Add packaging/libslp-sysman.changes file
[platform/core/system/libslp-sysman.git] / sysman_managed.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 ___SYSMAN_MANAGED___
19 #define ___SYSMAN_MANAGED___
20
21 #include <sys/time.h>
22
23 /**
24  * @file        sysman_managed.h
25  * @ingroup     libsysman System Manager library
26  * @brief       This library provides APIs related with memory, performance, processes, and so on.
27  * @author      SLP2.0
28  * @date        2010-01-24
29  * @version     0.1
30  */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /**
37  * @fn int sysman_get_pid(const char *execpath)
38  * @brief This API is used to get the pid of the process which has the specified execpath.\n
39  *              Internally, this API searches /proc/{pid}/cmdline and compares the parameter execpath with 1st argument of cmdline. \n
40  *              If there is no process that has same execpath in /proc/{pid}/cmdline, it will return -1.
41  * @param[in] execpath program path which you want to know whether it is run or not
42  * @return pid when the program is running, -1 if it is not.
43  */
44         int sysman_get_pid(const char *execpath);
45
46 /**
47  * @fn int sysman_set_datetime(time_t timet)
48  * @brief This API is used to set date time.\n
49  *              Internally, this API call predefined action API. That is send a notify message. \n
50  * @param[in] time_t type of time which you want to set.
51  * @return pid when the program is running, -1 if param is less than 0 or when failed set datetime.
52  */
53         int sysman_set_datetime(time_t timet);
54
55 /**
56  * @brief This structure defines the data for receive result of mmc operations(mount/unmount/format)
57  */
58         struct mmc_contents {
59                 void (*mmc_cb) (int result, void* data);/**< user callback function for receive result of mmc operations */
60                 void* user_data;/**< input data for callback function's second-param(data) */
61         };
62
63 /**
64  * @fn int sysman_request_mount_mmc(struct mmc_contents *mmc_data)
65  * @brief This API is used to mount mmc.\n
66  *              Internally, this API call predefined action API. That is send a notify message. \n
67  *              and when mount operation is finished, cb of mmc_content struct is called with cb's param1(result). \n
68  *              means of param1 - 0(mount success) , -1(mount fail) , -2(already mounted)
69  * @param[in] mmc_data for receive result of mount operation
70  * @return  non-zero on success message sending, -1 if message sending is failed.
71  */
72         int sysman_request_mount_mmc(struct mmc_contents *mmc_data);
73
74 /**
75  * @fn int sysman_request_unmount_mmc(struct mmc_contents *mmc_data,int option)
76  * @brief This API is used to unmount mmc.\n
77  *              Internally, this API call predefined action API. That is send a notify message. \n
78  *              and when unmount opeation is finished, cb of mmc_content struct is called with cb's param1(result). \n
79  *              means of param1 - 0(unmount success) , -1(unmount fail)
80  * @param[in] mmc_data for receive result of unmount operation
81  * @param[in] option is must be 1(just only support for force unmount)
82  * @return  non-zero on success message sending, -1 if message sending is failed.
83  */
84         int sysman_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
85 /**
86  * @fn int sysman_request_format_mmc(struct mmc_contents *mmc_data)
87  * @brief This API is used to format mmc.\n
88  *              Internally, this API call predefined action API. That is send a notify message. \n
89  *              and when format opeation is finished, cb of mmc_content struct is called with cb's param1(result). \n
90  *              means of param1 - 0(format success) , -1(format fail)
91  * @param[in] mmc_data for receive result of format operation
92  * @return  non-zero on success message sending, -1 if message sending is failed.
93  */
94         int sysman_request_format_mmc(struct mmc_contents *mmc_data);
95
96 #ifdef __cplusplus
97 }
98 #endif
99 #endif /* ___SYSMAN_MANAGED___ */