| [259] | 1 | ////////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // File : stdlib.h |
|---|
| 3 | // Date : 05/12/2013 |
|---|
| 4 | // Author : Clément DEVIGNE |
|---|
| 5 | // Copyright (c) UPMC-LIP6 |
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 7 | |
|---|
| [771] | 8 | #include <stdarg.h> |
|---|
| 9 | |
|---|
| [259] | 10 | #ifndef _STDLIB_H |
|---|
| 11 | #define _STDLIB_H |
|---|
| 12 | |
|---|
| [382] | 13 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [647] | 14 | // This function translates a character string to a signed integer. |
|---|
| [382] | 15 | // For a negative value, the first character must be a '-' (minus) character. |
|---|
| 16 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [580] | 17 | int atoi ( const char * str ); |
|---|
| [271] | 18 | |
|---|
| 19 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [580] | 20 | // This function translate a character string to a double. |
|---|
| 21 | // For a negative value, the first character must be a '-' (minus) character. |
|---|
| 22 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 23 | double atof ( const char * str ); |
|---|
| 24 | |
|---|
| 25 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [382] | 26 | // This function copies size bytes from the src source buffer |
|---|
| 27 | // to the dst destination buffer. |
|---|
| [271] | 28 | // GCC requires this function. Taken from MutekH. |
|---|
| 29 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [382] | 30 | void* memcpy( void* dst, |
|---|
| 31 | const void* src, |
|---|
| 32 | unsigned int size ); |
|---|
| [271] | 33 | |
|---|
| 34 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [382] | 35 | // This function initializes size bytes in the dst destination buffer, |
|---|
| 36 | // with the value defined by (char)s. |
|---|
| [271] | 37 | // GCC requires this function. Taken from MutekH. |
|---|
| 38 | //////////////////////////////////////////////////////////////////////////////////////// |
|---|
| [681] | 39 | void* memset( void* dst, |
|---|
| 40 | int s, |
|---|
| 41 | unsigned int size ); |
|---|
| [356] | 42 | |
|---|
| [647] | 43 | |
|---|
| [771] | 44 | /////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 45 | // This user function build a formated string. |
|---|
| 46 | // It analyse the <format> argument and uses the other arguments to returns |
|---|
| 47 | // a formated string in the <string> buffer. |
|---|
| 48 | // The <length> define the destination buffer size (bytes). |
|---|
| 49 | // It returns the number of written characters in case of success. |
|---|
| 50 | // It returns 0xFFFFFFFF in case of error (illegal format, or buffer overflow). |
|---|
| 51 | /////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 52 | unsigned int snprintf( char* string, |
|---|
| 53 | unsigned int length, |
|---|
| 54 | char* format, ... ); |
|---|
| 55 | |
|---|
| 56 | /////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 57 | // This service function is called by: |
|---|
| 58 | // - giet_fat_fprintf() |
|---|
| 59 | // - giet_tty_printf() |
|---|
| 60 | // - snprintf() |
|---|
| 61 | /////////////////////////////////////////////////////////////////////////////////////// |
|---|
| 62 | unsigned int xprintf( char* string, |
|---|
| 63 | unsigned int length, |
|---|
| 64 | char* format, |
|---|
| 65 | va_list* args ); |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|
| [259] | 69 | #endif |
|---|
| 70 | |
|---|
| [771] | 71 | |
|---|
| [259] | 72 | // Local Variables: |
|---|
| 73 | // tab-width: 4 |
|---|
| 74 | // c-basic-offset: 4 |
|---|
| 75 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
|---|
| 76 | // indent-tabs-mode: nil |
|---|
| 77 | // End: |
|---|
| 78 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
|---|