00001 /*********************************************************************** 00002 * 00003 * Copyright (C) 2009 Nils Doormann <ndmn@users.sourceforge.net> 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 * 00018 ***********************************************************************/ 00019 00020 /*********************************************************************** 00021 * client.h 00022 * 00023 * $Id: client.h,v 1.1.1.1 2009/06/04 14:54:56 ndmn Exp $ 00024 * 00025 ***********************************************************************/ 00026 00027 #ifndef __NCHAINS_CLIENT_H 00028 #define __NCHAINS_CLIENT_H 00029 00030 #include "defs.h" 00031 #include "interface.h" 00032 00033 #include <errno.h> 00034 #include <netdb.h> 00035 #include <netinet/in.h> 00036 #include <sys/types.h> 00037 #include <sys/socket.h> 00038 #include <stdio.h> 00039 #include <stdlib.h> 00040 #include <unistd.h> 00041 00042 /** 00043 * @desc The socket file descriptor 00044 */ 00045 //int cl_sfd; 00046 00047 /** 00048 * @desc The socket file pointer 00049 */ 00050 //FILE *cl_sfp; 00051 00052 /** 00053 * @desc Set up a client connection to the ecasound server. 00054 */ 00055 extern int cl_setup_connection(struct _application *app); 00056 00057 /** 00058 * @desc Closes the client connection to the ecasound server. 00059 */ 00060 extern void cl_close_connection(struct _application *app); 00061 00062 /** 00063 * @desc Executes an ecasound command on the ecasound server. 00064 * See man ecasound-iam(1) for a command list. 00065 * 00066 * @param cmd The ecasound command string and its parameters 00067 */ 00068 extern int cl_command(struct _application *app,const char *cmd); 00069 00070 /** 00071 * @desc Read an ecasound server response into <b>buf</b>. 00072 * 00073 * @param win The curses main window 00074 * @param buf The result string from the server 00075 * @param rcode The return code from the server 00076 * @param size The number of characters returned into buf 00077 * @param type The type indicator of the returned type. This can be one of e,s,S,f? 00078 */ 00079 extern void cl_read(struct _application *app,char *buf, int *rcode, int *size, char *type); 00080 00081 #endif /* __NCHAINS_CLIENT_H */