JunkBox_Lib  1.10.2
protocol.h
Go to the documentation of this file.
1 #ifndef __JBXL_PROTOCOL_H_
2 #define __JBXL_PROTOCOL_H_
3 
27 #include "xtools.h"
28 
29 
30 // Header tList のキー
31 #define HDLIST_FIRST_LINE_KEY "FIRST_LINE"
32 #define HDLIST_CONTENTS_KEY "CONTENTS_DATA"
33 #define HDLIST_CONTINUE "HEADER_CONTINUE"
34 #define HDLIST_END_KEY "HEADER_END"
35 
36 
38 // Protocol Header
39 
40 tList* get_protocol_header_list(Buffer buf, char deli, int fstline, int rcntnt);
41 Buffer restore_protocol_header (tList* pp, char* deli, int mode, int* hdsz);
42 
44 void set_protocol_contents(tList* pp, Buffer cnt);
45 
46 tList* get_protocol_header_list_seq(tList* list, Buffer buf, char deli, int fstline, int rcntnt);
47 tList* get_protocol_header_list_file(char* fname, char deli, int fstline, int rcntnt);
48 
49 // ヘッダデータの作成
50 #define create_protocol_header(p, k, v) add_tList_node_bystr((p), 0, 0, (char*)(k), (char*)(v), NULL, 0)
51 #define add_protocol_header(p, k, v) add_tList_node_bystr((p), 0, 0, (char*)(k), (char*)(v), NULL, 0)
52 #define create_protocol_header_Buffer(p, k, v) add_tList_node_byBuffer((p), 0, 0, (k), (v), NULL, 0)
53 #define add_protocol_header_Buffer(p, k, v) add_tList_node_byBuffer((p), 0, 0, (k), (v), NULL, 0)
54 #define delete_protocol_header(p, k, n) del_tList_key((p), (k), (n))
55 
56 // 検索 ldat.valのコピーを返す
57 Buffer search_protocol_header(tList* list, char* key, int no);
58 Buffer search_protocol_header_item (tList* list, char* key, int no, char deli, int nm);
59 Buffer search_protocol_header_value(tList* list, char* key, char* data, int no);
60 Buffer search_protocol_header_partvalue(tList* list, char* key, char* data, int no);
61 
62 #define get_protocol_header(l, k, n) search_protocol_header((l), (k), (n))
63 #define get_protocol_header_item(l, k, n, d, m) search_protocol_header_item((l), (k), (n), (d), (m))
64 #define get_protocol_header_value(l, k, d, n) search_protocol_header_value((l), (k), (d), (n))
65 #define get_protocol_header_partvalue(l, k, d, n) search_protocol_header_partvalue((l), (k), (d), (n))
66 
67 // 設定,置き換え
68 //int set_protocol_header(tList* list, char* key, int no, char* value, int mode);
69 int set_protocol_header(tList* list, char* key, char* value, int no, int mode);
70 
71 #define set_protocol_record_item(l, d, m, v) set_item_tList_node((l), (d), (m), (v))
72 #define replace_protocol_record_item(l, d, m, s, v) replace_item_tList_node((l), (d), (m), (s), (v))
73 
74 
90 #define replace_protocol_header(list, key, no, srcval, value) replace_value_tList((list), (key), (no), (srcval), (value))
91 
92 
107 #define replace_protocol_header_item(list, key, no, deli, nm, srcval, value) replace_item_tList((list), (key), (no), (deli), (nm), (srcval), (value))
108 
109 
123 #define set_protocol_header_item(list, key, no, deli, nm, value) set_item_tList((list), (key), (no), (deli), (nm), (value))
124 
125 
126 //
127 int search_crlfcrlf(char* mesg);
128 int is_header_continue(tList* lp);
129 
130 void print_protocol_header(tList* lp, int content);
131 
133 #endif
134 
unsigned char ** buf
Definition: jpeg_tool.h:96
Buffer search_protocol_header_item(tList *list, char *key, int no, char deli, int nm)
Definition: protocol.c:408
Buffer restore_protocol_contents(tList *pp)
Definition: protocol.c:109
Buffer search_protocol_header(tList *list, char *key, int no)
Definition: protocol.c:372
int set_protocol_header(tList *list, char *key, char *value, int no, int mode)
Definition: protocol.c:574
tList * find_protocol_end(tList *lp)
Definition: protocol.c:665
int search_crlfcrlf(char *mesg)
Definition: protocol.c:600
tList * get_protocol_header_list_seq(tList *list, Buffer buf, char deli, int fstline, int rcntnt)
Definition: protocol.c:181
int is_header_continue(tList *lp)
Definition: protocol.c:631
tList * get_protocol_header_list(Buffer buf, char deli, int fstline, int rcntnt)
Definition: protocol.c:34
void print_protocol_header(tList *lp, int content)
Definition: protocol.c:644
tList * get_protocol_header_list_file(char *fname, char deli, int fstline, int rcntnt)
Definition: protocol.c:341
Buffer search_protocol_header_value(tList *list, char *key, char *data, int no)
Definition: protocol.c:436
Buffer search_protocol_header_partvalue(tList *list, char *key, char *data, int no)
Definition: protocol.c:500
void set_protocol_contents(tList *pp, Buffer cnt)
Definition: protocol.c:132
Buffer restore_protocol_header(tList *pp, char *deli, int mode, int *hdsz)
Definition: protocol.c:55
Definition: buffer.h:35
汎用拡張ツールヘッダ