1 #ifndef DIRECTORIES_H 2 #define DIRECTORIES_H 3 4 #ifndef WIN32 5 #include <pwd.h> 6 #include <stdio.h> 7 #include <stdlib.h> 8 #include <sys/stat.h> 9 #include <unistd.h> 10 #endif 11 12 // The macros xstr(s) and str(s) were extracted from 13 // http://gcc.gnu.org/onlinedocs/cpp/Stringification.html 14 // They are used to expand BASE_DIR . 15 #define xstr(s) str(s) 16 #define str(s) #s 17 18 #ifndef PATH_SIZE // to allow modifying it by the compiler option -D 19 #define PATH_SIZE 1024 20 #endif 21 22 #ifdef WIN32 23 #define PATH_SEP "\\" 24 #else 25 #define PATH_SEP "/" 26 #endif 27 28 // BASE_DIR has not " arround it. 29 #ifndef BASE_DIR 30 #define BASE_DIR . 31 #endif 32 33 #define IMAGES_DIR "images" 34 #define MAPS_DIR "maps" 35 #define SOUND_DIR "sounds" 36 37 char *getHomeUserAbe(); 38 39 #ifndef WIN32 40 #define getSaveGameDir() getHomeUserAbe() 41 #else 42 #define getSaveGameDir() xstr(BASE_DIR) PATH_SEP "savegame" PATH_SEP 43 #endif 44 45 void mkshuae(); 46 47 #endif 48