3 typedef struct { unsigned int arg
[100]; } *FunctionCallInfo
;
4 typedef struct { int day
; int month
; } Interval
;
5 void* palloc (unsigned int);
10 interval_pl (FunctionCallInfo fcinfo
)
12 Interval
*span1
= ((Interval
*) ((char *) ((fcinfo
->arg
[0]))));
13 Interval
*span2
= ((Interval
*) ((char *) ((fcinfo
->arg
[1]))));
14 Interval
*result
= (Interval
*) palloc (sizeof (Interval
));
16 if ((((span1
->month
) < 0) == ((span2
->month
) < 0))
17 && !(((result
->month
) < 0) == ((span1
->month
) < 0)))
22 result
->day
= span1
->day
+ span2
->day
;