home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
SOURCE
/
CSSRC
/
UFNCSAVE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-01
|
1KB
|
70 lines
/*
ufncsave.c
% ufuncreq_save
C-scape 3.2
Copyright (c) 1988, 1989 by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
3/28/90 jmd ansi-fied
11/01/90 ted put (void) in arg list of ufunc_SaveInit.
*/
#include "sed.h"
#include "ufuncobj.h"
#include "ufuncod.h"
#include "sfile.h"
#include "sfilpriv.h"
OSTATIC objreq_func (ufuncreq_save);
void ufunc_SaveInit(void)
{
ufuncreq_savefptr = ufuncreq_save;
}
static int ufuncreq_save(VOID *objdata, int msg, VOID *indata, VOID *outdata)
/*
save code for ufunc objects
*/
{
ufunc_od *ufdp;
sfile_type sfile;
bob_type bob;
char *name;
oak_notused(outdata);
oak_notused(msg);
ufdp = (ufunc_od *)objdata;
sfile = (sfile_type)indata;
bob = ufuncod_GetSelf(ufdp);
/* ufunc info:
idata, ufunc name
*/
name = (ufuncbob_GetFuncHandle(bob) == -1) ?
((ufdp->ufunc == FNULL) ? "" : sfile_FindUserName(sfile, ufdp->ufunc))
: ufunc_GetUserName(bob, sfile);
sprintf(sfile->buf, "%d\n%s\n", ufdp->idata, fsym_NullCheck(name));
return(bfile_Write(sfile->bfile, sfile->buf, strlen(sfile->buf)));
}
char *ufunc_FindUserName(bob_type bob, sfile_type sfile)
/*
*/
{
ufuncopen_struct ufuncopen;
bob_Do(bob, UFUNCBM_GETUFUNC, NULL, &ufuncopen);
return((ufuncbob_GetFuncHandle(bob) == -1) ?
sfile_FindUserName(sfile, ufuncopen.ufunc)
: ufunc_GetUserName(bob, sfile));
}