ppc.h

00001 /*
00002  * Copyright (c) 2005-2012 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: ppc.h,v 1.10 2006/01/09 12:38:37 tat Exp $
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

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved