scriptcntl.h

来自「VoiFax is a program that manage voice/da」· C头文件 代码 · 共 85 行

H
85
字号
/*  voifax low level scripting control library *  Copyright (C) 2004  Simone Freddio & Andrea Emanuelli * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program 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 General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#ifndef SCRIPTCNTL_H#define SCRIPTCNTL_H#include "common.h"#define FD_WRITE		"VOICE_OUTPUT"#define FD_READ			"VOICE_INPUT"#define VOICE_PID		"VOICE_PID"typedef struct{	char	script_name[200];	int		pipe_to_script[2];	int		pipe_from_script[2];	int		script_pid;} t_scriptcntl;int sc_launch(t_scriptcntl *sc, char *scrname);/*		Esegue lo script scrname come child inizializzando le variabili d'ambiente		FD_WRITE e FD_READ per il colloquio dati.		(o)	sc				struttura con i dati del child		(i)	scrname		nome dello script da eseguire		Valori di ritorno:	true	= inizializzazione ok	 											false	= errore di inizializzazione*/int sc_send(t_scriptcntl *sc, char *cmd);/*		Invia il comando cmd allo script specificato da sc.		(i)	sc		struttura con i dati del child		(i)	cmd		comando da inviare		Valori di ritorno:	true	= comando inviato	 											false	= errore*/int sc_receive(t_scriptcntl *sc, char *buf, int maxlen);/*		Riceve un comando dallo script specificato da sc.		La funzione e' bloccante.		(i)	sc				struttura con i dati del child		(o)	buf				comando ricevuto		(i)	maxlen		dimensione buffer di uscita		Valori di ritorno:	true	= comando ricevuto	 											false	= errore*/int sc_receiveready(t_scriptcntl *sc);/*		Controlla se ci sono dati in coda dallo script sc.		La funzione NON e' bloccante.		(i)	sc				struttura con i dati del child		Valori di ritorno:	true	= dati da ricevere	 											false	= nessun dato in coda*/#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?