tizen_2.0_build
[framework/system/libslp-sysman.git] / sysman-priv.h
1 /*
2  *  libslp-sysman
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: DongGi Jang <dg0402.jang@samsung.com>
7  * 
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20 */ 
21
22
23 #ifndef ___SYSNMAN_PRIVATE___
24 #define ___SYSNMAN_PRIVATE___
25
26 #include <stdio.h>
27 #include <stdlib.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define API __attribute__ ((visibility("default")))
34
35 #define __PRTD(fmt, arg...) \
36         do { \
37                 if (getenv("SLP_DEBUG")) { \
38                         fprintf(stdout, "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg); \
39                 } \
40         } while (0)
41 #define _NOUT(fmt, arg...) do { } while (0)
42
43 #ifdef SLP_DEBUG
44 #  define DBG _PRTD
45 #else
46 #  define DBG _NOUT
47 #endif
48
49 #define ENABLE_DLOG_OUT 1
50 #ifdef ENABLE_DLOG_OUT
51 #  define LOG_TAG       "LIBSYSMAN"
52 #  include <dlog.h>
53 #  define _PRTD SLOGD
54 #  define ERR   SLOGE
55 #  define INFO  SLOGI
56 #else
57 #  define _PRTD __PRTD
58 #  define ERR   perror
59 #  define INFO(fmt, arg...) \
60           do { fprintf(stdout, "[%s:%d] "fmt"\n", __FILE__, __LINE__, ##arg); } while (0)
61 #endif
62
63 #define SYSMAN_MAXARG 16
64 #define SYSMAN_MAXSTR 100
65 #define BUFF_MAX 255
66
67         struct sysnoti {
68                 int pid;
69                 int cmd;
70                 char *type;
71                 char *path;
72                 int argc;
73                 char *argv[SYSMAN_MAXARG];
74         };
75
76         int util_launch_app_cmd(const char *cmdline);
77
78 #ifdef __cplusplus
79 }
80 #endif
81 #endif                          /* ___SYSMAN_PRIVATE___ */