Ticket #416: util.i.patch
File util.i.patch, 738 bytes (added by , 15 years ago) |
---|
-
util.i
old new 26 26 #endif 27 27 28 28 #include "../xapian-version.h" 29 29 30 %} 30 31 31 32 /* Add a section to the output from phpinfo(). */ … … 140 141 } 141 142 } 142 143 144 #define XAPIAN_STRING_DOCCOUNT_MAP_OUTPUT_TYPEMAP 145 %typemap(out) const std::map<std::string, Xapian::doccount> & { 146 if (array_init($result) == FAILURE) { 147 SWIG_PHP_Error(E_ERROR, "array_init failed"); 148 } 149 for (std::map<std::string, Xapian::doccount>::iterator i = $1->begin(); i != $1->end(); i++) 150 { 151 string term = i->first; 152 char *p = const_cast<char*>(term.data()); 153 add_assoc_long($result, p, i->second); 154 } 155 } 156 143 157 /* vim:set syntax=cpp:set noexpandtab: */