作者shane123 (家产有八十七亿  ﰩ
看板PttCurrent
标题Re: 请问我若要加功能上去
时间Thu May 26 14:31:31 2005
我写在bbs.c的内容如下
const onekey_t read_comms[] = {
..
..
show_owner, //p
..
};
static int show_owner(int ent, fileheader_t * fhdr, char *direct)
{
move(20,0);
clrtobot();
outs(fhdr->owner);
pressanykey();
return FULLUPDATE;
}
结果按下 p 後一点反应都没有
请问是哪里出错了呢?
谢谢喔~~
※ 引述《[email protected] (闭关修法)》之铭言:
: ※ 引述《[email protected] (家产有八十七亿  ﰩ》之铭言:
: : 假设我想在文章列表按p的话执行某个function
: : 那我到底要把这个地方写在
: : bbs.c
: : const onekey_t read_comms[] = {
: : show_filename, // Ctrl('A')
: : NULL, // Ctrl('B')
: : NULL, // Ctrl('C')
: : 我试过只有写在read.c里面才能动
: : 若是写在bbs.c完全没办法让function动起来
: : 能给点提示吗??
: : thanks~
: 看是甚麽类形的 function.
: 要写在 bbs.c , 则要用这种格式 : (*func)(entry, &fileheader, directory)
: 你可以看一看, read.c 的 i_read_key() 是这样处理的:
: if( num > 0 ){
: sprintf(direct,"%s.bottom", currdirect);
: mode= (*func)(num, &headers[locmem->crs_ln-locmem->top_ln],
: direct);
: }
: else
: mode = (*func)(locmem->crs_ln,
: &headers[locmem->crs_ln - locmem->top_ln],
: currdirect);
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.23.5.121