diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-11-15 15:25:50 -0500 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-28 12:18:23 +0000 |
commit | 4bfbfac5c6d9a0ecc663cdd23fe31fc59ee7bab3 (patch) | |
tree | c82433e1683e7be80790df54557dd85f5f73cc70 /os2/os2ish.h | |
parent | 6420b6fef5638a2b911cdc075d35917859e53913 (diff) | |
download | perl-4bfbfac5c6d9a0ecc663cdd23fe31fc59ee7bab3.tar.gz |
OS/2 events get closer to Perl
Message-Id: <199811160125.UAA05268@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@2340
Diffstat (limited to 'os2/os2ish.h')
-rw-r--r-- | os2/os2ish.h | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/os2/os2ish.h b/os2/os2ish.h index 586f75b0e6..20b2196b71 100644 --- a/os2/os2ish.h +++ b/os2/os2ish.h @@ -292,6 +292,10 @@ typedef struct OS2_Perl_data { int (*xs_init)(); unsigned long rc; unsigned long severity; + unsigned long phmq; /* Handle to message queue */ + unsigned long phmq_refcnt; + unsigned long phmq_servers; + unsigned long initial_mode; /* VIO etc. mode we were started in */ } OS2_Perl_data_t; extern OS2_Perl_data_t OS2_Perl_data; @@ -305,6 +309,42 @@ extern OS2_Perl_data_t OS2_Perl_data; #define Perl_HAB_set (OS2_Perl_flags & Perl_HAB_set_f) #define set_Perl_HAB_f (OS2_Perl_flags |= Perl_HAB_set_f) #define set_Perl_HAB(h) (set_Perl_HAB_f, Perl_hab = h) +#define _obtain_Perl_HAB (init_PMWIN_entries(), \ + Perl_hab = (*PMWIN_entries.Initialize)(0), \ + set_Perl_HAB_f, Perl_hab) +#define perl_hab_GET() (Perl_HAB_set ? Perl_hab : _obtain_Perl_HAB) +#define Acquire_hab() perl_hab_GET() +#define Perl_hmq ((HMQ)OS2_Perl_data.phmq) +#define Perl_hmq_refcnt (OS2_Perl_data.phmq_refcnt) +#define Perl_hmq_servers (OS2_Perl_data.phmq_servers) +#define Perl_os2_initial_mode (OS2_Perl_data.initial_mode) + +unsigned long Perl_hab_GET(); +unsigned long Perl_Register_MQ(int serve); +void Perl_Deregister_MQ(int serve); +int Perl_Serve_Messages(int force); +/* Cannot prototype with I32 at this point. */ +int Perl_Process_Messages(int force, long *cntp); + +struct _QMSG; +struct PMWIN_entries_t { + unsigned long (*Initialize)( unsigned long fsOptions ); + unsigned long (*CreateMsgQueue)(unsigned long hab, long cmsg); + int (*DestroyMsgQueue)(unsigned long hmq); + int (*PeekMsg)(unsigned long hab, struct _QMSG *pqmsg, + unsigned long hwndFilter, unsigned long msgFilterFirst, + unsigned long msgFilterLast, unsigned long fl); + int (*GetMsg)(unsigned long hab, struct _QMSG *pqmsg, + unsigned long hwndFilter, unsigned long msgFilterFirst, + unsigned long msgFilterLast); + void * (*DispatchMsg)(unsigned long hab, struct _QMSG *pqmsg); +}; +extern struct PMWIN_entries_t PMWIN_entries; +void init_PMWIN_entries(void); + +#define perl_hmq_GET(serve) Perl_Register_MQ(serve); +#define perl_hmq_UNSET(serve) Perl_Deregister_MQ(serve); + #define OS2_XS_init() (*OS2_Perl_data.xs_init)() /* The expressions below return true on error. */ /* INCL_DOSERRORS needed. rc should be declared outside. */ @@ -319,11 +359,6 @@ extern OS2_Perl_data_t OS2_Perl_data; errno = errno_isOS2, \ Perl_severity = ERRORIDSEV(Perl_rc), \ Perl_rc = ERRORIDERROR(Perl_rc)) -#define Acquire_hab() if (!Perl_HAB_set) { \ - Perl_hab = WinInitialize(0); \ - if (!Perl_hab) die("WinInitialize failed"); \ - set_Perl_HAB_f; \ - } #define STATIC_FILE_LENGTH 127 |