* t/pmc/complex.t:
[parrot.git] / src / main.c
blob017608d74bea45ee5cec76b6098fb9398d903443
1 /*
2 Copyright (C) 2007-2008, The Perl Foundation
3 $Id$
5 =head1 NAME
7 src/main.c - the Entry Point to Parrot Programs
9 =head1 DESCRIPTION
11 Start Parrot
13 =head2 Functions
15 =over 4
17 =cut
21 #include <stdio.h>
22 #include <string.h>
24 #include "parrot/parrot.h"
25 #include "parrot/embed.h"
26 #include "parrot/imcc.h"
30 =item C<int main(int argc, char * argv[])>
32 The entry point from the command line into Parrot.
34 =cut
38 int
39 main(int argc, const char * argv[])
41 const char *sourcefile;
42 Interp *interp;
43 int status;
45 Parrot_set_config_hash();
47 interp = Parrot_new(NULL);
48 imcc_initialize(interp);
50 /* We parse the arguments, but first store away the name of the Parrot
51 executable, since parsing destroys that and we want to make it
52 available. */
53 Parrot_set_executable_name(interp, string_from_cstring(interp, argv[0], 0));
55 sourcefile = parseflags(interp, &argc, &argv);
56 status = imcc_run(interp, sourcefile, argc, argv);
57 UNUSED(status);
59 /* Clean-up after ourselves */
60 Parrot_destroy(interp);
61 Parrot_exit(interp, 0);
66 =back
68 =head1 SEE ALSO
70 F<compilers/imcc/main.c>, unfortunately.
72 =cut
77 * Local variables:
78 * c-file-style: "parrot"
79 * End:
80 * vim: expandtab shiftwidth=4: