程序代码中的cb是什么意思?
时间:2009-10-05
来源:互联网
以前看eog、epdfview的时候经常看到某个函数是以cb结尾的,今天找epoll例子的时候也发现其中有些函数是以cb结尾的,请问这个cb是什么意思呀!
代码:
int file_notify_addcb(struct file *filep, void (*cbproc)(struct file *, void *, unsigned long *, long *), void *data) { unsigned long flags; struct fcb_struct *fcbp; if (!(fcbp = (struct fcb_struct *) kmalloc(sizeof(struct fcb_struct), GFP_KERNEL))) return -ENOMEM; memset(fcbp, 0, sizeof(struct fcb_struct)); fcbp->cbproc = cbproc; fcbp->data = data; fcblist_write_lock(filep, flags); list_add_tail(&fcbp->lnk, &filep->f_cblist); fcblist_write_unlock(filep, flags); return 0; } int file_notify_delcb(struct file *filep, void (*cbproc)(struct file *, void *, unsigned long *, long *)) { unsigned long flags; struct list_head *lnk; fcblist_write_lock(filep, flags); list_for_each(lnk, &filep->f_cblist) { struct fcb_struct *fcbp = list_entry(lnk, struct fcb_struct, lnk); if (fcbp->cbproc == cbproc) { list_del(lnk); fcblist_write_unlock(filep, flags); kfree(fcbp); return 0; } } fcblist_write_unlock(filep, flags); return -ENOENT; }
作者: jqxl0205 发布时间: 2009-10-05
cb == control block?
作者: javarchator 发布时间: 2009-10-06
callback
作者: ibear 发布时间: 2009-10-06
嗯,callback有道理。
作者: jqxl0205 发布时间: 2009-10-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28