embed.pl now reads *var*.h to do its stuff.
Nick Ing-Simmons [Sun, 30 Nov 1997 20:00:19 +0000 (20:00 +0000)]
Split generated embed.h into two - new embedvar.h
is #included when 'op' etc. will not mess up proto.h etc.
Removed #define foo (thr->Tfoo) from thread.h
Added some 'missing' symbols to global.sym, removed
those in the *var*.h files
Has build all MULTIPLICITY/USE_THREADS options on win32
with VC++ (and passed tests), but not with exactly this set
of files.

p4raw-id: //depot/ansiperl@338

13 files changed:
embed.h
embed.pl
embedvar.h [new file with mode: 0644]
global.sym
interp.sym
intrpvar.h
perl.h
perlvars.h
regcomp.c
thrdvar.h
thread.h
win32/Makefile
win32/makedef.pl

diff --git a/embed.h b/embed.h
index caa1936..8a475a9 100644 (file)
--- a/embed.h
+++ b/embed.h
@@ -1,6 +1,6 @@
 /* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
-   This file is built by embed.pl from global.sym and interp.sym.
-   Any changes made here will be lost!
+   This file is built by embed.pl from global.sym, intrpvar.h,
+   and thrdvar.h.  Any changes made here will be lost!
 */
 
 /* (Doing namespace management portably in C is really gross.) */
@@ -23,8 +23,6 @@
 #define Error                  Perl_Error
 #define Gv_AMupdate            Perl_Gv_AMupdate
 #define No                     Perl_No
-#define Sv                     Perl_Sv
-#define Xpv                    Perl_Xpv
 #define Yes                    Perl_Yes
 #define abs_amg                        Perl_abs_amg
 #define add_amg                        Perl_add_amg
 #define cshlen                 Perl_cshlen
 #define cshname                        Perl_cshname
 #define curinterp              Perl_curinterp
-#define curpad                 Perl_curpad
 #define cv_ckproto             Perl_cv_ckproto
 #define cv_clone               Perl_cv_clone
 #define cv_const_sv            Perl_cv_const_sv
 #define eq_amg                 Perl_eq_amg
 #define error_count            Perl_error_count
 #define euid                   Perl_euid
+#define eval_cond              Perl_eval_cond
+#define eval_mutex             Perl_eval_mutex
+#define eval_owner             Perl_eval_owner
 #define evalseq                        Perl_evalseq
 #define exp_amg                        Perl_exp_amg
 #define expect                 Perl_expect
 #define magic_wipepack         Perl_magic_wipepack
 #define magicname              Perl_magicname
 #define malloc_mutex           Perl_malloc_mutex
-#define markstack              Perl_markstack
 #define markstack_grow         Perl_markstack_grow
-#define markstack_max          Perl_markstack_max
-#define markstack_ptr          Perl_markstack_ptr
 #define max_intro_pending      Perl_max_intro_pending
 #define maxo                   Perl_maxo
 #define mem_collxfrm           Perl_mem_collxfrm
 #define oopsAV                 Perl_oopsAV
 #define oopsCV                 Perl_oopsCV
 #define oopsHV                 Perl_oopsHV
-#define op                     Perl_op
 #define op_desc                        Perl_op_desc
 #define op_free                        Perl_op_free
 #define op_name                        Perl_op_name
 #define op_seqmax              Perl_op_seqmax
 #define opargs                 Perl_opargs
-#define opsave                 Perl_opsave
 #define origalen               Perl_origalen
 #define origenviron            Perl_origenviron
 #define osname                 Perl_osname
 #define repeat_amg             Perl_repeat_amg
 #define repeat_ass_amg         Perl_repeat_ass_amg
 #define repeatcpy              Perl_repeatcpy
-#define retstack               Perl_retstack
-#define retstack_ix            Perl_retstack_ix
-#define retstack_max           Perl_retstack_max
 #define rninstr                        Perl_rninstr
 #define rsfp                   Perl_rsfp
 #define rsfp_filters           Perl_rsfp_filters
 #define save_threadsv          Perl_save_threadsv
 #define savepv                 Perl_savepv
 #define savepvn                        Perl_savepvn
-#define savestack              Perl_savestack
 #define savestack_grow         Perl_savestack_grow
-#define savestack_ix           Perl_savestack_ix
-#define savestack_max          Perl_savestack_max
 #define saw_return             Perl_saw_return
 #define sawparens              Perl_sawparens
 #define scalar                 Perl_scalar
 #define scan_word              Perl_scan_word
 #define scmp_amg               Perl_scmp_amg
 #define scope                  Perl_scope
-#define scopestack             Perl_scopestack
-#define scopestack_ix          Perl_scopestack_ix
-#define scopestack_max         Perl_scopestack_max
 #define screaminstr            Perl_screaminstr
 #define scrgv                  Perl_scrgv
 #define seq_amg                        Perl_seq_amg
 #define slt_amg                        Perl_slt_amg
 #define sne_amg                        Perl_sne_amg
 #define sqrt_amg               Perl_sqrt_amg
-#define stack_base             Perl_stack_base
 #define stack_grow             Perl_stack_grow
-#define stack_max              Perl_stack_max
-#define stack_sp               Perl_stack_sp
 #define start_subparse         Perl_start_subparse
-#define statbuf                        Perl_statbuf
 #define string_amg             Perl_string_amg
 #define sub_crush_depth                Perl_sub_crush_depth
 #define sub_generation         Perl_sub_generation
 #define sv_len                 Perl_sv_len
 #define sv_magic               Perl_sv_magic
 #define sv_mortalcopy          Perl_sv_mortalcopy
+#define sv_mutex               Perl_sv_mutex
 #define sv_newmortal           Perl_sv_newmortal
 #define sv_newref              Perl_sv_newref
 #define sv_no                  Perl_sv_no
 #define thr_key                        Perl_thr_key
 #define threads_mutex          Perl_threads_mutex
 #define threadsv_names         Perl_threadsv_names
-#define timesbuf               Perl_timesbuf
 #define tokenbuf               Perl_tokenbuf
 #define too_few_arguments      Perl_too_few_arguments
 #define too_many_arguments     Perl_too_many_arguments
 #define vtbl_pack              Perl_vtbl_pack
 #define vtbl_packelem          Perl_vtbl_packelem
 #define vtbl_pos               Perl_vtbl_pos
+#define vtbl_regexp            Perl_vtbl_regexp
 #define vtbl_sig               Perl_vtbl_sig
 #define vtbl_sigelem           Perl_vtbl_sigelem
 #define vtbl_substr            Perl_vtbl_substr
 
 #endif /* EMBED */
 
