onphp_util.c

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006-2007 by Konstantin V. Arkhipov                     *
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU Lesser General Public License as        *
00006  *   published by the Free Software Foundation; either version 3 of the    *
00007  *   License, or (at your option) any later version.                       *
00008  *                                                                         *
00009  ***************************************************************************/
00010 /* $Id: onphp_util.c 4687 2007-12-09 18:57:18Z voxus $ */
00011 
00012 #include "onphp_util.h"
00013 
00014 void onphp_append_zval_to_smart_string(smart_str *string, zval *value)
00015 {
00016     zval copy;
00017 
00018     if (Z_TYPE_P(value) == IS_STRING) {
00019         smart_str_appends(string, Z_STRVAL_P(value));
00020     } else {
00021         int use_copy;
00022         
00023         zend_make_printable_zval(value, &copy, &use_copy);
00024         smart_str_appends(string, Z_STRVAL(copy));
00025         
00026         if (use_copy) {
00027             zval_dtor(&copy);
00028         }
00029     }
00030 }

Generated on Sun Dec 9 21:56:23 2007 for onPHP by  doxygen 1.5.4