2003-04-30 21:08:44 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2004-01-06 12:45:34 +00:00
|
|
|
* Copyright (C) 2001-2004 The ScummVM project
|
2003-04-30 21:08:44 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2003-04-30 11:37:10 +00:00
|
|
|
#ifndef STDLIB_H
|
|
|
|
#define STDLIB_H
|
|
|
|
|
|
|
|
#include <PalmOS.h>
|
2003-06-08 09:28:18 +00:00
|
|
|
#include "MemGlue.h"
|
2003-04-30 11:37:10 +00:00
|
|
|
|
2004-09-12 11:27:36 +00:00
|
|
|
extern ErrJumpBuf stdlib_errJumpBuf;
|
|
|
|
|
|
|
|
#define DO_EXIT( code ) \
|
|
|
|
if (ErrSetJump(stdlib_errJumpBuf) == 0) { code }
|
|
|
|
|
2003-04-30 11:37:10 +00:00
|
|
|
#define atoi StrAToI
|
|
|
|
#define atol StrAToI
|
|
|
|
#define abs(a) ((a) < 0 ? -(a) : (a))
|
|
|
|
//#define abs fabs
|
2003-06-08 09:28:18 +00:00
|
|
|
#define malloc(a) MemGluePtrNew(a)
|
2003-04-30 11:37:10 +00:00
|
|
|
//#define free MemPtrFree
|
2004-05-25 13:36:02 +00:00
|
|
|
//#define strtol(a,b,c) StrAToI(a)
|
2003-06-08 09:28:18 +00:00
|
|
|
#define qsort(a,b,c,d) SysQSort((a), (b), (c), (CmpFuncPtr)(&d), 0);
|
2003-04-30 11:37:10 +00:00
|
|
|
#define rand() SysRandom(0)
|
2004-01-20 14:33:03 +00:00
|
|
|
#define abort()
|
2004-05-25 13:36:02 +00:00
|
|
|
#define strtoul(a,b,c) ((unsigned long)strtol(a,b,c))
|
|
|
|
|
|
|
|
void *bsearch (const void *key, const void *base, UInt32 nmemb, UInt32 size, int (*compar)(const void *, const void *));
|
|
|
|
MemPtr calloc (UInt32 nelem, UInt32 elsize);
|
|
|
|
void exit (Int16 status);
|
|
|
|
Err free (MemPtr memP);
|
|
|
|
MemPtr realloc (MemPtr oldP, UInt32 size);
|
|
|
|
long strtol (const char *s, char **endptr, int base);
|
2003-04-30 11:37:10 +00:00
|
|
|
|
2004-01-20 14:33:03 +00:00
|
|
|
#endif
|