|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T h
Length: 1538 (0x602)
Types: TextFile
Names: »hello_world.py«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/pepy/hello_world.py«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/pepy/hello_world.py«
HelloWorldDefs DEFINITIONS ::=
%{
#include <stdio.h>
static char *text;
static char *myname = "hello_world";
void adios ();
/* \f
*/
/* ARGSUSED */
main (argc, argv, envp)
int argc;
char **argv,
**envp;
{
PE pe;
myname = argv[0];
if (build_HelloWorldDefs_MyStruct (&pe, 1, NULL, NULLCP, NULLCP) == NOTOK)
adios (NULLCP, "encoder fails");
if (unbuild_HelloWorldDefs_MyStruct (pe, 1, NULLIP, NULLVP, NULLCP)
== NOTOK)
adios (NULLCP, "decoder fails");
exit (0); /* NOTREACHED */
}
%}
BEGIN
ENCODER build
MyStruct ::=
PrintableString [[s "Hello World" ]]
DECODER unbuild
MyStruct ::=
PrintableString [[s text]]
%{ printf("%s\n", text); %}
END
%{
/* \f
ERRORS */
#include <varargs.h>
#ifndef lint
void _advise ();
static void adios (va_alist)
va_dcl
{
va_list ap;
va_start (ap);
_advise (ap);
va_end (ap);
_exit (1);
}
#else
/* VARARGS */
static void adios (what, fmt)
char *what,
*fmt;
{
adios (what, fmt);
}
#endif
#ifndef lint
static void advise (va_alist)
va_dcl
{
va_list ap;
va_start (ap);
_advise (ap);
va_end (ap);
}
static void _advise (ap)
va_list ap;
{
char buffer[BUFSIZ];
asprintf (buffer, ap);
(void) fflush (stdout);
fprintf (stderr, "%s: ", myname);
(void) fputs (buffer, stderr);
(void) fputc ('\n', stderr);
(void) fflush (stderr);
}
#else
/* VARARGS */
static void advise (what, fmt)
char *what,
*fmt;
{
advise (what, fmt);
}
#endif
%}