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