New header file.
[jog] / tx-socket.h
1 /* -*-c-*-
2 *
3 * $Id: tx-socket.h,v 1.2 2002/01/30 09:25:35 mdw Exp $
4 *
5 * Socket transport
6 *
7 * (c) 2001 Mark Wooding
8 */
9
10 /*----- Licensing notice --------------------------------------------------*
11 *
12 * This file is part of Jog: Programming for a jogging machine.
13 *
14 * Jog is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * Jog is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Jog; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29 /*----- Revision history --------------------------------------------------*
30 *
31 * $Log: tx-socket.h,v $
32 * Revision 1.2 2002/01/30 09:25:35 mdw
33 * Minor modifications for the transport configuration change.
34 *
35 * Revision 1.1 2002/01/25 19:34:45 mdw
36 * Initial revision
37 *
38 */
39
40 #ifndef TX_SOCKET_H
41 #define TX_SOCKET_H
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /*----- Header files ------------------------------------------------------*/
48
49 #ifdef HAVE_CONFIG_H
50 # include "config.h"
51 #endif
52
53 #ifndef TXPORT_H
54 # include "txport.h"
55 #endif
56
57 /*----- Functions provided ------------------------------------------------*/
58
59 extern txport *txsock_create(const char */*file*/);
60 extern void *txsock_fetch(void */*txv*/);
61 extern ssize_t txsock_write(txport */*txg*/,
62 const void */*p*/, size_t /*sz*/);
63 extern void txsock_destroy(txport */*txg*/);
64
65 #ifdef TX_LIST
66 static const struct txfile txsock_fv[] = {
67 { "JOGSOCK", 0 },
68 { DIRVAR, "sim" },
69 { 0, "/var/lib/jog/sim" },
70 };
71
72 static txport_ops txsock_ops = {
73 TX_LIST, "socket", txsock_fv, 0,
74 txsock_create, 0, txsock_fetch, txsock_write, txsock_destroy
75 };
76 # undef TX_LIST
77 # define TX_LIST &txsock_ops
78 #endif
79
80 /*----- That's all, folks -------------------------------------------------*/
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif