MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / alloc_init_ext

Function alloc_init_ext

rigs/dummy/dummy_common.c:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#include "hamlib/rig.h"
27
28struct ext_list *alloc_init_ext(const struct confparams *cfp)
29{
30 struct ext_list *elp;
31 int i, nb_ext;
32
33 if (cfp == NULL)
34 {
35 return NULL;
36 }
37
38 for (nb_ext = 0; !RIG_IS_EXT_END(cfp[nb_ext]); nb_ext++)
39 ;
40
41 elp = calloc((nb_ext + 1), sizeof(struct ext_list));
42
43 if (!elp)
44 {
45 return NULL;
46 }
47
48 for (i = 0; !RIG_IS_EXT_END(cfp[i]); i++)
49 {
50 elp[i].token = cfp[i].token;
51 /* value reset already by calloc */
52 }
53
54 /* last token in array is set to 0 by calloc */
55
56 return elp;
57}
58
59struct ext_list *find_ext(struct ext_list *elp, hamlib_token_t token)
60{

Callers 6

dummy_initFunction · 0.70
dummy_vfo_opFunction · 0.70
dummy_get_channelFunction · 0.70
flrig_initFunction · 0.70
tci1x_initFunction · 0.70
dummy_rot_initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected