Skip to content
This repository
Browse code

Fixed codigstd tests

  • Loading branch information...
commit cc0610ab4ec0c4fb214e64d37f1dea13c7d1fa8d 1 parent 167abf5
Mariano Wahlmann authored December 19, 2010
7  MANIFEST
@@ -900,6 +900,7 @@ ext/nqp-rx/t/p6regex/rx_modifiers                           [test]
900 900
 ext/nqp-rx/t/p6regex/rx_quantifiers                         [test]
901 901
 ext/nqp-rx/t/p6regex/rx_subrules                            [test]
902 902
 ext/nqp-rx/t/p6regex/rx_syntax                              [test]
  903
+include/parrot/api.h                                        [main]include
903 904
 include/parrot/atomic.h                                     [main]include
904 905
 include/parrot/atomic/fallback.h                            [main]include
905 906
 include/parrot/atomic/gcc_pcc.h                             [main]include
@@ -915,7 +916,6 @@ include/parrot/datatypes.h                                  [main]include
915 916
 include/parrot/debugger.h                                   [main]include
916 917
 include/parrot/dynext.h                                     [main]include
917 918
 include/parrot/embed.h                                      [main]include
918  
-include/parrot/api.h                                        [main]include
919 919
 include/parrot/encoding.h                                   [main]include
920 920
 include/parrot/enums.h                                      [main]include
921 921
 include/parrot/exceptions.h                                 [main]include
@@ -1246,6 +1246,9 @@ src/dynpmc/rotest.pmc                                       []
1246 1246
 src/dynpmc/subproxy.pmc                                     []
1247 1247
 src/embed.c                                                 []
1248 1248
 src/embed/api.c                                             []
  1249
+src/embed/embed_private.h                                   []
  1250
+src/embed/pmc.c                                             []
  1251
+src/embed/strings.c                                         []
1249 1252
 src/exceptions.c                                            []
1250 1253
 src/exit.c                                                  []
1251 1254
 src/extend.c                                                []
@@ -1937,6 +1940,8 @@ t/src/README                                                []doc
1937 1940
 t/src/atomic.t                                              [test]
1938 1941
 t/src/basic.t                                               [test]
1939 1942
 t/src/embed.t                                               [test]
  1943
+t/src/embed/pmc.t                                           [test]
  1944
+t/src/embed/strings.t                                       [test]
1940 1945
 t/src/exit.t                                                [test]
1941 1946
 t/src/extend.t                                              [test]
1942 1947
 t/src/pointer_array.t                                       [test]
19  compilers/imcc/main.c
@@ -156,12 +156,13 @@ Set up the const struct declaration for cmd_options
156 156
 
157 157
 */
158 158
 
159  
-// TODO: Weed out the options that IMCC doesn't use, and rename this function
160  
-//       to something more imcc-ish
  159
+/* TODO: Weed out the options that IMCC doesn't use, and rename this function
  160
+         to something more imcc-ish
  161
+*/
  162
+
161 163
 static const struct longopt_opt_decl *
162 164
 Parrot_cmd_options(void)
163 165
 {
164  
-    //ASSERT_ARGS(Parrot_cmd_options)
165 166
     static const struct longopt_opt_decl cmd_options[] = {
166 167
         { '.', '.', (OPTION_flags)0, { "--wait" } },
167 168
         { 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } },
@@ -636,6 +637,18 @@ compile_to_bytecode(PARROT_INTERP,
636 637
     return pf;
637 638
 }
638 639
 
  640
+/*
  641
+
  642
+=item C<int imcc_run_api(PMC * interp_pmc, const char *sourcefile, int argc,
  643
+const char **argv, PMC **pbcpmc)>
  644
+
  645
+This is a wrapper around C<imcc_run> function in which the input parameter is a
  646
+PMC interpreter.
  647
+
  648
+=cut
  649
+
  650
+*/
  651
+
639 652
 PARROT_API
640 653
 int
641 654
 imcc_run_api(ARGMOD(PMC * interp_pmc), ARGIN(const char *sourcefile), int argc,
39  examples/embed/embedded_pir.c
... ...
@@ -1,39 +0,0 @@
1  
-/*
2  
- * Sample of an embedding application: compiles and executes "hello_world.pir"
3  
- */
4  
-
5  
-#include<stdio.h>
6  
-#include <stdlib.h>
7  
-
8  
-#include "parrot/api.h"
9  
-
10  
-int main(int argc, const char **argv)
11  
-{
12  
-  int exitcode;
13  
-  Parrot_PMC * interp;
14  
-  Parrot_PMC * compiler;
15  
-  Parrot_PMC * bytecode;
16  
-
17  
-  // Create the interpreter
18  
-  if (!Parrot_api_make_interpreter(NULL,NULL,NULL,&interp) ) {
19  
-    fprintf(stderr,"FATAL: Can't create the interpreter");
20  
-    return 1;
21  
-  }
22  
-
23  
-  // Compile hello_world.pir and execute it
24  
-  if (  Parrot_api_load_language(interp, "PIR") &&
25  
-        Parrot_api_get_compiler(interp, "PIR", &compiler) &&
26  
-        Parrot_api_compile_file(interp, compiler, "hello_world.pir", &bytecode) &&
27  
-        Parrot_api_load_bytecode(interp, bytecode) &&
28  
-        Parrot_api_run(interp, &exitcode))
29  
-    {
30  
-      return exitcode;
31  
-    }
32  
-  else
33  
-    {
34  
-      // Print last error to stderr
35  
-      const char * err = Parrot_api_get_last_error(interp);
36  
-      fprintf(stderr, err);
37  
-      return 1;
38  
-    }
39  
-}
4  examples/embed/hello_world.pir
... ...
@@ -1,4 +0,0 @@
1  
-# Sample creation of a "Hello world" program
2  
-.sub 'main' :main
3  
-     say 'Hello World!'
4  
-.end
270  include/parrot/api.h
@@ -94,9 +94,8 @@ PARROT_API
94 94
 Parrot_Int Parrot_api_disassemble_bytecode(
95 95
     Parrot_PMC interp_pmc,
96 96
     Parrot_PMC pbc,
97  
-    ARGIN(const char * const outfile),
98  
-    Parrot_Int opts)
99  
-        __attribute__nonnull__(3);
  97
+    ARGIN_NULLOK(const char * const outfile),
  98
+    Parrot_Int opts);
100 99
 
101 100
 PARROT_API
102 101
 Parrot_Int Parrot_api_flag(
@@ -252,8 +251,7 @@ Parrot_Int Parrot_api_wrap_imcc_hack(
252 251
 #define ASSERT_ARGS_Parrot_api_destroy_interpreter \
253 252
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
254 253
 #define ASSERT_ARGS_Parrot_api_disassemble_bytecode \
255  
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
256  
-       PARROT_ASSERT_ARG(outfile))
  254
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
257 255
 #define ASSERT_ARGS_Parrot_api_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
258 256
 #define ASSERT_ARGS_Parrot_api_get_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
259 257
        PARROT_ASSERT_ARG(compiler))
@@ -300,87 +298,101 @@ Parrot_Int Parrot_api_wrap_imcc_hack(
300 298
 
301 299
 PARROT_API
302 300
 Parrot_Int Parrot_api_string_export_ascii(
303  
-    Parrot_PMC interp_pmc,
  301
+    ARGIN(Parrot_PMC interp_pmc),
304 302
     ARGIN(Parrot_String string),
305 303
     ARGOUT(char ** strout))
  304
+        __attribute__nonnull__(1)
306 305
         __attribute__nonnull__(2)
307 306
         __attribute__nonnull__(3)
308 307
         FUNC_MODIFIES(* strout);
309 308
 
310 309
 PARROT_API
311 310
 Parrot_Int Parrot_api_string_export_wchar(
312  
-    Parrot_PMC interp_pmc,
  311
+    ARGIN(Parrot_PMC interp_pmc),
313 312
     ARGIN(Parrot_String string),
314 313
     ARGOUT(wchar_t ** strout))
  314
+        __attribute__nonnull__(1)
315 315
         __attribute__nonnull__(2)
316 316
         __attribute__nonnull__(3)
317 317
         FUNC_MODIFIES(* strout);
318 318
 
319 319
 PARROT_API
320 320
 Parrot_Int Parrot_api_string_free_exported_ascii(
321  
-    Parrot_PMC interp_pmc,
  321
+    ARGIN(Parrot_PMC interp_pmc),
322 322
     ARGIN(char * const str))
  323
+        __attribute__nonnull__(1)
323 324
         __attribute__nonnull__(2);
324 325
 
325 326
 PARROT_API
326 327
 Parrot_Int Parrot_api_string_free_exported_wchar(
327  
-    Parrot_PMC interp_pmc,
  328
+    ARGIN(Parrot_PMC interp_pmc),
328 329
     ARGIN(wchar_t * const str))
  330
+        __attribute__nonnull__(1)
329 331
         __attribute__nonnull__(2);
330 332
 
331 333
 PARROT_API
332 334
 Parrot_Int Parrot_api_string_import_ascii(
333  
-    Parrot_PMC interp_pmc,
  335
+    ARGIN(Parrot_PMC interp_pmc),
334 336
     ARGIN(const char * str),
335 337
     ARGOUT(Parrot_String * out))
  338
+        __attribute__nonnull__(1)
336 339
         __attribute__nonnull__(2)
337 340
         __attribute__nonnull__(3)
338 341
         FUNC_MODIFIES(* out);
339 342
 
340 343
 PARROT_API
341 344
 Parrot_Int Parrot_api_string_import_binary(
342  
-    Parrot_PMC interp_pmc,
  345
+    ARGIN(Parrot_PMC interp_pmc),
343 346
     ARGIN(const unsigned char *bytes),
344  
-    Parrot_Int length,
  347
+    ARGIN_NULLOK(Parrot_Int length),
345 348
     ARGOUT(Parrot_String *out))
  349
+        __attribute__nonnull__(1)
346 350
         __attribute__nonnull__(2)
347 351
         __attribute__nonnull__(4)
348 352
         FUNC_MODIFIES(*out);
349 353
 
350 354
 PARROT_API
351 355
 Parrot_Int Parrot_api_string_import_wchar(
352  
-    Parrot_PMC interp_pmc,
  356
+    ARGIN(Parrot_PMC interp_pmc),
353 357
     ARGIN(wchar_t * str),
354 358
     ARGOUT(Parrot_String * out))
  359
+        __attribute__nonnull__(1)
355 360
         __attribute__nonnull__(2)
356 361
         __attribute__nonnull__(3)
357 362
         FUNC_MODIFIES(* out);
358 363
 
359 364
 #define ASSERT_ARGS_Parrot_api_string_export_ascii \
360 365
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
361  
-       PARROT_ASSERT_ARG(string) \
  366
+       PARROT_ASSERT_ARG(interp_pmc) \
  367
+    , PARROT_ASSERT_ARG(string) \
362 368
     , PARROT_ASSERT_ARG(strout))
363 369
 #define ASSERT_ARGS_Parrot_api_string_export_wchar \
364 370
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
365  
-       PARROT_ASSERT_ARG(string) \
  371
+       PARROT_ASSERT_ARG(interp_pmc) \
  372
+    , PARROT_ASSERT_ARG(string) \
366 373
     , PARROT_ASSERT_ARG(strout))
