2 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef ___SYSMAN_MANAGED___
19 #define ___SYSMAN_MANAGED___
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.
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.
44 int sysman_get_pid(const char *execpath);
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.
53 int sysman_set_datetime(time_t timet);
56 * @brief This structure defines the data for receive result of mmc operations(mount/unmount/format)
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) */
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.
72 int sysman_request_mount_mmc(struct mmc_contents *mmc_data);
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.
84 int sysman_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
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.
94 int sysman_request_format_mmc(struct mmc_contents *mmc_data);
99 #endif /* ___SYSMAN_MANAGED___ */