version 1.1.1.1, 2013/10/14 10:32:47
|
version 1.1.1.2, 2016/11/02 10:35:00
|
Line 1
|
Line 1
|
#ifndef ARRAY_H |
#ifndef ARRAY_H |
#define ARRAY_H |
#define ARRAY_H |
|
#include "first.h" |
|
|
#ifdef HAVE_CONFIG_H |
|
# include "config.h" |
|
#endif |
|
|
|
#ifdef HAVE_PCRE_H |
#ifdef HAVE_PCRE_H |
# include <pcre.h> |
# include <pcre.h> |
#endif |
#endif |
|
|
#include "buffer.h" |
#include "buffer.h" |
|
#include "vector.h" |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
|
|
Line 35 typedef struct {
|
Line 33 typedef struct {
|
|
|
size_t *sorted; |
size_t *sorted; |
|
|
size_t used; | size_t used; /* <= SSIZE_MAX */ |
size_t size; |
size_t size; |
|
|
size_t unique_ndx; |
size_t unique_ndx; |
|
|
size_t next_power_of_2; |
|
int is_weakref; /* data is weakref, don't bother the data */ |
|
} array; |
} array; |
|
|
typedef struct { |
typedef struct { |
Line 105 typedef enum {
|
Line 100 typedef enum {
|
* for compare: comp cond string/regex |
* for compare: comp cond string/regex |
*/ |
*/ |
|
|
typedef struct _data_config data_config; | typedef struct data_config data_config; |
struct _data_config { | DEFINE_TYPED_VECTOR_NO_RELEASE(config_weak, data_config*); |
| |
| struct data_config { |
DATA_UNSET; |
DATA_UNSET; |
|
|
array *value; |
array *value; |
Line 118 struct _data_config {
|
Line 115 struct _data_config {
|
buffer *op; |
buffer *op; |
|
|
int context_ndx; /* more or less like an id */ |
int context_ndx; /* more or less like an id */ |
array *childs; | vector_config_weak children; |
/* nested */ |
/* nested */ |
data_config *parent; |
data_config *parent; |
/* for chaining only */ |
/* for chaining only */ |
Line 163 array *array_init(void);
|
Line 160 array *array_init(void);
|
array *array_init_array(array *a); |
array *array_init_array(array *a); |
void array_free(array *a); |
void array_free(array *a); |
void array_reset(array *a); |
void array_reset(array *a); |
int array_insert_unique(array *a, data_unset *str); | void array_insert_unique(array *a, data_unset *entry); |
data_unset *array_pop(array *a); | data_unset *array_pop(array *a); /* only works on "simple" lists with autogenerated keys */ |
int array_print(array *a, int depth); |
int array_print(array *a, int depth); |
data_unset *array_get_unused_element(array *a, data_type_t t); |
data_unset *array_get_unused_element(array *a, data_type_t t); |
data_unset *array_get_element(array *a, const char *key); |
data_unset *array_get_element(array *a, const char *key); |
|
data_unset *array_extract_element(array *a, const char *key); /* removes found entry from array */ |
void array_set_key_value(array *hdrs, const char *key, size_t key_len, const char *value, size_t val_len); |
void array_set_key_value(array *hdrs, const char *key, size_t key_len, const char *value, size_t val_len); |
data_unset *array_replace(array *a, data_unset *du); | void array_replace(array *a, data_unset *entry); |
int array_strcasecmp(const char *a, size_t a_len, const char *b, size_t b_len); |
int array_strcasecmp(const char *a, size_t a_len, const char *b, size_t b_len); |
void array_print_indent(int depth); |
void array_print_indent(int depth); |
size_t array_get_max_key_length(array *a); |
size_t array_get_max_key_length(array *a); |