Add packaging/libslp-sysman.changes file
[platform/core/system/libslp-sysman.git] / sysman-priv.h
1 /*
2  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
18 #ifndef ___SYSNMAN_PRIVATE___
19 #define ___SYSNMAN_PRIVATE___
20
21 #include <stdio.h>
22 #include <stdlib.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define API __attribute__ ((visibility("default")))
29
30 #define __PRTD(fmt, arg...) \
31         do { \
32                 if (getenv("SLP_DEBUG")) { \
33                         fprintf(stdout, "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg); \
34                 } \
35         } while (0)
36 #define _NOUT(fmt, arg...) do { } while (0)
37
38 #ifdef SLP_DEBUG
39 #  define DBG _PRTD
40 #else
41 #  define DBG _NOUT
42 #endif
43
44 #define ENABLE_DLOG_OUT 1
45 #ifdef ENABLE_DLOG_OUT
46 #  define LOG_TAG       "LIBSYSMAN"
47 #  include <dlog.h>
48 #  define _PRTD SLOGD
49 #  define ERR   SLOGE
50 #  define INFO  SLOGI
51 #else
52 #  define _PRTD __PRTD
53 #  define ERR   perror
54 #  define INFO(fmt, arg...) \
55           do { fprintf(stdout, "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg); } while (0)
56 #endif
57
58 #define SYSMAN_MAXARG 16
59 #define SYSMAN_MAXSTR 100
60 #define BUFF_MAX 255
61
62         struct sysnoti {
63                 int pid;
64                 int cmd;
65                 char *type;
66                 char *path;
67                 int argc;
68                 char *argv[SYSMAN_MAXARG];
69         };
70
71         int util_launch_app_cmd(const char *cmdline);
72
73 #ifdef __cplusplus
74 }
75 #endif
76 #endif                          /* ___SYSMAN_PRIVATE___ */