Пример #1
0
Файл: Simple.c Проект: aosm/X11
static void
XawSimpleClassInitialize(void)
{
    static XtConvertArgRec convertArg[] = {
    {
      XtWidgetBaseOffset,
      (XtPointer)XtOffsetOf(WidgetRec, core.screen),
      sizeof(Screen *)
    },
    {
      XtResourceString,
      (XtPointer)XtNpointerColor,
      sizeof(Pixel)
    },
    {
      XtResourceString,
      (XtPointer)XtNpointerColorBackground,
      sizeof(Pixel)
    },
    {
      XtWidgetBaseOffset,
      (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
      sizeof(Colormap)
    },
    };

    XawInitializeWidgetSet();
    XtSetTypeConverter(XtRString, XtRColorCursor, XmuCvtStringToColorCursor,
		       convertArg, XtNumber(convertArg), XtCacheByDisplay, NULL);
}
Пример #2
0
static void
XawVendorShellClassInitialize(void)
{
    static XtConvertArgRec screenConvertArg[] = {
        {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)}
    };
#ifdef XAW_MULTIPLANE_PIXMAPS
    static XtConvertArgRec _XawCvtStrToPix[] = {
	{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)},
	{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
	     sizeof(Colormap)},
	{XtWidgetBaseOffset,
	     (XtPointer)XtOffsetOf(WidgetRec, core.background_pixel),
	     sizeof(Pixel)}
    };
#endif

    XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,
		   screenConvertArg, XtNumber(screenConvertArg));

#ifdef XAW_MULTIPLANE_PIXMAPS
    XtSetTypeConverter(XtRString, XtRBitmap,
		       (XtTypeConverter)_XawCvtStringToPixmap,
		       _XawCvtStrToPix, XtNumber(_XawCvtStrToPix),
		       XtCacheByDisplay, (XtDestructor)NULL);
#else
    XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
		   screenConvertArg, XtNumber(screenConvertArg));
#endif

    XtSetTypeConverter("CompoundText", XtRString, XawCvtCompoundTextToString,
			NULL, 0, XtCacheNone, NULL);
}
Пример #3
0
static void
XawFormClassInitialize(void)
{
    static XtConvertArgRec parentCvtArgs[] = {
	{XtBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.parent),
	 sizeof(Widget)}
    };

    char name[12];

    XawInitializeWidgetSet();
    XmuNCopyISOLatin1Lowered(name, XtEchainLeft, sizeof(name));
    QchainLeft = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainRight, sizeof(name));
    QchainRight = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainTop, sizeof(name));
    QchainTop = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtEchainBottom, sizeof(name));
    QchainBottom = XrmStringToQuark(name);
    XmuNCopyISOLatin1Lowered(name, XtErubber, sizeof(name));
    Qrubber = XrmStringToQuark(name);

    XtAddConverter(XtRString, XtREdgeType, _CvtStringToEdgeType, NULL, 0);
    XtSetTypeConverter(XtREdgeType, XtRString, CvtEdgeTypeToString,
		       NULL, 0, XtCacheNone, NULL);
    XtSetTypeConverter(XtRString, XtRWidget, XmuNewCvtStringToWidget,
		       parentCvtArgs, XtNumber(parentCvtArgs), XtCacheNone,
		       NULL);
    XtSetTypeConverter(XtRWidget, XtRString, XmuCvtWidgetToString,
		       NULL, 0, XtCacheNone, NULL);
}
Пример #4
0
/* {{{ resourcebundle_register_class
 * Initialize 'ResourceBundle' class
 */