367 374
 #define ASSERT_ARGS_Parrot_api_string_free_exported_ascii \
368 375
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
369  
-       PARROT_ASSERT_ARG(str))
  376
+       PARROT_ASSERT_ARG(interp_pmc) \
  377
+    , PARROT_ASSERT_ARG(str))
370 378
 #define ASSERT_ARGS_Parrot_api_string_free_exported_wchar \
371 379
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
372  
-       PARROT_ASSERT_ARG(str))
  380
+       PARROT_ASSERT_ARG(interp_pmc) \
  381
+    , PARROT_ASSERT_ARG(str))
373 382
 #define ASSERT_ARGS_Parrot_api_string_import_ascii \
374 383
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
375  
-       PARROT_ASSERT_ARG(str) \
  384
+       PARROT_ASSERT_ARG(interp_pmc) \
  385
+    , PARROT_ASSERT_ARG(str) \
376 386
     , PARROT_ASSERT_ARG(out))
377 387
 #define ASSERT_ARGS_Parrot_api_string_import_binary \
378 388
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
379  
-       PARROT_ASSERT_ARG(bytes) \
  389
+       PARROT_ASSERT_ARG(interp_pmc) \
  390
+    , PARROT_ASSERT_ARG(bytes) \
380 391
     , PARROT_ASSERT_ARG(out))
381 392
 #define ASSERT_ARGS_Parrot_api_string_import_wchar \
382 393
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
383  
-       PARROT_ASSERT_ARG(str) \
  394
+       PARROT_ASSERT_ARG(interp_pmc) \
  395
+    , PARROT_ASSERT_ARG(str) \
384 396
     , PARROT_ASSERT_ARG(out))
385 397
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
386 398
 /* HEADERIZER END: src/embed/strings.c */
@@ -390,185 +402,267 @@ Parrot_Int Parrot_api_string_import_wchar(
390 402
 
391 403
 PARROT_API
392 404
 Parrot_Int Parrot_api_add_exception_handler(
393  
-    Parrot_PMC interp_pmc,
394  
-    Parrot_PMC handler);
  405
+    ARGIN(Parrot_PMC interp_pmc),
  406
+    ARGIN(Parrot_PMC handler))
  407
+        __attribute__nonnull__(1)
  408
+        __attribute__nonnull__(2);
395 409
 
396 410
 PARROT_API
397 411
 Parrot_Int Parrot_api_pmc_box_string(
398  
-    Parrot_PMC interp_pmc,
399  
-    Parrot_String str,
  412
+    ARGIN(Parrot_PMC interp_pmc),
  413
+    ARGIN(Parrot_String str),
400 414
     ARGOUT(Parrot_PMC * str_pmc))
  415
+        __attribute__nonnull__(1)
  416
+        __attribute__nonnull__(2)
401 417
         __attribute__nonnull__(3)
402 418
         FUNC_MODIFIES(* str_pmc);
403 419
 
404 420
 PARROT_API
405 421
 Parrot_Int Parrot_api_pmc_deserialize(
406  
-    Parrot_PMC interp_pmc,
407  
-    Parrot_String fpmc,
  422
+    ARGIN(Parrot_PMC interp_pmc),
  423
+    ARGIN(Parrot_String fpmc),
408 424
     ARGOUT(Parrot_PMC * pmc))
  425
+        __attribute__nonnull__(1)
  426
+        __attribute__nonnull__(2)
409 427
         __attribute__nonnull__(3)
