--- np2/common/profile.h 2004/02/21 04:48:35 1.4 +++ np2/common/profile.h 2004/03/31 11:59:17 1.5 @@ -8,6 +8,69 @@ BOOL profile_enum(const char *filename, const char *key, const char *data)); const char *profile_getarg(const char *str, char *buf, UINT leng); + + + +// ---- まだテスト + +enum { + PFILEH_READONLY = 0x0001, + PFILEH_MODIFY = 0x0002 +}; + +typedef struct { + BYTE *buffer; + UINT buffers; + UINT size; + UINT flag; + char path[MAX_PATH]; +} _PFILEH, *PFILEH; + +PFILEH profile_open(const char *filename, UINT flag); +void profile_close(PFILEH hdl); +BOOL profile_read(const char *app, const char *key, const char *def, + char *ret, UINT size, PFILEH hdl); +BOOL profile_write(const char *app, const char *key, + const char *data, PFILEH hdl); + + +enum { + PFTYPE_STR = 0, + PFTYPE_BOOL, + PFTYPE_BITMAP, + PFTYPE_ARGS16, + PFTYPE_ARGH8, + PFTYPE_SINT8, + PFTYPE_SINT16, + PFTYPE_SINT32, + PFTYPE_UINT8, + PFTYPE_UINT16, + PFTYPE_UINT32, + PFTYPE_HEX8, + PFTYPE_HEX16, + PFTYPE_HEX32, + PFTYPE_BYTE3, + PFTYPE_KB, + PFTYPE_USER, + PFITYPE_MASK = 0xff, + + PFFLAG_RO = 0x0100, + PFFLAG_MAX = 0x0200, + PFFLAG_AND = 0x0400 +}; + +typedef struct { + char item[10]; + UINT16 itemtype; + void *value; + UINT32 arg; +} PFTBL; + +void profile_iniread(const char *path, const char *app, + const PFTBL *tbl, UINT count); +void profile_iniwrite(const char *path, const char *app, + const PFTBL *tbl, UINT count); + #ifdef __cplusplus } #endif