当前位置: 首页 > news >正文

网站的布局怎么做/网站百度关键词优化

网站的布局怎么做,网站百度关键词优化,建筑工程网络推广,网站 搭建 公司我使用setjmp(),2392884445457714689和系统函数在C中编写了类似Java的异常处理机制。 它捕获自定义异常,但也包含SIGSEGV之类的信号。它具有异常处理块的无限嵌套,可以在函数调用中运行,并支持两种最常见的线程实现。 它允许您定义具有链接时…

我使用setjmp(),2392884445457714689和系统函数在C中编写了类似Java的异常处理机制。 它捕获自定义异常,但也包含SIGSEGV之类的信号。它具有异常处理块的无限嵌套,可以在函数调用中运行,并支持两种最常见的线程实现。 它允许您定义具有链接时继承的异常类的树层次结构,并且catch语句遍历此树以查看是否需要捕获或传递。

以下是使用此代码查看代码的示例:

try

{

*((int *)0) = 0; /* may not be portable */

}

catch (SegmentationFault, e)

{

long f[] = { 'i', 'l', 'l', 'e', 'g', 'a', 'l' };

((void(*)())f)(); /* may not be portable */

}

finally

{

return(1 / strcmp("", ""));

}

这是包含大量逻辑的包含文件的一部分:

#ifndef _EXCEPT_H

#define _EXCEPT_H

#include

#include

#include

#include

#include "Lifo.h"

#include "List.h"

#define SETJMP(env) sigsetjmp(env, 1)

#define LONGJMP(env, val) siglongjmp(env, val)

#define JMP_BUF sigjmp_buf

typedef void (* Handler)(int);

typedef struct _Class *ClassRef; /* exception class reference */

struct _Class

{

int notRethrown; /* always 1 (used by throw()) */

ClassRef parent; /* parent class */

char * name; /* this class name string */

int signalNumber; /* optional signal number */

};

typedef struct _Class Class[1]; /* exception class */

typedef enum _Scope /* exception handling scope */

{

OUTSIDE = -1, /* outside any 'try' */

INTERNAL, /* exception handling internal */

TRY, /* in 'try' (across routine calls) */

CATCH, /* in 'catch' (idem.) */

FINALLY /* in 'finally' (idem.) */

} Scope;

typedef enum _State /* exception handling state */

{

EMPTY, /* no exception occurred */

PENDING, /* exception occurred but not caught */

CAUGHT /* occurred exception caught */

} State;

typedef struct _Except /* exception handle */

{

int notRethrown; /* always 0 (used by throw()) */

State state; /* current state of this handle */

JMP_BUF throwBuf; /* start-'catching' destination */

JMP_BUF finalBuf; /* perform-'finally' destination */

ClassRef class; /* occurred exception class */

void * pData; /* exception associated (user) data */

char * file; /* exception file name */

int line; /* exception line number */

int ready; /* macro code control flow flag */

Scope scope; /* exception handling scope */

int first; /* flag if first try in function */

List * checkList; /* list used by 'catch' checking */

char* tryFile; /* source file name of 'try' */

int tryLine; /* source line number of 'try' */

ClassRef (*getClass)(void); /* method returning class reference */

char * (*getMessage)(void); /* method getting description */

void * (*getData)(void); /* method getting application data */

void (*printTryTrace)(FILE*);/* method printing nested trace */

} Except;

typedef struct _Context /* exception context per thread */

{

Except * pEx; /* current exception handle */

Lifo * exStack; /* exception handle stack */

char message[1024]; /* used by ExceptGetMessage() */

Handler sigAbrtHandler; /* default SIGABRT handler */

Handler sigFpeHandler; /* default SIGFPE handler */

Handler sigIllHandler; /* default SIGILL handler */

Handler sigSegvHandler; /* default SIGSEGV handler */

Handler sigBusHandler; /* default SIGBUS handler */

} Context;

extern Context * pC;

extern Class Throwable;

#define except_class_declare(child, parent) extern Class child

#define except_class_define(child, parent) Class child = { 1, parent, #child }

except_class_declare(Exception, Throwable);

except_class_declare(OutOfMemoryError, Exception);

except_class_declare(FailedAssertion, Exception);

except_class_declare(RuntimeException, Exception);

except_class_declare(AbnormalTermination, RuntimeException); /* SIGABRT */

except_class_declare(ArithmeticException, RuntimeException); /* SIGFPE */

except_class_declare(IllegalInstruction, RuntimeException); /* SIGILL */

except_class_declare(SegmentationFault, RuntimeException); /* SIGSEGV */

except_class_declare(BusError, RuntimeException); /* SIGBUS */

#ifdef DEBUG

#define CHECKED \

static int checked

#define CHECK_BEGIN(pC, pChecked, file, line) \

ExceptCheckBegin(pC, pChecked, file, line)

#define CHECK(pC, pChecked, class, file, line) \

ExceptCheck(pC, pChecked, class, file, line)

#define CHECK_END \

!checked

#else /* DEBUG */

#define CHECKED

#define CHECK_BEGIN(pC, pChecked, file, line) 1

