mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 21:38:10 +00:00
Add omapi object initializer to object type structure.
This commit is contained in:
parent
c509341958
commit
c4403423ed
@ -125,6 +125,7 @@ typedef struct __omapi_object_type_t {
|
|||||||
isc_result_t (*allocator) (omapi_object_t **, const char *, int);
|
isc_result_t (*allocator) (omapi_object_t **, const char *, int);
|
||||||
isc_result_t (*sizer) (size_t);
|
isc_result_t (*sizer) (size_t);
|
||||||
size_t size;
|
size_t size;
|
||||||
|
isc_result_t (*initialize) (omapi_object_t *, const char *, int);
|
||||||
} omapi_object_type_t;
|
} omapi_object_type_t;
|
||||||
|
|
||||||
#define OMAPI_OBJECT_PREAMBLE \
|
#define OMAPI_OBJECT_PREAMBLE \
|
||||||
@ -418,7 +419,9 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **,
|
|||||||
const char *, int),
|
const char *, int),
|
||||||
isc_result_t (*) (omapi_object_t **,
|
isc_result_t (*) (omapi_object_t **,
|
||||||
const char *, int),
|
const char *, int),
|
||||||
isc_result_t (*) (size_t), size_t);
|
isc_result_t (*) (size_t), size_t,
|
||||||
|
isc_result_t (*) (omapi_object_t *,
|
||||||
|
const char *, int));
|
||||||
isc_result_t omapi_signal (omapi_object_t *, const char *, ...);
|
isc_result_t omapi_signal (omapi_object_t *, const char *, ...);
|
||||||
isc_result_t omapi_signal_in (omapi_object_t *, const char *, ...);
|
isc_result_t omapi_signal_in (omapi_object_t *, const char *, ...);
|
||||||
isc_result_t omapi_set_value (omapi_object_t *, omapi_object_t *,
|
isc_result_t omapi_set_value (omapi_object_t *, omapi_object_t *,
|
||||||
|
@ -75,7 +75,7 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_connection_stuff_values,
|
omapi_connection_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof
|
sizeof
|
||||||
(omapi_connection_object_t));
|
(omapi_connection_object_t), 0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -87,7 +87,8 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_listener_signal_handler,
|
omapi_listener_signal_handler,
|
||||||
omapi_listener_stuff_values,
|
omapi_listener_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_listener_object_t));
|
sizeof (omapi_listener_object_t),
|
||||||
|
0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_io_signal_handler,
|
omapi_io_signal_handler,
|
||||||
omapi_io_stuff_values,
|
omapi_io_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_io_object_t));
|
sizeof (omapi_io_object_t), 0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -111,7 +112,8 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_generic_signal_handler,
|
omapi_generic_signal_handler,
|
||||||
omapi_generic_stuff_values,
|
omapi_generic_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_generic_object_t));
|
sizeof (omapi_generic_object_t),
|
||||||
|
0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -123,7 +125,8 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_protocol_signal_handler,
|
omapi_protocol_signal_handler,
|
||||||
omapi_protocol_stuff_values,
|
omapi_protocol_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_protocol_object_t));
|
sizeof (omapi_protocol_object_t),
|
||||||
|
0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -135,7 +138,7 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_protocol_listener_signal,
|
omapi_protocol_listener_signal,
|
||||||
omapi_protocol_listener_stuff,
|
omapi_protocol_listener_stuff,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_protocol_listener_object_t)));
|
sizeof (omapi_protocol_listener_object_t), 0));
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -147,7 +150,8 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_message_signal_handler,
|
omapi_message_signal_handler,
|
||||||
omapi_message_stuff_values,
|
omapi_message_stuff_values,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_message_object_t));
|
sizeof (omapi_message_object_t),
|
||||||
|
0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -158,7 +162,8 @@ isc_result_t omapi_init (void)
|
|||||||
0,
|
0,
|
||||||
omapi_waiter_signal_handler, 0,
|
omapi_waiter_signal_handler, 0,
|
||||||
0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_waiter_object_t));
|
sizeof (omapi_waiter_object_t),
|
||||||
|
0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -171,7 +176,7 @@ isc_result_t omapi_init (void)
|
|||||||
omapi_auth_key_stuff_values,
|
omapi_auth_key_stuff_values,
|
||||||
omapi_auth_key_lookup,
|
omapi_auth_key_lookup,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
sizeof (omapi_auth_key_t));
|
sizeof (omapi_auth_key_t), 0);
|
||||||
if (status != ISC_R_SUCCESS)
|
if (status != ISC_R_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -218,7 +223,10 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **type,
|
|||||||
(omapi_object_t **,
|
(omapi_object_t **,
|
||||||
const char *, int),
|
const char *, int),
|
||||||
isc_result_t (*sizer) (size_t),
|
isc_result_t (*sizer) (size_t),
|
||||||
size_t size)
|
size_t size,
|
||||||
|
isc_result_t (*initialize)
|
||||||
|
(omapi_object_t *,
|
||||||
|
const char *, int))
|
||||||
{
|
{
|
||||||
omapi_object_type_t *t;
|
omapi_object_type_t *t;
|
||||||
|
|
||||||
@ -241,6 +249,7 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **type,
|
|||||||
t -> size = size;
|
t -> size = size;
|
||||||
t -> freer = freer;
|
t -> freer = freer;
|
||||||
t -> allocator = allocator;
|
t -> allocator = allocator;
|
||||||
|
t -> initialize = initialize;
|
||||||
omapi_object_types = t;
|
omapi_object_types = t;
|
||||||
if (type)
|
if (type)
|
||||||
*type = t;
|
*type = t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user