Fix to disable/enable multiple packages
[platform/core/appfw/pkgmgr-server.git] / include / pm-queue.h
1 /*
2  * slp-pkgmgr
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23
24
25
26
27 #ifndef _PM_QUEUE_H_
28 #define _PM_QUEUE_H_
29
30 #include "pkgmgr-server.h"
31
32 typedef struct _pm_queue_data {
33         pm_dbus_msg *msg;
34         struct _pm_queue_data *next;
35 } pm_queue_data;
36
37 typedef struct queue_info_map_t {
38         char pkgtype[MAX_PKG_TYPE_LEN];
39         char backend[MAX_PKG_NAME_LEN];
40         int queue_slot;
41         pm_queue_data *head;
42 } queue_info_map;
43
44 #define MAX_QUEUE_NUM 128
45
46 int _pm_queue_init(void);
47 int _pm_queue_push(uid_t uid, const char *req_id, int req_type,
48                 const char *queue_type, const char *pkgid, const char *argv);
49 /*position specifies the queue from which to pop request*/
50 pm_dbus_msg *_pm_queue_pop(int position);
51 void _pm_queue_final();
52 void _pm_queue_delete(pm_dbus_msg *item);
53 pm_queue_data *_add_node();
54 void _print_queue(int position);
55
56 #endif                          /* _PM_QUEUE_H_ */