410 428
         FUNC_MODIFIES(* pmc);
411 429
 
412 430
 PARROT_API
413 431
 Parrot_Int Parrot_api_pmc_deserialize_bytes(
414  
-    Parrot_PMC interp_pmc,
  432
+    ARGIN(Parrot_PMC interp_pmc),
415 433
     ARGIN(const unsigned char * const fpmc),
416  
-    Parrot_Int length,
  434
+    ARGIN_NULLOK(Parrot_Int length),
417 435
     ARGOUT(Parrot_PMC * pmc))
  436
+        __attribute__nonnull__(1)
418 437
         __attribute__nonnull__(2)
419 438
         __attribute__nonnull__(4)
420 439
         FUNC_MODIFIES(* pmc);
421 440
 
422 441
 PARROT_API
423 442
 Parrot_Int Parrot_api_pmc_get_class(
424  
-    Parrot_PMC interp_pmc,
425  
-    Parrot_PMC key,
426  
-    ARGOUT(Parrot_PMC *class))
  443
+    ARGIN(Parrot_PMC interp_pmc),
  444
+    ARGIN(Parrot_PMC key),
  445
+    ARGOUT(Parrot_PMC *class_pmc))
  446
+        __attribute__nonnull__(1)
  447
+        __attribute__nonnull__(2)
427 448
         __attribute__nonnull__(3)
428  
-        FUNC_MODIFIES(*class);
  449
+        FUNC_MODIFIES(*class_pmc);
429 450
 
430 451
 PARROT_API
431 452
 Parrot_Int Parrot_api_pmc_get_float(
432  
-    Parrot_PMC interp_pmc,
433  
-    Parrot_PMC pmc,
  453
+    ARGIN(Parrot_PMC interp_pmc),
  454
+    ARGIN(Parrot_PMC pmc),
434 455
     ARGOUT(Parrot_Float * value))
  456
+        __attribute__nonnull__(1)
  457
+        __attribute__nonnull__(2)
435 458
         __attribute__nonnull__(3)
436 459
         FUNC_MODIFIES(* value);
437 460
 
438 461
 PARROT_API
439 462
 Parrot_Int Parrot_api_pmc_get_integer(
440  
-    Parrot_PMC interp_pmc,
441  
-    Parrot_PMC pmc,
  463
+    ARGIN(Parrot_PMC interp_pmc),
  464
+    ARGIN(Parrot_PMC pmc),
442 465
     ARGOUT(Parrot_Int * value))
  466
+        __attribute__nonnull__(1)
  467
+        __attribute__nonnull__(2)
443 468
         __attribute__nonnull__(3)
444 469
         FUNC_MODIFIES(* value);
445 470
 
446 471
 PARROT_API
447 472
 Parrot_Int Parrot_api_pmc_get_keyed_int(
448  
-    Parrot_PMC interp_pmc,
449  
-    Parrot_PMC pmc,
450  
-    Parrot_Int key,
  473
+    ARGIN(Parrot_PMC interp_pmc),
  474
+    ARGIN(Parrot_PMC pmc),
  475
+    ARGIN_NULLOK(Parrot_Int key),
451 476
     ARGOUT(Parrot_PMC * value))
  477
+        __attribute__nonnull__(1)
  478
+        __attribute__nonnull__(2)
452 479
         __attribute__nonnull__(4)
453 480
         FUNC_MODIFIES(* value);
454 481
 
455 482
 PARROT_API
456 483
 Parrot_Int Parrot_api_pmc_get_keyed_string(
457  
-    Parrot_PMC interp_pmc,
458  
-    Parrot_PMC pmc,
459  
-    Parrot_String key,
  484
+    ARGIN(Parrot_PMC interp_pmc),
  485
+    ARGIN(Parrot_PMC pmc),
  486
+    ARGIN(Parrot_String key),
460 487
     ARGOUT(Parrot_PMC * value))
  488
+        __attribute__nonnull__(1)
  489
+        __attribute__nonnull__(2)
  490
+        __attribute__nonnull__(3)
461 491
         __attribute__nonnull__(4)
462 492
         FUNC_MODIFIES(* value);
463 493
 
464 494
 PARROT_API
465 495
 Parrot_Int Parrot_api_pmc_get_string(
466  
-    Parrot_PMC interp_pmc,
467  
-    Parrot_PMC pmc,
  496
+    ARGIN(Parrot_PMC interp_pmc),
  497
+    ARGIN(Parrot_PMC pmc),
468 498
     ARGOUT(Parrot_String * str))
  499
+        __attribute__nonnull__(1)
  500
+        __attribute__nonnull__(2)
469 501
         __attribute__nonnull__(3)
470 502
         FUNC_MODIFIES(* str);
471 503
 
472 504
 PARROT_API
473 505
 Parrot_Int Parrot_api_pmc_invoke(
474  
-    Parrot_PMC interp_pmc,
475  
-    Parrot_PMC sub,
476  
-    Parrot_PMC signature);
  506
+    ARGIN(Parrot_PMC interp_pmc),
  507
+    ARGIN(Parrot_PMC sub),
  508
+    ARGIN(Parrot_PMC signature))
  509
+        __attribute__nonnull__(1)
  510
+        __attribute__nonnull__(2)
  511
+        __attribute__nonnull__(3);
477 512
 
478 513
 PARROT_API
479 514
 Parrot_Int Parrot_api_pmc_new(
480  
-    Parrot_PMC interp_pmc,
481  
-    Parrot_PMC class,
  515
+    ARGIN(Parrot_PMC interp_pmc),
  516
+    ARGIN(Parrot_PMC class_pmc),
482 517
     ARGOUT(Parrot_PMC *pmc))
  518
+        __attribute__nonnull__(1)
  519
+        __attribute__nonnull__(2)
483 520
         __attribute__nonnull__(3)
484 521
         FUNC_MODIFIES(*pmc);
485 522
 
486 523
 PARROT_API
487 524
 Parrot_Int Parrot_api_pmc_null(
488  
-    Parrot_PMC interp_pmc,
  525
+    ARGIN(Parrot_PMC interp_pmc),
489 526
     ARGMOD(Parrot_PMC *pmctonull))
  527
+        __attribute__nonnull__(1)
490 528
         __attribute__nonnull__(2)
491 529
         FUNC_MODIFIES(*pmctonull);
492 530
 
493 531
 PARROT_API
494 532
 Parrot_Int Parrot_api_pmc_set_float(
495  
-    Parrot_PMC interp_pmc,
496  
-    Parrot_PMC pmc,
497  
-    Parrot_Float value);
  533
+    ARGIN(Parrot_PMC interp_pmc),
  534
+    ARGIN(Parrot_PMC pmc),
  535
+    ARGIN_NULLOK(Parrot_Float value))
  536
+        __attribute__nonnull__(1)
  537
+        __attribute__nonnull__(2);
498 538
 
499 539
 PARROT_API
500 540
 Parrot_Int Parrot_api_pmc_set_integer(
501  
-    Parrot_PMC interp_pmc,
502  
-    Parrot_PMC pmc,
503  
-    Parrot_Int value);
  541
+    ARGIN(Parrot_PMC interp_pmc),
  542
+    ARGIN(Parrot_PMC pmc),
  543
+    ARGIN_NULLOK(Parrot_Int value))
  544
+        __attribute__nonnull__(1)
  545
+        __attribute__nonnull__(2);
504 546
 