-/* Put interpreter-specific symbols into a struct? */
-
-#ifdef MULTIPLICITY
-
-#define Argv                   (curinterp->IArgv)
-#define Cmd                    (curinterp->ICmd)
-#define DBgv                   (curinterp->IDBgv)
-#define DBline                 (curinterp->IDBline)
-#define DBsignal               (curinterp->IDBsignal)
-#define DBsingle               (curinterp->IDBsingle)
-#define DBsub                  (curinterp->IDBsub)
-#define DBtrace                        (curinterp->IDBtrace)
-#define allgvs                 (curinterp->Iallgvs)
-#define ampergv                        (curinterp->Iampergv)
-#define argvgv                 (curinterp->Iargvgv)
-#define argvoutgv              (curinterp->Iargvoutgv)
-#define basetime               (curinterp->Ibasetime)
-#define beginav                        (curinterp->Ibeginav)
-#define bodytarget             (curinterp->Ibodytarget)
-#define cddir                  (curinterp->Icddir)
-#define chopset                        (curinterp->Ichopset)
-#define copline                        (curinterp->Icopline)
-#define curblock               (curinterp->Icurblock)
-#define curcop                 (curinterp->Icurcop)
-#define curcopdb               (curinterp->Icurcopdb)
-#define curcsv                 (curinterp->Icurcsv)
-#define curpm                  (curinterp->Icurpm)
-#define curstack               (curinterp->Icurstack)
-#define curstash               (curinterp->Icurstash)
-#define curstname              (curinterp->Icurstname)
-#define cxstack                        (curinterp->Icxstack)
-#define cxstack_ix             (curinterp->Icxstack_ix)
-#define cxstack_max            (curinterp->Icxstack_max)
-#define dbargs                 (curinterp->Idbargs)
-#define debdelim               (curinterp->Idebdelim)
-#define debname                        (curinterp->Idebname)
-#define debstash               (curinterp->Idebstash)
-#define defgv                  (curinterp->Idefgv)
-#define defoutgv               (curinterp->Idefoutgv)
-#define defstash               (curinterp->Idefstash)
-#define delaymagic             (curinterp->Idelaymagic)
-#define diehook                        (curinterp->Idiehook)
-#define dirty                  (curinterp->Idirty)
-#define dlevel                 (curinterp->Idlevel)
-#define dlmax                  (curinterp->Idlmax)
-#define doextract              (curinterp->Idoextract)
-#define doswitches             (curinterp->Idoswitches)
-#define dowarn                 (curinterp->Idowarn)
-#define dumplvl                        (curinterp->Idumplvl)
-#define e_fp                   (curinterp->Ie_fp)
-#define e_tmpname              (curinterp->Ie_tmpname)
-#define endav                  (curinterp->Iendav)
-#define envgv                  (curinterp->Ienvgv)
-#define errgv                  (curinterp->Ierrgv)
-#define eval_root              (curinterp->Ieval_root)
-#define eval_start             (curinterp->Ieval_start)
-#define fdpid                  (curinterp->Ifdpid)
-#define filemode               (curinterp->Ifilemode)
-#define firstgv                        (curinterp->Ifirstgv)
-#define forkprocess            (curinterp->Iforkprocess)
-#define formfeed               (curinterp->Iformfeed)
-#define formtarget             (curinterp->Iformtarget)
-#define gensym                 (curinterp->Igensym)
-#define globalstash            (curinterp->Iglobalstash)
-#define in_eval                        (curinterp->Iin_eval)
-#define incgv                  (curinterp->Iincgv)
-#define initav                 (curinterp->Iinitav)
-#define inplace                        (curinterp->Iinplace)
-#define last_in_gv             (curinterp->Ilast_in_gv)
-#define lastfd                 (curinterp->Ilastfd)
-#define lastretstr             (curinterp->Ilastretstr)
-#define lastscream             (curinterp->Ilastscream)
-#define lastsize               (curinterp->Ilastsize)
-#define lastspbase             (curinterp->Ilastspbase)
-#define laststatval            (curinterp->Ilaststatval)
-#define laststype              (curinterp->Ilaststype)
-#define leftgv                 (curinterp->Ileftgv)
-#define lineary                        (curinterp->Ilineary)
-#define localizing             (curinterp->Ilocalizing)
-#define localpatches           (curinterp->Ilocalpatches)
-#define main_cv                        (curinterp->Imain_cv)
-#define main_root              (curinterp->Imain_root)
-#define main_start             (curinterp->Imain_start)
-#define mainstack              (curinterp->Imainstack)
-#define maxscream              (curinterp->Imaxscream)
-#define maxsysfd               (curinterp->Imaxsysfd)
-#define mess_sv                        (curinterp->Imess_sv)
-#define minus_F                        (curinterp->Iminus_F)
-#define minus_a                        (curinterp->Iminus_a)
-#define minus_c                        (curinterp->Iminus_c)
-#define minus_l                        (curinterp->Iminus_l)
-#define minus_n                        (curinterp->Iminus_n)
-#define minus_p                        (curinterp->Iminus_p)
-#define multiline              (curinterp->Imultiline)
-#define mystrk                 (curinterp->Imystrk)
-#define nrs                    (curinterp->Inrs)
-#define ofmt                   (curinterp->Iofmt)
-#define ofs                    (curinterp->Iofs)
-#define ofslen                 (curinterp->Iofslen)
-#define oldlastpm              (curinterp->Ioldlastpm)
-#define oldname                        (curinterp->Ioldname)
-#define op_mask                        (curinterp->Iop_mask)
-#define origargc               (curinterp->Iorigargc)
-#define origargv               (curinterp->Iorigargv)
-#define origfilename           (curinterp->Iorigfilename)
-#define ors                    (curinterp->Iors)
-#define orslen                 (curinterp->Iorslen)
-#define parsehook              (curinterp->Iparsehook)
-#define patchlevel             (curinterp->Ipatchlevel)
-#define perl_destruct_level    (curinterp->Iperl_destruct_level)
-#define perldb                 (curinterp->Iperldb)
-#define preambleav             (curinterp->Ipreambleav)
-#define preambled              (curinterp->Ipreambled)
-#define preprocess             (curinterp->Ipreprocess)
-#define restartop              (curinterp->Irestartop)
-#define rightgv                        (curinterp->Irightgv)
-#define rs                     (curinterp->Irs)
-#define sawampersand           (curinterp->Isawampersand)
-#define sawstudy               (curinterp->Isawstudy)
-#define sawvec                 (curinterp->Isawvec)
-#define screamfirst            (curinterp->Iscreamfirst)
-#define screamnext             (curinterp->Iscreamnext)
-#define secondgv               (curinterp->Isecondgv)
-#define siggv                  (curinterp->Isiggv)
-#define signalstack            (curinterp->Isignalstack)
-#define sortcop                        (curinterp->Isortcop)
-#define sortstack              (curinterp->Isortstack)
-#define sortstash              (curinterp->Isortstash)
-#define splitstr               (curinterp->Isplitstr)
-#define start_env              (curinterp->Istart_env)
-#define statcache              (curinterp->Istatcache)
-#define statgv                 (curinterp->Istatgv)
-#define statname               (curinterp->Istatname)
-#define statusvalue            (curinterp->Istatusvalue)
-#define statusvalue_vms                (curinterp->Istatusvalue_vms)
-#define stdingv                        (curinterp->Istdingv)
-#define strchop                        (curinterp->Istrchop)
-#define strtab                 (curinterp->Istrtab)
-#define sv_arenaroot           (curinterp->Isv_arenaroot)
-#define sv_count               (curinterp->Isv_count)
-#define sv_objcount            (curinterp->Isv_objcount)
-#define sv_root                        (curinterp->Isv_root)
-#define tainted                        (curinterp->Itainted)
-#define tainting               (curinterp->Itainting)
-#define thrsv                  (curinterp->Ithrsv)
-#define tmps_floor             (curinterp->Itmps_floor)
-#define tmps_ix                        (curinterp->Itmps_ix)
-#define tmps_max               (curinterp->Itmps_max)
-#define tmps_stack             (curinterp->Itmps_stack)
-#define top_env                        (curinterp->Itop_env)
-#define toptarget              (curinterp->Itoptarget)
-#define unsafe                 (curinterp->Iunsafe)
-#define warnhook               (curinterp->Iwarnhook)
-
-#else  /* !MULTIPLICITY */
-
-#define IArgv                  Argv
-#define ICmd                   Cmd
-#define IDBgv                  DBgv
-#define IDBline                        DBline
-#define IDBsignal              DBsignal
-#define IDBsingle              DBsingle
-#define IDBsub                 DBsub
-#define IDBtrace               DBtrace
-#define Iallgvs                        allgvs
-#define Iampergv               ampergv
-#define Iargvgv                        argvgv
-#define Iargvoutgv             argvoutgv
-#define Ibasetime              basetime
-#define Ibeginav               beginav
-#define Ibodytarget            bodytarget
-#define Icddir                 cddir
-#define Ichopset               chopset
-#define Icopline               copline
-#define Icurblock              curblock
-#define Icurcop                        curcop
-#define Icurcopdb              curcopdb
-#define Icurcsv                        curcsv
-#define Icurpm                 curpm
-#define Icurstack              curstack
-#define Icurstash              curstash
-#define Icurstname             curstname
-#define Icxstack               cxstack
-#define Icxstack_ix            cxstack_ix
-#define Icxstack_max           cxstack_max
-#define Idbargs                        dbargs
-#define Idebdelim              debdelim
-#define Idebname               debname
-#define Idebstash              debstash
-#define Idefgv                 defgv
-#define Idefoutgv              defoutgv
-#define Idefstash              defstash
-#define Idelaymagic            delaymagic
-#define Idiehook               diehook
-#define Idirty                 dirty
-#define Idlevel                        dlevel
-#define Idlmax                 dlmax
-#define Idoextract             doextract
-#define Idoswitches            doswitches
-#define Idowarn                        dowarn
-#define Idumplvl               dumplvl
-#define Ie_fp                  e_fp
-#define Ie_tmpname             e_tmpname
-#define Iendav                 endav
-#define Ienvgv                 envgv
-#define Ierrgv                 errgv
-#define Ieval_root             eval_root
-#define Ieval_start            eval_start
-#define Ifdpid                 fdpid
-#define Ifilemode              filemode
-#define Ifirstgv               firstgv
-#define Iforkprocess           forkprocess
-#define Iformfeed              formfeed
-#define Iformtarget            formtarget
-#define Igensym                        gensym
-#define Iglobalstash           globalstash
-#define Iin_eval               in_eval
-#define Iincgv                 incgv
-#define Iinitav                        initav
-#define Iinplace               inplace
-#define Ilast_in_gv            last_in_gv
-#define Ilastfd                        lastfd
-#define Ilastretstr            lastretstr
-#define Ilastscream            lastscream
-#define Ilastsize              lastsize
-#define Ilastspbase            lastspbase
-#define Ilaststatval           laststatval
-#define Ilaststype             laststype
-#define Ileftgv                        leftgv
-#define Ilineary               lineary
-#define Ilocalizing            localizing
-#define Ilocalpatches          localpatches
-#define Imain_cv               main_cv
-#define Imain_root             main_root
-#define Imain_start            main_start
-#define Imainstack             mainstack
-#define Imaxscream             maxscream
-#define Imaxsysfd              maxsysfd
-#define Imess_sv               mess_sv
-#define Iminus_F               minus_F
-#define Iminus_a               minus_a
-#define Iminus_c               minus_c
-#define Iminus_l               minus_l
-#define Iminus_n               minus_n
-#define Iminus_p               minus_p
-#define Imultiline             multiline
-#define Imystrk                        mystrk
-#define Inrs                   nrs
-#define Iofmt                  ofmt
-#define Iofs                   ofs
-#define Iofslen                        ofslen
-#define Ioldlastpm             oldlastpm
-#define Ioldname               oldname
-#define Iop_mask               op_mask
-#define Iorigargc              origargc
-#define Iorigargv              origargv
-#define Iorigfilename          origfilename
-#define Iors                   ors
-#define Iorslen                        orslen
-#define Iparsehook             parsehook
-#define Ipatchlevel            patchlevel
-#define Iperl_destruct_level   perl_destruct_level
-#define Iperldb                        perldb
-#define Ipreambleav            preambleav
-#define Ipreambled             preambled
-#define Ipreprocess            preprocess
-#define Irestartop             restartop
-#define Irightgv               rightgv
-#define Irs                    rs
-#define Isawampersand          sawampersand
-#define Isawstudy              sawstudy
-#define Isawvec                        sawvec
-#define Iscreamfirst           screamfirst
-#define Iscreamnext            screamnext
-#define Isecondgv              secondgv
-#define Isiggv                 siggv
-#define Isignalstack           signalstack
-#define Isortcop               sortcop
-#define Isortstack             sortstack
-#define Isortstash             sortstash
-#define Isplitstr              splitstr
-#define Istart_env             start_env
-#define Istatcache             statcache
-#define Istatgv                        statgv
-#define Istatname              statname
-#define Istatusvalue           statusvalue
-#define Istatusvalue_vms       statusvalue_vms
-#define Istdingv               stdingv
-#define Istrchop               strchop
-#define Istrtab                        strtab
-#define Isv_arenaroot          sv_arenaroot
-#define Isv_count              sv_count
-#define Isv_objcount           sv_objcount
-#define Isv_root               sv_root
-#define Itainted               tainted
-#define Itainting              tainting
-#define Ithrsv                 thrsv
-#define Itmps_floor            tmps_floor
-#define Itmps_ix               tmps_ix
-#define Itmps_max              tmps_max
-#define Itmps_stack            tmps_stack
-#define Itop_env               top_env
-#define Itoptarget             toptarget
-#define Iunsafe                        unsafe
-#define Iwarnhook              warnhook
-
-/* Hide interpreter-specific symbols? */
-
-#ifdef EMBED
-
-#define Argv                   Perl_Argv
-#define Cmd                    Perl_Cmd
-#define DBgv                   Perl_DBgv
-#define DBline                 Perl_DBline
-#define DBsignal               Perl_DBsignal
-#define DBsingle               Perl_DBsingle
-#define DBsub                  Perl_DBsub
-#define DBtrace                        Perl_DBtrace
-#define allgvs                 Perl_allgvs
-#define ampergv                        Perl_ampergv
-#define argvgv                 Perl_argvgv
-#define argvoutgv              Perl_argvoutgv
-#define basetime               Perl_basetime
-#define beginav                        Perl_beginav
-#define bodytarget             Perl_bodytarget
-#define cddir                  Perl_cddir
-#define chopset                        Perl_chopset
-#define copline                        Perl_copline
-#define curblock               Perl_curblock
-#define curcop                 Perl_curcop
-#define curcopdb               Perl_curcopdb
-#define curcsv                 Perl_curcsv
-#define curpm                  Perl_curpm
-#define curstack               Perl_curstack
-#define curstash               Perl_curstash
-#define curstname              Perl_curstname
-#define cxstack                        Perl_cxstack
-#define cxstack_ix             Perl_cxstack_ix
-#define cxstack_max            Perl_cxstack_max
-#define dbargs                 Perl_dbargs
-#define debdelim               Perl_debdelim
-#define debname                        Perl_debname
-#define debstash               Perl_debstash
-#define defgv                  Perl_defgv
-#define defoutgv               Perl_defoutgv
-#define defstash               Perl_defstash
-#define delaymagic             Perl_delaymagic
-#define diehook                        Perl_diehook
-#define dirty                  Perl_dirty
-#define dlevel                 Perl_dlevel
-#define dlmax                  Perl_dlmax
-#define doextract              Perl_doextract
-#define doswitches             Perl_doswitches
-#define dowarn                 Perl_dowarn
-#define dumplvl                        Perl_dumplvl
-#define e_fp                   Perl_e_fp
-#define e_tmpname              Perl_e_tmpname
-#define endav                  Perl_endav
-#define envgv                  Perl_envgv
-#define errgv                  Perl_errgv
-#define eval_root              Perl_eval_root
-#define eval_start             Perl_eval_start
-#define fdpid                  Perl_fdpid
-#define filemode               Perl_filemode
-#define firstgv                        Perl_firstgv
-#define forkprocess            Perl_forkprocess
-#define formfeed               Perl_formfeed
-#define formtarget             Perl_formtarget
-#define gensym                 Perl_gensym
-#define globalstash            Perl_globalstash
-#define in_eval                        Perl_in_eval
-#define incgv                  Perl_incgv
-#define initav                 Perl_initav
-#define inplace                        Perl_inplace
-#define last_in_gv             Perl_last_in_gv
-#define lastfd                 Perl_lastfd
-#define lastretstr             Perl_lastretstr
-#define lastscream             Perl_lastscream
-#define lastsize               Perl_lastsize
-#define lastspbase             Perl_lastspbase
-#define laststatval            Perl_laststatval
-#define laststype              Perl_laststype
-#define leftgv                 Perl_leftgv
-#define lineary                        Perl_lineary
-#define localizing             Perl_localizing
-#define localpatches           Perl_localpatches
-#define main_cv                        Perl_main_cv
-#define main_root              Perl_main_root
-#define main_start             Perl_main_start
-#define mainstack              Perl_mainstack
-#define maxscream              Perl_maxscream
-#define maxsysfd               Perl_maxsysfd
-#define mess_sv                        Perl_mess_sv
-#define minus_F                        Perl_minus_F
-#define minus_a                        Perl_minus_a
-#define minus_c                        Perl_minus_c
-#define minus_l                        Perl_minus_l
-#define minus_n                        Perl_minus_n
-#define minus_p                        Perl_minus_p
-#define multiline              Perl_multiline
-#define mystrk                 Perl_mystrk
-#define nrs                    Perl_nrs
-#define ofmt                   Perl_ofmt
-#define ofs                    Perl_ofs
-#define ofslen                 Perl_ofslen
-#define oldlastpm              Perl_oldlastpm
-#define oldname                        Perl_oldname
-#define op_mask                        Perl_op_mask
-#define origargc               Perl_origargc
-#define origargv               Perl_origargv
-#define origfilename           Perl_origfilename
-#define ors                    Perl_ors
-#define orslen                 Perl_orslen
-#define parsehook              Perl_parsehook
-#define patchlevel             Perl_patchlevel
-#define perl_destruct_level    Perl_perl_destruct_level
-#define perldb                 Perl_perldb
-#define preambleav             Perl_preambleav
-#define preambled              Perl_preambled
-#define preprocess             Perl_preprocess
-#define restartop              Perl_restartop
-#define rightgv                        Perl_rightgv
-#define rs                     Perl_rs
-#define sawampersand           Perl_sawampersand
-#define sawstudy               Perl_sawstudy
-#define sawvec                 Perl_sawvec
-#define screamfirst            Perl_screamfirst
-#define screamnext             Perl_screamnext
-#define secondgv               Perl_secondgv
-#define siggv                  Perl_siggv
-#define signalstack            Perl_signalstack
-#define sortcop                        Perl_sortcop
-#define sortstack              Perl_sortstack
-#define sortstash              Perl_sortstash
-#define splitstr               Perl_splitstr
-#define start_env              Perl_start_env
-#define statcache              Perl_statcache
-#define statgv                 Perl_statgv
-#define statname               Perl_statname
-#define statusvalue            Perl_statusvalue
-#define statusvalue_vms                Perl_statusvalue_vms
-#define stdingv                        Perl_stdingv
-#define strchop                        Perl_strchop
-#define strtab                 Perl_strtab
-#define sv_arenaroot           Perl_sv_arenaroot
-#define sv_count               Perl_sv_count
-#define sv_objcount            Perl_sv_objcount
-#define sv_root                        Perl_sv_root
-#define tainted                        Perl_tainted
-#define tainting               Perl_tainting
-#define thrsv                  Perl_thrsv
-#define tmps_floor             Perl_tmps_floor
-#define tmps_ix                        Perl_tmps_ix
-#define tmps_max               Perl_tmps_max
-#define tmps_stack             Perl_tmps_stack
-#define top_env                        Perl_top_env
-#define toptarget              Perl_toptarget
-#define unsafe                 Perl_unsafe
-#define warnhook               Perl_warnhook
-
-#endif /* EMBED */
-#endif /* MULTIPLICITY */
index 68a15df..c981b42 100755 (executable)
--- a/embed.pl
+++ b/embed.pl
@@ -20,6 +20,54 @@ sub readsyms (\%$) {
 readsyms %global, 'global.sym';
 readsyms %interp, 'interp.sym';
 
+sub readvars(\%$$) {
+    my ($syms, $file,$pre) = @_;
+    %$syms = ();
+    local (*FILE, $_);
+    open(FILE, "< $file")
+       or die "embed.pl: Can't open $file: $!\n";
+    while (<FILE>) {
+       s/[ \t]*#.*//;          # Delete comments.
+       if (/PERLVARI?\($pre(\w+)/) {
+           $$syms{$1} = $pre;
+       }
+    }
+    close(FILE);
+}
+
+my %intrp;
+my %thread;
+
+readvars %intrp,  'intrpvar.h','I';
+readvars %thread, 'thrdvar.h','T';
+#readvars %global, 'perlvars.h','';
+
+foreach my $sym (sort keys %intrp)
+ {
+  warn "$sym not in interp.sym\n" unless exists $interp{$sym};
+  if (exists $global{$sym})
+   {
+    delete $global{$sym};
+    warn "$sym in global.sym as well as interp\n";
+   }
+ }
+
+foreach my $sym (keys %interp)
+ {
+  warn "extra $sym in interp.sym\n" 
+   unless exists $intrp{$sym} || exists $thread{$sym};
+ }
+
+foreach my $sym (sort keys %thread)
+ {
+  warn "$sym in intrpvar.h\n" if exists $intrp{$sym};
+  if (exists $global{$sym})
+   {
+    delete $global{$sym};
+    warn "$sym in global.sym as well as thread\n";
+   }
+ }
+
 sub hide ($$) {
     my ($from, $to) = @_;
     my $t = int(length($from) / 8);
@@ -29,13 +77,13 @@ sub embed ($) {
     my ($sym) = @_;
     hide($sym, "Perl_$sym");
 }
-sub multon ($) {
-    my ($sym) = @_;
-    hide($sym, "(curinterp->I$sym)");
+sub multon ($$$) {
+    my ($sym,$pre,$ptr) = @_;
+    hide($sym, "($ptr->$pre$sym)");
 }
-sub multoff ($) {
-    my ($sym) = @_;
-    hide("I$sym", $sym);
+sub multoff ($$) {
+    my ($sym,$pre) = @_;
+    hide("$pre$sym", $sym);
 }
 
 unlink 'embed.h';
@@ -44,8 +92,8 @@ open(EM, '> embed.h')
 
 print EM <<'END';
 /* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
-   This file is built by embed.pl from global.sym and interp.sym.
-   Any changes made here will be lost!
+   This file is built by embed.pl from global.sym, intrpvar.h,
+   and thrdvar.h.  Any changes made here will be lost!
 */
 
 /* (Doing namespace management portably in C is really gross.) */
@@ -70,19 +118,57 @@ for $sym (sort keys %global) {
     print EM embed($sym);
 }
 
-
 print EM <<'END';
 
 #endif /* EMBED */
 
+END
+
+close(EM);
+
+unlink 'embedvar.h';
+open(EM, '> embedvar.h')
+    or die "Can't create embedvar.h: $!\n";
+
+print EM <<'END';
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+   This file is built by embed.pl from global.sym, intrpvar.h,
+   and thrdvar.h.  Any changes made here will be lost!
+*/
+
+/* (Doing namespace management portably in C is really gross.) */
+
+/*  EMBED has no run-time penalty, but helps keep the Perl namespace
+    from colliding with that used by other libraries pulled in
+    by extensions or by embedding perl.  Allow a cc -DNO_EMBED
+    override, however, to keep binary compatability with previous
+    versions of perl.
+*/
+
+
 /* Put interpreter-specific symbols into a struct? */
 
 #ifdef MULTIPLICITY
 
+#ifndef USE_THREADS
+/* If we do not have threads then per-thread vars are per-interpreter */
+
 END
 
-for $sym (sort keys %interp) {
-    print EM multon($sym);
+for $sym (sort keys %thread) {
+    print EM multon($sym,'T','curinterp');
+}
+
+print EM <<'END';
+
+#endif /* !USE_THREADS */
+
+/* These are always per-interpreter if there is more than one */
+
+END
+
+for $sym (sort keys %intrp) {
+    print EM multon($sym,'I','curinterp');
 }
 
 print EM <<'END';
@@ -91,25 +177,64 @@ print EM <<'END';
 
 END
 
-for $sym (sort keys %interp) {
-    print EM multoff($sym);
+for $sym (sort keys %intrp) {
+    print EM multoff($sym,'I');
 }
 
 print EM <<'END';
 
-/* Hide interpreter-specific symbols? */
+#ifndef USE_THREADS
+
+END
+
+for $sym (sort keys %thread) {
+    print EM multoff($sym,'T');
+}
+
+print EM <<'END';
+
+#endif /* USE_THREADS */
+
+/* Hide what would have been interpreter-specific symbols? */
 
 #ifdef EMBED
 
 END
 
-for $sym (sort keys %interp) {
+for $sym (sort keys %intrp) {
+    print EM embed($sym);
+}
+
+print EM <<'END';
+
+#ifndef USE_THREADS
+
+END
+
+for $sym (sort keys %thread) {
     print EM embed($sym);
 }
 
 print EM <<'END';
 
+#endif /* USE_THREADS */
 #endif /* EMBED */
 #endif /* MULTIPLICITY */
+
+/* Now same trickey for per-thread variables */
+
+#ifdef USE_THREADS
+
+END
+
+for $sym (sort keys %thread) {
+    print EM multon($sym,'T','thr');
+}
+
+print EM <<'END';
+
+#endif /* USE_THREADS */
+
 END
 
+close(EM);
\ No newline at end of file
diff --git a/embedvar.h b/embedvar.h
new file mode 100644 (file)
index 0000000..b68624a
--- /dev/null
@@ -0,0 +1,609 @@
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+   This file is built by embed.pl from global.sym, intrpvar.h,
+   and thrdvar.h.  Any changes made here will be lost!
+*/
+
+/* (Doing namespace management portably in C is really gross.) */
+
+/*  EMBED has no run-time penalty, but helps keep the Perl namespace
+    from colliding with that used by other libraries pulled in
+    by extensions or by embedding perl.  Allow a cc -DNO_EMBED
+    override, however, to keep binary compatability with previous
+    versions of perl.
+*/
+
+
+/* Put interpreter-specific symbols into a struct? */
+
+#ifdef MULTIPLICITY
+
+#ifndef USE_THREADS
+/* If we do not have threads then per-thread vars are per-interpreter */
+
+#define Sv                     (curinterp->TSv)
+#define Xpv                    (curinterp->TXpv)
+#define bodytarget             (curinterp->Tbodytarget)
+#define chopset                        (curinterp->Tchopset)
+#define curcop                 (curinterp->Tcurcop)
+#define curpad                 (curinterp->Tcurpad)
+#define curpm                  (curinterp->Tcurpm)
+#define curstack               (curinterp->Tcurstack)
+#define curstash               (curinterp->Tcurstash)
+#define cxstack                        (curinterp->Tcxstack)
+#define cxstack_ix             (curinterp->Tcxstack_ix)
+#define cxstack_max            (curinterp->Tcxstack_max)
+#define defoutgv               (curinterp->Tdefoutgv)
+#define defstash               (curinterp->Tdefstash)
+#define delaymagic             (curinterp->Tdelaymagic)
+#define dirty                  (curinterp->Tdirty)
+#define formtarget             (curinterp->Tformtarget)
+#define in_eval                        (curinterp->Tin_eval)
+#define last_in_gv             (curinterp->Tlast_in_gv)
+#define localizing             (curinterp->Tlocalizing)
+#define mainstack              (curinterp->Tmainstack)
+#define markstack              (curinterp->Tmarkstack)
+#define markstack_max          (curinterp->Tmarkstack_max)
+#define markstack_ptr          (curinterp->Tmarkstack_ptr)
+#define nrs                    (curinterp->Tnrs)
+#define ofs                    (curinterp->Tofs)
+#define ofslen                 (curinterp->Tofslen)
+#define op                     (curinterp->Top)
+#define opsave                 (curinterp->Topsave)
+#define restartop              (curinterp->Trestartop)
+#define retstack               (curinterp->Tretstack)
+#define retstack_ix            (curinterp->Tretstack_ix)
+#define retstack_max           (curinterp->Tretstack_max)
+#define rs                     (curinterp->Trs)
+#define savestack              (curinterp->Tsavestack)
+#define savestack_ix           (curinterp->Tsavestack_ix)
+#define savestack_max          (curinterp->Tsavestack_max)
+#define scopestack             (curinterp->Tscopestack)
+#define scopestack_ix          (curinterp->Tscopestack_ix)
+#define scopestack_max         (curinterp->Tscopestack_max)
+#define stack_base             (curinterp->Tstack_base)
+#define stack_max              (curinterp->Tstack_max)
+#define stack_sp               (curinterp->Tstack_sp)
+#define start_env              (curinterp->Tstart_env)
+#define statbuf                        (curinterp->Tstatbuf)
+#define tainted                        (curinterp->Ttainted)
+#define timesbuf               (curinterp->Ttimesbuf)
+#define tmps_floor             (curinterp->Ttmps_floor)
+#define tmps_ix                        (curinterp->Ttmps_ix)
+#define tmps_max               (curinterp->Ttmps_max)
+#define tmps_stack             (curinterp->Ttmps_stack)
+#define top_env                        (curinterp->Ttop_env)
+#define toptarget              (curinterp->Ttoptarget)
+
+#endif /* !USE_THREADS */
+
+/* These are always per-interpreter if there is more than one */
+
+#define Argv                   (curinterp->IArgv)
+#define Cmd                    (curinterp->ICmd)
+#define DBgv                   (curinterp->IDBgv)
+#define DBline                 (curinterp->IDBline)
+#define DBsignal               (curinterp->IDBsignal)
+#define DBsingle               (curinterp->IDBsingle)
+#define DBsub                  (curinterp->IDBsub)
+#define DBtrace                        (curinterp->IDBtrace)
+#define ampergv                        (curinterp->Iampergv)
+#define argvgv                 (curinterp->Iargvgv)
+#define argvoutgv              (curinterp->Iargvoutgv)
+#define basetime               (curinterp->Ibasetime)
+#define beginav                        (curinterp->Ibeginav)
+#define cddir                  (curinterp->Icddir)
+#define copline                        (curinterp->Icopline)
+#define curcopdb               (curinterp->Icurcopdb)
+#define curstname              (curinterp->Icurstname)
+#define dbargs                 (curinterp->Idbargs)
+#define debdelim               (curinterp->Idebdelim)
+#define debname                        (curinterp->Idebname)
+#define debstash               (curinterp->Idebstash)
+#define defgv                  (curinterp->Idefgv)
+#define diehook                        (curinterp->Idiehook)
+#define dlevel                 (curinterp->Idlevel)
+#define dlmax                  (curinterp->Idlmax)
+#define doextract              (curinterp->Idoextract)
+#define doswitches             (curinterp->Idoswitches)
+#define dowarn                 (curinterp->Idowarn)
+#define dumplvl                        (curinterp->Idumplvl)
+#define e_fp                   (curinterp->Ie_fp)
+#define e_tmpname              (curinterp->Ie_tmpname)
+#define endav                  (curinterp->Iendav)
+#define envgv                  (curinterp->Ienvgv)
+#define errgv                  (curinterp->Ierrgv)
+#define eval_root              (curinterp->Ieval_root)
+#define eval_start             (curinterp->Ieval_start)
+#define fdpid                  (curinterp->Ifdpid)
+#define filemode               (curinterp->Ifilemode)
+#define firstgv                        (curinterp->Ifirstgv)
+#define forkprocess            (curinterp->Iforkprocess)
+#define formfeed               (curinterp->Iformfeed)
+#define gensym                 (curinterp->Igensym)
+#define globalstash            (curinterp->Iglobalstash)
+#define incgv                  (curinterp->Iincgv)
+#define initav                 (curinterp->Iinitav)
+#define inplace                        (curinterp->Iinplace)
+#define lastfd                 (curinterp->Ilastfd)
+#define lastscream             (curinterp->Ilastscream)
+#define lastsize               (curinterp->Ilastsize)
+#define lastspbase             (curinterp->Ilastspbase)
+#define laststatval            (curinterp->Ilaststatval)
+#define laststype              (curinterp->Ilaststype)
+#define leftgv                 (curinterp->Ileftgv)
+#define lineary                        (curinterp->Ilineary)
+#define localpatches           (curinterp->Ilocalpatches)
+#define main_cv                        (curinterp->Imain_cv)
+#define main_root              (curinterp->Imain_root)
+#define main_start             (curinterp->Imain_start)
+#define maxscream              (curinterp->Imaxscream)
+#define maxsysfd               (curinterp->Imaxsysfd)
+#define mess_sv                        (curinterp->Imess_sv)
+#define minus_F                        (curinterp->Iminus_F)
+#define minus_a                        (curinterp->Iminus_a)
+#define minus_c                        (curinterp->Iminus_c)
+#define minus_l                        (curinterp->Iminus_l)
+#define minus_n                        (curinterp->Iminus_n)
+#define minus_p                        (curinterp->Iminus_p)
+#define multiline              (curinterp->Imultiline)
+#define mystrk                 (curinterp->Imystrk)
+#define ofmt                   (curinterp->Iofmt)
+#define oldlastpm              (curinterp->Ioldlastpm)
+#define oldname                        (curinterp->Ioldname)
+#define op_mask                        (curinterp->Iop_mask)
+#define origargc               (curinterp->Iorigargc)
+#define origargv               (curinterp->Iorigargv)
+#define origfilename           (curinterp->Iorigfilename)
+#define ors                    (curinterp->Iors)
+#define orslen                 (curinterp->Iorslen)
+#define parsehook              (curinterp->Iparsehook)
+#define patchlevel             (curinterp->Ipatchlevel)
+#define perl_destruct_level    (curinterp->Iperl_destruct_level)
+#define perldb                 (curinterp->Iperldb)
+#define preambleav             (curinterp->Ipreambleav)
+#define preambled              (curinterp->Ipreambled)
+#define preprocess             (curinterp->Ipreprocess)
+#define rightgv                        (curinterp->Irightgv)
+#define sawampersand           (curinterp->Isawampersand)
+#define sawstudy               (curinterp->Isawstudy)
+#define sawvec                 (curinterp->Isawvec)
+#define screamfirst            (curinterp->Iscreamfirst)
+#define screamnext             (curinterp->Iscreamnext)
+#define secondgv               (curinterp->Isecondgv)
+#define siggv                  (curinterp->Isiggv)
+#define signalstack            (curinterp->Isignalstack)
+#define sortcop                        (curinterp->Isortcop)
+#define sortstack              (curinterp->Isortstack)
+#define sortstash              (curinterp->Isortstash)
+#define splitstr               (curinterp->Isplitstr)
+#define statcache              (curinterp->Istatcache)
+#define statgv                 (curinterp->Istatgv)
+#define statname               (curinterp->Istatname)
+#define statusvalue            (curinterp->Istatusvalue)
+#define statusvalue_vms                (curinterp->Istatusvalue_vms)
+#define stdingv                        (curinterp->Istdingv)
+#define strchop                        (curinterp->Istrchop)
+#define strtab                 (curinterp->Istrtab)
+#define sv_arenaroot           (curinterp->Isv_arenaroot)
+#define sv_count               (curinterp->Isv_count)
+#define sv_objcount            (curinterp->Isv_objcount)
+#define sv_root                        (curinterp->Isv_root)
+#define tainting               (curinterp->Itainting)
+#define thrsv                  (curinterp->Ithrsv)
+#define unsafe                 (curinterp->Iunsafe)
+#define warnhook               (curinterp->Iwarnhook)
+
+#else  /* !MULTIPLICITY */
+
+#define IArgv                  Argv
+#define ICmd                   Cmd
+#define IDBgv                  DBgv
+#define IDBline                        DBline
+#define IDBsignal              DBsignal
+#define IDBsingle              DBsingle
+#define IDBsub                 DBsub
+#define IDBtrace               DBtrace
+#define Iampergv               ampergv
+#define Iargvgv                        argvgv
+#define Iargvoutgv             argvoutgv
+#define Ibasetime              basetime
+#define Ibeginav               beginav
+#define Icddir                 cddir
+#define Icopline               copline
+#define Icurcopdb              curcopdb
+#define Icurstname             curstname
+#define Idbargs                        dbargs
+#define Idebdelim              debdelim
+#define Idebname               debname
+#define Idebstash              debstash
+#define Idefgv                 defgv
+#define Idiehook               diehook
+#define Idlevel                        dlevel
+#define Idlmax                 dlmax
+#define Idoextract             doextract
+#define Idoswitches            doswitches
+#define Idowarn                        dowarn
+#define Idumplvl               dumplvl
+#define Ie_fp                  e_fp
+#define Ie_tmpname             e_tmpname
+#define Iendav                 endav
+#define Ienvgv                 envgv
+#define Ierrgv                 errgv
+#define Ieval_root             eval_root
+#define Ieval_start            eval_start
+#define Ifdpid                 fdpid
+#define Ifilemode              filemode
+#define Ifirstgv               firstgv
+#define Iforkprocess           forkprocess
+#define Iformfeed              formfeed
+#define Igensym                        gensym
+#define Iglobalstash           globalstash
+#define Iincgv                 incgv
+#define Iinitav                        initav
+#define Iinplace               inplace
+#define Ilastfd                        lastfd
+#define Ilastscream            lastscream
+#define Ilastsize              lastsize
+#define Ilastspbase            lastspbase
+#define Ilaststatval           laststatval
+#define Ilaststype             laststype
+#define Ileftgv                        leftgv
+#define Ilineary               lineary
+#define Ilocalpatches          localpatches
+#define Imain_cv               main_cv
+#define Imain_root             main_root
+#define Imain_start            main_start
+#define Imaxscream             maxscream
+#define Imaxsysfd              maxsysfd
+#define Imess_sv               mess_sv
+#define Iminus_F               minus_F
+#define Iminus_a               minus_a
+#define Iminus_c               minus_c
+#define Iminus_l               minus_l
+#define Iminus_n               minus_n
+#define Iminus_p               minus_p
+#define Imultiline             multiline
+#define Imystrk                        mystrk
+#define Iofmt                  ofmt
+#define Ioldlastpm             oldlastpm
+#define Ioldname               oldname
+#define Iop_mask               op_mask
+#define Iorigargc              origargc
+#define Iorigargv              origargv
+#define Iorigfilename          origfilename
+#define Iors                   ors
+#define Iorslen                        orslen
+#define Iparsehook             parsehook
+#define Ipatchlevel            patchlevel
+#define Iperl_destruct_level   perl_destruct_level
+#define Iperldb                        perldb
+#define Ipreambleav            preambleav
+#define Ipreambled             preambled
+#define Ipreprocess            preprocess
+#define Irightgv               rightgv
+#define Isawampersand          sawampersand
+#define Isawstudy              sawstudy
+#define Isawvec                        sawvec
+#define Iscreamfirst           screamfirst
+#define Iscreamnext            screamnext
+#define Isecondgv              secondgv
+#define Isiggv                 siggv
+#define Isignalstack           signalstack
+#define Isortcop               sortcop
+#define Isortstack             sortstack
+#define Isortstash             sortstash
+#define Isplitstr              splitstr
+#define Istatcache             statcache
+#define Istatgv                        statgv
+#define Istatname              statname
+#define Istatusvalue           statusvalue
+#define Istatusvalue_vms       statusvalue_vms
+#define Istdingv               stdingv
+#define Istrchop               strchop
+#define Istrtab                        strtab
+#define Isv_arenaroot          sv_arenaroot
+#define Isv_count              sv_count
+#define Isv_objcount           sv_objcount
+#define Isv_root               sv_root
+#define Itainting              tainting
+#define Ithrsv                 thrsv
+#define Iunsafe                        unsafe
+#define Iwarnhook              warnhook
+
+#ifndef USE_THREADS
+
+#define TSv                    Sv
+#define TXpv                   Xpv
+#define Tbodytarget            bodytarget
+#define Tchopset               chopset
+#define Tcurcop                        curcop
+#define Tcurpad                        curpad
+#define Tcurpm                 curpm
+#define Tcurstack              curstack
+#define Tcurstash              curstash
+#define Tcxstack               cxstack
+#define Tcxstack_ix            cxstack_ix
+#define Tcxstack_max           cxstack_max
+#define Tdefoutgv              defoutgv
+#define Tdefstash              defstash
+#define Tdelaymagic            delaymagic
+#define Tdirty                 dirty
+#define Tformtarget            formtarget
+#define Tin_eval               in_eval
+#define Tlast_in_gv            last_in_gv
+#define Tlocalizing            localizing
+#define Tmainstack             mainstack
+#define Tmarkstack             markstack
+#define Tmarkstack_max         markstack_max
+#define Tmarkstack_ptr         markstack_ptr
+#define Tnrs                   nrs
+#define Tofs                   ofs
+#define Tofslen                        ofslen
+#define Top                    op
+#define Topsave                        opsave
+#define Trestartop             restartop
+#define Tretstack              retstack
+#define Tretstack_ix           retstack_ix
+#define Tretstack_max          retstack_max
+#define Trs                    rs
+#define Tsavestack             savestack
+#define Tsavestack_ix          savestack_ix
+#define Tsavestack_max         savestack_max
+#define Tscopestack            scopestack
+#define Tscopestack_ix         scopestack_ix
+#define Tscopestack_max                scopestack_max
+#define Tstack_base            stack_base
+#define Tstack_max             stack_max
+#define Tstack_sp              stack_sp
+#define Tstart_env             start_env
+#define Tstatbuf               statbuf
+#define Ttainted               tainted
+#define Ttimesbuf              timesbuf
+#define Ttmps_floor            tmps_floor
+#define Ttmps_ix               tmps_ix
+#define Ttmps_max              tmps_max
+#define Ttmps_stack            tmps_stack
+#define Ttop_env               top_env
+#define Ttoptarget             toptarget
+
+#endif /* USE_THREADS */
+
+/* Hide what would have been interpreter-specific symbols? */
+
+#ifdef EMBED
+
+#define Argv                   Perl_Argv
+#define Cmd                    Perl_Cmd
+#define DBgv                   Perl_DBgv
+#define DBline                 Perl_DBline
+#define DBsignal               Perl_DBsignal
+#define DBsingle               Perl_DBsingle
+#define DBsub                  Perl_DBsub
+#define DBtrace                        Perl_DBtrace
+#define ampergv                        Perl_ampergv
+#define argvgv                 Perl_argvgv
+#define argvoutgv              Perl_argvoutgv
+#define basetime               Perl_basetime
+#define beginav                        Perl_beginav
+#define cddir                  Perl_cddir
+#define copline                        Perl_copline
+#define curcopdb               Perl_curcopdb
+#define curstname              Perl_curstname
+#define dbargs                 Perl_dbargs
+#define debdelim               Perl_debdelim
+#define debname                        Perl_debname
+#define debstash               Perl_debstash
+#define defgv                  Perl_defgv
+#define diehook                        Perl_diehook
+#define dlevel                 Perl_dlevel
+#define dlmax                  Perl_dlmax
+#define doextract              Perl_doextract
+#define doswitches             Perl_doswitches
+#define dowarn                 Perl_dowarn
+#define dumplvl                        Perl_dumplvl
+#define e_fp                   Perl_e_fp
+#define e_tmpname              Perl_e_tmpname
+#define endav                  Perl_endav
+#define envgv                  Perl_envgv
+#define errgv                  Perl_errgv
+#define eval_root              Perl_eval_root
+#define eval_start             Perl_eval_start
+#define fdpid                  Perl_fdpid
+#define filemode               Perl_filemode
+#define firstgv                        Perl_firstgv
+#define forkprocess            Perl_forkprocess
+#define formfeed               Perl_formfeed
+#define gensym                 Perl_gensym
+#define globalstash            Perl_globalstash
+#define incgv                  Perl_incgv
+#define initav                 Perl_initav
+#define inplace                        Perl_inplace
+#define lastfd                 Perl_lastfd
+#define lastscream             Perl_lastscream
+#define lastsize               Perl_lastsize
+#define lastspbase             Perl_lastspbase
+#define laststatval            Perl_laststatval
+#define laststype              Perl_laststype
+#define leftgv                 Perl_leftgv
+#define lineary                        Perl_lineary
+#define localpatches           Perl_localpatches
+#define main_cv                        Perl_main_cv
+#define main_root              Perl_main_root
+#define main_start             Perl_main_start
+#define maxscream              Perl_maxscream
+#define maxsysfd               Perl_maxsysfd
+#define mess_sv                        Perl_mess_sv
+#define minus_F                        Perl_minus_F
+#define minus_a                        Perl_minus_a
+#define minus_c                        Perl_minus_c
+#define minus_l                        Perl_minus_l
+#define minus_n                        Perl_minus_n
+#define minus_p                        Perl_minus_p
+#define multiline              Perl_multiline
+#define mystrk                 Perl_mystrk
+#define ofmt                   Perl_ofmt
+#define oldlastpm              Perl_oldlastpm
+#define oldname                        Perl_oldname
+#define op_mask                        Perl_op_mask
+#define origargc               Perl_origargc
+#define origargv               Perl_origargv
+#define origfilename           Perl_origfilename
+#define ors                    Perl_ors
+#define orslen                 Perl_orslen
+#define parsehook              Perl_parsehook
+#define patchlevel             Perl_patchlevel
+#define perl_destruct_level    Perl_perl_destruct_level
+#define perldb                 Perl_perldb
+#define preambleav             Perl_preambleav
+#define preambled              Perl_preambled
+#define preprocess             Perl_preprocess
+#define rightgv                        Perl_rightgv
+#define sawampersand           Perl_sawampersand
+#define sawstudy               Perl_sawstudy
+#define sawvec                 Perl_sawvec
+#define screamfirst            Perl_screamfirst
+#define screamnext             Perl_screamnext
+#define secondgv               Perl_secondgv
+#define siggv                  Perl_siggv
+#define signalstack            Perl_signalstack
+#define sortcop                        Perl_sortcop
+#define sortstack              Perl_sortstack
+#define sortstash              Perl_sortstash
+#define splitstr               Perl_splitstr
+#define statcache              Perl_statcache
+#define statgv                 Perl_statgv
+#define statname               Perl_statname
+#define statusvalue            Perl_statusvalue
+#define statusvalue_vms                Perl_statusvalue_vms
+#define stdingv                        Perl_stdingv
+#define strchop                        Perl_strchop
+#define strtab                 Perl_strtab
+#define sv_arenaroot           Perl_sv_arenaroot
+#define sv_count               Perl_sv_count
+#define sv_objcount            Perl_sv_objcount
+#define sv_root                        Perl_sv_root
+#define tainting               Perl_tainting
+#define thrsv                  Perl_thrsv
+#define unsafe                 Perl_unsafe
+#define warnhook               Perl_warnhook
+
+#ifndef USE_THREADS
+
+#define Sv                     Perl_Sv
+#define Xpv                    Perl_Xpv
+#define bodytarget             Perl_bodytarget
+#define chopset                        Perl_chopset
+#define curcop                 Perl_curcop
+#define curpad                 Perl_curpad
+#define curpm                  Perl_curpm
+#define curstack               Perl_curstack
+#define curstash               Perl_curstash
+#define cxstack                        Perl_cxstack
+#define cxstack_ix             Perl_cxstack_ix
+#define cxstack_max            Perl_cxstack_max
+#define defoutgv               Perl_defoutgv
+#define defstash               Perl_defstash
+#define delaymagic             Perl_delaymagic
+#define dirty                  Perl_dirty
+#define formtarget             Perl_formtarget
+#define in_eval                        Perl_in_eval
+#define last_in_gv             Perl_last_in_gv
+#define localizing             Perl_localizing
+#define mainstack              Perl_mainstack
+#define markstack              Perl_markstack
+#define markstack_max          Perl_markstack_max
+#define markstack_ptr          Perl_markstack_ptr
+#define nrs                    Perl_nrs
+#define ofs                    Perl_ofs
+#define ofslen                 Perl_ofslen
+#define op                     Perl_op
+#define opsave                 Perl_opsave
+#define restartop              Perl_restartop
+#define retstack               Perl_retstack
+#define retstack_ix            Perl_retstack_ix
+#define retstack_max           Perl_retstack_max
+#define rs                     Perl_rs
+#define savestack              Perl_savestack
+#define savestack_ix           Perl_savestack_ix
+#define savestack_max          Perl_savestack_max
+#define scopestack             Perl_scopestack
+#define scopestack_ix          Perl_scopestack_ix
+#define scopestack_max         Perl_scopestack_max
+#define stack_base             Perl_stack_base
+#define stack_max              Perl_stack_max
+#define stack_sp               Perl_stack_sp
+#define start_env              Perl_start_env
+#define statbuf                        Perl_statbuf
+#define tainted                        Perl_tainted
+#define timesbuf               Perl_timesbuf
+#define tmps_floor             Perl_tmps_floor
+#define tmps_ix                        Perl_tmps_ix
+#define tmps_max               Perl_tmps_max
+#define tmps_stack             Perl_tmps_stack
+#define top_env                        Perl_top_env
+#define toptarget              Perl_toptarget
+
+#endif /* USE_THREADS */
+#endif /* EMBED */
+#endif /* MULTIPLICITY */
+
+/* Now same trickey for per-thread variables */
+
+#ifdef USE_THREADS
+
+#define Sv                     (thr->TSv)
+#define Xpv                    (thr->TXpv)
+#define bodytarget             (thr->Tbodytarget)
+#define chopset                        (thr->Tchopset)
+#define curcop                 (thr->Tcurcop)
+#define curpad                 (thr->Tcurpad)
+#define curpm                  (thr->Tcurpm)
+#define curstack               (thr->Tcurstack)
+#define curstash               (thr->Tcurstash)
+#define cxstack                        (thr->Tcxstack)
+#define cxstack_ix             (thr->Tcxstack_ix)
+#define cxstack_max            (thr->Tcxstack_max)
+#define defoutgv               (thr->Tdefoutgv)
+#define defstash               (thr->Tdefstash)
+#define delaymagic             (thr->Tdelaymagic)
+#define dirty                  (thr->Tdirty)
+#define formtarget             (thr->Tformtarget)
+#define in_eval                        (thr->Tin_eval)
+#define last_in_gv             (thr->Tlast_in_gv)
+#define localizing             (thr->Tlocalizing)
+#define mainstack              (thr->Tmainstack)
+#define markstack              (thr->Tmarkstack)
+#define markstack_max          (thr->Tmarkstack_max)
+#define markstack_ptr          (thr->Tmarkstack_ptr)
+#define nrs                    (thr->Tnrs)
+#define ofs                    (thr->Tofs)
+#define ofslen                 (thr->Tofslen)
+#define op                     (thr->Top)
+#define opsave                 (thr->Topsave)
+#define restartop              (thr->Trestartop)
+#define retstack               (thr->Tretstack)
+#define retstack_ix            (thr->Tretstack_ix)
+#define retstack_max           (thr->Tretstack_max)
+#define rs                     (thr->Trs)
+#define savestack              (thr->Tsavestack)
+#define savestack_ix           (thr->Tsavestack_ix)
+#define savestack_max          (thr->Tsavestack_max)
+#define scopestack             (thr->Tscopestack)
+#define scopestack_ix          (thr->Tscopestack_ix)
+#define scopestack_max         (thr->Tscopestack_max)
+#define stack_base             (thr->Tstack_base)
+#define stack_max              (thr->Tstack_max)
+#define stack_sp               (thr->Tstack_sp)
+#define start_env              (thr->Tstart_env)
+#define statbuf                        (thr->Tstatbuf)
+#define tainted                        (thr->Ttainted)
+#define timesbuf               (thr->Ttimesbuf)
+#define tmps_floor             (thr->Ttmps_floor)
+#define tmps_ix                        (thr->Ttmps_ix)
+#define tmps_max               (thr->Ttmps_max)
+#define tmps_stack             (thr->Ttmps_stack)
+#define top_env                        (thr->Ttop_env)
+#define toptarget              (thr->Ttoptarget)
+
+#endif /* USE_THREADS */
+
index 0298c96..6e97660 100644 (file)
@@ -7,8 +7,6 @@ threads_mutex
 AMG_names
 Error
 No
-Sv
-Xpv
 Yes
 abs_amg
 add_amg
@@ -45,7 +43,6 @@ cryptseen
 cshlen
 cshname
 curinterp
-curpad
 dc
 debug
 dec_amg
@@ -103,9 +100,6 @@ log_amg
 lshift_amg
 lshift_ass_amg
 lt_amg
-markstack
-markstack_max
-markstack_ptr
 max_intro_pending
 maxo
 min_intro_pending
@@ -151,12 +145,10 @@ numeric_standard
 numer_amg
 oldbufptr
 oldoldbufptr
-op
 op_desc
 op_name
 op_seqmax
 opargs
-opsave
 origalen
 origenviron
 osname
@@ -180,9 +172,6 @@ regnext
 regprop
 repeat_amg
 repeat_ass_amg
-retstack
-retstack_ix
-retstack_max
 rsfp
 rsfp_filters
 rshift_amg
@@ -190,14 +179,8 @@ rshift_ass_amg
 runops
 runops_debug
 runops_standard
-savestack
-savestack_ix
-savestack_max
 saw_return
 scmp_amg
-scopestack
-scopestack_ix
-scopestack_max
 scrgv
 seq_amg
 sge_amg
@@ -211,10 +194,6 @@ sle_amg
 slt_amg
 sne_amg
 sqrt_amg
-stack_base
-stack_max
-stack_sp
-statbuf
 string_amg
 sub_generation
 subline
@@ -227,7 +206,6 @@ sv_yes
 thisexpr
 threadsv_names
 thr_key
-timesbuf
 tokenbuf
 uid
 varies
@@ -253,6 +231,7 @@ vtbl_nkeys
 vtbl_pack
 vtbl_packelem
 vtbl_pos
+vtbl_regexp
 vtbl_sig
 vtbl_sigelem
 vtbl_substr
@@ -427,6 +406,9 @@ dump_op
 dump_packsubs
 dump_pm
 dump_sub
+eval_cond
+eval_mutex
+eval_owner
 fbm_compile
 fbm_instr
 fetch_gv
@@ -1123,6 +1105,7 @@ sv_isobject
 sv_len
 sv_magic
 sv_mortalcopy
+sv_mutex
 sv_newmortal
 sv_newref
 sv_peek
index f50711b..e95a916 100644 (file)
@@ -6,7 +6,6 @@ DBsignal
 DBsingle
 DBsub
 DBtrace
-allgvs
 ampergv
 argvgv
 argvoutgv
@@ -16,10 +15,8 @@ bodytarget
 cddir
 chopset
 copline
-curblock
 curcop
 curcopdb
-curcsv
 curpm
 curstack
 curstash
@@ -64,7 +61,6 @@ initav
 inplace
 last_in_gv
 lastfd
-lastretstr
 lastscream
 lastsize
 lastspbase
index 0393b8f..b724e41 100644 (file)
@@ -5,19 +5,17 @@
 /* pseudo environmental stuff */
 PERLVAR(Iorigargc,     int)            
 PERLVAR(Iorigargv,     char **)                
-PERLVAR(Ienvgv,        GV *)           
-PERLVAR(Isiggv,        GV *)           
-PERLVAR(Iincgv,        GV *)           
+PERLVAR(Ienvgv,                GV *)           
+PERLVAR(Isiggv,                GV *)           
+PERLVAR(Iincgv,                GV *)           
 PERLVAR(Iorigfilename, char *)         
 PERLVAR(Idiehook,      SV *)           
 PERLVAR(Iwarnhook,     SV *)           
 PERLVAR(Iparsehook,    SV *)           
-/* switches */
-PERLVAR(Icddir,        char *)         
+PERLVAR(Icddir,                char *)         /* switches */
 PERLVAR(Iminus_c,      bool)           
-PERLVAR(Ipatchlevel[10],       char)           
+PERLVAR(Ipatchlevel[10],char)          
 PERLVAR(Ilocalpatches, char **)                
-PERLVAR(Inrs,  SV *)           
 PERLVARI(Isplitstr,    char *, " ")    
 PERLVAR(Ipreprocess,   bool)           
 PERLVAR(Iminus_n,      bool)           
@@ -34,21 +32,18 @@ PERLVAR(Isawvec,    bool)
 PERLVAR(Iunsafe,       bool)           
 PERLVAR(Iinplace,      char *)         
 PERLVAR(Ie_tmpname,    char *)         
-PERLVAR(Ie_fp, PerlIO *)               
+PERLVAR(Ie_fp,         PerlIO *)               
 PERLVAR(Iperldb,       U32)            
-       /* This value may be raised by extensions for testing purposes */
-PERLVARI(Iperl_destruct_level, int,    0)      /* 0=none, 1=full, 2=full with checks */
+
+/* This value may be raised by extensions for testing purposes */
+/* 0=none, 1=full, 2=full with checks */
+PERLVARI(Iperl_destruct_level, int,    0)      
 
 /* magical thingies */
 PERLVAR(Ibasetime,     Time_t)         /* $^T */
 PERLVAR(Iformfeed,     SV *)           /* $^L */
-PERLVARI(Ichopset,     char *, " \n-") /* $: */
-PERLVAR(Irs,   SV *)           /* $/ */
-PERLVAR(Iofs,  char *)         /* $, */
-PERLVAR(Iofslen,       STRLEN)         
-PERLVAR(Iors,  char *)         /* $\ */
-PERLVAR(Iorslen,       STRLEN)         
-PERLVAR(Iofmt, char *)         /* $# */
+
+
 PERLVARI(Imaxsysfd,    I32,    MAXSYSFD)       /* top fd to pass to subprocesses */
 PERLVAR(Imultiline,    int)            /* $*--do strings hold >1 line? */
 PERLVAR(Istatusvalue,  I32)            /* $? */
@@ -56,35 +51,32 @@ PERLVAR(Istatusvalue,       I32)            /* $? */
 PERLVAR(Istatusvalue_vms,      U32)            
 #endif
 
-PERLVAR(Istatcache,    struct stat)            /* _ */
+PERLVAR(Istatcache,    struct stat)    /* _ */
 PERLVAR(Istatgv,       GV *)           
 PERLVARI(Istatname,    SV *,   Nullsv) 
 
 /* shortcuts to various I/O objects */
 PERLVAR(Istdingv,      GV *)           
-PERLVAR(Ilast_in_gv,   GV *)           
-PERLVAR(Idefgv,        GV *)           
+PERLVAR(Idefgv,                GV *)           
 PERLVAR(Iargvgv,       GV *)           
-PERLVAR(Idefoutgv,     GV *)           
 PERLVAR(Iargvoutgv,    GV *)           
 
 /* shortcuts to regexp stuff */
 PERLVAR(Ileftgv,       GV *)           
 PERLVAR(Iampergv,      GV *)           
 PERLVAR(Irightgv,      GV *)           
-PERLVAR(Icurpm,        PMOP *)         /* what to do \ interps from */
 PERLVAR(Iscreamfirst,  I32 *)          
 PERLVAR(Iscreamnext,   I32 *)          
 PERLVARI(Imaxscream,   I32,    -1)     
 PERLVAR(Ilastscream,   SV *)           
 
 /* shortcuts to misc objects */
-PERLVAR(Ierrgv,        GV *)           
+PERLVAR(Ierrgv,                GV *)           
 
 /* shortcuts to debugging objects */
-PERLVAR(IDBgv, GV *)           
+PERLVAR(IDBgv,         GV *)           
 PERLVAR(IDBline,       GV *)           
-PERLVAR(IDBsub,        GV *)           
+PERLVAR(IDBsub,                GV *)           
 PERLVAR(IDBsingle,     SV *)           
 PERLVAR(IDBtrace,      SV *)           
 PERLVAR(IDBsignal,     SV *)           
@@ -92,21 +84,15 @@ PERLVAR(Ilineary,   AV *)           /* lines of script for debugger */
 PERLVAR(Idbargs,       AV *)           /* args to call listed by caller function */
 
 /* symbol tables */
-PERLVAR(Idefstash,     HV *)           /* main symbol table */
-PERLVAR(Icurstash,     HV *)           /* symbol table for current package */
 PERLVAR(Idebstash,     HV *)           /* symbol table for perldb package */
 PERLVAR(Iglobalstash,  HV *)           /* global keyword overrides imported here */
 PERLVAR(Icurstname,    SV *)           /* name of current package */
 PERLVAR(Ibeginav,      AV *)           /* names of BEGIN subroutines */
-PERLVAR(Iendav,        AV *)           /* names of END subroutines */
+PERLVAR(Iendav,                AV *)           /* names of END subroutines */
 PERLVAR(Iinitav,       AV *)           /* names of INIT subroutines */
 PERLVAR(Istrtab,       HV *)           /* shared string table */
 
 /* memory management */
-PERLVAR(Itmps_stack,   SV **)          
-PERLVARI(Itmps_ix,     I32,    -1)     
-PERLVARI(Itmps_floor,  I32,    -1)     
-PERLVAR(Itmps_max,     I32)            
 PERLVAR(Isv_count,     I32)            /* how many SV* are currently allocated */
 PERLVAR(Isv_objcount,  I32)            /* how many objects are currently allocated */
 PERLVAR(Isv_root,      SV*)            /* storage for SVs belonging to interp */
@@ -118,15 +104,9 @@ PERLVAR(Ilastsize, I32)
 PERLVAR(Iforkprocess,  int)            /* so do_open |- can return proc# */
 
 /* subprocess state */
-PERLVAR(Ifdpid,        AV *)           /* keep fd-to-pid mappings for my_popen */
+PERLVAR(Ifdpid,                AV *)           /* keep fd-to-pid mappings for my_popen */
 
 /* internal state */
-PERLVAR(Iin_eval,      VOL int)                /* trap "fatal" errors? */
-PERLVAR(Irestartop,    OP *)           /* Are we propagating an error from croak? */
-PERLVAR(Idelaymagic,   int)            /* ($<,$>) = ... */
-PERLVAR(Idirty,        bool)           /* In the middle of tearing things down? */
-PERLVAR(Ilocalizing,   U8)             /* are we processing a local() list? */
-PERLVAR(Itainted,      bool)           /* using variables controlled by $< */
 PERLVAR(Itainting,     bool)           /* doing taint checks */
 PERLVARI(Iop_mask,     char *, NULL)   /* masked operations for safe evals */
 
@@ -144,31 +124,16 @@ PERLVAR(Ieval_root,       OP *)
 PERLVAR(Ieval_start,   OP *)           
 
 /* runtime control stuff */
-PERLVARI(Icurcop,      COP * VOL,      &compiling)     
 PERLVARI(Icurcopdb,    COP *,  NULL)   
 PERLVARI(Icopline,     line_t, NOLINE) 
-PERLVAR(Icxstack,      PERL_CONTEXT *)         
-PERLVARI(Icxstack_ix,  I32,    -1)     
-PERLVARI(Icxstack_max, I32,    128)    
-PERLVAR(Istart_env,    JMPENV)         /* empty startup sigjmp() environment */
-PERLVAR(Itop_env,      JMPENV *)               /* ptr. to current sigjmp() environment */
-
-/* stack stuff */
-PERLVAR(Icurstack,     AV *)           /* THE STACK */
-PERLVAR(Imainstack,    AV *)           /* the stack when nothing funny is happening */
-
-/* format accumulators */
-PERLVAR(Iformtarget,   SV *)           
-PERLVAR(Ibodytarget,   SV *)           
-PERLVAR(Itoptarget,    SV *)           
 
 /* statics moved here for shared library purposes */
 PERLVAR(Istrchop,      SV)             /* return value from chop */
 PERLVAR(Ifilemode,     int)            /* so nextargv() can preserve mode */
 PERLVAR(Ilastfd,       int)            /* what to preserve mode on */
 PERLVAR(Ioldname,      char *)         /* what to preserve mode on */
-PERLVAR(IArgv, char **)                /* stuff to free from do_aexec, vfork safe */
-PERLVAR(ICmd,  char *)         /* stuff to free from do_aexec, vfork safe */
+PERLVAR(IArgv,         char **)        /* stuff to free from do_aexec, vfork safe */
+PERLVAR(ICmd,          char *)         /* stuff to free from do_aexec, vfork safe */
 PERLVAR(Isortcop,      OP *)           /* user defined sort routine */
 PERLVAR(Isortstash,    HV *)           /* which is in some package or other */
 PERLVAR(Ifirstgv,      GV *)           /* $a */
@@ -185,9 +150,10 @@ PERLVARI(Ilaststatval,     int,    -1)
 PERLVARI(Ilaststype,   I32,    OP_STAT)        
 PERLVAR(Imess_sv,      SV *)           
 
+PERLVAR(Iors,          char *)         /* $\ */
+PERLVAR(Iorslen,       STRLEN)         
+PERLVAR(Iofmt,         char *)         /* $# */
+
 #ifdef USE_THREADS
-/* threads stuff */
-PERLVAR(Ithrsv,        SV *)           /* holds struct perl_thread for main thread */
+PERLVAR(Ithrsv,                SV *)           /* holds struct perl_thread for main thread */
 #endif /* USE_THREADS */
-
-
diff --git a/perl.h b/perl.h
index 7761786..c5298fa 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1608,51 +1608,56 @@ typedef enum {
 #define HINT_STRICT_VARS       0x00000400
 #define HINT_LOCALE            0x00000800
 
-
-/***********************************************/
-/* Global only to current interpreter instance */
-/***********************************************/
+/* Various states of an input record separator SV (rs, nrs) */
+#define RsSNARF(sv)   (! SvOK(sv))
+#define RsSIMPLE(sv)  (SvOK(sv) && SvCUR(sv))
+#define RsPARA(sv)    (SvOK(sv) && ! SvCUR(sv))
 
 #ifdef MULTIPLICITY
-#define IEXT
-#define IINIT(x)
+/* If we have multiple interpreters define a struct 
+   holding variables which must be per-interpreter
+   If we don't have threads anything that would have 
+   be per-thread is per-interpreter.
+*/
+
+#define PERLVAR(var,type) type var;
+#define PERLVARI(var,type,init) type var;
+
 struct interpreter {
-#include "interpvar.h"
+#ifndef USE_THREADS
+#include "thrdvar.h"
+#endif
+#include "intrpvar.h"
 };
-#undef IEXT
-#undef IINIT
+
+#undef PERLVAR
+#undef PERLVARI
+
 #else
 struct interpreter {
     char broiled;
 };
 #endif
 
-
-/* Various states of an input record separator SV (rs, nrs) */
-#define RsSNARF(sv)   (! SvOK(sv))
-#define RsSIMPLE(sv)  (SvOK(sv) && SvCUR(sv))
-#define RsPARA(sv)    (SvOK(sv) && ! SvCUR(sv))
-
-/* perlvars needs to be before thread.h until we sort out
-   thread.h's #define stuff
+#ifdef USE_THREADS
+/* If we have threads define a struct with all the variables
+ * that have to be per-thread
  */
-#define PERLVAR(var,type) EXT type var;
-#define PERLVARI(var,type,init) EXT type var INIT(init);
-#include "perlvars.h"
-#undef PERLVAR
-#undef PERLVARI
 
-typedef struct perl_thread *Thread;
-#include "thread.h"
+#define PERLVAR(var,type) type var;
+#define PERLVARI(var,type,init) type var;
 
-#ifdef USE_THREADS
 struct perl_thread {
-#define PERLVAR(var,type) type var;
 #include "thrdvar.h"
-#undef PERLVAR
 };
+
+#undef PERLVAR
+#undef PERLVARI
 #endif
 
+typedef struct perl_thread *Thread;
+#include "thread.h"
+
 #include "pp.h"
 
 START_EXTERN_C
@@ -1667,7 +1672,30 @@ END_EXTERN_C
 #define sv_setptrref(rv,ptr) sv_setref_iv(rv,Nullch,(IV)ptr)
 #endif
 
-/* The following must follow proto.h */
+/* The following must follow proto.h as #defines mess up syntax */
+
+#include "embedvar.h"
+
+/* Now include all the 'global' variables 
+ * If we don't have threads or multiple interpreters
+ * these include variables that would have been their struct-s 
+ */
+
+#define PERLVAR(var,type) EXT type var;
+#define PERLVARI(var,type,init) EXT type var INIT(init);
+
+#include "perlvars.h"
+
+#ifndef MULTIPLICITY
+#include "intrpvar.h"
+#endif
+
+#ifndef USE_THREADS
+#include "thrdvar.h"
+#endif
+
+#undef PERLVAR
+#undef PERLVARI
 
 #if defined(HASATTRIBUTE) && defined(WIN32)
 /*
index 97b199f..e41423e 100644 (file)
@@ -53,6 +53,9 @@ PERLVAR(he_root,      HE *)           /* free he list--shared by interpreters */
 PERLVAR(nice_chunk,    char *)         /* a nice chunk of memory to reuse */
 PERLVAR(nice_chunk_size,       U32)            /* how nice the chunk of memory is */
 
+PERLVARI(runops,       runops_proc_t *,        RUNOPS_DEFAULT) 
+
+#ifndef USE_THREADS
 /* Stack for currently executing thread--context switch must handle this.     */
 PERLVAR(stack_base,    SV **)          /* stack->array_ary */
 PERLVAR(stack_sp,      SV **)          /* stack pointer now */
@@ -65,7 +68,7 @@ PERLVAR(opsave,       OP *)           /* save current op register across longjmps */
 #else
 PERLVAR(op,    OP *)           /* current op--when not in a global register */
 #endif
-PERLVARI(runops,       runops_proc_t *,        RUNOPS_DEFAULT) 
+
 PERLVAR(scopestack,    I32 *)          /* blocks we've entered */
 PERLVAR(scopestack_ix, I32)            
 PERLVAR(scopestack_max,        I32)            
@@ -82,16 +85,22 @@ PERLVAR(markstack,  I32 *)          /* stackmarks we're remembering */
 PERLVAR(markstack_ptr, I32 *)          /* stackmarks we're remembering */
 PERLVAR(markstack_max, I32 *)          /* stackmarks we're remembering */
 
+
+
 PERLVAR(curpad,        SV **)          
 
 /* temp space */
 PERLVAR(Sv,    SV *)           
 PERLVAR(Xpv,   XPV *)          
-PERLVAR(tokenbuf[256], char)           
+
 PERLVAR(statbuf,       struct stat)            
 #ifdef HAS_TIMES
 PERLVAR(timesbuf,      struct tms)             
 #endif
+
+#endif /* USE_THREADS */
+
+PERLVAR(tokenbuf[256], char)           
 #if defined(WIN32) && defined(__GNUC__)
 PERLVAR(na,    static STRLEN)          
 #else
@@ -197,10 +206,3 @@ PERLVARI(numeric_local,    bool,   TRUE)   /* Assume local numerics */
 
 #endif /* !USE_LOCALE_NUMERIC */
 
-#ifndef MULTIPLICITY
-#define IEXT EXT
-#define IINIT(x) INIT(x)
-#include "intrpvar.h"
-#undef IEXT
-#undef IINIT
-#endif
\ No newline at end of file
index adda2aa..9039797 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -60,9 +60,9 @@
 #define REG_COMP_C
 #include "regcomp.h"
 
-#ifdef USE_THREADS
+#ifdef op
 #undef op
-#endif /* USE_THREADS */
+#endif /* op */
 
 static regnode regdummy;
 static char *  regparse;       /* Input-scan pointer. */
@@ -2663,3 +2663,4 @@ re_croak2(const char* pat1,const char* pat2, va_alist)
 }
 
 
+
index 8f61950..4c69836 100644 (file)
--- a/thrdvar.h
+++ b/thrdvar.h
@@ -1,5 +1,6 @@
 /* Per-thread variables */
 /* Important ones in the first cache line (if alignment is done right) */
+
 PERLVAR(Tstack_sp,     SV **)          
 #ifdef OP_IN_REGISTER
 PERLVAR(Topsave,       OP *)           
@@ -7,8 +8,8 @@ PERLVAR(Topsave,        OP *)
 PERLVAR(Top,           OP *)           
 #endif
 PERLVAR(Tcurpad,       SV **)          
-PERLVAR(Tstack_base,   SV **)          
 
+PERLVAR(Tstack_base,   SV **)          
 PERLVAR(Tstack_max,    SV **)          
 
 PERLVAR(Tscopestack,   I32 *)          
@@ -27,58 +28,59 @@ PERLVAR(Tmarkstack, I32 *)
 PERLVAR(Tmarkstack_ptr,        I32 *)          
 PERLVAR(Tmarkstack_max,        I32 *)          
 
-PERLVAR(TSv,   SV *)           
-PERLVAR(TXpv,  XPV *)          
+PERLVAR(TSv,           SV *)           
+PERLVAR(TXpv,          XPV *)          
 PERLVAR(Tstatbuf,      struct stat)            
 #ifdef HAS_TIMES
 PERLVAR(Ttimesbuf,     struct tms)             
 #endif
     
-/* XXX What about regexp stuff? */
-
 /* Now the fields that used to be "per interpreter" (even when global) */
 
 /* Fields used by magic variables such as $@, $/ and so on */
-PERLVAR(Ttainted,      bool)           
-PERLVAR(Tcurpm,                PMOP *)         
+PERLVAR(Ttainted,      bool)           /* using variables controlled by $< */
+PERLVAR(Tcurpm,                PMOP *)         /* what to do \ interps from */
 PERLVAR(Tnrs,          SV *)           
-PERLVAR(Trs,           SV *)           
+PERLVAR(Trs,           SV *)           /* $/ */
 PERLVAR(Tlast_in_gv,   GV *)           
-PERLVAR(Tofs,          char *)         
+PERLVAR(Tofs,          char *)         /* $, */
 PERLVAR(Tofslen,       STRLEN)         
 PERLVAR(Tdefoutgv,     GV *)           
-PERLVAR(Tchopset,      char *)         
+PERLVARI(Tchopset,     char *, " \n-") /* $: */
 PERLVAR(Tformtarget,   SV *)           
 PERLVAR(Tbodytarget,   SV *)           
 PERLVAR(Ttoptarget,    SV *)           
 
-    /* Stashes */
-PERLVAR(Tdefstash,     HV *)           
-PERLVAR(Tcurstash,     HV *)           
+/* Stashes */
+PERLVAR(Tdefstash,     HV *)           /* main symbol table */
+PERLVAR(Tcurstash,     HV *)           /* symbol table for current package */
 
-    /* Stacks */
+/* Stacks */
 PERLVAR(Ttmps_stack,   SV **)          
-PERLVAR(Ttmps_ix,      I32)            
-PERLVAR(Ttmps_floor,   I32)            
+PERLVARI(Ttmps_ix,     I32,    -1)     
+PERLVARI(Ttmps_floor,  I32,    -1)     
 PERLVAR(Ttmps_max,     I32)            
 
-PERLVAR(Tin_eval,      int)            
-PERLVAR(Trestartop,    OP *)           
-PERLVAR(Tdelaymagic,   int)            
-PERLVAR(Tdirty,                bool)           
-PERLVAR(Tlocalizing,   U8)             
-PERLVAR(Tcurcop,       COP *)          
+PERLVAR(Trestartop,    OP *)           /* Are we propagating an error from croak? */
+PERLVARI(Tcurcop,      COP * VOL,      &compiling)     
+PERLVAR(Tin_eval,      VOL int)        /* trap "fatal" errors? */
+PERLVAR(Tdelaymagic,   int)            /* ($<,$>) = ... */
+PERLVAR(Tdirty,                bool)           /* In the middle of tearing things down? */
+PERLVAR(Tlocalizing,   U8)             /* are we processing a local() list? */
 
 PERLVAR(Tcxstack,      PERL_CONTEXT *)         
-PERLVAR(Tcxstack_ix,   I32)            
-PERLVAR(Tcxstack_max,  I32)            
+PERLVARI(Tcxstack_ix,  I32,    -1)     
+PERLVARI(Tcxstack_max, I32,    128)    
 
-PERLVAR(Tcurstack,     AV *)           
-PERLVAR(Tmainstack,    AV *)           
-PERLVAR(Ttop_env,      JMPENV *)               
-PERLVAR(Tstart_env,    JMPENV)                 /* Top of top_env longjmp() chain */
+PERLVAR(Tcurstack,     AV *)                   /* THE STACK */
+PERLVAR(Tmainstack,    AV *)                   /* the stack when nothing funny is happening */
+PERLVAR(Ttop_env,      JMPENV *)               /* ptr. to current sigjmp() environment */
+PERLVAR(Tstart_env,    JMPENV)                 /* empty startup sigjmp() environment */
 
 /* XXX Sort stuff, firstgv secongv and so on? */
+/* XXX What about regexp stuff? */
+
+#ifdef USE_THREADS
 
 PERLVAR(oursv,         SV *)           
 PERLVAR(cvcache,       HV *)           
@@ -99,3 +101,4 @@ PERLVAR(i,           struct thread_intern)   /* Platform-dependent internals */
 
 PERLVAR(trailing_nul,  char)                   /* For the sake of thrsv and oursv */
 
+#endif /* USE_THREADS */
index 7e98c1d..b6397cb 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -170,125 +170,6 @@ typedef struct condpair {
 #define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond)
 #define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner
 
-#undef stack_base
-#undef stack_sp
-#undef stack_max
-#undef curstack
-#undef mainstack
-#undef markstack
-#undef markstack_ptr
-#undef markstack_max
-#undef scopestack
-#undef scopestack_ix
-#undef scopestack_max
-#undef savestack
-#undef savestack_ix
-#undef savestack_max
-#undef retstack
-#undef retstack_ix
-#undef retstack_max
-#undef curcop
-#undef cxstack
-#undef cxstack_ix
-#undef cxstack_max
-#undef defstash
-#undef curstash
-#undef tmps_stack
-#undef tmps_floor
-#undef tmps_ix
-#undef tmps_max
-#undef curpad
-#undef Sv
-#undef Xpv
-#undef statbuf
-#undef timesbuf
-#undef tainted
-#undef curpm
-#undef nrs
-#undef rs
-#undef last_in_gv
-#undef ofs
-#undef ofslen
-#undef defoutgv
-#undef chopset
-#undef formtarget
-#undef bodytarget
-#undef  start_env
-#undef toptarget
-#undef top_env
-#undef in_eval
-#undef restartop
-#undef delaymagic
-#undef dirty
-#undef localizing
-
-#define stack_base     (thr->Tstack_base)
-#define stack_sp       (thr->Tstack_sp)
-#define stack_max      (thr->Tstack_max)
-#ifdef OP_IN_REGISTER
-#define opsave         (thr->Topsave)
-#else
-#undef op
-#define op             (thr->Top)
-#endif
-#define        curcop          (thr->Tcurcop)
-#define        stack           (thr->Tstack)
-#define curstack       (thr->Tcurstack)
-#define        mainstack       (thr->Tmainstack)
-#define        markstack       (thr->Tmarkstack)
-#define        markstack_ptr   (thr->Tmarkstack_ptr)
-#define        markstack_max   (thr->Tmarkstack_max)
-#define        scopestack      (thr->Tscopestack)
-#define        scopestack_ix   (thr->Tscopestack_ix)
-#define        scopestack_max  (thr->Tscopestack_max)
-
-#define        savestack       (thr->Tsavestack)
-#define        savestack_ix    (thr->Tsavestack_ix)
-#define        savestack_max   (thr->Tsavestack_max)
-
-#define        retstack        (thr->Tretstack)
-#define        retstack_ix     (thr->Tretstack_ix)
-#define        retstack_max    (thr->Tretstack_max)
-
-#define        cxstack         (thr->Tcxstack)
-#define        cxstack_ix      (thr->Tcxstack_ix)
-#define        cxstack_max     (thr->Tcxstack_max)
-
-#define curpad         (thr->Tcurpad)
-#define Sv             (thr->TSv)
-#define Xpv            (thr->TXpv)
-#define statbuf                (thr->Tstatbuf)
-#define timesbuf       (thr->Ttimesbuf)
-#define        tainted         (thr->Ttainted)
-#define        tainted         (thr->Ttainted)
-#define        curpm           (thr->Tcurpm)
-#define        nrs             (thr->Tnrs)
-#define        rs              (thr->Trs)
-#define        last_in_gv      (thr->Tlast_in_gv)
-#define        ofs             (thr->Tofs)
-#define        ofslen          (thr->Tofslen)
-#define        defoutgv        (thr->Tdefoutgv)
-#define        chopset         (thr->Tchopset)
-#define        formtarget      (thr->Tformtarget)
-#define        bodytarget      (thr->Tbodytarget)
-#define        toptarget       (thr->Ttoptarget)
-#define defstash       (thr->Tdefstash)
-#define curstash       (thr->Tcurstash)
-
-#define tmps_stack     (thr->Ttmps_stack)
-#define tmps_ix                (thr->Ttmps_ix)
-#define tmps_floor     (thr->Ttmps_floor)
-#define tmps_max       (thr->Ttmps_max)
-
-#define in_eval                (thr->Tin_eval)
-#define restartop      (thr->Trestartop)
-#define delaymagic     (thr->Tdelaymagic)
-#define dirty          (thr->Tdirty)
-#define localizing     (thr->Tlocalizing)
-
-#define        top_env         (thr->Ttop_env)
-#define start_env       (thr->Tstart_env)
-
 #else
 /* USE_THREADS is not defined */
 #define MUTEX_LOCK(m)
index 1505b14..901a9f4 100644 (file)
@@ -12,6 +12,8 @@
 INST_DRV=c:
 INST_TOP=$(INST_DRV)\perl5004.5x
 BUILDOPT=-DUSE_THREADS
+#BUILDOPT=-DMULTIPLICITY 
+#BUILDOPT=-DMULTIPLICITY -DUSE_THREADS
 CORECCOPT=
 
 #
@@ -243,6 +245,7 @@ CORE_H = ..\av.h    \
        ..\EXTERN.h     \
        ..\perlvars.h   \
        ..\intrpvar.h   \
+       ..\thrdvar.h    \
        .\include\dirent.h      \
        .\include\netdb.h       \
        .\include\sys\socket.h  \
index 87f1d93..f35e30f 100644 (file)
@@ -193,6 +193,9 @@ Perl_new_struct_thread
 Perl_nthreads
 Perl_nthreads_cond
 Perl_per_thread_magicals
+Perl_thread_create
+Perl_find_threadsv
+Perl_threadsv_names
 Perl_thrsv
 Perl_unlock_condpair
 Perl_vtbl_mutex
@@ -204,27 +207,34 @@ Perl_sv_uv
 Perl_sv_pvn
 Perl_newRV_noinc
 !END!OF!SKIP!
+
  }
 
-if ($define{'USE_THISPTR'} || $define{'USE_THREADS'})
+if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
  {
-  open(THREAD,"<../thread.sym") || die "Cannot open thread.sym:$!";
+  open(THREAD,"<../thrdvar.h") || die "Cannot open ../thrdvar.h:$!";
   while (<THREAD>)
    {
-    next if (!/^[A-Za-z]/);
-    next if (/_amg[ \t]*$/);
-    $skip_sym .= "Perl_".$_;
+    if (/\bPERLVARI?\(T(\w+)/)
+     {
+      $skip_sym .= "Perl_".$1."\n";
+     } 
    } 
   close(THREAD); 
-  $skip_sym .= "Perl_op\n";
  } 
 
-unless ($define{'USE_THREADS'})
+if ($define{'MULTIPLICITY'})
  {
-  $skip_sym .= "Perl_thread_create\n";
-  $skip_sym .= "Perl_find_threadsv\n";
-  $skip_sym .= "Perl_threadsv_names\n";
- }
+  open(THREAD,"<../intrpvar.h") || die "Cannot open ../intrpvar.h:$!";
+  while (<THREAD>)
+   {
+    if (/\bPERLVARI?\(I(\w+)/)
+     {
+      $skip_sym .= "Perl_".$1."\n";
+     } 
+   } 
+  close(THREAD); 
+ } 
 
 # All symbols have a Perl_ prefix because that's what embed.h
 # sticks in front of them.