X-Git-Url: http://git.osdn.net/view?p=chnosproject%2FCHNOSProject.git;a=blobdiff_plain;f=CHNOSProject%2Fchn%2Fchnlib.h;fp=CHNOSProject%2Fchn%2Fchnlib.h;h=88d235bb5e8d5f0148d3dc861c3df18cb40353f9;hp=20c6964e056ddabc2da7782ec41fdb37f5e56d4e;hb=1ba1ff02213d50410430f7c01c6ec362ad3d8aca;hpb=d632c9402c8f317c4fa25df6dbcc5fa89d4f1179 diff --git a/CHNOSProject/chn/chnlib.h b/CHNOSProject/chn/chnlib.h index 20c6964..88d235b 100755 --- a/CHNOSProject/chn/chnlib.h +++ b/CHNOSProject/chn/chnlib.h @@ -46,6 +46,7 @@ struct CHNLIB_STRUCTURE_HEADER { uint typeid; uint referenceCount; void (*destructor)(void **structrue); + uint (*getHash)(const void *structure); }; // @@ -78,6 +79,7 @@ void CHNLIB_Debug_PrintStructureData(void *structure, uint level); void CHNLIB_ReportError(const char format[], const char filename[], int line, const char funcname[], ...); //("", CHNLIB_DEBUG_ARGUMENTS); void CHNLIB_StructureHeader_Initialize(CHNLIB_StructureHeader *header, uint typeid); uint CHNLIB_StructureHeader_GetTypeID(const void *structure); +uint CHNLIB_StructureHeader_GetHash(const void *structure); void *CHNLIB_System_AllocateMemory_Strict(int size, const char filename[], int line, const char funcname[]); void CHNLIB_System_FreeMemory(void *p, const char filename[], int line, const char funcname[]); void CHNLIB_Retain(void **structure); @@ -117,25 +119,41 @@ CHNLIB_UIPArray *CHNLIB_UIPArray_GetSortedInDescendingOrderByData32(const CHNLIB //@chnlib01.c typedef struct CHNLIB_STRING CHNLIB_String; struct CHNLIB_STRING; +//----文字列の初期化 CHNLIB_String *CHNLIB_String_Initialize(const char str[]); CHNLIB_String *CHNLIB_String_InitializeWithFormat(const char format[], ...); +//----文字列の解放 void CHNLIB_String_Free(CHNLIB_String *strtag); +//----文字列の設定 int CHNLIB_String_SetStringFromCString(CHNLIB_String *strtag, const char s[]); +//----文字列の表示 int CHNLIB_String_Print(CHNLIB_String *strtag); +//----文字列の参照の取得 const char *CHNLIB_String_GetReferencePointerOfCString(const CHNLIB_String *strtag); +//----文字列の切り出し CHNLIB_String *CHNLIB_String_ExtractByLength(const CHNLIB_String *strtag, int start, int len); +//----文字列の連結 +CHNLIB_String *CHNLIB_String_Concatenate(const CHNLIB_String *s1, const CHNLIB_String *s2); +//----文字列の長さを取得 int CHNLIB_String_GetLength(const CHNLIB_String *strtag); +//----末尾の改行文字を削除 void CHNLIB_String_DeleteLastCRLF(CHNLIB_String *strtag); +//----文字列の比較 int CHNLIB_String_CompareStringWithCString(const CHNLIB_String *s, const char search[]); int CHNLIB_String_CompareString_Strict(const CHNLIB_String *s, const CHNLIB_String *search); +//----文字列の出現回数を取得 uint CHNLIB_String_GetCountOfContain(const CHNLIB_String *s, const CHNLIB_String *search); -//-- +//----文字列のコピーを作成 +CHNLIB_String *CHNLIB_String_Copy(const CHNLIB_String *s); +//----低レベルCString関数 int CHNLIB_CString_GetByteLength(const char s[]); void CHNLIB_CString_DeleteLastCRLF(char s[]); char *CHNLIB_CString_ExtractByLength(const char s[], int start, int len); int CHNLIB_CString_CompareString(const char s[], const char search[]); int CHNLIB_CString_CompareString_Strict(const char s[], const char search[]); int CHNLIB_CString_CompareString_LeftHand(const char s[], const char search[]); +char *CHNLIB_CString_Copy(const char s[]); +char *CHNLIB_CString_Concatenate(const char s1[], const char s2[]); //@chnlib02.c int CHNLIB_String_Search_UIPArrayStringLocation(const CHNLIB_String *s, int s_start, const CHNLIB_UIPArray *list, int *location); int CHNLIB_UIPArray_GetSeparatedStringByUIPArray(CHNLIB_UIPArray **separated, const CHNLIB_UIPArray *list, const CHNLIB_String *s);