cvs: /php3/functions php3_mcal.c php3_mcal.h /php3 Makefile.in acconfig.h config.h.in

From: Date: Thu, 02 Sep 1999 19:26:24 +0000
Subject: cvs: /php3/functions php3_mcal.c php3_mcal.h /php3 Makefile.in acconfig.h config.h.in
Groups: php.dev 
Request: Send a blank email to php-dev+get-10466@lists.php.net to get a copy of this message
musone Thu Sep 2 15:26:24 1999 EDT Modified files: /php3/functions php3_mcal.c php3_mcal.h /php3 Makefile.in acconfig.h config.h.in Log: ported to php3 Index: php3/functions/php3_mcal.c diff -u php3/functions/php3_mcal.c:1.3 php3/functions/php3_mcal.c:1.4 --- php3/functions/php3_mcal.c:1.3 Wed Sep 1 17:25:04 1999 +++ php3/functions/php3_mcal.c Thu Sep 2 15:26:23 1999 @@ -35,6 +35,7 @@ #endif #include "php.h" +#include "internal_functions.h" #if COMPILE_DL #include "dl/phpdl.h" @@ -95,7 +96,7 @@ php3_module_entry php3_mcal_module_entry = { - CALVER, mcal_functions, PHP_MINIT(mcal), NULL, NULL, NULL, PHP_MINFO(mcal), 0, 0, 0, NULL + CALVER, mcal_functions, PHP_MINIT_FUNCTION, NULL, NULL, NULL, PHP_MINFO_FUNCTION, 0, 0, 0, NULL }; @@ -125,7 +126,7 @@ } -PHP_MINFO_FUNCTION(mcal) +void PHP_MINFO_FUNCTION(void) { php3_printf("Mcal Support enabled<br>"); php3_printf("<table>"); @@ -134,7 +135,7 @@ php3_printf("</tr></table>"); } -PHP_MINIT_FUNCTION(mcal) +PHP_MINIT_FUNCTION(INIT_FUNC_ARGS) { le_mcal = register_list_destructors(cal_close_it,NULL); @@ -145,14 +146,7 @@ static int add_assoc_object(pval *arg, char *key, pval *tmp) { - HashTable *symtable; - - if (arg->type == IS_OBJECT) { - symtable = arg->value.obj.properties; - } else { - symtable = arg->value.ht; - } - return _php3_hash_update(symtable, key, strlen(key)+1, (void *) &tmp, sizeof(pval *), NULL); + return _php3_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(pval), NULL); } @@ -423,34 +417,34 @@ begincal.has_time=0; endcal.has_time=0; if(_php3_hash_find(begindate->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - begincal.year=(*pvalue)->value.lval; + convert_to_long(pvalue); + begincal.year=(pvalue)->value.lval; } if(_php3_hash_find(begindate->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - begincal.mon=(*pvalue)->value.lval; + convert_to_long(pvalue); + begincal.mon=(pvalue)->value.lval; } if(_php3_hash_find(begindate->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - begincal.mday=(*pvalue)->value.lval; + convert_to_long(pvalue); + begincal.mday=(pvalue)->value.lval; } if(myargc == 3) { if(_php3_hash_find(enddate->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - endcal.year=(*pvalue)->value.lval; + convert_to_long(pvalue); + endcal.year=(pvalue)->value.lval; } if(_php3_hash_find(enddate->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - endcal.mon=(*pvalue)->value.lval; + convert_to_long(pvalue); + endcal.mon=(pvalue)->value.lval; } if(_php3_hash_find(enddate->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - endcal.mday=(*pvalue)->value.lval; + convert_to_long(pvalue); + endcal.mday=(pvalue)->value.lval; } } @@ -573,29 +567,29 @@ mydate.has_time=1; if(_php3_hash_find(date->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - mydate.year=(*pvalue)->value.lval; + convert_to_long(pvalue); + mydate.year=(pvalue)->value.lval; } if(_php3_hash_find(date->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - mydate.mon=(*pvalue)->value.lval; + convert_to_long(pvalue); + mydate.mon=(pvalue)->value.lval; } if(_php3_hash_find(date->value.ht,"day",sizeof("day"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - mydate.mday=(*pvalue)->value.lval; + convert_to_long(pvalue); + mydate.mday=(pvalue)->value.lval; } if(_php3_hash_find(time->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - mydate.hour=(*pvalue)->value.lval; + convert_to_long(pvalue); + mydate.hour=(pvalue)->value.lval; } if(_php3_hash_find(time->value.ht,"minute",sizeof("minute"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - mydate.min=(*pvalue)->value.lval; + convert_to_long(pvalue); + mydate.min=(pvalue)->value.lval; } mydate.sec=0; g_cal_list=NULL; @@ -732,107 +726,107 @@ myevent=calevent_new(); if(_php3_hash_find(storeobject->value.ht,"uid",sizeof("uid"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->id=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->id=(pvalue)->value.lval; } if(_php3_hash_find(storeobject->value.ht,"public",sizeof("public"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->public=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->public=(pvalue)->value.lval; } if(_php3_hash_find(storeobject->value.ht,"category",sizeof("category"),(void **) &pvalue)== SUCCESS){ - convert_to_string(*pvalue); - myevent->category=strdup((*pvalue)->value.str.val); + convert_to_string(pvalue); + myevent->category=strdup((pvalue)->value.str.val); } if(_php3_hash_find(storeobject->value.ht,"title",sizeof("title"),(void **) &pvalue)== SUCCESS){ - convert_to_string(*pvalue); - myevent->title=strdup((*pvalue)->value.str.val); + convert_to_string(pvalue); + myevent->title=strdup((pvalue)->value.str.val); } if(_php3_hash_find(storeobject->value.ht,"description",sizeof("description"),(void **) &pvalue)== SUCCESS){ - convert_to_string(*pvalue); - myevent->description=strdup((*pvalue)->value.str.val); + convert_to_string(pvalue); + myevent->description=strdup((pvalue)->value.str.val); } if(_php3_hash_find(storeobject->value.ht,"alarm",sizeof("alarm"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->alarm=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->alarm=(pvalue)->value.lval; } if(_php3_hash_find(storeobject->value.ht,"start",sizeof("start"),(void **) &temppvalue)== SUCCESS){ - convert_to_array(*temppvalue); + convert_to_array(temppvalue); - if(_php3_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.year=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.year=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.mon=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.mon=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.mday=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.mday=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.hour=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.hour=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.min=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.min=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->start.sec=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->start.sec=(pvalue)->value.lval; } myevent->start.has_date=true; } if(_php3_hash_find(storeobject->value.ht,"end",sizeof("end"),(void **) &temppvalue)== SUCCESS){ - convert_to_array(*temppvalue); + convert_to_array(temppvalue); - if(_php3_hash_find((*temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"year",sizeof("year"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.year=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.year=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"month",sizeof("month"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.mon=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.mon=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"mday",sizeof("mday"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.mday=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.mday=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"hour",sizeof("hour"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.hour=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.hour=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"min",sizeof("min"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.min=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.min=(pvalue)->value.lval; } - if(_php3_hash_find((*temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ + if(_php3_hash_find((temppvalue)->value.ht,"sec",sizeof("sec"),(void **) &pvalue)== SUCCESS){ - convert_to_long(*pvalue); - myevent->end.sec=(*pvalue)->value.lval; + convert_to_long(pvalue); + myevent->end.sec=(pvalue)->value.lval; } myevent->end.has_date=true; } Index: php3/functions/php3_mcal.h diff -u php3/functions/php3_mcal.h:1.1 php3/functions/php3_mcal.h:1.2 --- php3/functions/php3_mcal.h:1.1 Wed Sep 1 16:50:55 1999 +++ php3/functions/php3_mcal.h Thu Sep 2 15:26:23 1999 @@ -1,4 +1,4 @@ -/* $Id: php3_mcal.h,v 1.1 1999/09/01 20:50:55 musone Exp $ */ +/* $Id: php3_mcal.h,v 1.2 1999/09/02 19:26:23 musone Exp $ */ #ifndef _INCLUDED_MCAL_H #define _INCLUDED_MCAL_H @@ -17,13 +17,15 @@ #include "build-defs.h" #endif -extern PHP_MINIT_FUNCTION(mcal); -PHP_MINFO_FUNCTION(mcal); - /* Functions accessable to PHP */ +//extern php3_module_entry php3_mcal_module_entry; extern php3_module_entry php3_mcal_module_entry; #define php3_mcal_module_ptr &php3_mcal_module_entry #define phpext_mcal_ptr php3_mcal_module_ptr + +extern int PHP_MINIT_FUNCTION(INIT_FUNC_ARGS); +extern void PHP_MINFO_FUNCTION(void); + extern int mcal_init_request(INIT_FUNC_ARGS); extern int mcal_end_request(void); Index: php3/Makefile.in diff -u php3/Makefile.in:1.346 php3/Makefile.in:1.347 --- php3/Makefile.in:1.346 Wed Sep 1 20:31:13 1999 +++ php3/Makefile.in Thu Sep 2 15:26:23 1999 @@ -24,7 +24,7 @@ # +----------------------------------------------------------------------+ # -# $Id: Makefile.in,v 1.346 1999/09/02 00:31:13 rasmus Exp $ +# $Id: Makefile.in,v 1.347 1999/09/02 19:26:23 musone Exp $ # prefix = @prefix@ @@ -79,7 +79,7 @@ functions/dl.c functions/dns.c functions/exec.c functions/file.c \ functions/filepro.c functions/filestat.c \ functions/formatted_print.c functions/fsock.c functions/gd.c \ - functions/head.c functions/html.c functions/image.c functions/imap.c functions/imsp.c \ + functions/head.c functions/html.c functions/image.c functions/imap.c functions/php3_mcal.c functions/imsp.c \ functions/link.c functions/mail.c functions/math.c functions/iptc.c \ functions/md5.c functions/microtime.c functions/mime.c \ functions/msql.c functions/mysql.c \ @@ -293,7 +293,7 @@ functions/oracle.h functions/base64.h functions/php3_dir.h \ functions/dns.h functions/php3_pgsql.h functions/php3_velocis.h \ functions/php3_sybase.h functions/php3_sybase-ct.h functions/reg.h \ - functions/php3_mail.h functions/imap.h functions/imsp.h functions/php3_aspell.h \ + functions/php3_mail.h functions/imap.h functions/php3_mcal.h functions/imsp.h functions/php3_aspell.h \ functions/md5.h functions/php3_global.h functions/php3_gd.h \ functions/html.h functions/dl.h functions/head.h functions/post.h \ functions/exec.h functions/php3_solid.h functions/adabasd.h \ @@ -478,6 +478,10 @@ php3_hash.h alloc.h safe_mode.h fopen-wrappers.h \ mod_php3.h stack.h operators.h token_cache.h variables.h constants.h \ internal_functions.h modules.h +functions/php3_mcal.c: functions/php3_mcal.h config.h php.h php_version.h request_info.h \ +php3_hash.h alloc.h safe_mode.h fopen-wrappers.h \ +mod_php3.h stack.h operators.h token_cache.h variables.h constants.h \ +internal_functions.h modules.h functions/imsp.o: functions/imsp.c config.h php.h php_version.h request_info.h \ php3_hash.h alloc.h safe_mode.h fopen-wrappers.h \ mod_php3.h stack.h operators.h token_cache.h variables.h constants.h \ Index: php3/acconfig.h diff -u php3/acconfig.h:1.110 php3/acconfig.h:1.111 --- php3/acconfig.h:1.110 Fri Aug 6 12:09:24 1999 +++ php3/acconfig.h Thu Sep 2 15:26:23 1999 @@ -1,4 +1,3 @@ -#undef HAVE_ICAP #undef HAVE_LIBGD14 #undef HAVE_LIBGD15 #undef HAVE_LIBGD16 @@ -185,6 +184,9 @@ /* Define if you want the IMAP directory interface */ #define HAVE_IMAP 0 + +/* Define if you want MCAL */ +#define HAVE_MCAL 0 /* Define if you want the IMSP options/addressbook interface */ #define HAVE_IMSP 0 Index: php3/config.h.in diff -u php3/config.h.in:1.190 php3/config.h.in:1.191 --- php3/config.h.in:1.190 Tue Aug 17 09:28:42 1999 +++ php3/config.h.in Thu Sep 2 15:26:23 1999 @@ -68,7 +68,6 @@ /* Define to `int' if <sys/types.h> doesn't define. */ #undef uid_t -#undef HAVE_ICAP #undef HAVE_LIBGD14 #undef HAVE_LIBGD15 #undef HAVE_LIBGD16 @@ -232,6 +231,9 @@ /* Define if you want the IMAP directory interface */ #define HAVE_IMAP 0 + +/* define if you want MCAL */ +#define HAVE_MCAL 0 /* Define if you want the IMSP options/addressbook interface */ #define HAVE_IMSP 0

« previous php.dev (#10466) next »