minor changes
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "coc_util.h"
|
||||
|
||||
typedef struct {
|
||||
/* private */
|
||||
int fd, port;
|
||||
CocVar *varList;
|
||||
Str_Buf *cmdbuf; /* for sending command */
|
||||
@@ -14,11 +15,35 @@ typedef struct {
|
||||
} CocConn;
|
||||
|
||||
int CocInitClient(CocConn *conn, char *host, int port, char *magic, int bufsize, char *startcmd);
|
||||
/* initialize a connection to the server process
|
||||
*/
|
||||
|
||||
int CocSendMagic(CocConn *conn, char *magic);
|
||||
/* send magic word to the server for changing access rights
|
||||
*/
|
||||
|
||||
int CocCmd(CocConn *conn, const char *rwList);
|
||||
/* rwList consists of a list of variables to be read or written.
|
||||
Variables must be separated with commas, variables to be written
|
||||
must be enclosed in square brackets.
|
||||
|
||||
Example (read p1 and p4, write p2 and p3):
|
||||
CocCmd(&conn, "p1,[p2,p3],p4")
|
||||
|
||||
see COC_UTIL.H for the definiton of variables
|
||||
*/
|
||||
|
||||
int CocSet(CocConn *conn, const char *name, const char *value);
|
||||
/*
|
||||
set one variable
|
||||
*/
|
||||
int CocGetN(CocConn *conn, const char *name, char *value, int reslen);
|
||||
#define CocGet(C,N,V) CocGetN(C,N,V,sizeof(V))
|
||||
/*
|
||||
read one variable. Use the macro if value is a fixed length array
|
||||
*/
|
||||
void CocCloseClient(CocConn *conn);
|
||||
|
||||
/*
|
||||
close the connection to the server
|
||||
*/
|
||||
#endif /* _COC_CLIENT_H_ */
|
||||
|
||||
Reference in New Issue
Block a user