OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [language/] [c/] [libc/] [string/] [v2_0/] [include/] [stringsupp.hxx] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_LIBC_STRING_STRINGSUPP_HXX
2
#define CYGONCE_LIBC_STRING_STRINGSUPP_HXX
3
//===========================================================================
4
//
5
//      stringsupp.hxx
6
//
7
//      Support for the ANSI standard string functions
8
//
9
//===========================================================================
10
//####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later version.
18
//
19
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
// for more details.
23
//
24
// You should have received a copy of the GNU General Public License along
25
// with eCos; if not, write to the Free Software Foundation, Inc.,
26
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
//
28
// As a special exception, if other files instantiate templates or use macros
29
// or inline functions from this file, or you compile this file and link it
30
// with other works to produce a work based on this file, this file does not
31
// by itself cause the resulting work to be covered by the GNU General Public
32
// License. However the source code for this file must still be made available
33
// in accordance with section (3) of the GNU General Public License.
34
//
35
// This exception does not invalidate any other reasons why a work based on
36
// this file might be covered by the GNU General Public License.
37
//
38
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
// at http://sources.redhat.com/ecos/ecos-license/
40
// -------------------------------------------
41
//####ECOSGPLCOPYRIGHTEND####
42
//===========================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):     jlarmour
46
// Contributors:  jlarmour
47
// Date:          2000-04-14
48
// Purpose:       Internal support for the libc string function implementations
49
// Description:
50
// Usage:
51
//
52
//####DESCRIPTIONEND####
53
//
54
//===========================================================================
55
 
56
// CONFIGURATION
57
 
58
#include    // Configuration header
59
 
60
// INCLUDES
61
 
62
#include  // Common type definitions
63
#include              // Compiler definitions such as
64
                                // size_t, NULL etc.
65
 
66
// CONSTANTS
67
 
68
#ifndef CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST
69
 
70
// Masks for CYG_LIBC_STR_DETECTNULL below
71
externC const cyg_uint64 Cyg_libc_str_null_mask_1;
72
externC const cyg_uint64 Cyg_libc_str_null_mask_2;
73
 
74
#endif
75
 
76
// MACROS
77
 
78
// Nonzero if X is not aligned on a word boundary.
79
#define CYG_LIBC_STR_UNALIGNED(X) ((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1))
80
 
81
// Nonzero if either X or Y is not aligned on a word boundary.
82
#define CYG_LIBC_STR_UNALIGNED2(X , Y) \
83
    (((CYG_WORD)(X) & (sizeof (CYG_WORD) - 1)) | \
84
     ((CYG_WORD)(Y) & (sizeof (CYG_WORD) - 1)))
85
 
86
// Nonzero if any byte of X contains a NULL.
87
#define CYG_LIBC_STR_DETECTNULL(X) \
88
    (((X) - (CYG_WORD)Cyg_libc_str_null_mask_1) & \
89
     ~(X) & (CYG_WORD)Cyg_libc_str_null_mask_2)
90
 
91
// How many bytes are copied each iteration of the 4X unrolled loop in the
92
// optimised string implementations
93
#define CYG_LIBC_STR_OPT_BIGBLOCKSIZE     (sizeof(CYG_WORD) << 2)
94
 
95
// How many bytes are copied each iteration of the word copy loop in the
96
// optimised string implementations
97
#define CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE  (sizeof (CYG_WORD))
98
 
99
// Threshold for punting to the byte copier in the optimised string
100
// implementations
101
#define CYG_LIBC_STR_OPT_TOO_SMALL(LEN) \
102
    ((LEN) < CYG_LIBC_STR_OPT_LITTLEBLOCKSIZE)
103
 
104
 
105
// FUNCTION PROTOTYPES
106
 
107
// These are function prototypes for the aliased functions that actually
108
// implement the string functions
109
 
110
//===========================================================================
111
 
112
// 7.11.2 Copying functions
113
 
114
externC void *
115
__memmove( void *, const void *, size_t );
116
 
117
 
118
externC char *
119
__strcpy( char *, const char * );
120
 
121
 
122
externC char *
123
__strncpy( char *, const char *, size_t );
124
 
125
 
126
//===========================================================================
127
 
128
// 7.11.3 Concatenation functions
129
 
130
 
131
externC char *
132
__strcat( char *, const char * );
133
 
134
 
135
externC char *
136
__strncat( char *, const char *, size_t );
137
 
138
 
139
//===========================================================================
140
 
141
// 7.11.4 Comparison functions
142
 
143
externC int
144
__memcmp( const void *, const void *, size_t );
145
 
146
 
147
externC int
148
__strcmp( const char *, const char * );
149
 
150
 
151
externC int
152
__strcoll( const char *, const char * );
153
 
154
 
155
externC int
156
__strncmp( const char *, const char *, size_t );
157
 
158
 
159
externC size_t
160
__strxfrm( char *, const char *, size_t );
161
 
162
 
163
//===========================================================================
164
 
165
// 7.11.5 Search functions
166
 
167
 
168
externC void *
169
__memchr( const void *, int , size_t );
170
 
171
 
172
externC char *
173
__strchr( const char *, int );
174
 
175
 
176
externC size_t
177
__strcspn( const char *, const char * );
178
 
179
 
180
externC char *
181
__strpbrk( const char *, const char * );
182
 
183
 
184
externC char *
185
__strrchr( const char *, int );
186
 
187
 
188
externC size_t
189
__strspn( const char *, const char * );
190
 
191
 
192
externC char *
193
__strstr( const char *, const char * );
194
 
195
 
196
externC char *
197
__strtok( char *, const char * );
198
 
199
// For POSIX 1003.1 section 8.3.3 strtok_r()
200
 
201
externC char *
202
__strtok_r( char *, const char *, char ** );
203
 
204
 
205
//===========================================================================
206
 
207
// 7.11.6 Miscellaneous functions
208
 
209
externC size_t
210
__strlen( const char * );
211
 
212
#endif // CYGONCE_LIBC_STRING_STRINGSUPP_HXX multiple inclusion protection
213
 
214
// EOF stringsupp.hxx

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.