27fd907b7262276c15a6cac870f49c5b4b49c566
[platform/core/appfw/pkgmgr-server.git] / include / queue.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
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 _QUEUE_H_
19 #define _QUEUE_H_
20
21 #include <sys/types.h>
22
23 struct backend_job {
24         uid_t target_uid;
25         uid_t caller_uid;
26         int req_type;
27         char *req_id;
28         char *pkgid;
29         char *appid;
30         char *args;
31         int backend_slot;
32         char *backend_type;
33         char *backend_path;
34 };
35
36 int _is_queue_empty(int pos);
37 int _push_queue(uid_t target_uid, uid_t caller_uid, const char *req_id,
38                 int req_type, const char *queue_type, const char *pkgid,
39                 const char *args);
40 struct backend_job *_pop_queue(int pos);
41 void _free_backend_job(struct backend_job *job);
42 int _init_backend_queue(void);
43 void _fini_backend_queue(void);
44
45 #endif  // _QUEUE_H_