[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src/missing _stdio.cpp,NONE,1.1 _stdlib.cpp,NONE,1.1 _string.cpp,NONE,1.1 _time.cpp,NONE,1.1 _unistd.cpp,NONE,1.1 assert.h,NONE,1.1 fcntl.h,NONE,1.1 math.h,NONE,1.1 stdio.h,NONE,1.1 stdlib.h,NONE,1.1 string.h,NONE,1.1 time.h,NONE,1.1 unistd.h,NONE,1.1
Max Horn
fingolfin at users.sourceforge.net
Wed Apr 30 04:34:08 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Rsc Starter.rsrc,NONE,1.1 StarterRsc.h,NONE,1.1
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src extend.cpp,NONE,1.1 extend.h,NONE,1.1 extras.cpp,NONE,1.1 extras.h,NONE,1.1 globals.h,NONE,1.1 init.cpp,NONE,1.1 palm.cpp,NONE,1.1 palm.h,NONE,1.1 palmsave.cpp,NONE,1.1 palmstart.cpp,NONE,1.1 saveslot.cpp,NONE,1.1 scumm_globals.h,NONE,1.1 skin.h,NONE,1.1 vibrate.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing
In directory sc8-pr-cvs1:/tmp/cvs-serv1788/Src/missing
Added Files:
_stdio.cpp _stdlib.cpp _string.cpp _time.cpp _unistd.cpp
assert.h fcntl.h math.h stdio.h stdlib.h string.h time.h
unistd.h
Log Message:
started to merge in Chrilith's PalmOS port
--- NEW FILE: _stdio.cpp ---
#include "stdio.h"
#include "extend.h"
///////////////////////////////////////////////////////////////////////////////
//FileRef gLogFile;
static void DrawStatus(Boolean show)
{
UInt8 x,y;
UInt8 *screen = (UInt8 *)(BmpGetBits(WinGetBitmap(WinGetDisplayWindow())));
UInt8 color = (show? gVars->indicator.on : gVars->indicator.off);
if (gVars->screenLocked)
if (screen == gVars->flipping.pageAddr1)
screen = gVars->flipping.pageAddr2;
else
screen = gVars->flipping.pageAddr1;
screen += 320 + 305;
for(y=0;y<3;y++)
{
for(x=0;x<14;x++)
screen[x] = color;
screen += 319;
}
}
///////////////////////////////////////////////////////////////////////////////
UInt16 fclose(FileRef *stream)
{
Err error = VFSFileClose(*stream);
if (error == errNone)
MemPtrFree(stream);
#ifdef DEBUG
FrmCustomAlert(FrmWarnAlert,"error fclose",0,0);
#endif
return error;
}
///////////////////////////////////////////////////////////////////////////////
UInt16 feof(FileRef *stream)
{
Err error = VFSFileEOF(*stream);
#ifdef DEBUG
switch (error)
{
case vfsErrFileEOF:
FrmCustomAlert(FrmWarnAlert,"vfsErrFileEOF",0,0);
break;
case expErrNotOpen:
FrmCustomAlert(FrmWarnAlert,"expErrNotOpen",0,0);
break;
case vfsErrFileBadRef:
FrmCustomAlert(FrmWarnAlert,"vfsErrFileBadRef",0,0);
break;
case vfsErrIsADirectory:
FrmCustomAlert(FrmWarnAlert,"vfsErrIsADirectory",0,0);
break;
case vfsErrNoFileSystem:
FrmCustomAlert(FrmWarnAlert,"vfsErrNoFileSystem",0,0);
break;
}
#endif
return error;
}
///////////////////////////////////////////////////////////////////////////////
Char *fgets(Char *s, UInt32 n, FileRef *stream)
{
UInt32 numBytesRead;
DrawStatus(true);
Err error = VFSFileRead(*stream, n, s, &numBytesRead);
DrawStatus(false);
if (error == errNone || error == vfsErrFileEOF) {
UInt32 reset = 0;
Char *endLine = StrChr(s, '\n');
if (endLine >= s) {
reset = (endLine - s);
s[reset] = 0;
reset = numBytesRead - (reset + 1);
VFSFileSeek(*stream, vfsOriginCurrent, -reset);
}
return s;
}
#ifdef DEBUG
switch (error)
{
case expErrNotOpen:
FrmCustomAlert(FrmWarnAlert,"expErrNotOpen",0,0);
break;
case vfsErrFileBadRef:
FrmCustomAlert(FrmWarnAlert,"vfsErrFileBadRef",0,0);
break;
case vfsErrFileEOF:
FrmCustomAlert(FrmWarnAlert,"vfsErrFileEOF",0,0);
break;
case vfsErrFilePermissionDenied:
FrmCustomAlert(FrmWarnAlert,"vfsErrFilePermissionDenied",0,0);
break;
case vfsErrIsADirectory:
FrmCustomAlert(FrmWarnAlert,"vfsErrIsADirectory",0,0);
break;
case vfsErrNoFileSystem:
FrmCustomAlert(FrmWarnAlert,"vfsErrNoFileSystem",0,0);
break;
}
#endif
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
FileRef *fopen(const Char *filename, const Char *type)
{
Err err;
UInt16 openMode;
FileRef *fileRefP = (FileRef *)MemPtrNew(sizeof(FileRef *));
if (StrCompare(type,"r")==0)
openMode = vfsModeRead;
else if (StrCompare(type,"rb")==0)
openMode = vfsModeRead;
else if (StrCompare(type,"w")==0)
openMode = vfsModeCreate|vfsModeWrite;
else if (StrCompare(type,"wb")==0)
openMode = vfsModeCreate|vfsModeWrite;
else
openMode = vfsModeReadWrite;
if (openMode & vfsModeRead) {
// if read file :
// first try to load from the specfied card
err = VFSFileOpen (gVars->volRefNum, filename, openMode, fileRefP);
//if err (not found ?) parse each avalaible card for the specified file
if (err) {
UInt16 volRefNum;
UInt32 volIterator = vfsIteratorStart;
while (volIterator != vfsIteratorStop) {
err = VFSVolumeEnumerate(&volRefNum, &volIterator);
if (!err) {
err = VFSFileOpen (volRefNum, filename, openMode, fileRefP);
if (!err)
return fileRefP;
}
}
} else {
return fileRefP;
}
} else {
// if write file :
// use only the specified card
// FIXME : vfsModeCreate|vfsModeWrite will failed on OS3.5 Clié
err = VFSFileDelete(gVars->volRefNum, filename); // delete it if exists
err = VFSFileCreate(gVars->volRefNum, filename);
openMode = vfsModeWrite;
if (!err) {
err = VFSFileOpen (gVars->volRefNum, filename, openMode, fileRefP);
if (!err)
return fileRefP;
}
}
#ifdef DEBUG
else
{
switch (err)
{
case expErrCardReadOnly:
FrmCustomAlert(FrmWarnAlert,"expErrCardReadOnly",0,0);
break;
case expErrNotOpen:
FrmCustomAlert(FrmWarnAlert,"expErrNotOpen",0,0);
break;
case vfsErrBadName:
FrmCustomAlert(FrmWarnAlert,"vfsErrBadName",0,0);
break;
case vfsErrFileNotFound:
FrmCustomAlert(FrmWarnAlert,"vfsErrFileNotFound",0,0);
break;
case vfsErrFilePermissionDenied:
FrmCustomAlert(FrmWarnAlert,"vfsErrFilePermissionDenied",0,0);
break;
case vfsErrVolumeBadRef:
FrmCustomAlert(FrmWarnAlert,"vfsErrVolumeBadRef",0,0);
break;
default:
FrmCustomAlert(FrmWarnAlert,"unknow",0,0);
break;
}
}
#endif
MemPtrFree(fileRefP); // prevent memory leak
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
UInt32 fread(void *ptr, UInt32 size, UInt32 nitems, FileRef *stream)
{
UInt32 numBytesRead;
DrawStatus(true);
Err error = VFSFileRead(*stream, size*nitems, ptr, &numBytesRead);
DrawStatus(false);
if (error == errNone || error == vfsErrFileEOF)
return (UInt32)(numBytesRead/size);
#ifdef DEBUG
switch (error)
{
case expErrNotOpen:
FrmCustomAlert(FrmWarn,"expErrNotOpen",0,0);
break;
case vfsErrFileBadRef:
FrmCustomAlert(FrmWarn,"vfsErrFileBadRef",0,0);
break;
case vfsErrFileEOF:
FrmCustomAlert(FrmWarn,"vfsErrFileEOF",0,0);
break;
case vfsErrFilePermissionDenied:
FrmCustomAlert(FrmWarn,"vfsErrFilePermissionDenied",0,0);
break;
case vfsErrIsADirectory:
FrmCustomAlert(FrmWarn,"vfsErrIsADirectory",0,0);
break;
case vfsErrNoFileSystem:
FrmCustomAlert(FrmWarn,"vfsErrNoFileSystem",0,0);
break;
}
#endif
return 0;
}
///////////////////////////////////////////////////////////////////////////////
UInt32 fwrite(const void *ptr, UInt32 size, UInt32 nitems, FileRef *stream)
{
UInt32 numBytesWritten;
DrawStatus(true);
Err error = VFSFileWrite(*stream, size*nitems, ptr, &numBytesWritten);
DrawStatus(false);
if (error == errNone || error == vfsErrFileEOF)
return (UInt32)(numBytesWritten/size);
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
Int32 fseek(FileRef *stream, Int32 offset, Int32 whence)
{
Err error = VFSFileSeek(*stream, whence, offset);
return error;
}
///////////////////////////////////////////////////////////////////////////////
UInt32 ftell(FileRef *stream)
{
Err e;
UInt32 filePos;
e = VFSFileTell(*stream,&filePos);
if (e != errNone)
return e;
return filePos;
}
///////////////////////////////////////////////////////////////////////////////
UInt16 fprintf(FileRef *stream, const Char *format, ...)
{
if (!*stream)
return 0;
UInt32 numBytesWritten;
Char buf[256];
va_list va;
va_start(va, format);
vsprintf(buf, format, va);
va_end(va);
VFSFileWrite (*stream, StrLen(buf), buf, &numBytesWritten);
return numBytesWritten;
}
///////////////////////////////////////////////////////////////////////////////
Int16 printf(const Char *format, ...)
{
if (!*stdout)
return 0;
UInt32 numBytesWritten;
Char buf[256];
// Char *buf = (Char *)MemPtrNew(256);
va_list va;
va_start(va, format);
vsprintf(buf, format, va);
va_end(va);
VFSFileWrite (*stdout, StrLen(buf), buf, &numBytesWritten);
// MemPtrFree(buf);
return numBytesWritten;
}
///////////////////////////////////////////////////////////////////////////////
Int16 sprintf(Char* s, const Char* formatStr, ...)
{
Char buf[256];
// Char *buf = (Char *)MemPtrNew(256);
Int16 count;
va_list va;
va_start(va, formatStr);
count = vsprintf(buf, formatStr, va);
va_end(va);
StrCopy(s,buf);
// MemPtrFree(buf);
return count;
}
///////////////////////////////////////////////////////////////////////////////
Int16 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam)
{
Char format[256];
// TODO : need a better modifier
StrCopy(format,formatStr);
StrReplace(format, 256, "%ld", "%d");
StrReplace(format, 256, "%li", "%i");
StrReplace(format, 256, "%lx", "%x");
StrReplace(format, 256, "%lx", "%X");
StrReplace(format, 256, "%2ld", "%2d");
StrReplace(format, 256, "%03ld","%.3d");
StrReplace(format, 256, "%02ld","%.2d");
StrReplace(format, 256, "%01ld","%.1d");
StrReplace(format, 256, "%02ld","%02d");
StrReplace(format, 256, "%2ld","%2d");
StrReplace(format, 256, "%3ld","%3d");
StrReplace(format, 256, "%4ld","%4d");
StrReplace(format, 256, "%5ld","%5d");
StrReplace(format, 256, "%6ld","%6d");
StrReplace(format, 256, "%02lx","%02x");
return StrVPrintF(s, format, argParam);;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
--- NEW FILE: _stdlib.cpp ---
#include "stdlib.h"
#include "MemGlue.h"
///////////////////////////////////////////////////////////////////////////////
/*void qsort(void *base, UInt32 nmemb, UInt32 size, ComparF *compar) {
SysQSort(base, nmemb, size, compar);
}*/
///////////////////////////////////////////////////////////////////////////////
void *bsearch(const void *key, const void *base, UInt32 nmemb,
UInt32 size, int (*compar)(const void *, const void *)) {
UInt32 i;
for (i=0; i<nmemb; i++)
if (compar(key, (void*)((UInt32)base + size * i)) == 0)
return (void*)((UInt32)base + size * i);
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
static DmOpenRef gExtMemory = NULL;
static UInt16 MemFindHeapID(UInt32 size)
{
UInt32 nFree, maxChunk ;
UInt16 maxCards = 1; //MemNumCards(); process only first card for now
UInt16 heapID = -1; // no heap avaliable
UInt16 cardNo;
UInt16 maxHeaps, heapIndex;
for (cardNo = 0; cardNo < maxCards; cardNo++)
{
if (MemNumRAMHeaps(cardNo) > 0)
{
maxHeaps = MemNumHeaps(cardNo);
for (heapIndex = 0; heapIndex < maxHeaps; heapIndex++)
{
// Obtain the ID of the heap.
heapID = MemHeapID(cardNo, heapIndex);
if (!(MemHeapFlags(heapID) & memHeapFlagReadOnly))
{
MemHeapFreeBytes( heapID, &nFree, &maxChunk );
if (maxChunk > size)
return heapID;
}
}
}
}
return heapID;
}
void MemExtInit()
{
if (!gExtMemory)
{
LocalID localID = DmFindDatabase(0, "ScummVM-Memory");
if (localID) DmDeleteDatabase(0, localID);
if (DmCreateDatabase (0, "ScummVM-Memory", 'ScVM', 'DATA', false) != errNone)
return;
localID = DmFindDatabase(0, "ScummVM-Memory");
gExtMemory = DmOpenDatabase(0, localID, dmModeReadWrite|dmModeExclusive);
}
}
void MemExtCleanup()
{
if (gExtMemory) {
DmCloseDatabase(gExtMemory);
LocalID localID = DmFindDatabase(0, "ScummVM-Memory");
if (localID)
DmDeleteDatabase(0, localID);
}
}
//#define USE_EXTENDEDMEM
#ifdef USE_EXTENDEDMEM
MemPtr calloc(UInt32 nelem, UInt32 elsize)
{
UInt32 size = nelem*elsize;
MemPtr newP = NULL;
UInt16 heapID = MemFindHeapID(size);
if (heapID != NO_HEAP_FOUND)
{
if (MemHeapDynamic(heapID) && size < 65536-8) // 8 = chunk header size
newP = MemPtrNew(size);
else
{
SysAppInfoPtr appInfoP;
UInt16 ownerID, large, nmovable;
UInt16 attr;
ownerID = ((SysAppInfoPtr)SysGetAppInfo(&appInfoP, &appInfoP))->memOwnerID;
large = ((size > 65536-8) ? memNewChunkFlagAllowLarge : 0);
nmovable= (MemHeapDynamic(heapID) ? memNewChunkFlagNonMovable : memNewChunkFlagPreLock);
attr = ownerID|large|nmovable;
//MEMORY_RESERVE_ACCESS
newP = MemChunkNew(heapID, size, attr);
//MEMORY_RELEASE_ACCESS
if (newP && MemPtrDataStorage(newP)) { // if storage heap ?
if (!gExtMemory) { // if memory DB doesn't exist
MemChunkFree(newP);
return NULL;
}
UInt16 index = dmMaxRecordIndex; // used for record purpose
MemHandle newH = MemPtrRecoverHandle(newP); // exists
if (DmAttachRecord(gExtMemory, &index, newH, NULL) != errNone) // attach to DB
{
MemChunkFree(newP); // error
return NULL;
}
}
}
}
if (newP)
MemSet(newP,size,0);
return newP;
}
#else
MemPtr calloc(UInt32 nelem, UInt32 elsize)
{
UInt32 size = nelem*elsize;
MemPtr newP = NULL;
/* if (size < 65536-8) // 8 = chunk header size
newP = MemPtrNew(size);
else*/
/* {
SysAppInfoPtr appInfoP;
UInt16 ownerID;
UInt16 attr;
ownerID = ((SysAppInfoPtr)SysGetAppInfo(&appInfoP, &appInfoP))->memOwnerID;
attr = ownerID|memNewChunkFlagAllowLarge|memNewChunkFlagNonMovable;
newP = MemChunkNew(0, size, attr);
}
*/
newP = MemGluePtrNew(size);
if (newP)
MemSet(newP,size,0);
return newP;
}
#endif
///////////////////////////////////////////////////////////////////////////////
#ifdef USE_EXTENDEDMEM
Err free(MemPtr memP)
{
Err err = memErrInvalidParam;
if (!memP)
return err;
if (MemPtrDataStorage(memP)) { // if storage heap ?
if (gExtMemory) { // if memory DB exists
DmOpenRef where;
MemHandle newH = MemPtrRecoverHandle(memP);
UInt16 index = DmSearchRecord(newH, &where);
err = DmRemoveRecord(gExtMemory, index);
}
}
else
err = MemChunkFree(memP);
return err;
}
#else
Err free(MemPtr memP)
{
if (memP)
return MemPtrFree(memP);
return memErrInvalidParam;
}
#endif
///////////////////////////////////////////////////////////////////////////////
MemPtr realloc(MemPtr oldP, UInt32 size)
{
if (oldP != NULL)
if (MemPtrResize(oldP,size) == 0)
return oldP;
MemPtr newP = MemPtrNew(size);
if (oldP!=NULL)
{
MemMove(newP,oldP,MemPtrSize(oldP));
MemPtrFree(oldP);
}
return newP;
}
///////////////////////////////////////////////////////////////////////////////
void exit(Int16 status)
{
// need to change this
EventType event;
event.eType = appStopEvent;
EvtAddEventToQueue (&event);
}
--- NEW FILE: _string.cpp ---
#include "string.h"
Char *StrTokNext;
///////////////////////////////////////////////////////////////////////////////
Char *strtok(Char *str, const Char *sep)
{
Char *position = NULL,
*found,
*end;
UInt16 loop = 0,
chars= StrLen(sep);
str = (str)?(str):(StrTokNext);
StrTokNext = NULL;
if (!str)
return NULL;
end = str+StrLen(str);
while (loop<chars)
{
found = StrChr(str,sep[loop]);
loop++;
if (found == str)
{
str++;
loop = 0;
}
else if (position == NULL || position > found)
position = found;
}
if (position == NULL)
if (str==end)
return NULL;
else
return str;
position[0] = 0;
StrTokNext = position+1;
return str;
}
///////////////////////////////////////////////////////////////////////////////
Char *strpbrk(const Char *s1, const Char *s2)
{
Char *found;
UInt32 n;
for (n=0; n <= StrLen(s2); n++) {
found = StrChr(s1, s2[n]);
if (found)
return found;
}
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
Char *strrchr(const Char *s, int c)
{
UInt32 chr;
UInt32 n = StrLen(s);
for(chr = n; chr >= 0; chr--)
if ( *((UInt8 *)s+chr) == c)
return (Char *)(s+chr);
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
Char *strdup(const Char *s1)
{
Char* buf = (Char *)MemPtrNew(StrLen(s1)+1);
if(buf)
StrCopy(buf, s1);
return buf;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
--- NEW FILE: _time.cpp ---
#include "time.h"
// ignore GMT, only device time
time_t time(time_t *tloc) {
UInt32 secs = TimGetSeconds(); // since 1/1/1904 12AM.
DateTimeType Epoch = {0, 0, 0, 1, 1, 1970, 0}; // form 1/1/1904 12AM to 1/1/1970 12AM
secs -= TimDateTimeToSeconds (&Epoch);
if (tloc)
*tloc = secs;
return (secs);
}
struct tm *localtime(const time_t *timer) {
static struct tm tmDate;
DateTimeType dt;
UInt32 secs = *timer;
DateTimeType Epoch = {0, 0, 0, 1, 1, 1970, 0}; // form 1/1/1904 12AM to 1/1/1970 12AM
// timer supposed to be based on Epoch
secs += TimDateTimeToSeconds(&Epoch);
TimSecondsToDateTime (secs, &dt);
tmDate.tm_sec = dt.second;
tmDate.tm_min = dt.minute;
tmDate.tm_hour = dt.hour;
tmDate.tm_mday = dt.day;
tmDate.tm_mon = dt.month;
tmDate.tm_year = dt.year;
tmDate.tm_wday = dt.weekDay;
return &tmDate;
}
--- NEW FILE: _unistd.cpp ---
#include "unistd.h"
#include "extend.h" // for SCUMMVM_SAVEPATH
// currently used only to retreive savepath
Char *getcwd(Char *buf, UInt32 size) {
Char *copy = buf;
if (!copy)
copy = (Char *)MemPtrNew(StrLen(SCUMMVM_SAVEPATH)); // this may never occured
StrCopy(copy, SCUMMVM_SAVEPATH);
return copy;
}
--- NEW FILE: assert.h ---
#define assert(a)
--- NEW FILE: fcntl.h ---
/* nothing */
--- NEW FILE: math.h ---
#include "mathlib.h"
--- NEW FILE: stdio.h ---
#include <PalmOS.h>
#include <VFSMgr.h>
#include <stdarg.h>
#include "globals.h"
//extern UInt16 gVolRefNum;
//extern FileRef gLogFile;
typedef FileRef FILE;
#define stdin 0
#define stdout (&gVars->logFile)
#define stderr (&gVars->logFile)
#define clearerr(a)
#define fflush(a)
#define vsnprintf(a,b,c,d) vsprintf(a,c,d)
#define SEEK_SET vfsOriginBeginning
#define SEEK_CUR vfsOriginCurrent
#define SEEK_END vfsOriginEnd
UInt16 fclose(FileRef *stream);
UInt16 feof(FileRef *stream);
Char *fgets(Char *s, UInt32 n, FileRef *stream);
FileRef *fopen(const Char *filename, const Char *type);
UInt32 fread(void *ptr, UInt32 size, UInt32 nitems, FileRef *stream);
UInt32 fwrite(const void *ptr, UInt32 size, UInt32 nitems, FileRef *stream);
Int32 fseek(FileRef *stream, Int32 offset, Int32 whence);
UInt32 ftell(FileRef *stream);
UInt16 fprintf(FileRef *stream, const Char *format, ...);
Int16 printf(const Char* formatStr, ...);
Int16 sprintf(Char* s, const Char* formatStr, ...);
Int16 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam);
--- NEW FILE: stdlib.h ---
#ifndef STDLIB_H
#define STDLIB_H
#include <PalmOS.h>
#include "mathlib.h"
//#define memNewChunkFlagNonMovable 0x0200
#define memNewChunkFlagAllowLarge 0x1000 // this is not in the sdk *g*
#define memHeapFlagReadOnly 0x0001
#define NO_HEAP_FOUND -1
SysAppInfoPtr SysGetAppInfo(SysAppInfoPtr *uiAppPP, SysAppInfoPtr *actionCodeAppPP)
SYS_TRAP(sysTrapSysGetAppInfo);
#define atoi StrAToI
#define atol StrAToI
#define abs(a) ((a) < 0 ? -(a) : (a))
//#define abs fabs
#define malloc(a) calloc(a,1)
//#define free MemPtrFree
#define strtol(a,b,c) StrAToI(a)
#define qsort(a,b,c,d)
#define rand() SysRandom(0)
void MemExtInit();
void MemExtCleanup();
MemPtr realloc(MemPtr oldP, UInt32 size);
MemPtr calloc(UInt32 nelem, UInt32 elsize);
Err free(MemPtr memP);
void exit(Int16 status);
void *bsearch(const void *key, const void *base, UInt32 nmemb,
UInt32 size, int (*compar)(const void *, const void *));
#endif
--- NEW FILE: string.h ---
#include <PalmOS.h>
#define memcmp MemCmp
#define memcpy MemMove
#define memmove MemMove
#define memset(a,b,c) MemSet(a,c,b)
#define strcat StrCat
#define strchr StrChr
#define strcmp StrCompare
#define strcpy StrCopy
#define strncpy StrNCopy
#define stricmp StrCaselessCompare
#define strlen StrLen
#define strncmp StrNCompare
#define strstr StrStr
Char *strtok(Char *str, const Char *sep);
Char *strrchr(const Char *s, int c);
Char *strdup(const Char *strSource);
Char *strpbrk(const Char *s1, const Char *s2);
#define StrTok strtok
--- NEW FILE: time.h ---
#include <PalmOS.h>
typedef UInt32 time_t;
struct tm {
Int16 tm_sec; // seconds [0,61]
Int16 tm_min; // minutes [0,59]
Int16 tm_hour; // hour [0,23]
Int16 tm_mday; // day of month [1,31]
Int16 tm_mon; // month of year [0,11]
Int16 tm_year; // years since 1900
Int16 tm_wday; // day of week [0,6] (Sunday = 0)
Int16 tm_yday; // day of year [0,365]
Int16 tm_isdst; // daylight savings flag
};
time_t time(time_t *tloc);
struct tm *localtime(const time_t *timer);
--- NEW FILE: unistd.h ---
#include <PalmOS.h>
Char *getcwd(Char *buf, UInt32 size);
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Rsc Starter.rsrc,NONE,1.1 StarterRsc.h,NONE,1.1
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src extend.cpp,NONE,1.1 extend.h,NONE,1.1 extras.cpp,NONE,1.1 extras.h,NONE,1.1 globals.h,NONE,1.1 init.cpp,NONE,1.1 palm.cpp,NONE,1.1 palm.h,NONE,1.1 palmsave.cpp,NONE,1.1 palmstart.cpp,NONE,1.1 saveslot.cpp,NONE,1.1 scumm_globals.h,NONE,1.1 skin.h,NONE,1.1 vibrate.h,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list