[svn:parrot] r40325 - in trunk: examples/embed t/codingstd
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Wed Jul 29 17:06:21 UTC 2009
Author: NotFound
Date: Wed Jul 29 17:06:19 2009
New Revision: 40325
URL: https://trac.parrot.org/parrot/changeset/40325
Log:
[cage] add pod doc to example program cotorra
Modified:
trunk/examples/embed/cotorra.c
trunk/t/codingstd/c_function_docs.t
Modified: trunk/examples/embed/cotorra.c
==============================================================================
--- trunk/examples/embed/cotorra.c Wed Jul 29 07:05:28 2009 (r40324)
+++ trunk/examples/embed/cotorra.c Wed Jul 29 17:06:19 2009 (r40325)
@@ -2,7 +2,23 @@
Copyright (C) 2009, Parrot Foundation.
$Id$
-A parrot embedding test
+=head1 NAME
+
+cotorra - A parrot embedding test
+
+=head1 SYNOPSIS
+
+cotorra file.pbc
+
+=head1 DESCRIPTION
+
+A test of parrot embedding in a C program.
+
+Is a simplified form of the parrot main executable, with just a few
+options and able to run only pbc files.
+
+=cut
+
*/
@@ -24,14 +40,45 @@
/**********************************************************************/
+/*
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
/* Auxiliary generic functions */
+/*
+
+=item C<void fail(const char *msg)>
+
+Fatal error, print the msg to stderr and exit.
+
+=cut
+
+*/
+
void fail(const char *msg)
{
fprintf(stderr, "cotorra failed: %s\n", msg);
exit(EXIT_FAILURE);
}
+/*
+
+=item C<unsigned int getuintval(const char *s)>
+
+Get an unsigned int value from a C string.
+Fails on invalid argument.
+
+=cut
+
+*/
+
unsigned int getuintval(const char *s)
{
char *aux;
@@ -46,6 +93,17 @@
const char *name;
};
+/*
+
+=item C<Parrot_Run_core_t getruncore(const char *name)>
+
+Get a runcore id from his name.
+Fails on invalid argument.
+
+=cut
+
+*/
+
Parrot_Run_core_t getruncore(const char *name)
{
static const struct runcoreinfo cores [] = {
@@ -71,6 +129,16 @@
/* Auxiliary parrot functions */
+/*
+
+=item C<Parrot_String create_string(Parrot_Interp interp, const char *name)>
+
+Auxiliary function to shorten Parrot String creation,
+
+=cut
+
+*/
+
Parrot_String create_string(Parrot_Interp interp, const char *name)
{
return Parrot_new_string(interp, name, strlen(name), (const char *) NULL, 0);
@@ -78,6 +146,16 @@
/**********************************************************************/
+/*
+
+=item C<int cotorra_main(Parrot_Interp interp, int argc, char **argv)>
+
+Auxiliary function to minimize the size of main.
+
+=cut
+
+*/
+
int cotorra_main(Parrot_Interp interp, int argc, char **argv)
{
char *source;
@@ -157,6 +235,16 @@
return 0;
}
+/*
+
+=item C<int main(int argc, char **argv)>
+
+Main function. Create the parrot interpreter and call cotorra_main.
+
+=cut
+
+*/
+
int main(int argc, char **argv)
{
Parrot_Interp interp;
@@ -176,6 +264,14 @@
}
/*
+
+=back
+
+=cut
+
+*/
+
+/*
* Local variables:
* c-file-style: "parrot"
* End:
Modified: trunk/t/codingstd/c_function_docs.t
==============================================================================
--- trunk/t/codingstd/c_function_docs.t Wed Jul 29 07:05:28 2009 (r40324)
+++ trunk/t/codingstd/c_function_docs.t Wed Jul 29 17:06:19 2009 (r40325)
@@ -122,7 +122,6 @@
examples/c/nanoparrot.c
examples/c/pbc_info.c
examples/compilers/japhc.c
-examples/embed/cotorra.c
src/atomic/gcc_x86.c
src/debug.c
src/gc/gc_malloc.c
More information about the parrot-commits
mailing list