1 /*-------------------------------------------------------------------------
2 stdlib.h - ANSI functions forward declarations
4 Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net
5 Ported to PIC16 port by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to the
19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22 As a special exception, if you link this library with other files,
23 some of which are compiled with SDCC, to produce an executable,
24 this library does not by itself cause the resulting executable to
25 be covered by the GNU General Public License. This exception does
26 not however invalidate any other reasons why the executable file
27 might be covered by the GNU General Public License.
28 -------------------------------------------------------------------------*/
31 #define __STDLIB_H__ 1
38 # define NULL (void *)0
41 #define RAND_MAX 0x7fffffff
45 long int labs (long int j
);
47 /* initialize random seed */
48 void srand (unsigned long seed
);
50 /* return a random number between 0 and RAND_MAX */
53 /* reentrant version of rand() */
54 long rand_r (unsigned long *ctx
);
56 /* returns the CRC16 checksum of the data buffer, takes as
57 * last argument an old value of crc16 checksum */
58 uint16_t crc16 (uint8_t *, uint32_t, uint16_t);
60 /* convert a ASCII string to float */
63 /* convert a ASCII string to integer */
66 /* convert a ASCII string to long */
69 long long int atoll (const char *);
71 /* convert an unsigned/signed integer to ASCII string */
72 void uitoa (unsigned int, __data
char *, unsigned char);
73 void itoa (int, __data
char*, unsigned char);
75 /* convert an unsigned/signed long integer to ASCII string */
76 void ultoa (unsigned long, __data
char *, unsigned char);
77 void ltoa (long, __data
char*, unsigned char);
79 /* helper functions: convert a float to ASCII string */
80 extern char x_ftoa (float, __data
char *, unsigned char, unsigned char);
82 /* George M. Gallant's version of ftoa() */
83 extern void g_ftoa (__data
char *, float, char);
86 #endif /* __STDLIB_H__ */