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 * helper.h 00022 * 00023 * $Id: helper.h,v 1.3 2009/07/09 16:19:23 ndmn Exp $ 00024 * 00025 ***************************************************************/ 00026 00027 #ifndef __NCHAINS_HELPER_H 00028 #define __NCHAINS_HELPER_H 00029 00030 #include "defs.h" 00031 #include "commands.h" 00032 00033 /** 00034 * Prompts for input of maximum length <i>length</i> at position ny and nx. 00035 * Returns the input or NULL 00036 */ 00037 char * nc_prompt(struct _application *app, int ny, int nx, int length, const char * fmt, ...); 00038 00039 /** 00040 * Read input from window at pos ny and nx of maxlength length 00041 */ 00042 char * nc_input(struct _application *app, int ny, int nx, int length); 00043 00044 /** 00045 * Returns the position of chain operator named copname after the cop-list command. 00046 * As this method determines the position within a list, counting starts from <b>zero</b>. 00047 */ 00048 extern int nc_get_coplist_index(struct _application *app, const char *copname); 00049 /** 00050 * Returns the position of chain operator named copname after the cop-list command. 00051 * This method does the same as the above except that <b>it starts counting from 1</b>. 00052 * This is done to properly map chain operator indices. 00053 */ 00054 extern int nc_get_copindex(struct _application *app, const char *copname); 00055 00056 00057 #endif /* __NCHAINS_HELPER_H */