chiark / gitweb /
Follow new transport configuration interface. Add parameters for flow
[jog] / tx-socket.h
1 /* -*-c-*-
2  *
3  * $Id: tx-socket.h,v 1.1 2002/01/25 19:34:45 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.1  2002/01/25 19:34:45  mdw
33  * Initial revision
34  *
35  */
36
37 #ifndef TX_SOCKET_H
38 #define TX_SOCKET_H
39
40 #ifdef __cplusplus
41   extern "C" {
42 #endif
43
44 /*----- Header files ------------------------------------------------------*/
45
46 #ifdef HAVE_CONFIG_H
47 #  include "config.h"
48 #endif
49
50 #ifndef TXPORT_H
51 #  include "txport.h"
52 #endif
53
54 /*----- Functions provided ------------------------------------------------*/
55
56 extern txport *txsock_create(const char */*file*/, const char */*config*/);
57 extern void *txsock_fetch(void */*txv*/);
58 extern ssize_t txsock_write(txport */*txg*/,
59                             const void */*p*/, size_t /*sz*/);
60 extern void txsock_destroy(txport */*txg*/);
61
62 #ifdef TX_LIST
63    static const struct txfile txsock_fv[] = {
64      { "JOGSOCK", 0 },
65      { DIRVAR, "sim" },
66      { 0, "/var/lib/jog/sim" },
67    };
68
69    static txport_ops txsock_ops = {
70      TX_LIST, "socket", txsock_fv, 0,
71      txsock_create, txsock_fetch, txsock_write, txsock_destroy
72    };
73 #  undef TX_LIST
74 #  define TX_LIST &txsock_ops
75 #endif
76
77 /*----- That's all, folks -------------------------------------------------*/
78
79 #ifdef __cplusplus
80   }
81 #endif
82
83 #endif