# HG changeset patch # User Nobuyasu Oshiro # Date 1324754903 -32400 # Node ID ce844f6c504dcdc40308bd87b3d81242af52a5ce # Parent 46cc88d1051cb59ba21048586865d7c60d12651e modify __rectype diff -r 46cc88d1051c -r ce844f6c504d presen/index.html --- a/presen/index.html Sat Dec 24 20:58:48 2011 +0900 +++ b/presen/index.html Sun Dec 25 04:28:23 2011 +0900 @@ -267,7 +267,15 @@

+
+typedef struct node {
+ selftype *right;
+ selftype *left;
+}*NODE	  
+	
+
  • +
    @@ -325,18 +333,36 @@
    -

    -
  • +

    __rectype の実装

    +
  • 通常、関数の引数に関数ポインタを渡した際は以下の様に使われる。
  • + +
    +void factorial(int n, int result, void(*print)()){
    +   :
    +   (*print)(n,result,print,exit1, envp);
    +}
    +	
    +
    +
  • 以下の様に扱えるようにしたい。
  • + +
    +void factorial(int n, int result, void *print){
    +   :
    +   (*print)(n,result,print,exit1, envp);
    +}
    +	
    +
    -

    -
  • -
    - -
    -

    -
  • +

    __rectype の実装

    +
  • そこで、__rectype という予約後を作り、以下の宣言を行えるようにした。
  • +
    +__code factorial(int n, int result, __rectype *print) {
    +   :
    +   (*print)(n,result,print,exit1, envp);
    +}
    +