1# Copyright (C) 2001-2015, Parrot Foundation. 2 3=head1 NAME 4 5embed.pod - Parrot embedding system 6 7=head1 NOTE 8 9Parrot's embedding API is being replaced with a newer version. This document 10is for the old embedding API and will be phased out over time. Documentation 11for the newer API is located at F<docs/embed_new.pod>. 12 13=head1 SYNOPSIS 14 15 #include "parrot/parrot.h" 16 #include "parrot/extend.h" 17 18 int main(int argc, char* argv[]) 19 { 20 Parrot_Interp interp; 21 Parrot_PackFile pf; 22 23 interp = Parrot_new(NULL); 24 if (!interp) { 25 fprintf(stderr, "Cannot create Parrot interpreter!\n"); 26 return 1; 27 } 28 29 pf = Parrot_pbc_read(interp, "foo.pbc", 0); 30 Parrot_pbc_load(interp, pf); 31 Parrot_runcode(interp, argc, argv); 32 33 Parrot_destroy(interp); 34 35 return 0; 36 } 37 38=head1 FILES 39 40=over 4 41 42=item F<include/parrot/extend.h> 43 44=back 45 46=head1 DESCRIPTION 47 48This is the documentation for Parrot's embedding API. 49 50=head2 Data structures 51 52=over 4 53 54=item C<Parrot_Interp> 55 56The topmost data structure in Parrot is C<Parrot_Interp>, which represents 57a Parrot interpreter. It is a required argument to almost every Parrot API 58function. The structure is opaque in an embedded environment, so you cannot 59directly access any of its members. 60 61=item C<Parrot_PackFile> 62 63A Parrot packfile, the internal structure containing Parrot bytecode. 64 65=item C<Parrot_String> 66 67Parrot's internal string type, which contains character encoding information. 68 69=item C<Parrot_PMC> 70 71A Polymorphic Container. This is the opaque external type for (PMC *). Note 72that this is a macro, so there can be only one C<Parrot_PMC> declaration per 73line. 74 75=item C<Parrot_Int> 76 77Parrot's integer numeric type. 78 79=item C<Parrot_Float> 80 81Parrot's floating point numeric type. 82 83=item C<Parrot_UInt> 84 85Parrot's unsigned integer numeric type. 86 87=back 88 89=head2 Function signatures 90 91What is a function signature? It is a string which represents the calling and 92return conventions of a function. It is a very succinct representation of the 93answer to the question "How do I call this function and what does it 94return?". 95 96All function signatures follow the form of: 97 98 Foo->Bar 99 100where C<Foo> and C<Bar> are a list of zero or more Parrot datatypes. C<Foo> 101and C<Bar> are individually called 'type signatures'. The datatypes on the 102left of the arrow are function arguments being passed in and the datatypes on 103the right are the datatype being returned. No spaces are allowed in a 104function signature. 105 106There are four datatypes that can be used in Parrot function signatures: 107 108 I <=> Parrot_Int 109 N <=> Parrot_Float (Numeric) 110 S <=> Parrot_String 111 P <=> Parrot_PMC 112 113Here are some example function signatures and what they mean: 114 115 INN->N In: Integer, two Numerics Out: Numeric 116 SIN->S In: String, Integer, Numeric Out: String 117 P->S In: PMC Out: String 118 PiP->S In: PMC (method call) Out: String 119 NN->N In: Two Numerics Out: Numeric 120 I->I In: Integer Out: Integer 121 I->N In: Integer Out: Numeric 122 N->P In: Numeric Out: PMC 123 Pi-> In: none (method call) Out: none 124 ->I In: none Out: Integer 125 -> In: none Out: none 126 127TODO: Multiple return values? 128 129 130There is also the C<Pi> datatype, which may only appear at the beginning of a 131function signature. It stands for "PMC invocant" and basically means SELF. C<Pi> 132will only be used if calling a method on an object. 133 134Parrot function signature are mostly used when calling C<Parrot_ext_call>. 135 136=head2 Interpreter initialization and destruction 137 138=over 4 139 140=item C<Parrot_Interp Parrot_new(Parrot_Interp parent)> 141 142Creates a new interpreter, inheriting some data structures from a parent 143interpreter, if supplied. The first interpreter in any process should be 144created with a NULL parent, and all subsequent interpreters in the same 145process should use the first interpreter as their parent. Failure to do so 146may result in unpredictable errors. 147 148=item C<Parrot_set_flag(PARROT_INTERP, Parrot_int flags)> 149 150Sets or unsets interpreter flags. Flags should be OR'd together. Valid 151flags include: 152 153=over 4 154 155=item PARROT_NO_FLAGS 156 157The default. No flags. 158 159=item PARROT_BOUNDS_FLAG 160 161True if bytecode bounds should be tracked. 162 163=item PARROT_GC_DEBUG_FLAG 164 165True if debugging memory management. 166 167=item PARROT_EXTERN_CODE_FLAG 168 169True if reusing another interpreters code. 170 171=item PARROT_DESTROY_FLAG 172 173True if the last interpreter shall cleanup. 174 175=item PARROT_IS_THREAD 176 177True if interpreter is a thread. 178 179=item PARROT_THR_COPY_INTERP 180 181True if thread start copies interpreter state. 182 183=item PARROT_THR_THREAD_POOL 184 185True if type3 threads are being used. 186 187=back 188 189These are defined in F<interpreter.h>. 190 191=item C<void Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core)> 192 193Sets the runcore for the interpreter. Must be called before executing any 194bytecode. Valid runcores include: 195 196=over 4 197 198=item PARROT_SLOW_CORE 199 200=item PARROT_FUNCTION_CORE 201 202=item PARROT_FAST_CORE 203 204=item PARROT_EXEC_CORE 205 206=item PARROT_GC_DEBUG_CORE 207 208=back 209 210See F<interpreter.h> for the definitive list. If you're not sure which runcore 211to use, don't call this function. The default will be fine for most cases. 212(TODO: document runcores here). 213 214=item C<Parrot_set_trace(Parrot_Interp, Parrot_UInt flags)> 215 216Sets the interpreter's trace flags. Flags should be OR'd together. Valid 217flags are: 218 219=over 4 220 221=item PARROT_NO_TRACE 222 223=item PARROT_TRACE_OPS_FLAG 224 225=item PARROT_TRACE_FIND_METH_FLAG 226 227=item PARROT_TRACE_SUB_CALL_FLAG 228 229=item PARROT_ALL_TRACE_FLAGS 230 231Z<> 232 233=back 234 235=item C<void Parrot_set_executable_name(PARROT_INTERP, Parrot_string name)> 236 237Sets the executable name of the calling process. Note that the name is a 238Parrot string, not a C string. 239 240=item C<void Parrot_destroy(PARROT_INTERP)> 241 242Destroys an interpreter. At the time of this writing, this is a no-op. 243See <Parrot_really_destroy()>. 244 245=item C<void Parrot_really_destroy(PARROT_INTERP, int exit_code)> 246 247Destroys an interpreter, regardless of the environment. The exit code is 248currently unused. 249 250=item C<void Parrot_x_exit(PARROT_INTERP, int status)> 251 252Destroys the interpreter and exits with an exit code of C<status>. Before 253exiting, the function calls all registered exit handlers in LIFO order. 254C<Parrot_really_destroy()> is usually called as the last exit handler. 255 256=item C<void Parrot_x_on_exit(PARROT_INTERP, 257 void (*handler)(Parrot_Interp, int, void *), void *arg)> 258 259Registers an exit handler to be called from C<Parrot_x_exit()> in LIFO order. 260The handler function should accept as arguments an interpreter, an integer 261exit code, and an argument (which can be NULL). 262 263=back 264 265=head2 Loading and running bytecode 266 267=over 4 268 269=item C<Parrot_PackFile Parrot_pbc_read(PARROT_INTERP, const char *path, const int debug)> 270 271Reads Parrot bytecode or PIR from the file referenced by C<path>. Returns 272a packfile structure for use by C<Parrot_pbc_load()>. C<debug> should be 0. 273 274=item C<void Parrot_pbc_load(PARROT_INTERP, Parrot_PackFile pf)> 275 276Loads a packfile into the interpreter. After this operation the interpreter 277is ready to run the bytecode in the packfile. 278 279=item C<void Parrot_runcode(PARROT_INTERP, int argc, char *argv[])> 280 281Runs the bytecode associated with the interpreter. Use C<argc> and C<argv[]> 282to pass arguments to the bytecode. 283 284=item C<Parrot_PackFile PackFile_new_dummy(PARROT_INTERP, char *name)> 285 286Creates a "dummy" packfile in lieu of actually creating one from a bytecode 287file on disk. 288 289=item C<void Parrot_load_bytecode(PARROT_INTERP, STRING *path)> 290 291Reads and load Parrot bytecode or PIR from the file referenced by C<path>. 292You should create a dummy packfile beforehand; see C<PackFile_new_dummy> for 293details. Due to the void return type, the behavior of this function on error 294is unclear. 295 296=back 297 298=head2 Data manipulation 299 300=head3 Native types 301 302=over 4 303 304=item C<int Parrot_PMC_typenum(PARROT_INTERP, const char *type)> 305 306Returns the internal type number corresponding to C<type>. Useful for 307instantiating various Parrot data types. 308 309=item C<char *Parrot_str_to_cstring(PARROT_INTERP, const STRING *s)> 310 311XXX needs to be a formal Parrot_* API. 312Returns the C string representation of a Parrot string. 313 314=item C<STRING *Parrot_str_new(PARROT_INTERP, const char *string, int len)> 315 316XXX needs to be a formal Parrot_* API. 317Returns the Parrot string representation of a C string. 318 319=item C<string_from_literal(PARROT_INTERP, const char *string)> 320 321XXX needs to be a formal Parrot_* API. 322A macro for simplifying calls to C<Parrot_str_new>. 323 324=back 325 326=head3 PMCs 327 328=over 4 329 330=item C<Parrot_PMC Parrot_PMC_new(PARROT_INTERP, int typenum)> 331 332Creates a new PMC of the type identified by C<typenum>. Use 333C<Parrot_PMC_typenum> to obtain the correct type number. 334 335=item C<void Parrot_register_pmc(Parrot_PMC pmc)> 336 337Registers an externally created PMC with the garbage collector. You MUST call 338this for any PMCs you create outside of Parrot bytecode, otherwise your PMC 339may be garbage collected before you are finished using it. 340 341=item C<void Parrot_unregister_pmc(Parrot_PMC pmc)> 342 343Unregisters an externally created PMC from the garbage collector. You MUST call 344this after you are finished using PMCs you create outside of Parrot bytecode, 345or risk memory leaks. 346 347=back 348 349=head3 Globals 350 351=over 4 352 353=item C<Parrot_PMC Parrot_ns_find_current_namespace_global(PARROT_INTERP, Parrot_String name)> 354 355Find and return a global called C<name> in the current namespace. Returns 356C<PMCNULL> if not found. 357 358=item C<Parrot_PMC Parrot_ns_find_namespace_global(PARROT_INTERP, PMC namespace, Parrot_String name)> 359 360Search the namespace PMC C<namespace> for an object with name C<globalname>. 361Return the object, or NULL if not found. 362 363=item C<void Parrot_ns_store_global(PARROT_INTERP, PMC namespace, Parrot_String name, Parrot_PMC val)> 364 365Store the PMC C<val> into the namespace PMC C<namespace> with name C<globalname>. 366 367=back 368 369=head3 Lexicals 370 371Not documented yet. 372 373=head2 Calling subroutines 374 375=over 4 376 377=item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC sub, const_char *signature, varargs ...)> 378 379Call a Parrot subroutine using the supplied function signature. Variables to be filled 380with return values are passed as references in the varargs list, after all 381arguments. 382 383=back 384 385=head2 Objects 386 387=head3 Creating and destroying objects 388 389=over 4 390 391=item C<Parrot_PMC Parrot_oo_get_class(PARROT_INTERP, Parrot_PMC namespace)> 392 393Returns the class corresponding to the supplied namespace. 394 395=item C<Parrot_PMC Parrot_PMC_instantiate(PARROT_INTERP, Parrot_PMC the_class, Parrot_PMC arg)> 396 397Instantiates a new object of class C<the_class>, which can be obtained from 398C<Parrot_oo_get_class()>. Passes an optional PMC argument C<arg> to the 399constructor (see init versus init_pmc). Use C<PMCNULL> if you are not 400supplying an argument. 401 402=back 403 404=head3 Calling methods 405 406=over 4 407 408=item C<void Parrot_ext_call(PARROT_INTERP, Parrot_PMC method, const_char *signature, varargs ...)> 409 410Methods are called using the same API function as calling a subroutine. The 411first argument should be the object that the method will be invoked on, and it 412should have the signature "Pi", which stands for "PMC invocant". 413 414=back 415 416=head1 COMPILING 417 418Note: This section is aimed at you if you are writing an application 419external to parrot which links against an installed parrot library. 420 421=head2 Caveats 422 423Several API functions are missing prototypes in Parrot's header files. This 424means you may receive type warnings during compilation even though the types 425of your arguments and return variables are correct. In this case it is safe 426to cast to the correct type; not doing so may cause undesired behavior. 427 428=head2 Compiler and linker flags 429 430Your application will need to include the appropriate header files and 431link against parrot and its dependencies. 432 433Because the location of these files can vary from platform to platform, and 434build to build, a general method is provided to find out the necessary flags to 435use. 436 437C<parrot_config> is the helper tool for determining anything related to parrot 438configuration, determining compiler and linker flags to build against parrot is 439no different. 440 441To start, you should find C<parrot_config> in the path or allow your user to 442provide this location for you. You can check this by running C<parrot_config> with 443C<VERSION> as the argument to determine the version of parrot you are working with. 444 445To determine the necessary C compiler flags, use C<embed-cflags>: 446 447 parrot_config embed-cflags 448 449... and to find the necessary linker flags, use C<embed-ldflags>: 450 451 parrot_config embed-ldflags 452 453The C<parrot_config> command can be incorporated with a compile as shown here 454performing both compiling and linking in one step. 455 456 cc src/disassemble.c `parrot_config embed-cflags` `parrot_config embed-ldflags` 457 458=head1 EXAMPLES 459 460=head2 Load bytecode as a library and run a single subroutine 461 462 #include <parrot/parrot.h> 463 #include <parrot/extend.h> 464 465 int main(int argc, char *argv[]) 466 { 467 Parrot_Interp interp; 468 Parrot_PackFile pf; 469 Parrot_PMC sub; 470 Parrot_String pstr; 471 472 interp = Parrot_new(NULL); 473 imcc_init(interp); 474 475 /* create a new packfile -- any name will do */ 476 pf = PackFile_new_dummy(interp, "my-parrot-code"); 477 478 pstr = string_from_literal(interp, "foo.pir"); 479 Parrot_load_bytecode(interp, pstr); 480 481 /* find the subroutine named "foo" in the global namespace */ 482 pstr = string_from_literal(interp, "foo"); 483 sub = Parrot_ns_find_current_namespace_global(interp, pstr); 484 485 /* run foo(), which returns nothing */ 486 Parrot_ext_call(interp, sub, "->"); 487 488 Parrot_destroy(interp); 489 490 return(0); 491 } 492 493=head1 EXPORTED FUNCTIONS 494 495The Parrot embedding API is not finalized, and it will go through several 496deprecation cycles before stabilizing. Below is the comprehensive list of 497candidates for inclusion in the Parrot embedding API. It includes the 498following types of functions: 499 500=over 4 501 502=item * The core functions documented above 503 504=item * Functions required by macros 505 506=item * Parrot_PMC_* VTABLE wrappers 507 508=item * Miscellaneous functions whose utility outside of the core is 509uncertain. This includes functions used by HLLs. 510 511=item * Functions that should be removed in a future deprecation cycle. A 512good example of this is most of the internal string_* functions, which now 513have formal Parrot_str_* wrappers. 514 515=back 516 517The list may also be augmented if additional functionality is required. 518 519=over 4 520 521=item C<disable_event_checking> 522 523=item C<enable_event_checking> 524 525=item C<interpinfo> 526 527=item C<interpinfo_p> 528 529=item C<interpinfo_s> 530 531=item C<mem_allocate_n_typed> 532 533=item C<mem_allocate_n_zeroed_typed> 534 535=item C<mem_allocate_zeroed_typed> 536 537=item C<mem_sys_allocate> 538 539=item C<mem_sys_allocate_zeroed> 540 541=item C<mem_sys_free> 542 543=item C<mem_sys_realloc> 544 545=item C<mem_sys_realloc_zeroed> 546 547=item C<PackFile_ConstTable_pack> will be removed 548 549=item C<PackFile_ConstTable_pack_size> will be removed 550 551=item C<PackFile_destroy> renamed to C<Parrot_pf_new> 552 553=item C<PackFile_fixup_subs> => C<Parrot_pf_fixup_subs> 554 555=item C<PackFile_new> renamed to C<Parrot_pf_new> 556 557=item C<PackFile_new_dummy> 558 559=item C<PackFile_pack> renamed to C<Parrot_pf_pack> 560 561=item C<PackFile_pack_size> renamed to C<Parrot_pf_pack_size> 562 563=item C<Parrot_assert> 564 565=item C<Parrot_block_GC_mark> 566 567=item C<Parrot_block_GC_sweep> 568 569=item C<Parrot_util_byte_index> 570 571=item C<Parrot_util_byte_rindex> 572 573=item C<Parrot_callback_C> 574 575=item C<Parrot_callback_D> 576 577=item C<Parrot_ext_call> 578 579=item C<Parrot_char_digit_value> 580 581=item C<Parrot_clear_debug> 582 583=item C<Parrot_clear_flag> 584 585=item C<Parrot_clear_trace> 586 587=item C<Parrot_clone> 588 589=item C<Parrot_compile_file> 590 591=item C<Parrot_compile_string> 592 593=item C<Parrot_ComposeRole> 594 595=item C<Parrot_compreg> 596 597=item C<Parrot_ComputeMRO_C3> 598 599=item C<Parrot_confess> 600 601=item C<Parrot_context_ref_trace> 602 603=item C<Parrot_cx_add_handler> 604 605=item C<Parrot_cx_add_handler_local> 606 607=item C<Parrot_cx_broadcast_message> 608 609=item C<Parrot_cx_count_handlers_local> 610 611=item C<Parrot_cx_count_handlers_typed> 612 613=item C<Parrot_cx_delete_handler_local> 614 615=item C<Parrot_cx_delete_handler_typed> 616 617=item C<Parrot_cx_delete_suspend_for_gc> 618 619=item C<Parrot_cx_delete_task> 620 621=item C<Parrot_cx_find_handler_for_task> 622 623=item C<Parrot_cx_find_handler_local> 624 625=item C<Parrot_cx_handle_tasks> 626 627=item C<Parrot_cx_peek_task> 628 629=item C<Parrot_cx_request_suspend_for_gc> 630 631=item C<Parrot_cx_schedule_callback> 632 633=item C<Parrot_cx_schedule_repeat> 634 635=item C<Parrot_cx_schedule_sleep> 636 637=item C<Parrot_cx_schedule_task> 638 639=item C<Parrot_cx_schedule_timer> 640 641=item C<Parrot_cx_send_message> 642 643=item C<Parrot_default_encoding> 644 645=item C<Parrot_del_timer_event> 646 647=item C<Parrot_destroy> 648 649=item C<Parrot_disassemble> 650 651=item C<Parrot_do_check_events> 652 653=item C<Parrot_do_handle_events> 654 655=item C<Parrot_dump_dynamic_environment> 656 657=item C<Parrot_encoding_c_name> 658 659=item C<Parrot_encoding_name> 660 661=item C<Parrot_encoding_number> 662 663=item C<Parrot_encoding_number_of_str> 664 665=item C<Parrot_eprintf> 666 667=item C<Parrot_event_add_io_event> 668 669=item C<Parrot_ex_add_c_handler> 670 671=item C<Parrot_ex_build_exception> 672 673=item C<Parrot_x_exit> 674 675=item C<Parrot_ex_mark_unhandled> 676 677=item C<Parrot_ex_rethrow_from_c> 678 679=item C<Parrot_ex_rethrow_from_op> 680 681=item C<Parrot_ex_throw_from_c> 682 683=item C<Parrot_ex_throw_from_c_args> 684 685=item C<Parrot_ex_throw_from_c_noargs> 686 687=item C<Parrot_ex_throw_from_op> 688 689=item C<Parrot_ex_throw_from_op_args> 690 691=item C<Parrot_find_encoding> 692 693=item C<Parrot_ns_find_current_namespace_global> 694 695=item C<Parrot_find_global_k> 696 697=item C<Parrot_ns_find_namespace_global> 698 699=item C<Parrot_ns_find_global_from_op> 700 701=item C<Parrot_find_language> 702 703=item C<Parrot_find_method_direct> 704 705=item C<Parrot_find_method_with_cache> 706 707=item C<Parrot_ns_find_named_item> 708 709=item C<Parrot_util_float_rand> 710 711=item C<Parrot_fprintf> 712 713=item C<Parrot_free_context> 714 715=item C<Parrot_freeze> 716 717=item C<Parrot_freeze_at_destruct> 718 719=item C<Parrot_sub_full_sub_name> 720 721=item C<parrot_gc_context> 722 723=item C<Parrot_gc_gms_init> 724 725=item C<parrot_gc_gms_Parrot_gc_mark_PObj_alive> 726 727=item C<Parrot_gc_mark_PObj_alive> 728 729=item C<Parrot_hll_get_ctx_HLL_namespace> 730 731=item C<Parrot_hll_get_ctx_HLL_type> 732 733=item C<Parrot_dt_get_datatype_enum> 734 735=item C<Parrot_dt_get_datatype_name> 736 737=item C<Parrot_get_encoding> 738 739=item C<Parrot_ns_get_global> 740 741=item C<Parrot_hll_get_HLL_id> 742 743=item C<Parrot_hll_get_HLL_name> 744 745=item C<Parrot_hll_get_HLL_namespace> 746 747=item C<Parrot_hll_get_HLL_type> 748 749=item C<Parrot_get_intreg> 750 751=item C<Parrot_get_namespace_autobase> 752 753=item C<Parrot_ns_get_namespace_keyed> 754 755=item C<Parrot_ns_get_namespace_keyed_str> 756 757=item C<Parrot_get_numreg> 758 759=item C<Parrot_get_pmcreg> 760 761=item C<Parrot_get_root_namespace> 762 763=item C<Parrot_get_runtime_path> 764 765=item C<Parrot_get_strreg> 766 767=item C<Parrot_get_vtable> 768 769=item C<Parrot_get_vtable_index> 770 771=item C<Parrot_get_vtable_name> 772 773=item C<Parrot_init_events> 774 775=item C<Parrot_init_signals> 776 777=item C<Parrot_init_stacktop> 778 779=item C<Parrot_util_int_rand> 780 781=item C<Parrot_invalidate_method_cache> 782 783=item C<Parrot_io_accept> 784 785=item C<Parrot_io_bind> 786 787=item C<Parrot_io_close> 788 789=item C<Parrot_io_close_filehandle> 790 791=item C<Parrot_io_close_piohandle> 792 793=item C<Parrot_io_connect> 794 795=item C<Parrot_IOData_mark> 796 797=item C<Parrot_io_eof> 798 799=item C<Parrot_io_eprintf> 800 801=item C<Parrot_io_fdopen> 802 803=item C<Parrot_io_finish> 804 805=item C<Parrot_io_flush> 806 807=item C<Parrot_io_flush_filehandle> 808 809=item C<Parrot_io_fprintf> 810 811=item C<Parrot_io_get_buffer_end> 812 813=item C<Parrot_io_get_buffer_next> 814 815=item C<Parrot_io_get_buffer_start> 816 817=item C<Parrot_io_getfd> 818 819=item C<Parrot_io_get_file_position> 820 821=item C<Parrot_io_get_file_size> 822 823=item C<Parrot_io_get_flags> 824 825=item C<Parrot_io_get_os_handle> 826 827=item C<Parrot_io_init> 828 829=item C<Parrot_io_is_closed> 830 831=item C<Parrot_io_is_closed_filehandle> 832 833=item C<Parrot_io_is_encoding> 834 835=item C<Parrot_io_is_tty> 836 837=item C<Parrot_io_listen> 838 839=item C<Parrot_io_make_offset> 840 841=item C<Parrot_io_new_pmc> 842 843=item C<Parrot_io_new_socket_pmc> 844 845=item C<Parrot_io_open> 846 847=item C<Parrot_io_parse_open_flags> 848 849=item C<Parrot_io_peek> 850 851=item C<Parrot_io_poll> 852 853=item C<Parrot_io_printf> 854 855=item C<Parrot_io_putps> 856 857=item C<Parrot_io_puts> 858 859=item C<Parrot_io_readline> 860 861=item C<Parrot_io_reads> 862 863=item C<Parrot_io_recv> 864 865=item C<Parrot_io_seek> 866 867=item C<Parrot_io_send> 868 869=item C<Parrot_io_set_file_position> 870 871=item C<Parrot_io_set_file_size> 872 873=item C<Parrot_io_set_flags> 874 875=item C<Parrot_io_set_os_handle> 876 877=item C<Parrot_io_socket> 878 879=item C<Parrot_io_socket_is_closed> 880 881=item C<Parrot_io_STDERR> 882 883=item C<Parrot_io_stdhandle> 884 885=item C<Parrot_io_STDIN> 886 887=item C<Parrot_io_STDOUT> 888 889=item C<Parrot_io_tell> 890 891=item C<Parrot_io_write> 892 893=item C<Parrot_is_blocked_GC_mark> 894 895=item C<Parrot_is_blocked_GC_sweep> 896 897=item C<Parrot_kill_event_loop> 898 899=item C<Parrot_lib_add_path> 900 901=item C<Parrot_lib_add_path_from_cstring> 902 903=item C<Parrot_load_bytecode> 904 905=item C<Parrot_load_encoding> 906 907=item C<Parrot_load_language> 908 909=item C<Parrot_dyn_load_lib> 910 911=item C<Parrot_locate_runtime_file> 912 913=item C<Parrot_locate_runtime_file_str> 914 915=item C<Parrot_make_cb> 916 917=item C<Parrot_make_default_encoding> 918 919=item C<Parrot_ns_make_namespace_autobase> 920 921=item C<Parrot_ns_make_namespace_keyed> 922 923=item C<Parrot_ns_make_namespace_keyed_str> 924 925=item C<Parrot_mmd_cache_create> 926 927=item C<Parrot_mmd_cache_destroy> 928 929=item C<Parrot_mmd_cache_lookup_by_values> 930 931=item C<Parrot_mmd_cache_mark> 932 933=item C<Parrot_mmd_cache_store_by_values> 934 935=item C<Parrot_new> 936 937=item C<Parrot_new_cb_event> 938 939=item C<Parrot_new_encoding> 940 941=item C<Parrot_new_string> 942 943=item C<Parrot_new_suspend_for_gc_event> 944 945=item C<Parrot_new_terminate_event> 946 947=item C<Parrot_new_timer_event> 948 949=item C<Parrot_ns_get_name> 950 951=item C<Parrot_x_on_exit> 952 953=item C<Parrot_oo_get_class> 954 955=item C<Parrot_oo_get_class_str> 956 957=item C<Parrot_pbc_load> 958 959=item C<Parrot_pbc_read> 960 961=item C<Parrot_PMC_absolute> 962 963=item C<Parrot_PMC_add> 964 965=item C<Parrot_PMC_add_attribute> 966 967=item C<Parrot_PMC_add_float> 968 969=item C<Parrot_PMC_add_int> 970 971=item C<Parrot_PMC_add_method> 972 973=item C<Parrot_PMC_add_parent> 974 975=item C<Parrot_PMC_add_role> 976 977=item C<Parrot_PMC_add_vtable_override> 978 979=item C<Parrot_PMC_assign_pmc> 980 981=item C<Parrot_PMC_assign_string_native> 982 983=item C<Parrot_PMC_can> 984 985=item C<Parrot_PMC_clone> 986 987=item C<Parrot_PMC_clone_pmc> 988 989=item C<Parrot_PMC_cmp> 990 991=item C<Parrot_PMC_cmp_num> 992 993=item C<Parrot_PMC_cmp_pmc> 994 995=item C<Parrot_PMC_cmp_string> 996 997=item C<Parrot_PMC_concatenate> 998 999=item C<Parrot_PMC_concatenate_str> 1000 1001=item C<Parrot_PMC_decrement> 1002 1003=item C<Parrot_PMC_defined> 1004 1005=item C<Parrot_PMC_defined_keyed> 1006 1007=item C<Parrot_PMC_defined_keyed_int> 1008 1009=item C<Parrot_PMC_defined_keyed_str> 1010 1011=item C<Parrot_PMC_delete_keyed> 1012 1013=item C<Parrot_PMC_delete_keyed_int> 1014 1015=item C<Parrot_PMC_delete_keyed_str> 1016 1017=item C<Parrot_PMC_delete_pmckey> 1018 1019=item C<Parrot_PMC_delprop> 1020 1021=item C<Parrot_PMC_divide> 1022 1023=item C<Parrot_PMC_divide_float> 1024 1025=item C<Parrot_PMC_divide_int> 1026 1027=item C<Parrot_PMC_does> 1028 1029=item C<Parrot_PMC_does_pmc> 1030 1031=item C<Parrot_PMC_elements> 1032 1033=item C<Parrot_PMC_exists_keyed> 1034 1035=item C<Parrot_PMC_exists_keyed_int> 1036 1037=item C<Parrot_PMC_exists_keyed_str> 1038 1039=item C<Parrot_PMC_find_method> 1040 1041=item C<Parrot_PMC_floor_divide> 1042 1043=item C<Parrot_PMC_floor_divide_float> 1044 1045=item C<Parrot_PMC_floor_divide_int> 1046 1047=item C<Parrot_PMC_get_attr_keyed> 1048 1049=item C<Parrot_PMC_get_attr_str> 1050 1051=item C<Parrot_PMC_get_bool> 1052 1053=item C<Parrot_PMC_get_class> 1054 1055=item C<Parrot_PMC_get_cstring> 1056 1057=item C<Parrot_PMC_get_cstring_intkey> 1058 1059=item C<Parrot_PMC_get_cstringn> 1060 1061=item C<Parrot_PMC_get_cstringn_intkey> 1062 1063=item C<Parrot_PMC_get_integer> 1064 1065=item C<Parrot_PMC_get_integer_keyed> 1066 1067=item C<Parrot_PMC_get_integer_keyed_int> 1068 1069=item C<Parrot_PMC_get_integer_keyed_str> 1070 1071=item C<Parrot_PMC_get_iter> 1072 1073=item C<Parrot_PMC_get_namespace> 1074 1075=item C<Parrot_PMC_get_number> 1076 1077=item C<Parrot_PMC_get_number_keyed> 1078 1079=item C<Parrot_PMC_get_number_keyed_int> 1080 1081=item C<Parrot_PMC_get_number_keyed_str> 1082 1083=item C<Parrot_PMC_get_numval> 1084 1085=item C<Parrot_PMC_get_numval_intkey> 1086 1087=item C<Parrot_PMC_get_pmc> 1088 1089=item C<Parrot_PMC_get_pmc_intkey> 1090 1091=item C<Parrot_PMC_get_pmc_keyed> 1092 1093=item C<Parrot_PMC_get_pmc_keyed_int> 1094 1095=item C<Parrot_PMC_get_pmc_keyed_str> 1096 1097=item C<Parrot_PMC_get_pmc_strkey> 1098 1099=item C<Parrot_PMC_get_pointer> 1100 1101=item C<Parrot_PMC_get_pointer_intkey> 1102 1103=item C<Parrot_PMC_get_pointer_keyed> 1104 1105=item C<Parrot_PMC_get_pointer_keyed_int> 1106 1107=item C<Parrot_PMC_get_pointer_keyed_str> 1108 1109=item C<Parrot_PMC_getprop> 1110 1111=item C<Parrot_PMC_getprops> 1112 1113=item C<Parrot_PMC_get_repr> 1114 1115=item C<Parrot_PMC_get_string> 1116 1117=item C<Parrot_PMC_get_string_intkey> 1118 1119=item C<Parrot_PMC_get_string_keyed> 1120 1121=item C<Parrot_PMC_get_string_keyed_int> 1122 1123=item C<Parrot_PMC_get_string_keyed_str> 1124 1125=item C<Parrot_PMC_i_absolute> 1126 1127=item C<Parrot_PMC_i_add> 1128 1129=item C<Parrot_PMC_i_add_float> 1130 1131=item C<Parrot_PMC_i_add_int> 1132 1133=item C<Parrot_PMC_i_concatenate> 1134 1135=item C<Parrot_PMC_i_concatenate_str> 1136 1137=item C<Parrot_PMC_i_divide> 1138 1139=item C<Parrot_PMC_i_divide_float> 1140 1141=item C<Parrot_PMC_i_divide_int> 1142 1143=item C<Parrot_PMC_i_floor_divide> 1144 1145=item C<Parrot_PMC_i_floor_divide_float> 1146 1147=item C<Parrot_PMC_i_floor_divide_int> 1148 1149=item C<Parrot_PMC_i_modulus> 1150 1151=item C<Parrot_PMC_i_modulus_float> 1152 1153=item C<Parrot_PMC_i_modulus_int> 1154 1155=item C<Parrot_PMC_i_multiply> 1156 1157=item C<Parrot_PMC_i_multiply_float> 1158 1159=item C<Parrot_PMC_i_multiply_int> 1160 1161=item C<Parrot_PMC_increment> 1162 1163=item C<Parrot_PMC_i_neg> 1164 1165=item C<Parrot_PMC_init> 1166 1167=item C<Parrot_PMC_init_pmc> 1168 1169=item C<Parrot_PMC_inspect> 1170 1171=item C<Parrot_PMC_inspect_str> 1172 1173=item C<Parrot_PMC_instantiate> 1174 1175=item C<Parrot_PMC_i_pow> 1176 1177=item C<Parrot_PMC_i_pow_float> 1178 1179=item C<Parrot_PMC_i_pow_int> 1180 1181=item C<Parrot_PMC_i_repeat> 1182 1183=item C<Parrot_PMC_i_repeat_int> 1184 1185=item C<Parrot_PMC_isa> 1186 1187=item C<Parrot_PMC_isa_pmc> 1188 1189=item C<Parrot_PMC_is_equal> 1190 1191=item C<Parrot_PMC_is_equal_num> 1192 1193=item C<Parrot_PMC_is_equal_string> 1194 1195=item C<Parrot_PMC_is_same> 1196 1197=item C<Parrot_PMC_i_subtract> 1198 1199=item C<Parrot_PMC_i_subtract_float> 1200 1201=item C<Parrot_PMC_i_subtract_int> 1202 1203=item C<Parrot_PMC_modulus> 1204 1205=item C<Parrot_PMC_modulus_float> 1206 1207=item C<Parrot_PMC_modulus_int> 1208 1209=item C<Parrot_PMC_morph> 1210 1211=item C<Parrot_PMC_multiply> 1212 1213=item C<Parrot_PMC_multiply_float> 1214 1215=item C<Parrot_PMC_multiply_int> 1216 1217=item C<Parrot_PMC_name> 1218 1219=item C<Parrot_PMC_neg> 1220 1221=item C<Parrot_PMC_new> 1222 1223=item C<Parrot_oo_new_class_pmc> 1224 1225=item C<Parrot_PMC_null> 1226 1227=item C<Parrot_PMC_pop_float> 1228 1229=item C<Parrot_PMC_pop_integer> 1230 1231=item C<Parrot_PMC_pop_pmc> 1232 1233=item C<Parrot_PMC_pop_string> 1234 1235=item C<Parrot_PMC_pow> 1236 1237=item C<Parrot_PMC_pow_float> 1238 1239=item C<Parrot_PMC_pow_int> 1240 1241=item C<Parrot_PMC_push_float> 1242 1243=item C<Parrot_PMC_push_integer> 1244 1245=item C<Parrot_PMC_push_intval> 1246 1247=item C<Parrot_PMC_push_numval> 1248 1249=item C<Parrot_PMC_push_pmc> 1250 1251=item C<Parrot_PMC_push_pmcval> 1252 1253=item C<Parrot_PMC_push_string> 1254 1255=item C<Parrot_PMC_remove_attribute> 1256 1257=item C<Parrot_PMC_remove_method> 1258 1259=item C<Parrot_PMC_remove_parent> 1260 1261=item C<Parrot_PMC_remove_role> 1262 1263=item C<Parrot_PMC_remove_vtable_override> 1264 1265=item C<Parrot_PMC_repeat> 1266 1267=item C<Parrot_PMC_repeat_int> 1268 1269=item C<Parrot_PMC_set_attr_keyed> 1270 1271=item C<Parrot_PMC_set_attr_str> 1272 1273=item C<Parrot_PMC_set_bignum_int> 1274 1275=item C<Parrot_PMC_set_bignum_num> 1276 1277=item C<Parrot_PMC_set_bignum_str> 1278 1279=item C<Parrot_PMC_set_bool> 1280 1281=item C<Parrot_PMC_set_cstring> 1282 1283=item C<Parrot_PMC_set_cstring_intkey> 1284 1285=item C<Parrot_PMC_set_cstringn> 1286 1287=item C<Parrot_PMC_set_cstringn_intkey> 1288 1289=item C<Parrot_PMC_set_integer_keyed> 1290 1291=item C<Parrot_PMC_set_integer_keyed_int> 1292 1293=item C<Parrot_PMC_set_integer_keyed_str> 1294 1295=item C<Parrot_PMC_set_integer_native> 1296 1297=item C<Parrot_PMC_set_integer_same> 1298 1299=item C<Parrot_PMC_set_intval> 1300 1301=item C<Parrot_PMC_set_intval_intkey> 1302 1303=item C<Parrot_PMC_set_number_keyed> 1304 1305=item C<Parrot_PMC_set_number_keyed_int> 1306 1307=item C<Parrot_PMC_set_number_keyed_str> 1308 1309=item C<Parrot_PMC_set_number_native> 1310 1311=item C<Parrot_PMC_set_number_same> 1312 1313=item C<Parrot_PMC_set_numval> 1314 1315=item C<Parrot_PMC_set_numval_intkey> 1316 1317=item C<Parrot_PMC_set_pmc> 1318 1319=item C<Parrot_PMC_set_pmc_intkey> 1320 1321=item C<Parrot_PMC_set_pmc_keyed> 1322 1323=item C<Parrot_PMC_set_pmc_keyed_int> 1324 1325=item C<Parrot_PMC_set_pmc_keyed_str> 1326 1327=item C<Parrot_PMC_set_pmc_pmckey> 1328 1329=item C<Parrot_PMC_set_pmc_strkey> 1330 1331=item C<Parrot_PMC_set_pointer> 1332 1333=item C<Parrot_PMC_set_pointer_intkey> 1334 1335=item C<Parrot_PMC_set_pointer_keyed> 1336 1337=item C<Parrot_PMC_set_pointer_keyed_int> 1338 1339=item C<Parrot_PMC_set_pointer_keyed_str> 1340 1341=item C<Parrot_PMC_setprop> 1342 1343=item C<Parrot_PMC_set_string> 1344 1345=item C<Parrot_PMC_set_string_intkey> 1346 1347=item C<Parrot_PMC_set_string_keyed> 1348 1349=item C<Parrot_PMC_set_string_keyed_int> 1350 1351=item C<Parrot_PMC_set_string_keyed_str> 1352 1353=item C<Parrot_PMC_set_string_native> 1354 1355=item C<Parrot_PMC_set_string_same> 1356 1357=item C<Parrot_PMC_set_vtable> 1358 1359=item C<Parrot_PMC_share> 1360 1361=item C<Parrot_PMC_share_ro> 1362 1363=item C<Parrot_PMC_shift_float> 1364 1365=item C<Parrot_PMC_shift_integer> 1366 1367=item C<Parrot_PMC_shift_pmc> 1368 1369=item C<Parrot_PMC_shift_string> 1370 1371=item C<Parrot_PMC_splice> 1372 1373=item C<Parrot_PMC_substr> 1374 1375=item C<Parrot_PMC_subtract> 1376 1377=item C<Parrot_PMC_subtract_float> 1378 1379=item C<Parrot_PMC_subtract_int> 1380 1381=item C<Parrot_PMC_typenum> 1382 1383=item C<Parrot_PMC_unshift_float> 1384 1385=item C<Parrot_PMC_unshift_integer> 1386 1387=item C<Parrot_PMC_unshift_pmc> 1388 1389=item C<Parrot_PMC_unshift_string> 1390 1391=item C<Parrot_pop_context> 1392 1393=item C<Parrot_pop_mark> 1394 1395=item C<Parrot_printf> 1396 1397=item C<Parrot_psprintf> 1398 1399=item C<Parrot_push_action> 1400 1401=item C<Parrot_push_context> 1402 1403=item C<Parrot_push_mark> 1404 1405=item C<Parrot_util_range_rand> 1406 1407=item C<Parrot_hll_regenerate_HLL_namespaces> 1408 1409=item C<Parrot_register_encoding> 1410 1411=item C<Parrot_hll_register_HLL> 1412 1413=item C<Parrot_hll_register_HLL_type> 1414 1415=item C<Parrot_util_register_move> 1416 1417=item C<Parrot_register_pmc> 1418 1419=item C<Parrot_run_callback> 1420 1421=item C<Parrot_runcode> 1422 1423=item C<Parrot_schedule_event> 1424 1425=item C<Parrot_schedule_interp_qentry> 1426 1427=item C<Parrot_secret_snprintf> 1428 1429=item C<Parrot_gbl_set_config_hash_internal> 1430 1431=item C<Parrot_set_context_threshold> 1432 1433=item C<Parrot_set_debug> 1434 1435=item C<Parrot_set_executable_name> 1436 1437=item C<Parrot_set_flag> 1438 1439=item C<Parrot_ns_set_global> 1440 1441=item C<Parrot_set_intreg> 1442 1443=item C<Parrot_set_numreg> 1444 1445=item C<Parrot_set_pmcreg> 1446 1447=item C<Parrot_set_run_core> 1448 1449=item C<Parrot_set_strreg> 1450 1451=item C<Parrot_set_trace> 1452 1453=item C<Parrot_setwarnings> 1454 1455=item C<Parrot_shared_gc_block> 1456 1457=item C<Parrot_shared_gc_unblock> 1458 1459=item C<Parrot_sleep_on_event> 1460 1461=item C<Parrot_snprintf> 1462 1463=item C<Parrot_sprintf_c> 1464 1465=item C<Parrot_sprintf_s> 1466 1467=item C<Parrot_util_srand> 1468 1469=item C<Parrot_ns_store_global> 1470 1471=item C<Parrot_ns_store_sub> 1472 1473=item C<Parrot_str_boolean> 1474 1475=item C<Parrot_str_byte_length> 1476 1477=item C<Parrot_str_change_encoding> 1478 1479=item C<Parrot_str_chopn> 1480 1481=item C<Parrot_str_compare> 1482 1483=item C<Parrot_str_compose> 1484 1485=item C<Parrot_str_concat> 1486 1487=item C<Parrot_str_copy> 1488 1489=item C<Parrot_str_downcase> 1490 1491=item C<Parrot_str_equal> 1492 1493=item C<Parrot_str_escape> 1494 1495=item C<Parrot_str_escape_truncate> 1496 1497=item C<Parrot_str_find_cclass> 1498 1499=item C<Parrot_str_find_index> 1500 1501=item C<Parrot_str_find_not_cclass> 1502 1503=item C<Parrot_str_finish> 1504 1505=item C<Parrot_str_format_data> 1506 1507=item C<Parrot_str_free_cstring> 1508 1509=item C<Parrot_str_from_int> 1510 1511=item C<Parrot_str_from_num> 1512 1513=item C<Parrot_str_indexed> 1514 1515=item C<Parrot_str_cstring> 1516 1517=item C<Parrot_str_init> 1518 1519=item C<Parrot_str_is_cclass> 1520 1521=item C<Parrot_str_join> 1522 1523=item C<Parrot_str_length> 1524 1525=item C<Parrot_str_new> 1526 1527=item C<Parrot_str_new_constant> 1528 1529=item C<Parrot_str_new_init> 1530 1531=item C<Parrot_str_new_noinit> 1532 1533=item C<Parrot_str_not_equal> 1534 1535=item C<Parrot_str_pin> 1536 1537=item C<Parrot_str_repeat> 1538 1539=item C<Parrot_str_replace> 1540 1541=item C<Parrot_str_split> 1542 1543=item C<Parrot_str_substr> 1544 1545=item C<Parrot_str_titlecase> 1546 1547=item C<Parrot_str_to_cstring> 1548 1549=item C<Parrot_str_to_hashval> 1550 1551=item C<Parrot_str_to_int> 1552 1553=item C<Parrot_str_to_num> 1554 1555=item C<Parrot_str_unescape> 1556 1557=item C<Parrot_str_unpin> 1558 1559=item C<Parrot_str_upcase> 1560 1561=item C<Parrot_test_debug> 1562 1563=item C<Parrot_test_flag> 1564 1565=item C<Parrot_test_trace> 1566 1567=item C<Parrot_thaw> 1568 1569=item C<Parrot_thaw_constants> 1570 1571=item C<Parrot_util_uint_rand> 1572 1573=item C<Parrot_unblock_GC_mark> 1574 1575=item C<Parrot_unblock_GC_sweep> 1576 1577=item C<Parrot_unregister_pmc> 1578 1579=item C<Parrot_vfprintf> 1580 1581=item C<Parrot_vsnprintf> 1582 1583=item C<Parrot_vsprintf_c> 1584 1585=item C<Parrot_vsprintf_s> 1586 1587=item C<Parrot_warn> 1588 1589=item C<Parrot_pmc_is_null> 1590 1591=item C<pmc_new> 1592 1593=item C<pmc_type> 1594 1595=item C<PObj_custom_destroy_SET> 1596 1597=item C<PObj_custom_mark_SET> 1598 1599=item C<string_chr> 1600 1601=item C<string_make> 1602 1603=item C<string_max_bytes> 1604 1605=item C<string_ord> 1606 1607=item C<string_rep_compatible> 1608 1609=item C<string_to_cstring_nullable> 1610 1611=back 1612 1613=head1 SEE ALSO 1614 1615F<src/main.c> and F<t/src/*.t> for Parrot's use of the embedding system. 1616 1617=cut 1618