-
Notifications
You must be signed in to change notification settings - Fork 0
/
req_handler.h
28 lines (23 loc) · 979 Bytes
/
req_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __REQ_HANDLER__
#define __REQ_HANDLER__
#include "global.h"
struct terminal_info_struct
{
int id;
char card_type[CARD_NAME_LENGTH];
char transaction_type[TRANS_NAME_LENGTH];
int flag; /* 0 = spare, 1 = used */
};
/* In-memory array, maximum number of DB slots = maximum number of terminal slots */
/* Maximum number of terminal slots depend on system capacity */
struct terminal_info_struct gl_terminal_info[MAXTERMID];
extern void init_db();
extern int svr_process_req (char * input_data, char * resp_data);
extern int query_term_info(int id, char *term_info);
extern int query_term_list (char *term_list);
extern int parse_json(char * p_msg, struct terminal_info_struct *term_info_ptr);
extern int find_spare_id(int *id_ptr);
extern int insert_db(struct terminal_info_struct *terminal_info_ptr);
extern int query_db(int id, struct terminal_info_struct * tm_db_ptr);
extern int struct2json(struct terminal_info_struct * tm_db_ptr, char tm_json[]);
#endif