Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 26 Nov 2014, 15:01
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
headers file or not to header file
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
scsijon

Joined: 23 May 2007
Posts: 1047
Location: the australian mallee

PostPosted: Fri 12 Jul 2013, 20:07    Post_subject:  headers file or not to header file  

I'm putting this here as I suspect i'll get a better answer.

Should every application have header files?

When is a header file unnecessary?

Is there a way to build only the header files if they but not the actual package is needed?

thanks
scsijon
Back to top
View user's profile Send_private_message Visit_website 
Ibidem

Joined: 25 May 2010
Posts: 523
Location: State of Jefferson

PostPosted: Sat 13 Jul 2013, 04:06    Post_subject: Re: headers file or not to header file  

scsijon wrote:
I'm putting this here as I suspect i'll get a better answer.

Should every application have header files?

When is a header file unnecessary?

Is there a way to build only the header files if they but not the actual package is needed?

thanks
scsijon

1) No applications except those supporting plugins, and libraries.
Also protocols may justify headers without libraries.
Static libs always need headers.

2) When the binary does not meet the criteria in section 1, or when the target is not intended to be used for development.
Dynamic libs may be used solely for dependencies; in this case, it makes sense to distribute just the binaries.
When cross-compiling, it's ~ "any time you aren't trying to bootstrap a new self-hosting system".

3) Not for most packages. But many provide headers that don't need any "building".
Back to top
View user's profile Send_private_message 
ericsond

Joined: 13 Apr 2013
Posts: 5

PostPosted: Wed 24 Jul 2013, 20:38    Post_subject:  

Perhaps I am misunderstanding your question, i am also assuming you are referring to C.

The use of header files jives with C's modular approach. If you only have one file for source code, then certainly you don't need a header file, but assuming you want to modularize your code into functions, then you would want to keep these sections apart by using different C files and different header files.

You might want to look at what 'scope' means to a source files to gain a better understanding of modular functionality.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0730s ][ Queries: 12 (0.0356s) ][ GZIP on ]