亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? exception.h

?? c語言開發方面的經典問題,包括源代碼.c語言開發所要注意的問題,以及在嵌入式等各方面的應用
?? H
字號:
/* * File: exception.h * Version: 1.0 * Last modified on Thu Feb 23 12:45:01 1995 by eroberts * ----------------------------------------------------- * The exception package provides a general exception * handling mechanism for use with C that is portable * across a variety of compilers and operating systems. */#ifndef _exception_h#define _exception_h/* * Overview: * -------- * The exception package makes it possible for clients to * specify a handler for an exceptional conditions in a * syntactically readable way.  As a client, your first step * is to declare an exception condition name by declaring * a variable of type exception, as in * *       exception MyException; * * Normal visibility rules apply, so that you should declare * the exception variable at the appropriate level.  For * example, if an exception is local to an implementation, * it should be declared statically within that module.  If * an exception condition is shared by many modules, the * exception variable should be declared in an interface * and exported to all clients that need it.  This package * defines and exports the exception ErrorException, which * is likely to be sufficient for many clients. * * The basic functionality of exceptions is that one piece * of code can "raise" an exception so that it can then be * "handled" by special code in a dynamically enclosing * section of the program.  Exceptions are raised by calling * the pseudo-function raise with the exception name, as in * *     raise(MyException); * * Exceptions are handled using the "try" statement * (actually implemented using macros), which has the form: * *     try { *        . . . statements in the body of the block . . . *     except(exception1) *        . . . statements to handle exception 1 . . . *     except(exception2) *        . . . statements to handle exception 2 . . . *     except(ANY) *        . . . statements to handle any exception . . . *     } endtry * * Any number of except clauses may appear (up to a * maximum defined by the constant MaxExceptionsPerScope), * and the ANY clause is optional. * * When the program encounters the "try" statement, the * statements in the body are executed.  If no exception * conditions are raised during that execution, either * in this block or by a function call nested inside * this block, control passes to the end of the "try" * statement when the last statement in the block is * executed.  If an exception is raised during the * dynamic execution of the block, control immediately * passes to the statements in the appropriate except * clause.  Only the statements in that clause are * executed; no break statement is required to exit * the block.  If no handler for the raised exception * appears anywhere in the control history, the program * exits with an error. * * Examples of use: * * 1.  Catching errors. * * The following code fragment traps calls to Error, so * that the program does not quit but instead returns * to the top-level read-and-execute loop. * *     while (TRUE) { *         try { *             printf("> "); *             cmd = ReadCommand(); *             ExecuteCommand(cmd); *         except(ErrorException) *             printf("Error: %s\n", (string) GetExceptionValue()); *             -- additional handling code, if any -- *         } endtry *     } * * If either ReadCommand or ExecuteCommand calls Error, * control will be passed back to the main loop, after * executing any additional handler code.  The error * message is passed as the exception value and can be * printed as shown in the example. * * 2.  Handling control-C * * The following code extends the example above so that * typing ^C also returns to top-level. * *     #include <signal.h> * *     static exception ControlCException; *     static int errorCount = 0; *     static int ControlCHandler(); * *     main() *     { *         string cmd; * *         signal(SIGINT, ControlCHandler); *         while (TRUE) { *             try { *                 printf("> "); *                 cmd = ReadCommand(); *                 ExecuteCommand(cmd); *             except(ControlCException); *                 printf("^C\n"); *                 signal(SIGINT, ControlCHandler); *             except(ErrorException) *                 errorCount++; *             } endtry *         } *     } * *     static int ControlCHandler() *     { *         raise(ControlCException); *     } *//* * Actual interface specification * ------------------------------ * Most of the implementation of the exception mechanism is * actually done in the macros defined by this file. * Clients should ordinarily be able to read the description * above and ignore the detailed code below. */#include <setjmp.h>#include <string.h>#include "genlib.h"/* Define parameters and error status indicators */#define MaxExceptionsPerScope 10#define ETooManyExceptClauses 101#define EUnhandledException 102/* Codes to keep track of the state of the try handler */#define ES_Initialize 0#define ES_EvalBody 1#define ES_Exception 2/* * Type: exception * --------------- * Exceptions are specified by their address, so that the * actual structure does not matter.  Strings are used here * so that exporters of exceptions can store the exception * name for the use of debuggers and other tools. */typedef struct { string name; } exception;/* * Type: context_block * ------------------- * This structure is used internally to maintain a chain of * exception scopes on the control stack. */typedef struct ctx_block {    jmp_buf jmp;    int nx;    exception *array[MaxExceptionsPerScope];    exception *id;    void *value;    string name;    struct ctx_block *link;} context_block;/* Declare the built-in exceptions */extern exception ErrorException;extern exception ANY;/* Declare a global pointer to the context stack */extern context_block *exceptionStack;/* * Function: RaiseException * Usage: RaiseException(&e, name, value); * --------------------------------------- * This function is called by the raise macro and does the * work necessary to raise the exception.  See the exception.c file * for details.  Clients do not ordinarily call this directly. */void RaiseException(exception *e, string name, void *value);/* * Function: HandlerExists * Usage: if (HandlerExists(&e)) ... * --------------------------------- * Determines whether a handler exists for an exception in * the dynamically enclosing scope.  Intended only for use * by special clients, such as the Error package. */bool HandlerExists(exception *e);/* Define the pseudo-functions for raise and try */#define raise(e) RaiseException(&e, #e, NULL)#define try \      { \          jmp_buf _jmp_; \          context_block _ctx_; \          volatile int _es_; \          _es_ = ES_Initialize; \          _ctx_.nx = 0; \          _ctx_.link = exceptionStack; \          exceptionStack = (context_block *) &_ctx_; \          if (setjmp(_jmp_) != 0) _es_ = ES_Exception; \          memcpy((void *) _ctx_.jmp, (void *) _jmp_, sizeof(jmp_buf)); \          while (1) { \              if (_es_ == ES_EvalBody)#define except(e) \                  if (_es_ == ES_EvalBody) exceptionStack = _ctx_.link; \                  break; \              } \              if (_es_ == ES_Initialize) { \                  if (_ctx_.nx >= MaxExceptionsPerScope) \                      exit(ETooManyExceptClauses); \                  _ctx_.array[_ctx_.nx++] = &e; \              } else if (_ctx_.id == &e || &e == &ANY) { \                  exceptionStack = _ctx_.link;#define endtry \              if (_es_ != ES_Initialize) break; \              _es_ = ES_EvalBody; \          } \      }#define GetExceptionName() _ctx_.name#define GetExceptionValue() _ctx_.value#define GetCurrentException() _ctx_.id#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美男人的天堂一二区| 亚洲精品国产一区二区精华液| 日本一区二区三区四区在线视频| 亚洲综合图片区| 国产成人免费在线观看不卡| 欧美三片在线视频观看| 国产蜜臀97一区二区三区| 三级影片在线观看欧美日韩一区二区| 国产suv精品一区二区三区| 欧美日本在线看| 亚洲精品国久久99热| 岛国一区二区三区| 欧美精品一区二区三区在线播放| 亚洲伊人色欲综合网| av成人免费在线| 国产嫩草影院久久久久| 久久aⅴ国产欧美74aaa| 欧美视频中文字幕| 亚洲精品伦理在线| 99久久综合国产精品| 国产区在线观看成人精品| 久久99热这里只有精品| 6080yy午夜一二三区久久| 亚洲影视在线播放| 色激情天天射综合网| 国产精品久久午夜| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 久久久久久99精品| 美国十次综合导航| 日韩片之四级片| 免费视频一区二区| 日韩午夜在线观看| 麻豆国产一区二区| 久久综合九色综合97婷婷女人| 人人狠狠综合久久亚洲| 日韩免费高清av| 国产麻豆精品95视频| 国产亚洲精品久| 不卡在线视频中文字幕| 国产精品高清亚洲| 色婷婷狠狠综合| 天天做天天摸天天爽国产一区| 在线成人小视频| 久久99久久99小草精品免视看| 精品免费视频一区二区| 国产精品一色哟哟哟| 日韩毛片精品高清免费| 色狠狠一区二区三区香蕉| 亚洲五码中文字幕| 精品精品国产高清a毛片牛牛 | 秋霞电影一区二区| xnxx国产精品| 色诱亚洲精品久久久久久| 亚洲在线免费播放| 精品国产99国产精品| 成人免费精品视频| 亚洲bt欧美bt精品| 久久综合九色综合97婷婷| 北条麻妃国产九九精品视频| 一区二区在线观看免费视频播放| 欧美日韩aaaaaa| 成人免费视频caoporn| 一区二区三区中文字幕精品精品 | 久久 天天综合| 亚洲欧美电影院| 日韩视频免费直播| 成人爱爱电影网址| 视频在线观看一区| 国产婷婷一区二区| 欧美日韩国产电影| 国产成人综合在线| 亚洲动漫第一页| 中文天堂在线一区| 69av一区二区三区| 成人性生交大片免费看在线播放| 亚洲国产一区二区在线播放| 国产午夜亚洲精品不卡| 欧美麻豆精品久久久久久| 国产69精品久久99不卡| 免费高清视频精品| 亚洲免费av观看| 日本一区免费视频| 日韩欧美电影一二三| 一本久道中文字幕精品亚洲嫩| 国产精一区二区三区| 午夜精品免费在线| 亚洲人成小说网站色在线| 久久亚洲捆绑美女| 欧美精品v国产精品v日韩精品| 成人av先锋影音| 国产精品一级片| 日本不卡视频在线| 亚洲黄色av一区| 国产精品人人做人人爽人人添| 日韩午夜在线观看视频| 欧美日韩国产综合一区二区| 99久久婷婷国产综合精品电影 | 国产精品网曝门| 精品理论电影在线观看 | 老司机精品视频一区二区三区| 亚洲男同性恋视频| 国产精品成人在线观看| 久久久久久电影| 久久综合色之久久综合| 欧美xxxx老人做受| 日韩一级片在线播放| 欧美电影一区二区| 欧美日韩二区三区| 欧美久久高跟鞋激| 91精品国产综合久久精品app| 色婷婷久久久亚洲一区二区三区| 99精品国产99久久久久久白柏 | 91精品婷婷国产综合久久性色| 欧美影视一区在线| 欧美日韩精品综合在线| 欧美日韩一级二级| 日韩一区二区电影网| 日韩天堂在线观看| 精品国产电影一区二区| 欧美va亚洲va在线观看蝴蝶网| 日韩欧美一区在线| 久久亚洲精华国产精华液| 久久久国产午夜精品| 日本一区二区三区在线不卡 | 蜜臀av一区二区在线观看| 日一区二区三区| 美女脱光内衣内裤视频久久网站| 青青青爽久久午夜综合久久午夜| 精品亚洲国内自在自线福利| 国产一区二区三区四| 成人av网址在线| 91成人看片片| 欧美一级理论片| 国产欧美日韩亚州综合| 国产精品人人做人人爽人人添| 亚洲品质自拍视频| 天天综合日日夜夜精品| 国产精一区二区三区| 91浏览器在线视频| 欧美精品日韩综合在线| 欧美va亚洲va| 中文字幕在线观看不卡| 五月天一区二区三区| 狠狠色狠狠色综合系列| 成人av在线网站| 欧美欧美欧美欧美| 中文字幕精品一区| 婷婷综合在线观看| 国产精品99久久久久久久vr| 色中色一区二区| 久久日一线二线三线suv| 亚洲特级片在线| 毛片av一区二区| 色偷偷久久一区二区三区| 欧美一区二区日韩| 中文字幕一区av| 蜜桃久久久久久| 色综合天天综合| 久久亚洲春色中文字幕久久久| 亚洲综合久久久久| 国产成人午夜99999| 欧美一区二区视频网站| 亚洲欧洲一区二区三区| 美女视频免费一区| 91国在线观看| 国产精品狼人久久影院观看方式| 视频在线观看国产精品| 一本色道久久加勒比精品| 久久久久久久久久久久久女国产乱| 亚洲影院免费观看| 成人av免费网站| 久久久久久99精品| 美美哒免费高清在线观看视频一区二区 | 亚洲精品亚洲人成人网| 精品一区二区在线观看| 欧美日韩精品免费观看视频| 亚洲欧洲日韩女同| 成人免费观看av| 久久免费电影网| 久久不见久久见免费视频7| 欧美色男人天堂| 中文字幕亚洲视频| 成人少妇影院yyyy| 国产色综合久久| 国产在线播放一区| xvideos.蜜桃一区二区| 老司机午夜精品99久久| 日韩欧美国产电影| 青椒成人免费视频| 欧美一区二区三区男人的天堂| 亚洲高清一区二区三区| 日本久久一区二区三区| 亚洲欧美日韩小说| 色吊一区二区三区| 亚洲最快最全在线视频| 色综合久久久久久久| 亚洲少妇最新在线视频| 99视频有精品| 亚洲精品视频免费观看| 色婷婷综合视频在线观看|