source: soft/giet_vm/giet_libs/stdlib.h

Last change on this file was 777, checked in by meunier, 8 years ago
  • Ajout de quelques fonction dans la lib math
  • Déplacement de certaines fonctions de stdlib vers string
File size: 3.2 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///////////////////////////////////////////////////////////////////////////////////////
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///////////////////////////////////////////////////////////////////////////////////////
52unsigned 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///////////////////////////////////////////////////////////////////////////////////////
62unsigned int xprintf( char*        string,
63                      unsigned int length,
64                      char*        format,
65                      va_list*     args );
66               
67
68
69#endif
70
71
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
Note: See TracBrowser for help on using the repository browser.