cvs: /php4/ext/mcal php_mcal.c

From: Date: Thu, 27 Jan 2000 16:39:10 +0000
Subject: cvs: /php4/ext/mcal php_mcal.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-9475@lists.php.net to get a copy of this message
chagenbu Thu Jan 27 08:39:10 2000 EDT Modified files: /php4/ext/mcal php_mcal.c Log: Mcal cleanup, stage 1: it compiles again (the php3 syntax to php4/zend syntax conversion left a lot of: PHP_FUNCTION void ... definitions, giving two types to every function). However, it's still segfaulting. I'll look into that next. Index: php4/ext/mcal/php_mcal.c diff -u php4/ext/mcal/php_mcal.c:1.1 php4/ext/mcal/php_mcal.c:1.2 --- php4/ext/mcal/php_mcal.c:1.1 Sat Dec 18 03:46:12 1999 +++ php4/ext/mcal/php_mcal.c Thu Jan 27 08:38:39 2000 @@ -125,7 +125,7 @@ #ifdef ZEND_VERSION zend_module_entry php_mcal_module_entry = { - CALVER, mcal_functions, PHP_MINIT(mcal), NULL, NULL, NULL, PHP_MINFO(mcal), 0, 0, 0, NULL + CALVER, mcal_functions, PHP_MINIT(mcal), NULL, NULL, NULL, PHP_MINFO(mcal), STANDARD_MODULE_PROPERTIES }; #else zend_module_entry php_mcal_module_entry = {"mcal", mcal_functions, PHP_MINIT_FUNCTION, NULL, NULL, NULL, PHP_MINFO_FUNCTION, 0, 0, 0, NULL}; @@ -284,7 +284,7 @@ /* {{{ proto int mcal_close(int stream_id [, int options]) Close an MCAL stream */ -void PHP_FUNCTION(mcal_close) +PHP_FUNCTION(mcal_close) { pval *options, *streamind; int ind, ind_type; @@ -321,7 +321,7 @@ /* {{{ proto int mcal_open(string calendar, string user, string password [, int options]) Open an MCAL stream to a calendar */ -void PHP_FUNCTION(mcal_open) +PHP_FUNCTION(mcal_open) { php_mcal_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } @@ -330,7 +330,7 @@ /* {{{ proto int mcal_reopen(int stream_id, string calendar [, int options]) Reopen MCAL stream to new calendar */ -void PHP_FUNCTION(mcal_reopen) +PHP_FUNCTION(mcal_reopen) { pval *streamind; pval *calendar; @@ -371,7 +371,7 @@ /* {{{ proto int mcal_expunge(int stream_id) Delete all messages marked for deletion */ -void PHP_FUNCTION(mcal_expunge) +PHP_FUNCTION(mcal_expunge) { pval *streamind; int ind, ind_type; @@ -400,7 +400,7 @@ /* {{{ proto int mcal_fetch_event(int stream_id,int eventid, [int options]) Fetch an event*/ -void PHP_FUNCTION(mcal_fetch_event) +PHP_FUNCTION(mcal_fetch_event) { pval *streamind,*eventid,*options=NULL; int ind, ind_type; @@ -436,7 +436,7 @@ /* {{{ proto object mcal_fetch_current_stream_event(int stream_id) Fetch the current event stored in the stream's event structure*/ -void PHP_FUNCTION(mcal_fetch_current_stream_event) +PHP_FUNCTION(mcal_fetch_current_stream_event) { pval *streamind; int ind, ind_type; @@ -530,15 +530,10 @@ /* {{{ proto array mcal_list_events(int stream_id,object begindate, [object enddate]) Returns list of UIDs for that day or range of days */ -void PHP_FUNCTION(mcal_list_events) +PHP_FUNCTION(mcal_list_events) { pval *streamind,*startyear,*startmonth,*startday; pval *endyear,*endmonth,*endday; -#ifdef ZEND_VERSION - pval **pvalue; -#else - pval *pvalue; -#endif int ind, ind_type; pils *mcal_le_struct; cal_list_t *my_cal_list; @@ -600,7 +595,7 @@ /* {{{ proto string mcal_create_calendar(int stream_id, string calendar) Create a new calendar*/ -void PHP_FUNCTION(mcal_create_calendar) +PHP_FUNCTION(mcal_create_calendar) { pval *streamind, *calendar; int ind, ind_type; @@ -635,7 +630,7 @@ /* {{{ proto string mcal_rename(int stream_id, string src_calendar, string dest_calendar) Rename a calendar*/ -void PHP_FUNCTION(mcal_rename_calendar) +PHP_FUNCTION(mcal_rename_calendar) { pval *streamind, *src_calendar,*dest_calendar; int ind, ind_type; @@ -667,14 +662,9 @@ /* {{{ proto int mcal_reopen(int stream_id, array date, array time) list alarms for a given time */ -void PHP_FUNCTION(mcal_list_alarms) +PHP_FUNCTION(mcal_list_alarms) { pval *streamind, *year,*month,*day,*hour,*min,*sec; -#ifdef ZEND_VERSION - pval **pvalue; -#else - pval *pvalue; -#endif datetime_t mydate=DT_INIT; int ind, ind_type; pils *mcal_le_struct; @@ -728,7 +718,7 @@ /* {{{ proto string mcal_delete_calendar(int stream_id, string calendar) Delete calendar*/ -void PHP_FUNCTION(mcal_delete_calendar) +PHP_FUNCTION(mcal_delete_calendar) { pval *streamind, *calendar; int ind, ind_type; @@ -763,7 +753,7 @@ /* {{{ proto string mcal_delete_event(int stream_id, int uid) Delete event*/ -void PHP_FUNCTION(mcal_delete_event) +PHP_FUNCTION(mcal_delete_event) { pval *streamind, *uid; int ind, ind_type; @@ -794,15 +784,15 @@ /* }}} */ -void PHP_FUNCTION(mcal_popen){ +PHP_FUNCTION(mcal_popen){ } /* {{{ proto string mcal_store_event(int stream_id, object event) Store an event*/ -void PHP_FUNCTION(mcal_store_event) +PHP_FUNCTION(mcal_store_event) { - pval *streamind,*storeobject; + pval *streamind; int ind, ind_type; pils *mcal_le_struct; int myargc; @@ -839,7 +829,7 @@ /* {{{ proto string mcal_snooze(int stream_id, int uid) Snooze an alarm*/ -void PHP_FUNCTION(mcal_snooze) +PHP_FUNCTION(mcal_snooze) { pval *streamind,*uid; int ind, ind_type; @@ -878,7 +868,7 @@ /* {{{ proto string mcal_event_set_category(int stream_id, string category) attach a category to an event*/ -void PHP_FUNCTION(mcal_event_set_category) +PHP_FUNCTION(mcal_event_set_category) { pval *streamind,*category; int ind, ind_type; @@ -906,7 +896,7 @@ /* {{{ proto string mcal_event_set_title(int stream_id, string title) attach a title to an event*/ -void PHP_FUNCTION(mcal_event_set_title) +PHP_FUNCTION(mcal_event_set_title) { pval *streamind,*title; int ind, ind_type; @@ -934,7 +924,7 @@ /* {{{ proto string mcal_event_set_description(int stream_id, string description) attach a description to an event*/ -void PHP_FUNCTION(mcal_event_set_description) +PHP_FUNCTION(mcal_event_set_description) { pval *streamind,*description; int ind, ind_type; @@ -962,7 +952,7 @@ /* {{{ proto string mcal_event_set_start(int stream_id, int year,int month, int day, [[[int hour],int min],int sec]) attach a start datetime to an event*/ -void PHP_FUNCTION(mcal_event_set_start) +PHP_FUNCTION(mcal_event_set_start) { pval *streamind,*year,*month,*date,*hour,*min,*sec; int ind, ind_type; @@ -1004,11 +994,13 @@ /* {{{ proto string mcal_event_set_end(int stream_id, int year,int month, int day, [[[int hour],int min],int sec]) attach an end datetime to an event*/ -void PHP_FUNCTION(mcal_event_set_end) +PHP_FUNCTION(mcal_event_set_end) { pval *streamind,*year,*month,*date,*hour,*min,*sec; int ind, ind_type; - int myhour,mymin,mysec; + /* initialize these to zero to make sure we don't use them + uninitialized (and to avoid the gcc warning) */ + int myhour = 0; int mymin = 0; int mysec = 0; pils *mcal_le_struct; int myargc; myargc=ARG_COUNT(ht); @@ -1045,7 +1037,7 @@ /* {{{ proto int mcal_event_set_alarm(int stream_id, int alarm) add an alarm to the streams global event */ -void PHP_FUNCTION(mcal_event_set_alarm) +PHP_FUNCTION(mcal_event_set_alarm) { pval *streamind,*alarm; int ind, ind_type; @@ -1073,7 +1065,7 @@ /* {{{ proto int mcal_event_init(int stream_id) initialize a streams global event */ -void PHP_FUNCTION(mcal_event_init) +PHP_FUNCTION(mcal_event_init) { pval *streamind; int ind, ind_type; @@ -1107,7 +1099,7 @@ /* {{{ proto int mcal_event_set_class(int stream_id, int class) add an class to the streams global event */ -void PHP_FUNCTION(mcal_event_set_class) +PHP_FUNCTION(mcal_event_set_class) { pval *streamind,*class; int ind, ind_type; @@ -1137,7 +1129,7 @@ /* {{{ proto bool mcal_is_leap_year(int year) returns true if year is a leap year, false if not */ -void PHP_FUNCTION(mcal_is_leap_year) +PHP_FUNCTION(mcal_is_leap_year) { pval *year; int myargc; @@ -1159,7 +1151,7 @@ /* {{{ proto int mcal_days_in_month(int month,bool leap_year) returns the number of days in the given month, needs to know if the year is a leap year or not */ -void PHP_FUNCTION(mcal_days_in_month) +PHP_FUNCTION(mcal_days_in_month) { pval *month,*leap; int myargc; @@ -1177,7 +1169,7 @@ /* {{{ proto bool mcal_date_valid(int year,int month,int day) returns true if the date is a valid date */ -void PHP_FUNCTION(mcal_date_valid) +PHP_FUNCTION(mcal_date_valid) { pval *year,*month,*day; int myargc; @@ -1203,7 +1195,7 @@ /* {{{ proto bool mcal_time_valid(int hour,int min,int sec) returns true if the time is a valid time */ -void PHP_FUNCTION(mcal_time_valid) +PHP_FUNCTION(mcal_time_valid) { pval *hour,*min,*sec; int myargc; @@ -1227,7 +1219,7 @@ /* {{{ proto int mcal_day_of_week(int year,int month,int day) returns the day of the week of the given date */ -void PHP_FUNCTION(mcal_day_of_week) +PHP_FUNCTION(mcal_day_of_week) { pval *year,*month,*day; int myargc; @@ -1248,7 +1240,7 @@ /* {{{ proto int mcal_day_of_year(int year,int month,int day) returns the day of the year of the given date */ -void PHP_FUNCTION(mcal_day_of_year) +PHP_FUNCTION(mcal_day_of_year) { pval *year,*month,*day; int myargc; @@ -1271,7 +1263,7 @@ /* {{{ proto int mcal_day_of_week(int ayear,int amonth,int aday,int byear,int bmonth,int bday) returns <0, 0, >0 if a<b, a==b, a>b respectively */ -void PHP_FUNCTION(mcal_date_compare) +PHP_FUNCTION(mcal_date_compare) { pval *ayear,*amonth,*aday; pval *byear,*bmonth,*bday; @@ -1304,14 +1296,13 @@ after the supplied date. Returns empty date field if event does not occur or something is invalid. */ -void PHP_FUNCTION(mcal_next_recurrence) +PHP_FUNCTION(mcal_next_recurrence) { pval *streamind,*weekstart,*next,*pvalue; int ind, ind_type; pils *mcal_le_struct; int myargc; datetime_t mydate; - CALEVENT *myevent=NULL; myargc=ARG_COUNT(ht); if (myargc !=3 || getParameters(ht,myargc,&streamind,&weekstart,&next) == FAILURE) { WRONG_PARAM_COUNT; @@ -1383,7 +1374,7 @@ /* {{{ proto string mcal_event_set_recur_daily(int stream_id,int year,int month,int day,int hour,int min,int sec,int interval create a daily recurrence */ -void PHP_FUNCTION(mcal_event_set_recur_daily) +PHP_FUNCTION(mcal_event_set_recur_daily) { pval *streamind,*year,*month,*day,*hour,*min,*sec,*interval; int ind, ind_type; @@ -1422,7 +1413,7 @@ /* {{{ proto string mcal_event_set_recur_weekly(int stream_id,int year,int month,int day,int hour,int min,int sec,int interval, int weekdays) create a weekly recurrence */ -void PHP_FUNCTION(mcal_event_set_recur_weekly) +PHP_FUNCTION(mcal_event_set_recur_weekly) { pval *streamind,*year,*month,*day,*hour,*min,*sec,*interval,*weekdays; int ind, ind_type; @@ -1461,7 +1452,7 @@ /* {{{ proto string mcal_event_set_recur_monthly_mday(int stream_id,int year,int month,int day,int hour,int min,int sec,int interval) create a monthly by day recurrence */ -void PHP_FUNCTION(mcal_event_set_recur_monthly_mday) +PHP_FUNCTION(mcal_event_set_recur_monthly_mday) { pval *streamind,*year,*month,*day,*hour,*min,*sec,*interval; int ind, ind_type; @@ -1500,7 +1491,7 @@ /* {{{ proto string mcal_event_set_recur_monthly_wday(int stream_id,int year,int month,int day,int hour,int min,int sec,int interval) create a monthy by week recurrence */ -void PHP_FUNCTION(mcal_event_set_recur_monthly_wday) +PHP_FUNCTION(mcal_event_set_recur_monthly_wday) { pval *streamind,*year,*month,*day,*hour,*min,*sec,*interval; int ind, ind_type; @@ -1539,7 +1530,7 @@ /* {{{ proto string mcal_event_set_recur_yearly(int stream_id,int year,int month,int day,int hour,int min,int sec,int interval) create a yearly recurrence */ -void PHP_FUNCTION(mcal_event_set_recur_yearly) +PHP_FUNCTION(mcal_event_set_recur_yearly) { pval *streamind,*year,*month,*day,*hour,*min,*sec,*interval; int ind, ind_type;

« previous php.version4 (#9475) next »