c-hglib
 All Data Structures Files Functions Variables Typedefs Macros
client.h
Go to the documentation of this file.
1 #ifndef _CLIENT_H_
2 #define _CLIENT_H_
3 
4 #include <errno.h>
5 #include <stdint.h>
6 #include <sys/types.h>
7 
8 
29 typedef struct hg_header{
30  char channel;
31  uint32_t length;
32 } hg_header;
33 
56 typedef struct hg_handle{
57  pid_t childpid;
59  int p_read;
60  int p_write;
61 
62 } hg_handle;
63 
64 
84 hg_handle *hg_open(const char *path, char *encoding);
85 
98 int hg_close(hg_handle **handle);
99 
114 int hg_rawcommand(hg_handle *handle, char *const command[], size_t cmd_size);
115 
131 int hg_rawread(hg_handle *handle, char *buffer, size_t sizebuff);
132 
149 int hg_rawwrite(hg_handle *handle, const char *buffer, size_t sizebuff);
150 
165 char hg_channel(hg_handle *handle);
166 
178 hg_header hg_head(hg_handle *handle);
179 
194 int hg_exitcode(hg_handle *handle);
195 
196 #endif
197