summaryrefslogtreecommitdiffstats
path: root/server/parser/parsethread.h
blob: 66e8524617bcf67fb20d555c4f13cb2d922b79c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Copyright (C) 2009 Red Hat Inc.
 *
 * This application is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; version 2.
 *
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

/**
 * @file   parsethread.h
 * @author David Sommerseth <davids@redhat.com>
 * @date   Thu Oct 15 11:52:10 2009
 *
 * @brief  Contains the "main" function which a parser threads runs
 *
 */

#ifndef _PARSETHREAD_H
#define _PARSETHREAD_H

/**
 * jbNONE means no job available,
 * jbAVAIL indicates that parseJob_t contains a job
*/
typedef enum { jbNONE, jbAVAIL } jobStatus;

/**
 * This struct is used for sending a parse job to a worker thread via POSIX MQ
 */
typedef struct {
        jobStatus status;                  /**< Info about if job information*/
        unsigned int submid;               /**< Work info: Numeric ID of the job being parsed */
        char clientid[256];                /**< Work info: Should contain senders hostname */
        char filename[4096];               /**< Work info: Full filename of the report to be parsed */
} parseJob_t;


void *parsethread(void *thrargs);

#endif