开发者

excellent setjmp/longjmp tutorials [closed]

开发者 https://www.devze.com 2022-12-11 05:10 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resourc开发者_StackOverflow中文版e are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

Hi I'd like to read good tutorials on setjmp/longjmp in C. It'd be better if there're examples which are real rather than artificial.

Thanks.


It's not really a tutorial as such, but the libpng documentation describes how the library uses setjmp/longjmp to do error handling.


The book "C interfaces and implementation" explains the concept well and implements a usable "exception" simulation in C using these constructs. The code for it (chapter 4) is freely available online here.

Edit: also see this SO thread


Then you should read Advanced Programming in the UNIX(R) Environment (2nd Edition) Here's the sample you're looking for http://my.safaribooksonline.com/0201433079/ch10lev1sec15 (just a preview)

0

精彩评论

暂无评论...
验证码 换一张
取 消