/*Copyright (C) 1992, 1996 by Thomas Glen Smith. All Rights Reserved.*/
/* savfsfo APL2 V1.0.0 *************************************************
* Called from savfsfn to save token elements. *
***********************************************************************/
#define INCLUDES APLCB+APLFUNCI+APLCHDEF+APLTOKEN+IO+STDIO
#include "includes.h"
void savfsfo(fp,func)
int fp; /* file descriptor handle */
Aplfunc func; /* function definition to save */
{
Savfscb; Offtptr; Strwrite;
Apltoken tok;
int i,j;
tok = func->functary; /* first token in array */
for (j = func->functotl; j > 0; j--) {
switch (tok->token_code) {
case QUOTE:
case VECTOR_TOKEN:
savfscb(fp, tok->token_ptr.token_vector);
break; /* aplcb is saved */
case OPERAND_TOKEN:
i = strwrite(fp, tok->token_ptr.token_string);
break;
} /* end switch */
tok->token_queue.token_next_ptr = (Apltoken)offtptr(
(char*)(func->functary),
tok->token_queue.token_next_offset); /* restore ptrs */
tok++; /* bump to next token */
}
}