void resourcebundle_register_class( void )
{
	zend_class_entry ce;

	INIT_CLASS_ENTRY( ce, "ResourceBundle", ResourceBundle_class_functions );

	ce.create_object = ResourceBundle_object_create;
	ce.get_iterator = resourcebundle_get_iterator;

	ResourceBundle_ce_ptr = zend_register_internal_class( &ce );

	if( !ResourceBundle_ce_ptr )
	{
		zend_error(E_ERROR, "Failed to register ResourceBundle class");
		return;
	}

	ResourceBundle_object_handlers = std_object_handlers;
	ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend);
	ResourceBundle_object_handlers.clone_obj	  = NULL; /* ICU ResourceBundle has no clone implementation */
	ResourceBundle_object_handlers.dtor_obj = ResourceBundle_object_destroy;
	ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
	ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;

	zend_class_implements(ResourceBundle_ce_ptr, 1, zend_ce_traversable);
}
Пример #5
0
/* {{{ transliterator_register_Transliterator_class
 * Initialize 'Transliterator' class
 */
void transliterator_register_Transliterator_class( void )
{
	zend_class_entry ce;

	/* Create and register 'Transliterator' class. */
	INIT_CLASS_ENTRY( ce, "Transliterator", Transliterator_class_functions );
	ce.create_object = Transliterator_object_create;
	Transliterator_ce_ptr = zend_register_internal_class( &ce );
	memcpy( &Transliterator_handlers, &std_object_handlers,
		sizeof Transliterator_handlers );
	Transliterator_handlers.offset = XtOffsetOf(Transliterator_object, zo);
	Transliterator_handlers.free_obj = Transliterator_objects_free;
	Transliterator_handlers.clone_obj = Transliterator_clone_obj;
	Transliterator_handlers.get_property_ptr_ptr = Transliterator_get_property_ptr_ptr;
	Transliterator_handlers.read_property = Transliterator_read_property;
	Transliterator_handlers.write_property = Transliterator_write_property;

	/* Declare 'Transliterator' class properties */
	if( !Transliterator_ce_ptr )
	{
		zend_error( E_ERROR,
			"Transliterator: attempt to create properties "
			"on a non-registered class." );
		return;
	}
	zend_declare_property_null( Transliterator_ce_ptr,
		"id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC );

	/* constants are declared in transliterator_register_constants, called from MINIT */

}
Пример #6
0
Файл: ssX.c Проект: q3k/ski
static void addDatwRsrcOpts(void)
{
    static char rsrc[EXPRSIZ+4][WINTBLSIZ];
    static char opt[EXPRSIZ+5][2*WINTBLSIZ];
    static char spec[EXPRSIZ+5][WINTBLSIZ];
    unsigned i;

    for (i = 0; i < topdatw; i++) {
	sprintf(rsrc[i],    "view%s",  datwtbl[i].tag);
	sprintf(opt[2*i],   "-view%s", datwtbl[i].tag);
	sprintf(opt[2*i+1], "+view%s", datwtbl[i].tag);
	sprintf(spec[i],    ".view%s", datwtbl[i].tag);

	resources[toprsrc].resource_name   = rsrc[i];
	resources[toprsrc].resource_class  = "ViewData";
	resources[toprsrc].resource_type   = XmRBoolean;
	resources[toprsrc].resource_size   = sizeof(Boolean);
	resources[toprsrc].resource_offset = XtOffsetOf(AppData, viewDw[0]) + i*sizeof(Boolean);
	resources[toprsrc].default_type    = XmRImmediate;
	resources[toprsrc].default_addr    = (XtPointer)True;
	toprsrc++;

	options[topopts].option    = opt[2*i];
	options[topopts].specifier = spec[i];
	options[topopts].argKind   = XrmoptionNoArg;
	options[topopts].value     = "True";
	topopts++;

	options[topopts].option    = opt[2*i+1];
	options[topopts].specifier = spec[i];
	options[topopts].argKind   = XrmoptionNoArg;
	options[topopts].value     = "False";
	topopts++;
    }
}
Пример #7
0
/************************************************************************
 *
 *  _XmCachePart
 *	Pass in a pointer, <cpart>, to <size> bytes of a temporary Cache
 *	record.  
 *	- If the Class cache head is NULL (no entries yet!), allocate a new
 *	  cache record, copy in temporary Cache bytes, append it to the 
 *	  class-cache linked list, and return the address.
 *	- Else, run through the class linked list.
 *	  = If a match is found, increment the ref_count and return the 
 *	    address.
 *	  = Else, allocate a new cache record, copy in temporary Cache bytes,
 *	    append it to the class-cache linked list, and return the address.
 *
 ************************************************************************/
XtPointer 
_XmCachePart(
        XmCacheClassPartPtr cp,
        XtPointer cpart,
        size_t size )
{
    XmGadgetCachePtr ptr, last;
    
    if (ClassCacheHead(cp).next == NULL)       /* First one */
    {
	ClassCacheHead(cp).next = 
	  (struct _XmGadgetCache *)XtMalloc( size + 
					    XtOffsetOf(XmGadgetCacheRef, data));
        ptr = (XmGadgetCachePtr)ClassCacheHead(cp).next;

        ClassCacheCopy(cp)(cpart, CacheDataPtr(ptr), size );  
	ptr-> ref_count = 1;
        ptr-> next = NULL;
	ptr-> prev = (struct _XmGadgetCache *)&ClassCacheHead(cp);
        return (CacheDataPtr(ptr));
    }    
    ptr = (XmGadgetCachePtr)ClassCacheHead(cp).next;
    do
    {

        if ((ClassCacheCompare(cp)( cpart, CacheDataPtr(ptr))))
        {
            ptr->ref_count++;
            return ((XtPointer) CacheDataPtr(ptr));
        }
        else
        {
            last = ptr;
            ptr = (XmGadgetCachePtr)ptr->next;
        }
    } while (ptr);
    
    /* Malloc a new rec off of last, fill it out*/
    ptr = (XmGadgetCachePtr)XtMalloc( size + 
				     XtOffsetOf(XmGadgetCacheRef, data) );
    last->next = (struct _XmGadgetCache *)ptr;
    ClassCacheCopy(cp)(cpart, CacheDataPtr(ptr), size);
    ptr-> ref_count = 1;
    ptr-> next = NULL;
    ptr-> prev = last;
    return (CacheDataPtr(ptr));
}
Пример #8
0
/*
 * standard help callback
 */
void
wl_help(Widget w, XtPointer closure, XtPointer call)
{
static	int	firsttime = TRUE;
	XtResource hr[] = {
		{
			XwlNhelpChapter, XwlCHelpChapter,
			XtRString, sizeof(String), XtOffsetOf(HELP, chapter),
			XtRString, NULL
		}, {
			XwlNhelpSection, XwlCHelpSection,
			XtRString, sizeof(String), XtOffsetOf(HELP, section),
			XtRString, NULL
		}, {
			XwlNhelpType, XwlCHelpType,
			XwlRHelpType, sizeof(WL_HELPFN), XtOffsetOf(HELP, f),
			XtRString, (XtPointer)"remote"
		}
	};
	HELP		help;
	WLP_HELP	h;
	USEUP(call); USEUP(closure);

	if(firsttime) {
		XtSetTypeConverter(XtRString, XwlRHelpType, string2help,
						NULL, 0, XtCacheNone, NULL);
		firsttime = FALSE;
	}

	for(; w != NULL; w = XtParent(w))
		if(XtHasCallbacks(w, XmNhelpCallback) == XtCallbackHasSome)
			break;
	if(w == NULL)
		return;

	memset((void *)&help, '\0', sizeof(help));
	XtGetApplicationResources(w, &help, &hr[0], XtNumber(hr), NULL, 0);
	if(help.f == NULL || help.chapter == NULL)
		return;
	h.chapter = help.chapter;
	h.section = help.section;

	help.f(w, &h);
}
Пример #9
0
void grpc_init_call() {
  zend_class_entry ce;
  INIT_CLASS_ENTRY(ce, "Grpc\\Call", call_methods);
  ce.create_object = create_wrapped_grpc_call;
  grpc_ce_call = zend_register_internal_class(&ce);
  memcpy(&call_object_handlers_call, zend_get_std_object_handlers(),
         sizeof(zend_object_handlers));
  call_object_handlers_call.offset = XtOffsetOf(wrapped_grpc_call, std);
  call_object_handlers_call.free_obj = free_wrapped_grpc_call;
  return;
}
Пример #10
0
void grpc_init_timeval() {
  zend_class_entry ce;
  INIT_CLASS_ENTRY(ce, "Grpc\\Timeval", timeval_methods);
  ce.create_object = create_wrapped_grpc_timeval;
  grpc_ce_timeval = zend_register_internal_class(&ce);
  memcpy(&timeval_object_handlers_timeval, zend_get_std_object_handlers(),
         sizeof(zend_object_handlers));
  timeval_object_handlers_timeval.offset =
    XtOffsetOf(wrapped_grpc_timeval, std);
  timeval_object_handlers_timeval.free_obj = free_wrapped_grpc_timeval;
}
Пример #11
0
static void XawVendorShellClassInitialize()
{
    static XtConvertArgRec screenConvertArg[] = {
        {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)}
    };

    XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,      
		   screenConvertArg, XtNumber(screenConvertArg));

    XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
		   screenConvertArg, XtNumber(screenConvertArg));
}
Пример #12
0
void grpc_init_server_credentials() {
  zend_class_entry ce;
  INIT_CLASS_ENTRY(ce, "Grpc\\ServerCredentials", server_credentials_methods);
  ce.create_object = create_wrapped_grpc_server_credentials;
  grpc_ce_server_credentials = zend_register_internal_class(&ce);
  memcpy(&server_credentials_ce_handlers,
         zend_get_std_object_handlers(),
         sizeof(zend_object_handlers));
  server_credentials_ce_handlers.offset =
    XtOffsetOf(wrapped_grpc_server_credentials, std);
  server_credentials_ce_handlers.free_obj =
    free_wrapped_grpc_server_credentials;
}
Пример #13
0
/* {{{ timezone_register_IntlTimeZone_class
 * Initialize 'IntlTimeZone' class
 */
