X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fmisc.h;h=159b393a27d0fdb9041c273a04aa5c56997f9d0d;hp=0660811ec84db308ee625160404ab3a082892eaa;hb=e086ff916e148637704376bff8314a8f23c5f552;hpb=115ce6f2da1914d68b0fe0e5f9082973190dacdd diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 0660811e..159b393a 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -4,7 +4,7 @@ // (c) 1995-2014 by Artsoft Entertainment // Holger Schemel // info@artsoft.org -// http://www.artsoft.org/ +// https://www.artsoft.org/ // ---------------------------------------------------------------------------- // misc.h // ============================================================================ @@ -19,11 +19,11 @@ #include "system.h" -/* values for InitCounter() and Counter() */ +// values for InitCounter() and Counter() #define INIT_COUNTER 0 #define READ_COUNTER 1 -/* values for InitRND() */ +// values for InitRND() #define NEW_RANDOMIZE 0 #define RANDOM_ENGINE 0 @@ -34,49 +34,32 @@ #define GetEngineRandom(max) get_random_number(RANDOM_ENGINE, max) #define GetSimpleRandom(max) get_random_number(RANDOM_SIMPLE, max) -/* values for Error() */ -#define ERR_UNKNOWN 0 -#define ERR_DEBUG (1 << 0) -#define ERR_INFO (1 << 1) -#define ERR_INFO_LINE (1 << 2) -#define ERR_WARN (1 << 3) -#define ERR_EXIT (1 << 4) -#define ERR_HELP (1 << 5) -#define ERR_SOUND_SERVER (1 << 6) -#define ERR_NETWORK_SERVER (1 << 7) -#define ERR_NETWORK_CLIENT (1 << 8) -#define ERR_FROM_SERVER (ERR_SOUND_SERVER | ERR_NETWORK_SERVER) -#define ERR_EXIT_HELP (ERR_EXIT | ERR_HELP) -#define ERR_EXIT_SOUND_SERVER (ERR_EXIT | ERR_SOUND_SERVER) -#define ERR_EXIT_NETWORK_SERVER (ERR_EXIT | ERR_NETWORK_SERVER) -#define ERR_EXIT_NETWORK_CLIENT (ERR_EXIT | ERR_NETWORK_CLIENT) - -/* values for getFile...() and putFile...() */ +// values for getFile...() and putFile...() #define BYTE_ORDER_BIG_ENDIAN 0 #define BYTE_ORDER_LITTLE_ENDIAN 1 -/* values for cursor bitmap creation */ +// values for cursor bitmap creation #define BIT_ORDER_MSB 0 #define BIT_ORDER_LSB 1 -/* values for createDirectory() */ +// values for createDirectory() #define PERMS_PRIVATE 0 #define PERMS_PUBLIC 1 -/* values for general file handling stuff */ +// values for general file handling stuff #define MAX_FILENAME_LEN 256 #define MAX_LINE_LEN 1024 -/* values for general username handling stuff */ +// values for general username handling stuff #define MAX_USERNAME_LEN 1024 #if defined(PLATFORM_ANDROID) -/* values for Android asset handling */ +// values for Android asset handling #define ASSET_TOC_BASENAME ".toc" #endif -/* structure definitions */ +// structure definitions typedef struct { @@ -111,7 +94,7 @@ typedef struct } Directory; -/* function definitions */ +// function definitions void fprintf_line(FILE *, char *, int); void fprintf_line_with_prefix(FILE *, char *, char *, int); @@ -123,6 +106,14 @@ void PrintNoLog(char *, ...); void PrintLine(char *, int); void PrintLineWithPrefix(char *, char *, int); +void DebugContinued(char *, char *, ...); +void Debug(char *, char *, ...); +void Info(char *, ...); +void Warn(char *, ...); +void Error(char *, ...); +void Fail(char *, ...); +void FailWithHelp(char *, ...); + char *int2str(int, int); char *i_to_a(unsigned int); int log_2(unsigned int); @@ -144,8 +135,15 @@ void SkipUntilDelayReached(unsigned int *, unsigned int, int *, int); unsigned int init_random_number(int, int); unsigned int get_random_number(int, int); +#if defined(PLATFORM_UNIX) +char *getUnixLoginName(void); +char *getUnixRealName(void); +char *getUnixHomeDir(void); +#endif + char *getLoginName(void); char *getRealName(void); +char *getFixedUserName(char *); time_t getFileTimestampEpochSeconds(char *); @@ -178,10 +176,6 @@ void GetOptions(int, char **, void (*print_usage_function)(void), void (*print_version_function)(void)); -void SetError(char *, ...); -char *GetError(void); -void Error(int, char *, ...); - void *checked_malloc(unsigned int); void *checked_calloc(unsigned int); void *checked_realloc(void *, unsigned int); @@ -267,8 +261,6 @@ boolean FileIsArtworkType(char *, int); char *get_mapped_token(char *); -int get_parameter_value(char *, char *, int); - struct FileInfo *getFileListFromConfigList(struct ConfigInfo *, struct ConfigTypeInfo *, char **, int); @@ -291,4 +283,4 @@ void print_timestamp_time(char *); void print_timestamp_done(char *); -#endif /* MISC_H */ +#endif // MISC_H