home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc2 / Src / bibtex / convert < prev    next >
Text File  |  1992-07-05  |  599b  |  25 lines

  1. #!/bin/sh
  2. # Convert Bibtex to C.
  3. sed=sed
  4.  
  5. cat ../lib/common.defines $1 \
  6.     | ../web2c/web2c -hconfig.h \
  7.         | $sed -e '1a\
  8. \#include \<setjmp.h\> \
  9. jmp_buf jmp9998, jmp32; int lab31=0;
  10. s/goto lab31 ; /{lab31=1; return;}/
  11. s/goto lab32/longjmp(jmp32,1)/
  12. s/goto lab9998/longjmp(jmp9998,1)/g
  13. s/lab31://
  14. s/lab32://
  15. s/hack1 () ;/if(setjmp(jmp9998)==1) goto lab9998;if(setjmp(jmp32)==0)while(true)/
  16. s/hack2 ()/break/
  17. /^void main_body/,$s/while ( true/while ( lab31==0/' \
  18.     | ../web2c/fixwrites > $2
  19.  
  20. sync
  21.  
  22. $sed -e 's/(buftype)//g' -e 's/(pdstype)//g' < coerce.h > xcoerce.h
  23. mv -f xcoerce.h coerce.h
  24.