2006-02-24 05:03:04 +00:00
|
|
|
|
|
|
|
//**************************************************************************
|
|
|
|
//**
|
|
|
|
//** misc.h
|
|
|
|
//**
|
|
|
|
//**************************************************************************
|
|
|
|
|
|
|
|
#ifndef __MISC_H__
|
|
|
|
#define __MISC_H__
|
|
|
|
|
|
|
|
// HEADER FILES ------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "error.h"
|
|
|
|
|
|
|
|
// MACROS ------------------------------------------------------------------
|
|
|
|
|
|
|
|
// TYPES -------------------------------------------------------------------
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MSG_NORMAL,
|
|
|
|
MSG_VERBOSE,
|
|
|
|
MSG_DEBUG
|
|
|
|
} msg_t;
|
|
|
|
|
|
|
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
|
|
|
|
|
|
|
void *MS_Alloc(size_t size, error_t error);
|
|
|
|
void *MS_Realloc(void *base, size_t size, error_t error);
|
|
|
|
U_WORD MS_LittleUWORD(U_WORD val);
|
2008-07-19 08:01:33 +00:00
|
|
|
// U_LONG MS_LittleULONG(U_LONG val);
|
|
|
|
U_INT MS_LittleUINT(U_INT val);
|
2006-02-24 05:03:04 +00:00
|
|
|
int MS_LoadFile(char *name, char **buffer);
|
2008-11-16 19:35:53 +00:00
|
|
|
boolean MS_FileExists(char *name);
|
2006-02-24 05:03:04 +00:00
|
|
|
boolean MS_SaveFile(char *name, void *buffer, int length);
|
|
|
|
int MS_StrCmp(char *s1, char *s2);
|
|
|
|
char *MS_StrLwr(char *string);
|
|
|
|
char *MS_StrUpr(char *string);
|
|
|
|
void MS_SuggestFileExt(char *base, char *extension);
|
|
|
|
void MS_StripFileExt(char *name);
|
|
|
|
boolean MS_StripFilename(char *path);
|
|
|
|
void MS_Message(msg_t type, char *text, ...);
|
2008-12-17 05:47:30 +00:00
|
|
|
boolean MS_IsPathAbsolute(char *name);
|
2008-12-18 02:24:55 +00:00
|
|
|
boolean MS_IsDirectoryDelimiter(char test);
|
2006-02-24 05:03:04 +00:00
|
|
|
|
|
|
|
// PUBLIC DATA DECLARATIONS ------------------------------------------------
|
|
|
|
|
2009-05-11 21:07:27 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
// Get rid of the annoying deprecation warnings with VC++2005 and newer.
|
|
|
|
#pragma warning(disable:4996)
|
|
|
|
#endif
|
|
|
|
|
2006-02-24 05:03:04 +00:00
|
|
|
#endif
|