bc39dadc1eb0bf310952376df148bc568bcf018d
[platform/core/appfw/slp-pkgmgr.git] / server / 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 #define STATUS_FILE     "/etc/package-manager/server/queue_status"
33 /* #define STATUS_FILE   "./queue_status" */
34
35 typedef struct _pm_queue_data {
36         pm_dbus_msg *msg;
37         struct _pm_queue_data *next;
38 } pm_queue_data;
39
40 typedef struct queue_info_map_t {
41         char pkgtype[MAX_PKG_TYPE_LEN];
42         char backend[MAX_PKG_NAME_LEN];
43         int queue_slot;
44         pm_queue_data *head;
45 } queue_info_map;
46
47 #define MAX_QUEUE_NUM 128
48
49 int _pm_queue_init();
50 int _pm_queue_push(pm_dbus_msg *item);
51 /*position specifies the queue from which to pop request*/
52 pm_dbus_msg *_pm_queue_pop(int position);
53 void _pm_queue_final();
54 void _pm_queue_delete(pm_dbus_msg *item);
55 pm_queue_data *_add_node();
56 void _save_queue_status(pm_dbus_msg *item, char *status);
57 void _print_queue(int position);
58
59 #endif                          /* _PM_QUEUE_H_ */