}
#else /* NFS_HACK */
- lockfd = VCWD_OPEN((lockfn,O_RDWR|O_CREAT,0644));
+ lockfd = VCWD_OPEN_MODE(lockfn, O_RDWR|O_CREAT, 0644);
if (lockfd) {
flock(lockfd,LOCK_EX);
/* {{{ proto bool dbmclose(int dbm_identifier)
Closes a dbm database */
-PHP_FUNCTION(dbmclose) {
+PHP_FUNCTION(dbmclose)
+{
pval *id;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht,1,&id)==FAILURE) {
VCWD_UNLINK(info->lockfn);
#else
if (info->lockfn) {
- lockfd = VCWD_OPEN((info->lockfn,O_RDWR,0644));
+ lockfd = VCWD_OPEN_MODE(info->lockfn, O_RDWR, 0644);
flock(lockfd,LOCK_UN);
close(lockfd);
}
cdb = malloc(sizeof *cdb);
memset(cdb, 0, sizeof *cdb);
- cdb->fd = VCWD_OPEN((info->path, gmode));
+ cdb->fd = VCWD_OPEN(info->path, gmode);
if(cdb->fd < 0) {
free(cdb);
return FAILURE;
#define TRUNC_IT(extension, mode) \
snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \
buf[MAXPATHLEN-1] = '\0'; \
- if((fd = VCWD_OPEN((buf, O_CREAT | mode | O_WRONLY, filemode))) == -1) \
+ if((fd = VCWD_OPEN_MODE(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \
return FAILURE; \
close(fd);
/* {{{ proto int dbase_open(string name, int mode)
Opens a dBase-format database file */
-PHP_FUNCTION(dbase_open) {
+PHP_FUNCTION(dbase_open)
+{
pval *dbf_name, *options;
dbhead_t *dbh;
int handle;
/* {{{ proto bool dbase_close(int identifier)
Closes an open dBase-format database file */
-PHP_FUNCTION(dbase_close) {
+PHP_FUNCTION(dbase_close)
+{
pval *dbh_id;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto int dbase_numrecords(int identifier)
Returns the number of records in the database */
-PHP_FUNCTION(dbase_numrecords) {
+PHP_FUNCTION(dbase_numrecords)
+{
pval *dbh_id;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto int dbase_numfields(int identifier)
Returns the number of fields (columns) in the database */
-PHP_FUNCTION(dbase_numfields) {
+PHP_FUNCTION(dbase_numfields)
+{
pval *dbh_id;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto bool dbase_pack(int identifier)
Packs the database (deletes records marked for deletion) */
-PHP_FUNCTION(dbase_pack) {
+PHP_FUNCTION(dbase_pack)
+{
pval *dbh_id;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto bool dbase_add_record(int identifier, array data)
Adds a record to the database */
-PHP_FUNCTION(dbase_add_record) {
+PHP_FUNCTION(dbase_add_record)
+{
pval *dbh_id, *fields, **field;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto bool dbase_delete_record(int identifier, int record)
Marks a record to be deleted */
-PHP_FUNCTION(dbase_delete_record) {
+PHP_FUNCTION(dbase_delete_record)
+{
pval *dbh_id, *record;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto array dbase_get_record(int identifier, int record)
Returns an array representing a record from the database */
-PHP_FUNCTION(dbase_get_record) {
+PHP_FUNCTION(dbase_get_record)
+{
pval *dbh_id, *record;
dbhead_t *dbh;
int dbh_type;
/* From Martin Kuba <makub@aida.inet.cz> */
/* {{{ proto array dbase_get_record_with_names(int identifier, int record)
Returns an associative array representing a record from the database */
-PHP_FUNCTION(dbase_get_record_with_names) {
+PHP_FUNCTION(dbase_get_record_with_names)
+{
pval *dbh_id, *record;
dbhead_t *dbh;
int dbh_type;
/* {{{ proto bool dbase_create(string filename, array fields)
Creates a new dBase-format database file */
-PHP_FUNCTION(dbase_create) {
+PHP_FUNCTION(dbase_create)
+{
pval *filename, *fields, **field, **value;
int fd;
dbhead_t *dbh;
RETURN_FALSE;
}
- if ((fd = VCWD_OPEN((Z_STRVAL_P(filename), O_BINARY|O_RDWR|O_CREAT, 0644))) < 0) {
+ if ((fd = VCWD_OPEN_MODE(Z_STRVAL_P(filename), O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) {
php_error(E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno));
RETURN_FALSE;
}
dbhead_t *dbh;
cp = dp;
- if ((fd = VCWD_OPEN((cp, o_flags|O_BINARY))) < 0) {
+ if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) {
cp = (char *)malloc(256);
strcpy(cp, dp); strcat(cp, ".dbf");
- if ((fd = VCWD_OPEN((cp, o_flags))) < 0) {
+ if ((fd = VCWD_OPEN(cp, o_flags)) < 0) {
perror("open");
return NULL;
}
/* {{{ proto string xpath_new_context([int doc_handle])
Create new XPath context */
-PHP_FUNCTION(xpath_new_context) {
+PHP_FUNCTION(xpath_new_context)
+{
php_xpathptr_new_context(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH);
}
/* }}} */
/* {{{ proto string xptr_new_context([int doc_handle])
Create new XPath context */
-PHP_FUNCTION(xptr_new_context) {
+PHP_FUNCTION(xptr_new_context)
+{
php_xpathptr_new_context(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPTR);
}
/* }}} */
/* {{{ proto int xpath_eval([int xpathctx_handle,] string str)
Evaluate the XPath Location Path in the given string */
-PHP_FUNCTION(xpath_eval) {
+PHP_FUNCTION(xpath_eval)
+{
php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH, 0);
}
/* }}} */
/* {{{ proto int xpath_eval_expression([int xpathctx_handle,] string str)
Evaluate the XPath Location Path in the given string */
-PHP_FUNCTION(xpath_eval_expression) {
+PHP_FUNCTION(xpath_eval_expression)
+{
php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH, 1);
}
/* }}} */
#if defined(LIBXML_XPTR_ENABLED)
/* {{{ proto int xptr_eval([int xpathctx_handle,] string str)
Evaluate the XPtr Location Path in the given string */
-PHP_FUNCTION(xptr_eval) {
+PHP_FUNCTION(xptr_eval)
+{
php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPTR, 0);
}
/* }}} */
ASInt32 nBytes;
zval *array_ptr = (zval *) arg;
- fp=php_open_temporary_file(NULL,"fdfdata.",&filename);
+ fp=php_open_temporary_file(NULL, "fdfdata.", &filename TSRMLS_CC);
if(!fp) {
if(filename) efree(filename);
return;
l = strlen(str);
#ifdef VIRTUAL_DIR
- if(virtual_filepath(Z_STRVAL_PP(FONTNAME), &fontname)) {
+ if(virtual_filepath(Z_STRVAL_PP(FONTNAME), &fontname TSRMLS_CC)) {
fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME);
}
#else
fontkey_t *b=(fontkey_t *)key;
int i, n, map_found;
short platform, encoding;
+ TSRMLS_FETCH();
a = (font_t *)malloc(sizeof(font_t));
#ifdef VIRTUAL_DIR
/* a->fontname will be freed in fontRelease() later on */
- if (virtual_filepath(b->fontname, &a->fontname)) {
+ if (virtual_filepath(b->fontname, &a->fontname TSRMLS_CC)) {
*error = "Could not find/open font";
return NULL;
}
/* {{{ proto void hw_close(int link)
Close connection to Hyperwave server */
-PHP_FUNCTION(hw_close) {
+PHP_FUNCTION(hw_close)
+{
pval **arg1;
int id, type;
hw_connection *ptr;
/* {{{ proto string hw_stat(int link)
Returns status string */
-PHP_FUNCTION(hw_stat) {
+PHP_FUNCTION(hw_stat)
+{
char *object;
object = php_hw_command(INTERNAL_FUNCTION_PARAM_PASSTHRU, STAT_COMMAND);
/* {{{ proto array hw_who(int link)
Returns names and info of users loged in */
-PHP_FUNCTION(hw_who) {
+PHP_FUNCTION(hw_who)
+{
zval *user_arr;
char *object, *ptr, *temp, *attrname;
int i;
/* {{{ proto string hw_dummy(int link, int id, int msgid)
Hyperwave dummy function */
-PHP_FUNCTION(hw_dummy) {
+PHP_FUNCTION(hw_dummy)
+{
pval **arg1, **arg2, **arg3;
int link, id, type, msgid;
hw_connection *ptr;
/* {{{ proto string hw_getobject(int link, int objid [, string query])
Returns object record */
-PHP_FUNCTION(hw_getobject) {
+PHP_FUNCTION(hw_getobject)
+{
pval **argv[3];
int argc, link, id, type, multi;
char *query;
/* {{{ proto int hw_insertobject(int link, string objrec, string parms)
Inserts an object */
-PHP_FUNCTION(hw_insertobject) {
+PHP_FUNCTION(hw_insertobject)
+{
pval *arg1, *arg2, *arg3;
int link, type;
char *objrec, *parms;
/* {{{ proto string hw_getandlock(int link, int objid)
Returns object record and locks object */
-PHP_FUNCTION(hw_getandlock) {
+PHP_FUNCTION(hw_getandlock)
+{
pval *arg1, *arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto void hw_unlock(int link, int objid)
Unlocks object */
-PHP_FUNCTION(hw_unlock) {
+PHP_FUNCTION(hw_unlock)
+{
pval *arg1, *arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto void hw_deleteobject(int link, int objid)
Deletes object */
-PHP_FUNCTION(hw_deleteobject) {
+PHP_FUNCTION(hw_deleteobject)
+{
pval *arg1, *arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto void hw_changeobject(int link, int objid, array attributes)
Changes attributes of an object (obsolete) */
#define BUFFERLEN 200
-PHP_FUNCTION(hw_changeobject) {
+PHP_FUNCTION(hw_changeobject)
+{
pval *arg1, *arg2, *arg3;
int link, id, type, i;
hw_connection *ptr;
/* {{{ proto void hw_modifyobject(int link, int objid, array remattributes, array addattributes [, int mode])
Modifies attributes of an object */
#define BUFFERLEN 200
-PHP_FUNCTION(hw_modifyobject) {
+PHP_FUNCTION(hw_modifyobject)
+{
zval **argv[5];
int argc;
int link, id, type, i, mode;
/* {{{ proto void hw_mv(int link, array objrec, int from, int dest)
Moves object */
-PHP_FUNCTION(hw_mv) {
+PHP_FUNCTION(hw_mv)
+{
php_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, MOVE);
}
/* }}} */
/* {{{ proto void hw_cp(int link, array objrec, int dest)
Copies object */
-PHP_FUNCTION(hw_cp) {
+PHP_FUNCTION(hw_cp)
+{
php_hw_mvcp(INTERNAL_FUNCTION_PARAM_PASSTHRU, COPY);
}
/* }}} */
/* {{{ proto hwdoc hw_gettext(int link, int objid [, int rootid])
Returns text document. Links are relative to rootid if given */
-PHP_FUNCTION(hw_gettext) {
+PHP_FUNCTION(hw_gettext)
+{
pval *argv[3];
int argc, link, id, type, mode;
int rootid = 0;
/* {{{ proto void hw_edittext(int link, hwdoc doc)
Modifies text document */
-PHP_FUNCTION(hw_edittext) {
+PHP_FUNCTION(hw_edittext)
+{
pval *arg1, *arg2;
int link, doc, type;
hw_connection *ptr;
Returns the output of a CGI script */
#define BUFFERLEN 1000
/* FIX ME: The buffer cgi_env_str should be allocated dynamically */
-PHP_FUNCTION(hw_getcgi) {
+PHP_FUNCTION(hw_getcgi)
+{
pval *arg1, *arg2;
int link, id, type;
hw_document *doc;
/* {{{ proto int hw_getremote(int link, int objid)
Returns the content of a remote document */
-PHP_FUNCTION(hw_getremote) {
+PHP_FUNCTION(hw_getremote)
+{
pval *arg1, *arg2;
int link, id, type;
hw_document *doc;
/* {{{ proto [array|int] hw_getremotechildren(int link, string objrec)
Returns the remote document or an array of object records */
-PHP_FUNCTION(hw_getremotechildren) {
+PHP_FUNCTION(hw_getremotechildren)
+{
pval *arg1, *arg2;
int link, type, i;
hw_connection *ptr;
/* {{{ proto void hw_setlinkroot(int link, int rootid)
Set the id to which links are calculated */
-PHP_FUNCTION(hw_setlinkroot) {
+PHP_FUNCTION(hw_setlinkroot)
+{
pval *arg1, *arg2;
int link, type, rootid;
hw_connection *ptr;
/* {{{ proto hwdoc hw_pipedocument(int link, int objid [, array urlprefixes])
Returns document with links inserted. Optionally a array with five urlprefixes may be passed, which will be inserted for the different types of anchors. This should be a named array with the following keys: HW_DEFAULT_LINK, HW_IMAGE_LINK, HW_BACKGROUND_LINK, HW_INTAG_LINK, and HW_APPLET_LINK */
-PHP_FUNCTION(hw_pipedocument) {
+PHP_FUNCTION(hw_pipedocument)
+{
pval *arg1, *arg2, *arg3;
int i, link, id, type, argc, mode;
int rootid = 0;
/* {{{ proto hwdoc hw_pipedocument(int link, int objid)
Returns document */
-PHP_FUNCTION(hw_oldpipedocument) {
+PHP_FUNCTION(hw_oldpipedocument)
+{
pval *argv[3];
int link, id, type, argc, mode;
int rootid = 0;
Returns output of CGI script */
#define BUFFERLEN 1000
/* FIX ME: The buffer cgi_env_str should be allocated dynamically */
-PHP_FUNCTION(hw_pipecgi) {
+PHP_FUNCTION(hw_pipecgi)
+{
pval *arg1, *arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto void hw_insertdocument(int link, int parentid, hwdoc doc)
Insert new document */
-PHP_FUNCTION(hw_insertdocument) {
+PHP_FUNCTION(hw_insertdocument)
+{
pval *arg1, *arg2, *arg3;
int link, id, doc, type;
hw_connection *ptr;
/* {{{ proto void hw_free_document(hwdoc doc)
Frees memory of document */
-PHP_FUNCTION(hw_free_document) {
+PHP_FUNCTION(hw_free_document)
+{
pval *arg1;
int id, type;
hw_document *ptr;
/* {{{ proto void hw_output_document(hwdoc doc)
Prints document */
-PHP_FUNCTION(hw_output_document) {
+PHP_FUNCTION(hw_output_document)
+{
pval *arg1;
int id, type;
hw_document *ptr;
/* {{{ proto string hw_document_bodytag(hwdoc doc [, string prefix])
Return bodytag prefixed by prefix */
-PHP_FUNCTION(hw_document_bodytag) {
+PHP_FUNCTION(hw_document_bodytag)
+{
pval *argv[2];
int id, type, argc;
hw_document *ptr;
/* {{{ proto string hw_document_content(hwdoc doc)
Returns content of document */
-PHP_FUNCTION(hw_document_content) {
+PHP_FUNCTION(hw_document_content)
+{
pval *argv[1];
int id, type, argc;
hw_document *ptr;
/* {{{ proto int hw_document_setcontent(hwdoc doc, string content)
Sets/replaces content of document */
-PHP_FUNCTION(hw_document_setcontent) {
+PHP_FUNCTION(hw_document_setcontent)
+{
pval *argv[2];
int id, type, argc;
hw_document *ptr;
/* {{{ proto int hw_document_size(hwdoc doc)
Returns size of document */
-PHP_FUNCTION(hw_document_size) {
+PHP_FUNCTION(hw_document_size)
+{
pval *arg1;
int id, type;
hw_document *ptr;
/* {{{ proto string hw_document_attributes(hwdoc doc)
Returns object record of document */
-PHP_FUNCTION(hw_document_attributes) {
+PHP_FUNCTION(hw_document_attributes)
+{
pval *arg1;
int id, type;
hw_document *ptr;
/* {{{ proto array hw_getparentsobj(int link, int objid)
Returns array of parent object records */
-PHP_FUNCTION(hw_getparentsobj) {
+PHP_FUNCTION(hw_getparentsobj)
+{
pval *arg1, *arg2;
int link, id, type;
int count;
/* {{{ proto array hw_getparents(int link, int objid)
Returns array of parent object ids */
-PHP_FUNCTION(hw_getparents) {
+PHP_FUNCTION(hw_getparents)
+{
pval *arg1, *arg2;
int link, id, type;
int count;
/* {{{ proto array hw_children(int link, int objid)
Returns array of children object ids */
-PHP_FUNCTION(hw_children) {
+PHP_FUNCTION(hw_children)
+{
zval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto array hw_childrenobj(int link, int objid)
Returns array of children object records */
-PHP_FUNCTION(hw_childrenobj) {
+PHP_FUNCTION(hw_childrenobj)
+{
pval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto array hw_getchildcoll(int link, int objid)
Returns array of child collection object ids */
-PHP_FUNCTION(hw_getchildcoll) {
+PHP_FUNCTION(hw_getchildcoll)
+{
pval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto array hw_getchildcollobj(int link, int objid)
Returns array of child collection object records */
-PHP_FUNCTION(hw_getchildcollobj) {
+PHP_FUNCTION(hw_getchildcollobj)
+{
pval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto int hw_docbyanchor(int link, int anchorid)
Returns objid of document belonging to anchorid */
-PHP_FUNCTION(hw_docbyanchor) {
+PHP_FUNCTION(hw_docbyanchor)
+{
pval **arg1, **arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto array hw_docbyanchorobj(int link, int anchorid)
Returns object record of document belonging to anchorid */
-PHP_FUNCTION(hw_docbyanchorobj) {
+PHP_FUNCTION(hw_docbyanchorobj)
+{
pval **arg1, **arg2;
int link, id, type;
hw_connection *ptr;
/* {{{ proto array hw_getobjectbyquery(int link, string query, int maxhits)
Search for query and return maxhits objids */
-PHP_FUNCTION(hw_getobjectbyquery) {
+PHP_FUNCTION(hw_getobjectbyquery)
+{
pval **arg1, **arg2, **arg3;
int link, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyqueryobj(int link, string query, int maxhits)
Search for query and return maxhits object records */
-PHP_FUNCTION(hw_getobjectbyqueryobj) {
+PHP_FUNCTION(hw_getobjectbyqueryobj)
+{
pval **arg1, **arg2, **arg3;
int link, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyquerycoll(int link, int collid, string query, int maxhits)
Search for query in collection and return maxhits objids */
-PHP_FUNCTION(hw_getobjectbyquerycoll) {
+PHP_FUNCTION(hw_getobjectbyquerycoll)
+{
pval **arg1, **arg2, **arg3, **arg4;
int link, id, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyquerycollobj(int link, int collid, string query, int maxhits)
Search for query in collection and return maxhits object records */
-PHP_FUNCTION(hw_getobjectbyquerycollobj) {
+PHP_FUNCTION(hw_getobjectbyquerycollobj)
+{
pval **arg1, **arg2, **arg3, **arg4;
int link, id, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyftquery(int link, string query, int maxhits)
Search for query as fulltext and return maxhits objids */
-PHP_FUNCTION(hw_getobjectbyftquery) {
+PHP_FUNCTION(hw_getobjectbyftquery)
+{
pval **arg1, **arg2, **arg3;
int link, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyftqueryobj(int link, string query, int maxhits)
Search for query as fulltext and return maxhits object records */
-PHP_FUNCTION(hw_getobjectbyftqueryobj) {
+PHP_FUNCTION(hw_getobjectbyftqueryobj)
+{
pval **arg1, **arg2, **arg3;
int link, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyftquerycoll(int link, int collid, string query, int maxhits)
Search for fulltext query in collection and return maxhits objids */
-PHP_FUNCTION(hw_getobjectbyftquerycoll) {
+PHP_FUNCTION(hw_getobjectbyftquerycoll)
+{
pval **arg1, **arg2, **arg3, **arg4;
int link, id, type, maxhits;
char *query;
/* {{{ proto array hw_getobjectbyftquerycollobj(int link, int collid, string query, int maxhits)
Search for fulltext query in collection and return maxhits object records */
-PHP_FUNCTION(hw_getobjectbyftquerycollobj) {
+PHP_FUNCTION(hw_getobjectbyftquerycollobj)
+{
pval **arg1, **arg2, **arg3, **arg4;
int link, id, type, maxhits;
char *query;
/* {{{ proto array hw_getchilddoccoll(int link, int objid)
Returns all children ids which are documents */
-PHP_FUNCTION(hw_getchilddoccoll) {
+PHP_FUNCTION(hw_getchilddoccoll)
+{
pval **arg1, **arg2;
int link, id, type;
int count, i;
/* {{{ proto array hw_getchilddoccollobj(int link, int objid)
Returns all children object records which are documents */
-PHP_FUNCTION(hw_getchilddoccollobj) {
+PHP_FUNCTION(hw_getchilddoccollobj)
+{
pval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto array hw_getanchors(int link, int objid)
Return all anchors of object */
-PHP_FUNCTION(hw_getanchors) {
+PHP_FUNCTION(hw_getanchors)
+{
pval **arg1, **arg2;
int link, id, type;
int count, i;
/* {{{ proto array hw_getanchorsobj(int link, int objid)
Return all object records of anchors of object */
-PHP_FUNCTION(hw_getanchorsobj) {
+PHP_FUNCTION(hw_getanchorsobj)
+{
pval **arg1, **arg2;
int link, id, type;
int count;
/* {{{ proto string hw_getusername(int link)
Returns the current user name */
-PHP_FUNCTION(hw_getusername) {
+PHP_FUNCTION(hw_getusername)
+{
pval **arg1;
int link, type;
hw_connection *ptr;
/* {{{ proto void hw_identify(int link, string username, string password)
Identifies at Hyperwave server */
-PHP_FUNCTION(hw_identify) {
+PHP_FUNCTION(hw_identify)
+{
pval **arg1, **arg2, **arg3;
int link, type;
char *name, *passwd, *userdata;
/* {{{ proto array hw_objrec2array(string objrec, [array format])
Returns object array of object record */
-PHP_FUNCTION(hw_objrec2array) {
+PHP_FUNCTION(hw_objrec2array)
+{
zval **arg1, **arg2;
switch(ZEND_NUM_ARGS()) {
/* {{{ proto string hw_array2objrec(array objarr)
Returns object record of object array */
-PHP_FUNCTION(hw_array2objrec) {
+PHP_FUNCTION(hw_array2objrec)
+{
pval **arg1;
char *objrec, *retobj;
/* {{{ proto array hw_incollections(int link, array objids, array collids, int para)
Returns object ids which are in collections */
-PHP_FUNCTION(hw_incollections) {
+PHP_FUNCTION(hw_incollections)
+{
pval **arg1, **arg2, **arg3, **arg4;
int type, link, i;
hw_connection *ptr;
/* {{{ proto void hw_inscoll(int link, int parentid, array objarr)
Inserts collection */
-PHP_FUNCTION(hw_inscoll) {
+PHP_FUNCTION(hw_inscoll)
+{
pval **arg1, **arg2, **arg3;
char *objrec;
int id, newid, type, link;
/* {{{ proto void hw_insdoc(int link, int parentid, string objrec [, string text])
Inserts document */
-PHP_FUNCTION(hw_insdoc) {
+PHP_FUNCTION(hw_insdoc)
+{
zval **argv[4];
char *objrec, *text;
int id, newid, type, link, argc;
/* {{{ proto int hw_getsrcbydestobj(int link, int destid)
Returns object id of source docuent by destination anchor */
-PHP_FUNCTION(hw_getsrcbydestobj) {
+PHP_FUNCTION(hw_getsrcbydestobj)
+{
pval **arg1, **arg2;
int link, type, id;
int count;
/* {{{ proto int hw_mapid(int link, int serverid, int destid)
Returns virtual object id of document on remote Hyperwave server */
-PHP_FUNCTION(hw_mapid) {
+PHP_FUNCTION(hw_mapid)
+{
pval **arg1, **arg2, **arg3;
int link, type, servid, id, virtid;
hw_connection *ptr;
/* {{{ proto string hw_getrellink(int link, int rootid, int sourceid, int destid)
Get link from source to dest relative to rootid */
-PHP_FUNCTION(hw_getrellink) {
+PHP_FUNCTION(hw_getrellink)
+{
pval **arg1, **arg2, **arg3, **arg4;
int link, type;
int rootid, destid, sourceid;
/* {{{ proto string hw_insertanchors(int hwdoc, array anchorecs, array dest [, array urlprefixes])
Inserts only anchors into text */
-PHP_FUNCTION(hw_insertanchors) {
+PHP_FUNCTION(hw_insertanchors)
+{
pval **arg1, **arg2, **arg3, **arg4;
hw_document *hwdoc;
int type, docid, error, argc, count;
/* {{{ proto string ldap_t61_to_8859(string value)
Translate t61 characters to 8859 characters */
-PHP_FUNCTION(ldap_t61_to_8859) {
+PHP_FUNCTION(ldap_t61_to_8859)
+{
php_ldap_do_translate(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto string ldap_8859_to_t61(string value)
Translate 8859 characters to t61 characters */
-PHP_FUNCTION(ldap_8859_to_t61) {
+PHP_FUNCTION(ldap_8859_to_t61)
+{
php_ldap_do_translate(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto string udm_get_res_field(int res, int row, int field)
Fetch mnoGoSearch result field */
-DLEXPORT PHP_FUNCTION(udm_get_res_field){
+DLEXPORT PHP_FUNCTION(udm_get_res_field)
+{
pval **yyres, **yyrow_num, **yyfield_name;
UDM_RESULT * Res;
Mark a note_id as read for the User user_name
Note: user_name must be fully distinguished user name
*/
-PHP_FUNCTION(notes_mark_read){
+PHP_FUNCTION(notes_mark_read)
+{
int argc;
int ActionCount;
Mark a note_id as unread for the User user_name
Note: user_name must be fully distinguished user name
*/
-PHP_FUNCTION(notes_mark_unread){
+PHP_FUNCTION(notes_mark_unread)
+{
int argc;
int ActionCount;
/* {{{ proto string notes_unread(string database_name, string user_name)
Returns the unread note id's for the current User user_name
Note: user_name must be fully distinguished user name*/
-PHP_FUNCTION(notes_unread){
+PHP_FUNCTION(notes_unread)
+{
int argc;
pval *argv[2];
priority H: High N: Normal L: Low
receipt 1: Yes 0: No
subject*/
-PHP_FUNCTION(notes_header_info){
+PHP_FUNCTION(notes_header_info)
+{
int argc;
pval *argv[3];
/* {{{ proto array notes_body(string server, string mailbox, int msg_number)
Open the message msg_number in the specified mailbox on the specified server (leave server
blank for local) and returns an array of body text lines. */
-PHP_FUNCTION(notes_body){
+PHP_FUNCTION(notes_body)
+{
int argc;
pval *argv[3];
FILTER
FIELD
*/
-PHP_FUNCTION(notes_find_note){
+PHP_FUNCTION(notes_find_note)
+{
int argc;
pval *argv[3];
/* {{{ proto bool notes_nav_create(string database_name, string name )
Create a navigator name, in database_name */
-PHP_FUNCTION(notes_nav_create){
+PHP_FUNCTION(notes_nav_create)
+{
int argc;
pval *argv[2];
STATUS LNPUBLIC print_file_summary (ITEM_TABLE *);
-PHP_FUNCTION(notes_search){
+PHP_FUNCTION(notes_search)
+{
int argc;
pval *argv[2];
char ItemName[MAX_ITEM_NAME_LEN];/* Zero terminated item name */
-PHP_FUNCTION(notes_list_msgs){
+PHP_FUNCTION(notes_list_msgs)
+{
int argc;
pval *argv[1];
filename = (*arg)->value.str.val;
- if ((fp = VCWD_OPEN((filename, O_RDONLY|O_BINARY))) == -1) {
+ if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) {
php_error(E_WARNING, "Can't open file %s", filename);
RETURN_FALSE;
}
goto bail;
}
- if ((fp = VCWD_OPEN((filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600))) == -1) {
+ if ((fp = VCWD_OPEN_MODE(filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600)) == -1) {
php_error(E_WARNING, "Can't create file %s", filename);
goto bail;
}
/* {{{ proto bool pdf_set_info(int pdfdoc, string fieldname, string value)
Fills an info field of the document */
-PHP_FUNCTION(pdf_set_info)
+PHP_FUNCTION(pdf_set_info)
{
zval **arg1, **arg2, **arg3;
PDF *pdf;
/* {{{ proto bool pdf_set_info_keywords(int pdfdoc, string keywords)
Fills the keywords field of the document */
-PHP_FUNCTION(pdf_set_info_keywords) {
+PHP_FUNCTION(pdf_set_info_keywords)
+{
_php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Keywords");
}
/* }}} */
/* {{{ proto int pdf_open([int filedesc])
Opens a new pdf document. If filedesc is NULL, document is created in memory. This is the old interface, only for compatibility use pdf_new + pdf_open_file instead */
-PHP_FUNCTION(pdf_open)
+PHP_FUNCTION(pdf_open)
{
zval **file;
FILE *fp;
/* {{{ proto void pdf_close(int pdfdoc)
Closes the pdf document */
-PHP_FUNCTION(pdf_close)
+PHP_FUNCTION(pdf_close)
{
zval **arg1;
PDF *pdf;
/* {{{ proto void pdf_begin_page(int pdfdoc, double width, double height)
Starts page */
-PHP_FUNCTION(pdf_begin_page)
+PHP_FUNCTION(pdf_begin_page)
{
zval **arg1, **arg2, **arg3;
PDF *pdf;
/* {{{ proto void pdf_end_page(int pdfdoc)
Ends page */
-PHP_FUNCTION(pdf_end_page)
+PHP_FUNCTION(pdf_end_page)
{
zval **arg1;
PDF *pdf;
/* {{{ proto void pdf_show(int pdfdoc, string text)
Output text at current position */
-PHP_FUNCTION(pdf_show)
+PHP_FUNCTION(pdf_show)
{
zval **arg1, **arg2;
PDF *pdf;
/* {{{ proto void pdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor)
Output text at position */
-PHP_FUNCTION(pdf_show_xy)
+PHP_FUNCTION(pdf_show_xy)
{
zval **arg1, **arg2, **arg3, **arg4;
PDF *pdf;
/* {{{ proto int pdf_show_boxed(int pdfdoc, string text, double x-koor, double y-koor, double width, double height, string mode [, string feature])
Output text formated in a boxed */
-PHP_FUNCTION(pdf_show_boxed)
+PHP_FUNCTION(pdf_show_boxed)
{
zval **argv[8];
int argc = ZEND_NUM_ARGS();
/* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, string encoding [, int embed])
Select the current font face, size and encoding */
-PHP_FUNCTION(pdf_set_font)
+PHP_FUNCTION(pdf_set_font)
{
zval **arg1, **arg2, **arg3, **arg4, **arg5;
int font, embed;
convert_to_string_ex(arg2);
#ifdef VIRTUAL_DIR
- virtual_filepath(Z_STRVAL_PP(arg2), &image);
+ virtual_filepath(Z_STRVAL_PP(arg2), &image TSRMLS_CC);
#else
image = Z_STRVAL_PP(arg2);
#endif
convert_to_string_ex(arg3);
#ifdef VIRTUAL_DIR
- virtual_filepath(Z_STRVAL_PP(arg3), &image);
+ virtual_filepath(Z_STRVAL_PP(arg3), &image TSRMLS_CC);
#else
image = Z_STRVAL_PP(arg3);
#endif
/* {{{ proto int pdf_new()
Creates a new PDF object */
-PHP_FUNCTION(pdf_new) {
+PHP_FUNCTION(pdf_new)
+{
PDF *pdf;
pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL);
/* {{{ proto void pdf_delete(int pdfdoc)
Deletes the PDF object */
-PHP_FUNCTION(pdf_delete) {
+PHP_FUNCTION(pdf_delete)
+{
zval **arg1;
PDF *pdf;
/* {{{ proto int pdf_open_file(int pdfdoc [, char filename])
Opens a new PDF document. If filename is NULL, document is created in memory. This is not yet fully supported */
-PHP_FUNCTION(pdf_open_file) {
+PHP_FUNCTION(pdf_open_file)
+{
zval **arg1, **arg2;
int pdf_file;
char *filename;
/* {{{ proto int pdf_get_buffer(int pdfdoc)
Fetches the full buffer containig the generated PDF data */
-PHP_FUNCTION(pdf_get_buffer) {
+PHP_FUNCTION(pdf_get_buffer)
+{
zval **arg1;
long size;
PDF *pdf;
/* {{{ proto int pdf_findfont(int pdfdoc, string fontname, string encoding [, int embed])
Prepares the font fontname for later use with pdf_setfont() */
-PHP_FUNCTION(pdf_findfont) {
+PHP_FUNCTION(pdf_findfont)
+{
zval **arg1, **arg2, **arg3, **arg4;
int embed, font;
const char *fontname, *encoding;
/* {{{ proto void pdf_setfont(int pdfdoc, int font, float fontsize)
Sets the current font in the fiven fontsize */
-PHP_FUNCTION(pdf_setfont) {
+PHP_FUNCTION(pdf_setfont)
+{
zval **arg1, **arg2, **arg3;
int font;
float fontsize;
/* {{{ proto void pdf_setpolydash(int pdfdoc, double darray)
Sets more complicated dash pattern */
-PHP_FUNCTION(pdf_setpolydash) {
+PHP_FUNCTION(pdf_setpolydash)
+{
zval **arg1, **arg2;
HashTable *array;
int len, i;
/* {{{ proto void pdf_concat(int pdf, double a, double b, double c, double d, double e, double f)
Concatenates a matrix to the current transformation matrix for text and graphics */
-PHP_FUNCTION(pdf_concat) {
+PHP_FUNCTION(pdf_concat)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
/* {{{ proto int pdf_open_ccitt(int pdf, string filename, int width, int height, int bitreverse, int k, int blackls1)
Opens an image file with raw CCITT G3 or G4 compresed bitmap data */
-PHP_FUNCTION(pdf_open_ccitt) {
+PHP_FUNCTION(pdf_open_ccitt)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
int pdf_image;
convert_to_string_ex(arg2);
#ifdef VIRTUAL_DIR
- virtual_filepath(Z_STRVAL_PP(arg2), &image);
+ virtual_filepath(Z_STRVAL_PP(arg2), &image TSRMLS_CC);
#else
image = Z_STRVAL_PP(arg2);
#endif
/* {{{ proto int pdf_open_image(int pdf, string type, string source, string data, long length, int width, int height, int components, int bpc, string params)
Opens an image of the given type and returns an image for placement in a PDF document */
-PHP_FUNCTION(pdf_open_image) {
+PHP_FUNCTION(pdf_open_image)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10;
PDF *pdf;
int pdf_image;
convert_to_string_ex(arg10);
#ifdef VIRTUAL_DIR
- virtual_filepath(Z_STRVAL_PP(arg4), &image);
+ virtual_filepath(Z_STRVAL_PP(arg4), &image TSRMLS_CC);
#else
image = Z_STRVAL_PP(arg4);
#endif
/* {{{ proto void pdf_attach_file(int pdf, double lly, double lly, double urx, double ury, string filename, string description, string author, string mimetype, string icon)
Adds a file attachment annotation at the rectangle specified by his lower left and upper right corners */
-PHP_FUNCTION(pdf_attach_file) {
+PHP_FUNCTION(pdf_attach_file)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10;
PDF *pdf;
/* {{{ proto void pdf_add_note(int pdfdoc, double llx, double lly, double urx, double ury, string contents, string title, string icon, int open)
Sets annotation */
-PHP_FUNCTION(pdf_add_note) {
+PHP_FUNCTION(pdf_add_note)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9;
PDF *pdf;
/* {{{ proto void pdf_add_locallink(int pdfdoc, double llx, double lly, double urx, double ury, int page, string dest)
Adds link to web resource */
-PHP_FUNCTION(pdf_add_locallink) {
+PHP_FUNCTION(pdf_add_locallink)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
/* {{{ proto void pdf_add_launchlink(int pdfdoc, double llx, double lly, double urx, double ury, string filename)
Adds link to web resource */
-PHP_FUNCTION(pdf_add_launchlink) {
+PHP_FUNCTION(pdf_add_launchlink)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
PDF *pdf;
/* {{{ proto int pdf_open_pdi(int pdf, string filename, string stringparam, int intparam);
* Open an existing PDF document and prepare it for later use. */
-PHP_FUNCTION(pdf_open_pdi) {
+PHP_FUNCTION(pdf_open_pdi)
+{
zval **arg1, **arg2, **arg3, **arg4;
PDF *pdf;
int pdi_handle;
convert_to_long_ex(arg4);
#ifdef VIRTUAL_DIR
- virtual_filepath(Z_STRVAL_PP(arg2), &file);
+ virtual_filepath(Z_STRVAL_PP(arg2), &file) TSRMLS_CC;
#else
file = Z_STRVAL_PP(arg2);
#endif
/* {{{ proto void pdf_close_pdi(int pdf, int doc);
* Close all open page handles, and close the input PDF document. */
-PHP_FUNCTION(pdf_close_pdi) {
+PHP_FUNCTION(pdf_close_pdi)
+{
zval **arg1, **arg2;
PDF *pdf;
/* {{{ proto int pdf_open_pdi_page(int pdf, int doc, int page, string label);
* Prepare a page for later use with PDF_place_image(). */
-PHP_FUNCTION(pdf_open_pdi_page) {
+PHP_FUNCTION(pdf_open_pdi_page)
+{
zval **arg1, **arg2, **arg3, **arg4;
PDF *pdf;
int pdi_image;
/* {{{ proto void pdf_place_pdi_page(int pdf, int page, double x, double y, double sx, double sy)
* Place a PDF page with the lower left corner at (x, y), and scale it. */
-PHP_FUNCTION(pdf_place_pdi_page) {
+PHP_FUNCTION(pdf_place_pdi_page)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
PDF *pdf;
/* {{{ proto void pdf_close_pdi_page(int pdf, int page);
* Close the page handle, and free all page-related resources. */
-PHP_FUNCTION(pdf_close_pdi_page) {
+PHP_FUNCTION(pdf_close_pdi_page)
+{
zval **arg1, **arg2;
PDF *pdf;
/* {{{ proto string pdf_get_pdi_parameter(int pdf, string key, int doc, int page, int index);
* Get the contents of some PDI document parameter with string type. */
-PHP_FUNCTION(pdf_get_pdi_parameter) {
+PHP_FUNCTION(pdf_get_pdi_parameter)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5;
PDF *pdf;
const char *buffer;
/* {{{ proto double pdf_get_pdi_value(int pdf, string key, int doc, int page, int index);
* Get the contents of some PDI document parameter with numerical type. */
-PHP_FUNCTION(pdf_get_pdi_value) {
+PHP_FUNCTION(pdf_get_pdi_value)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5;
PDF *pdf;
double value;
/* {{{ proto int pdf_begin_pattern(int pdf, double width, double height, double xstep, double ystep, int painttype);
* Start a new pattern definition. */
-PHP_FUNCTION(pdf_begin_pattern) {
+PHP_FUNCTION(pdf_begin_pattern)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
PDF *pdf;
int pattern_image;
/* {{{ proto void pdf_end_pattern(int pdf);
* Finish the pattern definition. */
-PHP_FUNCTION(pdf_end_pattern) {
+PHP_FUNCTION(pdf_end_pattern)
+{
zval **arg1;
PDF *pdf;
/* {{{ proto int pdf_begin_template(int pdf, double width, double height);
* Start a new template definition. */
-PHP_FUNCTION(pdf_begin_template) {
+PHP_FUNCTION(pdf_begin_template)
+{
zval **arg1, **arg2, **arg3;
PDF *pdf;
int tmpl_image;
/* {{{ proto void pdf_end_template(int pdf);
* Finish the template definition. */
-PHP_FUNCTION(pdf_end_template) {
+PHP_FUNCTION(pdf_end_template)
+{
zval **arg1;
PDF *pdf;
/* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, double c1 [, double c2 [, double c3 [, double c4]]]);
* Set the current color space and color. */
-PHP_FUNCTION(pdf_setcolor) {
+PHP_FUNCTION(pdf_setcolor)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
double c1;
/* {{{ proto int pdf_makespotcolor(int pdf, string spotname);
* Make a named spot color from the current color. */
-PHP_FUNCTION(pdf_makespotcolor) {
+PHP_FUNCTION(pdf_makespotcolor)
+{
zval **arg1, **arg2;
PDF *pdf;
int spotcolor;
/* {{{ proto void pdf_arcn(int pdf, double x, double y, double r, double alpha, double beta);
* Draw a clockwise circular arc from alpha to beta degrees. */
-PHP_FUNCTION(pdf_arcn) {
+PHP_FUNCTION(pdf_arcn)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6;
PDF *pdf;
/* {{{ proto void pdf_initgraphics(int pdf);
* Reset all implicit color and graphics state parameters to their defaults. */
-PHP_FUNCTION(pdf_initgraphics) {
+PHP_FUNCTION(pdf_initgraphics)
+{
zval **arg1;
PDF *pdf;
/* {{{ proto void pdf_add_thumbnail(int pdf, int image);
* Add an existing image as thumbnail for the current page. */
-PHP_FUNCTION(pdf_add_thumbnail) {
+PHP_FUNCTION(pdf_add_thumbnail)
+{
zval **arg1, **arg2;
PDF *pdf;
/* {{{ proto void pdf_setmatrix(int pdf, double a, double b, double c, double d, double e, double f)
Explicitly set the current transformation matrix. */
-PHP_FUNCTION(pdf_setmatrix) {
+PHP_FUNCTION(pdf_setmatrix)
+{
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
/* {{{ PHP_MINIT_FUNCTION
*/
-PHP_MINIT_FUNCTION(pspell){
+PHP_MINIT_FUNCTION(pspell)
+{
REGISTER_MAIN_LONG_CONSTANT("PSPELL_FAST", PSPELL_FAST, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("PSPELL_NORMAL", PSPELL_NORMAL, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("PSPELL_BAD_SPELLERS", PSPELL_BAD_SPELLERS, CONST_PERSISTENT | CONST_CS);
/* {{{ proto int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
Load a dictionary */
-PHP_FUNCTION(pspell_new){
+PHP_FUNCTION(pspell_new)
+{
zval **language,**spelling,**jargon,**encoding,**pmode;
long mode = 0L, speed = 0L;
int argc;
/* {{{ proto int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
Load a dictionary with a personal wordlist*/
-PHP_FUNCTION(pspell_new_personal){
+PHP_FUNCTION(pspell_new_personal)
+{
zval **personal, **language,**spelling,**jargon,**encoding,**pmode;
long mode = 0L, speed = 0L;
int argc;
/* {{{ proto int pspell_new_config(int config)
Load a dictionary based on the given config */
-PHP_FUNCTION(pspell_new_config){
+PHP_FUNCTION(pspell_new_config)
+{
int type;
zval **conf;
int argc;
/* {{{ proto int pspell_check(int pspell, string word)
Returns true if word is valid */
-PHP_FUNCTION(pspell_check){
+PHP_FUNCTION(pspell_check)
+{
int type;
zval **scin,**word;
PspellManager *manager;
/* {{{ proto int pspell_config_create(string language [, string spelling [, string jargon [, string encoding]]])
Create a new config to be used later to create a manager */
-PHP_FUNCTION(pspell_config_create){
+PHP_FUNCTION(pspell_config_create)
+{
zval **language,**spelling,**jargon,**encoding;
int argc;
int ind;
/* {{{ proto int pspell_config_runtogether(int conf, bool runtogether)
Consider run-together words as valid components */
-PHP_FUNCTION(pspell_config_runtogether){
+PHP_FUNCTION(pspell_config_runtogether)
+{
int type;
zval **sccin, **runtogether;
int argc;
/* {{{ proto int pspell_config_mode(int conf, long mode)
Select mode for config (PSPELL_FAST, PSPELL_NORMAL or PSPELL_BAD_SPELLERS) */
-PHP_FUNCTION(pspell_config_mode){
+PHP_FUNCTION(pspell_config_mode)
+{
int type;
zval **sccin, **mode;
int argc;
/* {{{ proto int pspell_config_ignore(int conf, int ignore)
Ignore words <= n chars */
-PHP_FUNCTION(pspell_config_ignore){
+PHP_FUNCTION(pspell_config_ignore)
+{
int type;
zval **sccin, **pignore;
int argc;
/* {{{ proto int pspell_config_personal(int conf, string personal)
Use a personal dictionary for this config */
-PHP_FUNCTION(pspell_config_personal){
+PHP_FUNCTION(pspell_config_personal)
+{
int type;
zval **sccin, **personal;
int argc;
/* {{{ proto int pspell_config_repl(int conf, string repl)
Use a personal dictionary with replacement pairs for this config */
-PHP_FUNCTION(pspell_config_repl){
+PHP_FUNCTION(pspell_config_repl)
+{
int type;
zval **sccin, **repl;
int argc;
/* {{{ proto int pspell_config_save_repl(int conf, bool save)
Save replacement pairs when personal list is saved for this config */
-PHP_FUNCTION(pspell_config_save_repl){
+PHP_FUNCTION(pspell_config_save_repl)
+{
int type;
zval **sccin, **save;
int argc;
static void ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
+ TSRMLS_FETCH();
if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) {
if (data->lastkey) {
data->lastkey = estrdup(key);
#ifdef O_EXCL
- data->fd = VCWD_OPEN((buf, O_RDWR | O_BINARY));
+ data->fd = VCWD_OPEN(buf, O_RDWR | O_BINARY);
if (data->fd == -1 && errno == ENOENT)
- data->fd = VCWD_OPEN((buf, O_EXCL | O_RDWR | O_CREAT | O_BINARY, 0600));
+ data->fd = VCWD_OPEN_MODE(buf, O_EXCL | O_RDWR | O_CREAT | O_BINARY, 0600);
#else
- data->fd = VCWD_OPEN((buf, O_CREAT | O_RDWR | O_BINARY, 0600));
+ data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, 0600);
#endif
if (data->fd != -1)
flock(data->fd, LOCK_EX);
time_t now;
int nrdels = 0;
size_t dirname_len;
+ TSRMLS_FETCH();
dir = opendir(dirname);
if (!dir) {
{
char buf[MAXPATHLEN];
PS_FILES_DATA;
+ TSRMLS_FETCH();
if (!ps_files_path_create(buf, sizeof(buf), data, key))
return FAILURE;
if (PS(entropy_length) > 0) {
int fd;
- fd = VCWD_OPEN((PS(entropy_file), O_RDONLY));
+ fd = VCWD_OPEN(PS(entropy_file), O_RDONLY);
if (fd >= 0) {
char buf[2048];
int n;
/* {{{ proto string snmpget(string host, string community, string object_id [, int timeout [, int retries]])
Fetch a SNMP object */
-PHP_FUNCTION(snmpget) {
+PHP_FUNCTION(snmpget)
+{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
}
/* }}} */
/* {{{ proto array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]])
Return all objects under the specified object id */
-PHP_FUNCTION(snmpwalk) {
+PHP_FUNCTION(snmpwalk)
+{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,2);
}
/* }}} */
/* {{{ proto array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]])
Return all objects including their respective object id withing the specified one */
-PHP_FUNCTION(snmprealwalk) {
+PHP_FUNCTION(snmprealwalk)
+{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,3);
}
/* }}} */
/* {{{ proto bool snmp_get_quick_print(void)
Return the current status of quick_print */
-PHP_FUNCTION(snmp_get_quick_print) {
+PHP_FUNCTION(snmp_get_quick_print)
+{
RETURN_LONG(snmp_get_quick_print() ? 1 : 0);
}
/* }}} */
/* {{{ proto void snmp_set_quick_print(int quick_print)
Return all objects including their respective object id withing the specified one */
-PHP_FUNCTION(snmp_set_quick_print) {
+PHP_FUNCTION(snmp_set_quick_print)
+{
zval **a1;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a1) == FAILURE) {
WRONG_PARAM_COUNT;
/* {{{ proto int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])
Set the value of a SNMP object */
-PHP_FUNCTION(snmpset) {
+PHP_FUNCTION(snmpset)
+{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU,11);
}
/* }}} */
/* {{{ proto string base64_encode(string str)
Encodes string using MIME base64 algorithm */
-PHP_FUNCTION(base64_encode) {
+PHP_FUNCTION(base64_encode)
+{
pval **str;
unsigned char *result;
int ret_length;
/* {{{ proto string base64_decode(string str)
Decodes string using MIME base64 algorithm */
-PHP_FUNCTION(base64_decode) {
+PHP_FUNCTION(base64_decode)
+{
pval **str;
unsigned char *result;
int ret_length;
VCWD_UNLINK(Z_STRVAL_PP(new_path));
if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==0) {
successful=1;
- } else if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==SUCCESS) {
+ } else if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path) TSRMLS_CC)==SUCCESS) {
VCWD_UNLINK(Z_STRVAL_PP(path));
successful=1;
}
d = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
strlcpy(p, Z_STRVAL_PP(arg2), sizeof(p));
- if ((fp = php_open_temporary_file(d, p, &opened_path))) {
+ if ((fp = php_open_temporary_file(d, p, &opened_path TSRMLS_CC))) {
fclose(fp);
RETVAL_STRING(opened_path, 0);
} else {
/* {{{ proto string fgetc(int fp)
Get a character from file pointer */
-PHP_FUNCTION(fgetc) {
+PHP_FUNCTION(fgetc)
+{
pval **arg1;
int type;
char *buf;
RETURN_FALSE;
}
- if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target))==SUCCESS) {
+ if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target) TSRMLS_CC)==SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(char *src, char *dest)
+PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
{
char buffer[8192];
int fd_s,fd_t,read_bytes;
int ret = FAILURE;
#ifdef PHP_WIN32
- if ((fd_s=VCWD_OPEN((src,O_RDONLY|_O_BINARY)))==-1) {
+ if ((fd_s=VCWD_OPEN(src, O_RDONLY|_O_BINARY))==-1) {
#else
- if ((fd_s=VCWD_OPEN((src,O_RDONLY)))==-1) {
+ if ((fd_s=VCWD_OPEN(src, O_RDONLY))==-1) {
#endif
php_error(E_WARNING,"Unable to open '%s' for reading: %s", src, strerror(errno));
return FAILURE;
}
#ifdef PHP_WIN32
- if ((fd_t=VCWD_OPEN((dest,_O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY,_S_IREAD|_S_IWRITE)))==-1) {
+ if ((fd_t=VCWD_OPEN_MODE(dest, _O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY, _S_IREAD|_S_IWRITE))==-1) {
#else
- if ((fd_t=VCWD_CREAT(dest,0777))==-1) {
+ if ((fd_t=VCWD_CREAT(dest, 0777))==-1) {
#endif
php_error(E_WARNING,"Unable to create '%s': %s", dest, strerror(errno));
close(fd_s);
/* {{{ proto array fgetcsv(int fp, int length [, string delimiter])
Get line from file pointer and parse for CSV fields */
-PHP_FUNCTION(fgetcsv) {
+PHP_FUNCTION(fgetcsv)
+{
char *temp, *tptr, *bptr, *lineEnd;
char delimiter = ','; /* allow this to be set as parameter */
PHPAPI int php_file_le_stream(void);
PHPAPI int php_file_le_popen(void);
PHPAPI int php_file_le_socket(void);
-PHPAPI int php_copy_file(char *src, char *dest);
+PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
#define META_DEF_BUFSIZE 8192
/* {{{ proto double floor(double number)
Returns the next lowest integer value from the number */
-PHP_FUNCTION(floor) {
+PHP_FUNCTION(floor)
+{
zval **value;
if (ZEND_NUM_ARGS()!=1||zend_get_parameters_ex(1,&value)==FAILURE) {
if (strcasecmp("php://stdout", tmpna) == 0) {
FILE *fp;
- fp = php_open_temporary_file(NULL, "php_swf_stdout", &na);
+ fp = php_open_temporary_file(NULL, "php_swf_stdout", &na TSRMLS_CC);
if (!fp) {
free_na = 0;
RETURN_FALSE;
}
#ifdef VIRTUAL_DIR
- if (virtual_filepath(na, &tmpna)) {
+ if (virtual_filepath(na, &tmpna TSRMLS_CC)) {
if (free_na) {
efree(na);
}
/* {{{ proto bool vpopmail_del_domain_ex(string domain)
Delete a virtual domain */
-PHP_FUNCTION(vpopmail_del_domain_ex) {
+PHP_FUNCTION(vpopmail_del_domain_ex)
+{
zval **domain;
int retval=-1;
char *cmd,*escdomain;
/* {{{ proto bool vpopmail_add_alias_domain_ex(string olddomain, string newdomain)
Add alias to an existing virtual domain */
-PHP_FUNCTION(vpopmail_add_alias_domain_ex) {
+PHP_FUNCTION(vpopmail_add_alias_domain_ex)
+{
zval **olddomain, **newdomain;
int retval;
char *cmd,*escolddomain,*escnewdomain;
/* {{{ proto array yp_cat(string domain, string map)
Return an array containing the entire map */
-PHP_FUNCTION(yp_cat) {
+PHP_FUNCTION(yp_cat)
+{
pval **domain, **map;
struct ypall_callback callback;
/* {{{ proto string yp_err_string(int errorcode)
Returns the corresponding error string for the given error code */
-PHP_FUNCTION(yp_err_string) {
+PHP_FUNCTION(yp_err_string)
+{
pval **error;
char *string;
}
/* Resolve the real path into resolved_name */
- if ((expand_filepath(path, resolved_name) != NULL) && (expand_filepath(local_open_basedir, resolved_basedir) != NULL)) {
+ if ((expand_filepath(path, resolved_name TSRMLS_CC) != NULL) && (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL)) {
/* Check the path */
#ifdef PHP_WIN32
if (strncasecmp(resolved_basedir, resolved_name, strlen(resolved_basedir)) == 0) {
}
fp = VCWD_FOPEN(path, mode);
if (fp && opened_path) {
- *opened_path = expand_filepath(path, NULL);
+ *opened_path = expand_filepath(path, NULL TSRMLS_CC);
}
return fp;
}
return FAILURE;
}
- file_handle->opened_path = expand_filepath(filename, NULL);
+ file_handle->opened_path = expand_filepath(filename, NULL TSRMLS_CC);
if (!(SG(options) & SAPI_OPTION_NO_CHDIR)) {
VCWD_CHDIR_FILE(filename);
}
}
- if (!protocol || !strncasecmp(protocol, "file",n)){
+ if (!protocol || !strncasecmp(protocol, "file", n)){
*issock = 0;
if(protocol) {
/* {{{ expand_filepath
*/
-PHPAPI char *expand_filepath(const char *filepath, char *real_path)
+PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
{
cwd_state new_state;
char cwd[MAXPATHLEN];
# define SOCK_CONN_ERR -1
# define SOCK_RECV_ERR -1
#endif
-#define SOCK_WRITE(d,s) send(s,d,strlen(d),0)
-#define SOCK_WRITEL(d,l,s) send(s,d,l,0)
+#define SOCK_WRITE(d, s) send(s, d, strlen(d), 0)
+#define SOCK_WRITEL(d, l, s) send(s, d, l, 0)
#define SOCK_FGETC(s) php_sock_fgetc((s))
-#define SOCK_FGETS(b,l,s) php_sock_fgets((b),(l),(s))
+#define SOCK_FGETS(b, l, s) php_sock_fgets((b), (l), (s))
#define SOCK_FEOF(sock) php_sock_feof((sock))
-#define SOCK_FREAD(ptr,size,sock) php_sock_fread((ptr),(size),(sock))
+#define SOCK_FREAD(ptr, size, sock) php_sock_fread((ptr), (size), (sock))
#define SOCK_FCLOSE(s) php_sock_close(s)
-#define FP_FGETS(buf,len,sock,fp,issock) \
- ((issock)?SOCK_FGETS(buf,len,sock):fgets(buf,len,fp))
-#define FP_FREAD(buf,len,sock,fp,issock) \
- ((issock)?SOCK_FREAD(buf,len,sock):fread(buf,1,len,fp))
-#define FP_FEOF(sock,fp,issock) \
+#define FP_FGETS(buf, len, sock, fp, issock) \
+ ((issock)?SOCK_FGETS(buf, len, sock):fgets(buf, len, fp))
+#define FP_FREAD(buf, len, sock, fp, issock) \
+ ((issock)?SOCK_FREAD(buf, len, sock):fread(buf, 1, len, fp))
+#define FP_FEOF(sock, fp, issock) \
((issock)?SOCK_FEOF(sock):feof(fp))
-#define FP_FGETC(sock,fp,issock) \
+#define FP_FGETC(sock, fp, issock) \
((issock)?SOCK_FGETC(sock):fgetc(fp))
/* values for issock */
PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC);
PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC);
-PHPAPI char *expand_filepath(const char *filepath, char *real_path);
+PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
PHPAPI int php_check_open_basedir(char *path TSRMLS_DC);
PHPAPI int php_check_specific_open_basedir(char *basedir, char *path TSRMLS_DC);
PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
- STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference","1",PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, allow_call_time_pass_reference, zend_compiler_globals, compiler_globals)
+ STD_PHP_INI_BOOLEAN("allow_call_time_pass_reference", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, allow_call_time_pass_reference, zend_compiler_globals, compiler_globals)
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, asp_tags, zend_compiler_globals, compiler_globals)
STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateBool, display_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("display_startup_errors", "0", PHP_INI_ALL, OnUpdateBool, display_startup_errors, php_core_globals, core_globals)
{
while (waitpid(-1, NULL, WNOHANG) > 0)
;
- signal(SIGCHLD,sigchld_handler);
+ signal(SIGCHLD, sigchld_handler);
}
/* }}} */
#endif
int retval = SUCCESS;
#if PHP_SIGCHILD
- signal(SIGCHLD,sigchld_handler);
+ signal(SIGCHLD, sigchld_handler);
#endif
zend_try {
*/
static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC)
{
- memset(core_globals,0,sizeof(*core_globals));
+ memset(core_globals, 0, sizeof(*core_globals));
}
/* }}} */
#endif
php_shutdown_fopen_wrappers(TSRMLS_C);
php_shutdown_info_logos();
UNREGISTER_INI_ENTRIES();
-#ifndef ZTS
+#ifdef ZTS
+ ts_free_thread();
+#else
zend_ini_shutdown(TSRMLS_C);
-#endif
shutdown_memory_manager(0, 1);
+#endif
module_initialized = 0;
}
/* }}} */
static int php_hash_environment(TSRMLS_D)
{
char *p;
- unsigned char _gpc_flags[3] = {0,0,0};
+ unsigned char _gpc_flags[3] = {0, 0, 0};
zend_bool have_variables_order;
zval *dummy_track_vars_array;
zend_bool initialized_dummy_track_vars_array=0;
zend_try {
#ifdef PHP_WIN32
- UpdateIniFromRegistry(primary_file->filename);
+ UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
#endif
PG(during_request_startup) = 0;
TSRMLS_FETCH();
ALLOC_INIT_ZVAL(orig_buffer);
- ZVAL_STRINGL(orig_buffer,OG(active_ob_buffer).buffer,OG(active_ob_buffer).text_length,0);
+ ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 0);
orig_buffer->refcount=2; /* don't let call_user_function() destroy our buffer */
orig_buffer->is_ref=1;
ALLOC_INIT_ZVAL(z_status);
- ZVAL_LONG(z_status,status);
+ ZVAL_LONG(z_status, status);
params[0] = &orig_buffer;
params[1] = &z_status;
if (OG(ob_nesting_level)==0) {
return FAILURE;
}
- ZVAL_STRINGL(p,OG(active_ob_buffer).buffer,OG(active_ob_buffer).text_length,1);
+ ZVAL_STRINGL(p, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1);
return SUCCESS;
}
/* }}} */
if (OG(ob_nesting_level) == 0) {
return FAILURE;
}
- ZVAL_LONG(p,OG(active_ob_buffer).text_length);
+ ZVAL_LONG(p, OG(active_ob_buffer).text_length);
return SUCCESS;
}
/* }}} */
typedef unsigned int socklen_t;
#endif
-#define CREATE_MUTEX(a,b)
+#define CREATE_MUTEX(a, b)
#define SET_MUTEX(a)
#define FREE_MUTEX(a)
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
#ifdef __STDC__
-#define XtOffset(p_type,field) _Offsetof(p_type,field)
+#define XtOffset(p_type, field) _Offsetof(p_type, field)
#else
#ifdef CRAY2
-#define XtOffset(p_type,field) \
+#define XtOffset(p_type, field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
#else /* !CRAY2 */
-#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
+#define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
#endif /* !CRAY2 */
#endif /* __STDC__ */
#else /* ! (CRAY || __arm) */
-#define XtOffset(p_type,field) \
+#define XtOffset(p_type, field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#endif /* !CRAY */
#ifdef offsetof
-#define XtOffsetOf(s_type,field) offsetof(s_type,field)
+#define XtOffsetOf(s_type, field) offsetof(s_type, field)
#else
-#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
+#define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
#endif
PHPAPI PHP_FUNCTION(warn_not_available);
char *data;
if(!SG(request_info).post_data) sapi_read_standard_form_data(TSRMLS_C);
- data = estrndup(SG(request_info).post_data,SG(request_info).post_data_length);
+ data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length);
SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, SG(request_info).post_data_length);
}
/* }}} */
#ifdef PHP_WIN32
default_location = (char *) emalloc(512);
- if (!GetWindowsDirectory(default_location,255)) {
+ if (!GetWindowsDirectory(default_location, 255)) {
default_location[0]=0;
}
free_default_location=1;
tmp.value.str.len = strlen(php_ini_opened_path);
tmp.value.str.val = zend_strndup(php_ini_opened_path, tmp.value.str.len);
tmp.type = IS_STRING;
- zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"),(void *) &tmp,sizeof(zval), NULL);
+ zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL);
efree(php_ini_opened_path);
php_ini_opened_path = zend_strndup(tmp.value.str.val, tmp.value.str.len);
}
/* {{{ cfg_get_long
*/
-PHPAPI int cfg_get_long(char *varname,long *result)
+PHPAPI int cfg_get_long(char *varname, long *result)
{
- zval *tmp,var;
+ zval *tmp, var;
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp)==FAILURE) {
*result=(long)NULL;
return FAILURE;
}
/* {{{ cfg_get_double
*/
-PHPAPI int cfg_get_double(char *varname,double *result)
+PHPAPI int cfg_get_double(char *varname, double *result)
{
- zval *tmp,var;
+ zval *tmp, var;
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp)==FAILURE) {
*result=(double)0;
return FAILURE;
}
{
zval *tmp;
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp)==FAILURE) {
*result=NULL;
return FAILURE;
}
char *content_header;
int len;
- if(FAILURE==zend_hash_find(&phpinfo_logo_hash,(char *) logo_string,strlen(logo_string),(void **)&logo_image))
+ if(FAILURE==zend_hash_find(&phpinfo_logo_hash, (char *) logo_string, strlen(logo_string), (void **)&logo_image))
return 0;
len=strlen(CONTENT_TYPE_HEADER)+logo_image->mimelen;
content_header=malloc(len+1);
if(!content_header) return 0;
- strcpy(content_header,CONTENT_TYPE_HEADER);
- strcat(content_header,logo_image->mimetype);
+ strcpy(content_header, CONTENT_TYPE_HEADER);
+ strcat(content_header, logo_image->mimetype);
sapi_add_header(content_header, len, 1);
free(content_header);
* SUCH DAMAGE.
*/
-static FILE *php_do_open_temporary_file(char *path, const char *pfx, char **opened_path_p)
+static FILE *php_do_open_temporary_file(char *path, const char *pfx, char **opened_path_p TSRMLS_DC)
{
char *trailing_slash;
FILE *fp;
* This function should do its best to return a file pointer to a newly created
* unique file, on every platform.
*/
-PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p)
+PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC)
{
static char path_tmp[] = "/tmp";
FILE *fp;
*opened_path_p = NULL;
}
- if ((fp=php_do_open_temporary_file((char *) dir, pfx, opened_path_p))) {
+ if ((fp=php_do_open_temporary_file((char *) dir, pfx, opened_path_p TSRMLS_CC))) {
return fp;
}
- if ((fp=php_do_open_temporary_file(getenv("TMPDIR"), pfx, opened_path_p))) {
+ if ((fp=php_do_open_temporary_file(getenv("TMPDIR"), pfx, opened_path_p TSRMLS_CC))) {
return fp;
}
#if PHP_WIN32
TempPath = (char *) emalloc(MAXPATHLEN);
if (GetTempPath(MAXPATHLEN, TempPath)) {
- fp = php_do_open_temporary_file(TempPath, pfx, opened_path_p);
+ fp = php_do_open_temporary_file(TempPath, pfx, opened_path_p TSRMLS_CC);
}
efree(TempPath);
return fp;
}
#else
- if ((fp=php_do_open_temporary_file(P_tmpdir, pfx, opened_path_p))) {
+ if ((fp=php_do_open_temporary_file(P_tmpdir, pfx, opened_path_p TSRMLS_CC))) {
return fp;
}
- if ((fp=php_do_open_temporary_file(path_tmp, pfx, opened_path_p))) {
+ if ((fp=php_do_open_temporary_file(path_tmp, pfx, opened_path_p TSRMLS_CC))) {
return fp;
}
#endif
#ifndef PHP_OPEN_TEMPORARY_FILE_H
#define PHP_OPEN_TEMPORARY_FILE_H
-PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p);
+PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC);
#endif /* PHP_OPEN_TEMPORARY_FILE_H */
TSRMLS_FETCH();
zend_llist_del_element(&PG(tick_functions), func,
- (int(*)(void*,void*))php_compare_tick_functions);
+ (int(*)(void*, void*))php_compare_tick_functions);
}
static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
if(is_arr_upload) {
arr_len = strlen(start_arr);
if(arr_index) efree(arr_index);
- arr_index = estrndup(start_arr+1,arr_len-2);
+ arr_index = estrndup(start_arr+1, arr_len-2);
}
} else {
php_error(E_WARNING, "File upload error - no name component in content disposition");
}
bytes = 0;
- fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename);
+ fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
if (!fp) {
php_error(E_WARNING, "File upload error - unable to create a temporary file");
SAFE_RETURN;
}
if ((loc - ptr - 4) > PG(upload_max_filesize)) {
- php_error(E_WARNING, "Max file size of %ld bytes exceeded - file [%s] not saved", PG(upload_max_filesize),namebuf);
+ php_error(E_WARNING, "Max file size of %ld bytes exceeded - file [%s] not saved", PG(upload_max_filesize), namebuf);
upload_successful = 0;
} else if (max_file_size && ((loc - ptr - 4) > max_file_size)) {
php_error(E_WARNING, "Max file size exceeded - file [%s] not saved", namebuf);
* If given filepath is a URL, allow - safe mode stuff
* related to URL's is checked in individual functions
*/
- if (!strncasecmp(filename,"http://",7) || !strncasecmp(filename,"ftp://",6)) {
+ if (!strncasecmp(filename,"http://", 7) || !strncasecmp(filename,"ftp://", 6)) {
return 1;
}
}
/* Trim off filename */
- if ((s = strrchr(path,DEFAULT_SLASH))) {
+ if ((s = strrchr(path, DEFAULT_SLASH))) {
*s = '\0';
}
} else { /* CHECKUID_ALLOW_ONLY_DIR */
- s = strrchr(filename,DEFAULT_SLASH);
+ s = strrchr(filename, DEFAULT_SLASH);
if (s) {
*s = '\0';
#define S_IFBLK _IFBLK
#define S_IFLNK _IFLNK
#define chdir(path) SetCurrentDirectory(path)
-#define mkdir(a,b) _mkdir(a)
+#define mkdir(a, b) _mkdir(a)
#define rmdir(a) _rmdir(a)
#define getpid _getpid
#define php_sleep(t) Sleep(t*1000)
* the HTTP header data, so that a script can access these.
*/
-#define ADD_STRINGX(name,buf) \
+#define ADD_STRINGX(name, buf) \
php_register_variable(name, buf, track_vars_array TSRMLS_CC)
#define ADD_STRING(name) \
tmp = uudecode(r->pool, authorization);
SG(request_info).auth_user = getword_nulls_nc(r->pool, &tmp, ':');
if (SG(request_info).auth_user) {
- r->connection->user = pstrdup(r->connection->pool,SG(request_info).auth_user);
+ r->connection->user = pstrdup(r->connection->pool, SG(request_info).auth_user);
r->connection->ap_auth_type = "Basic";
SG(request_info).auth_user = estrdup(SG(request_info).auth_user);
}
TSRMLS_FETCH();
sprintf(mem_usage,"%u", (int) AG(allocated_memory_peak));
- ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool,mem_usage));
+ ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool, mem_usage));
}
#endif
NULL, /* fixups */
NULL /* logger */
#if MODULE_MAGIC_NUMBER >= 19970103
- ,NULL /* header parser */
+ , NULL /* header parser */
#endif
#if MODULE_MAGIC_NUMBER >= 19970719
- ,NULL /* child_init */
+ , NULL /* child_init */
#endif
#if MODULE_MAGIC_NUMBER >= 19970728
- ,php_child_exit_handler /* child_exit */
+ , php_child_exit_handler /* child_exit */
#endif
#if MODULE_MAGIC_NUMBER >= 19970902
- ,NULL /* post read-request */
+ , NULL /* post read-request */
#endif
};
/* }}} */
Get and set Apache request notes */
PHP_FUNCTION(apache_note)
{
- pval **arg_name,**arg_val;
+ pval **arg_name, **arg_val;
char *note_val;
int arg_count = ARG_COUNT(ht);
TSRMLS_FETCH();
if (arg_count<1 || arg_count>2 ||
- zend_get_parameters_ex(arg_count,&arg_name,&arg_val) ==FAILURE ) {
+ zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(arg_name);
- note_val = (char *) table_get(((request_rec *)SG(server_context))->notes,(*arg_name)->value.str.val);
+ note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val);
if (arg_count == 2) {
convert_to_string_ex(arg_val);
- table_set(((request_rec *)SG(server_context))->notes,(*arg_name)->value.str.val,(*arg_val)->value.str.val);
+ table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val);
}
if (note_val) {
- RETURN_STRING(note_val,1);
+ RETURN_STRING(note_val, 1);
} else {
RETURN_FALSE;
}
#endif
sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER);
php_info_print_table_row(2, "Apache API Version", output_buf);
- sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port);
+ sprintf(output_buf, "%s:%u", serv->server_hostname, serv->port);
php_info_print_table_row(2, "Hostname:Port", output_buf);
#if !defined(WIN32) && !defined(WINNT)
- sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id);
+ sprintf(output_buf, "%s(%d)/%d", user_name, (int)user_id, (int)group_id);
php_info_print_table_row(2, "User/Group", output_buf);
- sprintf(output_buf, "Per Child: %d<br>Keep Alive: %s<br>Max Per Connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max);
+ sprintf(output_buf, "Per Child: %d<br>Keep Alive: %s<br>Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max);
php_info_print_table_row(2, "Max Requests", output_buf);
#endif
- sprintf(output_buf, "Connection: %d<br>Keep-Alive: %d",serv->timeout,serv->keep_alive_timeout);
+ sprintf(output_buf, "Connection: %d<br>Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout);
php_info_print_table_row(2, "Timeouts", output_buf);
#if !defined(WIN32) && !defined(WINNT)
php_info_print_table_row(2, "Server Root", server_root);
request_rec *rr = NULL;
TSRMLS_FETCH();
- if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
- if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val,((request_rec *) SG(server_context))))) {
+ if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
!strncasecmp(tenv[i].key, "authorization", 13))) {
continue;
}
- if (add_assoc_string(return_value, tenv[i].key,(tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
+ if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
RETURN_FALSE;
}
}
request_rec *rr=NULL;
TSRMLS_FETCH();
- if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
- if(!(rr = sub_req_lookup_uri((*filename)->value.str.val,((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed",(*filename)->value.str.val);
+ if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
+ php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
RETURN_FALSE;
}
object_init(return_value);
- add_property_long(return_value,"status",rr->status);
+ add_property_long(return_value,"status", rr->status);
if (rr->the_request) {
- add_property_string(return_value,"the_request",rr->the_request,1);
+ add_property_string(return_value,"the_request", rr->the_request, 1);
}
if (rr->status_line) {
- add_property_string(return_value,"status_line",(char *)rr->status_line,1);
+ add_property_string(return_value,"status_line", (char *)rr->status_line, 1);
}
if (rr->method) {
- add_property_string(return_value,"method",(char *)rr->method,1);
+ add_property_string(return_value,"method", (char *)rr->method, 1);
}
if (rr->content_type) {
- add_property_string(return_value,"content_type",(char *)rr->content_type,1);
+ add_property_string(return_value,"content_type", (char *)rr->content_type, 1);
}
if (rr->handler) {
- add_property_string(return_value,"handler",(char *)rr->handler,1);
+ add_property_string(return_value,"handler", (char *)rr->handler, 1);
}
if (rr->uri) {
- add_property_string(return_value,"uri",rr->uri,1);
+ add_property_string(return_value,"uri", rr->uri, 1);
}
if (rr->filename) {
- add_property_string(return_value,"filename",rr->filename,1);
+ add_property_string(return_value,"filename", rr->filename, 1);
}
if (rr->path_info) {
- add_property_string(return_value,"path_info",rr->path_info,1);
+ add_property_string(return_value,"path_info", rr->path_info, 1);
}
if (rr->args) {
- add_property_string(return_value,"args",rr->args,1);
+ add_property_string(return_value,"args", rr->args, 1);
}
if (rr->boundary) {
- add_property_string(return_value,"boundary",rr->boundary,1);
+ add_property_string(return_value,"boundary", rr->boundary, 1);
}
- add_property_long(return_value,"no_cache",rr->no_cache);
- add_property_long(return_value,"no_local_copy",rr->no_local_copy);
- add_property_long(return_value,"allowed",rr->allowed);
- add_property_long(return_value,"sent_bodyct",rr->sent_bodyct);
- add_property_long(return_value,"bytes_sent",rr->bytes_sent);
- add_property_long(return_value,"byterange",rr->byterange);
- add_property_long(return_value,"clength",rr->clength);
+ add_property_long(return_value,"no_cache", rr->no_cache);
+ add_property_long(return_value,"no_local_copy", rr->no_local_copy);
+ add_property_long(return_value,"allowed", rr->allowed);
+ add_property_long(return_value,"sent_bodyct", rr->sent_bodyct);
+ add_property_long(return_value,"bytes_sent", rr->bytes_sent);
+ add_property_long(return_value,"byterange", rr->byterange);
+ add_property_long(return_value,"clength", rr->clength);
#if MODULE_MAGIC_NUMBER >= 19980324
if (rr->unparsed_uri) {
- add_property_string(return_value,"unparsed_uri",rr->unparsed_uri,1);
+ add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1);
}
if(rr->mtime) {
- add_property_long(return_value,"mtime",rr->mtime);
+ add_property_long(return_value,"mtime", rr->mtime);
}
#endif
if(rr->request_time) {
- add_property_long(return_value,"request_time",rr->request_time);
+ add_property_long(return_value,"request_time", rr->request_time);
}
destroy_sub_req(rr);
request_rec *rr=NULL;
TSRMLS_FETCH();
- if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1,&filename) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(filename);
- if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val,((request_rec *) SG(server_context))))) {
- php_error(E_WARNING, "URI lookup failed",(*filename)->value.str.val);
+ if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
+ php_error(E_WARNING, "URI lookup failed", (*filename)->value.str.val);
RETURN_FALSE;
}
RETVAL_LONG(ap_run_sub_req(rr));
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(SG(request_info).path_translated,&syntax_highlighter_ini TSRMLS_CC)){
+ if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){
return OK;
} else {
return NOT_FOUND;
}
start_new_program(); /* Text */
pike_add_function("run", f_php_caudium_request_handler,
- "function(string,mapping,object,function:void)", 0);
+ "function(string, mapping, object, function:void)", 0);
end_class("Interpreter", 0);
}
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
- signal(SIGPIPE,SIG_IGN); /* ignore SIGPIPE in standalone mode so
+ signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
that sockets created via fsockopen()
don't kill PHP if the remote site
closes it. in apache|apxs mode apache
#ifdef ZTS
- tsrm_startup(1,1,0, NULL);
+ tsrm_startup(1, 1, 0, NULL);
#endif
sapi_startup(&cgi_sapi_module);
return FAILURE;
}
file_handle.filename = argv0;
- file_handle.opened_path = expand_filepath(argv0, NULL);
+ file_handle.opened_path = expand_filepath(argv0, NULL TSRMLS_CC);
} else if (retval == SUCCESS) {
/* #!php support */
c = fgetc(file_handle.handle.fp);
char *ptr;
while( ptr = strrchr(pt,'/') ) {
*ptr = 0;
- if ( stat(pt,&st) == 0 && S_ISREG(st.st_mode) ) {
+ if ( stat(pt, &st) == 0 && S_ISREG(st.st_mode) ) {
/*
* okay, we found the base script!
* work out how many chars we had to strip off;
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
- signal(SIGPIPE,SIG_IGN); /* ignore SIGPIPE in standalone mode so
+ signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
that sockets created via fsockopen()
don't kill PHP if the remote site
closes it. in apache|apxs mode apache
}
CG(unclean_shutdown)=1;
- _snprintf(buf,sizeof(buf)-1,"PHP has encountered a Stack overflow");
+ _snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow");
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
} else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) {
- _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Access Violation at %p",e->ExceptionRecord->ExceptionAddress);
+ _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress);
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
my_endthread();
} else {
- _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p",e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress);
+ _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress);
php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC);
my_endthread();
}
//
// Simple wrappers for the heap APIS
//
-#define xmalloc(s) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(s))
-#define xfree(s) HeapFree(GetProcessHeap(),0,(s))
+#define xmalloc(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s))
+#define xfree(s) HeapFree(GetProcessHeap(), 0, (s))
//
// The mandatory exports from the ISAPI DLL
typedef DWORD (WINAPI *HttpExtProc)(EXTENSION_CONTROL_BLOCK *);
BOOL WINAPI FillExtensionControlBlock(EXTENSION_CONTROL_BLOCK *, TIsapiContext *) ;
BOOL WINAPI GetServerVariable(HCONN, LPSTR, LPVOID, LPDWORD );
-BOOL WINAPI ReadClient(HCONN,LPVOID,LPDWORD);
-BOOL WINAPI WriteClient(HCONN,LPVOID,LPDWORD,DWORD);
-BOOL WINAPI ServerSupportFunction(HCONN,DWORD,LPVOID,LPDWORD,LPDWORD);
+BOOL WINAPI ReadClient(HCONN, LPVOID, LPDWORD);
+BOOL WINAPI WriteClient(HCONN, LPVOID, LPDWORD, DWORD);
+BOOL WINAPI ServerSupportFunction(HCONN, DWORD, LPVOID, LPDWORD, LPDWORD);
VersionProc IsapiGetExtensionVersion;
HttpExtProc IsapiHttpExtensionProc;
HSE_VERSION_INFO version_info;
DWORD i=0;
if (fp) {
char line[2048];
- while (fgets(line,sizeof(line)-1,fp)) {
+ while (fgets(line, sizeof(line)-1, fp)) {
// file.php arg1 arg2 etc.
char *p = strchr(line, '=');
if (p) {
}
char line[2048];
int i=0;
- while (fgets(line,sizeof(line)-1,fp)) {
+ while (fgets(line, sizeof(line)-1, fp)) {
// file.php arg1 arg2 etc.
stripcrlf(line);
if (strlen(line)>3) {
FILE *ft = fopen(tn, "w+");
FILE *fe = fopen(en, "w+");
if (fp && ft && fe) {
- while (fgets(line,sizeof(line)-1,fp)) {
+ while (fgets(line, sizeof(line)-1, fp)) {
if (line[0]=='-') {
if (_strnicmp(line, "--TEST--", 8)==0) {
parsestate = test;
WIN32_FIND_DATA fd;
memset(&fd, 0, sizeof(WIN32_FIND_DATA));
- _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*",path);
+ _snprintf(FindPath, sizeof(FindPath)-1, "%s\\*.*", path);
HANDLE fh = FindFirstFile(FindPath, &fd);
if (fh != INVALID_HANDLE_VALUE) {
do {
!strchr(fd.cFileName, '.')) {
// subdirectory, recurse into it
char NewFindPath[MAX_PATH];
- _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s",path, fd.cFileName);
+ _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", path, fd.cFileName);
GetTestFiles(NewFindPath);
} else if (strstr(fd.cFileName, ".phpt")) {
// got test file, parse it now
WIN32_FIND_DATA fd;
memset(&fd, 0, sizeof(WIN32_FIND_DATA));
- _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s",temppath, mask);
+ _snprintf(FindPath, sizeof(FindPath)-1, "%s\\%s", temppath, mask);
HANDLE fh = FindFirstFile(FindPath, &fd);
if (fh != INVALID_HANDLE_VALUE) {
do {
char NewFindPath[MAX_PATH];
- _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s",temppath, fd.cFileName);
+ _snprintf(NewFindPath, sizeof(NewFindPath)-1, "%s\\%s", temppath, fd.cFileName);
DeleteFile(NewFindPath);
memset(&fd, 0, sizeof(WIN32_FIND_DATA));
} while (FindNextFile(fh, &fd) != 0);
0,
NULL
);
- fprintf(stderr,"Error: Dll 'php4isapi.dll' not found -%d\n%s\n", GetLastError(),lpMsgBuf);
+ fprintf(stderr,"Error: Dll 'php4isapi.dll' not found -%d\n%s\n", GetLastError(), lpMsgBuf);
LocalFree( lpMsgBuf );
return -1;
}
IsapiGetExtensionVersion = (VersionProc)GetProcAddress(hDll,"GetExtensionVersion");
if (!IsapiGetExtensionVersion) {
- fprintf(stderr,"Can't Get Extension Version %d\n",GetLastError());
+ fprintf(stderr,"Can't Get Extension Version %d\n", GetLastError());
return -1;
}
IsapiHttpExtensionProc = (HttpExtProc)GetProcAddress(hDll,"HttpExtensionProc");
if (!IsapiHttpExtensionProc) {
- fprintf(stderr,"Can't Get Extension proc %d\n",GetLastError());
+ fprintf(stderr,"Can't Get Extension proc %d\n", GetLastError());
return -1;
}
rc = value.GetLength();
strncpy((char *)lpBuffer, value, *lpdwSize-1);
} else
- rc = GetEnvironmentVariable(lpszVariableName,(char *)lpBuffer,*lpdwSize) ;
+ rc = GetEnvironmentVariable(lpszVariableName, (char *)lpBuffer, *lpdwSize) ;
if (!rc) { // return of 0 indicates the variable was not found
SetLastError(ERROR_NO_DATA);
if (!c) return FALSE;
if (c->in != INVALID_HANDLE_VALUE)
- return ReadFile(c->in,lpBuffer,(*lpdwSize), lpdwSize,NULL);
+ return ReadFile(c->in, lpBuffer, (*lpdwSize), lpdwSize, NULL);
return FALSE;
}
if (!c) return FALSE;
if (c->out != INVALID_HANDLE_VALUE)
- return WriteFile(c->out,lpBuffer,*lpdwSize, lpdwSize,NULL);
+ return WriteFile(c->out, lpBuffer, *lpdwSize, lpdwSize, NULL);
return FALSE;
}
if (temp) xfree(temp);
dwBytes = strlen(lpszRespBuf);
- bRet = WriteClient(0,lpszRespBuf,&dwBytes,0);
+ bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0);
xfree(lpszRespBuf);
break;
(lpdwSize > 0)?lpvBuffer:0);
xfree(temp);
dwBytes = strlen(lpszRespBuf);
- bRet = WriteClient(0,lpszRespBuf,&dwBytes,0);
+ bRet = WriteClient(0, lpszRespBuf, &dwBytes, 0);
xfree(lpszRespBuf);
break;
default:
GetSystemTime(&systime);
- wsprintf(szDate,"%s, %d %s %d %d:%d.%d",DaysofWeek[systime.wDayOfWeek],
+ wsprintf(szDate,"%s, %d %s %d %d:%d.%d", DaysofWeek[systime.wDayOfWeek],
systime.wDay,
Months[systime.wMonth],
systime.wYear,
- systime.wHour,systime.wMinute,
+ systime.wHour, systime.wMinute,
systime.wSecond );
return szDate;
char * temp;
ECB->cbSize = sizeof(EXTENSION_CONTROL_BLOCK);
- ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR,HSE_VERSION_MAJOR);
+ ECB->dwVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
ECB->ConnID = (void *)context;
//
// Pointers to the functions the DLL will call.
//
// Works like _getenv(), but uses win32 functions instead.
//
-char * GetEnv(LPSTR lpszEnvVar) {
+char *GetEnv(LPSTR lpszEnvVar)
+{
- char *var,dummy;
+ char *var, dummy;
DWORD dwLen;
if (!lpszEnvVar)
return "";
- dwLen =GetEnvironmentVariable(lpszEnvVar,&dummy,1);
+ dwLen =GetEnvironmentVariable(lpszEnvVar, &dummy, 1);
if (dwLen == 0)
return "";
var = (char *)xmalloc(dwLen);
if (!var)
return "";
- (void)GetEnvironmentVariable(lpszEnvVar,var,dwLen);
+ (void)GetEnvironmentVariable(lpszEnvVar, var, dwLen);
return var;
}
int sent_bytes;
TSRMLS_FETCH();
- sent_bytes = fd_write(PHG(cip)->fd,str,str_length);
+ sent_bytes = fd_write(PHG(cip)->fd, str, str_length);
if (sent_bytes == -1) {
php_handle_aborted_connection();
char *p;
TSRMLS_FETCH();
- http_sendheaders(PHG(cip)->fd,PHG(cip), SG(sapi_headers).http_response_code, NULL);
+ http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL);
header_name = sapi_header->header;
header_content = p = strchr(header_name, ':');
header_content++;
} while (*header_content == ' ');
- fd_printf(PHG(cip)->fd,"%s: %s\n",header_name,header_content);
+ fd_printf(PHG(cip)->fd,"%s: %s\n", header_name, header_content);
*p = ':';
}
static void
php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC)
{
- memset(&SG(request_info),0,sizeof(sapi_globals_struct)); /* pfusch! */
+ memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */
SG(request_info).query_string = PHG(cip)->hip->request;
SG(request_info).request_method = PHG(cip)->hip->method;
ADD_STORAGE(php_roxen_request);
set_init_callback(clear_struct);
pike_add_function("run", f_php_roxen_request_handler,
- "function(string,mapping,object,function:int)", 0);
+ "function(string, mapping, object, function:int)", 0);
add_program_constant("Interpreter", (php_program = end_program()), 0);
}
* changed, so save it and change it back as quickly as possible
* in the hopes that Java doesn't notice.
*/
- getcwd(cwd,MAXPATHLEN);
+ getcwd(cwd, MAXPATHLEN);
retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
chdir(cwd);
#endif
if (retval == FAILURE) {
php_request_shutdown((void *) 0);
php_module_shutdown();
- ThrowIOException(jenv,file_handle.filename);
+ ThrowIOException(jenv, file_handle.filename);
return;
}
\r
Package=<4>\r
{{{\r
+ Begin Project Dependency\r
+ Project_Dep_Name TSRM\r
+ End Project Dependency\r
}}}\r
\r
###############################################################################\r
Begin Project Dependency\r
Project_Dep_Name php4dll\r
End Project Dependency\r
+ Begin Project Dependency\r
+ Project_Dep_Name Zend\r
+ End Project Dependency\r
+ Begin Project Dependency\r
+ Project_Dep_Name TSRM\r
+ End Project Dependency\r
}}}\r
\r
###############################################################################\r
#define PHP_REGISTRY_H
-void UpdateIniFromRegistry(char *path);
+void UpdateIniFromRegistry(char *path TSRMLS_DC);
#endif /* PHP_REGISTRY_H */
#include "php.h"
#include "php_ini.h"
-void UpdateIniFromRegistry(char *path)
+void UpdateIniFromRegistry(char *path TSRMLS_DC)
{
char *p, *orig_path;
HKEY MainKey;
return;
}
-
orig_path = path = estrdup(path);
/* Get rid of C:, if exists */