-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.h
30 lines (25 loc) · 1023 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// Created by Jeka Kovtun on 16/11/2019.
//
#ifndef REDIS_KEYSPACE_AMQP_UTILS_H
#define REDIS_KEYSPACE_AMQP_UTILS_H
#include "redismodule.h"
#include <amqp.h>
#include <stdbool.h>
#include <string.h>
typedef struct string_array_t_ {
uint size;
uint capacity;
char** data;
} string_array_t;
void copyStringAllocated(const char* in, char** out, bool needFree);
void copyAmqpStringAllocated(const char* in, amqp_bytes_t* out, bool needFree);
void stringArrayInit(string_array_t** arr, uint size, uint capacity);
void stringArrayAdd(string_array_t** arr, const char* value);
void stringArrayClean(string_array_t** arr);
uint stringArrayGetLength(string_array_t** arr);
const char* stringArrayGetElement(string_array_t** arr, uint index);
char* redisArgsToSerializedString(RedisModuleString **argv, int argc);
RedisModuleString** serializedStringToRedisArgs(RedisModuleCtx *ctx, const char* serializedData, size_t* argc);
int match(const char *regexp, const char *text);
#endif //REDIS_KEYSPACE_AMQP_UTILS_H