lighttpd 1.4.x https://www.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
948 B

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "array.h"
static void data_integer_free(data_unset *d) {
data_integer *ds = (data_integer *)d;
buffer_free(ds->key);
free(d);
}
static void data_integer_reset(data_unset *d) {
data_integer *ds = (data_integer *)d;
/* reused integer elements */
buffer_reset(ds->key);
ds->value = 0;
}
static int data_integer_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
src->free(src);
return 0;
}
static void data_integer_print(data_unset *d) {
data_integer *ds = (data_integer *)d;
printf("{%s: %d}", ds->key->ptr, ds->value);
}
data_integer *data_integer_init(void) {
data_integer *ds;
ds = calloc(1, sizeof(*ds));
ds->key = buffer_init();
ds->value = 0;
ds->free = data_integer_free;
ds->reset = data_integer_reset;
ds->insert_dup = data_integer_insert_dup;
ds->print = data_integer_print;
ds->type = TYPE_INTEGER;
return ds;
}