Guest User

Untitled

a guest
Sep 23rd, 2009
511
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: dbx.c
  2. ===================================================================
  3. --- dbx.c (revision 288604)
  4. +++ dbx.c (working copy)
  5. @@ -52,6 +52,16 @@
  6. #include "dbx_sybasect.h"
  7. #include "dbx_sqlite.h"
  8.  
  9. +#ifndef Z_ADDREF_P
  10. +# define Z_ADDREF_P(pz) (pz)->refcount++;
  11. +# define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
  12. +#endif
  13. +
  14. +#ifndef Z_SET_ISREF_P
  15. +# define Z_SET_ISREF_P(pz) (pz)->is_ref = 1;
  16. +# define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz))
  17. +#endif
  18. +
  19. /* support routines */
  20. int module_exists(char *module_name)
  21. {
  22. @@ -283,19 +293,19 @@
  23.  
  24. if (Z_TYPE_PP(arguments[0]) == IS_LONG) {
  25. if (!module_identifier_exists(Z_LVAL_PP(arguments[0]))) {
  26. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%ld' not loaded or not supported.", Z_LVAL_PP(arguments[0]));
  27. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%ld' not loaded or not supported", Z_LVAL_PP(arguments[0]));
  28. return;
  29. }
  30. module_identifier = Z_LVAL_PP(arguments[0]);
  31. } else {
  32. convert_to_string_ex(arguments[0]);
  33. if (!module_exists(Z_STRVAL_PP(arguments[0]))) {
  34. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%s' not loaded.", Z_STRVAL_PP(arguments[0]));
  35. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: module '%s' not loaded", Z_STRVAL_PP(arguments[0]));
  36. return;
  37. }
  38. module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0]));
  39. if (!module_identifier) {
  40. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: unsupported module '%s'.", Z_STRVAL_PP(arguments[0]));
  41. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbx: unsupported module '%s'", Z_STRVAL_PP(arguments[0]));
  42. return;
  43. }
  44. }
  45. @@ -349,7 +359,7 @@
  46. WRONG_PARAM_COUNT;
  47. }
  48. if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
  49. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
  50. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object");
  51. RETURN_LONG(0);
  52. }
  53.  
  54. @@ -401,7 +411,7 @@
  55. WRONG_PARAM_COUNT;
  56. }
  57. if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
  58. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
  59. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object");
  60. RETURN_LONG(0);
  61. }
  62. /* default values */
  63. @@ -470,7 +480,7 @@
  64. ZVAL_LONG(rv_column_count, 0);
  65. result = switch_dbx_getcolumncount(&rv_column_count, &rv_result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module);
  66. if (!result) {
  67. - php_error_docref(NULL TSRMLS_CC, E_ERROR, "get column_count failed...");
  68. + php_error_docref(NULL TSRMLS_CC, E_ERROR, "get column_count failed");
  69. FREE_ZVAL(rv_column_count);
  70. RETURN_LONG(0);
  71. }
  72. @@ -532,8 +542,8 @@
  73. for (col_index=0; col_index<Z_LVAL_P(rv_column_count); ++col_index) {
  74. zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
  75. zend_hash_index_find(Z_ARRVAL_PP(row_ptr), col_index, (void **) &actual_ptr);
  76. - (*actual_ptr)->refcount+=1;
  77. - (*actual_ptr)->is_ref=1;
  78. + Z_ADDREF_PP(actual_ptr);
  79. + Z_SET_ISREF_PP(actual_ptr);
  80. zend_hash_update(Z_ARRVAL_PP(row_ptr), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
  81. }
  82. }
  83. @@ -580,11 +590,11 @@
  84. WRONG_PARAM_COUNT;
  85. }
  86. if (!split_dbx_result_object(arguments[0], &dbx_result_link, &dbx_result_handle, &dbx_result_flags, &dbx_result_info, &dbx_result_cols, &dbx_result_rows TSRMLS_CC)) {
  87. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_result-object...");
  88. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_result-object");
  89. RETURN_LONG(0);
  90. }
  91. if (!split_dbx_handle_object(dbx_result_link, &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
  92. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
  93. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object");
  94. RETURN_LONG(0);
  95. }
  96.  
  97. @@ -606,8 +616,8 @@
  98. for (col_index=0; col_index<col_count; ++col_index) {
  99. zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
  100. zend_hash_index_find(Z_ARRVAL_P(return_value), col_index, (void **) &actual_ptr);
  101. - (*actual_ptr)->refcount+=1;
  102. - (*actual_ptr)->is_ref=1;
  103. + Z_ADDREF_PP(actual_ptr);
  104. + Z_SET_ISREF_PP(actual_ptr);
  105. zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
  106. }
  107. }
  108. @@ -636,7 +646,7 @@
  109. WRONG_PARAM_COUNT;
  110. }
  111. if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
  112. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
  113. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object");
  114. RETURN_LONG(0);
  115. }
  116.  
  117. @@ -669,7 +679,7 @@
  118. WRONG_PARAM_COUNT;
  119. }
  120. if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
  121. - php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object...");
  122. + php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a valid dbx_handle-object");
  123. RETURN_NULL();
  124. }
  125. convert_to_string_ex(arguments[1]);
  126. Index: dbx.h
  127. ===================================================================
  128. --- dbx.h (revision 288604)
  129. +++ dbx.h (working copy)
  130. @@ -29,6 +29,10 @@
  131. #include "zend_modules.h"
  132. #endif
  133.  
  134. +#ifdef HAVE_CONFIG_H
  135. +# include "config.h"
  136. +#endif
  137. +
  138. #include "php.h"
  139. #include "ext/standard/php_string.h"
  140.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×