505 547
 PARROT_API
506 548
 Parrot_Int Parrot_api_pmc_set_keyed_int(
507  
-    Parrot_PMC interp_pmc,
508  
-    Parrot_PMC pmc,
509  
-    Parrot_Int key,
510  
-    Parrot_PMC value);
  549
+    ARGIN(Parrot_PMC interp_pmc),
  550
+    ARGIN(Parrot_PMC pmc),
  551
+    ARGIN_NULLOK(Parrot_Int key),
  552
+    ARGIN(Parrot_PMC value))
  553
+        __attribute__nonnull__(1)
  554
+        __attribute__nonnull__(2)
  555
+        __attribute__nonnull__(4);
511 556
 
512 557
 PARROT_API
513 558
 Parrot_Int Parrot_api_pmc_set_keyed_string(
514  
-    Parrot_PMC interp_pmc,
515  
-    Parrot_PMC pmc,
516  
-    Parrot_String key,
517  
-    Parrot_PMC value);
  559
+    ARGIN(Parrot_PMC interp_pmc),
  560
+    ARGIN(Parrot_PMC pmc),
  561
+    ARGIN(Parrot_String key),
  562
+    ARGIN(Parrot_PMC value))
  563
+        __attribute__nonnull__(1)
  564
+        __attribute__nonnull__(2)
  565
+        __attribute__nonnull__(3)
  566
+        __attribute__nonnull__(4);
518 567
 
519 568
 PARROT_API
520 569
 Parrot_Int Parrot_api_pmc_set_string(
521  
-    Parrot_PMC interp_pmc,
522  
-    Parrot_PMC pmc,
523  
-    Parrot_String value);
  570
+    ARGIN(Parrot_PMC interp_pmc),
  571
+    ARGIN(Parrot_PMC pmc),
  572
+    ARGIN(Parrot_String value))
  573
+        __attribute__nonnull__(1)
  574
+        __attribute__nonnull__(2)
  575
+        __attribute__nonnull__(3);
524 576
 
525 577
 PARROT_API
526 578
 Parrot_Int Parrot_api_pmc_wrap_string_array(
527  
-    Parrot_PMC interp_pmc,
528  
-    Parrot_Int argc,
  579
+    ARGIN(Parrot_PMC interp_pmc),
  580
+    ARGIN_NULLOK(Parrot_Int argc),
529 581
     ARGIN(const char ** argv),
530 582
     ARGOUT(Parrot_PMC * args))
  583
+        __attribute__nonnull__(1)
531 584
         __attribute__nonnull__(3)
532 585
         __attribute__nonnull__(4)
533 586
         FUNC_MODIFIES(* args);
534 587
 
535 588
 #define ASSERT_ARGS_Parrot_api_add_exception_handler \
536  
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
  589
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  590
+       PARROT_ASSERT_ARG(interp_pmc) \
  591
+    , PARROT_ASSERT_ARG(handler))
537 592
 #define ASSERT_ARGS_Parrot_api_pmc_box_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
538  
-       PARROT_ASSERT_ARG(str_pmc))
  593
+       PARROT_ASSERT_ARG(interp_pmc) \
  594
+    , PARROT_ASSERT_ARG(str) \
  595
+    , PARROT_ASSERT_ARG(str_pmc))
539 596
 #define ASSERT_ARGS_Parrot_api_pmc_deserialize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
540  
-       PARROT_ASSERT_ARG(pmc))
  597
+       PARROT_ASSERT_ARG(interp_pmc) \
  598
+    , PARROT_ASSERT_ARG(fpmc) \
  599
+    , PARROT_ASSERT_ARG(pmc))
541 600
 #define ASSERT_ARGS_Parrot_api_pmc_deserialize_bytes \
542 601
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
543  
-       PARROT_ASSERT_ARG(fpmc) \
  602
+       PARROT_ASSERT_ARG(interp_pmc) \
  603
+    , PARROT_ASSERT_ARG(fpmc) \
544 604
     , PARROT_ASSERT_ARG(pmc))
545 605
 #define ASSERT_ARGS_Parrot_api_pmc_get_class __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
546  
-       PARROT_ASSERT_ARG(class))
  606
+       PARROT_ASSERT_ARG(interp_pmc) \
  607
+    , PARROT_ASSERT_ARG(key) \
  608
+    , PARROT_ASSERT_ARG(class_pmc))
547 609
 #define ASSERT_ARGS_Parrot_api_pmc_get_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
548  
-       PARROT_ASSERT_ARG(value))
  610
+       PARROT_ASSERT_ARG(interp_pmc) \
  611
+    , PARROT_ASSERT_ARG(pmc) \
  612
+    , PARROT_ASSERT_ARG(value))
549 613
 #define ASSERT_ARGS_Parrot_api_pmc_get_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
550  
-       PARROT_ASSERT_ARG(value))
  614
+       PARROT_ASSERT_ARG(interp_pmc) \
  615
+    , PARROT_ASSERT_ARG(pmc) \
  616
+    , PARROT_ASSERT_ARG(value))
551 617
 #define ASSERT_ARGS_Parrot_api_pmc_get_keyed_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
552  
-       PARROT_ASSERT_ARG(value))
  618
+       PARROT_ASSERT_ARG(interp_pmc) \
  619
+    , PARROT_ASSERT_ARG(pmc) \
  620
+    , PARROT_ASSERT_ARG(value))
553 621
 #define ASSERT_ARGS_Parrot_api_pmc_get_keyed_string \
554 622
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
555  
-       PARROT_ASSERT_ARG(value))
  623
+       PARROT_ASSERT_ARG(interp_pmc) \
  624
+    , PARROT_ASSERT_ARG(pmc) \
  625
+    , PARROT_ASSERT_ARG(key) \
  626
+    , PARROT_ASSERT_ARG(value))
556 627
 #define ASSERT_ARGS_Parrot_api_pmc_get_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
557  
-       PARROT_ASSERT_ARG(str))
558  
-#define ASSERT_ARGS_Parrot_api_pmc_invoke __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
  628
+       PARROT_ASSERT_ARG(interp_pmc) \
  629
+    , PARROT_ASSERT_ARG(pmc) \
  630
+    , PARROT_ASSERT_ARG(str))
  631
+#define ASSERT_ARGS_Parrot_api_pmc_invoke __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  632
+       PARROT_ASSERT_ARG(interp_pmc) \
  633
+    , PARROT_ASSERT_ARG(sub) \
  634
+    , PARROT_ASSERT_ARG(signature))
559 635
 #define ASSERT_ARGS_Parrot_api_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
560  
-       PARROT_ASSERT_ARG(pmc))
  636
+       PARROT_ASSERT_ARG(interp_pmc) \
  637
+    , PARROT_ASSERT_ARG(class_pmc) \
  638
+    , PARROT_ASSERT_ARG(pmc))
561 639
 #define ASSERT_ARGS_Parrot_api_pmc_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
562  
-       PARROT_ASSERT_ARG(pmctonull))
563  
-#define ASSERT_ARGS_Parrot_api_pmc_set_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
564  
-#define ASSERT_ARGS_Parrot_api_pmc_set_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
565  
-#define ASSERT_ARGS_Parrot_api_pmc_set_keyed_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
  640
+       PARROT_ASSERT_ARG(interp_pmc) \
  641
+    , PARROT_ASSERT_ARG(pmctonull))
  642
