Match all but MotionLoad
This commit is contained in:
parent
b57ad97bf6
commit
4f4cc47d0e
2 changed files with 89 additions and 0 deletions
51
include/ctype.h
Normal file
51
include/ctype.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef _CTYPE_H
|
||||
#define _CTYPE_H
|
||||
|
||||
|
||||
extern unsigned char __ctype_map[256];
|
||||
extern unsigned char __lower_map[256];
|
||||
extern unsigned char __upper_map[256];
|
||||
|
||||
#define __control_char 0x01
|
||||
#define __motion_char 0x02
|
||||
#define __space_char 0x04
|
||||
#define __punctuation 0x08
|
||||
#define __digit 0x10
|
||||
#define __hex_digit 0x20
|
||||
#define __lower_case 0x40
|
||||
#define __upper_case 0x80
|
||||
|
||||
#define __letter (__lower_case | __upper_case)
|
||||
#define __alphanumeric (__letter | __digit)
|
||||
#define __graphic (__alphanumeric | __punctuation)
|
||||
#define __printable (__graphic | __space_char)
|
||||
#define __whitespace (__motion_char | __space_char)
|
||||
#define __control (__motion_char | __control_char)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
__declspec(weak) int isalpha(int __c);
|
||||
__declspec(weak) int isdigit(int __c);
|
||||
__declspec(weak) int isspace(int __c);
|
||||
__declspec(weak) int isupper(int __c);
|
||||
__declspec(weak) int isxdigit(int __c);
|
||||
|
||||
__declspec(weak) int tolower(int __c);
|
||||
__declspec(weak) int toupper(int __c);
|
||||
|
||||
// added underscore to avoid naming conflicts
|
||||
inline int _isalpha(int c) { return (int)(__ctype_map[(u8)c] & __letter); }
|
||||
inline int _isdigit(int c) { return (int)(__ctype_map[(u8)c] & __digit); }
|
||||
inline int _isspace(int c) { return (int)(__ctype_map[(u8)c] & __whitespace); }
|
||||
inline int _isupper(int c) { return (int)(__ctype_map[(u8)c] & __upper_case); }
|
||||
inline int _isxdigit(int c) { return (int)(__ctype_map[(u8)c] & __hex_digit); }
|
||||
inline int _tolower(int c) { return (c == -1 ? -1 : (int)__lower_map[(u8)c]); }
|
||||
inline int _toupper(int c) { return (c == -1 ? -1 : (int)__upper_map[(u8)c]); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#include "game/hsfformat.h"
|
||||
#include "string.h"
|
||||
#include "ctype.h"
|
||||
|
||||
GXColor rgba[100];
|
||||
HsfHeader head;
|
||||
|
|
@ -947,6 +948,43 @@ static void PaletteLoad(void)
|
|||
}
|
||||
}
|
||||
|
||||
char *MakeObjectName(char *name)
|
||||
{
|
||||
static char buf[768];
|
||||
int index, num_minus;
|
||||
char *temp_name;
|
||||
num_minus = 0;
|
||||
index = 0;
|
||||
temp_name = name;
|
||||
while(*temp_name) {
|
||||
if(*temp_name == '-') {
|
||||
name = temp_name+1;
|
||||
break;
|
||||
}
|
||||
temp_name++;
|
||||
}
|
||||
while(*name) {
|
||||
if(num_minus != 0) {
|
||||
break;
|
||||
}
|
||||
if(*name == '_' && !isalpha(name[1])) {
|
||||
num_minus++;
|
||||
break;
|
||||
}
|
||||
buf[index] = *name;
|
||||
name++;
|
||||
index++;
|
||||
}
|
||||
buf[index] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
int CmpObjectName(char *name1, char *name2)
|
||||
{
|
||||
int temp = 0;
|
||||
return strcmp(name1, name2);
|
||||
}
|
||||
|
||||
static void MotionLoad(void)
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue