home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / web2c / bibtex / convert < prev    next >
Encoding:
Text File  |  1996-09-28  |  609 b   |  23 lines

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