/* * Here is simple-guile.c, source code for a program that will produce a * complete Guile interpreter. In addition to all usual functions provided * by Guile, it will also offer the function my-hostname. * * Compile this file with the following command: * * gcc -o simple-guile simple-guile.c `pkg-config --cflags --libs guile-3.0` * */ #include<stdlib.h> #include<libguile.h>
static SCM my_hostname(void) { char *s = getenv ("HOSTNAME"); if (s == NULL) return SCM_BOOL_F; else return scm_from_locale_string (s); }