| 1 | ////////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // File : stdlib.h |
|---|
| 3 | // Date : 05/12/2013 |
|---|
| 4 | // Author : Clément DEVIGNE |
|---|
| 5 | // Copyright (c) UPMC-LIP6 |
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 7 | |
|---|
| 8 | #ifndef _STDLIB_H |
|---|
| 9 | #define _STDLIB_H |
|---|
| 10 | |
|---|
| 11 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 12 | // This function translates a character string to a signed integer. |
|---|
| 13 | // For a negative value, the first character must be a '-' (minus) character. |
|---|
| 14 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 15 | int atoi ( const char * str ); |
|---|
| 16 | |
|---|
| 17 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 18 | // This function translate a character string to a double. |
|---|
| 19 | // For a negative value, the first character must be a '-' (minus) character. |
|---|
| 20 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 21 | double atof ( const char * str ); |
|---|
| 22 | |
|---|
| 23 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 24 | // This function copies size bytes from the src source buffer |
|---|
| 25 | // to the dst destination buffer. |
|---|
| 26 | // GCC requires this function. Taken from MutekH. |
|---|
| 27 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 28 | void* memcpy( void* dst, |
|---|
| 29 | const void* src, |
|---|
| 30 | unsigned int size ); |
|---|
| 31 | |
|---|
| 32 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 33 | // This function initializes size bytes in the dst destination buffer, |
|---|
| 34 | // with the value defined by (char)s. |
|---|
| 35 | // GCC requires this function. Taken from MutekH. |
|---|
| 36 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 37 | inline void* memset( void* dst, |
|---|
| 38 | int s, |
|---|
| 39 | unsigned int size ); |
|---|
| 40 | |
|---|
| 41 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 42 | // This function returns the number of characters in a string. |
|---|
| 43 | // The terminating NUL character is not taken into account. |
|---|
| 44 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 45 | unsigned int strlen( char* string ); |
|---|
| 46 | |
|---|
| 47 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 48 | // This function compare the two s1 & s2 strings. |
|---|
| 49 | // It returns 0 if strings are identical (including the terminating NUL character). |
|---|
| 50 | // It returns 1 if they are not. |
|---|
| 51 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 52 | unsigned int strcmp( char* s1, |
|---|
| 53 | char* s2 ); |
|---|
| 54 | |
|---|
| 55 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 56 | // This function copies the source string to the dest string. |
|---|
| 57 | // It returns a pointer on the dest string. |
|---|
| 58 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 59 | char* strcpy( char* dest, |
|---|
| 60 | char* source ); |
|---|
| 61 | |
|---|
| 62 | #endif |
|---|
| 63 | |
|---|
| 64 | // Local Variables: |
|---|
| 65 | // tab-width: 4 |
|---|
| 66 | // c-basic-offset: 4 |
|---|
| 67 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
|---|
| 68 | // indent-tabs-mode: nil |
|---|
| 69 | // End: |
|---|
| 70 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
|---|