#define CHECK(pC, pChecked, class, file, line) 1

#define CHECK_END 0

#endif /* DEBUG */

#define except_thread_cleanup(id) ExceptThreadCleanup(id)

#define try \

ExceptTry(pC, __FILE__, __LINE__); \

while (1) \

{ \

Context * pTmpC = ExceptGetContext(pC); \

Context * pC = pTmpC; \

CHECKED; \

\

if (CHECK_BEGIN(pC, &checked, __FILE__, __LINE__) && \

pC->pEx->ready && SETJMP(pC->pEx->throwBuf) == 0) \

{ \

pC->pEx->scope = TRY; \

do \

{

#define catch(class, e) \

} \

while (0); \

} \

else if (CHECK(pC, &checked, class, __FILE__, __LINE__) && \

pC->pEx->ready && ExceptCatch(pC, class)) \

{ \

Except *e = LifoPeek(pC->exStack, 1); \

pC->pEx->scope = CATCH; \

do \

{

#define finally \

} \

while (0); \

} \

if (CHECK_END) \

continue; \

if (!pC->pEx->ready && SETJMP(pC->pEx->finalBuf) == 0) \

pC->pEx->ready = 1; \

else \

break; \

} \

ExceptGetContext(pC)->pEx->scope = FINALLY; \

while (ExceptGetContext(pC)->pEx->ready > 0 || ExceptFinally(pC)) \

while (ExceptGetContext(pC)->pEx->ready-- > 0)

#define throw(pExceptOrClass, pData) \

ExceptThrow(pC, (ClassRef)pExceptOrClass, pData, __FILE__, __LINE__)

#define return(x) \

{ \

if (ExceptGetScope(pC) != OUTSIDE) \

{ \

void * pData = malloc(sizeof(JMP_BUF)); \

ExceptGetContext(pC)->pEx->pData = pData; \

if (SETJMP(*(JMP_BUF *)pData) == 0) \

ExceptReturn(pC); \

else \

free(pData); \

} \

return x; \

}

#define pending \

(ExceptGetContext(pC)->pEx->state == PENDING)

extern Scope ExceptGetScope(Context *pC);

extern Context *ExceptGetContext(Context *pC);

extern void ExceptThreadCleanup(int threadId);

extern void ExceptTry(Context *pC, char *file, int line);

extern void ExceptThrow(Context *pC, void * pExceptOrClass,

void *pData, char *file, int line);

extern int ExceptCatch(Context *pC, ClassRef class);

extern int ExceptFinally(Context *pC);

extern void ExceptReturn(Context *pC);

extern int ExceptCheckBegin(Context *pC, int *pChecked,

char *file, int line);

extern int ExceptCheck(Context *pC, int *pChecked, ClassRef class,

char *file, int line);

#endif /* _EXCEPT_H */

还有一个C模块,包含信号处理和一些簿记的逻辑。

实施起来非常棘手,我可以告诉你,我几乎退出了。 我真的很努力让它尽可能接近Java; 我发现它与C有多远是令人惊讶的。

如果你有兴趣,请给我一个喊叫。

http://www.lbrq.cn/news/1062991.html

相关文章:

  • 东莞做网站服务商/seo是指什么
  • 网站问卷调查系统怎么做/在百度上怎么发布广告
  • wordpress 404页面模板/毕节地seo
  • 营销型网站的价格/企业培训平台
  • 如何建网站教程视频/web前端培训费用大概多少
  • 怎么在建设银行网站更新身份证/百度关键词首页排名
  • 盘石做的网站/网络营销属于什么专业类型
  • 高校校园网站建设评比自评/福州网站建设
  • HTML网站制作设计/拼多多代运营收费标准
  • 廊坊网站建设冀icp备/爱站小工具计算器
  • 专业建设网站企业/友情链接交换的作用在于
  • 网站备案查询中心/营销推广app
  • 余姚公司网站建设/宁波网站建设制作报价
  • 江宁做网站价格/软文街
  • 湛江网站建设推广/福州seo公司
  • 网商网站怎么做/网站你应该明白我的意思吗
  • 网站规划图/线上营销工具
  • b2c网络购物系统/seo推广任务小结
  • 深圳定制网站制作厂家/网络推广服务合同范本
  • 怎么做网站推广知乎/百度企业查询
  • 青岛网站优化公司/百度认证中心
  • 一个好的网站怎样布局/域名申请的流程
  • 网站建设 分类/哈尔滨seo和网络推广
  • 单位网站建设/品牌策划案
  • 建设部网站备案/北京百度竞价
  • 石家庄网络营销哪家好做/深圳最好的外贸seo培训
  • 网站建设需要哪些基础/自助建站系统个人网站
  • 网页界面设计ppt/汕头seo推广
  • 外包公司做网站有哪些内容/搜索广告优化
  • 网站制作企业/5g网络优化
  • 2.4 组件通信
  • 怎样推动AI技术在人机协同中的发展?
  • Rust: 获取 MAC 地址方法大全
  • 「iOS」————weak底层原理
  • MC0364魔法链路
  • [Linux入门] Ubuntu 系统中 iptables 的配置与使用