/*************************************************** 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"); } }
std::string Function::formatted( ) { if ( m_cobj ) return EnvGetDeffunctionPPForm( m_environment.cobj(), m_cobj ); else return std::string(); }
EXPORT void* STDCALL EnvGetDeffunctionPPForm2(void* env, void* ptr) { return EnvGetDeffunctionPPForm(env, ptr); }
globle const char *GetDeffunctionPPForm( void *theDeffunction) { return EnvGetDeffunctionPPForm(GetCurrentEnvironment(),theDeffunction); }