kclangc.h | kclangc.h | |||
---|---|---|---|---|
skipping to change at line 445 | skipping to change at line 445 | |||
* record exists, the given value is appended at the end of the existing va lue. | * record exists, the given value is appended at the end of the existing va lue. | |||
*/ | */ | |||
int32_t kcdbappend(KCDB* db, const char* kbuf, size_t ksiz, const char* vbu f, size_t vsiz); | int32_t kcdbappend(KCDB* db, const char* kbuf, size_t ksiz, const char* vbu f, size_t vsiz); | |||
/** | /** | |||
* Add a number to the numeric value of a record. | * Add a number to the numeric value of a record. | |||
* @param db a database object. | * @param db a database object. | |||
* @param kbuf the pointer to the key region. | * @param kbuf the pointer to the key region. | |||
* @param ksiz the size of the key region. | * @param ksiz the size of the key region. | |||
* @param num the additional number. | * @param num the additional number. | |||
* @param orig the origin number if no record corresponds to the key. If i | ||||
t is INT64_MIN and | ||||
* no record corresponds, this function fails. If it is INT64_MAX, the val | ||||
ue is set as the | ||||
* additional number regardless of the current value. | ||||
* @return the result value, or INT64_MIN on failure. | * @return the result value, or INT64_MIN on failure. | |||
* @note The value is serialized as an 8-byte binary integer in big-endian | ||||
order, not a decimal | ||||
* string. If existing value is not 8-byte, this function fails. | ||||
*/ | */ | |||
int64_t kcdbincrint(KCDB* db, const char* kbuf, size_t ksiz, int64_t num); | int64_t kcdbincrint(KCDB* db, const char* kbuf, size_t ksiz, int64_t num, i nt64_t orig); | |||
/** | /** | |||
* Add a number to the numeric value of a record. | * Add a number to the numeric value of a record. | |||
* @param db a database object. | * @param db a database object. | |||
* @param kbuf the pointer to the key region. | * @param kbuf the pointer to the key region. | |||
* @param ksiz the size of the key region. | * @param ksiz the size of the key region. | |||
* @param num the additional number. | * @param num the additional number. | |||
* @param orig the origin number if no record corresponds to the key. If i | ||||
t is negative | ||||
* infinity and no record corresponds, this function fails. If it is posit | ||||
ive infinity, the | ||||
* value is set as the additional number regardless of the current value. | ||||
* @return the result value, or Not-a-number on failure. | * @return the result value, or Not-a-number on failure. | |||
* @note The value is serialized as an 16-byte binary fixed-point number in | ||||
big-endian order, | ||||
* not a decimal string. If existing value is not 16-byte, this function f | ||||
ails. | ||||
*/ | */ | |||
double kcdbincrdouble(KCDB* db, const char* kbuf, size_t ksiz, double num); | double kcdbincrdouble(KCDB* db, const char* kbuf, size_t ksiz, double num, double orig); | |||
/** | /** | |||
* Perform compare-and-swap. | * Perform compare-and-swap. | |||
* @param db a database object. | * @param db a database object. | |||
* @param kbuf the pointer to the key region. | * @param kbuf the pointer to the key region. | |||
* @param ksiz the size of the key region. | * @param ksiz the size of the key region. | |||
* @param ovbuf the pointer to the old value region. NULL means that no re cord corresponds. | * @param ovbuf the pointer to the old value region. NULL means that no re cord corresponds. | |||
* @param ovsiz the size of the old value region. | * @param ovsiz the size of the old value region. | |||
* @param nvbuf the pointer to the new value region. NULL means that the r ecord is removed. | * @param nvbuf the pointer to the new value region. NULL means that the r ecord is removed. | |||
* @param nvsiz the size of new old value region. | * @param nvsiz the size of new old value region. | |||
End of changes. 6 change blocks. | ||||
2 lines changed or deleted | 19 lines changed or added | |||