2006-02-24 04:48:15 +00:00
|
|
|
// cmdlib.h
|
|
|
|
|
|
|
|
#ifndef __CMDLIB__
|
|
|
|
#define __CMDLIB__
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(disable : 4244) // MIPS
|
|
|
|
#pragma warning(disable : 4136) // X86
|
|
|
|
#pragma warning(disable : 4051) // ALPHA
|
|
|
|
|
|
|
|
#pragma warning(disable : 4018) // signed/unsigned mismatch
|
|
|
|
#pragma warning(disable : 4305) // truncate from double to float
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "zstring.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
// the dec offsetof macro doesnt work very well...
|
|
|
|
#define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
|
|
|
|
|
|
|
|
int Q_filelength (FILE *f);
|
2006-09-14 00:02:31 +00:00
|
|
|
bool FileExists (const char *filename);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern char progdir[1024];
|
|
|
|
|
|
|
|
void FixPathSeperator (char *path);
|
|
|
|
|
|
|
|
void DefaultExtension (char *path, const char *extension);
|
2006-05-03 22:45:01 +00:00
|
|
|
void DefaultExtension (FString &path, const char *extension);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-07-08 02:17:35 +00:00
|
|
|
FString ExtractFilePath (const char *path);
|
|
|
|
FString ExtractFileBase (const char *path, bool keep_extension=false);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
int ParseHex (char *str);
|
|
|
|
int ParseNum (char *str);
|
2006-09-14 00:02:31 +00:00
|
|
|
bool IsNum (char *str); // [RH] added
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
char *copystring(const char *s);
|
|
|
|
void ReplaceString (char **ptr, const char *str);
|
|
|
|
|
|
|
|
bool CheckWildcards (const char *pattern, const char *text);
|
|
|
|
|
|
|
|
void FormatGUID (char *text, const GUID &guid);
|
|
|
|
|
|
|
|
char *myasctime ();
|
|
|
|
|
2006-05-14 14:30:13 +00:00
|
|
|
void CreatePath(const char * fn);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#endif
|