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