+#define ASSERT_ARGS_Parrot_api_pmc_set_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  643
+       PARROT_ASSERT_ARG(interp_pmc) \
  644
+    , PARROT_ASSERT_ARG(pmc))
  645
+#define ASSERT_ARGS_Parrot_api_pmc_set_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  646
+       PARROT_ASSERT_ARG(interp_pmc) \
  647
+    , PARROT_ASSERT_ARG(pmc))
  648
+#define ASSERT_ARGS_Parrot_api_pmc_set_keyed_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  649
+       PARROT_ASSERT_ARG(interp_pmc) \
  650
+    , PARROT_ASSERT_ARG(pmc) \
  651
+    , PARROT_ASSERT_ARG(value))
566 652
 #define ASSERT_ARGS_Parrot_api_pmc_set_keyed_string \
567  
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
568  
-#define ASSERT_ARGS_Parrot_api_pmc_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
  653
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  654
+       PARROT_ASSERT_ARG(interp_pmc) \
  655
+    , PARROT_ASSERT_ARG(pmc) \
  656
+    , PARROT_ASSERT_ARG(key) \
  657
+    , PARROT_ASSERT_ARG(value))
  658
+#define ASSERT_ARGS_Parrot_api_pmc_set_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
  659
+       PARROT_ASSERT_ARG(interp_pmc) \
  660
+    , PARROT_ASSERT_ARG(pmc) \
  661
+    , PARROT_ASSERT_ARG(value))
569 662
 #define ASSERT_ARGS_Parrot_api_pmc_wrap_string_array \
570 663
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
571  
-       PARROT_ASSERT_ARG(argv) \
  664
+       PARROT_ASSERT_ARG(interp_pmc) \
  665
+    , PARROT_ASSERT_ARG(argv) \
572 666
     , PARROT_ASSERT_ARG(args))
573 667
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
574 668
 /* HEADERIZER END: src/embed/pmc.c */
14  src/debug.c
@@ -3264,7 +3264,8 @@ PDB_help(PARROT_INTERP, ARGIN(const char *command))
3264 3264
 
