Ask a Question related to UNIX Programming, Design and Development.
-
Peteris Krumins #1
Two structures, bunch of programs.
Hello,
What is the best method to do the following:
Let's say two programs use the same data structure. Each one of them keeps
all the function prototypes and other structures in header files.
Some functions have the same name but take different parameters, so i cant
include first programs header file in the second program (unless i #ifdef).
What is the best aproach to use the same data structure used by 2 or more
programs?
Put the structure used by both programs it in a seperate header file, so
if it changes i wouldnt have to change it in 2 or more sources?
Or use #ifdef .. #endif?
Or any other method?
P.Krumins
Peteris Krumins Guest
-
HELP: Loading bunch of swf(movies) with XML
Hello, I used a sample of macromedia to get a XML file with the names to the swf files i want to import in the stage. That works (for now). But... -
Can't open administrator, get bunch of binary codesinstead. Please help!
Hello all, I have installed Cold Fusion 6.1 in a Fedora machine and CF admin doesn't want to show up. Instead I see the bunch of characters below.... -
How can I drag several clips as a bunch. URGENT
I want to drag several movie clips a one. StartDrag won't do it as it drags only one mc at a time. Is there a way to group them so that when you... -
Lost a bunch of data, looking for advice
Thanks Ian. We DL'd the trial version, and I think it's going to work out for us. It's processing an UNDO SQL statement right now. -corky Ian... -
- How do I copy a bunch of bookmarks into an email body?
Just do an Export. It will make a file Bookmark.html . -- ----- Paul ----- www.paulsxp.com www.paulsxp.com/forums "The Cerebral Ass ©"... -
Sam Zoghaib #2
Re: Two structures, bunch of programs.
Peteris Krumins wrote in article
<Xns93BB13C4FC04Awhitesuneapollolv@130.133.1.4> on Thursday 17 July 2003
00:57 in comp.unix.programmer:
It depends on how those 2 programs are separated; if they are (part of)> What is the best aproach to use the same data structure used by 2 or more
> programs?
> Put the structure used by both programs it in a seperate header file, so
> if it changes i wouldnt have to change it in 2 or more sources?
> Or use #ifdef .. #endif?
different projects, just put a copy of the header in each project, with the
necessary modifications.
If they are somewhat closely related (like, let's say, an
encryption/decryption pair) or belong to the same project, you may want to
have a single header where functions prototypes are between #ifdef...#endif
Anyway, try to keep the header simple. Even in the latter case, if having a
single header makes it hard to read, use 2.
Sam
--
"If sharing a thing in no way diminishes it, it is not rightly owned if it is
not shared."
- St Augustine
Sam Zoghaib Guest
-
Peteris Krumins #3
Re: Two structures, bunch of programs.
Sam Zoghaib <NOsam@zep.homedns.orgSPAM> wrote in
news:bf4nal$4hs$1@news-reader3.wanadoo.fr:
Thanks for the tips.> Peteris Krumins wrote in article
> <Xns93BB13C4FC04Awhitesuneapollolv@130.133.1.4> on Thursday 17 July
> 2003 00:57 in comp.unix.programmer:
>>>> What is the best aproach to use the same data structure used by 2 or
>> more
>> programs?
>> Put the structure used by both programs it in a seperate header
>> file, so
>> if it changes i wouldnt have to change it in 2 or more sources?
>> Or use #ifdef .. #endif?
> It depends on how those 2 programs are separated; if they are (part
> of) different projects, just put a copy of the header in each project,
> with the necessary modifications.
>
> If they are somewhat closely related (like, let's say, an
> encryption/decryption pair) or belong to the same project, you may
> want to have a single header where functions prototypes are between
> #ifdef...#endif
>
> Anyway, try to keep the header simple. Even in the latter case, if
> having a single header makes it hard to read, use 2.
>
> Sam
P.Krumins
Peteris Krumins Guest



Reply With Quote

