OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [stdlib.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* stdlib.h  <ndf@linux.mit.edu> */
2
#include <features.h>
3
#include <sys/types.h>
4
 
5
#ifndef __STDLIB_H
6
#define __STDLIB_H
7
 
8
/* Don't overwrite user definitions of NULL */
9
#ifndef NULL
10
#define NULL ((void *) 0)
11
#endif
12
 
13
/* For program termination */
14
#define EXIT_FAILURE 1
15
#define EXIT_SUCCESS 0
16
 
17
extern void * malloc __P ((size_t));
18
extern void * calloc __P ((size_t, size_t));
19
extern void free __P ((void *));
20
extern void * realloc __P ((void *, size_t));
21
 
22
#ifdef DEBUG_MALLOC
23
 
24
extern void * malloc_dbg __P ((size_t, char* func, char* file, int line));
25
extern void * calloc_dbg __P ((size_t, size_t, char* func, char* file, int line));
26
extern void free_dbg __P ((void *, char* func, char* file, int line));
27
extern void * realloc_dbg __P ((void *, size_t, char* func, char* file, int line));
28
 
29
#define malloc(x) malloc_dbg((x),__FUNCTION__,__FILE__,__LINE__)
30
#define calloc(x,y) calloc_dbg((x),(y),__FUNCTION__,__FILE__,__LINE__)
31
#define free(x) free_dbg((x),__FUNCTION__,__FILE__,__LINE__)
32
#define realloc(x) realloc((x),__FUNCTION__,__FILE__,__LINE__)
33
 
34
#endif
35
 
36
extern int rand __P ((void));
37
extern void srand __P ((unsigned int seed));
38
 
39
extern long strtol __P ((const char * nptr, char ** endptr, int base));
40
extern unsigned long strtoul __P ((const char * nptr,
41
                                   char ** endptr, int base));
42
#ifndef __HAS_NO_FLOATS__
43
extern float strtod __P ((const char * nptr, char ** endptr));
44
#endif
45
 
46
extern char *getenv __P ((__const char *__name));
47
 
48
extern int putenv __P ((__const char *__string));
49
 
50
extern int setenv __P ((__const char *__name, __const char *__value,
51
                        int __replace));
52
 
53
extern int system __P ((__const char *__command));
54
 
55
extern int qsort __P ((char *base, int num, int size, int (*cmp)()));
56
 
57
extern char * gcvt __P ((float number, size_t ndigit, char * buf));
58
 
59
#define atof(x) strtod((x),(char**)0)
60
 
61
/* Returned by `div'.  */
62
typedef struct
63
  {
64
    int quot;                   /* Quotient.  */
65
    int rem;                    /* Remainder.  */
66
  } div_t;
67
 
68
/* Returned by `ldiv'.  */
69
typedef struct
70
  {
71
    long int quot;              /* Quotient.  */
72
    long int rem;               /* Remainder.  */
73
  } ldiv_t;
74
 
75
#endif /* __STDLIB_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.