25 lines
712 B
C
25 lines
712 B
C
#ifndef _COC_CLIENT_H_
|
|
#define _COC_CLIENT_H_
|
|
|
|
#include "coc_util.h"
|
|
|
|
typedef struct {
|
|
int fd, port;
|
|
CocVar *varList;
|
|
Str_Buf *cmdbuf; /* for sending command */
|
|
Str_Buf *resbuf; /* for response */
|
|
char host[64];
|
|
char magic[32];
|
|
char startcmd[512];
|
|
} CocConn;
|
|
|
|
int CocInitClient(CocConn *conn, char *host, int port, char *magic, int bufsize, char *startcmd);
|
|
int CocSendMagic(CocConn *conn, char *magic);
|
|
int CocCmd(CocConn *conn, const char *rwList);
|
|
int CocSet(CocConn *conn, const char *name, const char *value);
|
|
int CocGetN(CocConn *conn, const char *name, char *value, int reslen);
|
|
#define CocGet(C,N,V) CocGetN(C,N,V,sizeof(V))
|
|
void CocCloseClient(CocConn *conn);
|
|
|
|
#endif /* _COC_CLIENT_H_ */
|