diff --git a/doc/hamlib.cfg b/doc/hamlib.cfg new file mode 100644 index 000000000..64bb664fc --- /dev/null +++ b/doc/hamlib.cfg @@ -0,0 +1,24 @@ +## $Id: hamlib.cfg,v 1.1 2001-07-21 12:50:35 f4cfe Exp $ + +PROJECT_NAME = "Hamlib" + +# TODO: replace ../ by $(top_srcdir) et al. + +# Output +OUTPUT_DIRECTORY= . + +OUTPUT_LANGUAGE = English +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_RTF = NO +GENERATE_MAN = YES +MAN_EXTENSION = .3 + +# Input +INPUT = ../src/rig.c +#../c++/rigclass.cc +INCLUDE_PATH = ../include + +EXAMPLE_PATH = ../tests +QUIET = YES +JAVADOC_AUTOBRIEF = YES diff --git a/src/conf.c b/src/conf.c new file mode 100644 index 000000000..aefcc78a8 --- /dev/null +++ b/src/conf.c @@ -0,0 +1,87 @@ +/* + * Hamlib Interface - configuration interface + * Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton + * + * $Id: conf.c,v 1.1 2001-07-21 12:55:04 f4cfe Exp $ + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include /* Standard input/output definitions */ +#include /* String function definitions */ +#include /* UNIX standard function definitions */ + +#define HAMLIB_DLL +#include + +#include "conf.h" + +#define TOK_EXAMPLE RIG_TOKEN_FRONTEND(1) + +/* + * Place holder for now. Here will be defined all the configuration + * options available in the rig->state struct. + */ +static const struct confparams frontend_cfg_params[] = { + { TOK_EXAMPLE, "example", "Example", "Frontend conf param example", + "0", RIG_CONF_NUMERIC, { n: { 0, 10, 1 } } + }, + { RIG_CONF_END, NULL, } +}; + +int frontend_set_conf(RIG *rig, token_t token, const char *val) +{ + return -RIG_ENIMPL; +} + +int frontend_get_conf(RIG *rig, token_t token, char *val) +{ + return -RIG_ENIMPL; +} + +/* + * lookup only in backend config table + * should use Lex to speed it up, strcmp hurts! + */ +const struct confparams *rig_confparam_lookup(RIG *rig, const char *name) +{ + const struct confparams *cfp; + + if (!rig || !rig->caps || !rig->caps->cfgparams) + return NULL; + for (cfp = rig->caps->cfgparams; cfp->name; cfp++) + if (!strcmp(cfp->name, name)) + return cfp; + return NULL; +} + +token_t rig_token_lookup(RIG *rig, const char *name) +{ + const struct confparams *cfp; + + cfp = rig_confparam_lookup(rig, name); + if (!cfp) + return RIG_CONF_END; + + return cfp->token; +} + diff --git a/src/conf.h b/src/conf.h new file mode 100644 index 000000000..fd8ced77c --- /dev/null +++ b/src/conf.h @@ -0,0 +1,34 @@ +/* + * Hamlib Interface - configuration header + * Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton + * + * $Id: conf.h,v 1.1 2001-07-21 12:55:04 f4cfe Exp $ + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library 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 Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef _CONF_H +#define _CONF_H 1 + +#include + + +int frontend_set_conf(RIG *rig, token_t token, const char *val); +int frontend_get_conf(RIG *rig, token_t token, char *val); + + +#endif /* _CONF_H */ +