1 /****************************************************************************
2  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
3  * Copyright (C) 2008-2013 Sourcefire, Inc.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License Version 2 as
7  * published by the Free Software Foundation.  You may not use, modify or
8  * distribute this program under any other version of the GNU General
9  * Public License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  *
20  ****************************************************************************/
21 #ifndef _SF_ACTION_QUEUE_
22 #define _SF_ACTION_QUEUE_
23 
24 #include "mempool.h"
25 
26 typedef struct
27 {
28     MemPool mempool;
29 
30 } tSfActionQueue;
31 
32 typedef tSfActionQueue* tSfActionQueueId;
33 
34 typedef struct _sfActionNode
35 {
36     void (*callback)(void *);
37     void  *data;
38 
39 } tSfActionNode;
40 
41 tSfActionQueueId sfActionQueueInit(
42         int queueLength
43         );
44 int sfActionQueueAdd(
45         tSfActionQueueId actionQ,
46         void (*callback)(void *),
47         void *data
48         );
49 void sfActionQueueExecAll(
50         tSfActionQueueId actionQ
51         );
52 void sfActionQueueExec(
53         tSfActionQueueId actionQ
54         );
55 void sfActionQueueDestroy(
56         tSfActionQueueId actionQ
57         );
58 
59 #endif
60