#include "ficl.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Ficl interface to system (ANSI)
* Gets a newline (or NULL) delimited string from the input
* and feeds it to the ANSI system function...
* Example:
* system del *.*
* \ ouch!
*/
static void
{
if (FICL_COUNTED_STRING_GET_LENGTH(*counted) > 0) {
int returnValue = \
if (returnValue) {
}
} else {
}
}
/*
* Ficl add-in to load a text file and execute it...
* Cheesy, but illustrative.
* Line oriented... filename is newline (or NULL) delimited.
* Example:
* load test.f
*/
static void
{
int line = 0;
FILE *f;
int result = 0;
ficlString s;
if (FICL_COUNTED_STRING_GET_LENGTH(*counted) <= 0) {
return;
}
/*
* get the file's size and make sure it exists
*/
if (!f) {
}
/* feed each line to ficlExec */
line++;
if (length <= 0)
continue;
/* handle "bye" in loaded files. --lch */
switch (result) {
case FICL_VM_STATUS_USER_EXIT:
break;
default:
fclose(f);
break;
}
}
/*
* Pass an empty line with SOURCE-ID == -1 to flush
* any pending REFILLs (as required by FILE wordset)
*/
FICL_STRING_SET_FROM_CSTRING(s, "");
ficlVmExecuteString(vm, s);
fclose(f);
/* handle "bye" in loaded files. --lch */
if (result == FICL_VM_STATUS_USER_EXIT)
}
/*
* Dump a tab delimited file that summarizes the contents of the
* dictionary hash table by hashcode...
*/
static void
{
FILE *f;
unsigned i;
if (!ficlVmGetWordToPad(vm))
if (!f) {
return;
}
for (i = 0; i < hashSize; i++) {
int n = 0;
while (word) {
n++;
}
fprintf(f, "%d\t%d", i, n);
while (word) {
}
fprintf(f, "\n");
}
fclose(f);
}
static void
{
}
void
{
}