#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <freem.h>
#include <stdlib.h>
int main(int argc, char **argv, char)
{
pid_t pid;
freem_ref_t ref;
/* get the PID of this process */
pid = getpid();
/* we want to access an SSVN */
ref.reftype = MREF_RT_SSVN;
/* set up the name and subscripts */
strcpy(ref.name, "JOB");
ref.subscript_count = 2;
sprintf(ref.subscripts[0], "%d", pid);
strcpy(ref.subscripts[1], "CHARACTER");
/* initialize libfreem, using the USER namespace */
freem_init("USER");
/* call libfreem API */
freem_get(&ref);
/* output the character set info */
printf("PID %d character set is '%s'\n", pid, ref.value);
ref.reftype = MREF_RT_GLOBAL;
strcpy(ref.name, "snw");
ref.subscript_count = 0;
freem_get(&ref);
printf("^snw = '%s'\n", ref.value);
char *foo;
foo = malloc (MLIB_ERRLEN);
freem_errmsg (146, foo);
printf("errmsg for 146: '%s'\n", foo);
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>