ppc.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_PPC_H_
00012 #define _KLONE_PPC_H_
00013
00014 #include <stdlib.h>
00015 #include <unistd.h>
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021 enum { PPC_MAX_DATA_SIZE = 8192 };
00022
00023 struct ppc_s;
00024 typedef struct ppc_s ppc_t;
00025
00026 typedef int (*ppc_cb_t)(ppc_t*, int fd, unsigned char cmd, char *data,
00027 size_t size, void*arg);
00028
00029 int ppc_create(ppc_t **pppc);
00030 int ppc_free(ppc_t *ppc);
00031 int ppc_register(ppc_t *ppc, unsigned char cmd, ppc_cb_t func, void *arg);
00032 int ppc_dispatch(ppc_t *ppc, int fd, unsigned char cmd, char *data,
00033 size_t size);
00034 ssize_t ppc_write(ppc_t *ppc, int fd, unsigned char cmd, char *data,
00035 size_t size);
00036 ssize_t ppc_read(ppc_t *ppc, int fd, unsigned char *cmd, char *data,
00037 size_t size);
00038
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042
00043 #endif