Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
coshcage authored Apr 18, 2024
1 parent 04e1c12 commit caadfb4
Show file tree
Hide file tree
Showing 6 changed files with 324 additions and 198 deletions.
2 changes: 1 addition & 1 deletion src/silock.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int _sicbftvsTrans(void * pitem, size_t param)
* ptrans Pointer to a transaction.
* pobj Pointer to an object.
* lt Lock type.
* Return value: TRUE lock acquired. FALSE lock refused.
* Return value: TRUE lock accuired. FALSE lock refused.
* Caution: N/A.
* Tip: N/A.
*/
Expand Down
45 changes: 44 additions & 1 deletion src/simisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* Name: simisc.c
* Description: Misc functions.
* Author: cosh.cage#hotmail.com
* File ID: 0703231856E1101231110L00287
* File ID: 0703231856E0418240132L00330
* License: GPLv2.
*/

#include <ctype.h> /* Using function tolower. */
#include <stdint.h> /* Using type uint32_t, uint64_t. */
#include <string.h> /* Using function strcmp. */
#include <stdio.h> /* Using function printf. */
#include "svimrdb.h"

int _siCBFCompareNodeDataSPlusA(void * pitem, size_t param);
Expand Down Expand Up @@ -156,6 +157,18 @@ size_t siPlatformSize(void)
return sizeof(size_t);
}

/* Function name: siPrintSystemVersion
* Description: Print system version.
* Parameter: N/A.
* Return value: N/A.
* Caution: N/A.
* Tip: N/A.
*/
void siPrintSystemVersion(void)
{
(void)printf("%s", SYS_VER);
}

/* Attention: This Is An Internal Function. No Interface for Library Users.
* Function name: _siCBFCompareNodeDataSPlusA
* Description: Used to compare data of NODE_S for strings.
Expand Down Expand Up @@ -284,3 +297,33 @@ P_NODE_S hshSearchCPlusW(P_HSHTBL_C pht, CBF_HASH cbfhsh, const void * pkey, siz
{
return _siSearchLinkedListSCPlusW(*(P_NODE_S *)(pht->pdata + (cbfhsh(pkey) % strLevelArrayZ(pht)) * sizeof(P_NODE_S)), pkey, size);
}

/* Function name: sicbftaDefaultIncrease
* Description: Default table increasing function.
* Parameters:
* curln Input the current table length value.
* ln Input total table length value.
* Return value: New table length value.
*/
size_t sicbftaDefaultIncrease(size_t curln, size_t ln)
{
if (curln == ln)
return ln + TBL_LN_BUF_SIZ;
else
return ln;
}

/* Function name: sicbftaDefaultDecrease
* Description: Default table decreasing function.
* Parameters:
* curln Input the current table length value.
* ln Input total table length value.
* Return value: New table length value.
*/
size_t sicbftaDefaultDecrease(size_t curln, size_t ln)
{
if (ln - TBL_LN_BUF_SIZ > curln)
return ln - TBL_LN_BUF_SIZ;
else
return ln;
}
Loading

0 comments on commit caadfb4

Please sign in to comment.