Annotation of embedaddon/lighttpd/src/data_fastcgi.c, revision 1.1
1.1 ! misho 1: #include "array.h"
! 2: #include "fastcgi.h"
! 3:
! 4: #include <string.h>
! 5: #include <stdio.h>
! 6: #include <stdlib.h>
! 7:
! 8: static data_unset *data_fastcgi_copy(const data_unset *s) {
! 9: data_fastcgi *src = (data_fastcgi *)s;
! 10: data_fastcgi *ds = data_fastcgi_init();
! 11:
! 12: buffer_copy_string_buffer(ds->key, src->key);
! 13: buffer_copy_string_buffer(ds->host, src->host);
! 14: ds->is_index_key = src->is_index_key;
! 15: return (data_unset *)ds;
! 16: }
! 17:
! 18: static void data_fastcgi_free(data_unset *d) {
! 19: data_fastcgi *ds = (data_fastcgi *)d;
! 20:
! 21: buffer_free(ds->key);
! 22: buffer_free(ds->host);
! 23:
! 24: free(d);
! 25: }
! 26:
! 27: static void data_fastcgi_reset(data_unset *d) {
! 28: data_fastcgi *ds = (data_fastcgi *)d;
! 29:
! 30: buffer_reset(ds->key);
! 31: buffer_reset(ds->host);
! 32:
! 33: }
! 34:
! 35: static int data_fastcgi_insert_dup(data_unset *dst, data_unset *src) {
! 36: UNUSED(dst);
! 37:
! 38: src->free(src);
! 39:
! 40: return 0;
! 41: }
! 42:
! 43: static void data_fastcgi_print(const data_unset *d, int depth) {
! 44: data_fastcgi *ds = (data_fastcgi *)d;
! 45: UNUSED(depth);
! 46:
! 47: fprintf(stdout, "fastcgi(%s)", ds->host->ptr);
! 48: }
! 49:
! 50:
! 51: data_fastcgi *data_fastcgi_init(void) {
! 52: data_fastcgi *ds;
! 53:
! 54: ds = calloc(1, sizeof(*ds));
! 55:
! 56: ds->key = buffer_init();
! 57: ds->host = buffer_init();
! 58: ds->port = 0;
! 59: ds->is_disabled = 0;
! 60:
! 61: ds->copy = data_fastcgi_copy;
! 62: ds->free = data_fastcgi_free;
! 63: ds->reset = data_fastcgi_reset;
! 64: ds->insert_dup = data_fastcgi_insert_dup;
! 65: ds->print = data_fastcgi_print;
! 66: ds->type = TYPE_FASTCGI;
! 67:
! 68: return ds;
! 69: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>