~ubuntu-branches/ubuntu/karmic/rsyslog/karmic-200908151517

« back to all changes in this revision

Viewing changes to vmprg.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2008-04-23 16:46:39 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080423164639-5acmt8a4vpxjgnxw
Tags: 3.14.2-3
* debian/rsyslog-doc.install
  - Fix a typo in the install path of the dia files. Closes: #477489
    Thanks to Justin B Rye for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The vmprg object.
 
2
 *
 
3
 * The program is made up of vmop_t's, one after another. When we support
 
4
 * branching (or user-defined functions) at some time, well do this via
 
5
 * special branch opcodes. They will then contain the actual memory
 
6
 * address of a logical program entry that we shall branch to. Other than
 
7
 * that, all execution is serial - that is one opcode is executed after
 
8
 * the other. This class implements a logical program store, modelled
 
9
 * after real main memory. A linked list of opcodes is used to implement it.
 
10
 * In the future, we may use linked lists of array's to enhance performance,
 
11
 * but for the time being we have taken the simplistic approach (which also
 
12
 * reduces risk of bugs during initial development). The necessary pointers
 
13
 * for this are already implemented in vmop. Though this is not the 100%
 
14
 * correct place, we have opted this time in favor of performance, which
 
15
 * made them go there.
 
16
 *
 
17
 * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
 
18
 *
 
19
 * This file is part of rsyslog.
 
20
 *
 
21
 * Rsyslog is free software: you can redistribute it and/or modify
 
22
 * it under the terms of the GNU General Public License as published by
 
23
 * the Free Software Foundation, either version 3 of the License, or
 
24
 * (at your option) any later version.
 
25
 *
 
26
 * Rsyslog is distributed in the hope that it will be useful,
 
27
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
28
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
29
 * GNU General Public License for more details.
 
30
 *
 
31
 * You should have received a copy of the GNU General Public License
 
32
 * along with Rsyslog.  If not, see <http://www.gnu.org/licenses/>.
 
33
 *
 
34
 * A copy of the GPL can be found in the file "COPYING" in this distribution.
 
35
 */
 
36
#ifndef INCLUDED_VMPRG_H
 
37
#define INCLUDED_VMPRG_H
 
38
 
 
39
#include "vmop.h"
 
40
 
 
41
 
 
42
/* the vmprg object */
 
43
typedef struct vmprg_s {
 
44
        BEGINobjInstance;       /* Data to implement generic object - MUST be the first data element! */
 
45
        vmop_t *vmopRoot;       /* start of program */
 
46
        vmop_t *vmopLast;       /* last vmop of program (for adding new ones) */
 
47
} vmprg_t;
 
48
 
 
49
 
 
50
/* interfaces */
 
51
BEGINinterface(vmprg) /* name must also be changed in ENDinterface macro! */
 
52
        INTERFACEObjDebugPrint(vmprg);
 
53
        rsRetVal (*Construct)(vmprg_t **ppThis);
 
54
        rsRetVal (*ConstructFinalize)(vmprg_t __attribute__((unused)) *pThis);
 
55
        rsRetVal (*Destruct)(vmprg_t **ppThis);
 
56
        rsRetVal (*AddOperation)(vmprg_t *pThis, vmop_t *pOp);
 
57
        rsRetVal (*AddVarOperation)(vmprg_t *pThis, opcode_t opcode, var_t *pVar);
 
58
ENDinterface(vmprg)
 
59
#define vmprgCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
 
60
 
 
61
 
 
62
/* prototypes */
 
63
PROTOTYPEObj(vmprg);
 
64
 
 
65
#endif /* #ifndef INCLUDED_VMPRG_H */