static int Pass1( void ) /**********************/ { int noerror; noerror = RcPass1IoInit(); if( noerror ) { if( !CmdLineParms.PreprocessOnly ) { SetDefLang(); if( CmdLineParms.TargetOS == RC_TARGET_OS_OS2 ) { ParseInitOS2(); ParseOS2(); } else { ParseInit(); Parse(); } WriteDependencyRes(); } else { CreatePreprocFile(); } PP_Fini(); RcPass1IoShutdown(); noerror = !ErrorHasOccured; } return( noerror ); } /* Pass1 */
int main( int argc, char *argv[] ) { //BOOL bUseStartup, bGotCmd; BOOL bGotCmd; BLOCK bCmd; //char c; RESULTt rResult; setbuf(stdout,NULL); strcpy( GsProgramName, argv[0] ); BasicsInitialize(); GbGraphicalEnvironment = FALSE; ParseArguments( argc, argv ); ParseInit( &rResult ); bGotCmd = FALSE; bCmd = bBlockCreate(); while ( rResult.iCommand != CQUIT ) { char *line=NULL; char *cp; line = tl_getline("> "); cp = stripwhite (line); if (*cp){ gl_histadd(cp); for(; *cp; cp++) (void) bBlockAddChar( bCmd, *cp ); if ( bBlockAddChar( bCmd, '\n' ) ) { ParseBlock( bCmd, &rResult ); BlockEmpty( bCmd ); } } } while ( rResult.iCommand != CQUIT ); ParseShutdown(); LISTUNFREEDMEMORYTOLOGFILE(); exit(0); }
void load_force_fields( ) { /************************/ /* For LIGAND leaprc.gaff is used ("ff" force field). To specify force field for PROTEIN a link is used. For example: cd $AMBERHOME/dat/leap/cmd ln -s leaprc.ff03 leaprc. Then leaprc.ff03 will become the default.*/ char *flibLig = "leaprc.gaff"; char *system_env; char tmpchar[NB_OF_CHAR]; int i; char *prep = "/dat/leap/prep"; char *lib = "/dat/leap/lib"; char *parm= "/dat/leap/parm"; char *cmd= "/dat/leap/cmd"; char *lib_path[NB_OF_LIB] = {prep,lib,parm,cmd}; BasicsInitialize(); system_env = (char *) getenv("AMBERHOME"); if (system_env != NULL) { for(i = 0; i < NB_OF_LIB ; i++) { tmpchar[0] = '\0'; strcpy(tmpchar, system_env); strcat(tmpchar, lib_path[i]); AMBER_addPath(tmpchar); } } AMBER_add_source(flibLig); ParseInit(&rResult); }
////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// // // Command - Process text command // // Inputs: Line command to process // // Outputs: None. // void Command(char *Buffer) { ParseInit(Buffer); char *Command = ParseToken(); #ifdef USE_MAIN_SCREEN // // MA - Show the main screen // if( StrEQ(Command,"MA") ) { ShowScreen('MA'); return; } #ifdef USE_MAIN_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'MA' ) { if( MAScreenCommand(Command) ) return; } // // Universally accept <ESC> as an escape to the main screen. // if( StrEQ(Command,ESC_CMD) ) { ShowScreen('MA'); return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_HELP_SCREEN // // HE - Help screen // if( StrEQ(Command,"HE") || StrEQ(Command,"?" ) ) { ShowScreen('HE'); return; } #ifdef USE_HELP_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'HE' ) { if( HEScreenCommand(Command) ) return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_DEBUG_SCREEN // // DE - Show the debug screen // if( StrEQ(Command,"DE") ) { ShowScreen('DE'); return; } #ifdef USE_DEBUG_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'DE' ) { if( DEScreenCommand(Command) ) return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_MEMORY_SCREEN // // ME - Show the memory screen // if( StrEQ(Command,"ME") ) { ShowScreen('ME'); return; } #ifdef USE_MEMORY_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'ME' ) { if( MEScreenCommand(Command) ) return; } #endif #endif #ifdef USE_EEPROM_SCREEN // // EE - Show the memory screen // if( StrEQ(Command,"EE") ) { ShowScreen('EE'); return; } #ifdef USE_EEPROM_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'EE' ) { if( EEScreenCommand(Command) ) return; } #endif #endif // // Not a recognized command. Let the user know he goofed. // CursorPos(1,ERROR_ROW); ClearEOL; PrintString("Unrecognized command ("); PrintString(Command); PrintString(")\r\n"); PrintStringP(PSTR(BEEP)); }