hdac SDK
SDK for hdac blockchain development
utility.h
1 #ifndef UTILITY_H
2 #define UTILITY_H
3 
4 #include "strcodeclib_global.h"
5 #include <cstdint>
6 #include "tools.h"
7 
8 int64_t mc_GetLE(void *src,int size);
9 
10 typedef struct mc_Buffer
11 {
12  mc_Buffer()
13  {
14  Zero();
15  }
16 
17  ~mc_Buffer()
18  {
19  Destroy();
20  }
21 
22  mc_MapStringIndex *m_lpIndex;
23  unsigned char *m_lpData;
24  int m_AllocSize;
25  int m_Size;
26  int m_KeySize;
27  int m_RowSize;
28  int m_Count;
29  uint32_t m_Mode;
30 
31  void Zero();
32  int Destroy();
33  int Initialize(int KeySize,int TotalSize,uint32_t Mode);
34 
35  int Clear();
36  int Realloc(int Rows);
37  int Add(const void *lpKey,const void *lpValue);
38  int Add(const void *lpKeyValue);
39  int Seek(void *lpKey);
40  unsigned char *GetRow(int RowID);
41  int PutRow(int RowID,const void *lpKey,const void *lpValue);
42  int GetCount();
43  int SetCount(int count);
44 
45  int Sort();
46 
47  void CopyFrom(mc_Buffer *source);
48 
49 } mc_Buffer;
50 
51 void *mc_New(int Size);
52 void mc_Delete(void *ptr);
53 int64_t mc_GetVarInt(const unsigned char *buf,int max_size,int64_t default_value,int* shift);
54 int mc_PutVarInt(unsigned char *buf,int max_size,int64_t value);
55 void mc_PutLE(void *dest,void *src,int dest_size);
56 int64_t mc_GetLE(void *src,int size);
57 
58 unsigned int mc_TimeNowAsUInt();
59 
60 int mc_StringCompareCaseInsensitive(const char *str1,const char *str2,int len);
61 
62 #endif // UTILITY_H
Definition: utility.h:10
Definition: tools.h:4