/*************************************************** NAME : SaveDeffunctionHeader DESCRIPTION : Writes a deffunction forward declaration to the save file INPUTS : 1) The deffunction 2) The logical name of the output RETURNS : Nothing useful SIDE EFFECTS : Defffunction header written NOTES : None ***************************************************/ static void SaveDeffunctionHeader( void *theEnv, struct constructHeader *theDeffunction, void *userBuffer) { DEFFUNCTION *dfnxPtr = (DEFFUNCTION *) theDeffunction; char *logicalName = (char *) userBuffer; register int i; if (EnvGetDeffunctionPPForm(theEnv,(void *) dfnxPtr) != NULL) { EnvPrintRouter(theEnv,logicalName,(char*)"(deffunction "); EnvPrintRouter(theEnv,logicalName,EnvDeffunctionModule(theEnv,(void *) dfnxPtr)); EnvPrintRouter(theEnv,logicalName,(char*)"::"); EnvPrintRouter(theEnv,logicalName,EnvGetDeffunctionName(theEnv,(void *) dfnxPtr)); EnvPrintRouter(theEnv,logicalName,(char*)" ("); for (i = 0 ; i < dfnxPtr->minNumberOfParameters ; i++) { EnvPrintRouter(theEnv,logicalName,(char*)"?p"); PrintLongInteger(theEnv,logicalName,(long long) i); if (i != dfnxPtr->minNumberOfParameters-1) EnvPrintRouter(theEnv,logicalName,(char*)" "); } if (dfnxPtr->maxNumberOfParameters == -1) { if (dfnxPtr->minNumberOfParameters != 0) EnvPrintRouter(theEnv,logicalName,(char*)" "); EnvPrintRouter(theEnv,logicalName,(char*)"$?wildargs))\n\n"); } else EnvPrintRouter(theEnv,logicalName,(char*)"))\n\n"); } }
EXPORT void* STDCALL EnvGetDeffunctionModule(void* env, void* ptr) { return EnvGetDefmodule(env, EnvDeffunctionModule(env, ptr)); }
EXPORT void* STDCALL EnvDeffunctionModuleName(void* env, void* ptr) { return EnvDeffunctionModule(env, ptr); }
std::string Function::module_name() { if ( m_cobj ) return EnvDeffunctionModule( m_environment.cobj(), m_cobj ); else return std::string(); }
globle const char *DeffunctionModule( void *theDeffunction) { return EnvDeffunctionModule(GetCurrentEnvironment(),theDeffunction); }