* added ABI VERSION to backend entry point symbol name

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1442 7ae35d74-ebe9-4afe-98af-79ac388436b8
This commit is contained in:
Stéphane Fillod, F8CFE 2003-04-16 22:30:43 +00:00
parent 0dd531ac30
commit 960c83c4c5
45 changed files with 183 additions and 168 deletions

View File

@ -2,7 +2,7 @@
* Hamlib Alinco backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: alinco.c,v 1.15 2003-04-07 22:41:44 fillods Exp $
* $Id: alinco.c,v 1.16 2003-04-16 22:30:38 fillods 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
@ -33,6 +33,7 @@
#include <serial.h>
#include <misc.h>
#include <cal.h>
#include <register.h>
#include "alinco.h"
@ -820,7 +821,7 @@ int alinco_get_mem(RIG *rig, vfo_t vfo, int *ch)
/*
* initrigs_alinco is called by rig_backend_load
*/
int initrigs_alinco(void *be_handle)
DECLARE_INITRIG_BACKEND(alinco)
{
rig_debug(RIG_DEBUG_VERBOSE, "alinco: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib Alinco backend - main header
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: alinco.h,v 1.11 2003-04-06 18:40:35 fillods Exp $
* $Id: alinco.h,v 1.12 2003-04-16 22:30:38 fillods 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
@ -56,8 +56,5 @@ int alinco_get_mem(RIG *rig, vfo_t vfo, int *ch);
extern const struct rig_caps dx77_caps;
extern BACKEND_EXPORT(int) initrigs_alinco(void *be_handle);
#endif /* _ALINCO_H */

View File

@ -2,7 +2,7 @@
* Hamlib AOR backend - main file
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: aor.c,v 1.23 2003-04-07 22:41:44 fillods Exp $
* $Id: aor.c,v 1.24 2003-04-16 22:30:38 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "aor.h"
@ -502,7 +503,7 @@ const char *aor_get_info(RIG *rig)
/*
* initrigs_aor is called by rig_backend_load
*/
int initrigs_aor(void *be_handle)
DECLARE_INITRIG_BACKEND(aor)
{
rig_debug(RIG_DEBUG_VERBOSE, "aor: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib AOR backend - main header
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: aor.h,v 1.13 2003-02-24 22:27:41 fillods Exp $
* $Id: aor.h,v 1.14 2003-04-16 22:30:39 fillods 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
@ -47,8 +47,5 @@ extern const struct rig_caps ar8000_caps;
extern const struct rig_caps ar5000_caps;
extern const struct rig_caps ar3000a_caps;
extern BACKEND_EXPORT(int) initrigs_aor(void *be_handle);
#endif /* _AOR_H */

View File

@ -7,12 +7,17 @@ AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AM_CONFIG_HEADER(include/config.h)
AM_MAINTAINER_MODE
ABI_VERSION=1
# Minimum Autoconf version required.
AC_PREREQ(2.50)
dnl Pick up the Hamlib macros.
AM_ACLOCAL_INCLUDE(macros)
AC_DEFINE_UNQUOTED(ABI_VERSION, $ABI_VERSION, [Frontend ABI version])
AC_SUBST(ABI_VERSION)
dnl directory for docs (html)
hamlibdocdir=$datadir/doc/hamlib
AC_SUBST(hamlibdocdir)

View File

@ -2,7 +2,7 @@
* Hamlib Drake backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: drake.c,v 1.4 2003-04-07 22:41:56 fillods Exp $
* $Id: drake.c,v 1.5 2003-04-16 22:30:39 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "drake.h"
@ -205,7 +206,7 @@ const char *drake_get_info(RIG *rig)
/*
* initrigs_drake is called by rig_backend_load
*/
int initrigs_drake(void *be_handle)
DECLARE_INITRIG_BACKEND(drake)
{
rig_debug(RIG_DEBUG_VERBOSE, "drake: _init called\n");
@ -215,9 +216,9 @@ int initrigs_drake(void *be_handle)
}
/*
* probe_drake
* probe_drake(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
*/
rig_model_t probeallrigs_drake(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
DECLARE_PROBERIG_BACKEND(drake)
{
static unsigned char idbuf[BUFSZ];
int retval, id_len;

View File

@ -2,7 +2,7 @@
* Hamlib Drake backend - main header
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: drake.h,v 1.3 2003-03-10 08:26:08 fillods Exp $
* $Id: drake.h,v 1.4 2003-04-16 22:30:39 fillods 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
@ -33,9 +33,5 @@ const char *drake_get_info(RIG *rig);
extern const struct rig_caps r8b_caps;
extern BACKEND_EXPORT(int) initrigs_drake(void *be_handle);
extern BACKEND_EXPORT(rig_model_t) probeallrigs_drake(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data);
#endif /* _DRAKE_H */

View File

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: dummy.c,v 1.33 2003-04-07 22:41:46 fillods Exp $
* $Id: dummy.c,v 1.34 2003-04-16 22:30:39 fillods 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
@ -34,6 +34,7 @@
#include "misc.h"
#include "tones.h"
#include "idx_builtin.h"
#include "register.h"
#include "dummy.h"
@ -1136,7 +1137,7 @@ const struct rig_caps dummy_caps = {
.get_trn = dummy_get_trn,
};
int initrigs_dummy(void *be_handle)
DECLARE_INITRIG_BACKEND(dummy)
{
rig_debug(RIG_DEBUG_VERBOSE, "dummy: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
*
* $Id: dummy.h,v 1.5 2001-12-28 20:28:03 fillods Exp $
* $Id: dummy.h,v 1.6 2003-04-16 22:30:39 fillods 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
@ -26,6 +26,4 @@
extern const struct rig_caps dummy_caps;
extern BACKEND_EXPORT(int) initrigs_dummy(void *be_handle);
#endif /* _DUMMY_H */

View File

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: rot_dummy.c,v 1.5 2003-04-07 22:41:47 fillods Exp $
* $Id: rot_dummy.c,v 1.6 2003-04-16 22:30:39 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rotator.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "rot_dummy.h"
@ -187,7 +188,7 @@ const struct rot_caps dummy_rot_caps = {
.get_info = dummy_rot_get_info,
};
int initrots_dummy(void *be_handle)
DECLARE_INITROT_BACKEND(dummy)
{
rig_debug(RIG_DEBUG_VERBOSE, "dummy: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
*
* $Id: rot_dummy.h,v 1.1 2001-12-28 20:29:33 fillods Exp $
* $Id: rot_dummy.h,v 1.2 2003-04-16 22:30:39 fillods 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
@ -26,6 +26,4 @@
extern const struct rot_caps dummy_rot_caps;
extern BACKEND_EXPORT(int) initrots_dummy(void *be_handle);
#endif /* _ROT_DUMMY_H */

View File

@ -3,7 +3,7 @@
* Copyright (c) 2001-2003 by Stephane Fillod
* Contributed by Francois Retief <fgretief@sun.ac.za>
*
* $Id: easycomm.c,v 1.4 2003-04-07 22:41:48 fillods Exp $
* $Id: easycomm.c,v 1.5 2003-04-16 22:30:39 fillods 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
@ -33,6 +33,7 @@
#include "hamlib/rotator.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "easycomm.h"
@ -315,7 +316,7 @@ const struct rot_caps easycomm2_rot_caps = {
/* ************************************************************************* */
int initrots_easycomm(void *be_handle)
DECLARE_INITROT_BACKEND(easycomm)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);

View File

@ -1,9 +1,9 @@
/*
* Hamlib Rotator backend - Easycomm interface protocol
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
* Contributed by Francois Retief <fgretief@sun.ac.za>
*
* $Id: easycomm.h,v 1.1 2002-01-16 16:35:22 fgretief Exp $
* $Id: easycomm.h,v 1.2 2003-04-16 22:30:39 fillods 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
@ -27,6 +27,4 @@
extern const struct rot_caps easycomm1_rot_caps;
extern const struct rot_caps easycomm2_rot_caps;
extern BACKEND_EXPORT(int) initrots_easycomm(void *be_handle);
#endif /* _ROT_EASYCOMM_H */

View File

@ -2,7 +2,7 @@
* Hamlib Rotator backend - Fodtrack parallel port
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: fodtrack.c,v 1.2 2003-04-07 22:41:49 fillods Exp $
* $Id: fodtrack.c,v 1.3 2003-04-16 22:30:39 fillods 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
@ -42,6 +42,7 @@
#include "hamlib/rotator.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "fodtrack.h"
@ -136,7 +137,7 @@ const struct rot_caps fodtrack_rot_caps = {
/* ************************************************************************* */
int initrots_fodtrack(void *be_handle)
DECLARE_INITROT_BACKEND(fodtrack)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);

View File

@ -1,8 +1,8 @@
/*
* Hamlib Rotator backend - Fodtrack interface protocol
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: fodtrack.h,v 1.1 2002-11-28 22:24:10 fillods Exp $
* $Id: fodtrack.h,v 1.2 2003-04-16 22:30:40 fillods 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
@ -25,6 +25,4 @@
extern const struct rot_caps fodtrack_rot_caps;
extern BACKEND_EXPORT(int) initrots_fodtrack(void *be_handle);
#endif /* _ROT_FODTRACK_H */

View File

@ -2,7 +2,7 @@
* Hamlib GNUradio backend - main header
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: gnuradio.h,v 1.3 2003-04-06 18:50:21 fillods Exp $
* $Id: gnuradio.h,v 1.4 2003-04-16 22:30:40 fillods 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
@ -65,8 +65,6 @@ extern const struct rig_caps gr_caps;
extern const struct rig_caps mc4020_caps;
extern const struct rig_caps graudio_caps;
extern BACKEND_EXPORT(int) initrigs_gnuradio(void *be_handle);
__END_DECLS
#endif /* _GNURADIO_H */

View File

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main file
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: icom.c,v 1.74 2003-04-07 22:41:50 fillods Exp $
* $Id: icom.c,v 1.75 2003-04-16 22:30:40 fillods 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
@ -34,6 +34,7 @@
#include <misc.h>
#include <cal.h>
#include <token.h>
#include <register.h>
#include "icom.h"
#include "icom_defs.h"
@ -2383,9 +2384,10 @@ int icom_decode_event(RIG *rig)
* init_icom is called by rig_probe_all (register.c)
*
* probe_icom reports all the devices on the CI-V bus.
* TODO: try different speeds
*
* rig_model_t probeallrigs_icom(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
*/
rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
DECLARE_PROBERIG_BACKEND(icom)
{
unsigned char buf[MAXFRAMELEN], civ_addr, civ_id;
int frm_len, i;
@ -2394,23 +2396,23 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
int rates[] = { 19200, 9600, 300, 0 };
int rates_idx;
if (!p)
if (!port)
return RIG_MODEL_NONE;
if (p->type.rig != RIG_PORT_SERIAL)
if (port->type.rig != RIG_PORT_SERIAL)
return RIG_MODEL_NONE;
p->write_delay = p->post_write_delay = 0;
p->retry = 1;
port->write_delay = port->post_write_delay = 0;
port->retry = 1;
/*
* try for all different baud rates
*/
for (rates_idx = 0; rates[rates_idx]; rates_idx++) {
p->parm.serial.rate = rates[rates_idx];
p->timeout = 2*1000/rates[rates_idx] + 40;
port->parm.serial.rate = rates[rates_idx];
port->timeout = 2*1000/rates[rates_idx] + 40;
retval = serial_open(p);
retval = serial_open(port);
if (retval != RIG_OK)
return RIG_MODEL_NONE;
@ -2426,16 +2428,16 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
frm_len = make_cmd_frame(buf, civ_addr, C_RD_TRXID, S_RD_TRXID,
NULL, 0);
serial_flush(p);
write_block(p, buf, frm_len);
serial_flush(port);
write_block(port, buf, frm_len);
/* read out the bytes we just sent
* TODO: check this is what we expect
*/
frm_len = read_icom_frame(p, buf);
frm_len = read_icom_frame(port, buf);
/* this is the reply */
frm_len = read_icom_frame(p, buf);
frm_len = read_icom_frame(port, buf);
/* timeout.. nobody's there */
if (frm_len <= 0)
@ -2445,7 +2447,7 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
/* protocol error, unexpected reply.
* is this a CI-V device?
*/
close(p->fd);
close(port->fd);
return RIG_MODEL_NONE;
} else if (buf[4] == NAK) {
/*
@ -2463,7 +2465,7 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
" at %#x\n", civ_id, buf[3]);
model = icom_addr_list[i].model;
if (cfunc)
(*cfunc)(p, model, data);
(*cfunc)(port, model, data);
break;
}
}
@ -2476,7 +2478,7 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
"with CI-V ID %#x, please report to Hamlib "
"developers.\n", civ_id);
}
close(p->fd);
close(port->fd);
/*
* Assumes all the rigs on the bus are running at same speed.
@ -2492,7 +2494,7 @@ rig_model_t probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
/*
* initrigs_icom is called by rig_backend_load
*/
int initrigs_icom(void *be_handle)
DECLARE_INITRIG_BACKEND(icom)
{
rig_debug(RIG_DEBUG_VERBOSE, "icom: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main header
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: icom.h,v 1.55 2003-04-09 06:37:37 fillods Exp $
* $Id: icom.h,v 1.56 2003-04-16 22:30:40 fillods 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
@ -171,9 +171,6 @@ extern const struct rig_caps os535_caps;
extern const struct rig_caps omnivip_caps;
extern BACKEND_EXPORT(rig_model_t) probeallrigs_icom(port_t *p, rig_probe_func_t cfunc, rig_ptr_t data);
extern BACKEND_EXPORT(int) initrigs_icom(void *be_handle);
#endif /* _ICOM_H */

View File

@ -2,7 +2,7 @@
* Hamlib JRC backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: jrc.c,v 1.7 2003-04-07 22:41:52 fillods Exp $
* $Id: jrc.c,v 1.8 2003-04-16 22:30:40 fillods 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
@ -32,6 +32,7 @@
#include "serial.h"
#include "misc.h"
#include "cal.h"
#include "register.h"
#include "jrc.h"
@ -856,7 +857,7 @@ int jrc_decode_event(RIG *rig)
/*
* initrigs_jrc is called by rig_backend_load
*/
int initrigs_jrc(void *be_handle)
DECLARE_INITRIG_BACKEND(jrc)
{
rig_debug(RIG_DEBUG_VERBOSE, "jrc: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib JRC backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: jrc.h,v 1.4 2001-12-28 20:28:03 fillods Exp $
* $Id: jrc.h,v 1.5 2003-04-16 22:30:40 fillods 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
@ -52,8 +52,6 @@ int jrc_decode_event(RIG *rig);
extern const struct rig_caps nrd545_caps;
extern BACKEND_EXPORT(int) initrigs_jrc(void *be_handle);
#endif /* _JRC_H */

View File

@ -2,7 +2,7 @@
* Hamlib Kachina backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: kachina.c,v 1.5 2003-04-07 22:41:52 fillods Exp $
* $Id: kachina.c,v 1.6 2003-04-16 22:30:40 fillods 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
@ -33,6 +33,7 @@
#include "serial.h"
#include "misc.h"
#include "cal.h"
#include "register.h"
#include "kachina.h"
@ -205,7 +206,7 @@ int kachina_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/*
* initrigs_kachina is called by rig_backend_load
*/
int initrigs_kachina(void *be_handle)
DECLARE_INITRIG_BACKEND(kachina)
{
rig_debug(RIG_DEBUG_VERBOSE, "kachina: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib Kachina backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: kachina.h,v 1.3 2001-12-28 20:28:03 fillods Exp $
* $Id: kachina.h,v 1.4 2003-04-16 22:30:41 fillods 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
@ -36,8 +36,6 @@ int kachina_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
extern const struct rig_caps k505dsp_caps;
extern BACKEND_EXPORT(int) initrigs_kachina(void *be_handle);
#endif /* _KACHINA_H */

View File

@ -2,7 +2,7 @@
* Hamlib Kenwood backend - main file
* Copyright (c) 2000-2003 by Stephane Fillod and others
*
* $Id: kenwood.c,v 1.60 2003-04-07 22:41:53 fillods Exp $
* $Id: kenwood.c,v 1.61 2003-04-16 22:30:41 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "kenwood.h"
@ -1311,8 +1312,10 @@ const char* kenwood_get_info(RIG *rig)
*
* Notes:
* There's only one rig possible per port.
*
* rig_model_t probeallrigs_kenwood(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
*/
rig_model_t probeallrigs_kenwood(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
DECLARE_PROBERIG_BACKEND(kenwood)
{
unsigned char idbuf[IDBUFSZ];
int id_len=-1, i, k_id;
@ -1478,7 +1481,7 @@ int kenwood_cleanup(RIG *rig)
/*
* initrigs_kenwood is called by rig_backend_load
*/
int initrigs_kenwood(void *be_handle)
DECLARE_INITRIG_BACKEND(kenwood)
{
rig_debug(RIG_DEBUG_VERBOSE, "kenwood: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib Kenwood backend - main header
* Copyright (c) 2000-2002 by Stephane Fillod
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: kenwood.h,v 1.28 2003-03-15 23:58:41 fillods Exp $
* $Id: kenwood.h,v 1.29 2003-04-16 22:30:41 fillods 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
@ -96,9 +96,6 @@ extern const struct rig_caps thf7a_caps;
extern const struct rig_caps thf7e_caps;
extern const struct rig_caps k2_caps;
extern BACKEND_EXPORT(int) initrigs_kenwood(void *be_handle);
extern BACKEND_EXPORT(rig_model_t) probeallrigs_kenwood(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data);
#endif /* _KENWOOD_H */

View File

@ -1,8 +1,8 @@
/*
* Hamlib Microtune backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: microtune.h,v 1.1 2003-01-29 23:06:30 fillods Exp $
* $Id: microtune.h,v 1.2 2003-04-16 22:30:41 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -36,7 +36,6 @@ int module_4937_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int module_4937_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
extern const struct rig_caps module_4937_caps;
extern BACKEND_EXPORT(int) initrigs_microtune(void *be_handle);
__END_DECLS

View File

@ -2,7 +2,7 @@
* Hamlib microtune backend - 4937 file
* Copyright (c) 2003 by Stephane Fillod
*
* $Id: module_4937.c,v 1.1 2003-01-29 23:06:30 fillods Exp $
* $Id: module_4937.c,v 1.2 2003-04-16 22:30:41 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,6 +27,7 @@
#include <hamlib/rig.h>
#include "register.h"
#include "microtune.h"
/*
@ -93,7 +94,7 @@ const struct rig_caps module_4937_caps = {
};
int initrigs_microtune(void *be_handle)
DECLARE_INITRIG_BACKEND(microtune)
{
rig_debug(RIG_DEBUG_VERBOSE, "microtune: _init called\n");

View File

@ -2,7 +2,7 @@
* Hamlib PCR backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod and Darren Hatcher
*
* $Id: pcr.c,v 1.17 2003-04-07 22:41:55 fillods Exp $
* $Id: pcr.c,v 1.18 2003-04-16 22:30:41 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "pcr.h"
@ -1380,7 +1381,7 @@ int pcr_set_VSC(RIG *rig, int level) // J50xx
/*
* initrigs_pcr is called by rig_backend_load
*/
int initrigs_pcr(void *be_handle)
DECLARE_INITRIG_BACKEND(pcr)
{
rig_debug(RIG_DEBUG_VERBOSE, "pcr: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib PCR backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: pcr.h,v 1.8 2002-08-26 22:33:52 fillods Exp $
* $Id: pcr.h,v 1.9 2003-04-16 22:30:41 fillods 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
@ -76,8 +76,6 @@ int pcr_set_DSP_auto_notch(RIG *rig, int state); // J83xx
extern const struct rig_caps pcr1000_caps;
extern const struct rig_caps pcr100_caps;
extern BACKEND_EXPORT(int) initrigs_pcr(void *be_handle);
#endif /* _PCR_H */

View File

@ -12,7 +12,7 @@
* Hy-Gain is a trademark of MFJ Enterprises
*
*
* $Id: rotorez.c,v 1.6 2003-04-07 22:41:55 fillods Exp $
* $Id: rotorez.c,v 1.7 2003-04-16 22:30:41 fillods Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -42,6 +42,7 @@
#include "hamlib/rotator.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "rotorez.h"
@ -410,7 +411,8 @@ static int rotorez_send_priv_cmd(ROT *rot, const char *cmdstr) {
* Initialize backend
*/
int initrots_rotorez(void *be_handle) {
DECLARE_INITROT_BACKEND(rotorez)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rot_register(&rotorez_rot_caps);

View File

@ -9,7 +9,7 @@
* supports the Hy-Gain DCU-1.
*
*
* $Id: rotorez.h,v 1.4 2003-02-27 03:50:03 n0nb Exp $
* $Id: rotorez.h,v 1.5 2003-04-16 22:30:41 fillods Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -37,8 +37,6 @@ extern const struct rot_caps rotorez_rot_caps;
extern const struct rot_caps rotorcard_rot_caps;
extern const struct rot_caps dcu_rot_caps;
extern BACKEND_EXPORT(int) initrots_rotorez(void *be_handle);
/*
* API local implementation
*

View File

@ -2,7 +2,7 @@
* Hamlib RPC backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: rpcrig_backend.c,v 1.13 2003-04-07 22:41:56 fillods Exp $
* $Id: rpcrig_backend.c,v 1.14 2003-04-16 22:30:42 fillods 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
@ -35,6 +35,7 @@
#include "serial.h"
#include "misc.h"
#include "token.h"
#include "register.h"
#include <rpc/rpc.h>
#ifdef HAVE_RPC_RPCENT_H
@ -1099,7 +1100,7 @@ struct rig_caps rpcrig_caps = {
.reset = rpcrig_reset,
};
int initrigs_rpcrig(void *be_handle)
DECLARE_INITRIG_BACKEND(rpcrig)
{
rig_debug(RIG_DEBUG_VERBOSE, "rpcrig: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib RPC backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: rpcrig_backend.h,v 1.4 2001-12-28 20:28:03 fillods Exp $
* $Id: rpcrig_backend.h,v 1.5 2003-04-16 22:30:42 fillods 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
@ -26,6 +26,4 @@
extern struct rig_caps rpcrig_caps;
extern BACKEND_EXPORT(int) initrigs_rpcrig(void *be_handle);
#endif /* _RPCRIG_H */

View File

@ -1,9 +1,9 @@
/*
* Hamlib RPC backend - main file
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
* Contributed by Francois Retief <fgretief@sun.ac.za>
*
* $Id: rpcrot_backend.c,v 1.6 2003-04-07 22:41:56 fillods Exp $
* $Id: rpcrot_backend.c,v 1.7 2003-04-16 22:30:42 fillods 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
@ -36,6 +36,7 @@
#include "serial.h"
#include "misc.h"
#include "token.h"
#include "register.h"
#include <rpc/rpc.h>
#ifdef HAVE_RPC_RPCENT_H
@ -400,7 +401,7 @@ struct rot_caps rpcrot_caps = {
/* ************************************************************************* */
int initrots_rpcrot(void *be_handle)
DECLARE_INITROT_BACKEND(rpcrot)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);

View File

@ -5,10 +5,10 @@ RIGSRC = rig.c serial.c misc.c register.c event.c cal.c conf.c tones.c \
lib_LTLIBRARIES = libhamlib.la
libhamlib_la_SOURCES = $(RIGSRC)
libhamlib_la_LDFLAGS = -no-undefined -release @VERSION@ -version-info 1:0:0
libhamlib_la_LDFLAGS = -no-undefined -release @VERSION@ -version-info @ABI_VERSION@:0:0
libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(libdir)\"
libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la @MATH_LIBS@
noinst_HEADERS = event.h misc.h serial.h iofunc.h cal.h tones.h \
rot_conf.h token.h idx_builtin.h
rot_conf.h token.h idx_builtin.h register.h

View File

@ -2,7 +2,7 @@
* Hamlib Interface - provides registering for dynamically loadable backends.
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: register.c,v 1.19 2003-04-06 18:34:15 fillods Exp $
* $Id: register.c,v 1.20 2003-04-16 22:30:38 fillods 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
@ -282,23 +282,14 @@ int rig_load_all_backends()
*/
int rig_load_backend(const char *be_name)
{
/*
* determine PREFIX and POSTFIX values from configure script
*/
#ifdef __CYGWIN__
# define PREFIX "cyghamlib-"
# define POSTFIX ".dll"
#else
# define PREFIX "hamlib-"
# define POSTFIX ".la"
#endif
lt_dlhandle be_handle;
int (*be_init)(rig_ptr_t);
int status;
char libname[PATH_MAX];
char initfname[MAXFUNCNAMELEN] = "initrigs_";
char probefname[MAXFUNCNAMELEN] = "probeallrigs_";
char initfname[MAXFUNCNAMELEN];
char probefname[MAXFUNCNAMELEN];
int i;
/*
@ -345,7 +336,7 @@ int rig_load_backend(const char *be_name)
return -RIG_EINVAL;
}
strncat(initfname, be_name, MAXFUNCNAMELEN);
snprintf(initfname, MAXFUNCNAMELEN, "initrigs%d_%s", ABI_VERSION, be_name);
be_init = (int (*)(rig_ptr_t)) lt_dlsym (be_handle, initfname);
if (!be_init) {
rig_debug(RIG_DEBUG_ERR, "rig: dlsym(%s) failed (%s)\n",
@ -362,7 +353,7 @@ int rig_load_backend(const char *be_name)
*/
for (i=0; i<RIG_BACKEND_MAX && rig_backend_list[i].be_name; i++) {
if (!strncmp(be_name, rig_backend_list[i].be_name, 64)) {
strncat(probefname, be_name, MAXFUNCNAMELEN);
snprintf(probefname, MAXFUNCNAMELEN, "probeallrigs%d_%s", ABI_VERSION, be_name);
rig_backend_list[i].be_probe_all =
(rig_model_t (*)(port_t*, rig_probe_func_t, rig_ptr_t))
lt_dlsym (be_handle, probefname);

49
src/register.h Normal file
View File

@ -0,0 +1,49 @@
/*
* Hamlib Interface - plugin registration
* Copyright (c) 2003 by Stephane Fillod
*
* $Id: register.h,v 1.1 2003-04-16 22:30:38 fillods 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 <hamlib/rig.h>
#include <hamlib/rotator.h>
#ifdef DECLARE_INITRIG_BACKEND
#undef DECLARE_INITRIG_BACKEND
#endif
#define DECLARE_INITRIG_BACKEND(backend) extern BACKEND_EXPORT(int) initrigs1_##backend(void *be_handle)
#ifdef DECLARE_PROBERIG_BACKEND
#undef DECLARE_PROBERIG_BACKEND
#endif
#define DECLARE_PROBERIG_BACKEND(backend) extern BACKEND_EXPORT(rig_model_t) probeallrigs1_##backend(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
#ifdef DECLARE_INITROT_BACKEND
#undef DECLARE_INITROT_BACKEND
#endif
#define DECLARE_INITROT_BACKEND(backend) extern BACKEND_EXPORT(int) initrots1_##backend(void *be_handle)
#ifdef DECLARE_PROBEROT_BACKEND
#undef DECLARE_PROBEROT_BACKEND
#endif
#define DECLARE_PROBEROT_BACKEND(backend) extern BACKEND_EXPORT(rot_model_t) probeallrots1_##backend(port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)

View File

@ -1,8 +1,8 @@
/*
* Hamlib Interface - provides registering for dynamically loadable backends.
* Copyright (c) 2000,2001,2002 by Stephane Fillod
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: rot_reg.c,v 1.5 2002-11-04 22:27:49 fillods Exp $
* $Id: rot_reg.c,v 1.6 2003-04-16 22:30:38 fillods 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
@ -259,23 +259,14 @@ int rot_load_all_backends()
*/
int rot_load_backend(const char *be_name)
{
/*
* determine PREFIX and POSTFIX values from configure script
*/
#ifdef __CYGWIN__
# define PREFIX "cyghamlib-"
# define POSTFIX ".dll"
#else
# define PREFIX "hamlib-"
# define POSTFIX ".la"
#endif
lt_dlhandle be_handle;
int (*be_init)(rig_ptr_t);
int status;
char libname[PATH_MAX];
char initfname[MAXFUNCNAMELEN] = "initrots_";
char probefname[MAXFUNCNAMELEN] = "proberots_";
char initfname[MAXFUNCNAMELEN];
char probefname[MAXFUNCNAMELEN];
int i;
/*
@ -320,7 +311,7 @@ int rot_load_backend(const char *be_name)
return -RIG_EINVAL;
}
strncat(initfname, be_name, MAXFUNCNAMELEN);
snprintf(initfname, MAXFUNCNAMELEN, "initrots%d_%s", ABI_VERSION, be_name);
be_init = (int (*)(rig_ptr_t)) lt_dlsym (be_handle, initfname);
if (!be_init) {
rot_debug(RIG_DEBUG_ERR, "rot: dlsym(%s) failed (%s)\n",
@ -337,7 +328,7 @@ int rot_load_backend(const char *be_name)
*/
for (i=0; i<ROT_BACKEND_MAX && rot_backend_list[i].be_name; i++) {
if (!strncmp(be_name, rot_backend_list[i].be_name, 64)) {
strncat(probefname, be_name, MAXFUNCNAMELEN);
snprintf(probefname, MAXFUNCNAMELEN, "probeallrots%d_%s", ABI_VERSION, be_name);
rot_backend_list[i].be_probe = (rot_model_t (*)(port_t *))
lt_dlsym (be_handle, probefname);
break;

View File

@ -2,7 +2,7 @@
* Hamlib Tentec backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: tentec.c,v 1.7 2003-04-07 22:41:58 fillods Exp $
* $Id: tentec.c,v 1.8 2003-04-16 22:30:43 fillods 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
@ -33,6 +33,7 @@
#include "serial.h"
#include "misc.h"
#include "cal.h"
#include "register.h"
#include "tentec.h"
@ -439,7 +440,7 @@ const char *tentec_get_info(RIG *rig)
/*
* initrigs_tentec is called by rig_backend_load
*/
int initrigs_tentec(void *be_handle)
DECLARE_INITRIG_BACKEND(tentec)
{
rig_debug(RIG_DEBUG_VERBOSE, "tentec: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib Tentec backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: tentec.h,v 1.4 2002-01-06 17:49:55 fillods Exp $
* $Id: tentec.h,v 1.5 2003-04-16 22:30:43 fillods 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
@ -62,8 +62,6 @@ const char* tentec_get_info(RIG *rig);
extern const struct rig_caps rx320_caps;
extern const struct rig_caps tt550_caps;
extern BACKEND_EXPORT(int) initrigs_tentec(void *be_handle);
#endif /* _TENTEC_H */

View File

@ -2,7 +2,7 @@
* Hamlib Uniden backend - main file
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: uniden.c,v 1.5 2003-04-07 22:41:58 fillods Exp $
* $Id: uniden.c,v 1.6 2003-04-16 22:30:43 fillods 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
@ -32,6 +32,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "uniden.h"
@ -113,7 +114,7 @@ int uniden_set_mem(RIG *rig, vfo_t vfo, int ch)
/*
* initrigs_uniden is called by rig_backend_load
*/
int initrigs_uniden(void *be_handle)
DECLARE_INITRIG_BACKEND(uniden)
{
rig_debug(RIG_DEBUG_VERBOSE, "uniden: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib Uniden backend - main header
* Copyright (c) 2001,2002 by Stephane Fillod
* Copyright (c) 2001-2003 by Stephane Fillod
*
* $Id: uniden.h,v 1.3 2001-12-28 20:28:04 fillods Exp $
* $Id: uniden.h,v 1.4 2003-04-16 22:30:43 fillods 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
@ -32,8 +32,6 @@ int uniden_set_mem(RIG *rig, vfo_t vfo, int ch);
extern const struct rig_caps bc895_caps;
extern BACKEND_EXPORT(int) initrigs_uniden(void *be_handle);
#endif /* _UNIDEN_H */

View File

@ -3,7 +3,7 @@
* Copyright (C) 2001 pab@users.sourceforge.net
* Derived from hamlib code (C) 2000-2003 Stephane Fillod.
*
* $Id: winradio.c,v 1.17 2003-04-07 22:41:59 fillods Exp $
* $Id: winradio.c,v 1.18 2003-04-16 22:30:43 fillods 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
@ -36,6 +36,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "winradio.h"
@ -229,7 +230,7 @@ const char *wr_get_info(RIG *rig) {
}
int initrigs_winradio(void *be_handle)
DECLARE_INITRIG_BACKEND(winradio)
{
rig_debug(RIG_DEBUG_VERBOSE, "winradio: _init called\n");

View File

@ -1,8 +1,8 @@
/*
* Hamlib WiNRADiO backend - main header
* Copyright (c) 2000,2001,2002 by Stephane Fillod
* Copyright (c) 2000-2003 by Stephane Fillod
*
* $Id: winradio.h,v 1.7 2001-12-28 20:28:04 fillods Exp $
* $Id: winradio.h,v 1.8 2003-04-16 22:30:43 fillods 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
@ -46,6 +46,4 @@ extern const struct rig_caps wr3150_caps;
extern const struct rig_caps wr3500_caps;
extern const struct rig_caps wr3700_caps;
extern BACKEND_EXPORT(int) initrigs_winradio(void *be_handle);
#endif /* _WINRADIO_H */

View File

@ -7,7 +7,7 @@
* via serial interface to a Yaesu rig
*
*
* $Id: yaesu.c,v 1.13 2003-04-14 03:05:32 n0nb Exp $
* $Id: yaesu.c,v 1.14 2003-04-16 22:30:43 fillods Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -37,6 +37,7 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "misc.h"
#include "register.h"
#include "yaesu.h"
@ -45,7 +46,7 @@
* initrigs_yaesu is called by rig_backend_load
*/
int initrigs_yaesu(void *be_handle)
DECLARE_INITRIG_BACKEND(yaesu)
{
rig_debug(RIG_DEBUG_VERBOSE, "yaesu: %s called\n", __func__);

View File

@ -2,11 +2,11 @@
* hamlib - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
*
* yaesu.h - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
* and Stephane Fillod 2001,2002
* and Stephane Fillod 2001-2003
*
* Common yaesu declarations for hamlib
*
* $Id: yaesu.h,v 1.15 2003-04-14 03:05:32 n0nb Exp $
* $Id: yaesu.h,v 1.16 2003-04-16 22:30:43 fillods Exp $
*
*
*
@ -56,6 +56,4 @@ extern const struct rig_caps ft900_caps;
extern const struct rig_caps ft920_caps;
extern const struct rig_caps ft1000mp_caps;
extern BACKEND_EXPORT(int) initrigs_yaesu(void *be_handle);
#endif /* _YAESU_H */