/***********************************************************
-* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+* Artsoft Retro-Game Library *
*----------------------------------------------------------*
-* (c) 1995-98 Artsoft Entertainment *
-* Holger Schemel *
-* Oststrasse 11a *
-* 33604 Bielefeld *
-* phone: ++49 +521 290471 *
-* email: aeglos@valinor.owl.de *
+* (c) 1994-2000 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
*----------------------------------------------------------*
-* misc.c *
+* misc.c *
***********************************************************/
#include <time.h>
#include <sys/param.h>
#endif
-#include "libgame.h"
-
#include "misc.h"
+#include "random.h"
-#if 0
-#include "joystick_TMP.h"
-#endif
#if defined(PLATFORM_MSDOS)
volatile unsigned long counter = 0;
return ptr;
}
+void *checked_realloc(void *ptr, unsigned long size)
+{
+ ptr = realloc(ptr, size);
+
+ if (ptr == NULL)
+ Error(ERR_EXIT, "cannot allocate %d bytes -- out of memory", size);
+
+ return ptr;
+}
+
short getFile16BitInteger(FILE *file, int byte_order)
{
if (byte_order == BYTE_ORDER_BIG_ENDIAN)
FILE *error_file;
filename = getPath2(getUserDataDir(), ERROR_FILENAME);
- error_file = fopen(filename, "a");
+ error_file = fopen(filename, MODE_APPEND);
free(filename);
return error_file;
FILE *error_file;
filename = getPath2(getUserDataDir(), ERROR_FILENAME);
- error_file = fopen(filename, "r");
+ error_file = fopen(filename, MODE_READ);
free(filename);
if (error_file != NULL)