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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? exceptio.h

?? c語言開發(fā)方面的經(jīng)典問題,包括源代碼.c語言開發(fā)所要注意的問題,以及在嵌入式等各方面的應(yīng)用
?? H
字號:
/* * File: exception.h * Version: 1.0 * Last modified on Sun Jul 24 10:26:20 1994 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) *             -- 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 printed by the Error routine, so it is * often the case that no additional work is needed.) * * 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 _tmpbuf; \          context_block _ctx; \          volatile int _es; \          _es = ES_Initialize; \          _ctx.nx = 0; \          _ctx.link = exceptionStack; \          exceptionStack = (context_block *) &_ctx; \          if (setjmp(_tmpbuf) != 0) _es = ES_Exception; \          memcpy((void *) _ctx.jmp, (void *) _tmpbuf, 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区在线影院| 一区二区三区日本| 国产精品一区不卡| 欧美精品一区视频| 成人免费的视频| 亚洲人一二三区| 欧洲色大大久久| 日韩av午夜在线观看| 777午夜精品视频在线播放| 男女视频一区二区| 久久精品人人爽人人爽| 成人精品视频一区二区三区| 国产精品乱码久久久久久| fc2成人免费人成在线观看播放| 亚洲欧美另类小说| 在线播放视频一区| 国产一区二区日韩精品| 中文字幕亚洲成人| 欧美电影在线免费观看| 精品一区二区综合| 亚洲精品欧美二区三区中文字幕| 欧美高清视频一二三区| 激情五月婷婷综合网| 日韩一区在线播放| 欧美一级淫片007| 成人激情文学综合网| 亚洲一区电影777| 久久久一区二区三区捆绑**| 一本到三区不卡视频| 免费在线看一区| 国产精品毛片久久久久久| 91久久久免费一区二区| 久草这里只有精品视频| 国产精品家庭影院| 欧美成人r级一区二区三区| 波多野结衣一区二区三区| 亚洲二区在线视频| 中文字幕免费在线观看视频一区| 欧美少妇bbb| 国产高清精品网站| 日韩在线观看一区二区| 国产精品亲子伦对白| 欧美精品粉嫩高潮一区二区| 成人精品免费网站| 国产在线视频不卡二| 亚洲电影中文字幕在线观看| 国产免费成人在线视频| 67194成人在线观看| 99re这里都是精品| 粉嫩在线一区二区三区视频| 午夜国产精品一区| 亚洲午夜视频在线| 中文字幕一区二区视频| 精品国产一二三区| 7777精品久久久大香线蕉| 91免费在线视频观看| 国产精品一二三区在线| 麻豆视频一区二区| 香蕉乱码成人久久天堂爱免费| 中文字幕在线视频一区| 久久日韩精品一区二区五区| 日韩一区二区三区观看| 欧美另类z0zxhd电影| 91传媒视频在线播放| 99久久久无码国产精品| 成人黄动漫网站免费app| 国产酒店精品激情| 国产激情视频一区二区在线观看| 美女视频一区二区三区| 亚洲成人资源在线| 亚洲成人免费视| 亚洲bdsm女犯bdsm网站| 亚洲综合视频在线观看| 亚洲免费观看高清完整版在线 | 精品久久人人做人人爽| 337p亚洲精品色噜噜噜| 欧美午夜理伦三级在线观看| 色88888久久久久久影院野外 | 在线这里只有精品| 91视频www| 色婷婷国产精品久久包臀| 成人av免费网站| 97久久久精品综合88久久| 波多野结衣中文字幕一区| 99久久精品一区| 一本大道综合伊人精品热热| 色吧成人激情小说| 欧美日韩不卡一区| 日韩欧美你懂的| 久久久久九九视频| 成人免费小视频| 一区二区三区中文免费| 亚洲国产一区二区三区青草影视| 亚洲成人在线免费| 免费欧美高清视频| 国产精品综合视频| 99精品视频在线播放观看| 色猫猫国产区一区二在线视频| 欧美无人高清视频在线观看| 欧美人狂配大交3d怪物一区| 日韩午夜在线播放| 久久精品亚洲一区二区三区浴池 | 日韩欧美黄色影院| 欧美va日韩va| 国产精品美女一区二区三区| 亚洲色大成网站www久久九九| 亚洲一线二线三线久久久| 视频一区二区三区在线| 久久99蜜桃精品| 99国产精品一区| 欧美日韩大陆在线| 国产亚洲欧美日韩在线一区| 亚洲嫩草精品久久| 久久成人久久爱| 91蜜桃网址入口| 欧美一级二级在线观看| 国产欧美日韩另类一区| 亚洲免费资源在线播放| 日韩高清在线不卡| 不卡av电影在线播放| 欧美日韩激情一区二区三区| 久久免费的精品国产v∧| 亚洲日本电影在线| 国产伦精一区二区三区| 日本韩国一区二区| 精品国产91亚洲一区二区三区婷婷| 欧美国产日产图区| 男男成人高潮片免费网站| 不卡av免费在线观看| 91精品国产入口| 亚洲丝袜制服诱惑| 精品在线播放午夜| 欧美日韩卡一卡二| 国产精品久久久久久久久免费桃花| 日本不卡不码高清免费观看| 成人免费毛片高清视频| 日韩欧美一级精品久久| 亚洲色图制服丝袜| 国产99久久久国产精品| 91精品国产综合久久精品| 国产精品久久网站| 国产一区二区91| 日韩欧美一区在线观看| 亚洲免费观看高清完整版在线观看 | 亚洲欧洲日韩一区二区三区| 日韩av电影天堂| 欧美性xxxxxxxx| 亚洲欧美国产三级| av高清久久久| 中文字幕第一页久久| 久久99久久精品| 欧美欧美午夜aⅴ在线观看| 亚洲欧美在线视频观看| 国产a区久久久| 国产亚洲综合性久久久影院| 日韩av电影免费观看高清完整版 | 成人黄色a**站在线观看| 日韩欧美的一区| 日本aⅴ精品一区二区三区 | 国产嫩草影院久久久久| 久国产精品韩国三级视频| 欧美一区二区视频在线观看2020 | 欧美性色黄大片手机版| 国产精品美日韩| 9色porny自拍视频一区二区| 久久久www成人免费毛片麻豆| 老司机一区二区| 欧美成人三级在线| 国产一区二区免费在线| 久久亚洲精品小早川怜子| 久久疯狂做爰流白浆xx| 精品欧美乱码久久久久久1区2区| 青青草精品视频| 日韩欧美成人一区二区| 精品一区二区三区不卡| 亚洲精品一区在线观看| 韩国精品免费视频| 中文字幕第一页久久| 99精品久久只有精品| 亚洲三级小视频| 欧美日韩视频专区在线播放| 亚洲va欧美va天堂v国产综合| 欧美三级在线视频| 免费一级欧美片在线观看| 日韩欧美一卡二卡| 成人丝袜18视频在线观看| 1024成人网色www| 在线观看日韩电影| 青椒成人免费视频| 久久这里只有精品首页| 国产不卡在线视频| 夜夜爽夜夜爽精品视频| 精品视频资源站| 激情偷乱视频一区二区三区| 国产人伦精品一区二区| www.色综合.com| 亚洲成人在线免费| xnxx国产精品| 色综合中文字幕国产 | 亚洲第一电影网|