aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-01-25 16:16:20 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-01-25 16:16:20 +0000
commitbfaccf59b0b916e9f944b68b869146a6e859a208 (patch)
treeb043c05ab3e74c3f12485acdd6164c28519cca58 /src
parent1ea230f8d6d79ca17278063d56edb78eabd1db05 (diff)
better setup-function detection:
remove the dependency on "z_"-prefix use "setup_"-prefix for c-files containing 0x (hexloader), else use "_setup" suffix replace trailing "~" by "_tilde" svn path=/trunk/externals/zexy/; revision=4493
Diffstat (limited to 'src')
-rwxr-xr-xsrc/makesource.sh13
-rw-r--r--src/z_zexy.c139
-rw-r--r--src/z_zexy.h141
-rw-r--r--src/zexy.c2
4 files changed, 149 insertions, 146 deletions
diff --git a/src/makesource.sh b/src/makesource.sh
index 24fc90f..3e29540 100755
--- a/src/makesource.sh
+++ b/src/makesource.sh
@@ -22,6 +22,8 @@ function head_h() {
}
function foot_h() {
+ echo ""
+ echo "void z_zexy_setup(void);"
echo "#endif /* Z_ZEXY_H__ */"
echo ""
}
@@ -49,15 +51,18 @@ function foot_c() {
head_h > $ZEXY_H
head_c > $ZEXY_C
-for i in `ls *.c | grep -v zexy.c`
+for f in `ls *.c | grep -v zexy.c`
do
## each c-file in zexy needs to have a z_<file>_setup()-function
## that calls all needed setup-functions
## any non-alpha-numeric-character is replaced by "_"
## e.g. "multiplex~.c" -> "z_multiplex__setup()"
- SETUPNAME=z_`echo ${i%.c} | sed -e 's/[^[:alnum:]]/_/g'`_setup
- echo "void ${SETUPNAME}(void); /* $i */" >> $ZEXY_H
- echo " ${SETUPNAME}(); /* $i */" >> $ZEXY_C
+ i=${f%.c}
+ SETUPNAME=$(echo $i | sed -e "s/.*0x.*/setup_&/g" -e "s/~$/_tilde/g" -e "/0x/! s/.*/&_setup/")
+ if grep -w ${SETUPNAME} $f > /dev/null; then
+ echo "void ${SETUPNAME}(void); /* $i */" >> $ZEXY_H
+ echo " ${SETUPNAME}(); /* $i */" >> $ZEXY_C
+ fi
done
foot_h >> $ZEXY_H
diff --git a/src/z_zexy.c b/src/z_zexy.c
index ae76b9e..915c1e1 100644
--- a/src/z_zexy.c
+++ b/src/z_zexy.c
@@ -7,75 +7,74 @@
void z_zexy_setup(void)
{
- z_0x260x260x7e_setup(); /* 0x260x260x7e.c */
- z_0x2e_setup(); /* 0x2e.c */
- z_0x3c0x7e_setup(); /* 0x3c0x7e.c */
- z_0x3d0x3d0x7e_setup(); /* 0x3d0x3d0x7e.c */
- z_0x3e0x7e_setup(); /* 0x3e0x7e.c */
- z_0x7c0x7c0x7e_setup(); /* 0x7c0x7c0x7e.c */
- z_a2l_setup(); /* a2l.c */
- z_abs__setup(); /* abs~.c */
- z_absgn__setup(); /* absgn~.c */
- z_atoi_setup(); /* atoi.c */
- z_avg__setup(); /* avg~.c */
- z_blockmirror__setup(); /* blockmirror~.c */
- z_blockswap__setup(); /* blockswap~.c */
- z_date_setup(); /* date.c */
- z_demultiplex__setup(); /* demultiplex~.c */
- z_demultiplex_setup(); /* demultiplex.c */
- z_dfreq__setup(); /* dfreq~.c */
- z_dirac__setup(); /* dirac~.c */
- z_drip_setup(); /* drip.c */
- z_envrms__setup(); /* envrms~.c */
- z_fifop_setup(); /* fifop.c */
- z_glue_setup(); /* glue.c */
- z_index_setup(); /* index.c */
- z_length_setup(); /* length.c */
- z_lifop_setup(); /* lifop.c */
- z_limiter__setup(); /* limiter~.c */
- z_list2int_setup(); /* list2int.c */
- z_list2symbol_setup(); /* list2symbol.c */
- z_lister_setup(); /* lister.c */
- z_lpt_setup(); /* lpt.c */
- z_makesymbol_setup(); /* makesymbol.c */
- z_mavg_setup(); /* mavg.c */
- z_minmax_setup(); /* minmax.c */
- z_msgfile_setup(); /* msgfile.c */
- z_multiline__setup(); /* multiline~.c */
- z_multiplex__setup(); /* multiplex~.c */
- z_multiplex_setup(); /* multiplex.c */
- z_niagara_setup(); /* niagara.c */
- z_noish__setup(); /* noish~.c */
- z_noisi__setup(); /* noisi~.c */
- z_operating_system_setup(); /* operating_system.c */
- z_pack__setup(); /* pack~.c */
- z_packel_setup(); /* packel.c */
- z_pdf__setup(); /* pdf~.c */
- z_prime_setup(); /* prime.c */
- z_quantize__setup(); /* quantize~.c */
- z_regex_setup(); /* regex.c */
- z_relay_setup(); /* relay.c */
- z_repack_setup(); /* repack.c */
- z_repeat_setup(); /* repeat.c */
- z_sfplay_setup(); /* sfplay.c */
- z_sfrecord_setup(); /* sfrecord.c */
- z_sgn__setup(); /* sgn~.c */
- z_sigzero__setup(); /* sigzero~.c */
- z_sort_setup(); /* sort.c */
- z_step__setup(); /* step~.c */
- z_strcmp_setup(); /* strcmp.c */
- z_sum_setup(); /* sum.c */
- z_swap__setup(); /* swap~.c */
- z_symbol2list_setup(); /* symbol2list.c */
- z_tabdump_setup(); /* tabdump.c */
- z_tabminmax_setup(); /* tabminmax.c */
- z_tabset_setup(); /* tabset.c */
- z_tavg__setup(); /* tavg~.c */
- z_time_setup(); /* time.c */
- z_unpack__setup(); /* unpack~.c */
- z_urn_setup(); /* urn.c */
- z_winNT_portio_setup(); /* winNT_portio.c */
- z_wrap_setup(); /* wrap.c */
- z_z__setup(); /* z~.c */
+ setup_0x260x260x7e(); /* 0x260x260x7e */
+ setup_0x2e(); /* 0x2e */
+ setup_0x3c0x7e(); /* 0x3c0x7e */
+ setup_0x3d0x3d0x7e(); /* 0x3d0x3d0x7e */
+ setup_0x3e0x7e(); /* 0x3e0x7e */
+ setup_0x7c0x7c0x7e(); /* 0x7c0x7c0x7e */
+ a2l_setup(); /* a2l */
+ abs_tilde_setup(); /* abs~ */
+ absgn_tilde_setup(); /* absgn~ */
+ atoi_setup(); /* atoi */
+ avg_tilde_setup(); /* avg~ */
+ blockmirror_tilde_setup(); /* blockmirror~ */
+ blockswap_tilde_setup(); /* blockswap~ */
+ date_setup(); /* date */
+ demultiplex_tilde_setup(); /* demultiplex~ */
+ demultiplex_setup(); /* demultiplex */
+ dfreq_tilde_setup(); /* dfreq~ */
+ dirac_tilde_setup(); /* dirac~ */
+ drip_setup(); /* drip */
+ envrms_tilde_setup(); /* envrms~ */
+ fifop_setup(); /* fifop */
+ glue_setup(); /* glue */
+ index_setup(); /* index */
+ length_setup(); /* length */
+ lifop_setup(); /* lifop */
+ limiter_tilde_setup(); /* limiter~ */
+ list2int_setup(); /* list2int */
+ list2symbol_setup(); /* list2symbol */
+ lister_setup(); /* lister */
+ lpt_setup(); /* lpt */
+ makesymbol_setup(); /* makesymbol */
+ mavg_setup(); /* mavg */
+ minmax_setup(); /* minmax */
+ msgfile_setup(); /* msgfile */
+ multiline_tilde_setup(); /* multiline~ */
+ multiplex_tilde_setup(); /* multiplex~ */
+ multiplex_setup(); /* multiplex */
+ niagara_setup(); /* niagara */
+ noish_tilde_setup(); /* noish~ */
+ noisi_tilde_setup(); /* noisi~ */
+ operating_system_setup(); /* operating_system */
+ pack_tilde_setup(); /* pack~ */
+ packel_setup(); /* packel */
+ pdf_tilde_setup(); /* pdf~ */
+ prime_setup(); /* prime */
+ quantize_tilde_setup(); /* quantize~ */
+ regex_setup(); /* regex */
+ relay_setup(); /* relay */
+ repack_setup(); /* repack */
+ repeat_setup(); /* repeat */
+ sfplay_setup(); /* sfplay */
+ sfrecord_setup(); /* sfrecord */
+ sgn_tilde_setup(); /* sgn~ */
+ sigzero_tilde_setup(); /* sigzero~ */
+ sort_setup(); /* sort */
+ step_tilde_setup(); /* step~ */
+ strcmp_setup(); /* strcmp */
+ sum_setup(); /* sum */
+ swap_tilde_setup(); /* swap~ */
+ symbol2list_setup(); /* symbol2list */
+ tabdump_setup(); /* tabdump */
+ tabminmax_setup(); /* tabminmax */
+ tabset_setup(); /* tabset */
+ tavg_tilde_setup(); /* tavg~ */
+ time_setup(); /* time */
+ unpack_tilde_setup(); /* unpack~ */
+ urn_setup(); /* urn */
+ wrap_setup(); /* wrap */
+ z_tilde_setup(); /* z~ */
}
diff --git a/src/z_zexy.h b/src/z_zexy.h
index e5b26f1..ea00729 100644
--- a/src/z_zexy.h
+++ b/src/z_zexy.h
@@ -5,75 +5,76 @@
#ifndef Z_ZEXY_H__
#define Z_ZEXY_H__
-void z_0x260x260x7e_setup(void); /* 0x260x260x7e.c */
-void z_0x2e_setup(void); /* 0x2e.c */
-void z_0x3c0x7e_setup(void); /* 0x3c0x7e.c */
-void z_0x3d0x3d0x7e_setup(void); /* 0x3d0x3d0x7e.c */
-void z_0x3e0x7e_setup(void); /* 0x3e0x7e.c */
-void z_0x7c0x7c0x7e_setup(void); /* 0x7c0x7c0x7e.c */
-void z_a2l_setup(void); /* a2l.c */
-void z_abs__setup(void); /* abs~.c */
-void z_absgn__setup(void); /* absgn~.c */
-void z_atoi_setup(void); /* atoi.c */
-void z_avg__setup(void); /* avg~.c */
-void z_blockmirror__setup(void); /* blockmirror~.c */
-void z_blockswap__setup(void); /* blockswap~.c */
-void z_date_setup(void); /* date.c */
-void z_demultiplex__setup(void); /* demultiplex~.c */
-void z_demultiplex_setup(void); /* demultiplex.c */
-void z_dfreq__setup(void); /* dfreq~.c */
-void z_dirac__setup(void); /* dirac~.c */
-void z_drip_setup(void); /* drip.c */
-void z_envrms__setup(void); /* envrms~.c */
-void z_fifop_setup(void); /* fifop.c */
-void z_glue_setup(void); /* glue.c */
-void z_index_setup(void); /* index.c */
-void z_length_setup(void); /* length.c */
-void z_lifop_setup(void); /* lifop.c */
-void z_limiter__setup(void); /* limiter~.c */
-void z_list2int_setup(void); /* list2int.c */
-void z_list2symbol_setup(void); /* list2symbol.c */
-void z_lister_setup(void); /* lister.c */
-void z_lpt_setup(void); /* lpt.c */
-void z_makesymbol_setup(void); /* makesymbol.c */
-void z_mavg_setup(void); /* mavg.c */
-void z_minmax_setup(void); /* minmax.c */
-void z_msgfile_setup(void); /* msgfile.c */
-void z_multiline__setup(void); /* multiline~.c */
-void z_multiplex__setup(void); /* multiplex~.c */
-void z_multiplex_setup(void); /* multiplex.c */
-void z_niagara_setup(void); /* niagara.c */
-void z_noish__setup(void); /* noish~.c */
-void z_noisi__setup(void); /* noisi~.c */
-void z_operating_system_setup(void); /* operating_system.c */
-void z_pack__setup(void); /* pack~.c */
-void z_packel_setup(void); /* packel.c */
-void z_pdf__setup(void); /* pdf~.c */
-void z_prime_setup(void); /* prime.c */
-void z_quantize__setup(void); /* quantize~.c */
-void z_regex_setup(void); /* regex.c */
-void z_relay_setup(void); /* relay.c */
-void z_repack_setup(void); /* repack.c */
-void z_repeat_setup(void); /* repeat.c */
-void z_sfplay_setup(void); /* sfplay.c */
-void z_sfrecord_setup(void); /* sfrecord.c */
-void z_sgn__setup(void); /* sgn~.c */
-void z_sigzero__setup(void); /* sigzero~.c */
-void z_sort_setup(void); /* sort.c */
-void z_step__setup(void); /* step~.c */
-void z_strcmp_setup(void); /* strcmp.c */
-void z_sum_setup(void); /* sum.c */
-void z_swap__setup(void); /* swap~.c */
-void z_symbol2list_setup(void); /* symbol2list.c */
-void z_tabdump_setup(void); /* tabdump.c */
-void z_tabminmax_setup(void); /* tabminmax.c */
-void z_tabset_setup(void); /* tabset.c */
-void z_tavg__setup(void); /* tavg~.c */
-void z_time_setup(void); /* time.c */
-void z_unpack__setup(void); /* unpack~.c */
-void z_urn_setup(void); /* urn.c */
-void z_winNT_portio_setup(void); /* winNT_portio.c */
-void z_wrap_setup(void); /* wrap.c */
-void z_z__setup(void); /* z~.c */
+void setup_0x260x260x7e(void); /* 0x260x260x7e */
+void setup_0x2e(void); /* 0x2e */
+void setup_0x3c0x7e(void); /* 0x3c0x7e */
+void setup_0x3d0x3d0x7e(void); /* 0x3d0x3d0x7e */
+void setup_0x3e0x7e(void); /* 0x3e0x7e */
+void setup_0x7c0x7c0x7e(void); /* 0x7c0x7c0x7e */
+void a2l_setup(void); /* a2l */
+void abs_tilde_setup(void); /* abs~ */
+void absgn_tilde_setup(void); /* absgn~ */
+void atoi_setup(void); /* atoi */
+void avg_tilde_setup(void); /* avg~ */
+void blockmirror_tilde_setup(void); /* blockmirror~ */
+void blockswap_tilde_setup(void); /* blockswap~ */
+void date_setup(void); /* date */
+void demultiplex_tilde_setup(void); /* demultiplex~ */
+void demultiplex_setup(void); /* demultiplex */
+void dfreq_tilde_setup(void); /* dfreq~ */
+void dirac_tilde_setup(void); /* dirac~ */
+void drip_setup(void); /* drip */
+void envrms_tilde_setup(void); /* envrms~ */
+void fifop_setup(void); /* fifop */
+void glue_setup(void); /* glue */
+void index_setup(void); /* index */
+void length_setup(void); /* length */
+void lifop_setup(void); /* lifop */
+void limiter_tilde_setup(void); /* limiter~ */
+void list2int_setup(void); /* list2int */
+void list2symbol_setup(void); /* list2symbol */
+void lister_setup(void); /* lister */
+void lpt_setup(void); /* lpt */
+void makesymbol_setup(void); /* makesymbol */
+void mavg_setup(void); /* mavg */
+void minmax_setup(void); /* minmax */
+void msgfile_setup(void); /* msgfile */
+void multiline_tilde_setup(void); /* multiline~ */
+void multiplex_tilde_setup(void); /* multiplex~ */
+void multiplex_setup(void); /* multiplex */
+void niagara_setup(void); /* niagara */
+void noish_tilde_setup(void); /* noish~ */
+void noisi_tilde_setup(void); /* noisi~ */
+void operating_system_setup(void); /* operating_system */
+void pack_tilde_setup(void); /* pack~ */
+void packel_setup(void); /* packel */
+void pdf_tilde_setup(void); /* pdf~ */
+void prime_setup(void); /* prime */
+void quantize_tilde_setup(void); /* quantize~ */
+void regex_setup(void); /* regex */
+void relay_setup(void); /* relay */
+void repack_setup(void); /* repack */
+void repeat_setup(void); /* repeat */
+void sfplay_setup(void); /* sfplay */
+void sfrecord_setup(void); /* sfrecord */
+void sgn_tilde_setup(void); /* sgn~ */
+void sigzero_tilde_setup(void); /* sigzero~ */
+void sort_setup(void); /* sort */
+void step_tilde_setup(void); /* step~ */
+void strcmp_setup(void); /* strcmp */
+void sum_setup(void); /* sum */
+void swap_tilde_setup(void); /* swap~ */
+void symbol2list_setup(void); /* symbol2list */
+void tabdump_setup(void); /* tabdump */
+void tabminmax_setup(void); /* tabminmax */
+void tabset_setup(void); /* tabset */
+void tavg_tilde_setup(void); /* tavg~ */
+void time_setup(void); /* time */
+void unpack_tilde_setup(void); /* unpack~ */
+void urn_setup(void); /* urn */
+void wrap_setup(void); /* wrap */
+void z_tilde_setup(void); /* z~ */
+
+void z_zexy_setup(void);
#endif /* Z_ZEXY_H__ */
diff --git a/src/zexy.c b/src/zexy.c
index af335a4..6a5d32c 100644
--- a/src/zexy.c
+++ b/src/zexy.c
@@ -122,8 +122,6 @@ static void *zexy_new(void)
return (x);
}
-void z_zexy_setup(void); /* defined in z_zexy.c */
-
void zexy_setup(void)
{
int i;