當前位置:編程學習大全網 - 網站源碼 - Linux源代碼分析希望能得到專家的幫助。

Linux源代碼分析希望能得到專家的幫助。

typedef

結構體

_AT91S_Service

//定義的結構

{

數據;

(* main method)();

//函數指針

(* child method)();

//函數指針

}AT91S_Service,

* at 91PS _ Service;

AT91F_MainMethod()

{

}

AT91F_ChildMethod()

{

}

/*初始化

服務

*/

AT91PS_Service

at 91F _ open device(at 91PS _ Service

pService)

{

pService-& gt;數據

=

0;

pService-& gt;主要方法

=

at 91F _ main method;

/*將函數的地址賦給MainMethod,下次使用pservice->即可。MainMethod()相當於使用AT91F_MainMethod()函數*/

pService-& gt;子方法

=

at 91F _ child method;

//同上

}

//使用方式如下

AT91S_Service

服務;

AT91PS_Service

服務

=

at 91F _ open device(& amp;服務);

pService-& gt;at 91F _ MainMethmod();

  • 上一篇:潛山跑風麻將怎麽開俱樂部
  • 下一篇:怎麽設置asp網站程序必須指定的域名才能訪問?
  • copyright 2024編程學習大全網