[Nut-upsdev] Re: [nut-commits] svn commit r433 - in trunk: data drivers include

Peter Selinger selinger at mathstat.dal.ca
Mon Jun 19 14:46:26 UTC 2006


Hi Arnaud,

I have a suggestion on code organization. Since libshut.c and libhid.c
are intended to share the same interface, perhaps this should be
made explicit by making them use the same header file. I.e.,
newhidups.c would always include libhid.h, instead of including
one of libshut.h / libhid.h. 

The stuff in libshut.c that does not implement the libhid interface
(essentially the definition of the shut_subdriver data structure)
would be moved into its own source file, by analogy with the
{apc,belkin,generic,mge,tripplite}-hid.[ch] files. This way there
would be a clear distinction between (1) the HID/SHUT (abstract)
interface, and (2) specific driver code. 

Ultimately, it would be a nice goal to make the HID/SHUT interface
abstract enough to eliminate all the new #ifdef's from newhidups.c,
i.e., it should be transparent to newhidups whether it is using HID or
SHUT.

-- Peter

Arnaud Quette wrote:
> 
> Hi Peter,
> 
> 2006/6/17, Peter Selinger <selinger at mathstat.dal.ca>:
> > Arnaud,
> >
> > this commit refers to files called libshut.c and libshut.h, yet no
> > such file has been added to SVN. Perhaps take this opportunity to run
> > "svn status" and check for other files that might be missing from
> > SVN.
> 
> you're fully right. these were the only add, and are now commit'ed.
> thanks for pointing this.
> 
> Arnaud
> 




More information about the Nut-upsdev mailing list