From c03328857394bef36ffa9678d33079ad96e4a4e4 Mon Sep 17 00:00:00 2001 From: Jeroen van Wolffelaar Date: Tue, 25 Sep 2001 21:58:48 +0000 Subject: Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know. --- ext/notes/php_notes.c | 92 +++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'ext/notes/php_notes.c') diff --git a/ext/notes/php_notes.c b/ext/notes/php_notes.c index 6f5a9a98f7..8b0367aa8c 100644 --- a/ext/notes/php_notes.c +++ b/ext/notes/php_notes.c @@ -174,7 +174,7 @@ PHP_FUNCTION(notes_create_db) RETURN_FALSE; } - if (error = NSFDbCreate ((*db)->value.str.val, (USHORT) DBCLASS_NOTEFILE, FALSE)) { + if (error = NSFDbCreate (Z_STRVAL_PP(db), (USHORT) DBCLASS_NOTEFILE, FALSE)) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to create database: %s", error_string); NotesTerm(); @@ -217,7 +217,7 @@ PHP_FUNCTION(notes_drop_db) RETURN_FALSE; } - if (error = NSFDbDelete ((*db)->value.str.val)) { + if (error = NSFDbDelete (Z_STRVAL_PP(db))) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to delete database: %s", error_string); NotesTerm(); @@ -264,7 +264,7 @@ PHP_FUNCTION(notes_version) RETURN_FALSE; } - if (error = NSFDbOpen((*db)->value.str.val, &db_handle)) { + if (error = NSFDbOpen(Z_STRVAL_PP(db), &db_handle)) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -339,7 +339,7 @@ PHP_FUNCTION(notes_create_note) RETURN_FALSE; } - if (error = NSFDbOpen((*db)->value.str.val, &db_handle)) { + if (error = NSFDbOpen(Z_STRVAL_PP(db), &db_handle)) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -356,7 +356,7 @@ PHP_FUNCTION(notes_create_note) } /* Append the form name item to the new note */ - if (error = NSFItemSetText(note_handle, FIELD_FORM, (*form_name)->value.str.val, MAXWORD)) { + if (error = NSFItemSetText(note_handle, FIELD_FORM, Z_STRVAL_PP(form_name), MAXWORD)) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to use the form: %s", error_string); NSFNoteClose (note_handle); @@ -485,20 +485,20 @@ PHP_FUNCTION(notes_mark_read) ActionTable[curAction].AddFlag = FALSE; - ActionTable[curAction].NoteID = strtoul ((*note_id)->value.str.val, &pEnd, 16); + ActionTable[curAction].NoteID = strtoul (Z_STRVAL_PP(note_id), &pEnd, 16); - if (error = NSFDbOpen((*db)->value.str.val, &db_handle)) { + if (error = NSFDbOpen(Z_STRVAL_PP(db), &db_handle)) { OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); NotesTerm(); RETURN_FALSE; } - error = UpdateUnread (db_handle, (*user_name)->value.str.val, UserNameLen, + error = UpdateUnread (db_handle, Z_STRVAL_PP(user_name), UserNameLen, ActionTable, ActionCount, &UndoID); if ((error == NOERROR) && UndoID) { - error = UndoUnreadStatus (db_handle, (*user_name)->value.str.val, UserNameLen, ActionTable, + error = UndoUnreadStatus (db_handle, Z_STRVAL_PP(user_name), UserNameLen, ActionTable, ActionCount, UndoID); } @@ -567,7 +567,7 @@ PHP_FUNCTION(notes_mark_unread) curArg = 2; - UserNameLen = strlen ((*user_name)->value.str.val); + UserNameLen = strlen (Z_STRVAL_PP(user_name)); curAction = 0; ActionCount = 1; @@ -575,9 +575,9 @@ PHP_FUNCTION(notes_mark_unread) ActionTable[curAction].AddFlag = TRUE; ActionTable[curAction].NoteID = - strtoul ((*note_id)->value.str.val, &pEnd, 16); + strtoul (Z_STRVAL_PP(note_id), &pEnd, 16); - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -585,12 +585,12 @@ PHP_FUNCTION(notes_mark_unread) RETURN_FALSE; } - error = UpdateUnread (db_handle, (*user_name)->value.str.val, UserNameLen, + error = UpdateUnread (db_handle, Z_STRVAL_PP(user_name), UserNameLen, ActionTable, ActionCount, &UndoID); if ( (error == NOERROR) && UndoID ){ - error = UndoUnreadStatus (db_handle, (*user_name)->value.str.val, UserNameLen, ActionTable, + error = UndoUnreadStatus (db_handle, Z_STRVAL_PP(user_name), UserNameLen, ActionTable, ActionCount, UndoID); } @@ -888,7 +888,7 @@ PHP_FUNCTION(notes_unread) RETURN_FALSE; } - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -896,12 +896,12 @@ PHP_FUNCTION(notes_unread) RETURN_FALSE; } - UserNameLen = strlen((*user_name)->value.str.val); + UserNameLen = strlen(Z_STRVAL_PP(user_name)); /* Get the unread list */ if( error = NSFDbGetUnreadNoteTable ( db_handle, - (*user_name)->value.str.val, + Z_STRVAL_PP(user_name), UserNameLen, TRUE, /* Create the list if it's not already there */ &table_handle) ){ @@ -1020,8 +1020,8 @@ PHP_FUNCTION(notes_header_info) } OSPathNetConstruct( NULL, /* port name */ - (*server)->value.str.val, - (*mail_box)->value.str.val, + Z_STRVAL_PP(server), + Z_STRVAL_PP(mail_box), szMailFilePath); /* Open the message file. */ @@ -1053,10 +1053,10 @@ PHP_FUNCTION(notes_header_info) object_init(return_value); - if (error = MailOpenMessage (MessageList, (WORD)(*msg_number)->value.lval, &hMessage)){ + if (error = MailOpenMessage (MessageList, (WORD)Z_LVAL_PP(msg_number), &hMessage)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); - php_error(E_WARNING,"Unable to open message number %d: %s", (WORD)(*msg_number)->value.lval, error_string); + php_error(E_WARNING,"Unable to open message number %d: %s", (WORD)Z_LVAL_PP(msg_number), error_string); if (hMessageList != NULLHANDLE){ @@ -1073,7 +1073,7 @@ PHP_FUNCTION(notes_header_info) /* Get the originator's name/address. */ - if (error = MailGetMessageOriginator(MessageList, (WORD)(*msg_number)->value.lval, + if (error = MailGetMessageOriginator(MessageList, (WORD)Z_LVAL_PP(msg_number), Originator, sizeof(Originator), &OriginatorLength)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); @@ -1253,8 +1253,8 @@ PHP_FUNCTION(notes_body) } OSPathNetConstruct( NULL, /* port name */ - (*server)->value.str.val, - (*mail_box)->value.str.val, + Z_STRVAL_PP(server), + Z_STRVAL_PP(mail_box), szMailFilePath); /* Open the message file. */ @@ -1281,10 +1281,10 @@ PHP_FUNCTION(notes_body) RETURN_FALSE; } - if (error = MailOpenMessage (MessageList, (WORD)(*msg_number)->value.lval, &hMessage)){ + if (error = MailOpenMessage (MessageList, (WORD)Z_LVAL_PP(msg_number), &hMessage)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); - php_error(E_WARNING,"Unable to open message number %d: %s", (WORD)(*msg_number)->value.lval, error_string); + php_error(E_WARNING,"Unable to open message number %d: %s", (WORD)Z_LVAL_PP(msg_number), error_string); if (hMessageList != NULLHANDLE){ @@ -1447,7 +1447,7 @@ PHP_FUNCTION(notes_find_note) RETURN_FALSE; } - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -1455,35 +1455,35 @@ PHP_FUNCTION(notes_find_note) RETURN_FALSE; } - if( strcmp( (*type)->value.str.val, "FORM" ) == 0 ){ + if( strcmp( Z_STRVAL_PP(type), "FORM" ) == 0 ){ - if ((error = NIFFindDesignNote(db_handle, (*name)->value.str.val, NOTE_CLASS_FORM, ¬e_id)) != ERR_NOT_FOUND) { + if ((error = NIFFindDesignNote(db_handle, Z_STRVAL_PP(name), NOTE_CLASS_FORM, ¬e_id)) != ERR_NOT_FOUND) { RETVAL_LONG( (long) note_id ); } - } else if( strcmp( (*type)->value.str.val, "VIEW" ) == 0 ){ + } else if( strcmp( Z_STRVAL_PP(type), "VIEW" ) == 0 ){ - if ((error = NIFFindDesignNote(db_handle, (*name)->value.str.val, NOTE_CLASS_VIEW, ¬e_id)) != ERR_NOT_FOUND) { + if ((error = NIFFindDesignNote(db_handle, Z_STRVAL_PP(name), NOTE_CLASS_VIEW, ¬e_id)) != ERR_NOT_FOUND) { RETVAL_LONG( (long) note_id ); } - } else if( strcmp( (*type)->value.str.val, "FILTER" ) == 0 ){ + } else if( strcmp( Z_STRVAL_PP(type), "FILTER" ) == 0 ){ - if ((error = NIFFindDesignNote(db_handle, (*name)->value.str.val, NOTE_CLASS_FILTER, ¬e_id)) != ERR_NOT_FOUND) { + if ((error = NIFFindDesignNote(db_handle, Z_STRVAL_PP(name), NOTE_CLASS_FILTER, ¬e_id)) != ERR_NOT_FOUND) { RETVAL_LONG( (long) note_id ); } - } else if( strcmp( (*type)->value.str.val, "FIELD" ) == 0 ){ + } else if( strcmp( Z_STRVAL_PP(type), "FIELD" ) == 0 ){ - if ((error = NIFFindDesignNote(db_handle, (*name)->value.str.val, NOTE_CLASS_FIELD, ¬e_id)) != ERR_NOT_FOUND) { + if ((error = NIFFindDesignNote(db_handle, Z_STRVAL_PP(name), NOTE_CLASS_FIELD, ¬e_id)) != ERR_NOT_FOUND) { RETVAL_LONG( (long) note_id ); } } else{ - if ((error = NIFFindDesignNote(db_handle, (*name)->value.str.val, NOTE_CLASS_ALL, ¬e_id)) != ERR_NOT_FOUND) { + if ((error = NIFFindDesignNote(db_handle, Z_STRVAL_PP(name), NOTE_CLASS_ALL, ¬e_id)) != ERR_NOT_FOUND) { RETVAL_LONG( (long) note_id ); } @@ -1548,7 +1548,7 @@ PHP_FUNCTION(notes_nav_create) RETURN_FALSE; } - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -1573,7 +1573,7 @@ PHP_FUNCTION(notes_nav_create) * Set the view name. */ error = NSFItemSetText( view_handle, VIEW_TITLE_ITEM, - (*name)->value.str.val, MAXWORD ); + Z_STRVAL_PP(name), MAXWORD ); if ( error ){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); @@ -1740,7 +1740,7 @@ PHP_FUNCTION(notes_search) RETURN_FALSE; } - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); php_error(E_WARNING,"Unable to open database: %s", error_string); @@ -1773,7 +1773,7 @@ PHP_FUNCTION(notes_search) allocated search handle */ (HCOLLECTION) NULLHANDLE, /* no collection specified - query all docs */ - (*keywords)->value.str.val, /* query string */ + Z_STRVAL_PP(keywords), /* query string */ FT_SEARCH_SCORES | /* find relevancy scores */ FT_SEARCH_STEM_WORDS, /* find word variants */ 0, /* maximum number of docs to @@ -1867,7 +1867,7 @@ PHP_FUNCTION(notes_search) allocated search handle */ (HCOLLECTION) NULLHANDLE, /* no collection specified - query all docs */ - (*keywords)->value.str.val, /* query string */ + Z_STRVAL_PP(keywords), /* query string */ FT_SEARCH_SCORES | /* find relevancy scores */ FT_SEARCH_REFINE, /* refine the search - use the * given id table */ @@ -1985,7 +1985,7 @@ PHP_FUNCTION(notes_copy_db) /* Open the input database. */ - if (error = NSFDbOpen ((*db_input)->value.str.val, &input_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db_input), &input_handle)){ NSFDbClose (input_handle); OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); @@ -1996,7 +1996,7 @@ PHP_FUNCTION(notes_copy_db) /* Create and open the output database. */ - if (error = NSFDbCreate ((*db_output)->value.str.val, DBCLASS_NOTEFILE, FALSE)) + if (error = NSFDbCreate (Z_STRVAL_PP(db_output), DBCLASS_NOTEFILE, FALSE)) { NSFDbClose (input_handle); OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); @@ -2005,7 +2005,7 @@ PHP_FUNCTION(notes_copy_db) RETURN_FALSE; } - if (error = NSFDbOpen ((*db_output)->value.str.val, &output_handle)) + if (error = NSFDbOpen (Z_STRVAL_PP(db_output), &output_handle)) { NSFDbClose (input_handle); OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); @@ -2129,7 +2129,7 @@ specified to indicate that we do not want any cutoff date. */ /* Add the database title to the database information buffer */ - NSFDbInfoModify (output_db_info, INFOPARSE_TITLE, (*title)->value.str.val); + NSFDbInfoModify (output_db_info, INFOPARSE_TITLE, Z_STRVAL_PP(title)); if (error = NSFDbInfoSet (output_handle, output_db_info)) { NSFDbClose (input_handle); @@ -2257,7 +2257,7 @@ PHP_FUNCTION(notes_list_msgs) RETURN_FALSE; } - if (error = NSFDbOpen ((*db)->value.str.val, &db_handle)){ + if (error = NSFDbOpen (Z_STRVAL_PP(db), &db_handle)){ NSFDbClose (db_handle); OSLoadString(NULLHANDLE, ERR(error), error_string, sizeof(error_string)); -- cgit v1.2.1