blob: 892e80dca4390fd441c82a101dfd3f3d030dcf72 [file] [log] [blame]
Mark Salyzyn018a96d2016-03-01 13:45:42 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _LIBLOG_CONFIG_READ_H__
18#define _LIBLOG_CONFIG_READ_H__
19
20#include <cutils/list.h>
21
22#include "log_portability.h"
23
24__BEGIN_DECLS
25
26extern LIBLOG_HIDDEN struct listnode __android_log_transport_read;
27extern LIBLOG_HIDDEN struct listnode __android_log_persist_read;
28
29#define read_transport_for_each(transp, transports) \
Chih-Hung Hsiehf0f94fe2016-05-18 15:47:19 -070030 for ((transp) = node_to_item((transports)->next, \
Mark Salyzyn96432fc2016-03-08 16:18:26 -080031 struct android_log_transport_read, node); \
32 ((transp) != node_to_item((transports), \
33 struct android_log_transport_read, \
34 node)) && \
35 ((transp) != node_to_item((transp)->node.next, \
36 struct android_log_transport_read, \
37 node)); \
Chih-Hung Hsiehf0f94fe2016-05-18 15:47:19 -070038 (transp) = node_to_item((transp)->node.next, \
Mark Salyzyn96432fc2016-03-08 16:18:26 -080039 struct android_log_transport_read, node))
Mark Salyzyn018a96d2016-03-01 13:45:42 -080040
41#define read_transport_for_each_safe(transp, n, transports) \
Chih-Hung Hsiehf0f94fe2016-05-18 15:47:19 -070042 for ((transp) = node_to_item((transports)->next, \
Mark Salyzyn96432fc2016-03-08 16:18:26 -080043 struct android_log_transport_read, node), \
Chih-Hung Hsiehf0f94fe2016-05-18 15:47:19 -070044 (n) = (transp)->node.next; \
Mark Salyzyn96432fc2016-03-08 16:18:26 -080045 ((transp) != node_to_item((transports), \
46 struct android_log_transport_read, \
47 node)) && \
48 ((transp) != node_to_item((n), struct android_log_transport_read, \
49 node)); \
50 (transp) = node_to_item((n), struct android_log_transport_read, \
51 node), \
Chih-Hung Hsiehf0f94fe2016-05-18 15:47:19 -070052 (n) = (transp)->node.next)
Mark Salyzyn018a96d2016-03-01 13:45:42 -080053
54LIBLOG_HIDDEN void __android_log_config_read();
Mark Salyzyn96432fc2016-03-08 16:18:26 -080055LIBLOG_HIDDEN void __android_log_config_read_close();
Mark Salyzyn018a96d2016-03-01 13:45:42 -080056
57__END_DECLS
58
59#endif /* _LIBLOG_CONFIG_READ_H__ */