C Header protocol

Rick Sivernell res005ru
Tue May 3 23:37:54 PDT 2005


On Tue, 03 May 2005 09:50:43 -0500
Ben Duncan <bns at meta3.net> wrote:

> Ok, I am deep in re-writing SLAG.
> 
> I will have a "Menu Program" and a  "menu module" (.so).
> The idea being that the "module" will contain all of
> the functions to handle the menu'ing stuff, but be a S-Lang loadable module.
> The "Program" will be simply a stand alone Program linked with/to the
> module to run from a command line a SLAG Menu definition.
> 
> I have defined a menu.h that contains the structures and other such stuff.
> 
> Now in the menu module, I have defined the prototypes at the top of the
> program for the routines contained in the program. I have defined
> in the menu.h, the routines in the module as "external ...".
> menu "PROGRAM" will run them out of the module.
> 
> Is this the correct way to do this? Define the prototypes as external
> in a header, even though the header is going to get included in the
> program where the modules truly are defined?
> 
> Thanks ...
> 
> 
> -- 
> Ben Duncan   - VersAccounting Software LLC 336 Elton Road  Jackson MS, 39212
> "Never attribute to malice, that which can be adequately explained by stupidity"
>         - Hanlon's Razor
> 
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc:
> http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> 
> Need to chat further on this subject? Check out #linux-users on
> irc.linux-sxs.org !

Ben

  If you put the prototypes in the header and include the header in your source
code module, then that is all you need. Now if you include this header in another
source code module, you can use the function(s) declared. If you have the
prototypes for your source in both header and the source, then you have a double
declaration, the compiler may complain as already declared protypes. Is this clear
as mud?

cheers

-- 
Rick Sivernell
Dallas, Texas  75287
972 306-2296
res005ru at verizon.net
Registered Linux User

   .~.
  / v \
 /( _ )\
   ^ ^
In Linux we trust!


More information about the Linux-users mailing list