home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
ms_dos
/
update
/
gosub.h
< prev
next >
Wrap
Text File
|
1990-06-14
|
441b
|
23 lines
/*
* gosub.h
* subroutine call 'gosub' & 'retsub' for Turbo C
* usage : gosub(<tag>);
* ・・・
* return;
* <tag>:
* ・・・
* retsub;
* 1988/4/5 Sey
*/
#include <setjmp.h>
#ifndef _SUBLVLMAX_
#define _SUBLVLMAX_ 10
#endif
static jmp_buf _GOSUBBUF_[_SUBLVLMAX_];
static unsigned _SUBLVL_ = 0;
#define gosub(tag) if(!setjmp(_GOSUBBUF_[_SUBLVL_++]))goto tag
#define retsub longjmp(_GOSUBBUF_[--_SUBLVL_],1)