3265 3265
 /*
3266 3266
 
3267  
-=item C<STRING *Parrot_dbg_get_exception_backtrace(PARROT_INTERP, ARGMOD(PMC * exception))>
  3267
+=item C<STRING * Parrot_dbg_get_exception_backtrace(PARROT_INTERP, PMC *
  3268
+exception)>
3268 3269
 
3269 3270
 Returns an string containing the backtrace of the interpreter's call chain for a given exception.
3270 3271
 
@@ -3276,7 +3277,7 @@ Returns an string containing the backtrace of the interpreter's call chain for a
3276 3277
 STRING *
3277 3278
 Parrot_dbg_get_exception_backtrace(PARROT_INTERP, ARGMOD(PMC * exception))
3278 3279
 {
3279  
-    ASSERT_ARGS(PDB_backtrace)
  3280
+    ASSERT_ARGS(Parrot_dbg_get_exception_backtrace)
3280 3281
     STRING           *str;
3281 3282
     PMC              *old       = PMCNULL;
3282 3283
     int               rec_level = 0;
@@ -3295,9 +3296,9 @@ Parrot_dbg_get_exception_backtrace(PARROT_INTERP, ARGMOD(PMC * exception))
3295 3296
 
3296 3297
 /*
3297 3298
 
3298  
-=item CS<static PMC * get_exception_context(PARROT_INTERP, ARGMOD(PMC * exception))>
  3299
+=item C<static PMC * get_exception_context(PARROT_INTERP, PMC * exception)>
3299 3300
 
3300  
-Returns the context in which the exception was generated. 
  3301
+Returns the context in which the exception was generated.
3301 3302
 
3302 3303
 =cut
3303 3304
 
@@ -3306,6 +3307,7 @@ Returns the context in which the exception was generated.
3306 3307
 static PMC *
3307 3308
 get_exception_context(PARROT_INTERP, ARGMOD(PMC * exception))
3308 3309
 {
  3310
+    ASSERT_ARGS(get_exception_context)
3309 3311
     PMC * const thrower = VTABLE_get_attr_str(interp, exception, CONST_STRING(interp, "thrower"));
3310 3312
     if (!PMC_IS_NULL(thrower))
3311 3313
         return thrower;
@@ -3344,8 +3346,8 @@ PDB_backtrace(PARROT_INTERP)
3344 3346
 
3345 3347
 /*
3346 3348
 
3347  
-=item C<static STRING * PDB_get_continuation_backtrace(PARROT_INTERP, ARGMOD_NULLOK(PMC * sub),
3348  
-ARGMOD(PMC * ctx))>
  3349
+=item C<static STRING * PDB_get_continuation_backtrace(PARROT_INTERP, PMC * sub,
  3350
+PMC * ctx)>
3349 3351
 
3350 3352
 Returns an string with the backtrace of interpreter's call chain for the given sub including
3351 3353
 context information.
295  src/embed/api.c
@@ -3,11 +3,15 @@ Copyright (C) 2010, Parrot Foundation.
3 3
 
4 4
 =head1 NAME
5 5
 
6  
-src/embed/api.c - TO COME
  6
+src/embed/api.c - The Parrot embedding interface
7 7
 
8 8
 =head1 DESCRIPTION
9 9
 
10  
-TO COME.
  10
+This file implements functions of the Parrot embedding interface.
  11
+
  12
+=head2 Functions
  13
+
  14
+=over 4
11 15
 
12 16
 =cut
13 17
 
@@ -24,15 +28,17 @@ TO COME.
24 28
 
25 29
 /*
26 30
 
27  
-=item C<Parrot_Int Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error),
28  
-ARGOUT(Parrot_PMC * exception), ARGOUT(Parrot_Int *exit_code), ARGOUT(Parrot_String * errmsg))>
  31
+=item C<Parrot_Int Parrot_api_get_result(Parrot_PMC interp_pmc, Parrot_Int
  32
+*is_error, Parrot_PMC * exception, Parrot_Int *exit_code, Parrot_String *
  33
+errmsg)>
29 34
 
30  
-Gets the results of the last API function call and stores the results in C<is_error>, 
31  
-C<exception>, C<exit_code> and C<errmsg>. This function returns a true value if this
32  
-call is successful and false value otherwise. The stored information is as follow:
  35
+Gets the results of the last API function call and stores the results in
  36
+C<is_error>, C<exception>, C<exit_code> and C<errmsg>. This function returns
  37
+a true value if this call is successful and false value otherwise. The stored
  38
+information is as follow:
33 39
 
34  
-C<is_error> a true value if an unhandled exception was thrown or the program terminated 
35  
-with an error condition and a false value otherwise.
  40
+C<is_error> a true value if an unhandled exception was thrown or the program
  41
+terminated with an error condition and a false value otherwise.
36 42
 
37 43
 C<exception> the last exception thrown.
38 44
 
@@ -50,6 +56,7 @@ Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error),
50 56
         ARGOUT(Parrot_PMC * exception), ARGOUT(Parrot_Int *exit_code),
51 57
         ARGOUT(Parrot_String * errmsg))
52 58
 {
  59
+    ASSERT_ARGS(Parrot_api_get_result)
53 60
     EMBED_API_CALLIN(interp_pmc, interp)
54 61
     *exit_code = interp->exit_code;
55 62
     *exception = interp->final_exception;
@@ -69,11 +76,11 @@ Parrot_api_get_result(Parrot_PMC interp_pmc, ARGOUT(Parrot_Int *is_error),
69 76
 /*
70 77
 
71 78
 =item C<Parrot_Int Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc,
72  
-Parrot_PMC exception, ARGOUT(Parrot_String * bt))>
  79
+Parrot_PMC exception, Parrot_String * bt)>
73 80
 
74  
-Gets the backtrace of the interpreter's call chain for the given exception C<expcetion>
75  
-and stores the results in string C<bt>. This function returns a true value if this
76  
-call is successful and false value otherwise.
  81
+Gets the backtrace of the interpreter's call chain for the given exception
  82
+C<expcetion> and stores the results in string C<bt>. This function returns a
  83
+true value if this call is successful and false value otherwise.
77 84
 
78 85
 =cut
79 86
 
@@ -84,6 +91,7 @@ Parrot_Int
84 91
 Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc,
85 92
         Parrot_PMC exception, ARGOUT(Parrot_String * bt))
86 93
 {
  94
+    ASSERT_ARGS(Parrot_api_get_exception_backtrace)
87 95
     EMBED_API_CALLIN(interp_pmc, interp)
88 96
     STRING * const bts = Parrot_dbg_get_exception_backtrace(interp, exception);
89 97
     *bt = bts;
@@ -93,13 +101,13 @@ Parrot_api_get_exception_backtrace(Parrot_PMC interp_pmc,
93 101
 
94 102
 /*
95 103
 
96  
-=item C<Parrot_Int Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags,
97  
-ARGIN_NULLOK(Parrot_Init_Args *args), ARGOUT(Parrot_PMC *interp))>
  104
+=item C<Parrot_Int Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int
  105
+flags, Parrot_Init_Args *args, Parrot_PMC *interp)>
98 106
 
99  
-Creates a new interpreter and stores it in C<interp>. It takes three optional parameters
100  
-the new interpreter's C<flags>, the initialization paremeters C<args> and the C<parent> 
101  
-interpreter. This function returns a true value if this call is successful and false 
102  
-value otherwise.
  107
+Creates a new interpreter and stores it in C<interp>. It takes three optional
  108
+parameters the new interpreter's C<flags>, the initialization paremeters C<args>
  109
+and the C<parent> interpreter. This function returns a true value if this call
  110
+is successful and false value otherwise.
103 111
 
104 112
 =cut
105 113
 
@@ -110,7 +118,7 @@ Parrot_Int
110 118
 Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags,
111 119
         ARGIN_NULLOK(Parrot_Init_Args *args), ARGOUT(Parrot_PMC *interp))
112 120
 {
113  
-    //ASSERT_ARGS(Parrot_api_make_interpreter)
  121
+    ASSERT_ARGS(Parrot_api_make_interpreter)
114 122
     int alt_stacktop;
115 123
     Parrot_Interp interp_raw;
116 124
     void *stacktop_ptr = &alt_stacktop;
@@ -134,12 +142,12 @@ Parrot_api_make_interpreter(Parrot_PMC parent, Parrot_Int flags,
134 142
 
135 143
 /*
136 144
 
137  
-=item C<Parrot_Int Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename),
138  
-Parrot_UInt trace)>
  145
+=item C<Parrot_Int Parrot_api_set_runcore(Parrot_PMC interp_pmc, const char *
  146
+corename, Parrot_UInt trace)>
139 147
 
140  
-Sets the C<interp_pmc>'s bytecode running core, the core is specified by the C<corename>
141  
-parameter. This function returns a true value if this call is successful and false value 
142  
-otherwise.
  148
+Sets the C<interp_pmc>'s bytecode running core, the core is specified by the
  149
+C<corename>. This function returns a true value if this call is successful and
  150
+false value otherwise.
143 151
 
144 152
 =cut
145 153
 
@@ -150,7 +158,7 @@ Parrot_Int
150 158
 Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename),
151 159
         Parrot_UInt trace)
152 160
 {
153  
-    //ASSERT_ARGS(Parrot_api_set_runcore)
  161
+    ASSERT_ARGS(Parrot_api_set_runcore)
154 162
     EMBED_API_CALLIN(interp_pmc, interp)
155 163
     if (trace) {
156 164
         Parrot_pcc_trace_flags_on(interp, interp->ctx, trace);
@@ -178,11 +186,12 @@ Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename),
178 186
 
179 187
 /*
180 188
 
181  
-=item C<Parrot_Int Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)>
  189
+=item C<Parrot_Int Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int
  190
+flags, Parrot_Int set)>
182 191
 
183  
-Set/Unset the C<interp_pmc>'s debug flags. If C<set> is in a true value debug flags are set
184  
-otherwise debug flags are cleared. This function returns a true value if this call is successful 
185  
-and false value otherwise.
  192
+Sets/Unsets the C<interp_pmc>'s debug flags. If C<set> is in a true value debug
  193
+flags are set otherwise debug flags are cleared. This function returns a true
  194
+value if this call is successful and false value otherwise.
186 195
 
187 196
 =cut
188 197
 
@@ -192,7 +201,7 @@ PARROT_API
192 201
 Parrot_Int
193 202
 Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
194 203
 {
195  
-    //ASSERT_ARGS(Parrot_api_debug_flag)
  204
+    ASSERT_ARGS(Parrot_api_debug_flag)
196 205
     EMBED_API_CALLIN(interp_pmc, interp)
197 206
     if (set)
198 207
         interp->debug_flags |= flags;
@@ -203,11 +212,12 @@ Parrot_api_debug_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
203 212
 
204 213
 /*
205 214
 
206  
-=item C<Parrot_Int Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)>
  215
+=item C<Parrot_Int Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags,
  216
+Parrot_Int set)>
207 217
 
208  
-Set/Unset the C<interp_pmc>'s general flags. If C<set> is in a true value general flags are
209  
-set otherwise passed flags are cleared. This function returns a true value if this call is 
210  
-successful and false value otherwise.
  218
+Set/Unset the C<interp_pmc>'s general flags. If C<set> is in a true value general
  219
+flags are set otherwise passed flags are cleared. This function returns a true
  220
+value if this call is successful and false value otherwise.
211 221
 
212 222
 =cut
213 223
 
@@ -217,7 +227,7 @@ PARROT_API
217 227
 Parrot_Int
218 228
 Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
219 229
 {
220  
-    //ASSERT_ARGS(Parrot_api_flag)
  230
+    ASSERT_ARGS(Parrot_api_flag)
221 231
     EMBED_API_CALLIN(interp_pmc, interp)
222 232
     if (set) {
223 233
         Interp_flags_SET(interp, flags);
@@ -231,10 +241,11 @@ Parrot_api_flag(Parrot_PMC interp_pmc, Parrot_Int flags, Parrot_Int set)
231 241
 
232 242
 /*
233 243
 
234  
-=item C<Parrot_Int Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char * name))>
  244
+=item C<Parrot_Int Parrot_api_set_executable_name(Parrot_PMC interp_pmc, const
  245
+char * name)>
235 246
 
236  
-Sets the executable name for the C<interp_pmc> interpreter. This function returns a true
237  
-value if this call is successful and false value otherwise.
  247
+Sets the executable name for the C<interp_pmc> interpreter. This function returns
  248
+a true value if this call is successful and false value otherwise.
238 249
 
239 250
 =cut
240 251
 
@@ -244,7 +255,7 @@ PARROT_API
244 255
 Parrot_Int
245 256
 Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char * name))
246 257
 {
247  
-    //ASSERT_ARGS(Parrot_api_set_executable_name)
  258
+    ASSERT_ARGS(Parrot_api_set_executable_name)
248 259
     EMBED_API_CALLIN(interp_pmc, interp)
249 260
     STRING * const name_str = Parrot_str_new(interp, name, 0);
250 261
     PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String);
@@ -258,8 +269,9 @@ Parrot_api_set_executable_name(Parrot_PMC interp_pmc, ARGIN(const char * name))
258 269
 
259 270
 =item C<Parrot_Int Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc)>
260 271
 
261  
-Destroys the C<interp_pmc> interpreter, freeing the memory structures allocated for it.
262  
-This function returns a true value if this call is successful and false value otherwise.
  272
+Destroys the C<interp_pmc> interpreter, freeing the memory structures allocated
  273
+for it. This function returns a true value if this call is successful and false
  274
+value otherwise.
263 275
 
264 276
 =cut
265 277
 
@@ -269,7 +281,7 @@ PARROT_API
269 281
 Parrot_Int
270 282
 Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc)
271 283
 {
272  
-    //ASSERT_ARGS(Parrot_api_destroy_interpreter)
  284
+    ASSERT_ARGS(Parrot_api_destroy_interpreter)
273 285
     EMBED_API_CALLIN(interp_pmc, interp)
274 286
     Parrot_destroy(interp);
275 287
     Parrot_x_exit(interp, 0);
@@ -281,8 +293,8 @@ Parrot_api_destroy_interpreter(Parrot_PMC interp_pmc)
281 293
 =item C<Parrot_Int Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc, const
282 294
 char *filename, Parrot_PMC * pbc)>
283 295
 
284  
-Load a bytecode file and return a bytecode PMC. This function returns a true value
285  
-if this call is successful and false value otherwise.
  296
+Load a bytecode file and stores the resulting bytecode in C<pbc>. This function
  297
+returns a true value if this call is successful and false value otherwise.
286 298
 
287 299
 =cut
288 300
 
@@ -296,7 +308,7 @@ Parrot_Int
296 308
 Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc,
297 309
         ARGIN(const char *filename), ARGOUT(Parrot_PMC * pbc))
298 310
 {
299  
-    //ASSERT_ARGS(Parrot_api_load_bytecode_file)
  311
+    ASSERT_ARGS(Parrot_api_load_bytecode_file)
300 312
     EMBED_API_CALLIN(interp_pmc, interp)
301 313
     PackFile * const pf = Parrot_pbc_read(interp, filename, 0);
302 314
     if (!pf)
@@ -309,12 +321,12 @@ Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc,
309 321
 
310 322
 /*
311 323
 
312  
-=item C<Parrot_Int Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc,
313  
-ARGIN(const unsigned char * const pbc), Parrot_Int bytecode_size,
314  
-ARGOUT(Parrot_PMC * pbcpmc))>
  324
+=item C<Parrot_Int Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc, const
  325
+unsigned char * const pbc, Parrot_Int bytecode_size, Parrot_PMC * pbcpmc)>
315 326
 
316  
-
317  
-This function returns a true value if this call is successful and false value otherwise.
  327
+Unpacks a bytecode from a buffer C<pbc> of a C<bytecode_size> size, and stores
  328
+the resulting bytecode in C<pbcpmc>. This function returns a true value if this
  329
+call is successful and false value otherwise.
318 330
 
319 331
 =cut
320 332
 
@@ -326,6 +338,7 @@ Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc,
326 338
         ARGIN(const unsigned char * const pbc), Parrot_Int bytecode_size,
327 339
         ARGOUT(Parrot_PMC * pbcpmc))
328 340
 {
  341
+    ASSERT_ARGS(Parrot_api_load_bytecode_bytes)
329 342
     EMBED_API_CALLIN(interp_pmc, interp)
330 343
     PackFile * const pf = PackFile_new(interp, 0);
331 344
     if (!pf)
@@ -343,11 +356,25 @@ Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc,
343 356
 /* TODO: This only works with the inital bytecode. After this we should use
344 357
        Parrot_append_bytecode or something similar */
