5276ee618098b43531e5a6846a0ab6746989eaaf
[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 uid;
25         int req_type;
26         char *req_id;
27         char *pkgid;
28         char *appid;
29         char *args;
30         int backend_slot;
31         char *backend_type;
32         char *backend_path;
33 };
34
35 int _is_queue_empty(int pos);
36 int _push_queue(uid_t uid, const char *req_id, int req_type,
37                 const char *queue_type, const char *pkgid, const char *args);
38 struct backend_job *_pop_queue(int pos);
39 void _free_backend_job(struct backend_job *job);
40 int _init_backend_queue(void);
41 void _fini_backend_queue(void);
42
43 #endif  // _QUEUE_H_