/usr/include/sfi/sficomwire.h is in libbse-dev 0.7.4-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | /* SFI - Synthesis Fusion Kit Interface
* Copyright (C) 2002 Tim Janik
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* A copy of the GNU Lesser General Public License should ship along
* with this library; if not, see http://www.gnu.org/copyleft/.
*/
#ifndef __SFI_COM_WIRE_H__
#define __SFI_COM_WIRE_H__
#include <sfi/sfitypes.h>
#include <sfi/sfiring.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _SfiComWire SfiComWire;
typedef gboolean (*SfiComDispatch) (gpointer data,
guint request,
const gchar *request_msg,
SfiComWire *wire);
struct _SfiComWire
{
gchar *ident; /* debugging identifier for this connection */
gpointer owner; /* ScriptControl object */
guint connected : 1;
guint remote_input_broke : 1;
guint remote_output_broke : 1;
guint standard_input_broke : 1;
guint standard_output_broke : 1;
guint standard_error_broke : 1;
SfiComDispatch dispatch_func;
gpointer dispatch_data;
GDestroyNotify destroy_data;
/* message queues */
GList *orequests; /* outgoing requests */
GList *iresults; /* incoming results */
GList *irequests; /* incoming requests */
GList *rrequests; /* received requests */
/* I/O channels */
gint remote_input; /* readable */
gint remote_output; /* writable */
/* spawned child */
gint standard_input; /* writable */
gint standard_output; /* readable */
gint standard_error; /* readable */
gint remote_pid;
GString *gstring_stdout;
GString *gstring_stderr;
/* input buffer */
guint8 *ibuffer;
guint8 *ibp;
guint8 *ibound;
/* output buffer */
guint8 *obuffer;
guint8 *obp;
guint8 *obound;
};
typedef enum /*< skip >*/
{
SFI_COM_MSG_INVALID = 0,
SFI_COM_MSG_RESERVED1 = 1,
SFI_COM_MSG_RESERVED2 = 2,
SFI_COM_MSG_RESERVED3 = 3,
SFI_COM_MSG_RESERVED4 = 4,
SFI_COM_MSG_REQUEST = 5,
SFI_COM_MSG_RESULT = 6
} SfiComMsgType;
#define BSE_MAGIC_BSEm (0x4253456d) /* "BSEm" */
typedef struct
{
guint32 magic; /* "BSEm" 0x4253456d */
guint32 mlength; /* total length, including magic */
guint32 type;
guint32 request;
gchar *message;
} SfiComMsg;
/* create wires */
SfiComWire* sfi_com_wire_from_pipe (const gchar *ident,
gint remote_input,
gint remote_output);
SfiComWire* sfi_com_wire_from_child (const gchar *ident,
gint remote_input,
gint remote_output,
gint standard_input,
gint standard_output,
gint standard_error,
gint remote_pid);
/* handle outgoing */
guint sfi_com_wire_send_request (SfiComWire *wire,
const gchar *request_msg);
gchar* sfi_com_wire_receive_result (SfiComWire *wire,
guint request);
void sfi_com_wire_forget_request (SfiComWire *wire,
guint request);
guint sfi_com_wire_peek_first_result (SfiComWire *wire);
/* handle incomming */
const gchar* sfi_com_wire_receive_request (SfiComWire *wire,
guint *request);
void sfi_com_wire_send_result (SfiComWire *wire,
guint request,
const gchar *result_msg);
void sfi_com_wire_discard_request (SfiComWire *wire,
guint request);
/* dispatching */
void sfi_com_wire_set_dispatcher (SfiComWire *wire,
SfiComDispatch dispatch_func,
gpointer dispatch_data,
GDestroyNotify destroy_data);
void sfi_com_wire_dispatch (SfiComWire *wire,
guint request);
gboolean sfi_com_wire_need_dispatch (SfiComWire *wire);
/* wire I/O */
gint* sfi_com_wire_get_read_fds (SfiComWire *wire,
guint *n_fds);
gint* sfi_com_wire_get_write_fds (SfiComWire *wire,
guint *n_fds);
GPollFD* sfi_com_wire_get_poll_fds (SfiComWire *wire,
guint *n_pfds);
void sfi_com_wire_process_io (SfiComWire *wire);
gchar* sfi_com_wire_collect_stdout (SfiComWire *wire,
guint *n_chars);
gchar* sfi_com_wire_collect_stderr (SfiComWire *wire,
guint *n_chars);
/* shutdown */
void sfi_com_wire_close_remote (SfiComWire *wire,
gboolean terminate);
void sfi_com_wire_destroy (SfiComWire *wire);
/* convenience */
gboolean sfi_com_wire_receive_dispatch (SfiComWire *wire);
void sfi_com_wire_select (SfiComWire *wire,
guint timeout);
gchar* sfi_com_wire_ping_pong (SfiComWire *wire,
const gchar *ping,
guint timeout);
/* --- fork/exec --- */
void sfi_com_set_spawn_dir (const gchar *cwd);
gchar* sfi_com_spawn_async (const gchar *executable,
gint *child_pid,
gint *standard_input,
gint *standard_output,
gint *standard_error,
const gchar *command_fd_option,
gint *command_input,
gint *command_output,
SfiRing *args);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __SFI_COM_WIRE_H__ */
|