U_CFUNC void timezone_register_IntlTimeZone_class(void)
{
	zend_class_entry ce;

	/* Create and register 'IntlTimeZone' class. */
	INIT_CLASS_ENTRY(ce, "IntlTimeZone", TimeZone_class_functions);
	ce.create_object = TimeZone_object_create;
	TimeZone_ce_ptr = zend_register_internal_class(&ce);
	if (!TimeZone_ce_ptr) {
		//can't happen now without bigger problems before
		php_error_docref0(NULL, E_ERROR,
			"IntlTimeZone: class registration has failed.");
		return;
	}

	memcpy(&TimeZone_handlers, zend_get_std_object_handlers(),
		sizeof TimeZone_handlers);
	TimeZone_handlers.offset = XtOffsetOf(TimeZone_object, zo);
	TimeZone_handlers.clone_obj = TimeZone_clone_obj;
	TimeZone_handlers.compare_objects = TimeZone_compare_objects;
	TimeZone_handlers.get_debug_info = TimeZone_get_debug_info;
	TimeZone_handlers.dtor_obj = TimeZone_objects_dtor;
	TimeZone_handlers.free_obj = TimeZone_objects_free;


	/* Declare 'IntlTimeZone' class constants */
#define TIMEZONE_DECL_LONG_CONST(name, val) \
	zend_declare_class_constant_long(TimeZone_ce_ptr, name, sizeof(name) - 1, \
		val)

	TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT", TimeZone::SHORT);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG", TimeZone::LONG);

