Thread: [freestdf-commits] SF.net SVN: freestdf: [267] trunk/libstdf
Status: Beta
Brought to you by:
vapier
From: <va...@us...> - 2006-10-16 01:41:33
|
Revision: 267 http://svn.sourceforge.net/freestdf/?rev=267&view=rev Author: vapier Date: 2006-10-15 18:41:21 -0700 (Sun, 15 Oct 2006) Log Message: ----------- dont use := assignment Modified Paths: -------------- trunk/libstdf/examples/Makefile.am trunk/libstdf/src/Makefile.am Modified: trunk/libstdf/examples/Makefile.am =================================================================== --- trunk/libstdf/examples/Makefile.am 2006-09-29 12:27:32 UTC (rev 266) +++ trunk/libstdf/examples/Makefile.am 2006-10-16 01:41:21 UTC (rev 267) @@ -1,5 +1,5 @@ if BUILD_EXAMPLES -extra_examples := +extra_examples = if HAVE_GDLIB extra_examples += stdf2img endif Modified: trunk/libstdf/src/Makefile.am =================================================================== --- trunk/libstdf/src/Makefile.am 2006-09-29 12:27:32 UTC (rev 266) +++ trunk/libstdf/src/Makefile.am 2006-10-16 01:41:21 UTC (rev 267) @@ -8,7 +8,7 @@ @ZIP_CFLAGS@ @GZIP_CFLAGS@ @BZIP2_CFLAGS@ lib_LTLIBRARIES = libstdf.la -EXTRA_STDF_SOURCES := +EXTRA_STDF_SOURCES = if HAVE_LZW EXTRA_STDF_SOURCES += lzw.c endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-01-19 06:34:40
|
Revision: 274 http://svn.sourceforge.net/freestdf/?rev=274&view=rev Author: vapier Date: 2007-01-18 22:34:40 -0800 (Thu, 18 Jan 2007) Log Message: ----------- fix building out of src tree Modified Paths: -------------- trunk/libstdf/configure.ac trunk/libstdf/examples/Makefile.am trunk/libstdf/src/Makefile.am Added Paths: ----------- trunk/libstdf/tests/Makefile.in Removed Paths: ------------- trunk/libstdf/tests/Makefile Property Changed: ---------------- trunk/libstdf/ trunk/libstdf/tests/ Property changes on: trunk/libstdf ___________________________________________________________________ Name: svn:ignore - aclocal.m4 autom4te.cache compile config.guess config.log config.status config.sub configure depcomp install-sh libstdf-config libstdf-doc.c libstdf.pc libtool ltmain.sh m4 Makefile Makefile.in missing + aclocal.m4 autom4te.cache build compile config.guess config.log config.status config.sub configure depcomp install-sh libstdf-config libstdf-doc.c libstdf.pc libtool ltmain.sh m4 Makefile Makefile.in missing Modified: trunk/libstdf/configure.ac =================================================================== --- trunk/libstdf/configure.ac 2007-01-19 06:33:45 UTC (rev 273) +++ trunk/libstdf/configure.ac 2007-01-19 06:34:40 UTC (rev 274) @@ -195,6 +195,7 @@ Makefile include/Makefile src/Makefile +tests/Makefile doc/Makefile doc/man/Makefile doc/man/man3/Makefile Modified: trunk/libstdf/examples/Makefile.am =================================================================== --- trunk/libstdf/examples/Makefile.am 2007-01-19 06:33:45 UTC (rev 273) +++ trunk/libstdf/examples/Makefile.am 2007-01-19 06:34:40 UTC (rev 274) @@ -18,7 +18,7 @@ endif INCLUDES = \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/include -I$(top_builddir)/include \ @HASH_CFLAGS@ @ECORE_CFLAGS@ @GLIB_CFLAGS@ \ @GDLIB_CFLAGS@ Modified: trunk/libstdf/src/Makefile.am =================================================================== --- trunk/libstdf/src/Makefile.am 2007-01-19 06:33:45 UTC (rev 273) +++ trunk/libstdf/src/Makefile.am 2007-01-19 06:34:40 UTC (rev 274) @@ -4,7 +4,8 @@ AM_CPPFLAGS = -D__IN_LIBSTDF AM_CFLAGS = @DEBUG_CFLAGS@ -INCLUDES = -I$(top_builddir)/include \ +INCLUDES = \ + -I$(top_srcdir)/include -I$(top_builddir)/include \ @ZIP_CFLAGS@ @GZIP_CFLAGS@ @BZIP2_CFLAGS@ lib_LTLIBRARIES = libstdf.la Property changes on: trunk/libstdf/tests ___________________________________________________________________ Name: svn:ignore + *.out Deleted: trunk/libstdf/tests/Makefile =================================================================== --- trunk/libstdf/tests/Makefile 2007-01-19 06:33:45 UTC (rev 273) +++ trunk/libstdf/tests/Makefile 2007-01-19 06:34:40 UTC (rev 274) @@ -1,33 +0,0 @@ -# Dirty little tests - -EXAMPLE_DIR = ../examples -STDF = stdf.bz2 -BZCMP = bzdiff - -all install: - -check: ascii html stats create - -ascii: - $(EXAMPLE_DIR)/dump_records_to_ascii $(STDF) > ascii.out - $(BZCMP) ascii.out ascii.good.bz2 - -html: - $(EXAMPLE_DIR)/dump_records_to_html $(STDF) html.out - $(BZCMP) html.out html.good.bz2 - -stats: - $(EXAMPLE_DIR)/record_stats $(STDF) | env LC_ALL="C" sort > stats.out - $(BZCMP) stats.out stats.good.bz2 - -create: - $(EXAMPLE_DIR)/makestdf create.out - $(BZCMP) create.out create.good.bz2 - -distdir: - @cp Makefile *.bz2 $(distdir) - -distclean clean: - rm -f *.out - -.PHONY: all install check ascii html stats create distdir distclean clean Added: trunk/libstdf/tests/Makefile.in =================================================================== --- trunk/libstdf/tests/Makefile.in (rev 0) +++ trunk/libstdf/tests/Makefile.in 2007-01-19 06:34:40 UTC (rev 274) @@ -0,0 +1,41 @@ +# Dirty little tests + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +builddir = @builddir@ +top_builddir = @top_builddir@ + +EXAMPLE_DIR = $(top_builddir)/examples +STDF = stdf.bz2 +BZCMP = bzdiff + +all install: + +check: ascii html stats create + +$(STDF): $(srcdir)/$(STDF) + cp $(srcdir)/$(STDF) $(STDF) + +ascii: $(STDF) + $(EXAMPLE_DIR)/dump_records_to_ascii $(STDF) > ascii.out + $(BZCMP) ascii.out $(srcdir)/ascii.good.bz2 + +html: $(STDF) + $(EXAMPLE_DIR)/dump_records_to_html $(STDF) html.out + $(BZCMP) html.out $(srcdir)/html.good.bz2 + +stats: $(STDF) + $(EXAMPLE_DIR)/record_stats $(STDF) | env LC_ALL="C" sort > stats.out + $(BZCMP) stats.out $(srcdir)/stats.good.bz2 + +create: + $(EXAMPLE_DIR)/makestdf create.out + $(BZCMP) create.out $(srcdir)/create.good.bz2 + +distdir: + @cp Makefile *.bz2 $(distdir) + +distclean clean: + rm -f *.out + +.PHONY: all install check ascii html stats create distdir distclean clean This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-01-19 08:05:14
|
Revision: 276 http://svn.sourceforge.net/freestdf/?rev=276&view=rev Author: vapier Date: 2007-01-19 00:05:14 -0800 (Fri, 19 Jan 2007) Log Message: ----------- scrub exported namespace completely so that we play nice with other record based libraries (like libatdf) ... unfortunately, this breaks API from previous releases Modified Paths: -------------- trunk/libstdf/examples/dump_records_to_ascii.c trunk/libstdf/examples/dump_records_to_html.c trunk/libstdf/examples/example.c trunk/libstdf/examples/extract_records.c trunk/libstdf/examples/is_valid_stdf.c trunk/libstdf/examples/makestdf.c trunk/libstdf/examples/record_stats.c trunk/libstdf/examples/stdf2img.c trunk/libstdf/examples/stdf2xtdf.c trunk/libstdf/include/libstdf.h trunk/libstdf/include/libstdf_bswap.h trunk/libstdf/include/libstdf_const.h trunk/libstdf/include/libstdf_funcs.h trunk/libstdf/include/libstdf_internal.h trunk/libstdf/include/libstdf_systems.h trunk/libstdf/include/libstdf_types.h trunk/libstdf/include/libstdf_win32.h trunk/libstdf/include/libstdf_win32_options.h trunk/libstdf/src/dtc.c trunk/libstdf/src/dtc.h trunk/libstdf/src/libstdf.c trunk/libstdf/src/rec.c trunk/libstdf/src/rec.h trunk/libstdf/win32/generate-win32-files.sh trunk/libstdf/win32/in/libstdf.rc.in trunk/libstdf/win32/libstdf.rc Property Changed: ---------------- trunk/libstdf/tests/ Modified: trunk/libstdf/examples/dump_records_to_ascii.c =================================================================== --- trunk/libstdf/examples/dump_records_to_ascii.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/dump_records_to_ascii.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file dump_records_to_ascii.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -19,9 +19,9 @@ do { time_t t = d; print_fmt(n, "%s", ctime(&t)); } while(0) #define MAKE_PRINT_X(DTC, OUTPUT_FUNC, FORMAT) \ -void print_x ## DTC(char *n, dtc_x ## DTC u, dtc_U2 c) \ +void print_x ## DTC(char *n, stdf_dtc_x ## DTC u, stdf_dtc_U2 c) \ { \ - dtc_U2 i; \ + stdf_dtc_U2 i; \ printf("\t%s: ", n); \ for (i=0; i<c; ++i) { \ OUTPUT_FUNC(FORMAT, u[i]); \ @@ -36,9 +36,9 @@ #define _printf_xCn(fmt,Cn) printf(fmt, (*Cn ? Cn+1 : "(null)")) MAKE_PRINT_X(Cn, _printf_xCn, "%s") -void print_xN1(char *member, dtc_xN1 xN1, dtc_U2 c) +void print_xN1(char *member, stdf_dtc_xN1 xN1, stdf_dtc_U2 c) { - dtc_N1 *n = xN1; + stdf_dtc_N1 *n = xN1; printf("\t%s: ", member); while (c > 0) { if (c > 1) { @@ -53,7 +53,7 @@ printf("\n"); } -void print_Vn(char *n, dtc_Vn v, int c) +void print_Vn(char *n, stdf_dtc_Vn v, int c) { int i; --c; @@ -61,30 +61,30 @@ for (i=0; i<=c; ++i) { printf("\t\t%s: ", stdf_get_Vn_name(v[i].type)); switch (v[i].type) { - case GDR_B0: printf("(pad)"); break; - case GDR_U1: printf("%i", *((dtc_U1*)v[i].data)); break; - case GDR_U2: printf("%i", *((dtc_U2*)v[i].data)); break; - case GDR_U4: printf("%i", *((dtc_U4*)v[i].data)); break; - case GDR_I1: printf("%i", *((dtc_I1*)v[i].data)); break; - case GDR_I2: printf("%i", *((dtc_I2*)v[i].data)); break; - case GDR_I4: printf("%i", *((dtc_I4*)v[i].data)); break; - case GDR_R4: printf("%f", *((dtc_R4*)v[i].data)); break; - case GDR_R8: printf("%f", *((dtc_R8*)v[i].data)); break; - case GDR_Cn: { - dtc_Cn Cn = *((dtc_Cn*)v[i].data); + case STDF_GDR_B0: printf("(pad)"); break; + case STDF_GDR_U1: printf("%i", *((stdf_dtc_U1*)v[i].data)); break; + case STDF_GDR_U2: printf("%i", *((stdf_dtc_U2*)v[i].data)); break; + case STDF_GDR_U4: printf("%i", *((stdf_dtc_U4*)v[i].data)); break; + case STDF_GDR_I1: printf("%i", *((stdf_dtc_I1*)v[i].data)); break; + case STDF_GDR_I2: printf("%i", *((stdf_dtc_I2*)v[i].data)); break; + case STDF_GDR_I4: printf("%i", *((stdf_dtc_I4*)v[i].data)); break; + case STDF_GDR_R4: printf("%f", *((stdf_dtc_R4*)v[i].data)); break; + case STDF_GDR_R8: printf("%f", *((stdf_dtc_R8*)v[i].data)); break; + case STDF_GDR_Cn: { + stdf_dtc_Cn Cn = *((stdf_dtc_Cn*)v[i].data); printf("%s", (*Cn ? Cn+1 : "(null")); break; } - case GDR_Bn: printf("[??]"); break; - case GDR_Dn: printf("[??]"); break; - case GDR_N1: printf("%X", *((dtc_N1*)v[i].data)); break; + case STDF_GDR_Bn: printf("[??]"); break; + case STDF_GDR_Dn: printf("[??]"); break; + case STDF_GDR_N1: printf("%X", *((stdf_dtc_N1*)v[i].data)); break; } printf("\n"); } if (c == -1) printf("\n"); } -void print_Bn(dtc_C1 *n, dtc_Bn b) +void print_Bn(stdf_dtc_C1 *n, stdf_dtc_Bn b) { int i; printf("\t%s:", n); @@ -94,10 +94,10 @@ printf(" (null)"); printf("\n"); } -void print_Dn(dtc_C1 *n, dtc_Dn d) +void print_Dn(stdf_dtc_C1 *n, stdf_dtc_Dn d) { int i; - dtc_U2 *num_bits = (dtc_U2*)d, len; + stdf_dtc_U2 *num_bits = (stdf_dtc_U2*)d, len; len = *num_bits / 8; if (*num_bits % 8) ++len; printf("\t%s:", n); @@ -123,9 +123,9 @@ { stdf_file *f; char *recname; - rec_unknown *rec; + stdf_rec_unknown *rec; int i; - dtc_U4 stdf_ver; + stdf_dtc_U4 stdf_ver; if (argc <= 1) { printf("Need some files to open!\n"); @@ -146,20 +146,20 @@ printf("Record %s (%3i,%3i) %i bytes:\n", recname, rec->header.REC_TYP, rec->header.REC_SUB, rec->header.REC_LEN); switch (HEAD_TO_REC(rec->header)) { - case REC_FAR: { - rec_far *far = (rec_far*)rec; + case STDF_REC_FAR: { + stdf_rec_far *far = (stdf_rec_far*)rec; print_int("CPU_TYPE", far->CPU_TYPE); print_int("STDF_VER", far->STDF_VER); break; } - case REC_ATR: { - rec_atr *atr = (rec_atr*)rec; + case STDF_REC_ATR: { + stdf_rec_atr *atr = (stdf_rec_atr*)rec; print_tim("MOD_TIM", atr->MOD_TIM); print_str("CMD_LINE", atr->CMD_LINE); break; } - case REC_MIR: { - rec_mir *mir = (rec_mir*)rec; + case STDF_REC_MIR: { + stdf_rec_mir *mir = (stdf_rec_mir*)rec; #ifdef STDF_VER3 if (stdf_ver == 4) { #endif @@ -230,8 +230,8 @@ #endif break; } - case REC_MRR: { - rec_mrr *mrr = (rec_mrr*)rec; + case STDF_REC_MRR: { + stdf_rec_mrr *mrr = (stdf_rec_mrr*)rec; print_tim("FINISH_T", mrr->FINISH_T); #ifdef STDF_VER3 if (stdf_ver == 3) { @@ -247,8 +247,8 @@ print_str("EXC_DESC", mrr->EXC_DESC); break; } - case REC_PCR: { - rec_pcr *pcr = (rec_pcr*)rec; + case STDF_REC_PCR: { + stdf_rec_pcr *pcr = (stdf_rec_pcr*)rec; print_int("HEAD_NUM", pcr->HEAD_NUM); print_int("SITE_NUM", pcr->SITE_NUM); print_int("PART_CNT", pcr->PART_CNT); @@ -258,8 +258,8 @@ print_int("FUNC_CNT", pcr->FUNC_CNT); break; } - case REC_HBR: { - rec_hbr *hbr = (rec_hbr*)rec; + case STDF_REC_HBR: { + stdf_rec_hbr *hbr = (stdf_rec_hbr*)rec; print_int("HEAD_NUM", hbr->HEAD_NUM); print_int("SITE_NUM", hbr->SITE_NUM); print_int("HBIN_NUM", hbr->HBIN_NUM); @@ -268,8 +268,8 @@ print_str("HBIN_NAM", hbr->HBIN_NAM); break; } - case REC_SBR: { - rec_sbr *sbr = (rec_sbr*)rec; + case STDF_REC_SBR: { + stdf_rec_sbr *sbr = (stdf_rec_sbr*)rec; print_int("HEAD_NUM", sbr->HEAD_NUM); print_int("SITE_NUM", sbr->SITE_NUM); print_int("SBIN_NUM", sbr->SBIN_NUM); @@ -278,8 +278,8 @@ print_str("SBIN_NAM", sbr->SBIN_NAM); break; } - case REC_PMR: { - rec_pmr *pmr = (rec_pmr*)rec; + case STDF_REC_PMR: { + stdf_rec_pmr *pmr = (stdf_rec_pmr*)rec; print_int("PMR_INDX", pmr->PMR_INDX); print_int("CHAN_TYP", pmr->CHAN_TYP); print_str("CHAN_NAM", pmr->CHAN_NAM); @@ -289,16 +289,16 @@ print_int("SITE_NUM", pmr->SITE_NUM); break; } - case REC_PGR: { - rec_pgr *pgr = (rec_pgr*)rec; + case STDF_REC_PGR: { + stdf_rec_pgr *pgr = (stdf_rec_pgr*)rec; print_int("GRP_INDX", pgr->GRP_INDX); print_str("GRP_NAM", pgr->GRP_NAM); print_int("INDX_CNT", pgr->INDX_CNT); print_xU2("PMR_INDX", pgr->PMR_INDX, pgr->INDX_CNT); break; } - case REC_PLR: { - rec_plr *plr = (rec_plr*)rec; + case STDF_REC_PLR: { + stdf_rec_plr *plr = (stdf_rec_plr*)rec; print_int("GRP_CNT", plr->GRP_CNT); print_xU2("GRP_INDX", plr->GRP_INDX, plr->GRP_CNT); print_xU2("GRP_MODE", plr->GRP_MODE, plr->GRP_CNT); @@ -309,14 +309,14 @@ print_xCn("RTN_CHAL", plr->RTN_CHAL, plr->GRP_CNT); break; } - case REC_RDR: { - rec_rdr *rdr = (rec_rdr*)rec; + case STDF_REC_RDR: { + stdf_rec_rdr *rdr = (stdf_rec_rdr*)rec; print_int("NUM_BINS", rdr->NUM_BINS); print_xU2("RTST_BIN", rdr->RTST_BIN, rdr->NUM_BINS); break; } - case REC_SDR: { - rec_sdr *sdr = (rec_sdr*)rec; + case STDF_REC_SDR: { + stdf_rec_sdr *sdr = (stdf_rec_sdr*)rec; print_int("HEAD_NUM", sdr->HEAD_NUM); print_int("SITE_GRP", sdr->SITE_GRP); print_int("SITE_CNT", sdr->SITE_CNT); @@ -339,8 +339,8 @@ print_str("EXTR_ID", sdr->EXTR_ID); break; } - case REC_WIR: { - rec_wir *wir = (rec_wir*)rec; + case STDF_REC_WIR: { + stdf_rec_wir *wir = (stdf_rec_wir*)rec; print_int("HEAD_NUM", wir->HEAD_NUM); #ifdef STDF_VER3 if (stdf_ver == 3) @@ -352,8 +352,8 @@ print_str("WAFER_ID", wir->WAFER_ID); break; } - case REC_WRR: { - rec_wrr *wrr = (rec_wrr*)rec; + case STDF_REC_WRR: { + stdf_rec_wrr *wrr = (stdf_rec_wrr*)rec; #ifdef STDF_VER3 if (stdf_ver == 4) { #endif @@ -389,8 +389,8 @@ print_str("EXC_DESC", wrr->EXC_DESC); break; } - case REC_WCR: { - rec_wcr *wcr = (rec_wcr*)rec; + case STDF_REC_WCR: { + stdf_rec_wcr *wcr = (stdf_rec_wcr*)rec; print_rel("WAFR_SIZ", wcr->WAFR_SIZ); print_rel("DIE_HT", wcr->DIE_HT); print_rel("DIE_WID", wcr->DIE_WID); @@ -402,8 +402,8 @@ print_chr("POS_Y", wcr->POS_Y); break; } - case REC_PIR: { - rec_pir *pir = (rec_pir*)rec; + case STDF_REC_PIR: { + stdf_rec_pir *pir = (stdf_rec_pir*)rec; print_int("HEAD_NUM", pir->HEAD_NUM); print_int("SITE_NUM", pir->SITE_NUM); #ifdef STDF_VER3 @@ -415,8 +415,8 @@ #endif break; } - case REC_PRR: { - rec_prr *prr = (rec_prr*)rec; + case STDF_REC_PRR: { + stdf_rec_prr *prr = (stdf_rec_prr*)rec; print_int("HEAD_NUM", prr->HEAD_NUM); print_int("SITE_NUM", prr->SITE_NUM); #ifdef STDF_VER3 @@ -444,8 +444,8 @@ break; } #ifdef STDF_VER3 - case REC_PDR: { - rec_pdr *pdr = (rec_pdr*)rec; + case STDF_REC_PDR: { + stdf_rec_pdr *pdr = (stdf_rec_pdr*)rec; print_int("TEST_NUM", pdr->TEST_NUM); print_hex("DESC_FLG", pdr->DESC_FLG); print_hex("OPT_FLAG", pdr->OPT_FLAG); @@ -465,8 +465,8 @@ print_str("SEQ_NAME", pdr->SEQ_NAME); break; } - case REC_FDR: { - rec_fdr *fdr = (rec_fdr*)rec; + case STDF_REC_FDR: { + stdf_rec_fdr *fdr = (stdf_rec_fdr*)rec; print_int("TEST_NUM", fdr->TEST_NUM); print_hex("DESC_FLG", fdr->DESC_FLG); print_str("TEST_NAM", fdr->TEST_NAM); @@ -474,8 +474,8 @@ break; } #endif - case REC_TSR: { - rec_tsr *tsr = (rec_tsr*)rec; + case STDF_REC_TSR: { + stdf_rec_tsr *tsr = (stdf_rec_tsr*)rec; print_int("HEAD_NUM", tsr->HEAD_NUM); print_int("SITE_NUM", tsr->SITE_NUM); #ifdef STDF_VER3 @@ -514,8 +514,8 @@ #endif break; } - case REC_PTR: { - rec_ptr *ptr = (rec_ptr*)rec; + case STDF_REC_PTR: { + stdf_rec_ptr *ptr = (stdf_rec_ptr*)rec; print_int("TEST_NUM", ptr->TEST_NUM); print_int("HEAD_NUM", ptr->HEAD_NUM); print_int("SITE_NUM", ptr->SITE_NUM); @@ -538,8 +538,8 @@ print_rel("HI_SPEC", ptr->HI_SPEC); break; } - case REC_MPR: { - rec_mpr *mpr = (rec_mpr*)rec; + case STDF_REC_MPR: { + stdf_rec_mpr *mpr = (stdf_rec_mpr*)rec; print_int("TEST_NUM", mpr->TEST_NUM); print_int("HEAD_NUM", mpr->HEAD_NUM); print_int("SITE_NUM", mpr->SITE_NUM); @@ -569,8 +569,8 @@ print_rel("HI_SPEC", mpr->HI_SPEC); break; } - case REC_FTR: { - rec_ftr *ftr = (rec_ftr*)rec; + case STDF_REC_FTR: { + stdf_rec_ftr *ftr = (stdf_rec_ftr*)rec; print_int("TEST_NUM", ftr->TEST_NUM); print_int("HEAD_NUM", ftr->HEAD_NUM); print_int("SITE_NUM", ftr->SITE_NUM); @@ -601,18 +601,18 @@ print_Dn("SPIN_MAP", ftr->SPIN_MAP); break; } - case REC_BPS: { - rec_bps *bps = (rec_bps*)rec; + case STDF_REC_BPS: { + stdf_rec_bps *bps = (stdf_rec_bps*)rec; print_str("SEQ_NAME", bps->SEQ_NAME); break; } - case REC_EPS: { - /*rec_eps *eps = (rec_eps*)rec;*/ + case STDF_REC_EPS: { + /*stdf_rec_eps *eps = (stdf_rec_eps*)rec;*/ break; } #ifdef STDF_VER3 - case REC_SHB: { - rec_shb *shb = (rec_shb*)rec; + case STDF_REC_SHB: { + stdf_rec_shb *shb = (stdf_rec_shb*)rec; print_int("HEAD_NUM", shb->HEAD_NUM); print_int("SITE_NUM", shb->SITE_NUM); print_int("HBIN_NUM", shb->HBIN_NUM); @@ -620,8 +620,8 @@ print_str("HBIN_NAM", shb->HBIN_NAM); break; } - case REC_SSB: { - rec_ssb *ssb = (rec_ssb*)rec; + case STDF_REC_SSB: { + stdf_rec_ssb *ssb = (stdf_rec_ssb*)rec; print_int("HEAD_NUM", ssb->HEAD_NUM); print_int("SITE_NUM", ssb->SITE_NUM); print_int("SBIN_NUM", ssb->SBIN_NUM); @@ -629,8 +629,8 @@ print_str("SBIN_NAM", ssb->SBIN_NAM); break; } - case REC_STS: { - rec_sts *sts = (rec_sts*)rec; + case STDF_REC_STS: { + stdf_rec_sts *sts = (stdf_rec_sts*)rec; print_int("HEAD_NUM", sts->HEAD_NUM); print_int("SITE_NUM", sts->SITE_NUM); print_int("TEST_NUM", sts->TEST_NUM); @@ -650,8 +650,8 @@ print_str("TEST_LBL", sts->TEST_LBL); break; } - case REC_SCR: { - rec_scr *scr = (rec_scr*)rec; + case STDF_REC_SCR: { + stdf_rec_scr *scr = (stdf_rec_scr*)rec; print_int("HEAD_NUM", scr->HEAD_NUM); print_int("SITE_NUM", scr->SITE_NUM); print_int("FINISH_T", scr->FINISH_T); @@ -663,19 +663,19 @@ break; } #endif - case REC_GDR: { - rec_gdr *gdr = (rec_gdr*)rec; + case STDF_REC_GDR: { + stdf_rec_gdr *gdr = (stdf_rec_gdr*)rec; print_int("FLD_CNT", gdr->FLD_CNT); print_Vn("GEN_DATA", gdr->GEN_DATA, gdr->FLD_CNT); break; } - case REC_DTR: { - rec_dtr *dtr = (rec_dtr*)rec; + case STDF_REC_DTR: { + stdf_rec_dtr *dtr = (stdf_rec_dtr*)rec; print_str("TEXT_DAT", dtr->TEXT_DAT); break; } - case REC_UNKNOWN: { - rec_unknown *unk = (rec_unknown*)rec; + case STDF_REC_UNKNOWN: { + stdf_rec_unknown *unk = (stdf_rec_unknown*)rec; printf("\tBytes: %i\n", unk->header.REC_LEN); printf("\tTYP: 0x%X [%i]\n", unk->header.REC_TYP, unk->header.REC_TYP); printf("\tSUB: 0x%X [%i]\n", unk->header.REC_SUB, unk->header.REC_SUB); Modified: trunk/libstdf/examples/dump_records_to_html.c =================================================================== --- trunk/libstdf/examples/dump_records_to_html.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/dump_records_to_html.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file dump_records_to_html.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -14,17 +14,17 @@ #endif #define MAX_REC_STYLES 4 -int max_width, width, rec_rot; -rec_unknown *raw_rec; +int max_width, width, stdf_rec_rot; +stdf_rec_unknown *raw_rec; #define OUT_HEX 1 #define OUT_ASCII 2 -void write_rec(FILE *f, rec_header *h, int type) +void write_rec(FILE *f, stdf_rec_header *h, int type) { int i; int towrite, written; - byte_t *rec; + unsigned char *rec; int tagged; rec = raw_rec->data; @@ -38,7 +38,7 @@ towrite = h->REC_LEN - written; for (i=0; i<towrite; ++i) { if (tagged > 3) { /* raw data */ - fprintf(f, "<td class=r%i>", rec_rot); + fprintf(f, "<td class=r%i>", stdf_rec_rot); if (type == OUT_HEX) fprintf(f, "%.2X", rec[i]); else { @@ -50,18 +50,18 @@ fprintf(f, "</td>"); } else { /* record header */ if (type == OUT_HEX) { - fprintf(f, "<td class=r%i><span class='head", rec_rot); + fprintf(f, "<td class=r%i><span class='head", stdf_rec_rot); fprintf(f, (tagged<2)?"len":"type"); fprintf(f, "'>%.2X</span></td>", rec[i]); } else { if (tagged == 0) /* rec len */ fprintf(f, "<td class=r%i colspan=2><span class=headlen>%i</span></td>", - rec_rot, h->REC_LEN - 4); + stdf_rec_rot, h->REC_LEN - 4); else if (tagged == 2) /* rec type */ fprintf(f, "<td class=r%i colspan=2><span class=headtype>%s</span></td>", - rec_rot, stdf_get_rec_name_from_head((*h))); + stdf_rec_rot, stdf_get_rec_name_from_head((*h))); else if (width == 0 && i == 0) - fprintf(f, "<td class=r%i></td>", rec_rot); + fprintf(f, "<td class=r%i></td>", stdf_rec_rot); } tagged++; } @@ -96,8 +96,8 @@ stdf_file *f; char cpu_name[256]; FILE *out; - int x, rec_count, max_recs, type; - dtc_U4 byte_order, stdf_ver; + int x, stdf_rec_count, max_recs, type; + stdf_dtc_U4 byte_order, stdf_ver; max_recs = 25; max_width = 25; @@ -186,8 +186,8 @@ f = stdf_open(argv[x]); width = 0; - rec_count = max_recs; - rec_rot = 1; + stdf_rec_count = max_recs; + stdf_rec_rot = 1; fprintf(out, "<td><table>\n<tr>"); for (width=0; width<max_width; ++width) @@ -200,10 +200,10 @@ while ((raw_rec=stdf_read_record_raw(f)) != NULL) { write_rec(out, &(raw_rec->header), type); stdf_free_record(raw_rec); - if (--rec_count == 0) + if (--stdf_rec_count == 0) break; - if (++rec_rot > MAX_REC_STYLES) - rec_rot = 1; + if (++stdf_rec_rot > MAX_REC_STYLES) + stdf_rec_rot = 1; } if (width != 0) fprintf(out, "</tr>\n"); Modified: trunk/libstdf/examples/example.c =================================================================== --- trunk/libstdf/examples/example.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/example.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file example.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -12,7 +12,7 @@ int main(int argc, char *argv[]) { stdf_file *f; - rec_unknown *r; + stdf_rec_unknown *r; if (argc != 2) return EXIT_FAILURE; Modified: trunk/libstdf/examples/extract_records.c =================================================================== --- trunk/libstdf/examples/extract_records.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/extract_records.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file extract_records.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) { - rec_unknown *raw_rec, *parsed_rec; + stdf_rec_unknown *raw_rec, *parsed_rec; stdf_file *f; char *filename_in, *filename_out; FILE *out; Modified: trunk/libstdf/examples/is_valid_stdf.c =================================================================== --- trunk/libstdf/examples/is_valid_stdf.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/is_valid_stdf.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file is_valid_stdf.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -15,9 +15,9 @@ int main(int argc, char *argv[]) { stdf_file *f; - rec_unknown *rec; - rec_header prev_rec; - long rec_mrr_cnt, rec_pcr_cnt, rec_hbr_cnt, rec_sbr_cnt, rec_wcr_cnt; + stdf_rec_unknown *rec; + stdf_rec_header prev_rec; + long stdf_rec_mrr_cnt, stdf_rec_pcr_cnt, stdf_rec_hbr_cnt, stdf_rec_sbr_cnt, stdf_rec_wcr_cnt; int i; if (argc <= 1) { @@ -47,14 +47,14 @@ /* Find the FAR record */ rec = stdf_read_record(f); - if (rec == NULL || HEAD_TO_REC(rec->header) != REC_FAR) { + if (rec == NULL || HEAD_TO_REC(rec->header) != STDF_REC_FAR) { print_err("First record is not FAR!"); goto next_file; } stdf_free_record(rec); /* Try to read all the ATR records (if they exist) */ while ((rec=stdf_read_record(f)) != NULL) { - if (HEAD_TO_REC(rec->header) != REC_ATR) + if (HEAD_TO_REC(rec->header) != STDF_REC_ATR) break; else stdf_free_record(rec); @@ -64,7 +64,7 @@ goto next_file; } /* We should now have the MIR record already read in */ - if (HEAD_TO_REC(rec->header) != REC_MIR) { + if (HEAD_TO_REC(rec->header) != STDF_REC_MIR) { print_err("Initial sequence wrong: MIR not located!"); goto next_file; } @@ -74,7 +74,7 @@ print_err("EOF found after initial sequence!"); goto next_file; } - if (HEAD_TO_REC(rec->header) == REC_RDR) { + if (HEAD_TO_REC(rec->header) == STDF_REC_RDR) { stdf_free_record(rec); rec = stdf_read_record(f); if (rec == NULL) { @@ -83,7 +83,7 @@ } } /* Try to read the SDR records (if they exist) */ - while (HEAD_TO_REC(rec->header) == REC_SDR) { + while (HEAD_TO_REC(rec->header) == STDF_REC_SDR) { stdf_free_record(rec); rec = stdf_read_record(f); if (rec == NULL) { @@ -93,44 +93,44 @@ } /* Now we read the rest of the file */ - rec_mrr_cnt = rec_pcr_cnt = rec_hbr_cnt = rec_sbr_cnt = rec_wcr_cnt = 0; + stdf_rec_mrr_cnt = stdf_rec_pcr_cnt = stdf_rec_hbr_cnt = stdf_rec_sbr_cnt = stdf_rec_wcr_cnt = 0; while (1) { - memcpy(&prev_rec, &rec->header, sizeof(rec_header)); + memcpy(&prev_rec, &rec->header, sizeof(stdf_rec_header)); stdf_free_record(rec); rec = stdf_read_record(f); if (rec == NULL) break; switch (HEAD_TO_REC(rec->header)) { - case REC_FAR: - case REC_ATR: - case REC_MIR: - case REC_RDR: - case REC_SDR: + case STDF_REC_FAR: + case STDF_REC_ATR: + case STDF_REC_MIR: + case STDF_REC_RDR: + case STDF_REC_SDR: printf("\tFound %s outside of initial sequence!\n", stdf_get_rec_name(rec->header.REC_TYP, rec->header.REC_SUB)); goto next_file; - case REC_MRR: - if (++rec_mrr_cnt > 1) { - print_err("More than one REC_MRR was found!"); + case STDF_REC_MRR: + if (++stdf_rec_mrr_cnt > 1) { + print_err("More than one STDF_REC_MRR was found!"); goto next_file; } break; - case REC_PCR: ++rec_pcr_cnt; break; - case REC_HBR: ++rec_hbr_cnt; break; - case REC_SBR: ++rec_sbr_cnt; break; + case STDF_REC_PCR: ++stdf_rec_pcr_cnt; break; + case STDF_REC_HBR: ++stdf_rec_hbr_cnt; break; + case STDF_REC_SBR: ++stdf_rec_sbr_cnt; break; /* need some logic with these ... */ - case REC_PMR: break; - case REC_PGR: break; - case REC_PLR: break; + case STDF_REC_PMR: break; + case STDF_REC_PGR: break; + case STDF_REC_PLR: break; - case REC_WIR: break; /* only 1 per wafer */ - case REC_WRR: break; /* only 1 per wafer */ + case STDF_REC_WIR: break; /* only 1 per wafer */ + case STDF_REC_WRR: break; /* only 1 per wafer */ - case REC_WCR: - if (++rec_wcr_cnt > 1) { - print_err("More than one REC_WCR was found!"); + case STDF_REC_WCR: + if (++stdf_rec_wcr_cnt > 1) { + print_err("More than one STDF_REC_WCR was found!"); goto next_file; } break; @@ -138,24 +138,24 @@ /* each PIR must have a PRR for same HEAD/SITE */ /* PTR/MPR/FTR records must appear between the right PIR/PRR pairs */ /* each BPS/EPS pair must be inside the PIR/PRR pair */ - case REC_PIR: break; /* only 1 per part tested */ - case REC_PTR: break; /* only 1 per part tested */ - case REC_MPR: break; /* only 1 per part tested */ - case REC_FTR: break; /* only 1 per part tested */ - case REC_BPS: break; - case REC_EPS: break; - case REC_PRR: break; /* only 1 per part tested */ + case STDF_REC_PIR: break; /* only 1 per part tested */ + case STDF_REC_PTR: break; /* only 1 per part tested */ + case STDF_REC_MPR: break; /* only 1 per part tested */ + case STDF_REC_FTR: break; /* only 1 per part tested */ + case STDF_REC_BPS: break; + case STDF_REC_EPS: break; + case STDF_REC_PRR: break; /* only 1 per part tested */ - case REC_TSR: break; - case REC_GDR: break; + case STDF_REC_TSR: break; + case STDF_REC_GDR: break; default: print_err("Uknown record found!"); goto next_file; } } - if (HEAD_TO_REC(prev_rec) != REC_MRR) { - print_err("REC_MRR was not the last record in the stream!"); + if (HEAD_TO_REC(prev_rec) != STDF_REC_MRR) { + print_err("STDF_REC_MRR was not the last record in the stream!"); goto next_file; } Modified: trunk/libstdf/examples/makestdf.c =================================================================== --- trunk/libstdf/examples/makestdf.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/makestdf.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file makestdf.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -25,25 +25,25 @@ } { - rec_far far = { - .CPU_TYPE = CPU_TYPE_X86, + stdf_rec_far far = { + .CPU_TYPE = STDF_CPU_TYPE_X86, .STDF_VER = 4 }; - stdf_init_header(far.header, REC_FAR); + stdf_init_header(far.header, STDF_REC_FAR); stdf_write_record(f, &far); } { - rec_atr atr = { + stdf_rec_atr atr = { .MOD_TIM = 3, .CMD_LINE = "\010CMD_LINE" }; - stdf_init_header(atr.header, REC_ATR); + stdf_init_header(atr.header, STDF_REC_ATR); stdf_write_record(f, &atr); } { - rec_mir mir = { + stdf_rec_mir mir = { .SETUP_T = 0, .START_T = 1, .STAT_NUM = 2, @@ -83,33 +83,33 @@ .SERL_NUM = "\010SERL_NUM", .SUPR_NAM = "\010SUPR_NAM" }; - stdf_init_header(mir.header, REC_MIR); + stdf_init_header(mir.header, STDF_REC_MIR); stdf_write_record(f, &mir); } { - rec_mrr mrr = { + stdf_rec_mrr mrr = { .FINISH_T = 4, .DISP_COD = ' ', .USR_DESC = "\010USR_DESC", .EXC_DESC = "\010EXC_DESC" }; - stdf_init_header(mrr.header, REC_MRR); + stdf_init_header(mrr.header, STDF_REC_MRR); stdf_write_record(f, &mrr); } { - dtc_U2 rtst_bin[10] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }; - rec_rdr rdr = { + stdf_dtc_U2 rtst_bin[10] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }; + stdf_rec_rdr rdr = { .NUM_BINS = 10, .RTST_BIN = rtst_bin }; - stdf_init_header(rdr.header, REC_RDR); + stdf_init_header(rdr.header, STDF_REC_RDR); stdf_write_record(f, &rdr); } { - rec_pcr pcr = { + stdf_rec_pcr pcr = { .HEAD_NUM = 1, .SITE_NUM = 2, .PART_CNT = 5, @@ -118,12 +118,12 @@ .GOOD_CNT = 8, .FUNC_CNT = 9 }; - stdf_init_header(pcr.header, REC_PCR); + stdf_init_header(pcr.header, STDF_REC_PCR); stdf_write_record(f, &pcr); } { - rec_hbr hbr = { + stdf_rec_hbr hbr = { .HEAD_NUM = 1, .SITE_NUM = 2, .HBIN_NUM = 6, @@ -131,12 +131,12 @@ .HBIN_PF = 'F', .HBIN_NAM = "\010HBIN_NAM" }; - stdf_init_header(hbr.header, REC_HBR); + stdf_init_header(hbr.header, STDF_REC_HBR); stdf_write_record(f, &hbr); } { - rec_sbr sbr = { + stdf_rec_sbr sbr = { .HEAD_NUM = 1, .SITE_NUM = 2, .SBIN_NUM = 0, @@ -144,12 +144,12 @@ .SBIN_PF = 'P', .SBIN_NAM = "\010SBIN_NAM" }; - stdf_init_header(sbr.header, REC_SBR); + stdf_init_header(sbr.header, STDF_REC_SBR); stdf_write_record(f, &sbr); } { - rec_pmr pmr = { + stdf_rec_pmr pmr = { .PMR_INDX = 3, .CHAN_TYP = 78, .CHAN_NAM = "\010CHAN_NAM", @@ -158,31 +158,31 @@ .HEAD_NUM = 68, .SITE_NUM = 4 }; - stdf_init_header(pmr.header, REC_PMR); + stdf_init_header(pmr.header, STDF_REC_PMR); stdf_write_record(f, &pmr); } { - dtc_U2 pmr_indx[3] = { 10, 20, 30}; - rec_pgr pgr = { + stdf_dtc_U2 pmr_indx[3] = { 10, 20, 30}; + stdf_rec_pgr pgr = { .GRP_INDX = 45678, .GRP_NAM = "\007GRP_NAM", .INDX_CNT = 3, .PMR_INDX = pmr_indx }; - stdf_init_header(pgr.header, REC_PGR); + stdf_init_header(pgr.header, STDF_REC_PGR); stdf_write_record(f, &pgr); } { - dtc_U2 grp_indx[6] = { 2, 4, 6, 8, 10, 12 }; - dtc_U2 grp_mode[6] = { 00, 10, 20, 21, 22, 23 }; - dtc_U1 grp_radx[6] = { 0, 2, 8, 10, 16, 20 }; - dtc_Cn pgm_char[6] = { "\001A", "\001B", "\001C", "\001D", "\001E", "\001F" }; - dtc_Cn rtn_char[6] = { "\001G", "\001H", "\001I", "\001J", "\001K", "\001L" }; - dtc_Cn pgm_chal[6] = { "\001M", "\001N", "\001O", "\001P", "\001Q", "\001R" }; - dtc_Cn rtn_chal[6] = { "\001S", "\001T", "\001U", "\001V", "\001W", "\001X" }; - rec_plr plr = { + stdf_dtc_U2 grp_indx[6] = { 2, 4, 6, 8, 10, 12 }; + stdf_dtc_U2 grp_mode[6] = { 00, 10, 20, 21, 22, 23 }; + stdf_dtc_U1 grp_radx[6] = { 0, 2, 8, 10, 16, 20 }; + stdf_dtc_Cn pgm_char[6] = { "\001A", "\001B", "\001C", "\001D", "\001E", "\001F" }; + stdf_dtc_Cn rtn_char[6] = { "\001G", "\001H", "\001I", "\001J", "\001K", "\001L" }; + stdf_dtc_Cn pgm_chal[6] = { "\001M", "\001N", "\001O", "\001P", "\001Q", "\001R" }; + stdf_dtc_Cn rtn_chal[6] = { "\001S", "\001T", "\001U", "\001V", "\001W", "\001X" }; + stdf_rec_plr plr = { .GRP_CNT = 6, .GRP_INDX = grp_indx, .GRP_MODE = grp_mode, @@ -192,13 +192,13 @@ .PGM_CHAL = pgm_chal, .RTN_CHAL = rtn_chal }; - stdf_init_header(plr.header, REC_PLR); + stdf_init_header(plr.header, STDF_REC_PLR); stdf_write_record(f, &plr); } { - dtc_U1 site_num[4] = { 5, 10, 15, 20 }; - rec_sdr sdr = { + stdf_dtc_U1 site_num[4] = { 5, 10, 15, 20 }; + stdf_rec_sdr sdr = { .HEAD_NUM = 2, .SITE_GRP = 3, .SITE_CNT = 4, @@ -220,23 +220,23 @@ .EXTR_TYP = "\010EXTR_TYP", .EXTR_ID = "\007EXTR_ID" }; - stdf_init_header(sdr.header, REC_SDR); + stdf_init_header(sdr.header, STDF_REC_SDR); stdf_write_record(f, &sdr); } { - rec_wir wir = { + stdf_rec_wir wir = { .HEAD_NUM = 2, .SITE_GRP = 3, .START_T = 4, .WAFER_ID = "\010WAFER_ID" }; - stdf_init_header(wir.header, REC_WIR); + stdf_init_header(wir.header, STDF_REC_WIR); stdf_write_record(f, &wir); } { - rec_wrr wrr = { + stdf_rec_wrr wrr = { .HEAD_NUM = 20, .SITE_GRP = 10, .FINISH_T = 5, @@ -252,12 +252,12 @@ .USR_DESC = "\010USR_DESC", .EXC_DESC = "\010EXC_DESC" }; - stdf_init_header(wrr.header, REC_WRR); + stdf_init_header(wrr.header, STDF_REC_WRR); stdf_write_record(f, &wrr); } { - rec_wcr wcr = { + stdf_rec_wcr wcr = { .WAFR_SIZ = 4.1, .DIE_HT = 2500.2, .DIE_WID = 5200.3, @@ -268,30 +268,30 @@ .POS_X = 'L', .POS_Y = 'U' }; - stdf_init_header(wcr.header, REC_WCR); + stdf_init_header(wcr.header, STDF_REC_WCR); stdf_write_record(f, &wcr); } { - rec_pir pir = { + stdf_rec_pir pir = { .HEAD_NUM = 30, .SITE_NUM = 60 }; - stdf_init_header(pir.header, REC_PIR); + stdf_init_header(pir.header, STDF_REC_PIR); stdf_write_record(f, &pir); } /* { - rec_prr prr = { + stdf_rec_prr prr = { }; - stdf_init_header(prr.header, REC_PRR); + stdf_init_header(prr.header, STDF_REC_PRR); stdf_write_record(f, &prr); } */ { - rec_tsr tsr = { + stdf_rec_tsr tsr = { .HEAD_NUM = 13, .SITE_NUM = 23, .TEST_TYP = 'P', @@ -309,24 +309,24 @@ .TST_SUMS = 66.66, .TST_SQRS = 8.125 }; - stdf_init_header(tsr.header, REC_TSR); + stdf_init_header(tsr.header, STDF_REC_TSR); stdf_write_record(f, &tsr); } /* { - rec_ptr ptr = { + stdf_rec_ptr ptr = { }; - stdf_init_header(ptr.header, REC_PTR); + stdf_init_header(ptr.header, STDF_REC_PTR); stdf_write_record(f, &ptr); } */ { - dtc_N1 rtn_stat[] = { 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90 }; - dtc_R4 rtn_rslt[] = { 1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9 }; - dtc_U2 rtn_indx[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33 }; - rec_mpr mpr = { + stdf_dtc_N1 rtn_stat[] = { 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90 }; + stdf_dtc_R4 rtn_rslt[] = { 1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9 }; + stdf_dtc_U2 rtn_indx[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33 }; + stdf_rec_mpr mpr = { .TEST_NUM = 2024, .HEAD_NUM = 1, .SITE_NUM = 2, @@ -354,18 +354,18 @@ .LO_SPEC = 0.9, .HI_SPEC = 9.0 }; - stdf_init_header(mpr.header, REC_MPR); + stdf_init_header(mpr.header, STDF_REC_MPR); stdf_write_record(f, &mpr); } { - dtc_U2 rtn_indx[] = { 1010, 2020, 3030, 4040, 5050, 6060, 7070, 8080 }; - dtc_N1 rtn_stat[] = { 0x13, 0x24, 0x57, 0x68 }; - dtc_U2 pgm_indx[] = { 101, 202, 303, 404, 505 }; - dtc_N1 pgm_stat[] = { 0x42, 0x75, 0x86 }; - uchar fail_pin[] = { 0x00, 0x00 }; - uchar spin_map[] = { 0x00, 0x00 }; - rec_ftr ftr = { + stdf_dtc_U2 rtn_indx[] = { 1010, 2020, 3030, 4040, 5050, 6060, 7070, 8080 }; + stdf_dtc_N1 rtn_stat[] = { 0x13, 0x24, 0x57, 0x68 }; + stdf_dtc_U2 pgm_indx[] = { 101, 202, 303, 404, 505 }; + stdf_dtc_N1 pgm_stat[] = { 0x42, 0x75, 0x86 }; + unsigned char fail_pin[] = { 0x00, 0x00 }; + unsigned char spin_map[] = { 0x00, 0x00 }; + stdf_rec_ftr ftr = { .TEST_NUM = 2024, .HEAD_NUM = 1, .SITE_NUM = 2, @@ -395,38 +395,38 @@ .PATG_NUM = 254, .SPIN_MAP = spin_map }; - stdf_init_header(ftr.header, REC_FTR); + stdf_init_header(ftr.header, STDF_REC_FTR); stdf_write_record(f, &ftr); } { - rec_bps bps = { + stdf_rec_bps bps = { .SEQ_NAME = "\010SEQ_NAME" }; - stdf_init_header(bps.header, REC_BPS); + stdf_init_header(bps.header, STDF_REC_BPS); stdf_write_record(f, &bps); } { - rec_eps eps; - stdf_init_header(eps.header, REC_EPS); + stdf_rec_eps eps; + stdf_init_header(eps.header, STDF_REC_EPS); stdf_write_record(f, &eps); } /* { - rec_gdr gdr = { + stdf_rec_gdr gdr = { }; - stdf_init_header(gdr.header, REC_GDR); + stdf_init_header(gdr.header, STDF_REC_GDR); stdf_write_record(f, &gdr); } */ { - rec_dtr dtr = { + stdf_rec_dtr dtr = { .TEXT_DAT = "\010TEXT_DAT" }; - stdf_init_header(dtr.header, REC_DTR); + stdf_init_header(dtr.header, STDF_REC_DTR); stdf_write_record(f, &dtr); } Modified: trunk/libstdf/examples/record_stats.c =================================================================== --- trunk/libstdf/examples/record_stats.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/record_stats.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file record_stats.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -102,7 +102,7 @@ { stdf_file *f; char *recname; - rec_unknown *rec; + stdf_rec_unknown *rec; long cnt; int i; HASH_VARS Modified: trunk/libstdf/examples/stdf2img.c =================================================================== --- trunk/libstdf/examples/stdf2img.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/stdf2img.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file stdf2img.c */ /* - * Copyright (C) 2005-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2005-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -13,10 +13,10 @@ int main(int argc, char *argv[]) { stdf_file *f; - rec_unknown *r; + stdf_rec_unknown *r; - dtc_I2 x_min, y_min, x_max, y_max, x, y, x_range, y_range; - dtc_U2 *hard_bins, *soft_bins; + stdf_dtc_I2 x_min, y_min, x_max, y_max, x, y, x_range, y_range; + stdf_dtc_U2 *hard_bins, *soft_bins; if (argc != 2) { printf("Usage: %s <stdf file>\n", argv[0]); @@ -31,10 +31,10 @@ while ((r=stdf_read_record(f)) != NULL) { switch (HEAD_TO_REC(r->header)) { - case REC_MIR: + case STDF_REC_MIR: break; - case REC_PRR: { - rec_prr *prr = (rec_prr*)r; + case STDF_REC_PRR: { + stdf_rec_prr *prr = (stdf_rec_prr*)r; if (x_min > prr->X_COORD) x_min = prr->X_COORD; if (y_min > prr->Y_COORD) y_min = prr->Y_COORD; if (x_max < prr->X_COORD) x_max = prr->X_COORD; @@ -49,21 +49,21 @@ x_range = x_max - x_min + 1 ; y_range = y_max - y_min + 1; - hard_bins = (dtc_U2*)malloc(sizeof(dtc_U2) * x_range * y_range); + hard_bins = (stdf_dtc_U2*)malloc(sizeof(stdf_dtc_U2) * x_range * y_range); if (!hard_bins) perror("hard_bins malloc failed"); - memset(hard_bins, 0, sizeof(dtc_U2) * x_range * y_range); + memset(hard_bins, 0, sizeof(stdf_dtc_U2) * x_range * y_range); - soft_bins = (dtc_U2*)malloc(sizeof(dtc_U2) * x_range * y_range); + soft_bins = (stdf_dtc_U2*)malloc(sizeof(stdf_dtc_U2) * x_range * y_range); if (!soft_bins) perror("soft_bins malloc failed"); - memset(soft_bins, 0, sizeof(dtc_U2) * x_range * y_range); + memset(soft_bins, 0, sizeof(stdf_dtc_U2) * x_range * y_range); f = stdf_open(argv[1]); if (!f) return EXIT_FAILURE; while ((r=stdf_read_record(f)) != NULL) { switch (HEAD_TO_REC(r->header)) { - case REC_PRR: { - rec_prr *prr = (rec_prr*)r; + case STDF_REC_PRR: { + stdf_rec_prr *prr = (stdf_rec_prr*)r; x = prr->X_COORD - x_min; y = prr->Y_COORD - y_min; hard_bins[x*x_range + y] = prr->HARD_BIN; @@ -76,7 +76,7 @@ stdf_close(f); { - dtc_U2 bin; + stdf_dtc_U2 bin; gdImagePtr hardim, softim; int hard_colors[50], soft_colors[50]; FILE *outimg; Modified: trunk/libstdf/examples/stdf2xtdf.c =================================================================== --- trunk/libstdf/examples/stdf2xtdf.c 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/examples/stdf2xtdf.c 2007-01-19 08:05:14 UTC (rev 276) @@ -2,7 +2,7 @@ * @file stdf2xtdf.c */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -32,13 +32,13 @@ } \ printf("'/>\n"); \ } -print_x(print_xU1, dtc_xU1, "%i") -print_x(print_xU2, dtc_xU2, "%i") -print_x(print_xR4, dtc_xR4, "%f") +print_x(print_xU1, stdf_dtc_xU1, "%i") +print_x(print_xU2, stdf_dtc_xU2, "%i") +print_x(print_xR4, stdf_dtc_xR4, "%f") -void print_xN1(char *member, dtc_xN1 xN1, dtc_U2 c) +void print_xN1(char *member, stdf_dtc_xN1 xN1, stdf_dtc_U2 c) { - dtc_N1 *n = xN1; + stdf_dtc_N1 *n = xN1; printf("\t<%s value='", member); while (c > 0) { if (c > 1) { @@ -54,7 +54,7 @@ printf("'/>\n"); } -void print_Vn(char *n, dtc_Vn v, int c) +void print_Vn(char *n, stdf_dtc_Vn v, int c) { int i; --c; @@ -62,30 +62,30 @@ for (i=0; i<=c; ++i) { printf("\t\t<%s value='", stdf_get_Vn_name(v[i].type)); switch (v[i].type) { - case GDR_B0: printf("(pad)"); break; - case GDR_U1: printf("%i", *((dtc_U1*)v[i].data)); break; - case GDR_U2: printf("%i", *((dtc_U2*)v[i].data)); break; - case GDR_U4: printf("%i", *((dtc_U4*)v[i].data)); break; - case GDR_I1: printf("%i", *((dtc_I1*)v[i].data)); break; - case GDR_I2: printf("%i", *((dtc_I2*)v[i].data)); break; - case GDR_I4: printf("%i", *((dtc_I4*)v[i].data)); break; - case GDR_R4: printf("%f", *((dtc_R4*)v[i].data)); break; - case GDR_R8: printf("%f", *((dtc_R8*)v[i].data)); break; - case GDR_Cn: { - dtc_Cn Cn = *((dtc_Cn*)v[i].data); + case STDF_GDR_B0: printf("(pad)"); break; + case STDF_GDR_U1: printf("%i", *((stdf_dtc_U1*)v[i].data)); break; + case STDF_GDR_U2: printf("%i", *((stdf_dtc_U2*)v[i].data)); break; + case STDF_GDR_U4: printf("%i", *((stdf_dtc_U4*)v[i].data)); break; + case STDF_GDR_I1: printf("%i", *((stdf_dtc_I1*)v[i].data)); break; + case STDF_GDR_I2: printf("%i", *((stdf_dtc_I2*)v[i].data)); break; + case STDF_GDR_I4: printf("%i", *((stdf_dtc_I4*)v[i].data)); break; + case STDF_GDR_R4: printf("%f", *((stdf_dtc_R4*)v[i].data)); break; + case STDF_GDR_R8: printf("%f", *((stdf_dtc_R8*)v[i].data)); break; + case STDF_GDR_Cn: { + stdf_dtc_Cn Cn = *((stdf_dtc_Cn*)v[i].data); printf("%s", (*Cn ? Cn+1 : "(null")); break; } - case GDR_Bn: printf("[??]"); break; - case GDR_Dn: printf("[??]"); break; - case GDR_N1: printf("%X", *((dtc_N1*)v[i].data)); break; + case STDF_GDR_Bn: printf("[??]"); break; + case STDF_GDR_Dn: printf("[??]"); break; + case STDF_GDR_N1: printf("%X", *((stdf_dtc_N1*)v[i].data)); break; } printf("'/>\n"); } printf("\t</%s>\n", n); } -void print_Bn(char *n, dtc_Bn b) +void print_Bn(char *n, stdf_dtc_Bn b) { int i; printf("\t<%s value='", n); @@ -94,10 +94,10 @@ printf("'/>\n"); } -void print_Dn(char *n, dtc_Dn d) +void print_Dn(char *n, stdf_dtc_Dn d) { int i; - dtc_U2 *num_bits = (dtc_U2*)d, len; + stdf_dtc_U2 *num_bits = (stdf_dtc_U2*)d, len; len = *num_bits / 8; if (*num_bits % 8) ++len; printf("\t<%s value='", n); @@ -121,9 +121,9 @@ { stdf_file *f; char *recname; - rec_unknown *rec; + stdf_rec_unknown *rec; int i; - dtc_U4 stdf_ver; + stdf_dtc_U4 stdf_ver; if (argc <= 1) { printf("Need some files to open!\n"); @@ -144,23 +144,23 @@ printf("<stdf source=\"%s\">\n", argv[i]); while ((rec=stdf_read_record(f)) != NULL) { recname = stdf_get_rec_name(rec->header.REC_TYP, rec->header.REC_SUB); - if (HEAD_TO_REC(rec->header) != REC_UNKNOWN) + if (HEAD_TO_REC(rec->header) != STDF_REC_UNKNOWN) printf("<%s>\n", recname); switch (HEAD_TO_REC(rec->header)) { - case REC_FAR: { - rec_far *far = (rec_far*)rec; + case STDF_REC_FAR: { + stdf_rec_far *far = (stdf_rec_far*)rec; print_int("CPU_TYPE", far->CPU_TYPE); print_int("STDF_VER", far->STDF_VER); break; } - case REC_ATR: { - rec_atr *atr = (rec_atr*)rec; + case STDF_REC_ATR: { + stdf_rec_atr *atr = (stdf_rec_atr*)rec; print_tim("MOD_TIM", atr->MOD_TIM); print_str("CMD_LINE", atr->CMD_LINE); break; } - case REC_MIR: { - rec_mir *mir = (rec_mir*)rec; + case STDF_REC_MIR: { + stdf_rec_mir *mir = (stdf_rec_mir*)rec; #ifdef STDF_VER3 if (stdf_ver == 4) { #endif @@ -231,8 +231,8 @@ #endif break; } - case REC_MRR: { - rec_mrr *mrr = (rec_mrr*)rec; + case STDF_REC_MRR: { + stdf_rec_mrr *mrr = (stdf_rec_mrr*)rec; print_tim("FINISH_T", mrr->FINISH_T); #ifdef STDF_VER3 if (stdf_ver == 3) { @@ -248,8 +248,8 @@ print_str("EXC_DESC", mrr->EXC_DESC); break; } - case REC_PCR: { - rec_pcr *pcr = (rec_pcr*)rec; + case STDF_REC_PCR: { + stdf_rec_pcr *pcr = (stdf_rec_pcr*)rec; print_int("HEAD_NUM", pcr->HEAD_NUM); print_int("SITE_NUM", pcr->SITE_NUM); print_int("PART_CNT", pcr->PART_CNT); @@ -259,8 +259,8 @@ print_int("FUNC_CNT", pcr->FUNC_CNT); break; } - case REC_HBR: { - rec_hbr *hbr = (rec_hbr*)rec; + case STDF_REC_HBR: { + stdf_rec_hbr *hbr = (stdf_rec_hbr*)rec; print_int("HEAD_NUM", hbr->HEAD_NUM); print_int("SITE_NUM", hbr->SITE_NUM); print_int("HBIN_NUM", hbr->HBIN_NUM); @@ -269,8 +269,8 @@ print_str("HBIN_NAM", hbr->HBIN_NAM); break; } - case REC_SBR: { - rec_sbr *sbr = (rec_sbr*)rec; + case STDF_REC_SBR: { + stdf_rec_sbr *sbr = (stdf_rec_sbr*)rec; print_int("HEAD_NUM", sbr->HEAD_NUM); print_int("SITE_NUM", sbr->SITE_NUM); print_int("SBIN_NUM", sbr->SBIN_NUM); @@ -279,8 +279,8 @@ print_str("SBIN_NAM", sbr->SBIN_NAM); break; } - case REC_PMR: { - rec_pmr *pmr = (rec_pmr*)rec; + case STDF_REC_PMR: { + stdf_rec_pmr *pmr = (stdf_rec_pmr*)rec; print_int("PMR_INDX", pmr->PMR_INDX); print_int("CHAN_TYP", pmr->CHAN_TYP); print_str("CHAN_NAM", pmr->CHAN_NAM); @@ -290,16 +290,16 @@ print_int("SITE_NUM", pmr->SITE_NUM); break; } - case REC_PGR: { - rec_pgr *pgr = (rec_pgr*)rec; + case STDF_REC_PGR: { + stdf_rec_pgr *pgr = (stdf_rec_pgr*)rec; print_int("GRP_INDX", pgr->GRP_INDX); print_str("GRP_NAM", pgr->GRP_NAM); print_int("INDX_CNT", pgr->INDX_CNT); print_xU2("PMR_INDX", pgr->PMR_INDX, pgr->INDX_CNT); break; } - case REC_PLR: { - rec_plr *plr = (rec_plr*)rec; + case STDF_REC_PLR: { + stdf_rec_plr *plr = (stdf_rec_plr*)rec; print_int("GRP_CNT", plr->GRP_CNT); print_xU2("GRP_INDX", plr->GRP_INDX, plr->GRP_CNT); print_xU2("GRP_MODE", plr->GRP_MODE, plr->GRP_CNT); @@ -310,14 +310,14 @@ print_UNK("RTN_CHAL"); break; } - case REC_RDR: { - rec_rdr *rdr = (rec_rdr*)rec; + case STDF_REC_RDR: { + stdf_rec_rdr *rdr = (stdf_rec_rdr*)rec; print_int("NUM_BINS", rdr->NUM_BINS); print_xU2("RTST_BIN", rdr->RTST_BIN, rdr->NUM_BINS); break; } - case REC_SDR: { - rec_sdr *sdr = (rec_sdr*)rec; + case STDF_REC_SDR: { + stdf_rec_sdr *sdr = (stdf_rec_sdr*)rec; print_int("HEAD_NUM", sdr->HEAD_NUM); print_int("SITE_GRP", sdr->SITE_GRP); print_int("SITE_CNT", sdr->SITE_CNT); @@ -340,8 +340,8 @@ print_str("EXTR_ID", sdr->EXTR_ID); break; } - case REC_WIR: { - rec_wir *wir = (rec_wir*)rec; + case STDF_REC_WIR: { + stdf_rec_wir *wir = (stdf_rec_wir*)rec; print_int("HEAD_NUM", wir->HEAD_NUM); #ifdef STDF_VER3 if (stdf_ver == 3) @@ -353,8 +353,8 @@ print_str("WAFER_ID", wir->WAFER_ID); break; } - case REC_WRR: { - rec_wrr *wrr = (rec_wrr*)rec; + case STDF_REC_WRR: { + stdf_rec_wrr *wrr = (stdf_rec_wrr*)rec; #ifdef STDF_VER3 if (stdf_ver == 4) { #endif @@ -390,8 +390,8 @@ print_str("EXC_DESC", wrr->EXC_DESC); break; } - case REC_WCR: { - rec_wcr *wcr = (rec_wcr*)rec; + case STDF_REC_WCR: { + stdf_rec_wcr *wcr = (stdf_rec_wcr*)rec; print_rel("WAFR_SIZ", wcr->WAFR_SIZ); print_rel("DIE_HT", wcr->DIE_HT); print_rel("DIE_WID", wcr->DIE_WID); @@ -403,8 +403,8 @@ print_chr("POS_Y", wcr->POS_Y); break; } - case REC_PIR: { - rec_pir *pir = (rec_pir*)rec; + case STDF_REC_PIR: { + stdf_rec_pir *pir = (stdf_rec_pir*)rec; print_int("HEAD_NUM", pir->HEAD_NUM); print_int("SITE_NUM", pir->SITE_NUM); #ifdef STDF_VER3 @@ -416,8 +416,8 @@ #endif break; } - case REC_PRR: { - rec_prr *prr = (rec_prr*)rec; + case STDF_REC_PRR: { + stdf_rec_prr *prr = (stdf_rec_prr*)rec; print_int("HEAD_NUM", prr->HEAD_NUM); print_int("SITE_NUM", prr->SITE_NUM); #ifdef STDF_VER3 @@ -445,8 +445,8 @@ break; } #ifdef STDF_VER3 - case REC_PDR: { - rec_pdr *pdr = (rec_pdr*)rec; + case STDF_REC_PDR: { + stdf_rec_pdr *pdr = (stdf_rec_pdr*)rec; print_int("TEST_NUM", pdr->TEST_NUM); print_hex("DESC_FLG", pdr->DESC_FLG); print_hex("OPT_FLAG", pdr->OPT_FLAG); @@ -466,8 +466,8 @@ print_str("SEQ_NAME", pdr->SEQ_NAME); break; } - case REC_FDR: { - rec_fdr *fdr = (rec_fdr*)rec; + case STDF_REC_FDR: { + stdf_rec_fdr *fdr = (stdf_rec_fdr*)rec; print_int("TEST_NUM", fdr->TEST_NUM); print_hex("DESC_FLG", fdr->DESC_FLG); print_str("TEST_NAM", fdr->TEST_NAM); @@ -475,8 +475,8 @@ break; } #endif - case REC_TSR: { - rec_tsr *tsr = (rec_tsr*)rec; + case STDF_REC_TSR: { + stdf_rec_tsr *tsr = (stdf_rec_tsr*)rec; print_int("HEAD_NUM", tsr->HEAD_NUM); print_int("SITE_NUM", tsr->SITE_NUM); #ifdef STDF_VER3 @@ -515,8 +515,8 @@ #endif break; } - case REC_PTR: { - rec_ptr *ptr = (rec_ptr*)rec; + case STDF_REC_PTR: { + stdf_rec_ptr *ptr = (stdf_rec_ptr*)rec; print_int("TEST_NUM", ptr->TEST_NUM); print_int("HEAD_NUM", ptr->HEAD_NUM); print_int("SITE_NUM", ptr->SITE_NUM); @@ -539,8 +539,8 @@ print_rel("HI_SPEC", ptr->HI_SPEC); break; } - case REC_MPR: { - rec_mpr *mpr = (rec_mpr*)rec; + case STDF_REC_MPR: { + stdf_rec_mpr *mpr = (stdf_rec_mpr*)rec; print_int("TEST_NUM", mpr->TEST_NUM); print_int("HEAD_NUM", mpr->HEAD_NUM); print_int("SITE_NUM", mpr->SITE_NUM); @@ -570,8 +570,8 @@ print_rel("HI_SPEC", mpr->HI_SPEC); break; } - case REC_FTR: { - rec_ftr *ftr = (rec_ftr*)rec; + case STDF_REC_FTR: { + stdf_rec_ftr *ftr = (stdf_rec_ftr*)rec; print_int("TEST_NUM", ftr->TEST_NUM); print_int("HEAD_NUM", ftr->HEAD_NUM); print_int("SITE_NUM", ftr->SITE_NUM); @@ -602,18 +602,18 @@ print_Dn("SPIN_MAP", ftr->SPIN_MAP); break; } - case REC_BPS: { - rec_bps *bps = (rec_bps*)rec; + case STDF_REC_BPS: { + stdf_rec_bps *bps = (stdf_rec_bps*)rec; print_str("SEQ_NAME", bps->SEQ_NAME); break; } - case REC_EPS: { - /*rec_eps *eps = (rec_eps*)rec;*/ + case STDF_REC_EPS: { + /*stdf_rec_eps *eps = (stdf_rec_eps*)rec;*/ break; } #ifdef STDF_VER3 - case REC_SHB: { - rec_shb *shb = (rec_shb*)rec; + case STDF_REC_SHB: { + stdf_rec_shb *shb = (stdf_rec_shb*)rec; print_int("HEAD_NUM", shb->HEAD_NUM); print_int("SITE_NUM", shb->SITE_NUM); print_int("HBIN_NUM", shb->HBIN_NUM); @@ -621,8 +621,8 @@ print_str("HBIN_NAM", shb->HBIN_NAM); break; } - case REC_SSB: { - rec_ssb *ssb = (rec_ssb*)rec; + case STDF_REC_SSB: { + stdf_rec_ssb *ssb = (stdf_rec_ssb*)rec; print_int("HEAD_NUM", ssb->HEAD_NUM); print_int("SITE_NUM", ssb->SITE_NUM); print_int("SBIN_NUM", ssb->SBIN_NUM); @@ -630,8 +630,8 @@ print_str("SBIN_NAM", ssb->SBIN_NAM); break; } - case REC_STS: { - rec_sts *sts = (rec_sts*)rec; + case STDF_REC_STS: { + stdf_rec_sts *sts = (stdf_rec_sts*)rec; print_int("HEAD_NUM", sts->HEAD_NUM); print_int("SITE_NUM", sts->SITE_NUM); print_int("TEST_NUM", sts->TEST_NUM); @@ -651,8 +651,8 @@ print_str("TEST_LBL", sts->TEST_LBL); break; } - case REC_SCR: { - rec_scr *scr = (rec_scr*)rec; + case STDF_REC_SCR: { + stdf_rec_scr *scr = (stdf_rec_scr*)rec; print_int("HEAD_NUM", scr->HEAD_NUM); print_int("SITE_NUM", scr->SITE_NUM); print_int("FINISH_T", scr->FINISH_T); @@ -664,19 +664,19 @@ break; } #endif - case REC_GDR: { - rec_gdr *gdr = (rec_gdr*)rec; + case STDF_REC_GDR: { + stdf_rec_gdr *gdr = (stdf_rec_gdr*)rec; print_int("FLD_CNT", gdr->FLD_CNT); print_Vn("GEN_DATA", gdr->GEN_DATA, gdr->FLD_CNT); break; } - case REC_DTR: { - rec_dtr *dtr = (rec_dtr*)rec; + case STDF_REC_DTR: { + stdf_rec_dtr *dtr = (stdf_rec_dtr*)rec; print_str("TEXT_DAT", dtr->TEXT_DAT); break; } } - if (HEAD_TO_REC(rec->header) != REC_UNKNOWN) + if (HEAD_TO_REC(rec->header) != STDF_REC_UNKNOWN) printf("</%s>\n", recname); stdf_free_record(rec); } Modified: trunk/libstdf/include/libstdf.h =================================================================== --- trunk/libstdf/include/libstdf.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf.h 2007-01-19 08:05:14 UTC (rev 276) @@ -3,7 +3,7 @@ * @brief Top level include and the main stdf structure definition. */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ Modified: trunk/libstdf/include/libstdf_bswap.h =================================================================== --- trunk/libstdf/include/libstdf_bswap.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf_bswap.h 2007-01-19 08:05:14 UTC (rev 276) @@ -3,7 +3,7 @@ * @brief Byte swapping functions. */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ Modified: trunk/libstdf/include/libstdf_const.h =================================================================== --- trunk/libstdf/include/libstdf_const.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf_const.h 2007-01-19 08:05:14 UTC (rev 276) @@ -3,7 +3,7 @@ * @brief Constants for specific records/members. */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -13,17 +13,17 @@ /* FAR: File Attributes Record [page 18] */ typedef enum { - CPU_TYPE_DEC = 0, /**< PDP-11 / VAX */ - CPU_TYPE_SPARC = 1, /**< sparc [Solaris] */ - CPU_TYPE_X86 = 2, /**< x86 [Sun386i / Windows / DOS] */ - CPU_TYPE_UNKNOWN = 123, /**< Unknown kind of CPU */ + STDF_CPU_TYPE_DEC = 0, /**< PDP-11 / VAX */ + STDF_CPU_TYPE_SPARC = 1, /**< sparc [Solaris] */ + STDF_CPU_TYPE_X86 = 2, /**< x86 [Sun386i / Windows / DOS] */ + STDF_CPU_TYPE_UNKNOWN = 123, /**< Unknown kind of CPU */ #ifdef STDF_VER3 - CPU_TYPE_SUN_680XX = CPU_TYPE_SPARC, /**< sparc [Solaris] */ - CPU_TYPE_SUN_80386 = CPU_TYPE_X86, /**< x86 [Sun386i] */ - CPU_TYPE_LTX = 3, /**< WTF is LTX ? */ - CPU_TYPE_APOLLO = 4 /**< WTF is Apollo ? */ + STDF_CPU_TYPE_SUN_680XX = STDF_CPU_TYPE_SPARC, /**< sparc [Solaris] */ + STDF_CPU_TYPE_SUN_80386 = STDF_CPU_TYPE_X86, /**< x86 [Sun386i] */ + STDF_CPU_TYPE_LTX = 3, /**< WTF is LTX ? */ + STDF_CPU_TYPE_APOLLO = 4 /**< WTF is Apollo ? */ #endif -} cpu_types; +} stdf_cpu_types; /* MIR: Master Information Record [page 20] */ #define MODE_AEL 'A' @@ -107,19 +107,19 @@ /* GDR: Generic Data Record [page 64] */ typedef enum { - GDR_B0 = 0, - GDR_U1 = 1, - GDR_U2 = 2, - GDR_U4 = 3, - GDR_I1 = 4, - GDR_I2 = 5, - GDR_I4 = 6, - GDR_R4 = 7, - GDR_R8 = 8, - GDR_Cn = 10, - GDR_Bn = 11, - GDR_Dn = 12, - GDR_N1 = 13 -} dtc_Vn_type; + STDF_GDR_B0 = 0, + STDF_GDR_U1 = 1, + STDF_GDR_U2 = 2, + STDF_GDR_U4 = 3, + STDF_GDR_I1 = 4, + STDF_GDR_I2 = 5, + STDF_GDR_I4 = 6, + STDF_GDR_R4 = 7, + STDF_GDR_R8 = 8, + STDF_GDR_Cn = 10, + STDF_GDR_Bn = 11, + STDF_GDR_Dn = 12, + STDF_GDR_N1 = 13 +} stdf_dtc_Vn_type; #endif /* _LIBSTDF_CONST_H */ Modified: trunk/libstdf/include/libstdf_funcs.h =================================================================== --- trunk/libstdf/include/libstdf_funcs.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf_funcs.h 2007-01-19 08:05:14 UTC (rev 276) @@ -3,7 +3,7 @@ * @brief Publicly exported functions. */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -20,16 +20,16 @@ extern int stdf_set_setting(stdf_file*, uint32_t, ...); extern void stdf_get_setting(stdf_file*, uint32_t, ...); -extern rec_unknown* stdf_read_record(stdf_file*); /**< Read in the next record and parse it */ -extern rec_unknown* stdf_read_record_raw(stdf_file*); /**< Read in the next record raw */ -extern rec_unknown* stdf_parse_raw_record(rec_unknown*); /**< Parse a previously read record */ -extern void stdf_free_record(rec_unknown*); /**< Free a record */ +extern stdf_rec_unknown* stdf_read_record(stdf_file*); /**< Read in the next record and parse it */ +extern stdf_rec_unknown* stdf_read_record_raw(stdf_file*); /**< Read in the next record raw */ +extern stdf_rec_unknown* stdf_parse_raw_record(stdf_rec_unknown*); /**< Parse a previously read record */ +extern void stdf_free_record(stdf_rec_unknown*); /**< Free a record */ extern ssize_t stdf_write_record(stdf_file*, void*); /**< Write out a record */ #define stdf_init_header(header, type) INIT_HEADER(header, type) -extern char* stdf_get_rec_name(rec_typ, rec_sub); /**< Translate a record into the 3 letter spec name */ +extern char* stdf_get_rec_name(stdf_rec_typ, stdf_rec_sub); /**< Translate a record into the 3 letter spec name */ #define stdf_get_rec_name_from_head(h) stdf_get_rec_name(h.REC_TYP, h.REC_SUB) #define stdf_get_rec_name_from_rec(r) stdf_get_rec_name(r->header.REC_TYP, r->header.REC_SUB) Modified: trunk/libstdf/include/libstdf_internal.h =================================================================== --- trunk/libstdf/include/libstdf_internal.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf_internal.h 2007-01-19 08:05:14 UTC (rev 276) @@ -4,7 +4,7 @@ * @internal */ /* - * Copyright (C) 2005-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2005-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -21,48 +21,43 @@ int (*close)(void*); } __stdf_fops; +typedef uint8_t byte_t; + /** * @brief The main STDF file structure. */ typedef struct { - rec_header header; /**< A processed version of the last record read */ + stdf_rec_header header; /**< A processed version of the last record read */ - int fd; /**< Actual file descriptor for the backing file */ + int fd; /**< Actual file descriptor for the backing file */ union { -# if HAVE_ZIP - ZZIP_FILE *zip; -# define fd_zip __fd.zip -# endif -# if HAVE_GZIP - gzFile *gzip; -# define fd_gzip __fd.gzip -# endif -# if HAVE_BZIP2 - BZFILE *bzip2; -# define fd_bzip2 __fd.bzip2 -# endif -# if HAVE_LZW - lzwFile *lzw; -# define fd_lzw __fd.lzw -# endif - uintptr_t padding[4]; + USE_ZIP (ZZIP_FILE *zip;) + USE_GZIP (gzFile *gzip;) + USE_BZIP2 (BZFILE *bzip2;) + USE_LZW (lzwFile *lzw;) + /* leave space for 8 compression type ... */ + uintptr_t padding[8]; } __fd; +#define fd_zip __fd.zip +#define fd_gzip __fd.gzip +#define fd_bzip2 __fd.bzip2 +#define fd_lzw __fd.lzw - stdf_format file_format; /**< Compressed file format */ - char *filename; /**< Filename that was given to stdf_open() */ - __stdf_fops *fops; /**< Virtual file i/o functions to hide compression details */ + stdf_format file_format; /**< Compressed file format */ + char *filename; /**< Filename that was given to stdf_open() */ + __stdf_fops *fops; /**< Virtual file i/o functions to hide compression details */ - int byte_order; /**< Byte order of the file */ - uint32_t opts; /**< Misc options to control libstdf behavior */ - dtc_U1 ver; /**< Spec version of the file */ + int byte_order; /**< Byte order of the file */ + uint32_t opts; /**< Misc options to control libstdf behavior */ + stdf_dtc_U1 ver; /**< Spec version of the file */ - byte_t *__data; - byte_t *rec_pos; - byte_t *rec_end; + byte_t *__data; + byte_t *rec_pos; + byte_t *rec_end; - byte_t *__output; - byte_t *_write_pos; - dtc_U2 _write_chunk_size; + byte_t *__output; + byte_t *_write_pos; + stdf_dtc_U2 _write_chunk_size; } stdf_file; Modified: trunk/libstdf/include/libstdf_systems.h =================================================================== --- trunk/libstdf/include/libstdf_systems.h 2007-01-19 06:45:59 UTC (rev 275) +++ trunk/libstdf/include/libstdf_systems.h 2007-01-19 08:05:14 UTC (rev 276) @@ -3,7 +3,7 @@ * @brief System specific include files / features. */ /* - * Copyright (C) 2004-2006 Mike Frysinger <va...@gm...> + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> * Released under the BSD license. For more information, * please see: http://opensource.org/licenses/bsd-license.php */ @@ -98,8 +98,6 @@ typedef int64 int64_t; #endif -typedef unsi... [truncated message content] |
From: <va...@us...> - 2007-02-19 04:06:12
|
Revision: 284 http://svn.sourceforge.net/freestdf/?rev=284&view=rev Author: vapier Date: 2007-02-18 20:06:12 -0800 (Sun, 18 Feb 2007) Log Message: ----------- tweak tests some more so we can pass distcheck Modified Paths: -------------- trunk/libstdf/TODO trunk/libstdf/configure.ac trunk/libstdf/test.sh trunk/libstdf/tests/Makefile.in Modified: trunk/libstdf/TODO =================================================================== --- trunk/libstdf/TODO 2007-02-19 03:45:10 UTC (rev 283) +++ trunk/libstdf/TODO 2007-02-19 04:06:12 UTC (rev 284) @@ -20,3 +20,6 @@ If so, then remove duplicate entries after the first occurence - stop polluting exported name space with HAVE_* defines + + - figure out how to integrate tests/Makefile.in properly so i dont have + to keep tweaking it Modified: trunk/libstdf/configure.ac =================================================================== --- trunk/libstdf/configure.ac 2007-02-19 03:45:10 UTC (rev 283) +++ trunk/libstdf/configure.ac 2007-02-19 04:06:12 UTC (rev 284) @@ -1,4 +1,4 @@ -AC_INIT(libstdf, 0.4, [va...@gm...]) +AC_INIT(libstdf, 0.5, [va...@gm...]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER(include/libstdf_sys_config.h) Modified: trunk/libstdf/test.sh =================================================================== --- trunk/libstdf/test.sh 2007-02-19 03:45:10 UTC (rev 283) +++ trunk/libstdf/test.sh 2007-02-19 04:06:12 UTC (rev 284) @@ -9,6 +9,7 @@ make clean make -j make check + [[ $d == "." ]] && make distcheck make distclean } Modified: trunk/libstdf/tests/Makefile.in =================================================================== --- trunk/libstdf/tests/Makefile.in 2007-02-19 03:45:10 UTC (rev 283) +++ trunk/libstdf/tests/Makefile.in 2007-02-19 04:06:12 UTC (rev 284) @@ -37,5 +37,7 @@ distclean clean: rm -f *.out + if test "$(srcdir)" != "$(builddir)" ; then rm -f $(STDF) ; fi -.PHONY: all install check ascii html stats create distdir distclean clean +.PHONY: all install check ascii html stats create distdir distclean clean \ + dvi installcheck uninstall This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-02-19 04:35:32
|
Revision: 286 http://svn.sourceforge.net/freestdf/?rev=286&view=rev Author: vapier Date: 2007-02-18 20:35:32 -0800 (Sun, 18 Feb 2007) Log Message: ----------- change #if to #ifdef since these things are defined/undefined, not always defined to 0/1 Modified Paths: -------------- trunk/libstdf/include/libstdf_internal.h trunk/libstdf/src/libstdf.c trunk/libstdf/src/rec.c Modified: trunk/libstdf/include/libstdf_internal.h =================================================================== --- trunk/libstdf/include/libstdf_internal.h 2007-02-19 04:33:15 UTC (rev 285) +++ trunk/libstdf/include/libstdf_internal.h 2007-02-19 04:35:32 UTC (rev 286) @@ -105,7 +105,7 @@ /** * @brief Misc cruft for debugging fun. */ -#if HAVE_MCHECK_H +#ifdef HAVE_MCHECK_H # include <mcheck.h> # define _stdf_mtrace() mtrace() # define _stdf_muntrace() muntrace() @@ -114,11 +114,11 @@ # define _stdf_muntrace() #endif -#if HAVE_DMALLOC_H +#ifdef HAVE_DMALLOC_H # include <dmalloc.h> #endif -#if HAVE_EFENCE_H +#ifdef HAVE_EFENCE_H # include <efence.h> #endif Modified: trunk/libstdf/src/libstdf.c =================================================================== --- trunk/libstdf/src/libstdf.c 2007-02-19 04:33:15 UTC (rev 285) +++ trunk/libstdf/src/libstdf.c 2007-02-19 04:35:32 UTC (rev 286) @@ -155,7 +155,7 @@ /* * ZIP SUPPORT */ -#if HAVE_ZIP +#ifdef HAVE_ZIP static int __stdf_open_zip(void *data, int flags, uint32_t mode) { stdf_file *stdf = (stdf_file*)data; @@ -204,7 +204,7 @@ /* * GZIP SUPPORT */ -#if HAVE_GZIP +#ifdef HAVE_GZIP static int __stdf_open_gzip(void *data, int flags, uint32_t mode) { stdf_file *stdf = (stdf_file*)data; @@ -242,7 +242,7 @@ /* * BZIP2 SUPPORT */ -#if HAVE_BZIP2 +#ifdef HAVE_BZIP2 static int __stdf_open_bzip2(void *data, int flags, uint32_t mode) { stdf_file *stdf = (stdf_file*)data; @@ -280,7 +280,7 @@ /* * LZW SUPPORT */ -#if HAVE_LZW +#ifdef HAVE_LZW static int __stdf_open_lzw(void *data, int flags, uint32_t mode) { stdf_file *stdf = (stdf_file*)data; @@ -368,22 +368,22 @@ } switch (ret->file_format) { -#if HAVE_ZIP +#ifdef HAVE_ZIP case STDF_FORMAT_ZIP: ret->fops = &__stdf_fops_zip; break; #endif -#if HAVE_GZIP +#ifdef HAVE_GZIP case STDF_FORMAT_GZIP: ret->fops = &__stdf_fops_gzip; break; #endif -#if HAVE_BZIP2 +#ifdef HAVE_BZIP2 case STDF_FORMAT_BZIP2: ret->fops = &__stdf_fops_bzip2; break; #endif -#if HAVE_LZW +#ifdef HAVE_LZW case STDF_FORMAT_LZW: ret->fops = &__stdf_fops_lzw; break; Modified: trunk/libstdf/src/rec.c =================================================================== --- trunk/libstdf/src/rec.c 2007-02-19 04:33:15 UTC (rev 285) +++ trunk/libstdf/src/rec.c 2007-02-19 04:35:32 UTC (rev 286) @@ -94,7 +94,7 @@ return stdf_rec_names[_stdf_header_to_idx(type, sub)]; } -#if WARN_UNTESTED +#ifdef WARN_UNTESTED #define warn_untested(type) \ do { \ warnf("*********************************************"); \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-11-26 07:25:39
|
Revision: 296 http://freestdf.svn.sourceforge.net/freestdf/?rev=296&view=rev Author: vapier Date: 2007-11-25 23:25:40 -0800 (Sun, 25 Nov 2007) Log Message: ----------- convert to AC_C_BIGENDIAN which allows independence from ugly system-specific BYTE_ORDER defines and transition to clean stdf defines Modified Paths: -------------- trunk/libstdf/configure.ac trunk/libstdf/examples/dump_records_to_html.c trunk/libstdf/include/libstdf_internal.h trunk/libstdf/include/libstdf_systems.h trunk/libstdf/include/libstdf_win32.h trunk/libstdf/src/dtc.c trunk/libstdf/src/dtc.h trunk/libstdf/src/libstdf.c Modified: trunk/libstdf/configure.ac =================================================================== --- trunk/libstdf/configure.ac 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/configure.ac 2007-11-26 07:25:40 UTC (rev 296) @@ -3,10 +3,11 @@ AC_CONFIG_HEADER(include/libstdf_sys_config.h) AC_PROG_CC +AC_C_CONST + AC_STDF_LIBTOOL AC_HEADER_STDC -AC_C_CONST AC_CHECK_HEADERS([ \ stdint.h inttypes.h sys/types.h sys/stat.h ctype.h \ errno.h unistd.h fcntl.h stdio.h stdlib.h time.h \ @@ -44,19 +45,20 @@ dnl ******************************************************** dnl * Force endian types * dnl ******************************************************** -stdf_force_endian="auto" +stdf_endian_force="auto" AC_MSG_CHECKING(for endian type) AC_ARG_ENABLE(endian, AC_HELP_STRING([--enable-endian],[force endian type @<:@default=detect@:>@]), - [stdf_force_endian=$enableval]) -if test "x$stdf_force_endian" = "xlittle" ; then - AC_DEFINE(STDF_FORCE_ENDIAN, 1234, [Force endian type to little]) -elif test "x$stdf_force_endian" = "xbig" ; then - AC_DEFINE(STDF_FORCE_ENDIAN, 4321, [Force endian type to big]) -elif test "x$stdf_force_endian" != "xauto" ; then + [stdf_endian_force=$enableval]) +if test "x$stdf_endian_force" = "xlittle" ; then + AC_DEFINE(STDF_ENDIAN_FORCE, STDF_ENDIAN_LITTLE, [Force endian type to little]) +elif test "x$stdf_endian_force" = "xbig" ; then + AC_DEFINE(STDF_ENDIAN_FORCE, STDF_ENDIAN_BIG, [Force endian type to big]) +elif test "x$stdf_endian_force" != "xauto" ; then AC_MSG_ERROR(Valid values for endian are "little", "big", or "auto") fi -AC_MSG_RESULT($stdf_force_endian) +AC_MSG_RESULT($stdf_endian_force) +AC_C_BIGENDIAN AM_STDF_ZZIPLIB AM_STDF_LIBLZW @@ -110,7 +112,6 @@ AM_CONDITIONAL(HAVE_ECORE, false) ECORE_CFLAGS="" ECORE_LIBS="" - AC_MSG_RESULT(no) ]) if test "x$HASH_LIBS" != "x" ; then ECORE_CFLAGS="" Modified: trunk/libstdf/examples/dump_records_to_html.c =================================================================== --- trunk/libstdf/examples/dump_records_to_html.c 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/examples/dump_records_to_html.c 2007-11-26 07:25:40 UTC (rev 296) @@ -146,9 +146,9 @@ } stdf_get_setting(f, STDF_SETTING_VERSION, &stdf_ver); stdf_get_setting(f, STDF_SETTING_BYTE_ORDER, &byte_order); - if (byte_order == LITTLE_ENDIAN) + if (byte_order == STDF_ENDIAN_LITTLE) sprintf(cpu_name, "Little Endian [intel/x86]"); - else if (byte_order == BIG_ENDIAN) + else if (byte_order == STDF_ENDIAN_BIG) sprintf(cpu_name, "Big Endian [sun/sparc]"); else sprintf(cpu_name, "Unknown Endian [???]"); Modified: trunk/libstdf/include/libstdf_internal.h =================================================================== --- trunk/libstdf/include/libstdf_internal.h 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/include/libstdf_internal.h 2007-11-26 07:25:40 UTC (rev 296) @@ -34,8 +34,6 @@ #endif /* STDF File structure */ -#define __STDF_HOST_BYTE_ORDER BYTE_ORDER - typedef struct { int (*open)(void*, int, uint32_t); int (*read)(void*, void*, long); Modified: trunk/libstdf/include/libstdf_systems.h =================================================================== --- trunk/libstdf/include/libstdf_systems.h 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/include/libstdf_systems.h 2007-11-26 07:25:40 UTC (rev 296) @@ -115,38 +115,21 @@ typedef int64 int64_t; #endif -#if !defined(STDF_FORCE_ENDIAN) && !defined(BYTE_ORDER) - -/* Workaround for random systems */ -# if defined(WORDS_LITTLENDIAN) -# define STDF_FORCE_ENDIAN 1234 -# elif defined(WORDS_BIGENDIAN) -# define STDF_FORCE_ENDIAN 4321 - -/* Workaround for crappy Solaris */ -# elif defined(_LITTLE_ENDIAN) -# define STDF_FORCE_ENDIAN 1234 -# elif defined(_BIG_ENDIAN) -# define STDF_FORCE_ENDIAN 4321 - -# endif - -#endif - -#if defined(STDF_FORCE_ENDIAN) -# undef LITTLE_ENDIAN -# undef BIG_ENDIAN -# undef BYTE_ORDER -# define LITTLE_ENDIAN 1234 -# define BIG_ENDIAN 4321 -# if STDF_FORCE_ENDIAN == LITTLE_ENDIAN -# define BYTE_ORDER LITTLE_ENDIAN +/* Setup endian type. */ +#define STDF_ENDIAN_BIG 4321 +#define STDF_ENDIAN_LITTLE 1234 +#if !defined(STDF_ENDIAN_FORCE) +# ifdef WORDS_BIGENDIAN +# define STDF_ENDIAN_FORCE STDF_ENDIAN_BIG # else -# define BYTE_ORDER BIG_ENDIAN +# define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE # endif #endif - -#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN) +#if (STDF_ENDIAN_FORCE == STDF_ENDIAN_BIG) +# define STDF_ENDIAN_HOST STDF_ENDIAN_BIG +#elif (STDF_ENDIAN_FORCE == STDF_ENDIAN_LITTLE) +# define STDF_ENDIAN_HOST STDF_ENDIAN_LITTLE +#else # error Unable to detect appropriate endian settings for your system. # error Please send a bug report to the fre...@li... # error mailing list. You can work around the problem by re-running Modified: trunk/libstdf/include/libstdf_win32.h =================================================================== --- trunk/libstdf/include/libstdf_win32.h 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/include/libstdf_win32.h 2007-11-26 07:25:40 UTC (rev 296) @@ -37,10 +37,6 @@ #include <io.h> #define open _open -#if !defined(BYTE_ORDER) -# define LITTLE_ENDIAN 1234 -# define BIG_ENDIAN 4321 -# define BYTE_ORDER LITTLE_ENDIAN -#endif +#define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE #endif /* _LIBSTDF_WIN32_H */ Modified: trunk/libstdf/src/dtc.c =================================================================== --- trunk/libstdf/src/dtc.c 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/src/dtc.c 2007-11-26 07:25:40 UTC (rev 296) @@ -17,7 +17,7 @@ { if (in_byte_order == out_byte_order || len == 1) return; - if (in_byte_order != LITTLE_ENDIAN && in_byte_order != BIG_ENDIAN) { + if (in_byte_order != STDF_ENDIAN_LITTLE && in_byte_order != STDF_ENDIAN_BIG) { warnf("byte order %i is not implemented", in_byte_order); return; } Modified: trunk/libstdf/src/dtc.h =================================================================== --- trunk/libstdf/src/dtc.h 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/src/dtc.h 2007-11-26 07:25:40 UTC (rev 296) @@ -15,8 +15,8 @@ #include <libstdf.h> extern void __byte_order_change(int, int, byte_t*, int) stdf_attribute_hidden; -#define __byte_order_to_host(b,p,l) __byte_order_change(b, __STDF_HOST_BYTE_ORDER, p, l) -#define __byte_order_to_src(b,p,l) __byte_order_change(__STDF_HOST_BYTE_ORDER, b, p, l) +#define __byte_order_to_host(b,p,l) __byte_order_change(b, STDF_ENDIAN_HOST, p, l) +#define __byte_order_to_src(b,p,l) __byte_order_change(STDF_ENDIAN_HOST, b, p, l) #define _stdf_byte_order_to_host(f,v,l) __byte_order_to_host(f->byte_order, (byte_t*)(v), l) #define _stdf_byte_order_to_src(f,v,l) __byte_order_to_src(f->byte_order, (byte_t*)(v), l) Modified: trunk/libstdf/src/libstdf.c =================================================================== --- trunk/libstdf/src/libstdf.c 2007-11-26 06:54:08 UTC (rev 295) +++ trunk/libstdf/src/libstdf.c 2007-11-26 07:25:40 UTC (rev 296) @@ -25,12 +25,12 @@ /*case STDF_CPU_TYPE_SUN_680XX:*/ case STDF_CPU_TYPE_SPARC: - f->byte_order = BIG_ENDIAN; + f->byte_order = STDF_ENDIAN_BIG; break; /*case STDF_CPU_TYPE_SUN_80386:*/ case STDF_CPU_TYPE_X86: - f->byte_order = LITTLE_ENDIAN; + f->byte_order = STDF_ENDIAN_LITTLE; break; #ifdef STDF_VER3 @@ -46,7 +46,7 @@ } #endif default: - f->byte_order = __STDF_HOST_BYTE_ORDER; + f->byte_order = STDF_ENDIAN_HOST; if (!(opts & STDF_OPTS_CREATE)) warnf("Unknown STDF_CPU type 0x%X; you may have incorrect output", cpu_type); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-11-26 16:09:45
|
Revision: 302 http://freestdf.svn.sourceforge.net/freestdf/?rev=302&view=rev Author: vapier Date: 2007-11-26 08:09:39 -0800 (Mon, 26 Nov 2007) Log Message: ----------- remove pointless casts on return value of malloc() Modified Paths: -------------- trunk/libstdf/examples/record_stats.c trunk/libstdf/examples/stdf2img.c trunk/libstdf/src/dtc.c trunk/libstdf/src/libstdf.c trunk/libstdf/src/rec.c Modified: trunk/libstdf/examples/record_stats.c =================================================================== --- trunk/libstdf/examples/record_stats.c 2007-11-26 16:01:46 UTC (rev 301) +++ trunk/libstdf/examples/record_stats.c 2007-11-26 16:09:39 UTC (rev 302) @@ -25,7 +25,7 @@ #define HASH_UPDATE \ key = (void*)recname; \ if (!hash_retrieve(&hash_table, key, (void**)&val)) { \ - val = (void*)malloc(sizeof(long)); \ + val = malloc(sizeof(long)); \ *(long*)val = 0; \ hash_insert(&hash_table, key, val); \ } \ @@ -51,7 +51,7 @@ #define HASH_UPDATE \ stat = ecore_hash_get(hash_table, recname); \ if (!stat) { \ - stat = (long*)malloc(sizeof(long)); \ + stat = malloc(sizeof(long)); \ *stat = 0; \ ecore_hash_set(hash_table, strdup(recname), stat); \ } \ @@ -78,7 +78,7 @@ #define HASH_UPDATE \ stat = g_hash_table_lookup(hash_table, recname); \ if (!stat) { \ - stat = (long*)malloc(sizeof(long)); \ + stat = malloc(sizeof(long)); \ *stat = 0; \ g_hash_table_insert(hash_table, g_strdup(recname), stat); \ } \ Modified: trunk/libstdf/examples/stdf2img.c =================================================================== --- trunk/libstdf/examples/stdf2img.c 2007-11-26 16:01:46 UTC (rev 301) +++ trunk/libstdf/examples/stdf2img.c 2007-11-26 16:09:39 UTC (rev 302) @@ -49,11 +49,11 @@ x_range = x_max - x_min + 1 ; y_range = y_max - y_min + 1; - hard_bins = (stdf_dtc_U2*)malloc(sizeof(stdf_dtc_U2) * x_range * y_range); + hard_bins = malloc(sizeof(stdf_dtc_U2) * x_range * y_range); if (!hard_bins) perror("hard_bins malloc failed"); memset(hard_bins, 0, sizeof(stdf_dtc_U2) * x_range * y_range); - soft_bins = (stdf_dtc_U2*)malloc(sizeof(stdf_dtc_U2) * x_range * y_range); + soft_bins = malloc(sizeof(stdf_dtc_U2) * x_range * y_range); if (!soft_bins) perror("soft_bins malloc failed"); memset(soft_bins, 0, sizeof(stdf_dtc_U2) * x_range * y_range); Modified: trunk/libstdf/src/dtc.c =================================================================== --- trunk/libstdf/src/dtc.c 2007-11-26 16:01:46 UTC (rev 301) +++ trunk/libstdf/src/dtc.c 2007-11-26 16:09:39 UTC (rev 302) @@ -84,7 +84,7 @@ { unsigned char len; if (f->rec_pos == f->rec_end) { - (*Cn) = (stdf_dtc_Cn)malloc(sizeof(stdf_dtc_C1)); + (*Cn) = malloc(sizeof(stdf_dtc_C1)); (*Cn)[0] = 0; return; } @@ -108,7 +108,7 @@ unsigned int len; if (f->rec_pos == f->rec_end) { - (*Dn) = (stdf_dtc_Dn)malloc(2); + (*Dn) = malloc(2); ((stdf_dtc_U2*)(*Dn))[0] = 0; return; } @@ -119,7 +119,7 @@ len = bit_cnt / (sizeof(stdf_dtc_B1) * 8); if (bit_cnt % 8) ++len; - (*Dn) = (stdf_dtc_Dn)malloc(len + 3); + (*Dn) = malloc(len + 3); ((stdf_dtc_U2*)(*Dn))[0] = bit_cnt; memcpy(((byte_t*)(*Dn))+2, f->rec_pos, len); f->rec_pos += len; @@ -129,7 +129,7 @@ void _stdf_read_dtc_xN1(stdf_file *f, stdf_dtc_xN1 *xN1, stdf_dtc_U2 cnt) { stdf_dtc_U2 len = cnt / 2 + cnt % 2; - (*xN1) = (stdf_dtc_xN1)malloc(len); + (*xN1) = malloc(len); memcpy((*xN1), f->rec_pos, len); f->rec_pos += len; } @@ -205,7 +205,7 @@ } #define DO_VN(DTC) \ - Vn->data = (void*)malloc(sizeof(stdf_##DTC)); \ + Vn->data = malloc(sizeof(stdf_##DTC)); \ _stdf_read_ ## DTC(f, ((stdf_##DTC*)Vn->data)); (*pVn) = (stdf_dtc_Vn)calloc(cnt, sizeof(stdf_dtc_Vn_ele)); Modified: trunk/libstdf/src/libstdf.c =================================================================== --- trunk/libstdf/src/libstdf.c 2007-11-26 16:01:46 UTC (rev 301) +++ trunk/libstdf/src/libstdf.c 2007-11-26 16:09:39 UTC (rev 302) @@ -70,7 +70,7 @@ if (f->opts & STDF_OPTS_WRITE) { /* make the buffer big enough to hold the largest record possible */ - f->__output = (byte_t*)malloc(sizeof(byte_t) * (stdf_dtc_U2)-1); + f->__output = malloc(sizeof(byte_t) * (stdf_dtc_U2)-1); if (f->__output == NULL) return 1; } else @@ -319,7 +319,7 @@ stdf_file *ret; _stdf_mtrace(); - ret = (stdf_file*)malloc(sizeof(stdf_file)); + ret = malloc(sizeof(*ret)); if (!pathname || pathname[0] == '\0') { if (fd == -1) { @@ -413,7 +413,7 @@ if (!(opts & STDF_OPTS_WRITE)) { /* try to peek at the FAR record to figure out the CPU type/STDF ver */ - ret->__data = (byte_t*)malloc(6); + ret->__data = malloc(6); if (ret->fops->read(ret, ret->__data, 6) != 6) goto out_err; if ((MAKE_REC(ret->__data[2], ret->__data[3]) != STDF_REC_FAR) @@ -512,7 +512,7 @@ file->__data = NULL; cheated = 1; } - raw_rec = (stdf_rec_unknown*)malloc(sizeof(stdf_rec_unknown)); + raw_rec = malloc(sizeof(*raw_rec)); if (raw_rec == NULL) { warnfp("malloc.1"); goto ret_null; @@ -526,7 +526,7 @@ _stdf_byte_order_to_host(file, &(file->header.REC_LEN), sizeof(stdf_dtc_U2)); /* buffer the whole record in memory */ - raw_rec->data = (void*)malloc(file->header.REC_LEN+4); + raw_rec->data = malloc(file->header.REC_LEN+4); if (raw_rec->data == NULL) { warnfp("malloc.2"); free(raw_rec); @@ -720,7 +720,7 @@ ssize_t ret; stdf_rec_unknown *rec = (stdf_rec_unknown*)stdf_rec_void; unsigned char *reentrant_buffer; - reentrant_buffer = (unsigned char *)malloc(rec->header.STDF_REC_LEN); + reentrant_buffer = malloc(rec->header.STDF_REC_LEN); ret = _stdf_write_record(file, rec, reentrant_buffer); free(reentrant_buffer); return ret; Modified: trunk/libstdf/src/rec.c =================================================================== --- trunk/libstdf/src/rec.c 2007-11-26 16:01:46 UTC (rev 301) +++ trunk/libstdf/src/rec.c 2007-11-26 16:09:39 UTC (rev 302) @@ -100,8 +100,6 @@ */ -#define __malloc_rec(r) ((r*)malloc(sizeof(r))) - void stdf_free_record(stdf_rec_unknown *rec) { stdf_file *file; @@ -472,9 +470,9 @@ stdf_rec_unknown* stdf_read_rec_unknown(stdf_file *file) { - stdf_rec_unknown *rec = __malloc_rec(stdf_rec_unknown); + stdf_rec_unknown *rec = malloc(sizeof(*rec)); #if 0 - rec->data = (void*)malloc(file->header.REC_LEN); + rec->data = malloc(file->header.REC_LEN); memcpy(rec->data, file->stdf_rec_data, file->header.REC_LEN); #else rec->data = NULL; @@ -485,7 +483,8 @@ stdf_rec_far* stdf_read_rec_far(stdf_file *file) { - stdf_rec_far *far = __malloc_rec(stdf_rec_far); + stdf_rec_far *far = malloc(sizeof(*far)); + _stdf_read_dtc_U1(file, &(far->CPU_TYPE)); _stdf_read_dtc_U1(file, &(far->STDF_VER)); return far; @@ -493,7 +492,7 @@ stdf_rec_atr* stdf_read_rec_atr(stdf_file *file) { - stdf_rec_atr *atr = __malloc_rec(stdf_rec_atr); + stdf_rec_atr *atr = malloc(sizeof(*atr)); _stdf_read_dtc_U4(file, &(atr->MOD_TIM)); _stdf_read_dtc_Cn(file, &(atr->CMD_LINE)); return atr; @@ -501,7 +500,7 @@ stdf_rec_mir* stdf_read_rec_mir(stdf_file *file) { - stdf_rec_mir *mir = __malloc_rec(stdf_rec_mir); + stdf_rec_mir *mir = malloc(sizeof(*mir)); #ifdef STDF_VER3 if (file->ver == 4) { #endif @@ -575,7 +574,7 @@ stdf_rec_mrr* stdf_read_rec_mrr(stdf_file *file) { - stdf_rec_mrr *mrr = __malloc_rec(stdf_rec_mrr); + stdf_rec_mrr *mrr = malloc(sizeof(*mrr)); _stdf_read_dtc_U4(file, &(mrr->FINISH_T)); #ifdef STDF_VER3 if (file->ver == 3) { @@ -594,7 +593,7 @@ stdf_rec_pcr* stdf_read_rec_pcr(stdf_file *file) { - stdf_rec_pcr *pcr = __malloc_rec(stdf_rec_pcr); + stdf_rec_pcr *pcr = malloc(sizeof(*pcr)); _stdf_read_dtc_U1(file, &(pcr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(pcr->SITE_NUM)); _stdf_read_dtc_U4(file, &(pcr->PART_CNT)); @@ -607,7 +606,7 @@ stdf_rec_hbr* stdf_read_rec_hbr(stdf_file *file) { - stdf_rec_hbr *hbr = __malloc_rec(stdf_rec_hbr); + stdf_rec_hbr *hbr = malloc(sizeof(*hbr)); _stdf_read_dtc_U1(file, &(hbr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(hbr->SITE_NUM)); _stdf_read_dtc_U2(file, &(hbr->HBIN_NUM)); @@ -619,7 +618,7 @@ stdf_rec_sbr* stdf_read_rec_sbr(stdf_file *file) { - stdf_rec_sbr *sbr = __malloc_rec(stdf_rec_sbr); + stdf_rec_sbr *sbr = malloc(sizeof(*sbr)); _stdf_read_dtc_U1(file, &(sbr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(sbr->SITE_NUM)); _stdf_read_dtc_U2(file, &(sbr->SBIN_NUM)); @@ -631,7 +630,7 @@ stdf_rec_pmr* stdf_read_rec_pmr(stdf_file *file) { - stdf_rec_pmr *pmr = __malloc_rec(stdf_rec_pmr); + stdf_rec_pmr *pmr = malloc(sizeof(*pmr)); _stdf_read_dtc_U2(file, &(pmr->PMR_INDX)); _stdf_read_dtc_U2(file, &(pmr->CHAN_TYP)); _stdf_read_dtc_Cn(file, &(pmr->CHAN_NAM)); @@ -644,7 +643,7 @@ stdf_rec_pgr* stdf_read_rec_pgr(stdf_file *file) { - stdf_rec_pgr *pgr = __malloc_rec(stdf_rec_pgr); + stdf_rec_pgr *pgr = malloc(sizeof(*pgr)); _stdf_read_dtc_U2(file, &(pgr->GRP_INDX)); _stdf_read_dtc_Cn(file, &(pgr->GRP_NAM)); _stdf_read_dtc_U2(file, &(pgr->INDX_CNT)); @@ -654,7 +653,7 @@ stdf_rec_plr* stdf_read_rec_plr(stdf_file *file) { - stdf_rec_plr *plr = __malloc_rec(stdf_rec_plr); + stdf_rec_plr *plr = malloc(sizeof(*plr)); _stdf_read_dtc_U2(file, &(plr->GRP_CNT)); _stdf_read_dtc_xU2(file, &(plr->GRP_INDX), plr->GRP_CNT); _stdf_read_dtc_xU2(file, &(plr->GRP_MODE), plr->GRP_CNT); @@ -668,7 +667,7 @@ stdf_rec_rdr* stdf_read_rec_rdr(stdf_file *file) { - stdf_rec_rdr *rdr = __malloc_rec(stdf_rec_rdr); + stdf_rec_rdr *rdr = malloc(sizeof(*rdr)); _stdf_read_dtc_U2(file, &(rdr->NUM_BINS)); _stdf_read_dtc_xU2(file, &(rdr->RTST_BIN), rdr->NUM_BINS); return rdr; @@ -676,7 +675,7 @@ stdf_rec_sdr* stdf_read_rec_sdr(stdf_file *file) { - stdf_rec_sdr *sdr = __malloc_rec(stdf_rec_sdr); + stdf_rec_sdr *sdr = malloc(sizeof(*sdr)); _stdf_read_dtc_U1(file, &(sdr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(sdr->SITE_GRP)); _stdf_read_dtc_U1(file, &(sdr->SITE_CNT)); @@ -702,7 +701,7 @@ stdf_rec_wir* stdf_read_rec_wir(stdf_file *file) { - stdf_rec_wir *wir = __malloc_rec(stdf_rec_wir); + stdf_rec_wir *wir = malloc(sizeof(*wir)); _stdf_read_dtc_U1(file, &(wir->HEAD_NUM)); #ifdef STDF_VER3 if (file->ver == 3) @@ -717,7 +716,7 @@ stdf_rec_wrr* stdf_read_rec_wrr(stdf_file *file) { - stdf_rec_wrr *wrr = __malloc_rec(stdf_rec_wrr); + stdf_rec_wrr *wrr = malloc(sizeof(*wrr)); #ifdef STDF_VER3 if (file->ver == 4) { #endif @@ -756,7 +755,7 @@ stdf_rec_wcr* stdf_read_rec_wcr(stdf_file *file) { - stdf_rec_wcr *wcr = __malloc_rec(stdf_rec_wcr); + stdf_rec_wcr *wcr = malloc(sizeof(*wcr)); _stdf_read_dtc_R4(file, &(wcr->WAFR_SIZ)); _stdf_read_dtc_R4(file, &(wcr->DIE_HT)); _stdf_read_dtc_R4(file, &(wcr->DIE_WID)); @@ -771,7 +770,7 @@ stdf_rec_pir* stdf_read_rec_pir(stdf_file *file) { - stdf_rec_pir *pir = __malloc_rec(stdf_rec_pir); + stdf_rec_pir *pir = malloc(sizeof(*pir)); _stdf_read_dtc_U1(file, &(pir->HEAD_NUM)); _stdf_read_dtc_U1(file, &(pir->SITE_NUM)); #ifdef STDF_VER3 @@ -786,7 +785,7 @@ stdf_rec_prr* stdf_read_rec_prr(stdf_file *file) { - stdf_rec_prr *prr = __malloc_rec(stdf_rec_prr); + stdf_rec_prr *prr = malloc(sizeof(*prr)); _stdf_read_dtc_U1(file, &(prr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(prr->SITE_NUM)); #ifdef STDF_VER3 @@ -818,7 +817,7 @@ stdf_rec_pdr* stdf_read_rec_pdr(stdf_file *file) { - stdf_rec_pdr *pdr = __malloc_rec(stdf_rec_pdr); + stdf_rec_pdr *pdr = malloc(sizeof(*pdr)); _stdf_read_dtc_U4(file, &(pdr->TEST_NUM)); _stdf_read_dtc_B1(file, &(pdr->DESC_FLG)); _stdf_read_dtc_B1(file, &(pdr->OPT_FLAG)); @@ -841,7 +840,7 @@ stdf_rec_fdr* stdf_read_rec_fdr(stdf_file *file) { - stdf_rec_fdr *fdr = __malloc_rec(stdf_rec_fdr); + stdf_rec_fdr *fdr = malloc(sizeof(*fdr)); _stdf_read_dtc_U4(file, &(fdr->TEST_NUM)); _stdf_read_dtc_B1(file, &(fdr->DESC_FLG)); _stdf_read_dtc_Cn(file, &(fdr->TEST_NAM)); @@ -853,7 +852,7 @@ stdf_rec_tsr* stdf_read_rec_tsr(stdf_file *file) { - stdf_rec_tsr *tsr = __malloc_rec(stdf_rec_tsr); + stdf_rec_tsr *tsr = malloc(sizeof(*tsr)); _stdf_read_dtc_U1(file, &(tsr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(tsr->SITE_NUM)); #ifdef STDF_VER3 @@ -895,7 +894,7 @@ stdf_rec_ptr* stdf_read_rec_ptr(stdf_file *file) { - stdf_rec_ptr *ptr = __malloc_rec(stdf_rec_ptr); + stdf_rec_ptr *ptr = malloc(sizeof(*ptr)); _stdf_read_dtc_U4(file, &(ptr->TEST_NUM)); _stdf_read_dtc_U1(file, &(ptr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(ptr->SITE_NUM)); @@ -921,7 +920,7 @@ stdf_rec_mpr* stdf_read_rec_mpr(stdf_file *file) { - stdf_rec_mpr *mpr = __malloc_rec(stdf_rec_mpr); + stdf_rec_mpr *mpr = malloc(sizeof(*mpr)); _stdf_read_dtc_U4(file, &(mpr->TEST_NUM)); _stdf_read_dtc_U1(file, &(mpr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(mpr->SITE_NUM)); @@ -954,7 +953,7 @@ stdf_rec_ftr* stdf_read_rec_ftr(stdf_file *file) { - stdf_rec_ftr *ftr = __malloc_rec(stdf_rec_ftr); + stdf_rec_ftr *ftr = malloc(sizeof(*ftr)); _stdf_read_dtc_U4(file, &(ftr->TEST_NUM)); _stdf_read_dtc_U1(file, &(ftr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(ftr->SITE_NUM)); @@ -988,14 +987,14 @@ stdf_rec_bps* stdf_read_rec_bps(stdf_file *file) { - stdf_rec_bps *bps = __malloc_rec(stdf_rec_bps); + stdf_rec_bps *bps = malloc(sizeof(*bps)); _stdf_read_dtc_Cn(file, &(bps->SEQ_NAME)); return bps; } stdf_rec_eps* stdf_read_rec_eps(stdf_attribute_unused stdf_file *file) { - stdf_rec_eps *eps = __malloc_rec(stdf_rec_eps); + stdf_rec_eps *eps = malloc(sizeof(*eps)); return eps; } @@ -1003,7 +1002,7 @@ stdf_rec_shb* stdf_read_rec_shb(stdf_file *file) { - stdf_rec_shb *shb = __malloc_rec(stdf_rec_shb); + stdf_rec_shb *shb = malloc(sizeof(*shb)); _stdf_read_dtc_U1(file, &(shb->HEAD_NUM)); _stdf_read_dtc_U1(file, &(shb->SITE_NUM)); _stdf_read_dtc_U2(file, &(shb->HBIN_NUM)); @@ -1014,7 +1013,7 @@ stdf_rec_ssb* stdf_read_rec_ssb(stdf_file *file) { - stdf_rec_ssb *ssb = __malloc_rec(stdf_rec_ssb); + stdf_rec_ssb *ssb = malloc(sizeof(*ssb)); _stdf_read_dtc_U1(file, &(ssb->HEAD_NUM)); _stdf_read_dtc_U1(file, &(ssb->SITE_NUM)); _stdf_read_dtc_U2(file, &(ssb->SBIN_NUM)); @@ -1025,7 +1024,7 @@ stdf_rec_sts* stdf_read_rec_sts(stdf_file *file) { - stdf_rec_sts *sts = __malloc_rec(stdf_rec_sts); + stdf_rec_sts *sts = malloc(sizeof(*sts)); _stdf_read_dtc_U1(file, &(sts->HEAD_NUM)); _stdf_read_dtc_U1(file, &(sts->SITE_NUM)); _stdf_read_dtc_U4(file, &(sts->TEST_NUM)); @@ -1048,7 +1047,7 @@ stdf_rec_scr* stdf_read_rec_scr(stdf_file *file) { - stdf_rec_scr *scr = __malloc_rec(stdf_rec_scr); + stdf_rec_scr *scr = malloc(sizeof(*scr)); _stdf_read_dtc_U1(file, &(scr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(scr->SITE_NUM)); _stdf_read_dtc_U4(file, &(scr->FINISH_T)); @@ -1064,7 +1063,7 @@ stdf_rec_gdr* stdf_read_rec_gdr(stdf_file *file) { - stdf_rec_gdr *gdr = __malloc_rec(stdf_rec_gdr); + stdf_rec_gdr *gdr = malloc(sizeof(*gdr)); _stdf_read_dtc_U2(file, &(gdr->FLD_CNT)); _stdf_read_dtc_Vn(file, &(gdr->GEN_DATA), gdr->FLD_CNT); return gdr; @@ -1072,7 +1071,7 @@ stdf_rec_dtr* stdf_read_rec_dtr(stdf_file *file) { - stdf_rec_dtr *dtr = __malloc_rec(stdf_rec_dtr); + stdf_rec_dtr *dtr = malloc(sizeof(*dtr)); _stdf_read_dtc_Cn(file, &(dtr->TEXT_DAT)); return dtr; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-11-26 16:18:33
|
Revision: 303 http://freestdf.svn.sourceforge.net/freestdf/?rev=303&view=rev Author: vapier Date: 2007-11-26 08:18:24 -0800 (Mon, 26 Nov 2007) Log Message: ----------- use ARRAY_SIZE rather than a trailing NULL in static arrays Modified Paths: -------------- trunk/libstdf/include/libstdf_internal.h trunk/libstdf/src/libstdf.c Modified: trunk/libstdf/include/libstdf_internal.h =================================================================== --- trunk/libstdf/include/libstdf_internal.h 2007-11-26 16:09:39 UTC (rev 302) +++ trunk/libstdf/include/libstdf_internal.h 2007-11-26 16:18:24 UTC (rev 303) @@ -99,7 +99,9 @@ _warn("\n"); \ } while (0) +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + /** * @brief Misc cruft for debugging fun. */ Modified: trunk/libstdf/src/libstdf.c =================================================================== --- trunk/libstdf/src/libstdf.c 2007-11-26 16:09:39 UTC (rev 302) +++ trunk/libstdf/src/libstdf.c 2007-11-26 16:18:24 UTC (rev 303) @@ -355,11 +355,10 @@ { ".Z", STDF_FORMAT_LZW }, { ".bz", STDF_FORMAT_BZIP2 }, { ".bz2", STDF_FORMAT_BZIP2 }, - { NULL, STDF_FORMAT_REG } }; - int i; + size_t i; ret->file_format = STDF_FORMAT_REG; - for (i = 0; guesses[i].filetype; ++i) + for (i = 0; i < ARRAY_SIZE(guesses); ++i) if (strstr(ret->filename, guesses[i].filetype) != NULL) { ret->file_format = guesses[i].fmt; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-11-26 18:10:10
|
Revision: 306 http://freestdf.svn.sourceforge.net/freestdf/?rev=306&view=rev Author: vapier Date: 2007-11-26 10:09:57 -0800 (Mon, 26 Nov 2007) Log Message: ----------- initial handling of STDFv3 versions of PTR/FTR records Modified Paths: -------------- trunk/libstdf/include/libstdf_types.h trunk/libstdf/src/rec.c Modified: trunk/libstdf/include/libstdf_types.h =================================================================== --- trunk/libstdf/include/libstdf_types.h 2007-11-26 17:43:49 UTC (rev 305) +++ trunk/libstdf/include/libstdf_types.h 2007-11-26 18:09:57 UTC (rev 306) @@ -481,8 +481,19 @@ stdf_dtc_Cn ALARM_ID; /* V4 */ stdf_dtc_B1 OPT_FLAG; stdf_dtc_I1 RES_SCAL; +#ifdef STDF_VER3 + stdf_dtc_U1 RES_LDIG; /* V3 */ + stdf_dtc_U1 RES_RDIG; /* V3 */ + stdf_dtc_B1 DESC_FLG; /* V3 */ +#endif stdf_dtc_I1 LLM_SCAL; stdf_dtc_I1 HLM_SCAL; +#ifdef STDF_VER3 + stdf_dtc_U1 HLM_LDIG; /* V3 */ + stdf_dtc_U1 HLM_RDIG; /* V3 */ + stdf_dtc_U1 LLM_LDIG; /* V3 */ + stdf_dtc_U1 LLM_RDIG; /* V3 */ +#endif stdf_dtc_R4 LO_LIMIT; stdf_dtc_R4 HI_LIMIT; stdf_dtc_Cn UNITS; /* V3:C7 V4:Cn */ @@ -491,6 +502,10 @@ stdf_dtc_Cn C_HLMFMT; stdf_dtc_R4 LO_SPEC; /* V4 */ stdf_dtc_R4 HI_SPEC; /* V4 */ +#ifdef STDF_VER3 + stdf_dtc_Cn TEST_NAM; + stdf_dtc_Cn SEQ_NAME; +#endif } stdf_rec_ptr; /* MPR: Multiple-Result Parametric Record [page 53] */ typedef struct { /* V4 */ @@ -530,30 +545,42 @@ stdf_dtc_U1 HEAD_NUM; stdf_dtc_U1 SITE_NUM; stdf_dtc_B1 TEST_FLG; +#ifdef STDF_VER3 + stdf_dtc_B1 DESC_FLG; /* V3 */ +#endif stdf_dtc_B1 OPT_FLAG; stdf_dtc_U4 CYCL_CNT; - stdf_dtc_U4 REL_VADR; - stdf_dtc_U4 REPT_CNT; + stdf_dtc_U4 REL_VADR; /* V4 */ + stdf_dtc_U4 REPT_CNT; /* V3:U2 V4:U4 */ stdf_dtc_U4 NUM_FAIL; - stdf_dtc_I4 XFAIL_AD; - stdf_dtc_I4 YFAIL_AD; - stdf_dtc_I2 VECT_OFF; - stdf_dtc_U2 RTN_ICNT; - stdf_dtc_U2 PGM_ICNT; - stdf_dtc_xU2 RTN_INDX; - stdf_dtc_xN1 RTN_STAT; - stdf_dtc_xU2 PGM_INDX; - stdf_dtc_xN1 PGM_STAT; - stdf_dtc_Dn FAIL_PIN; - stdf_dtc_Cn VECT_NAM; - stdf_dtc_Cn TIME_SET; - stdf_dtc_Cn OP_CODE; + stdf_dtc_I4 XFAIL_AD; /* V4 */ + stdf_dtc_I4 YFAIL_AD; /* V4 */ + stdf_dtc_I2 VECT_OFF; /* V4 */ + stdf_dtc_U2 RTN_ICNT; /* V4 */ + stdf_dtc_U2 PGM_ICNT; /* V4 */ + stdf_dtc_xU2 RTN_INDX; /* V4 */ + stdf_dtc_xN1 RTN_STAT; /* V4 */ + stdf_dtc_xU2 PGM_INDX; /* V4 */ + stdf_dtc_xN1 PGM_STAT; /* V4 */ + stdf_dtc_Dn FAIL_PIN; /* V3:Bn V4:Dn */ + stdf_dtc_Cn VECT_NAM; /* V4 */ + stdf_dtc_Cn TIME_SET; /* V3:U1 V4:Cn */ +#ifdef STDF_VER3 + stdf_dtc_U4 VECT_ADR; /* V3 */ + stdf_dtc_U2 PCP_ADDR; /* V3 */ + stdf_dtc_Bn VECT_DAT; /* V3 */ + stdf_dtc_Bn DEV_DAT; /* V3 */ + stdf_dtc_Bn RPIN_MAP; /* V3 */ + stdf_dtc_Cn TEST_NAM; /* V3 */ + stdf_dtc_Cn SEQ_NAME; /* V3 */ +#endif + stdf_dtc_Cn OP_CODE; /* V4 */ stdf_dtc_Cn TEST_TXT; - stdf_dtc_Cn ALARM_ID; - stdf_dtc_Cn PROG_TXT; - stdf_dtc_Cn RSLT_TXT; - stdf_dtc_U1 PATG_NUM; - stdf_dtc_Dn SPIN_MAP; + stdf_dtc_Cn ALARM_ID; /* V4 */ + stdf_dtc_Cn PROG_TXT; /* V4 */ + stdf_dtc_Cn RSLT_TXT; /* V4 */ + stdf_dtc_U1 PATG_NUM; /* V4 */ + stdf_dtc_Dn SPIN_MAP; /* V4 */ } stdf_rec_ftr; /* BPS: Begin Program Section [page 62] */ typedef struct { Modified: trunk/libstdf/src/rec.c =================================================================== --- trunk/libstdf/src/rec.c 2007-11-26 17:43:49 UTC (rev 305) +++ trunk/libstdf/src/rec.c 2007-11-26 18:09:57 UTC (rev 306) @@ -911,10 +911,19 @@ _stdf_read_dtc_B1(file, &(ptr->TEST_FLG)); _stdf_read_dtc_B1(file, &(ptr->PARM_FLG)); _stdf_read_dtc_R4(file, &(ptr->RESULT)); +#ifdef STDF_VER3 + if (file->ver == 4) { +#endif _stdf_read_dtc_Cn(file, &(ptr->TEST_TXT)); _stdf_read_dtc_Cn(file, &(ptr->ALARM_ID)); +#ifdef STDF_VER3 + } +#endif _stdf_read_dtc_B1(file, &(ptr->OPT_FLAG)); _stdf_read_dtc_I1(file, &(ptr->RES_SCAL)); +#ifdef STDF_VER3 + if (file->ver == 4) { +#endif _stdf_read_dtc_I1(file, &(ptr->LLM_SCAL)); _stdf_read_dtc_I1(file, &(ptr->HLM_SCAL)); _stdf_read_dtc_R4(file, &(ptr->LO_LIMIT)); @@ -925,6 +934,25 @@ _stdf_read_dtc_Cn(file, &(ptr->C_HLMFMT)); _stdf_read_dtc_R4(file, &(ptr->LO_SPEC)); _stdf_read_dtc_R4(file, &(ptr->HI_SPEC)); +#ifdef STDF_VER3 + } else { + _stdf_read_dtc_U1(file, &(ptr->RES_LDIG)); + _stdf_read_dtc_U1(file, &(ptr->RES_RDIG)); + _stdf_read_dtc_B1(file, &(ptr->DESC_FLG)); + _stdf_read_dtc_Cx(file, &(ptr->UNITS), 7); + _stdf_read_dtc_I1(file, &(ptr->LLM_SCAL)); + _stdf_read_dtc_I1(file, &(ptr->HLM_SCAL)); + _stdf_read_dtc_U1(file, &(ptr->LLM_LDIG)); + _stdf_read_dtc_U1(file, &(ptr->LLM_RDIG)); + _stdf_read_dtc_U1(file, &(ptr->HLM_LDIG)); + _stdf_read_dtc_U1(file, &(ptr->HLM_RDIG)); + _stdf_read_dtc_R4(file, &(ptr->LO_LIMIT)); + _stdf_read_dtc_R4(file, &(ptr->HI_LIMIT)); + _stdf_read_dtc_Cn(file, &(ptr->TEST_NAM)); + _stdf_read_dtc_Cn(file, &(ptr->SEQ_NAME)); + _stdf_read_dtc_Cn(file, &(ptr->TEST_TXT)); + } +#endif return ptr; } @@ -968,6 +996,9 @@ _stdf_read_dtc_U1(file, &(ftr->HEAD_NUM)); _stdf_read_dtc_U1(file, &(ftr->SITE_NUM)); _stdf_read_dtc_B1(file, &(ftr->TEST_FLG)); +#ifdef STDF_VER3 + if (file->ver == 4) { +#endif _stdf_read_dtc_B1(file, &(ftr->OPT_FLAG)); _stdf_read_dtc_U4(file, &(ftr->CYCL_CNT)); _stdf_read_dtc_U4(file, &(ftr->REL_VADR)); @@ -992,6 +1023,25 @@ _stdf_read_dtc_Cn(file, &(ftr->RSLT_TXT)); _stdf_read_dtc_U1(file, &(ftr->PATG_NUM)); _stdf_read_dtc_Dn(file, &(ftr->SPIN_MAP)); +#ifdef STDF_VER3 + } else { + _stdf_read_dtc_B1(file, &(ftr->DESC_FLG)); + _stdf_read_dtc_B1(file, &(ftr->OPT_FLAG)); + _stdf_read_dtc_U1(file, &(ftr->TIME_SET)); + _stdf_read_dtc_U4(file, &(ftr->VECT_ADR)); + _stdf_read_dtc_U4(file, &(ftr->CYCL_CNT)); + _stdf_read_dtc_U2(file, &(ftr->REPT_CNT)); + _stdf_read_dtc_U2(file, &(ftr->PCP_ADDR)); + _stdf_read_dtc_U4(file, &(ftr->NUM_FAIL)); + _stdf_read_dtc_Bn(file, &(ftr->FAIL_PIN)); + _stdf_read_dtc_Bn(file, &(ftr->VECT_DAT)); + _stdf_read_dtc_Bn(file, &(ftr->DEV_DAT)); + _stdf_read_dtc_Bn(file, &(ftr->RPIN_MAP)); + _stdf_read_dtc_Cn(file, &(ftr->TEST_NAM)); + _stdf_read_dtc_Cn(file, &(ftr->SEQ_NAME)); + _stdf_read_dtc_Cn(file, &(ftr->TEST_TXT)); + } +#endif return ftr; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <va...@us...> - 2007-12-15 19:35:52
|
Revision: 314 http://freestdf.svn.sourceforge.net/freestdf/?rev=314&view=rev Author: vapier Date: 2007-12-15 11:33:58 -0800 (Sat, 15 Dec 2007) Log Message: ----------- cleanup internal/external header stuff (mainly from autoheader) so that we dont install any unsanitized headers Modified Paths: -------------- trunk/libstdf/ChangeLog trunk/libstdf/configure.ac trunk/libstdf/examples/dump_records_to_ascii.c trunk/libstdf/examples/dump_records_to_html.c trunk/libstdf/examples/example.c trunk/libstdf/examples/extract_records.c trunk/libstdf/examples/is_valid_stdf.c trunk/libstdf/examples/makestdf.c trunk/libstdf/examples/record_stats.c trunk/libstdf/examples/stdf2img.c trunk/libstdf/examples/stdf2xtdf.c trunk/libstdf/include/Makefile.am trunk/libstdf/include/libstdf.h trunk/libstdf/include/libstdf_win32.h Added Paths: ----------- trunk/libstdf/include/internal/ trunk/libstdf/include/internal/Makefile.am trunk/libstdf/include/internal/headers.h trunk/libstdf/include/internal/libstdf.h trunk/libstdf/include/internal/win32.h trunk/libstdf/include/internal/win32_options.h trunk/libstdf/include/libstdf_systems.h.in Removed Paths: ------------- trunk/libstdf/include/libstdf_internal.h trunk/libstdf/include/libstdf_systems.h trunk/libstdf/include/libstdf_win32_options.h Property Changed: ---------------- trunk/libstdf/ Property changes on: trunk/libstdf ___________________________________________________________________ Name: svn:ignore - aclocal.m4 autom4te.cache build compile config.guess config.log config.status config.sub configure depcomp install-sh libstdf-config libstdf-doc.c libstdf.pc libtool ltmain.sh m4 Makefile Makefile.in missing + aclocal.m4 autom4te.cache build compile config.cache config.guess config.h config.h.in config.log config.status config.sub configure depcomp install-sh libstdf-config libstdf-doc.c libstdf.pc libtool ltmain.sh m4 Makefile Makefile.in missing stamp-h1 Modified: trunk/libstdf/ChangeLog =================================================================== --- trunk/libstdf/ChangeLog 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/ChangeLog 2007-12-15 19:33:58 UTC (rev 314) @@ -2,8 +2,10 @@ * Cleanup build system all over the place * Use explicit casts for enum conversions * Add an "stdf" prefix to all exported API pieces to play nice with other libraries + * Remove all header pollution from autotools by internalizing them * Set initial state of records to parsed so people can do more direct manipulation * Initial support for PTR/FTR in STDFv3 + * STDF writing functions should be (in theory) complete 0.4 * Initial partial support for writing STDF files Modified: trunk/libstdf/configure.ac =================================================================== --- trunk/libstdf/configure.ac 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/configure.ac 2007-12-15 19:33:58 UTC (rev 314) @@ -1,6 +1,6 @@ AC_INIT(libstdf, 0.5, [va...@gm...]) AM_INIT_AUTOMAKE -AC_CONFIG_HEADER(include/libstdf_sys_config.h) +AC_CONFIG_HEADER([config.h]) AC_PROG_CC AC_C_CONST @@ -16,6 +16,17 @@ features.h stdarg.h sys/cdefs.h assert.h \ ]) +dnl a few vars for exported libstdf headers +dnl xxx: should make this into a macro with as_tr_sh/as_tr_cpp ... +test "x$ac_cv_header_stdint_h" = "xyes" && HAVE_STDINT_H=1 || HAVE_STDINT_H=0 +AC_SUBST(HAVE_STDINT_H) +test "x$ac_cv_header_inttypes_h" = "xyes" && HAVE_INTTYPES_H=1 || HAVE_INTTYPES_H=0 +AC_SUBST(HAVE_INTTYPES_H) +test "x$ac_cv_header_sys_types_h" = "xyes" && HAVE_SYS_TYPES_H=1 || HAVE_SYS_TYPES_H=0 +AC_SUBST(HAVE_SYS_TYPES_H) +test "x$ac_cv_header_cmplrs_host_h" = "xyes" && HAVE_CMPLRS_HOST_H=1 || HAVE_CMPLRS_HOST_H=0 +AC_SUBST(HAVE_CMPLRS_HOST_H) + AC_STDF_TYPE_CHECKS AC_STDF_GCC_ATTRIBUTES @@ -192,10 +203,11 @@ - -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile +include/libstdf_systems.h include/Makefile +include/internal/Makefile src/Makefile tests/Makefile doc/Makefile @@ -205,6 +217,6 @@ libstdf-config libstdf.pc libstdf-doc.c -],[ -chmod +x libstdf-config ]) +AC_CONFIG_COMMANDS([config-perms], [chmod +x libstdf-config]) +AC_OUTPUT Modified: trunk/libstdf/examples/dump_records_to_ascii.c =================================================================== --- trunk/libstdf/examples/dump_records_to_ascii.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/dump_records_to_ascii.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + #define print_fmt(n,f,v) printf("\t" n ": " f, v) #define print_int(n,i) print_fmt(n, "%i\n", i) #define print_str(n,s) print_fmt(n, "%s\n", (*(s) ? (s)+1 : "(null)")) Modified: trunk/libstdf/examples/dump_records_to_html.c =================================================================== --- trunk/libstdf/examples/dump_records_to_html.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/dump_records_to_html.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + #if defined(HAVE_GETOPT_H) # include <getopt.h> #endif Modified: trunk/libstdf/examples/example.c =================================================================== --- trunk/libstdf/examples/example.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/example.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + int main(int argc, char *argv[]) { stdf_file *f; Modified: trunk/libstdf/examples/extract_records.c =================================================================== --- trunk/libstdf/examples/extract_records.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/extract_records.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + void usage(char *prog) { printf("Usage: %s <stdf input file> <stdf output file>\n", prog); Modified: trunk/libstdf/examples/is_valid_stdf.c =================================================================== --- trunk/libstdf/examples/is_valid_stdf.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/is_valid_stdf.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + #define print_msg(m) printf("\t" m "\n"); #define print_err(m) printf("\tERROR: " m "\n"); Modified: trunk/libstdf/examples/makestdf.c =================================================================== --- trunk/libstdf/examples/makestdf.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/makestdf.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + int main(int argc, char *argv[]) { stdf_file *f; Modified: trunk/libstdf/examples/record_stats.c =================================================================== --- trunk/libstdf/examples/record_stats.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/record_stats.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + /* * libhash */ Modified: trunk/libstdf/examples/stdf2img.c =================================================================== --- trunk/libstdf/examples/stdf2img.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/stdf2img.c 2007-12-15 19:33:58 UTC (rev 314) @@ -10,6 +10,9 @@ #include <libstdf.h> #include <gd.h> +#include <config.h> +#include <internal/headers.h> + int main(int argc, char *argv[]) { stdf_file *f; Modified: trunk/libstdf/examples/stdf2xtdf.c =================================================================== --- trunk/libstdf/examples/stdf2xtdf.c 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/examples/stdf2xtdf.c 2007-12-15 19:33:58 UTC (rev 314) @@ -9,6 +9,9 @@ #include <libstdf.h> +#include <config.h> +#include <internal/headers.h> + #define print_fmt(n,f,v) printf("\t<" n " value=" f "/>\n", v) #define print_int(n,i) print_fmt(n, "%i", i) #define print_str(n,s) \ Modified: trunk/libstdf/include/Makefile.am =================================================================== --- trunk/libstdf/include/Makefile.am 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/Makefile.am 2007-12-15 19:33:58 UTC (rev 314) @@ -1,11 +1,12 @@ +SUBDIRS = internal + include_HEADERS = \ libstdf.h \ - libstdf_types.h \ + libstdf_bswap.h \ libstdf_const.h \ libstdf_funcs.h \ libstdf_systems.h \ - libstdf_sys_config.h \ - libstdf_bswap.h + libstdf_types.h + noinst_HEADERS = \ - libstdf_internal.h \ lzw.h Property changes on: trunk/libstdf/include/internal ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in Added: trunk/libstdf/include/internal/Makefile.am =================================================================== --- trunk/libstdf/include/internal/Makefile.am (rev 0) +++ trunk/libstdf/include/internal/Makefile.am 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,5 @@ +noinst_HEADERS = \ + headers.h \ + libstdf.h \ + win32.h \ + win32_options.h Copied: trunk/libstdf/include/internal/headers.h (from rev 312, trunk/libstdf/include/libstdf_systems.h) =================================================================== --- trunk/libstdf/include/internal/headers.h (rev 0) +++ trunk/libstdf/include/internal/headers.h 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,155 @@ +/** + * @file libstdf_systems.h + * @brief System specific include files / features. + */ +/* + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> + * Released under the BSD license. For more information, + * please see: http://opensource.org/licenses/bsd-license.php + */ + +#ifndef _LIBSTDF_INTERNAL_HEADERS_H +#define _LIBSTDF_INTERNAL_HEADERS_H + +#if defined(HAVE_STDINT_H) +# include <stdint.h> +#endif +#if defined(HAVE_INTTYPES_H) +# include <inttypes.h> +#endif +#if defined(HAVE_SYS_TYPES_H) +# include <sys/types.h> +#endif +#if defined(HAVE_SYS_STAT_H) +# include <sys/stat.h> +#endif +#if defined(HAVE_CTYPE_H) +# include <ctype.h> +#endif +#if defined(HAVE_ERRNO_H) +# include <errno.h> +#else +extern int errno; +#endif +#if defined(HAVE_UNISTD_H) +# include <unistd.h> +#endif +#if defined(HAVE_FCNTL_H) +# include <fcntl.h> +#endif +#if defined(HAVE_STDIO_H) +# include <stdio.h> +#endif +#if defined(HAVE_STDLIB_H) +# include <stdlib.h> +#endif +#if defined(HAVE_TIME_H) +# include <time.h> +#endif +#if defined(HAVE_STRING_H) +# include <string.h> +#endif +#if defined(HAVE_FEATURES_H) +# include <features.h> +#endif +#if defined(HAVE_STDARG_H) +# include <stdarg.h> +#endif +#if defined(HAVE_SYS_CDEFS_H) +# include <sys/cdefs.h> +#endif +#if defined(HAVE_ASSERT_H) +# include <assert.h> +#endif + +#if defined(HAVE_ENDIAN_H) +# include <endian.h> +#endif +#if defined(HAVE_SYS_ENDIAN_H) +# include <sys/endian.h> +#endif +#if defined(HAVE_MACHINE_ENDIAN_H) +# include <machine/endian.h> +#endif +#if defined(HAVE_SYS_ISA_DEFS_H) +# include <sys/isa_defs.h> +#endif +#if defined(HAVE_SYS_PARAM_H) +# include <sys/param.h> +#endif + +#if defined(HAVE_BYTESWAP_H) +# include <byteswap.h> +#endif + +#if defined(HAVE_ZIP) +# include <zzip/zzip.h> +#endif +#if defined(HAVE_GZIP) +# include <zlib.h> +#endif +#if defined(HAVE_BZIP2) +# include <bzlib.h> +#endif +#if defined(HAVE_LZW) +# define __IN_LIBLZW +# include <lzw.h> +#endif + +#if defined(HAVE_CMPLRS_HOST_H) +# include <cmplrs/host.h> +#endif + +/* Setup endian type. */ +#define STDF_ENDIAN_BIG 4321 +#define STDF_ENDIAN_LITTLE 1234 +#if !defined(STDF_ENDIAN_FORCE) +# ifdef WORDS_BIGENDIAN +# define STDF_ENDIAN_FORCE STDF_ENDIAN_BIG +# else +# define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE +# endif +#endif +#if (STDF_ENDIAN_FORCE == STDF_ENDIAN_BIG) +# define STDF_ENDIAN_HOST STDF_ENDIAN_BIG +#elif (STDF_ENDIAN_FORCE == STDF_ENDIAN_LITTLE) +# define STDF_ENDIAN_HOST STDF_ENDIAN_LITTLE +#else +# error Unable to detect appropriate endian settings for your system. +# error Please send a bug report to the fre...@li... +# error mailing list. You can work around the problem by re-running +# error the configure script with the --enable-endian option. +#endif + +/* i'll see you in hell windows */ +#if !defined(O_BINARY) +# define O_BINARY 0x00 +#endif + +/** + * @brief Internal macros for fun ELF tricks. + */ +#ifdef STDF_HAVE_GCC_ATTRIBUTE_UNUSED +# define stdf_attribute_unused __attribute__ ((__unused__)) +#else +# define stdf_attribute_unused +#endif +#ifdef STDF_HAVE_GCC_ATTRIBUTE_VISIBILITY +# define stdf_attribute_hidden __attribute__ ((__visibility__("hidden"))) +#else +# define stdf_attribute_hidden +#endif +#ifdef STDF_HAVE_GCC_ATTRIBUTE_STRONG_ALIAS +# define stdf_attribute_strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((__alias__ (#name))) +#else +# define stdf_attribute_strong_alias(name, aliasname) +#endif +#ifdef STDF_HAVE_GCC_ATTRIBUTE_WEAK_ALIAS +# define stdf_attribute_weak_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((__weak__, __alias__ (#name))) +#else +# define stdf_attribute_weak_alias(name, aliasname) +#endif + +#endif /* _LIBSTDF_INTERNAL_HEADERS_H */ Copied: trunk/libstdf/include/internal/libstdf.h (from rev 312, trunk/libstdf/include/libstdf_internal.h) =================================================================== --- trunk/libstdf/include/internal/libstdf.h (rev 0) +++ trunk/libstdf/include/internal/libstdf.h 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,125 @@ +/** + * @file libstdf_internal.h + * @brief All the fun internal details no one needs to know about + * @internal + */ +/* + * Copyright (C) 2005-2007 Mike Frysinger <va...@gm...> + * Released under the BSD license. For more information, + * please see: http://opensource.org/licenses/bsd-license.php + */ + +#ifndef _LIBSTDF_INTERNAL_H +#define _LIBSTDF_INTERNAL_H + +#ifdef HAVE_ZIP +# define USE_ZIP(x) x +#else +# define USE_ZIP(x) +#endif +#ifdef HAVE_GZIP +# define USE_GZIP(x) x +#else +# define USE_GZIP(x) +#endif +#ifdef HAVE_BZIP2 +# define USE_BZIP2(x) x +#else +# define USE_BZIP2(x) +#endif +#ifdef HAVE_LZW +# define USE_LZW(x) x +#else +# define USE_LZW(x) +#endif + +/* STDF File structure */ +typedef struct { + int (*open)(void*, int, uint32_t); + int (*read)(void*, void*, long); + int (*close)(void*); +} __stdf_fops; + +typedef uint8_t byte_t; + +/** + * @brief The main STDF file structure. + */ +typedef struct { + stdf_rec_header header; /**< A processed version of the last record read */ + + int fd; /**< Actual file descriptor for the backing file */ + union { + USE_ZIP (ZZIP_FILE *zip;) + USE_GZIP (gzFile gzip;) + USE_BZIP2 (BZFILE *bzip2;) + USE_LZW (lzwFile *lzw;) + /* leave space for 8 compression type ... */ + uintptr_t padding[8]; + } __fd; +#define fd_zip __fd.zip +#define fd_gzip __fd.gzip +#define fd_bzip2 __fd.bzip2 +#define fd_lzw __fd.lzw + + stdf_format file_format; /**< Compressed file format */ + char *filename; /**< Filename that was given to stdf_open() */ + __stdf_fops *fops; /**< Virtual file i/o functions to hide compression details */ + + int byte_order; /**< Byte order of the file */ + uint32_t opts; /**< Misc options to control libstdf behavior */ + stdf_dtc_U1 ver; /**< Spec version of the file */ + + byte_t *__data; + byte_t *rec_pos; + byte_t *rec_end; + + byte_t *__output; + byte_t *_write_pos; + stdf_dtc_U2 _write_chunk_size; +} stdf_file; + + + +/** + * @brief Helpful debug macros. + */ +#define _warn(fmt, args...) fprintf(stderr, fmt , ## args) +#define warn(fmt, args...) _warn(PACKAGE_STRING ": " fmt "\n" , ## args) +#define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__ , ## args) +#define warnp(fmt, args...) warn(fmt ": %s" , ## args , strerror(errno)) +#define warnfp(fmt, args...) warnp("%s(): " fmt, __FUNCTION__ , ## args) + +#define dumphex(buf, cnt) \ + do { \ + size_t i = 0; \ + _warn("dumphex: "); \ + while (i < cnt) \ + _warn("%2.2X ", buf[i++]); \ + _warn("\n"); \ + } while (0) + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + +/** + * @brief Misc cruft for debugging fun. + */ +#ifdef HAVE_MCHECK_H +# include <mcheck.h> +# define _stdf_mtrace() mtrace() +# define _stdf_muntrace() muntrace() +#else +# define _stdf_mtrace() +# define _stdf_muntrace() +#endif + +#ifdef HAVE_DMALLOC_H +# include <dmalloc.h> +#endif + +#ifdef HAVE_EFENCE_H +# include <efence.h> +#endif + +#endif /* _LIBSTDF_INTERNAL_H */ Copied: trunk/libstdf/include/internal/win32.h (from rev 312, trunk/libstdf/include/libstdf_win32.h) =================================================================== --- trunk/libstdf/include/internal/win32.h (rev 0) +++ trunk/libstdf/include/internal/win32.h 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,29 @@ +/** + * @file win32.h + * @brief Win32 specific internal definitions. + * @internal + */ +/* + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> + * Released under the BSD license. For more information, + * please see: http://opensource.org/licenses/bsd-license.php + */ + +#ifndef _LIBSTDF_INTERNAL_WIN32_H +#define _LIBSTDF_INTERNAL_WIN32_H + +#include <win32_options.h> + +#ifndef PACKAGE_STRING +# ifndef __DATE__ +# define __DATE__ +# endif +# define PACKAGE_STRING "libstdf win32 " __DATE__ +#endif + +#include <io.h> +#define open _open + +#define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE + +#endif /* _LIBSTDF_INTERNAL_WIN32_H */ Copied: trunk/libstdf/include/internal/win32_options.h (from rev 312, trunk/libstdf/include/libstdf_win32_options.h) =================================================================== --- trunk/libstdf/include/internal/win32_options.h (rev 0) +++ trunk/libstdf/include/internal/win32_options.h 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,32 @@ +/** + * @file win32_options.h + * @brief Enable/Disable libstdf features. + * @internal + */ +/* + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> + * Released under the BSD license. For more information, + * please see: http://opensource.org/licenses/bsd-license.php + */ + +#ifndef _LIBSTDF_INTERNAL_WIN32_OPTIONS_H +#define _LIBSTDF_INTERNAL_WIN32_OPTIONS_H + +#define HAVE_ZIP 0 +#define HAVE_GZIP 0 +#define HAVE_BZIP2 0 +#define HAVE_LZW 0 + +/* you shouldn't have to touch anything below here */ +#define HAVE_CTYPE_H 1 +#define HAVE_ERRNO_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_TIME_H 1 + +#endif /* _LIBSTDF_INTERNAL_WIN32_OPTIONS_H */ Modified: trunk/libstdf/include/libstdf.h =================================================================== --- trunk/libstdf/include/libstdf.h 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/libstdf.h 2007-12-15 19:33:58 UTC (rev 314) @@ -57,7 +57,7 @@ #ifdef __IN_LIBSTDF -# include <libstdf_internal.h> +# include <internal/libstdf.h> #else typedef void stdf_file; #endif Deleted: trunk/libstdf/include/libstdf_internal.h =================================================================== --- trunk/libstdf/include/libstdf_internal.h 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/libstdf_internal.h 2007-12-15 19:33:58 UTC (rev 314) @@ -1,125 +0,0 @@ -/** - * @file libstdf_internal.h - * @brief All the fun internal details no one needs to know about - * @internal - */ -/* - * Copyright (C) 2005-2007 Mike Frysinger <va...@gm...> - * Released under the BSD license. For more information, - * please see: http://opensource.org/licenses/bsd-license.php - */ - -#ifndef _LIBSTDF_INTERNAL_H -#define _LIBSTDF_INTERNAL_H - -#ifdef HAVE_ZIP -# define USE_ZIP(x) x -#else -# define USE_ZIP(x) -#endif -#ifdef HAVE_GZIP -# define USE_GZIP(x) x -#else -# define USE_GZIP(x) -#endif -#ifdef HAVE_BZIP2 -# define USE_BZIP2(x) x -#else -# define USE_BZIP2(x) -#endif -#ifdef HAVE_LZW -# define USE_LZW(x) x -#else -# define USE_LZW(x) -#endif - -/* STDF File structure */ -typedef struct { - int (*open)(void*, int, uint32_t); - int (*read)(void*, void*, long); - int (*close)(void*); -} __stdf_fops; - -typedef uint8_t byte_t; - -/** - * @brief The main STDF file structure. - */ -typedef struct { - stdf_rec_header header; /**< A processed version of the last record read */ - - int fd; /**< Actual file descriptor for the backing file */ - union { - USE_ZIP (ZZIP_FILE *zip;) - USE_GZIP (gzFile gzip;) - USE_BZIP2 (BZFILE *bzip2;) - USE_LZW (lzwFile *lzw;) - /* leave space for 8 compression type ... */ - uintptr_t padding[8]; - } __fd; -#define fd_zip __fd.zip -#define fd_gzip __fd.gzip -#define fd_bzip2 __fd.bzip2 -#define fd_lzw __fd.lzw - - stdf_format file_format; /**< Compressed file format */ - char *filename; /**< Filename that was given to stdf_open() */ - __stdf_fops *fops; /**< Virtual file i/o functions to hide compression details */ - - int byte_order; /**< Byte order of the file */ - uint32_t opts; /**< Misc options to control libstdf behavior */ - stdf_dtc_U1 ver; /**< Spec version of the file */ - - byte_t *__data; - byte_t *rec_pos; - byte_t *rec_end; - - byte_t *__output; - byte_t *_write_pos; - stdf_dtc_U2 _write_chunk_size; -} stdf_file; - - - -/** - * @brief Helpful debug macros. - */ -#define _warn(fmt, args...) fprintf(stderr, fmt , ## args) -#define warn(fmt, args...) _warn(PACKAGE_STRING ": " fmt "\n" , ## args) -#define warnf(fmt, args...) warn("%s(): " fmt, __FUNCTION__ , ## args) -#define warnp(fmt, args...) warn(fmt ": %s" , ## args , strerror(errno)) -#define warnfp(fmt, args...) warnp("%s(): " fmt, __FUNCTION__ , ## args) - -#define dumphex(buf, cnt) \ - do { \ - size_t i = 0; \ - _warn("dumphex: "); \ - while (i < cnt) \ - _warn("%2.2X ", buf[i++]); \ - _warn("\n"); \ - } while (0) - -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - - -/** - * @brief Misc cruft for debugging fun. - */ -#ifdef HAVE_MCHECK_H -# include <mcheck.h> -# define _stdf_mtrace() mtrace() -# define _stdf_muntrace() muntrace() -#else -# define _stdf_mtrace() -# define _stdf_muntrace() -#endif - -#ifdef HAVE_DMALLOC_H -# include <dmalloc.h> -#endif - -#ifdef HAVE_EFENCE_H -# include <efence.h> -#endif - -#endif /* _LIBSTDF_INTERNAL_H */ Deleted: trunk/libstdf/include/libstdf_systems.h =================================================================== --- trunk/libstdf/include/libstdf_systems.h 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/libstdf_systems.h 2007-12-15 19:33:58 UTC (rev 314) @@ -1,175 +0,0 @@ -/** - * @file libstdf_systems.h - * @brief System specific include files / features. - */ -/* - * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> - * Released under the BSD license. For more information, - * please see: http://opensource.org/licenses/bsd-license.php - */ - -#ifndef _LIBSTDF_SYSTEMS_H -#define _LIBSTDF_SYSTEMS_H - -#if defined(WIN32) && !defined(__MINGW32__) -# include <libstdf_win32.h> -#else -# include <libstdf_sys_config.h> -#endif - -#if defined(HAVE_STDINT_H) -# include <stdint.h> -#endif -#if defined(HAVE_INTTYPES_H) -# include <inttypes.h> -#endif -#if defined(HAVE_SYS_TYPES_H) -# include <sys/types.h> -#endif -#if defined(HAVE_SYS_STAT_H) -# include <sys/stat.h> -#endif -#if defined(HAVE_CTYPE_H) -# include <ctype.h> -#endif -#if defined(HAVE_ERRNO_H) -# include <errno.h> -#else -extern int errno; -#endif -#if defined(HAVE_UNISTD_H) -# include <unistd.h> -#endif -#if defined(HAVE_FCNTL_H) -# include <fcntl.h> -#endif -#if defined(HAVE_STDIO_H) -# include <stdio.h> -#endif -#if defined(HAVE_STDLIB_H) -# include <stdlib.h> -#endif -#if defined(HAVE_TIME_H) -# include <time.h> -#endif -#if defined(HAVE_STRING_H) -# include <string.h> -#endif -#if defined(HAVE_FEATURES_H) -# include <features.h> -#endif -#if defined(HAVE_STDARG_H) -# include <stdarg.h> -#endif -#if defined(HAVE_SYS_CDEFS_H) -# include <sys/cdefs.h> -#endif -#if defined(HAVE_ASSERT_H) -# include <assert.h> -#endif - -#if defined(HAVE_ENDIAN_H) -# include <endian.h> -#endif -#if defined(HAVE_SYS_ENDIAN_H) -# include <sys/endian.h> -#endif -#if defined(HAVE_MACHINE_ENDIAN_H) -# include <machine/endian.h> -#endif -#if defined(HAVE_SYS_ISA_DEFS_H) -# include <sys/isa_defs.h> -#endif -#if defined(HAVE_SYS_PARAM_H) -# include <sys/param.h> -#endif - -#if defined(HAVE_BYTESWAP_H) -# include <byteswap.h> -#endif - -#if defined(HAVE_ZIP) -# include <zzip/zzip.h> -#endif -#if defined(HAVE_GZIP) -# include <zlib.h> -#endif -#if defined(HAVE_BZIP2) -# include <bzlib.h> -#endif -#if defined(HAVE_LZW) -# define __IN_LIBLZW -# include <lzw.h> -#endif - -/* Support for Tru64 */ -#if defined(HAVE_CMPLRS_HOST_H) -# include <cmplrs/host.h> -typedef uint8 uint8_t; -typedef uint16 uint16_t; -typedef uint32 uint32_t; -typedef uint64 uint64_t; -typedef int8 int8_t; -typedef int16 int16_t; -typedef int32 int32_t; -typedef int64 int64_t; -#endif - -/* Setup endian type. */ -#define STDF_ENDIAN_BIG 4321 -#define STDF_ENDIAN_LITTLE 1234 -#if !defined(STDF_ENDIAN_FORCE) -# ifdef WORDS_BIGENDIAN -# define STDF_ENDIAN_FORCE STDF_ENDIAN_BIG -# else -# define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE -# endif -#endif -#if (STDF_ENDIAN_FORCE == STDF_ENDIAN_BIG) -# define STDF_ENDIAN_HOST STDF_ENDIAN_BIG -#elif (STDF_ENDIAN_FORCE == STDF_ENDIAN_LITTLE) -# define STDF_ENDIAN_HOST STDF_ENDIAN_LITTLE -#else -# error Unable to detect appropriate endian settings for your system. -# error Please send a bug report to the fre...@li... -# error mailing list. You can work around the problem by re-running -# error the configure script with the --enable-endian option. -#endif - -/* i'll see you in hell windows */ -#if !defined(O_BINARY) -# define O_BINARY 0x00 -#endif - -/** - * @brief Internal macros for fun ELF tricks. - */ -#ifdef STDF_HAVE_GCC_ATTRIBUTE_UNUSED -# define stdf_attribute_unused __attribute__ ((__unused__)) -#else -# define stdf_attribute_unused -#endif -#ifdef STDF_HAVE_GCC_ATTRIBUTE_CONST -# define stdf_attribute_const __attribute__ ((__const__)) -#else -# define stdf_attribute_const -#endif -#ifdef STDF_HAVE_GCC_ATTRIBUTE_VISIBILITY -# define stdf_attribute_hidden __attribute__ ((__visibility__("hidden"))) -#else -# define stdf_attribute_hidden -#endif -#ifdef STDF_HAVE_GCC_ATTRIBUTE_STRONG_ALIAS -# define stdf_attribute_strong_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((__alias__ (#name))) -#else -# define stdf_attribute_strong_alias(name, aliasname) -#endif -#ifdef STDF_HAVE_GCC_ATTRIBUTE_WEAK_ALIAS -# define stdf_attribute_weak_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((__weak__, __alias__ (#name))) -#else -# define stdf_attribute_weak_alias(name, aliasname) -#endif - -#endif /* _LIBSTDF_SYSTEMS_H */ Added: trunk/libstdf/include/libstdf_systems.h.in =================================================================== --- trunk/libstdf/include/libstdf_systems.h.in (rev 0) +++ trunk/libstdf/include/libstdf_systems.h.in 2007-12-15 19:33:58 UTC (rev 314) @@ -0,0 +1,52 @@ +/** + * @file libstdf_systems.h + * @brief Pull in system specific include files / features in order for + * public libstdf.h to work properly. + */ +/* + * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> + * Released under the BSD license. For more information, + * please see: http://opensource.org/licenses/bsd-license.php + */ + +#ifndef _LIBSTDF_SYSTEMS_H +#define _LIBSTDF_SYSTEMS_H + +#if defined(WIN32) && !defined(__MINGW32__) +# include <libstdf_win32.h> +#elif defined(__IN_LIBSTDF) +# include <config.h> +#endif +#if defined(__IN_LIBSTDF) +# include <internal/headers.h> +#endif + +#if @HAVE_STDINT_H@ +# include <stdint.h> +#endif +#if @HAVE_INTTYPES_H@ +# include <inttypes.h> +#endif +#if @HAVE_SYS_TYPES_H@ +# include <sys/types.h> +#endif + +#if @HAVE_CMPLRS_HOST_H@ +# include <cmplrs/host.h> +typedef uint8 uint8_t; +typedef uint16 uint16_t; +typedef uint32 uint32_t; +typedef uint64 uint64_t; +typedef int8 int8_t; +typedef int16 int16_t; +typedef int32 int32_t; +typedef int64 int64_t; +#endif + +#if @STDF_HAVE_GCC_ATTRIBUTE_CONST@ +# define stdf_attribute_const __attribute__ ((__const__)) +#else +# define stdf_attribute_const +#endif + +#endif /* _LIBSTDF_SYSTEMS_H */ Modified: trunk/libstdf/include/libstdf_win32.h =================================================================== --- trunk/libstdf/include/libstdf_win32.h 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/libstdf_win32.h 2007-12-15 19:33:58 UTC (rev 314) @@ -11,8 +11,6 @@ #ifndef _LIBSTDF_WIN32_H #define _LIBSTDF_WIN32_H -#include <libstdf_win32_options.h> - #include <sys/types.h> typedef unsigned __int8 uint8_t; @@ -24,19 +22,11 @@ typedef signed __int32 int32_t; typedef signed __int64 int64_t; -#ifndef PACKAGE_STRING -# ifndef __DATE__ -# define __DATE__ -# endif -# define PACKAGE_STRING "libstdf win32 " __DATE__ -#endif - /* pos windows compiler doesnt like 'far' as a variable name */ #define far _windows_is_a_pos_far -#include <io.h> -#define open _open +#ifdef __IN_LIBSTDF +# include <internal/win32.h> +#endif -#define STDF_ENDIAN_FORCE STDF_ENDIAN_LITTLE - #endif /* _LIBSTDF_WIN32_H */ Deleted: trunk/libstdf/include/libstdf_win32_options.h =================================================================== --- trunk/libstdf/include/libstdf_win32_options.h 2007-12-15 19:31:35 UTC (rev 313) +++ trunk/libstdf/include/libstdf_win32_options.h 2007-12-15 19:33:58 UTC (rev 314) @@ -1,32 +0,0 @@ -/** - * @file libstdf_win32_options.h - * @brief Enable/Disable libstdf features. - * @internal - */ -/* - * Copyright (C) 2004-2007 Mike Frysinger <va...@gm...> - * Released under the BSD license. For more information, - * please see: http://opensource.org/licenses/bsd-license.php - */ - -#ifndef _LIBSTDF_WIN32_OPTIONS_H -#define _LIBSTDF_WIN32_OPTIONS_H - -#define HAVE_ZIP 0 -#define HAVE_GZIP 0 -#define HAVE_BZIP2 0 -#define HAVE_LZW 0 - -/* you shouldn't have to touch anything below here */ -#define HAVE_CTYPE_H 1 -#define HAVE_ERRNO_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TIME_H 1 - -#endif /* _LIBSTDF_WIN32_OPTIONS_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |