📄 scriptcntl.h
字号:
/* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -