gm_entrypoint.cpp

来自「算断裂的」· C++ 代码 · 共 78 行

CPP
78
字号
// ------------------------------------------------------------------// gm_entrypoint.cpp//// This is not a standalone file -- it is included by driver routines.// It is the standard entrypoint for QMG's tcl/tk functions.// The includer must define macros://   GM_ROUTINE_NAME//   GM_ROUTINE_NAME_Q// and a function called "worker" to actually call the routine.//// ------------------------------------------------------------------// Author: Stephen A. Vavasis// Copyright (c) 1999 by Cornell University.  All rights reserved.// // See the accompanying file 'Copyright' for authorship information,// the terms of the license governing this software, and disclaimers// concerning this software.// ------------------------------------------------------------------// This file is part of the QMG software.  // Version 2.0 of QMG, release date September 3, 1999.// ------------------------------------------------------------------#include "qerr.h"extern "C" {int GM_ROUTINE_NAME(ClientData clientdata,                    Tcl_Interp* interp,                    int objc,                    Tcl_Obj* const objv[]) {  using namespace QMG::FrontEnd;  // Initialize the list of error messages and error tasks.  QMG::Error_Message::init_error_message_list();  QMG::Error_Task::init_error_task_list();  try {        // parse input args.    ArgValType arghandle(objc, objv, interp);    ReturnValType returnhandle;    Interpreter interpr(interp);        // call the worker.    worker(arghandle, returnhandle, interpr);    // Set the TCL result.    returnhandle.set_result(interp);    return TCL_OK;  }  catch(QMG::Error e) {    Tcl_AppendResult(interp, e.get_error_messages(), 0);    Tcl_AppendResult(interp, GM_ROUTINE_NAME_Q, " terminated because of exception.", 0);    return TCL_ERROR;  }  catch(std::bad_alloc) {    Tcl_AppendResult(interp, GM_ROUTINE_NAME_Q,		     " terminated because out of memory", 0);    return TCL_ERROR;  }  catch(...) {    Tcl_AppendResult(interp, GM_ROUTINE_NAME_Q,       " terminated because of unknown exception", 0);    return TCL_ERROR;  }}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?