xref: /unit/src/nxt_service.h (revision 2084:7d479274f334)
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #ifndef _NXT_SERVICE_H_INCLUDED_
8 #define _NXT_SERVICE_H_INCLUDED_
9 
10 
11 typedef struct {
12     const char  *type;
13     const char  *name;
14     const void  *service;
15 } nxt_service_t;
16 
17 
18 #define nxt_service_is_module(s)                                              \
19     ((s)->type == NULL)
20 
21 
22 NXT_EXPORT nxt_array_t *nxt_services_init(nxt_mp_t *mp);
23 NXT_EXPORT nxt_int_t nxt_service_add(nxt_array_t *services,
24     const nxt_service_t *service);
25 NXT_EXPORT const void *nxt_service_get(nxt_array_t *services, const char *type,
26     const char *name);
27 
28 
29 #endif /* _NXT_SERVICE_H_INCLUDED_ */
30