Use 'ao-dbg' instead of 's51' to communicate with TeleMetrum
[fw/sdcc] / doc / libdoc.txt
1 Not finished - 20 Jan 2002 - checkpoint (Steve Kenton)
2
3 This is a sorted (ignoring leading '_') list of the SDCC library.
4 Sources are in ~sdcc/device/lib/*.c and ~sdcc/device/include/*.h.
5 Except where denoted with MACRO these are implemented as functions.
6 Internal function calls are generated by the compiler to implement
7 IEEE floating point, etc.  They are not normally called directly.
8
9 isalnum - character classification - #include <ctype.h> - all ports
10         char isalnum (unsigned char c); MACRO
11         Return true if c is an ASCII letter or digit
12         'a-z','A-Z', '0'-'9' otherwise return false.
13
14 isalpha - character classification - #include <ctype.h> - all ports
15         char isalpha (unsigned char c); MACRO
16         Return true if c is an ASCII letter
17         'a-z','A-Z' otherwise return false.
18
19 isascii - character classification - #include <ctype.h> - missing
20         char isascii (unsigned char c);
21         Return true if c is an 7-bit ASCII character
22         0x00-0x7F otherwise return false.
23
24 iscntrl - character classification - #include <ctype.h> - all ports
25         char iscntrl (unsigned char c);
26         Return true if c is an ASCII control character
27         0x00-0x1F or 0x7F (DEL) otherwise return false.
28
29 isdigit - character classification - #include <ctype.h> - all ports
30         char isdigit (unsigned char c);
31         Return true if c is an ASCII digit '0'-'9'
32         otherwise return false.
33
34 isgraph - character classification - #include <ctype.h> - all ports
35         char isgraph (unsigned char c);
36         Return true is c is an ASCII printable graphic
37         excluding space 0x21-0x7E otherwise return false.
38
39 islower - character classification - #include <ctype.h> - all ports
40         char islower (unsigned char c);
41         Return true if c is an ASCII lower case letter
42         'a'-'z' otherwise return false.
43
44 isprint - character classification - #include <ctype.h> - all ports
45         char isprint (unsigned char c);
46         Return true is c is an ASCII printable graphic
47         including space 0x20-0x7E otherwise return false.
48
49 ispunct - character classification - #include <ctype.h> - all ports
50         char ispunct (unsigned char c);
51         Return true if c is ASCII punctuation (isgraph but not isalnum)
52         otherwise return false.
53
54 isspace - character classification - #include <ctype.h> - all ports
55         char isspace (unsigned char c);
56         Return true if c is an ASCII white space character
57         space, tab, carriage return, newline or vertical tab
58         0x09-0x0D, 0x20 otherwise return false.
59
60 isupper - character classification - #include <ctype.h> - all ports
61         char isupper (unsigned char c);
62         Return true if c is an ASCII upper case letter
63         'A'-'Z' otherwise return false.
64
65 isxdigit - character classification - #include <ctype.h> - all ports
66         char isxdigit (unsigned char c);
67         Return true if c is an ASCII hexidecimal digit
68         '0-9','a-f','A-F' otherwise return false.
69
70 toascii - character classification - #include <ctype.h> - all ports
71         char toascii(unsigned char c); MACRO
72         Convert c from 8-bit value to 7-bit ASCII.
73
74 tolower - character classification - #include <ctype.h> - all ports
75         char _tolower(unsigned char c); MACRO
76         char tolower(unsigned char c); MACRO
77         Convert c from upper case to lower case.
78
79 toupper - character classification - #include <ctype.h> - all ports
80         char _toupper(unsigned char c); MACRO
81         char toupper(unsigned char c); MACRO
82         Convert c from lower case to upper case.
83
84 __uchar2fs - IEEE single precision math - #include <float.h> - ??? ports
85         float __uchar2fs (unsigned char uc); INTERNAL
86         Convert an unsigned char to float.
87
88 __schar2fs - IEEE single precision math - #include <float.h> - ??? ports
89         float __schar2fs (signed char sc); INTERNAL
90         Convert a signed char to float.
91
92 __uint2fs - IEEE single precision math - #include <float.h> - ??? ports
93         float __uint2fs (unsigned int ui); INTERNAL
94         Convert an unsigned int to float.
95
96 __sint2fs - IEEE single precision math - #include <float.h> - ??? ports
97         float __sint2fs (signed int si); INTERNAL
98         Convert a signed int to float.
99
100 __ulong2fs - IEEE single precision math - #include <float.h> - ??? ports
101         float __ulong2fs (unsigned long ul); INTERNAL
102         Convert an unsigned log to float.
103
104 __slong2fs - IEEE single precision math - #include <float.h> - ??? ports
105         float __slong2fs (signed long sl); INTERNAL
106         Convert a signed long to float.
107
108 __fs2uchar - IEEE single precision math - #include <float.h> - ??? ports
109         unsigned char __fs2uchar (float f); INTERNAL
110         Convert a float to unsigned char;
111
112 __fs2schar - IEEE single precision math - #include <float.h> - ??? ports
113         signed char __fs2schar (float f); INTERNAL
114         Convert a float to signed char;
115
116 __fs2uint - IEEE single precision math - #include <float.h> - ??? ports
117         unsigned int __fs2uint (float f); INTERNAL
118         Convert a float to unsigned int;
119
120 __fs2sint - IEEE single precision math - #include <float.h> - ??? ports
121         signed int __fs2sint (float f); INTERNAL
122         Convert a float to signed int;
123
124 __fs2ulong - IEEE single precision math - #include <float.h> - ??? ports
125         unsigned long __fs2ulong (float f); INTERNAL
126         Convert a float to unsigned long;
127
128 __fs2slong - IEEE single precision math - #include <float.h> - ??? ports
129         signed long __fs2slong (float f); INTERNAL
130         Convert a float to signed long.
131
132 __fsadd - IEEE single precision math - #include <float.h> - ??? ports
133         float __fsadd (float a1, float a2); INTERNAL
134         Add two floats.
135
136 __fssub - IEEE single precision math - #include <float.h> - ??? ports
137         float __fssub (float a1, float a2); INTERNAL
138         Subtract two floats.
139
140 __fsmul - IEEE single precision math - #include <float.h> - ??? ports
141         float __fsmul (float a1, float a2); INTERNAL
142         Multiply two floats.
143
144 __fsdiv - IEEE single precision math - #include <float.h> - ??? ports
145         float __fsdiv (float a1, float a2); INTERNAL
146         Divide two floats.
147
148 __fslt - IEEE single precision math - #include <float.h> - ??? ports
149         char __fslt (float a1, float a2); INTERNAL
150         Compare two floats lt.
151
152 __fseq - IEEE single precision math - #include <float.h> - ??? ports
153         char __fseq (float a1, float a2); INTERNAL
154         Compare two floats eq.
155
156 __fsneq - IEEE single precision math - #include <float.h> - ??? ports
157         char __fseq (float a1, float a2); INTERNAL ??? missing in float.h ???
158         Compare two floats neq.
159
160 __fsgt - IEEE single precision math - #include <float.h> - ??? ports
161         char __fsgt (float a1, float a2); INTERNAL ??? typo in float.h ???
162         Compare two floats gt.
163
164 malloc - memory allocation - #include <malloc.h> - ??? ports
165         void *malloc (unsigned int);
166         void xdata * malloc (unsigned int );
167         Allocate a block of memory from the heap;
168
169 free - memory allocation - #include <malloc.h> - ??? ports
170         void free (void *p);
171         void free (void xdata *  p);
172         Return previously allocated memory to the heap.
173
174 init_dynamic_memory - memory allocation - #include <malloc.h> - ??? ports
175         void init_dynamic_memory (MEMHEADER xdata *  , unsigned int );
176         Initialize the memory allocation system.
177
178 sincosf - ANSI C math - #include <math.h> - all ports
179         float sincosf(const float x, const int iscos); INTERNAL
180         Compute the sine or cosine of x.
181
182 tancotf - ANSI C math - #include <math.h> - all ports
183         float tancotf(const float x, const int iscot); INTERNAL
184         Compute the tangent or cotangent of x.
185
186 asincosf - ANSI C math - #include <math.h> - all ports
187         float asincosf(const float x, const int isacos); INTERNAL
188         Compute the arc sine or arc cosine of x.
189
190 sincoshf - ANSI C math - #include <math.h> - all ports
191         float sincoshf(const float x, const int iscosh); INTERNAL
192         Compute the hyperbolic sine or hyperbolic cosine of x.
193
194 sinf - ANSI C math - #include <math.h> - all ports
195         float sinf (const float x);
196         Compute sine of x.
197
198 cosf - ANSI C math - #include <math.h> - all ports
199         float cosf (const float x);
200         Compute cosine of x.
201
202 tanf - ANSI C math - #include <math.h> - all ports
203         float tanf (const float x);
204         Compute tangent of x.
205
206 cotf - ANSI C math - #include <math.h> - all ports
207         float cotf (const float x);
208         Compute cotangent of x.
209
210 asinf - ANSI C math - #include <math.h> - all ports
211         float asinf (const float x);
212         Compute the arc sine of x.
213
214 acosf - ANSI C math - #include <math.h> - all ports
215         float acosf (const float x);
216         Compute the arc cosine of x.
217
218 atanf - ANSI C math - #include <math.h> - all ports
219         float atanf (const float x);
220         Compute the arc tangent of x.
221
222 atan2f - ANSI C math - #include <math.h> - all ports
223         float atan2f (const float x, const float y); ??? x,y reversed ???
224         Compute the arc tangent of (x/y);
225
226 sinhf - ANSI C math - #include <math.h> - all ports
227         float sinhf (const float x);
228         Compute the hyperbolic sine of x.
229
230 coshf - ANSI C math - #include <math.h> - all ports
231         float coshf (const float x);
232         Compute the hyperbolic cosine of x.
233
234 tanhf - ANSI C math - #include <math.h> - all ports
235         float tanhf (const float x);
236         Compute the hyperbolic tangent of x.
237
238 expf - ANSI C math - #include <math.h> - all ports
239         float expf (const float x);
240         Compute e to the x power.
241
242 logf - ANSI C math - #include <math.h> - all ports
243         float logf (const float x);
244         Compute log base e of x.
245
246 log10f - ANSI C math - #include <math.h> - all ports
247         float log10f (const float x);
248         Compute log base 10 of x.
249
250 powf - ANSI C math - #include <math.h> - all ports
251         float powf (const float x, const float y);
252         Compute x to y power.
253
254 sqrtf - ANSI C math - #include <math.h> - all ports
255         float sqrtf (const float x);
256         Compute the square root of x.
257
258 fabsf - ANSI C math - #include <math.h> - all ports
259         float fabsf (const float x);
260         Compute the absolute value of x.
261
262 frexpf - ANSI C math - #include <math.h> - all ports
263         float frexpf (const float x, int *pw2);
264         Split x in to mantissa and exponent parts.
265
266 ldexpf - ANSI C math - #include <math.h> - all ports
267         float ldexpf (const float x, const int pw2);
268         Combine mantissa and exponent parts of a float.
269
270 ceilf - ANSI C math - #include <math.h> - all ports
271         float ceilf (float x);
272         Find the smallest integer not less than x.
273
274 floorf - ANSI C math - #include <math.h> - all ports
275         float floorf (float x);
276         Find the largest integer not more than x.
277
278 modff - ANSI C math - #include <math.h> - all ports
279         float modff (float x, float * y);
280         Split x in to integer and fractional parts.
281
282 setjmp - long jump - #include <setjmp.h> - ??? ports
283         int setjmp (unsigned char * jmpb);
284         Save the return address and sufficient task state
285         to allow implementation of co-routines or error
286         handlers that unwind the stack using longjmp.
287         Returns 0, which is reserved and cannot be used
288         by longjmp.
289
290 longjmp - long jump - #include <setjmp.h> - ??? ports
291         int longjmp (unsigned char * jmpb, int retval);
292         Return to the the location and task state previously
293         save in the jump buffer.  Any integer number except 0
294         may be passed as retval.
295
296 stdio.h
297 /*-------------------------------------------------------------------------
298 printf_small - standard character I/O - #include <stdio.h> - all ports
299         void printf_small (char *,...);
300
301 printf - standard character I/O - #include <stdio.h> - all ports
302         int printf (const char *,...);
303
304 vprintf - standard character I/O - #include <stdio.h> - all ports
305         int vprintf (const char *, va_list);
306
307 sprintf - standard character I/O - #include <stdio.h> - all ports
308         int sprintf (const char *, const char *, ...);
309
310 vsprintf - standard character I/O - #include <stdio.h> - all ports
311         int vsprintf (const char *, const char *, va_list);
312
313 puts - standard character I/O - #include <stdio.h> - all ports
314         int puts(const char *);
315
316 gets - standard character I/O - #include <stdio.h> - all ports
317         char *gets(char *);
318
319 getchar - standard character I/O - #include <stdio.h> - all ports
320         char getchar(void);
321
322 putchar - standard character I/O - #include <stdio.h> - all ports
323         void putchar(char);
324
325 string.h
326 /*-------------------------------------------------------------------------
327 strcpy - string manipulation - #include <string.h> - all ports
328         char *strcpy (char * d, char * s);
329         Copy the nul terminated source string s to the destination d.
330
331 strncpy - string manipulation - #include <string.h> - all ports
332         char *strncpy(char * d, char * s, int n);
333         Copy the nul terminated source string s to the destination d but
334         do not copy more than n characters even if this causes d to not
335         be nul terminated.
336
337 strcat - string manipulation - #include <string.h> - all ports
338         char *strcat (char * front, char * back);
339         Copy the nul terminated string back to the end of the nul terminated
340         string front, overwriting the nul and creating a concatenation of
341         the two with a single trailing nul terminator.
342
343 strncat - string manipulation - #include <string.h> - all ports
344         char *strncat(char * front, char * back, int n);
345         Copy the nul terminated string back to the end of the nul terminated
346         string front, overwriting the nul and creating a concatenation of
347         the two, but do not copy more than n characters, even if this causes
348         the result to no be nul terminated.
349
350 strcmp - string manipulation - #include <string.h> - all ports
351         int   strcmp (char * asrc, char * adst);
352         Compare two nul terminated strings asrc and adst.  Return a value < 0 if asrc
353         is less than adst.  Return a value > 0 if asrc is greater than adst.  Otherwise
354         return 0.
355
356 strncmp - string manipulation - #include <string.h> - all ports
357         int   strncmp(char * asrc, char * adst, int n);
358         Compare two nul terminated strings asrc and adst but do not check more than n
359         characters.  Return a value < 0 if asrc is less than adst.  Return a value > 0
360         if asrc is greater than adst. Otherwise return 0.
361
362 strchr - string manipulation - #include <string.h> - all ports
363         char *strchr (char * string, char ch);
364         Return a pointer to the first occurrence of the character ch is string
365         or a NULL pointer if not found.
366
367 strrchr - string manipulation - #include <string.h> - all ports
368         char *strrchr(char * string, char ch);
369         Return a pointer to the last occurrence of the character ch is string
370         or a NULL pointer if not found.
371
372 strspn - string manipulation - #include <string.h> - all ports
373         int   strspn (char *, char *);
374
375 strcspn - string manipulation - #include <string.h> - all ports
376         int   strcspn(char *, char *);
377
378 strpbrk - string manipulation - #include <string.h> - all ports
379         char *strpbrk(char *, char *);
380
381 strstr - string manipulation - #include <string.h> - all ports
382         char *strstr (char *, char *);
383
384 strlen - string manipulation - #include <string.h> - all ports
385         int   strlen (char *  );
386
387 strtok - string manipulation - #include <string.h> - all ports
388         char *strtok (char *, char *);
389
390 memcpy - string manipulation - #include <string.h> - all ports
391         void *memcpy (void *, void *, int );
392
393 memcmp - string manipulation - #include <string.h> - all ports
394         int   memcmp (void *, void *, int );
395
396 memset - string manipulation - #include <string.h> - all ports
397         void *memset (void *, unsigned char  , int );
398
399 time.h
400 /*-------------------------------------------------------------------------
401
402 mktime - time and date - #include <time.h> - all ports
403         time_t mktime(struct tm *timeptr);
404
405 asctime - time and date - #include <time.h> - all ports
406         char *asctime(struct tm *timeptr);
407
408 ctime - time and date - #include <time.h> - all ports
409         char *ctime(time_t *timep);
410