2008 January 10th Thursday (一月 十日 木曜日)

  This morning I wrote an article on how to implement try/catch mechanism in C lanuage.  The key is how to use the syscalls
setjmp() and longjmp().  To prevent from confusing, the status of current exception frame was defined from 0.  There are four
states on a exception frame, entered, raised, handled and finally.  The enumeration type is used to defined them.

  I don't know what is the structure of jmp_buf.  But it is not important to implement the mechanism.  Firstly, invoking setjmp(),
the setjmp() not only save the current run environment, but also return 0 to the caller.  When invoking longjmp(), it not only
restore the run enviornment saved by setjmp(), but also return a value by setjmp().

  If you learnt the assembly lanuage, known how to implement thread mechanism, it is easy to understand what is the run environment.
The rest is easy to dealt with.  It just is to dispatch exception branchs.  Wrapped it by macros, we will be at ease when resuing them.
Wrapping macros are just like veils.  Instead of those veils, you can put those sources into your codes.  Therefore, you can debug
it step by step.

  昨日、売変設定情報作成プロクラムを修正してしまいました。明日はC語言の教えることがあるので、今朝には、そろそろ、準備をしておかなければ
なりません。電子郵件で、社員たを知らせてみました。

  今日、商品マスタブロクラムの定義書は始まって読んでいます。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值