345 358
 
  359
+/*
  360
+
  361
+=item C<Parrot_Int Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC
  362
+pbc, Parrot_PMC *main_sub)>
  363
+
  364
+Prepares the bytecode C<pbc> to be run and stores the entry point subroutine in
  365
+C<main_sub>. This function returns a true value if this call is successful and
  366
+false value otherwise.
  367
+
  368
+=cut
  369
+
  370
+*/
  371
+
346 372
 PARROT_API
347 373
 Parrot_Int
348 374
 Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
349 375
         ARGOUT(Parrot_PMC *main_sub))
350 376
 {
  377
+    ASSERT_ARGS(Parrot_api_ready_bytecode)
351 378
     EMBED_API_CALLIN(interp_pmc, interp)
352 379
     PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
353 380
 
@@ -369,12 +396,25 @@ Parrot_api_ready_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
369 396
     EMBED_API_CALLOUT(interp_pmc, interp)
370 397
 }
371 398
 
  399
+
  400
+/*
  401
+
  402
+=item C<Parrot_Int Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC
  403
+pbc, Parrot_PMC mainargs)>
  404
+
  405
+Runs the bytecode C<pbc> passing optional C<mainargs> parameters. This function
  406
+returns a true value if this call is successful and false value otherwise.
  407
+
  408
+=cut
  409
+
  410
+*/
  411
+
372 412
 PARROT_API
373 413
 Parrot_Int
374 414
 Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
375 415
     Parrot_PMC mainargs)
376 416
 {
377  
-    //ASSERT_ARGS(Parrot_api_run_bytecode)
  417
+    ASSERT_ARGS(Parrot_api_run_bytecode)
378 418
     EMBED_API_CALLIN(interp_pmc, interp)
379 419
     PMC * main_sub = NULL;
380 420
 
@@ -408,38 +448,77 @@ Parrot_api_run_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
408 448
     EMBED_API_CALLOUT(interp_pmc, interp)
409 449
 }
410 450
 
  451
+/*
  452
+
  453
+=item C<Parrot_Int Parrot_api_disassemble_bytecode(Parrot_PMC interp_pmc,
  454
+Parrot_PMC pbc, const char * const outfile, Parrot_Int opts)>
  455
+
  456
+Disassembles and prints out the C<pbc> bytecode. This function returns a true
  457
+value if this call is successful and false value otherwise.
  458
+
  459
+=cut
  460
+
  461
+*/
  462
+
411 463
 PARROT_API
412 464
 Parrot_Int
413 465
 Parrot_api_disassemble_bytecode(Parrot_PMC interp_pmc, Parrot_PMC pbc,
414  
-        ARGIN(const char * const outfile), Parrot_Int opts)
  466
+        ARGIN_NULLOK(const char * const outfile), Parrot_Int opts)
415 467
 {
  468
+    ASSERT_ARGS(Parrot_api_disassemble_bytecode)
416 469
     EMBED_API_CALLIN(interp_pmc, interp)
417 470
     PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);
418 471
     if (!pf)
419 472
         Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
420 473
     if (pf->cur_cs != NULL)
421 474
         Parrot_pbc_load(interp, pf);
  475
+    /* TODO: Break up the dependency with emebed.c */
422 476
     Parrot_disassemble(interp, outfile, (Parrot_disassemble_options)opts);
