source: soft/giet_vm/giet_libs/stdlib.h @ 772

Last change on this file since 772 was 772, checked in by meunier, 8 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 4.3 KB
Line 
1//////////////////////////////////////////////////////////////////////////////////
2// File     : stdlib.h
3// Date     : 05/12/2013
4// Author   : Clément DEVIGNE
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#include <stdarg.h>
9
10#ifndef _STDLIB_H
11#define _STDLIB_H
12
13////////////////////////////////////////////////////////////////////////////////////////
14// This function translates a character string to a signed integer. 
15// For a negative value, the first character must be a '-' (minus) character.
16////////////////////////////////////////////////////////////////////////////////////////
17int atoi ( const char * str );
18
19////////////////////////////////////////////////////////////////////////////////////////
20// This function translate a character string to a double. 
21// For a negative value, the first character must be a '-' (minus) character.
22////////////////////////////////////////////////////////////////////////////////////////
23double atof ( const char * str );
24
25////////////////////////////////////////////////////////////////////////////////////////
26// This function copies size bytes from the src source buffer
27// to the dst destination buffer.
28// GCC requires this function. Taken from MutekH.
29////////////////////////////////////////////////////////////////////////////////////////
30void* memcpy( void*         dst, 
31              const void*   src, 
32              unsigned int  size );
33
34////////////////////////////////////////////////////////////////////////////////////////
35// This function initializes size bytes in the dst destination buffer,
36// with the value defined by (char)s.
37// GCC requires this function. Taken from MutekH.
38////////////////////////////////////////////////////////////////////////////////////////
39void* memset( void*        dst,
40              int          s,
41              unsigned int size );
42
43////////////////////////////////////////////////////////////////////////////////////////
44// This function returns the number of characters in a string.
45// The terminating NUL character is not taken into account.
46////////////////////////////////////////////////////////////////////////////////////////
47int strlen( const char* string );
48
49////////////////////////////////////////////////////////////////////////////////////////
50// This function compare the two s1 & s2 strings.
51// It returns 0 if strings are identical (including the terminating NUL character).
52// It returns 1 if they are not.
53////////////////////////////////////////////////////////////////////////////////////////
54int strcmp( const char* s1,
55            const char* s2 );
56
57////////////////////////////////////////////////////////////////////////////////////////
58// This function copies the source string to the dest string.
59// It returns a pointer on the dest string.
60////////////////////////////////////////////////////////////////////////////////////////
61char* strcpy( char* dest,
62              const char* source );
63
64///////////////////////////////////////////////////////////////////////////////////////
65// This user function build a formated string.
66// It analyse the <format> argument and uses the other arguments to returns
67// a formated string in the <string> buffer.
68// The <length> define the destination buffer size (bytes).
69// It returns the number of written characters in case of success.
70// It returns 0xFFFFFFFF in case of error (illegal format, or buffer overflow).
71///////////////////////////////////////////////////////////////////////////////////////
72unsigned int snprintf( char*        string,
73                       unsigned int length,
74                       char*        format, ... );
75
76///////////////////////////////////////////////////////////////////////////////////////
77// This service function is called by:
78// - giet_fat_fprintf()
79// - giet_tty_printf()
80// - snprintf()
81///////////////////////////////////////////////////////////////////////////////////////
82unsigned int xprintf( char*        string,
83                      unsigned int length,
84                      char*        format,
85                      va_list*     args );
86               
87
88
89#endif
90
91
92// Local Variables:
93// tab-width: 4
94// c-basic-offset: 4
95// c-file-offsets:((innamespace . 0)(inline-open . 0))
96// indent-tabs-mode: nil
97// End:
98// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
Note: See TracBrowser for help on using the repository browser.