cvs: /php3/functions php3_mcal.c posix.c
| From: | Egon Schmid | Date: | Sun, 21 Nov 1999 09:10:42 +0000 |
| Subject: | cvs: /php3/functions php3_mcal.c posix.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12845@lists.php.net to get a copy of this message | ||
eschmid Sun Nov 21 04:10:42 1999 EDT
Modified files:
/php3/functions php3_mcal.c posix.c
Log:
Mark, one newline should be enough.
Index: php3/functions/php3_mcal.c
diff -u php3/functions/php3_mcal.c:1.31 php3/functions/php3_mcal.c:1.32
--- php3/functions/php3_mcal.c:1.31 Thu Sep 23 11:46:19 1999
+++ php3/functions/php3_mcal.c Sun Nov 21 04:10:41 1999
@@ -63,7 +63,6 @@
CALSTREAM *cal_close_it ();
CALSTREAM *cal_close_full ();
-
typedef struct php3_mcal_le_struct {
CALSTREAM *mcal_stream;
long public;
@@ -71,7 +70,6 @@
long flags;
} pils;
-
typedef struct cal_list
{
u_int32_t uid;
@@ -155,7 +153,6 @@
return ret;
}
-
#ifndef ZEND_VERSION
void php3_minfo_mcal(void)
#else
@@ -175,7 +172,6 @@
PHP_MINIT_FUNCTION(mcal)
#endif
{
-
le_mcal = register_list_destructors(cal_close_it,NULL);
REGISTER_MAIN_LONG_CONSTANT("MCAL_SUNDAY",SUNDAY, CONST_PERSISTENT | CONST_CS);
@@ -198,7 +194,6 @@
REGISTER_MAIN_LONG_CONSTANT("MCAL_OCTOBER",OCTOBER, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_NOVEMBER",NOVEMBER, CONST_PERSISTENT | CONST_CS);
-
REGISTER_MAIN_LONG_CONSTANT("MCAL_RECUR_NONE",RECUR_NONE, CONST_PERSISTENT |
CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_RECUR_DAILY",RECUR_DAILY, CONST_PERSISTENT |
CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_RECUR_WEEKLY",RECUR_WEEKLY, CONST_PERSISTENT |
CONST_CS);
@@ -206,7 +201,6 @@
REGISTER_MAIN_LONG_CONSTANT("MCAL_RECUR_MONTHLY_WDAY",RECUR_MONTHLY_WDAY,
CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_RECUR_YEARLY",RECUR_YEARLY, CONST_PERSISTENT |
CONST_CS);
-
REGISTER_MAIN_LONG_CONSTANT("MCAL_M_SUNDAY",M_SUNDAY, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_M_MONDAY",M_MONDAY, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_M_TUESDAY",M_TUESDAY, CONST_PERSISTENT | CONST_CS);
@@ -219,11 +213,9 @@
REGISTER_MAIN_LONG_CONSTANT("MCAL_M_WEEKEND",M_WEEKEND, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("MCAL_M_ALLDAYS",M_ALLDAYS, CONST_PERSISTENT | CONST_CS);
-
return SUCCESS;
}
-
static int add_assoc_object(pval *arg, char *key, pval tmp)
{
#ifdef ZEND_VERSION
@@ -240,7 +232,6 @@
#endif
}
-
void php3_mcal_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
pval *calendar;
@@ -282,9 +273,6 @@
RETURN_LONG(ind);
}
-
-
-
/* {{{ proto int mcal_close(int stream_id [, int options])
Close an MCAL stream */
void php3_mcal_close(INTERNAL_FUNCTION_PARAMETERS)
@@ -315,13 +303,6 @@
}
/* }}} */
-
-
-
-
-
-
-
/* {{{ proto int mcal_open(string calendar, string user, string password [, int options])
Open an MCAL stream to a calendar */
void php3_mcal_open(INTERNAL_FUNCTION_PARAMETERS)
@@ -371,7 +352,6 @@
}
/* }}} */
-
/* {{{ proto int mcal_expunge(int stream_id)
Delete all messages marked for deletion */
void php3_mcal_expunge(INTERNAL_FUNCTION_PARAMETERS)
@@ -401,8 +381,8 @@
}
/* }}} */
-/* {{{ proto int mcal_fetch_event(int stream_id,int eventid, [int options])
- Fetch an event*/
+/* {{{ proto int mcal_fetch_event(int stream_id, int eventid [, int options])
+ Fetch an event */
void php3_mcal_fetch_event(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*eventid,*options=NULL;
@@ -438,7 +418,7 @@
/* }}} */
/* {{{ proto object mcal_fetch_current_stream_event(int stream_id)
- Fetch the current event stored in the stream's event structure*/
+ Fetch the current event stored in the stream's event structure */
void php3_mcal_fetch_current_stream_event(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind;
@@ -461,8 +441,6 @@
}
/* }}} */
-
-
void make_event_object(pval *mypvalue,CALEVENT *event)
{
pval start,end,recurend;
@@ -484,7 +462,6 @@
add_property_long(&start,"sec",event->start.sec);
}
-
add_assoc_object(mypvalue, "start",start);
object_init(&end);
@@ -501,9 +478,8 @@
add_property_long(&end,"sec",event->end.sec);
}
add_assoc_object(mypvalue, "end",end);
-
-
- if (event->category)
+
+ if (event->category)
add_property_string(mypvalue,"category",event->category,1);
if (event->title)
add_property_string(mypvalue,"title",event->title,1);
@@ -522,10 +498,8 @@
add_assoc_object(mypvalue, "recur_enddate",recurend);
add_property_long(mypvalue,"recur_data",event->recur_data.weekly_wday);
}
-
-
-/* {{{ proto array mcal_list_events(int stream_id,int startyear, int startmonth, int startday, int
endyear, int endmonth,int endday)
+/* {{{ proto array mcal_list_events(int stream_id, int startyear, int startmonth, int startday, int
endyear, int endmonth, int endday)
Returns list of UIDs for that day or range of days */
void php3_mcal_list_events(INTERNAL_FUNCTION_PARAMETERS)
{
@@ -556,9 +530,8 @@
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;
}
-
-
- if(myargc ==7)
+
+ if(myargc ==7)
{
convert_to_long(startyear);
convert_to_long(startmonth);
@@ -588,9 +561,8 @@
}
/* }}} */
-
/* {{{ proto string mcal_create_calendar(int stream_id, string calendar)
- Create a new calendar*/
+ Create a new calendar */
void php3_mcal_create_calendar(INTERNAL_FUNCTION_PARAMETERS)
{
@@ -624,9 +596,8 @@
}
/* }}} */
-
/* {{{ proto string mcal_rename(int stream_id, string src_calendar, string dest_calendar)
- Rename a calendar*/
+ Rename a calendar */
void php3_mcal_rename_calendar(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind, *src_calendar,*dest_calendar;
@@ -653,12 +624,9 @@
*/
}
/* }}} */
-
-
-
-/* {{{ proto int mcal_list_alarms(int stream_id, int year,int month,int day,int hour, int min, int
sec)
- list alarms for a given time */
+/* {{{ proto int mcal_list_alarms(int stream_id, int year, int month, int day, int hour, int min,
int sec)
+ List alarms for a given time */
void php3_mcal_list_alarms(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind, *year,*month,*day,*hour,*min,*sec;
@@ -712,9 +680,8 @@
}
/* }}} */
-
/* {{{ proto string mcal_delete_calendar(int stream_id, string calendar)
- Delete calendar*/
+ Delete calendar */
void php3_mcal_delete_calendar(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind, *calendar;
@@ -747,9 +714,8 @@
}
/* }}} */
-
/* {{{ proto string mcal_delete_event(int stream_id, int uid)
- Delete event*/
+ Delete event */
void php3_mcal_delete_event(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind, *uid;
@@ -780,13 +746,11 @@
}
/* }}} */
-
void php3_mcal_popen(INTERNAL_FUNCTION_PARAMETERS){
}
-
/* {{{ proto string mcal_store_event(int stream_id, object event)
- Store an event*/
+ Store an event */
void php3_mcal_store_event(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind;
@@ -823,9 +787,8 @@
}
/* }}} */
-
/* {{{ proto string mcal_snooze(int stream_id, int uid)
- Snooze an alarm*/
+ Snooze an alarm */
void php3_mcal_snooze(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*uid;
@@ -857,14 +820,11 @@
{
RETURN_FALSE;
}
-
-
}
/* }}} */
-
/* {{{ proto string mcal_event_set_category(int stream_id, string category)
- attach a category to an event*/
+ Attach a category to an event */
void php3_mcal_event_set_category(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*category;
@@ -889,10 +849,10 @@
}
mcal_le_struct->event->category=strdup(category->value.str.val);
}
- /* }}} */
+/* }}} */
/* {{{ proto string mcal_event_set_title(int stream_id, string title)
- attach a title to an event*/
+ Attach a title to an event */
void php3_mcal_event_set_title(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*title;
@@ -917,10 +877,10 @@
}
mcal_le_struct->event->title=strdup(title->value.str.val);
}
- /* }}} */
+/* }}} */
/* {{{ proto string mcal_event_set_description(int stream_id, string description)
- attach a description to an event*/
+ Attach a description to an event */
void php3_mcal_event_set_description(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*description;
@@ -945,10 +905,10 @@
}
mcal_le_struct->event->description=strdup(description->value.str.val);
}
- /* }}} */
+/* }}} */
-/* {{{ 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*/
+/* {{{ 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 php3_mcal_event_set_start(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*date,*hour,*min,*sec;
@@ -987,10 +947,10 @@
if(myargc >4) dt_settime(&(mcal_le_struct->event->start),myhour,mymin,mysec);
}
- /* }}} */
+/* }}} */
-/* {{{ 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*/
+/* {{{ 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 php3_mcal_event_set_end(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*date,*hour,*min,*sec;
@@ -1020,7 +980,6 @@
RETURN_FALSE;
}
-
dt_setdate(&(mcal_le_struct->event->end),year->value.lval,month->value.lval,date->value.lval);
if(myargc > 4) myhour=hour->value.lval;
@@ -1028,10 +987,10 @@
if(myargc > 6) mysec=sec->value.lval;
if(myargc >4) dt_settime(&(mcal_le_struct->event->end),myhour,mymin,mysec);
}
- /* }}} */
+/* }}} */
/* {{{ proto int mcal_event_set_alarm(int stream_id, int alarm)
- add an alarm to the streams global event */
+ Add an alarm to the streams global event */
void php3_mcal_event_set_alarm(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*alarm;
@@ -1056,10 +1015,10 @@
}
mcal_le_struct->event->alarm=alarm->value.lval;
}
- /* }}} */
+/* }}} */
/* {{{ proto int mcal_event_init(int stream_id)
- initialize a streams global event */
+ Initialize a streams global event */
void php3_mcal_event_init(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind;
@@ -1083,7 +1042,7 @@
}
php3_event_init(mcal_le_struct);
}
- /* }}} */
+/* }}} */
/* {{{ proto int mcal_event_set_now(int stream_id)
Set a streams global event start date to the current date/time */
@@ -1117,7 +1076,7 @@
RETURN_FALSE;
}
}
- /* }}} */
+/* }}} */
/* {{{ proto int mcal_event_set_now(int stream_id)
Set a streams global event end date to the current date/time */
@@ -1151,7 +1110,7 @@
RETURN_FALSE;
}
}
- /* }}} */
+/* }}} */
void php3_event_init(struct php3_mcal_le_struct *mystruct)
{
@@ -1161,7 +1120,7 @@
/* {{{ proto int mcal_event_set_class(int stream_id, int class)
- add an class to the streams global event */
+ Add an class to the streams global event */
void php3_mcal_event_set_class(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*class;
@@ -1186,12 +1145,10 @@
}
mcal_le_struct->event->public=class->value.lval;
}
- /* }}} */
-
-
+/* }}} */
/* {{{ proto bool mcal_is_leap_year(int year)
- returns true if year is a leap year, false if not */
+ Returns true if year is a leap year, false if not */
void php3_mcal_is_leap_year(INTERNAL_FUNCTION_PARAMETERS)
{
pval *year;
@@ -1212,8 +1169,8 @@
}
/* }}} */
-/* {{{ 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
*/
+/* {{{ 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 php3_mcal_days_in_month(INTERNAL_FUNCTION_PARAMETERS)
{
pval *month,*leap;
@@ -1228,10 +1185,9 @@
RETURN_LONG(daysinmonth(month->value.lval,leap->value.lval));
}
/* }}} */
-
-/* {{{ proto bool mcal_date_valid(int year,int month,int day)
- returns true if the date is a valid date */
+/* {{{ proto bool mcal_date_valid(int year, int month, int day)
+ Returns true if the date is a valid date */
void php3_mcal_date_valid(INTERNAL_FUNCTION_PARAMETERS)
{
pval *year,*month,*day;
@@ -1254,10 +1210,9 @@
}
/* }}} */
-
-/* {{{ proto bool mcal_time_valid(int hour,int min,int sec)
- returns true if the time is a valid time */
+/* {{{ proto bool mcal_time_valid(int hour, int min, int sec)
+ Returns true if the time is a valid time */
void php3_mcal_time_valid(INTERNAL_FUNCTION_PARAMETERS)
{
pval *hour,*min,*sec;
@@ -1280,8 +1235,8 @@
}
/* }}} */
-/* {{{ proto int mcal_day_of_week(int year,int month,int day)
- returns the day of the week of the given date */
+/* {{{ proto int mcal_day_of_week(int year, int month, int day)
+ Returns the day of the week of the given date */
void php3_mcal_day_of_week(INTERNAL_FUNCTION_PARAMETERS)
{
pval *year,*month,*day;
@@ -1301,8 +1256,8 @@
}
/* }}} */
-/* {{{ proto int mcal_day_of_year(int year,int month,int day)
- returns the day of the year of the given date */
+/* {{{ proto int mcal_day_of_year(int year, int month, int day)
+ Returns the day of the year of the given date */
void php3_mcal_day_of_year(INTERNAL_FUNCTION_PARAMETERS)
{
pval *year,*month,*day;
@@ -1321,11 +1276,8 @@
RETURN_LONG(dt_dayofyear(&mydate));
}
-
-
-
-/* {{{ 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 */
+/* {{{ 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 php3_mcal_date_compare(INTERNAL_FUNCTION_PARAMETERS)
{
pval *ayear,*amonth,*aday;
@@ -1349,16 +1301,10 @@
RETURN_LONG(dt_compare(&myadate,&mybdate));
}
-
-
/* }}} */
-
-/* {{{ proto object mcal_next_recurrence(int stream_id, int weekstart,array next)
- returns an object filled with the next date the event occurs, on or
- after the supplied date. Returns empty date field if event does not
- occur or something is invalid.
- */
+/* {{{ proto object mcal_next_recurrence(int stream_id, int weekstart, array next)
+ Returns an object filled with the next date the event occurs, on or after the supplied date.
Returns empty date field if event does not occur or something is invalid. */
void php3_mcal_next_recurrence(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*weekstart,*next,*pvalue;
@@ -1383,7 +1329,6 @@
RETURN_FALSE;
}
-
if(_php3_hash_find(next->value.ht,"year",sizeof("year"),(void **)
&pvalue)== SUCCESS){
convert_to_long(pvalue);
@@ -1431,12 +1376,10 @@
add_property_long(return_value,"sec",mydate.sec);
}
}
- /* }}} */
-
-
+/* }}} */
-/* {{{ proto string mcal_event_set_recur_daily(int stream_id,int year,int month,int day,int
interval
- create a daily recurrence */
+/* {{{ proto string mcal_event_set_recur_daily(int stream_id, int year, int month, int day, int
interval)
+ Create a daily recurrence */
void php3_mcal_event_set_recur_daily(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*day,*interval;
@@ -1466,12 +1409,11 @@
dt_setdate(&endtime,year->value.lval,month->value.lval,day->value.lval);
calevent_recur_daily(mcal_le_struct->event, &endtime,
interval->value.lval);
-
}
- /* }}} */
+/* }}} */
-/* {{{ proto string mcal_event_set_recur_weekly(int stream_id,int year,int month,int day,int
interval, int weekdays)
-create a weekly recurrence */
+/* {{{ proto string mcal_event_set_recur_weekly(int stream_id, int year, int month, int day, int
interval, int weekdays)
+ Create a weekly recurrence */
void php3_mcal_event_set_recur_weekly(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*day,*interval,*weekdays;
@@ -1503,10 +1445,10 @@
interval->value.lval,weekdays->value.lval);
}
- /* }}} */
+/* }}} */
-/* {{{ proto string mcal_event_set_recur_monthly_mday(int stream_id,int year,int month,int day,int
interval)
- create a monthly by day recurrence */
+/* {{{ proto string mcal_event_set_recur_monthly_mday(int stream_id, int year, int month, int day,
int interval)
+ Create a monthly by day recurrence */
void php3_mcal_event_set_recur_monthly_mday(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*day,*interval;
@@ -1536,12 +1478,11 @@
dt_setdate(&endtime,year->value.lval,month->value.lval,day->value.lval);
calevent_recur_monthly_mday(mcal_le_struct->event, &endtime,
interval->value.lval);
-
}
- /* }}} */
+/* }}} */
-/* {{{ proto string mcal_event_set_recur_monthly_wday(int stream_id,int year,int month,int day,int
interval)
- create a monthy by week recurrence */
+/* {{{ proto string mcal_event_set_recur_monthly_wday(int stream_id, int year, int month, int day,
int interval)
+ Create a monthy by week recurrence */
void php3_mcal_event_set_recur_monthly_wday(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*day,*interval;
@@ -1571,12 +1512,11 @@
dt_setdate(&endtime,year->value.lval,month->value.lval,day->value.lval);
calevent_recur_monthly_wday(mcal_le_struct->event, &endtime,
interval->value.lval);
-
}
- /* }}} */
+/* }}} */
-/* {{{ proto string mcal_event_set_recur_yearly(int stream_id,int year,int month,int day,int
interval)
- create a yearly recurrence */
+/* {{{ proto string mcal_event_set_recur_yearly(int stream_id, int year, int month, int day, int
interval)
+ Create a yearly recurrence */
void php3_mcal_event_set_recur_yearly(INTERNAL_FUNCTION_PARAMETERS)
{
pval *streamind,*year,*month,*day,*interval;
@@ -1606,15 +1546,11 @@
dt_setdate(&endtime,year->value.lval,month->value.lval,day->value.lval);
calevent_recur_yearly(mcal_le_struct->event, &endtime,
interval->value.lval);
-
}
- /* }}} */
-
+/* }}} */
/* Interfaces to callbacks */
-
-
void cc_searched (unsigned long cal_uid)
{
if(g_cal_list==NULL)
@@ -1633,23 +1569,14 @@
}
}
-
-
-
-
-
void cc_appended(u_int32_t uid)
{
-
}
-
void cc_fetched(const CALEVENT *event)
{
-
}
-
void cc_login(const char **user, const char **pwd)
{
@@ -1657,7 +1584,6 @@
*pwd=mcal_password;
}
-
void cc_vlog(const char *fmt,va_list ap)
{
}
@@ -1666,7 +1592,6 @@
}
#endif
-
/*
* Local_ variables:
Index: php3/functions/posix.c
diff -u php3/functions/posix.c:1.14 php3/functions/posix.c:1.15
--- php3/functions/posix.c:1.14 Sun Nov 21 03:30:47 1999
+++ php3/functions/posix.c Sun Nov 21 04:10:41 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: posix.c,v 1.14 1999/11/21 08:30:47 eschmid Exp $ */
+/* $Id: posix.c,v 1.15 1999/11/21 09:10:41 eschmid Exp $ */
#include "php.h"
@@ -148,7 +148,7 @@
void php3_info_posix(void)
{
- php3_printf("$Revision: 1.14 $\n");
+ php3_printf("$Revision: 1.15 $\n");
}
/* {{{ proto int posix_kill(int pid, int sig)
@@ -600,7 +600,7 @@
*/
/* {{{ proto string posix_mkfifo()
- Make a FIFO Special File (POSIX.1, 5.4.2) */
+ Make a FIFO special file (POSIX.1, 5.4.2) */
void php3_posix_mkfifo(INTERNAL_FUNCTION_PARAMETERS)
{
#if HAVE_MKFIFO
@@ -646,7 +646,7 @@
*/
/* {{{ proto array posix_getgrnam(string groupname)
- Group Database Access (POSIX.1, 9.2.1) */
+ Group database access (POSIX.1, 9.2.1) */
void php3_posix_getgrnam(INTERNAL_FUNCTION_PARAMETERS)
{
pval *name;