Subversion Repositories shark

Rev

Rev 80 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/**
22
 ------------
925 pj 23
 CVS :        $Id: stdlib.h,v 1.4 2005-01-08 14:54:09 pj Exp $
2 pj 24
 
25
 File:        $File$
925 pj 26
 Revision:    $Revision: 1.4 $
27
 Last update: $Date: 2005-01-08 14:54:09 $
2 pj 28
 ------------
29
 
30
 stdlib.h
31
 
32
**/
33
 
34
/*
35
 * Copyright (C) 2000 Paolo Gai
36
 *
37
 * This program is free software; you can redistribute it and/or modify
38
 * it under the terms of the GNU General Public License as published by
39
 * the Free Software Foundation; either version 2 of the License, or
40
 * (at your option) any later version.
41
 *
42
 * This program is distributed in the hope that it will be useful,
43
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45
 * GNU General Public License for more details.
46
 *
47
 * You should have received a copy of the GNU General Public License
48
 * along with this program; if not, write to the Free Software
49
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
50
 *
51
 */
52
 
53
#ifndef __STDLIB_H__
54
#define __STDLIB_H__
55
 
56
#include <ll/stdlib.h>
57
#include <sys/types.h>
61 pj 58
#include <stddef.h>
80 pj 59
#include "ll/sys/cdefs.h"
2 pj 60
 
80 pj 61
__BEGIN_DECLS
62
 
61 pj 63
#define qsort _quicksort
64
 
2 pj 65
void abort(void);
66
int atexit(void (*function)(void));
67
void *calloc(size_t nelt, size_t eltsize);
68
void free(void *ptr);
69
void *malloc (size_t size);
70
void *realloc(void *ptr, size_t size);
71
 
72
/* This is not the correct behaviour of the function. Maybe someone will fix
73
   it; see kernel/kern.c */
925 pj 74
void exit(int status);
2 pj 75
void _exit(int status);
76
 
77
/* to implement!! */
61 pj 78
//char *getenv(const char *);
2 pj 79
 
80
/* not standard but required! */
81
long strtol (const char *, char **, int);
82
unsigned long strtoul (const char *, char **, int);
83
 
61 pj 84
/* StdLib QSort */
85
typedef int (*__compar_fn_t) (const void *, const void *);
86
extern void _quicksort (void *const pbase, size_t total_elems, size_t size, __compar_fn_t cmp);
87
extern void * bsearch (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *));
88
 
80 pj 89
__END_DECLS
2 pj 90
#endif