#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <getopt.h>
#include <memory.h>
#include <assert.h>
enum{
/* ftp */
FTP_TEST = 10,
};
struct oam_excute_st
{
int (*doit)(char*, char* , int *);
int (*dumpit)(char*, char* , int *, int );
};
extern struct oam_excute_st * oam_execute ;
int ftp_test (char *buf, char *outbuf, int *len){
printf("hello,world");
return 0;
}
struct oam_excute_st ftp_oam_table[]=
{
[FTP_TEST] = {.doit = ftp_test},
};
int main()
{
int i = 2;
ftp_oam_table[FTP_TEST].doit(NULL,NULL,&i);
return 0;
}
c语言结构体回调函数:函数指针实现
最新推荐文章于 2024-09-08 23:04:05 发布