27 #include <sys/param.h>
32 #include <openssl/sha.h>
35 for (
int i = 0; i < 3; i++) {
40 uint8_t value[] =
"valueX";
52 .value = put_value_buf,
73 for (
int i = 1; i < 3; i++) {
75 static const ssize_t sz = 100;
94 printf(
"Previous key before 'key%d': '%s', value '%s'\n",
95 i, key_buf, value_buf);
100 for (
int i = 0; i < 2; i++) {
102 static const ssize_t sz = 100;
113 .value = valueBuffer,
121 printf(
"Next key after 'key%d': '%s', value '%s'\n",
122 i, key_buf, value_buf);
130 int main(
int argc,
char** argv)
136 KineticSession* session;
142 if (client == NULL) {
return 1; }
143 const char HmacKeyString[] =
"asdfasdf";
153 fprintf(stderr,
"Failed connecting to the Kinetic device w/status: %s\n",
ByteBuffer * ByteBuffer_Append(ByteBuffer *buffer, const void *data, size_t len)
Structure for an embedded ByteArray as a buffer.
This request is made persistent before returning.
ByteBuffer ByteBuffer_Malloc(size_t size)
KineticStatus KineticClient_CreateSession(KineticSessionConfig *const config, KineticClient *const client, KineticSession **session)
Creates a session with the Kinetic Device per specified configuration.
Structure used to specify the configuration for a session.
KineticStatus KineticClient_GetPrevious(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a GETPREVIOUS operation to retrieve the next entry from the Kinetic Device.
KineticStatus KineticClient_DestroySession(KineticSession *const session)
Closes the connection to a host.
ByteArray array
ByteArray holding allocated array w/length = allocated size.
char host[256]
Host name/IP address of Kinetic Device.
const char * Kinetic_GetStatusDescription(KineticStatus status)
Provides a string representation for a KineticStatus code.
ByteBuffer ByteBuffer_Create(void *data, size_t max_len, size_t used)
#define KINETIC_PORT
Default kinetic port.
static void do_put_and_getprevious_getnext(KineticSession *session)
const char * logFile
Path to log file. Specify 'stdout' to log to STDOUT or NULL to disable logging.
ByteBuffer key
Key associated with the object stored on disk.
uint8_t * data
Pointer to an allocated array of data bytes.
ByteBuffer ByteBuffer_CreateAndAppendFormattedCString(void *data, size_t max_len, const char *format,...)
Status not available (no reponse/status available)
KineticStatus
Kinetic status codes.
KineticStatus KineticClient_Put(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a PUT operation to store/update an entry on the Kinetic Device.
ByteBuffer ByteBuffer_MallocAndAppend(const void *data, size_t len)
Configuration values for the KineticClient connection.
void KineticClient_Shutdown(KineticClient *const client)
Performs shutdown/cleanup of the kinetic-c client library.
KineticClient * KineticClient_Init(KineticClientConfig *config)
Initializes the Kinetic API and configures logging.
int main(int argc, char **argv)
size_t bytesUsed
Reflects the number of bytes used from the array
KineticStatus KineticClient_GetNext(KineticSession *const session, KineticEntry *const entry, KineticCompletionClosure *closure)
Executes a GETNEXT operation to retrieve the next entry from the Kinetic Device.
void ByteBuffer_Free(ByteBuffer buffer)
ByteArray ByteArray_CreateWithCString(const char *str)