423 477
     EMBED_API_CALLOUT(interp_pmc, interp);
424 478
 }
425 479
 
  480
+/*
  481
+
  482
+=item C<Parrot_Int Parrot_api_set_warnings(Parrot_PMC interp_pmc, Parrot_Int
  483
+flags)>
  484
+
  485
+Enables C<inter_pmc>'s warning messages the type of warning information to be
  486
+print out is specified by C<flags>. This function returns a true value if this
  487
+call is successful and false value otherwise.
  488
+
  489
+=cut
  490
+
  491
+*/
  492
+
426 493
 PARROT_API
427 494
 Parrot_Int
428 495
 Parrot_api_set_warnings(Parrot_PMC interp_pmc, Parrot_Int flags)
429 496
 {
430  
-    //ASSERT_ARGS(Parrot_api_set_warnings)
  497
+    ASSERT_ARGS(Parrot_api_set_warnings)
431 498
     EMBED_API_CALLIN(interp_pmc, interp)
432 499
     /* Activates the given warnings.  (Macro from warnings.h.) */
433 500
     PARROT_WARNINGS_on(interp, flags);
434 501
     EMBED_API_CALLOUT(interp_pmc, interp)
435 502
 }
436 503
 
  504
+/*
  505
+
  506
+=item C<Parrot_Int Parrot_api_set_output_file(Parrot_PMC interp_pmc, const char
  507
+* filename)>
  508
+
  509
+Sets the C<interp_pmc>'s output file name specified by C<filename>. This function
  510
+returns a true value if this call is successful and false value otherwise.
  511
+
  512
+=cut
  513
+
  514
+*/
  515
+
437 516
 PARROT_API
438 517
 Parrot_Int
439 518
 Parrot_api_set_output_file(Parrot_PMC interp_pmc,
440 519
         ARGIN_NULLOK(const char * filename))
441 520
 {
442  
-    //ASSERT_ARGS(Parrot_api_set_output_file)
  521
+    ASSERT_ARGS(Parrot_api_set_output_file)
443 522
     EMBED_API_CALLIN(interp_pmc, interp)
444 523
     if (!filename && !interp->output_file)
445 524
         interp->output_file = "-";
@@ -448,34 +527,70 @@ Parrot_api_set_output_file(Parrot_PMC interp_pmc,
448 527
     EMBED_API_CALLOUT(interp_pmc, interp)
449 528
 }
450 529
 
  530
+/*
  531
+
  532
+=item C<Parrot_Int Parrot_api_add_library_search_path(Parrot_PMC interp_pmc,
  533
+const char *path)>
  534
+
  535
+Adds C<path> to the C<inter_pmc>'s library search path list. This function
  536
+returns a true value if this call is successful and false value otherwise.
  537
+
  538
+=cut
  539
+
  540
+*/
  541
+
451 542
 PARROT_API
452 543
 Parrot_Int
453 544
 Parrot_api_add_library_search_path(Parrot_PMC interp_pmc,
454 545
         ARGIN(const char *path))
455 546
 {
456  
-    //ASSERT_ARGS(Parrot_api_add_library_search_path)
  547
+    ASSERT_ARGS(Parrot_api_add_library_search_path)
457 548
     EMBED_API_CALLIN(interp_pmc, interp)
458 549
     Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_LIBRARY);
459 550
     EMBED_API_CALLOUT(interp_pmc, interp)
460 551
 }
461 552
 
  553
+/*
  554
+
  555
+=item C<Parrot_Int Parrot_api_add_include_search_path(Parrot_PMC interp_pmc,
  556
+const char *path)>
  557
+
  558
+Adds C<path> to the C<inter_pmc>'s include search path list. This function
  559
+returns a true value if this call is successful and false value otherwise.
  560
+
  561
+=cut
  562
+
  563
+*/
  564
+
462 565
 PARROT_API
463 566
 Parrot_Int
464 567
 Parrot_api_add_include_search_path(Parrot_PMC interp_pmc,
465 568
         ARGIN(const char *path))
466 569
 {
467  
-    //ASSERT_ARGS(Parrot_api_add_include_search_path)
  570
+    ASSERT_ARGS(Parrot_api_add_include_search_path)
468 571
     EMBED_API_CALLIN(interp_pmc, interp)
469 572
     Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_INCLUDE);
470 573
     EMBED_API_CALLOUT(interp_pmc, interp)
471 574
 }
472 575
 
  576
+/*
  577
+
  578
+=item C<Parrot_Int Parrot_api_add_dynext_search_path(Parrot_PMC interp_pmc,
  579
+const char *path)>
  580
+
  581
+Adds C<path> to the C<inter_pmc>'s dynext search path list. This function
  582
+returns a true value if this call is successful and false value otherwise.
  583
+
  584
+=cut
  585
+
  586
+*/
  587
+
473 588
 PARROT_API
474 589
 Parrot_Int
475 590
 Parrot_api_add_dynext_search_path(Parrot_PMC interp_pmc,
476 591
         ARGIN(const char *path))
477 592
 {
478  
-    //ASSERT_ARGS(Parrot_api_add_dynext_search_path)
  593
+    ASSERT_ARGS(Parrot_api_add_dynext_search_path)
479 594
     EMBED_API_CALLIN(interp_pmc, interp)
480 595
     Parrot_lib_add_path_from_cstring(interp, path, PARROT_LIB_PATH_DYNEXT);
481 596
     EMBED_API_CALLOUT(interp_pmc, interp)
@@ -486,8 +601,9 @@ Parrot_api_add_dynext_search_path(Parrot_PMC interp_pmc,
486 601
 =item C<Parrot_Int Parrot_api_set_stdhandles(Parrot_PMC interp_pmc, Parrot_Int
487 602
 in, Parrot_Int out, Parrot_Int err)>
488 603
 
489  
-Set the std file descriptors for the embedded interpreter. Any file descriptor
490  
-passed as argument and set to C<PIO_INVALID_HANDLE> is ignored.
  604
+Set the C<interp_pmc>'s standard file descriptors STDIN, STDOUT, STDERR. Any
  605
+file descriptor set to C<PIO_INVALID_HANDLE> is ignored. This function returns
  606
+a true value if this call is successful and false value otherwise.
491 607
 
492 608
 =cut
493 609
 
@@ -498,7 +614,7 @@ Parrot_Int
498 614
 Parrot_api_set_stdhandles(Parrot_PMC interp_pmc, Parrot_Int in,
499 615
     Parrot_Int out, Parrot_Int err)
500 616
 {
501  
-    //ASSERT_ARGS(Parrot_api_set_stdhandles)
  617
+    ASSERT_ARGS(Parrot_api_set_stdhandles)
502 618
     EMBED_API_CALLIN(interp_pmc, interp)
503 619
     void *dummy;
504 620
 
@@ -524,20 +640,47 @@ Parrot_api_set_stdhandles(Parrot_PMC interp_pmc, Parrot_Int in,
524 640
     EMBED_API_CALLOUT(interp_pmc, interp)
525 641
 }
526 642
 
  643
+/*
  644
+
  645
+=item C<Parrot_Int Parrot_api_get_runtime_path(Parrot_PMC interp_pmc,
  646
+Parrot_String *runtime)>
  647
+
  648
+Stores in C<runtime> the C<interp_pmc>'s running path. This function returns a
  649
+true value if this call is successful and false value otherwise.
  650
+
  651
+=cut
  652
+
  653
+*/
  654
+
527