Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
#define PERL_SYS_INIT3(argc, argv, env) Perl_sys_init3(argc, argv, +env)
void Perl_sys_init3 (int *argc, char ***argv, char ***env) { extern int Perl___notused; (void) ((argc) || (_assert ("argc", "perl.c", 145), 0)); (void) ((argv) || (_assert ("argv", "perl.c", 145), 0)); (void) ((env) || (_assert ("env", "perl.c", 145), 0)); ((void) argc); ((void) argv); ((void) env); Perl_win32_init (argc, argv); InitializeCriticalSection (&(*Perl_Gperlio_mutex_ptr (0))); }
void Perl_win32_init (int *argcp, char ***argvp) { HMODULE module; _control87 (0x0008001f, 0x0008001f); #line 4840 "win32.c" ; InitCommonControls (); module = GetModuleHandleA ("ntdll.dll"); if (module) { *(FARPROC *) & pfnZwQuerySystemInformation = GetProcAddress (mod +ule, "ZwQuerySystemInformation"); } module = GetModuleHandleA ("kernel32.dll"); if (module) { *(FARPROC *) & pfnCreateToolhelp32Snapshot = GetProcAddress (mod +ule, "CreateToolhelp32Snapshot"); *(FARPROC *) & pfnProcess32First = GetProcAddress (module, "Proc +ess32First"); *(FARPROC *) & pfnProcess32Next = GetProcAddress (module, "Proce +ss32Next"); } g_osver.dwOSVersionInfoSize = sizeof (g_osver); GetVersionExA (&g_osver); ansify_path (); }
#define PERL_SYS_TERM() Perl_sys_term()
void Perl_sys_term () { extern int Perl___notused; if (!(*Perl_Gveto_cleanup_ptr (0))) { Perl_win32_term (); } }
void Perl_win32_term (void) { PerlInterpreter *my_perl = ((PerlInterpreter *) Perl_get_context ()) +; DeleteCriticalSection (&(*Perl_Ghints_mutex_ptr (0))); DeleteCriticalSection (&(*Perl_Gop_mutex_ptr (0))); do { PerlIO_teardown (); DeleteCriticalSection (&(*Perl_Gperlio_mutex_ptr (0))); } while (0); ; }
I agree, terrible terrible description in perlapi. Perl 5.12.2 on windows above. Use the -P flag, and then a code formater. On some makefiles (XS/makemaker ones, not perl interpreter makefile) you can just type "nmake somecfile.i" and it will make the post preprocessed file, you still need to run it through a code formatter for it to be remotely readable. The Perl interpreter is the first interpreted programing language written completely in preprocessor macros jk jk

It seems to me like you have to call then once per process. They set up process global, not ithread global (or is that local?), things perl uses.

Also watch out for insane Perls taken your c standard lib hostage problems, Perl's headers redefine all of C standard library to its own emulations, see fakesdio.h in perl.git and XSUB.h#l563 in perl.git and win32/win32iop-o.h#l292 in perl.git. It will cause endless crashes and headaches when trying to interface Perl with anything else that is written in C. Make sure you have tons of undefs to return you back to your normal c standard library.

Why Perl takes over your cstdlib? Who knows, perlclib has the Perl specific names for Perl's clib.

In reply to Re: what do PERL_SYS_INIT3() and PERL_SYS_TERM() do? by patcat88
in thread what do PERL_SYS_INIT3() and PERL_SYS_TERM() do? by xiaoyafeng

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [Discipulus]: but the best i attended live was Mano Negra Patchanka at Forte Prenestino .. in 1990
    [Corion]: Hmmm - Mano Negra or at least Manu Chao seem to put on a good live show. At least the one live CD I have from Manu Chao sounds good ;)
    Discipulus feels the same jealousity of the johngg's daughter
    [1nickt]: choroba I agree
    [choroba]: Playing in a punk rock band for 20 years... my hearing is quite bad
    [Corion]: I still have hopes to turn my godson and his two siblings into a punk band ;)
    [Corion]: Their older sister just started piano but has been interested in drumming, which she should be able to start with 8 years or so)
    [Discipulus]: ah was Kink of Bongo 1992..
    [1nickt]: choroba name of band? youtube link? MySpace link?

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (9)
    As of 2017-03-24 12:21 GMT
    Find Nodes?
      Voting Booth?
      Should Pluto Get Its Planethood Back?

      Results (301 votes). Check out past polls.