X
xarax
Greetings,
What is the general practice, usual and customary way,
of including a data file into a source file?
I have some large data structures defined as source
similar to:
=========================
typedef struct fubar
{
unsigned int fab; /* something */
unsigned int nrk; /* somethang */
} Fubar;
static Fubar myFubar[] =
{
{0x01,0x02},
{0x02,0x03},
/* much more of the same */
{0x20,0x21}
};
=========================
The above data array is used by a single
source file. Currently, it is hard-coded
into the source file, but I need to move
it into a separate file and include it.
(The situation is actually much more
complicated with multiple large data
arrays that are all used by the same
single source file.)
Is it alright to put that data structure
definition into a ".h" header file, even
though it is only used by a single source
file? Is there some other "usual and customary"
style for imbedding the source of a data
definition other than using a header file?
The data arrays are only defined in source
form, not binary files or such like.
TIA
--
----------------------------
Jeffrey D. Smith
Farsight Systems Corporation
24 BURLINGTON DRIVE
LONGMONT, CO 80501-6906
http://www.farsight-systems.com
z/Debug debugs your Systems/C programs running on IBM z/OS!
Are ISV upgrade fees too high? Check our custom product development!
What is the general practice, usual and customary way,
of including a data file into a source file?
I have some large data structures defined as source
similar to:
=========================
typedef struct fubar
{
unsigned int fab; /* something */
unsigned int nrk; /* somethang */
} Fubar;
static Fubar myFubar[] =
{
{0x01,0x02},
{0x02,0x03},
/* much more of the same */
{0x20,0x21}
};
=========================
The above data array is used by a single
source file. Currently, it is hard-coded
into the source file, but I need to move
it into a separate file and include it.
(The situation is actually much more
complicated with multiple large data
arrays that are all used by the same
single source file.)
Is it alright to put that data structure
definition into a ".h" header file, even
though it is only used by a single source
file? Is there some other "usual and customary"
style for imbedding the source of a data
definition other than using a header file?
The data arrays are only defined in source
form, not binary files or such like.
TIA
--
----------------------------
Jeffrey D. Smith
Farsight Systems Corporation
24 BURLINGTON DRIVE
LONGMONT, CO 80501-6906
http://www.farsight-systems.com
z/Debug debugs your Systems/C programs running on IBM z/OS!
Are ISV upgrade fees too high? Check our custom product development!