Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

conf.c File Reference

Rig configuration interface. More...

#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <hamlib/rig.h>
#include "token.h"

Functions

int rig_token_foreach (RIG *rig, int(*cfunc)(const struct confparams *, char *), char *data)
 call a function against each configuration token of a rig
const struct confparamsrig_confparam_lookup (RIG *rig, const char *name)
 lookup a confparam struct
token_t rig_token_lookup (RIG *rig, const char *name)
 lookup a token id
int rig_set_conf (RIG *rig, token_t token, const char *val)
 set a radio configuration parameter
int rig_get_conf (RIG *rig, token_t token, char *val)
 get the value of a configuration parameter


Detailed Description

Rig configuration interface.

Author:
Stephane Fillod
Date:
2000-2006

Function Documentation

const struct confparams* rig_confparam_lookup RIG rig,
const char *  name
 

lookup a confparam struct

Parameters:
rig The rig handle
name The name of the configuration parameter
Lookup conf token by its name.

Returns:
a pointer to the confparams struct if found, otherwise NULL.

int rig_get_conf RIG rig,
token_t  token,
char *  val
 

get the value of a configuration parameter

Parameters:
rig The rig handle
token The parameter
val The location where to store the value of config token
Retrieves the value of a configuration paramter associated with token. The location pointed to by val must be large enough to hold the value of the config.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_conf()

int rig_set_conf RIG rig,
token_t  token,
const char *  val
 

set a radio configuration parameter

Parameters:
rig The rig handle
token The parameter
val The value to set the parameter to
Sets a configuration parameter.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_conf()

int rig_token_foreach RIG rig,
int(*)(const struct confparams *, char *)  cfunc,
char *  data
 

call a function against each configuration token of a rig

Parameters:
rig The rig handle
cfunc The function to perform on each token
data Any data to be passed to cfunc
Executes cfunc on all the elements stored in the conf table. rig_token_foreach starts first with backend conf table, then finish with frontend table.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

token_t rig_token_lookup RIG rig,
const char *  name
 

lookup a token id

Parameters:
rig The rig handle
name The name of the configuration parameter
Simple lookup returning token id assicated with name.

Returns:
the token id if found, otherwise RIG_CONF_END


Generated on Sat Sep 30 15:49:37 2006 for Hamlib - the C library reference by  doxygen 1.4.4