mirror of
https://git.telodendria.io/Telodendria/Cytoplasm.git
synced 2024-11-22 12:10:47 +03:00
Add a Cytoplasm example, which I'll use to debug some stuff.
This commit is contained in:
parent
0e60cd5195
commit
4174bcf8f4
1 changed files with 27 additions and 0 deletions
27
examples/PrintArgsAndEnv.c
Normal file
27
examples/PrintArgsAndEnv.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#include <Array.h>
|
||||||
|
#include <HashMap.h>
|
||||||
|
|
||||||
|
#include <Log.h>
|
||||||
|
|
||||||
|
int Main(Array *args, HashMap *env)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
char *key;
|
||||||
|
char *val;
|
||||||
|
|
||||||
|
Log(LOG_INFO, "Hello World!");
|
||||||
|
Log(LOG_INFO, "Arguments: %lu", ArraySize(args));
|
||||||
|
|
||||||
|
for (i = 0; i < ArraySize(args); i++)
|
||||||
|
{
|
||||||
|
Log(LOG_INFO, " [%ld] %s", i, ArrayGet(args, i));
|
||||||
|
}
|
||||||
|
|
||||||
|
Log(LOG_INFO, "Environment:");
|
||||||
|
while (HashMapIterate(env, &key, (void **) &val))
|
||||||
|
{
|
||||||
|
Log(LOG_INFO, " %s = %s", key, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue