1 /* 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License as published by 4 * the Free Software Foundation; either version 2 of the License, or 5 * (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU Library General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software 14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 */ 16 #ifndef _UTILS_C 17 #define _UTILS_C 18 19 #include "cleantyp.h" 20 21 void Log (char *, ...); 22 23 //! Wait for the current 60th of sec to be elapsed 24 void wait_next_vsync(); 25 26 //! CRC predefined array 27 extern unsigned long TAB_CONST[256]; 28 29 #if defined(WIN32) 30 31 #include <stdio.h> 32 #include <windows.h> 33 34 // Dummy declarations to fool our implementation of shared memory 35 typedef int key_t; 36 #define IPC_CREAT 0 37 #define IPC_EXCL 0 38 #define IPC_RMID 0 39 40 int shmget (key_t, int, int); 41 char* shmat (int, int, int); 42 int shmctl(int, int, int); 43 44 #if !defined(unix) 45 #define htons(arg) (((arg) >> 8) | (((arg) & 0xFF) << 8)) 46 #endif 47 48 #endif 49 50 void patch_rom(char* filename, int offset, UChar value); 51 52 char *strupr(char *s); 53 #if !defined(FREEBSD) 54 char *strcasestr (const char *s1, const char *s2); 55 #endif 56 57 #if !defined(WIN32) 58 int stricmp (char *s1, char *s2); 59 #endif 60 61 void get_directory_from_filename(char*); 62 63 void wipe_directory(char*); 64 65 int file_exists(char*); 66 67 #endif 68