OSDN Git Service

chnlib:構造体のハッシュ値取得を実装。検索の高速化に利用する予定。文字列の連結・コピーも実装。合わせてlibtestも更新。
[chnosproject/CHNOSProject.git] / CHNOSProject / chn / chnlib.h
index 20c6964..88d235b 100755 (executable)
@@ -46,6 +46,7 @@ struct CHNLIB_STRUCTURE_HEADER {
     uint typeid;\r
     uint referenceCount;\r
     void (*destructor)(void **structrue);\r
+    uint (*getHash)(const void *structure);\r
 };\r
 \r
 //\r
@@ -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);\r
 void CHNLIB_StructureHeader_Initialize(CHNLIB_StructureHeader *header, uint typeid);\r
 uint CHNLIB_StructureHeader_GetTypeID(const void *structure);\r
+uint CHNLIB_StructureHeader_GetHash(const void *structure);\r
 void *CHNLIB_System_AllocateMemory_Strict(int size, const char filename[], int line, const char funcname[]);\r
 void CHNLIB_System_FreeMemory(void *p, const char filename[], int line, const char funcname[]);\r
 void CHNLIB_Retain(void **structure);\r
@@ -117,25 +119,41 @@ CHNLIB_UIPArray *CHNLIB_UIPArray_GetSortedInDescendingOrderByData32(const CHNLIB
 //@chnlib01.c\r
 typedef struct CHNLIB_STRING CHNLIB_String;\r
 struct CHNLIB_STRING;\r
+//----文字列の初期化\r
 CHNLIB_String *CHNLIB_String_Initialize(const char str[]);\r
 CHNLIB_String *CHNLIB_String_InitializeWithFormat(const char format[], ...);\r
+//----文字列の解放\r
 void CHNLIB_String_Free(CHNLIB_String *strtag);\r
+//----文字列の設定\r
 int CHNLIB_String_SetStringFromCString(CHNLIB_String *strtag, const char s[]);\r
+//----文字列の表示\r
 int CHNLIB_String_Print(CHNLIB_String *strtag);\r
+//----文字列の参照の取得\r
 const char *CHNLIB_String_GetReferencePointerOfCString(const CHNLIB_String *strtag);\r
+//----文字列の切り出し\r
 CHNLIB_String *CHNLIB_String_ExtractByLength(const CHNLIB_String *strtag, int start, int len);\r
+//----文字列の連結\r
+CHNLIB_String *CHNLIB_String_Concatenate(const CHNLIB_String *s1, const CHNLIB_String *s2);\r
+//----文字列の長さを取得\r
 int CHNLIB_String_GetLength(const CHNLIB_String *strtag);\r
+//----末尾の改行文字を削除\r
 void CHNLIB_String_DeleteLastCRLF(CHNLIB_String *strtag);\r
+//----文字列の比較\r
 int CHNLIB_String_CompareStringWithCString(const CHNLIB_String *s, const char search[]);\r
 int CHNLIB_String_CompareString_Strict(const CHNLIB_String *s, const CHNLIB_String *search);\r
+//----文字列の出現回数を取得\r
 uint CHNLIB_String_GetCountOfContain(const CHNLIB_String *s, const CHNLIB_String *search);\r
-//--\r
+//----文字列のコピーを作成\r
+CHNLIB_String *CHNLIB_String_Copy(const CHNLIB_String *s);\r
+//----低レベルCString関数\r
 int CHNLIB_CString_GetByteLength(const char s[]);\r
 void CHNLIB_CString_DeleteLastCRLF(char s[]);\r
 char *CHNLIB_CString_ExtractByLength(const char s[], int start, int len);\r
 int CHNLIB_CString_CompareString(const char s[], const char search[]);\r
 int CHNLIB_CString_CompareString_Strict(const char s[], const char search[]);\r
 int CHNLIB_CString_CompareString_LeftHand(const char s[], const char search[]);\r
+char *CHNLIB_CString_Copy(const char s[]);\r
+char *CHNLIB_CString_Concatenate(const char s1[], const char s2[]);\r
 //@chnlib02.c\r
 int CHNLIB_String_Search_UIPArrayStringLocation(const CHNLIB_String *s, int s_start, const CHNLIB_UIPArray *list, int *location);\r
 int CHNLIB_UIPArray_GetSeparatedStringByUIPArray(CHNLIB_UIPArray **separated, const CHNLIB_UIPArray *list, const CHNLIB_String *s);\r