#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 44
	TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_GENERIC", TimeZone::SHORT_GENERIC);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG_GENERIC", TimeZone::LONG_GENERIC);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_GMT", TimeZone::SHORT_GMT);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG_GMT", TimeZone::LONG_GMT);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT_COMMONLY_USED", TimeZone::SHORT_COMMONLY_USED);
	TIMEZONE_DECL_LONG_CONST("DISPLAY_GENERIC_LOCATION", TimeZone::GENERIC_LOCATION);
#endif

#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
	TIMEZONE_DECL_LONG_CONST("TYPE_ANY", UCAL_ZONE_TYPE_ANY);
	TIMEZONE_DECL_LONG_CONST("TYPE_CANONICAL", UCAL_ZONE_TYPE_CANONICAL);
	TIMEZONE_DECL_LONG_CONST("TYPE_CANONICAL_LOCATION", UCAL_ZONE_TYPE_CANONICAL_LOCATION);
#endif

	/* Declare 'IntlTimeZone' class properties */

}
Пример #14
0
void php_ds_register_queue_handlers()
{
    memcpy(&php_queue_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    php_queue_handlers.offset = XtOffsetOf(php_ds_queue_t, std);

    php_queue_handlers.dtor_obj          = zend_objects_destroy_object;
    php_queue_handlers.free_obj          = ds_queue_free_object;
    php_queue_handlers.clone_obj         = ds_queue_clone_obj;
    php_queue_handlers.cast_object       = ds_default_cast_object;
    php_queue_handlers.get_debug_info    = ds_queue_get_debug_info;
    php_queue_handlers.count_elements    = ds_queue_count_elements;
    php_queue_handlers.write_dimension   = ds_queue_write_dimension;
}
Пример #15
0
extern int oauth_provider_register_class() /* {{{ */
{
	zend_class_entry osce;

	INIT_CLASS_ENTRY(osce, "OAuthProvider", oauth_provider_methods);
	osce.create_object = oauth_provider_new;
	oauthprovider = zend_register_internal_class(&osce);

	memcpy(&oauth_provider_obj_hndlrs, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
	oauth_provider_obj_hndlrs.offset = XtOffsetOf(php_oauth_provider, zo);
	oauth_provider_obj_hndlrs.free_obj = oauth_provider_free_storage;

	return SUCCESS;
}
Пример #16
0
void php_lua_closure_register() /* {{{ */
{
	zend_class_entry ce;

	INIT_CLASS_ENTRY(ce, "LuaClosure", lua_closure_methods);
	lua_closure_ce = zend_register_internal_class(&ce);
	lua_closure_ce->create_object = php_lua_closure_create_object;
	lua_closure_ce->ce_flags |= ZEND_ACC_FINAL;

	memcpy(&lua_closure_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
	lua_closure_handlers.offset = XtOffsetOf(lua_closure_object, std);
	lua_closure_handlers.clone_obj = NULL;
	lua_closure_handlers.free_obj = php_lua_closure_free_obj;
} /* }}} */
Пример #17
0
void php_ds_register_set_handlers()
{
    memcpy(&php_ds_set_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    php_ds_set_handlers.offset = XtOffsetOf(php_ds_set_t, std);

    php_ds_set_handlers.free_obj            = ds_set_free_object;
    php_ds_set_handlers.clone_obj           = ds_set_clone_obj;
    php_ds_set_handlers.get_debug_info      = ds_set_get_debug_info;
    php_ds_set_handlers.count_elements      = ds_set_count_elements;
    php_ds_set_handlers.read_dimension      = ds_set_read_dimension;
    php_ds_set_handlers.write_dimension     = ds_set_write_dimension;
    php_ds_set_handlers.cast_object         = ds_default_cast_object;
    // php_ds_set_handlers.do_operation        = ds_set_do_operation;
}
Пример #18
0
/* {{{ spoofchecker_register_Spoofchecker_class
 * Initialize 'Spoofchecker' class
 */
void spoofchecker_register_Spoofchecker_class(void)
{
	zend_class_entry ce;

	/* Create and register 'Spoofchecker' class. */
	INIT_CLASS_ENTRY(ce, "Spoofchecker", Spoofchecker_class_functions);
	ce.create_object = Spoofchecker_object_create;
	Spoofchecker_ce_ptr = zend_register_internal_class(&ce);

	memcpy(&Spoofchecker_handlers, zend_get_std_object_handlers(),
		sizeof Spoofchecker_handlers);
	Spoofchecker_handlers.offset = XtOffsetOf(Spoofchecker_object, zo);
	Spoofchecker_handlers.clone_obj = spoofchecker_clone_obj;
	Spoofchecker_handlers.free_obj = Spoofchecker_objects_free;
}
Пример #19
0
/* {{{ dateformat_register_class
 * Initialize 'IntlDateFormatter' class
 */
void dateformat_register_IntlDateFormatter_class( void )
{
	zend_class_entry ce;

	/* Create and register 'IntlDateFormatter' class. */
	INIT_CLASS_ENTRY( ce, "IntlDateFormatter", IntlDateFormatter_class_functions );
	ce.create_object = IntlDateFormatter_object_create;
	IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce );

	memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(),
		sizeof IntlDateFormatter_handlers);
	IntlDateFormatter_handlers.offset = XtOffsetOf(IntlDateFormatter_object, zo);
	IntlDateFormatter_handlers.clone_obj = IntlDateFormatter_object_clone;
	IntlDateFormatter_handlers.dtor_obj = IntlDateFormatter_object_dtor;
	IntlDateFormatter_handlers.free_obj = IntlDateFormatter_object_free;
}
Пример #20
0
static void
XawVendorShellClassInitialize(void)
{
    static XtConvertArgRec screenConvertArg[] = {
        {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
	     sizeof(Screen *)}
    };

    XtAddConverter(XtRString, XtRCursor, XmuCvtStringToCursor,      
		   screenConvertArg, XtNumber(screenConvertArg));

    XtAddConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap,
		   screenConvertArg, XtNumber(screenConvertArg));

    XtSetTypeConverter("CompoundText", XtRString, XawCvtCompoundTextToString,
			NULL, 0, XtCacheNone, NULL);
}
Пример #21
0
void register_map_handlers()
{
    memcpy(&map_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    map_handlers.offset = XtOffsetOf(Map, std);

    map_handlers.dtor_obj            = zend_objects_destroy_object;
    map_handlers.free_obj            = map_free_object;
    map_handlers.clone_obj           = map_clone_obj;
    map_handlers.get_debug_info      = map_get_debug_info;
    map_handlers.count_elements      = map_count_elements;
    map_handlers.read_dimension      = map_read_dimension;
    map_handlers.write_dimension     = map_write_dimension;
    map_handlers.has_dimension       = map_has_dimension;
    map_handlers.unset_dimension     = map_unset_dimension;
    map_handlers.cast_object         = ds_default_cast_object;
    // map_handlers.get_properties      = map_get_properties;
}
Пример #22
0
void php_register_vector_handlers()
{
    memcpy(&php_vector_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    php_vector_handlers.offset = XtOffsetOf(php_ds_vector_t, std);

    php_vector_handlers.dtor_obj         = zend_objects_destroy_object;
    php_vector_handlers.free_obj         = php_ds_vector_free_object;
    php_vector_handlers.get_gc           = php_ds_vector_get_gc;
    php_vector_handlers.clone_obj        = php_ds_vector_clone_obj;
    php_vector_handlers.cast_object      = php_ds_default_cast_object;
    php_vector_handlers.get_debug_info   = php_ds_vector_get_debug_info;
    php_vector_handlers.count_elements   = php_ds_vector_count_elements;
    php_vector_handlers.read_dimension   = php_ds_vector_read_dimension;
    php_vector_handlers.write_dimension  = php_ds_vector_write_dimension;
    php_vector_handlers.has_dimension    = php_ds_vector_has_dimension;
    php_vector_handlers.unset_dimension  = php_ds_vector_unset_dimension;
}
Пример #23
0
void php_ds_register_pair_handlers()
{
    memcpy(&php_pair_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    php_pair_handlers.offset = XtOffsetOf(php_ds_pair_t, std);

    php_pair_handlers.dtor_obj                = zend_objects_destroy_object;
    php_pair_handlers.free_obj                = ds_pair_free_object;
    php_pair_handlers.clone_obj               = ds_pair_clone_object;
    php_pair_handlers.cast_object             = ds_default_cast_object;
    php_pair_handlers.get_debug_info          = ds_pair_get_debug_info;
    php_pair_handlers.count_elements          = ds_pair_count_elements;

    php_pair_handlers.get_property_ptr_ptr    = ds_pair_get_property_ptr_ptr;
    php_pair_handlers.read_property           = ds_pair_read_property;
    php_pair_handlers.write_property          = ds_pair_write_property;
    php_pair_handlers.has_property            = ds_pair_has_property;
    php_pair_handlers.unset_property          = ds_pair_unset_property;
}
Пример #24
0
static MString get_tip_of_the_day(Widget w, int n)
{
    struct tip_of_the_day_resource_values {
	XmString tip;
    };

    const string tip_name = "tip" + itostring(n);

    XtResource r;
    r.resource_name   = XTRESSTR(tip_name.chars());
    r.resource_class  = XTRESSTR("Tip");
    r.resource_type   = XmRXmString;
    r.resource_size   = sizeof(XmString);
    r.resource_offset = XtOffsetOf(tip_of_the_day_resource_values, tip);
    r.default_type    = XtRImmediate;
    r.default_addr    = XtPointer(0);

    tip_of_the_day_resource_values values;
    XtGetApplicationResources(w, &values, &r, 1, ArgList(0), 0);

    return MString(values.tip, true);
}
Пример #25
0
/* {{{ spoofchecker_register_Spoofchecker_class
 * Initialize 'Spoofchecker' class
 */
void spoofchecker_register_Spoofchecker_class(void)
{
	zend_class_entry ce;

	/* Create and register 'Spoofchecker' class. */
	INIT_CLASS_ENTRY(ce, "Spoofchecker", Spoofchecker_class_functions);
	ce.create_object = Spoofchecker_object_create;
	Spoofchecker_ce_ptr = zend_register_internal_class(&ce);

	memcpy(&Spoofchecker_handlers, zend_get_std_object_handlers(),
		sizeof Spoofchecker_handlers);
	Spoofchecker_handlers.offset = XtOffsetOf(Spoofchecker_object, zo);
	Spoofchecker_handlers.clone_obj = spoofchecker_clone_obj; 
	Spoofchecker_handlers.dtor_obj = Spoofchecker_objects_dtor;
	Spoofchecker_handlers.free_obj = Spoofchecker_objects_free;

	if (!Spoofchecker_ce_ptr) {
		zend_error(E_ERROR,
			"Spoofchecker: attempt to create properties "
			"on a non-registered class.");
		return;
	}
}
Пример #26
0
/* {{{ dateformat_register_class
 * Initialize 'IntlDateFormatter' class
 */
void dateformat_register_IntlDateFormatter_class( void )
{
	zend_class_entry ce;

	/* Create and register 'IntlDateFormatter' class. */
	INIT_CLASS_ENTRY( ce, "IntlDateFormatter", IntlDateFormatter_class_functions );
	ce.create_object = IntlDateFormatter_object_create;
	IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce );

	memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(),
		sizeof IntlDateFormatter_handlers);
	IntlDateFormatter_handlers.offset = XtOffsetOf(IntlDateFormatter_object, zo);
	IntlDateFormatter_handlers.clone_obj = IntlDateFormatter_object_clone;
	IntlDateFormatter_handlers.dtor_obj = IntlDateFormatter_object_dtor;
	IntlDateFormatter_handlers.free_obj = IntlDateFormatter_object_free;

	/* Declare 'IntlDateFormatter' class properties. */
	if( !IntlDateFormatter_ce_ptr )
	{
		zend_error(E_ERROR, "Failed to register IntlDateFormatter class");
		return;
	}
}
Пример #27
0
void register_pair_handlers()
{
    memcpy(&pair_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));

    pair_handlers.offset = XtOffsetOf(Pair, std);

    pair_handlers.dtor_obj                = zend_objects_destroy_object;
    pair_handlers.free_obj                = pair_free_object;
    pair_handlers.clone_obj               = pair_clone_object;
    pair_handlers.cast_object             = ds_default_cast_object;
    pair_handlers.get_debug_info          = pair_get_debug_info;
    pair_handlers.count_elements          = pair_count_elements;

    pair_handlers.write_dimension         = pair_write_dimension;
    pair_handlers.read_dimension          = pair_read_dimension;
    pair_handlers.has_dimension           = pair_has_dimension;
    pair_handlers.unset_dimension         = pair_unset_dimension;

    pair_handlers.read_property           = pair_read_property;
    pair_handlers.write_property          = pair_write_property;
    pair_handlers.has_property            = pair_has_property;
    pair_handlers.unset_property          = pair_unset_property;
}
Пример #28
0
static void
XawVendorShellClassPartInit(WidgetClass cclass)
{
    CompositeClassExtension ext;
    VendorShellWidgetClass vsclass = (VendorShellWidgetClass)cclass;

    if ((ext = (CompositeClassExtension) 
	    XtGetClassExtension (cclass,
				 XtOffsetOf(CompositeClassRec, 
					    composite_class.extension),
				 NULLQUARK, 1L, (Cardinal) 0)) == NULL) {
	ext = (CompositeClassExtension) XtNew (CompositeClassExtensionRec);
	if (ext != NULL) {
	    ext->next_extension = vsclass->composite_class.extension;
	    ext->record_type = NULLQUARK;
	    ext->version = XtCompositeExtensionVersion;
	    ext->record_size = sizeof (CompositeClassExtensionRec);
	    ext->accepts_objects = TRUE;
	    ext->allows_change_managed_set = FALSE;
	    vsclass->composite_class.extension = (XtPointer) ext;
	}
    }
}
Пример #29
0
static PHP_MINIT_FUNCTION(tidy)
{
	tidySetMallocCall(php_tidy_malloc);
	tidySetReallocCall(php_tidy_realloc);
	tidySetFreeCall(php_tidy_free);
	tidySetPanicCall(php_tidy_panic);

	REGISTER_INI_ENTRIES();
	REGISTER_TIDY_CLASS(tidy, doc,	NULL, 0);
	REGISTER_TIDY_CLASS(tidyNode, node,	NULL, ZEND_ACC_FINAL);

	tidy_object_handlers_doc.cast_object = tidy_doc_cast_handler;
	tidy_object_handlers_node.cast_object = tidy_node_cast_handler;

	tidy_object_handlers_node.offset = tidy_object_handlers_doc.offset = XtOffsetOf(PHPTidyObj, std);
	tidy_object_handlers_node.free_obj = tidy_object_handlers_doc.free_obj = tidy_object_free_storage;

	_php_tidy_register_tags(INIT_FUNC_ARGS_PASSTHRU);
	_php_tidy_register_nodetypes(INIT_FUNC_ARGS_PASSTHRU);

	php_output_handler_alias_register(ZEND_STRL("ob_tidyhandler"), php_tidy_output_handler_init);

	return SUCCESS;
}
Пример #30
0
	return target;
}

static inline zval *php_ustring_zval_copy_ex(zval *target, php_ustring_t *source, int32_t offset, int32_t length)
{
	object_init_ex(target, ce_UString);

	php_ustring_copy_ex(php_ustring_fetch(target), source, offset, length);

	return target;
}

zend_object_handlers php_ustring_handlers;

static inline void _php_ustring_free(zend_object *zobject TSRMLS_DC) {
	php_ustring_t *ustring = (php_ustring_t*)((char*)(zobject) - XtOffsetOf(php_ustring_t, std));

	zend_object_std_dtor(&ustring->std TSRMLS_CC);

	if (ustring->codepage) {
	    STR_RELEASE(ustring->codepage);
	}

	delete ustring->val;
}

static inline zend_object* _php_ustring_create(zend_class_entry *ce TSRMLS_DC) {
	php_ustring_t *ustring =
		(php_ustring_t*) ecalloc(1, sizeof(php_ustring_t));

	zend_object_std_init(&ustring->std, ce TSRMLS_CC);