10 static data_unset
*data_fastcgi_copy(const data_unset
*s
) {
11 data_fastcgi
*src
= (data_fastcgi
*)s
;
12 data_fastcgi
*ds
= data_fastcgi_init();
14 buffer_copy_buffer(ds
->key
, src
->key
);
15 buffer_copy_buffer(ds
->host
, src
->host
);
16 ds
->is_index_key
= src
->is_index_key
;
17 return (data_unset
*)ds
;
20 static void data_fastcgi_free(data_unset
*d
) {
21 data_fastcgi
*ds
= (data_fastcgi
*)d
;
24 buffer_free(ds
->host
);
29 static void data_fastcgi_reset(data_unset
*d
) {
30 data_fastcgi
*ds
= (data_fastcgi
*)d
;
32 buffer_reset(ds
->key
);
33 buffer_reset(ds
->host
);
37 static int data_fastcgi_insert_dup(data_unset
*dst
, data_unset
*src
) {
45 static void data_fastcgi_print(const data_unset
*d
, int depth
) {
46 data_fastcgi
*ds
= (data_fastcgi
*)d
;
49 fprintf(stdout
, "fastcgi(%s)", ds
->host
->ptr
);
53 data_fastcgi
*data_fastcgi_init(void) {
56 ds
= calloc(1, sizeof(*ds
));
57 force_assert(NULL
!= ds
);
59 ds
->key
= buffer_init();
60 ds
->host
= buffer_init();
64 ds
->copy
= data_fastcgi_copy
;
65 ds
->free
= data_fastcgi_free
;
66 ds
->reset
= data_fastcgi_reset
;
67 ds
->insert_dup
= data_fastcgi_insert_dup
;
68 ds
->print
= data_fastcgi_print
;
69 ds
->type
= TYPE_FASTCGI
;