1 /*-------------------------------------------------------------------------
2 stdlib.h - ANSI functions forward declarations
4 Ported to PIC16 port by Vangelis Rokas, 2004 (vrokas@otenet.gr)
6 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
8 This program is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 2, or (at your option) any
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 In other words, you are welcome to use, share and improve this program.
23 You are forbidden to forbid anyone else to use, share and improve
24 what you give them. Help stamp out software-hoarding!
25 -------------------------------------------------------------------------*/
32 #define __STDLIB_H__ 1
40 # define NULL (void *)0
43 #define RAND_MAX 0x7fffffff
45 /* initialize random seed */
46 void srand(unsigned long seed);
48 /* return a random number between 0 and RAND_MAX */
51 /* reentrant version of rand() */
52 long rand_r(unsigned long *ctx);
55 /* returns the CRC16 checksum of the data buffer, takes as
56 * last argument an old value of crc16 checksum */
57 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 /* convert an unsigned/signed integer to ASCII string */
70 void uitoa(unsigned int, __data char *, unsigned char);
71 void itoa(int, __data char*, unsigned char);
73 /* convert an unsigned/signed long integer to ASCII string */
74 void ultoa(unsigned long, __data unsigned char *, unsigned char);
75 void ltoa(long, __data unsigned char*, unsigned char);
77 /* helper functions: convert a float to ASCII string */
78 extern char x_ftoa(float, __data char *, unsigned char, unsigned char);
80 /* George M. Gallant's version of ftoa() */
81 extern void g_ftoa(__data char *, float, char);
84 #endif /* __STDLIB_H__ */