看板 PttCurrent 關於我們 聯絡資訊
我寫在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 後一點反應都沒有 請問是哪裡出錯了呢? 謝謝喔~~ ※ 引述《lxb.bbs@bbs.hkday.net (閉關修法)》之銘言: : ※ 引述《shane123.bbs@ptt.cc (家產有八十七億￾  ￾ﰩ》之銘言: : : 假設我想在文章列表按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