home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Magazine / HomeAutomation / Apache / include / php / ext / standard / php_incomplete_class.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.2 KB  |  65 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group                   |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Author:  Sascha Schumann <sascha@schumann.cx>                        |
  16.    +----------------------------------------------------------------------+
  17.  */
  18.  
  19.  
  20. #ifndef PHP_INCOMPLETE_CLASS_H
  21. #define PHP_INCOMPLETE_CLASS_H
  22.  
  23. #include "ext/standard/basic_functions.h"
  24.  
  25. #define PHP_IC_ENTRY \
  26.     BG(incomplete_class)
  27.  
  28. #define PHP_IC_ENTRY_READ \
  29.     (PHP_IC_ENTRY ? PHP_IC_ENTRY : php_create_incomplete_class(BLS_C))
  30.  
  31.  
  32. #define PHP_SET_CLASS_ATTRIBUTES(struc)                 \
  33.     if ((struc)->value.obj.ce == BG(incomplete_class)) {                \
  34.         class_name = php_lookup_class_name(struc, &name_len, 1);        \
  35.         free_class_name = 1;                                            \
  36.     } else {                                                            \
  37.         class_name = (struc)->value.obj.ce->name;                        \
  38.         name_len   = (struc)->value.obj.ce->name_length;                \
  39.     }
  40.  
  41. #define PHP_CLEANUP_CLASS_ATTRIBUTES()                                    \
  42.     if (free_class_name) efree(class_name)
  43.  
  44. #define PHP_CLASS_ATTRIBUTES                                            \
  45.     char *class_name;                                                    \
  46.     size_t name_len;                                                    \
  47.     zend_bool free_class_name = 0                                        \
  48.  
  49.  
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. zend_class_entry *php_create_incomplete_class(BLS_D);
  56.  
  57. char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del);
  58. void  php_store_class_name(zval *object, const char *name, size_t len);
  59.  
  60. #ifdef __cplusplus
  61. };
  62. #endif
  63.  
  64. #endif
  65.