~ubuntu-branches/ubuntu/lucid/rsyslog/lucid-updates

« back to all changes in this revision

Viewing changes to runtime/vmop.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-06-23 12:12:43 UTC
  • mfrom: (1.1.11 upstream) (3.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20090623121243-d2fejarzidywnn17
Tags: 4.2.0-1
* New upstream release of the now stable v4 branch.
  - Fix warnings when /etc/rsyslog.d/ is empty. Closes: #530228
* debian/patches/imudp_multiple_udp_sockets.patch
  - Removed, merged upstream.
* debian/rsyslog.default
  - Set default compat mode to '4'.
* debian/rsyslog.logcheck.ignore.server
  - Update logcheck rules files to also ignore rsyslogd and imklog stop
    messages.
* debian/control
  - Bump Standards-Version to 3.8.2. No further changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
/* destructor for the vmop object */
62
62
BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */
63
63
CODESTARTobjDestruct(vmop)
64
 
        if(   pThis->opcode == opcode_PUSHSYSVAR
65
 
           || pThis->opcode == opcode_PUSHMSGVAR
66
 
           || pThis->opcode == opcode_PUSHCONSTANT) {
67
 
                if(pThis->operand.pVar != NULL)
68
 
                        var.Destruct(&pThis->operand.pVar);
69
 
        }
 
64
        if(pThis->operand.pVar != NULL)
 
65
                var.Destruct(&pThis->operand.pVar);
70
66
ENDobjDestruct(vmop)
71
67
 
72
68
 
73
69
/* DebugPrint support for the vmop object */
74
70
BEGINobjDebugPrint(vmop) /* be sure to specify the object type also in END and CODESTART macros! */
75
71
        uchar *pOpcodeName;
 
72
        cstr_t *pStrVar;
76
73
CODESTARTobjDebugPrint(vmop)
77
74
        vmopOpcode2Str(pThis, &pOpcodeName);
78
 
        dbgoprint((obj_t*) pThis, "opcode: %d\t(%s), next %p, var in next line\n", (int) pThis->opcode, pOpcodeName,
79
 
                  pThis->pNext);
80
 
        if(pThis->operand.pVar != NULL)
81
 
                var.DebugPrint(pThis->operand.pVar);
 
75
        CHKiRet(rsCStrConstruct(&pStrVar));
 
76
        CHKiRet(rsCStrFinish(&pStrVar));
 
77
        if(pThis->operand.pVar != NULL) {
 
78
                CHKiRet(var.Obj2Str(pThis->operand.pVar, pStrVar));
 
79
        }
 
80
        dbgoprint((obj_t*) pThis, "%.12s\t%s\n", pOpcodeName, rsCStrGetSzStrNoNULL(pStrVar));
 
81
        rsCStrDestruct(&pStrVar);
 
82
finalize_it:
82
83
ENDobjDebugPrint(vmop)
83
84
 
84
85
 
158
159
                        *ppName = (uchar*) "and";
159
160
                        break;
160
161
                case opcode_PLUS:
161
 
                        *ppName = (uchar*) "+";
 
162
                        *ppName = (uchar*) "add";
162
163
                        break;
163
164
                case opcode_MINUS:
164
 
                        *ppName = (uchar*) "-";
 
165
                        *ppName = (uchar*) "sub";
165
166
                        break;
166
167
                case opcode_TIMES:
167
 
                        *ppName = (uchar*) "*";
 
168
                        *ppName = (uchar*) "mul";
168
169
                        break;
169
170
                case opcode_DIV:
170
 
                        *ppName = (uchar*) "/";
 
171
                        *ppName = (uchar*) "div";
171
172
                        break;
172
173
                case opcode_MOD:
173
 
                        *ppName = (uchar*) "%";
 
174
                        *ppName = (uchar*) "mod";
174
175
                        break;
175
176
                case opcode_NOT:
176
177
                        *ppName = (uchar*) "not";
177
178
                        break;
178
179
                case opcode_CMP_EQ:
179
 
                        *ppName = (uchar*) "==";
 
180
                        *ppName = (uchar*) "cmp_==";
180
181
                        break;
181
182
                case opcode_CMP_NEQ:
182
 
                        *ppName = (uchar*) "!=";
 
183
                        *ppName = (uchar*) "cmp_!=";
183
184
                        break;
184
185
                case opcode_CMP_LT:
185
 
                        *ppName = (uchar*) "<";
 
186
                        *ppName = (uchar*) "cmp_<";
186
187
                        break;
187
188
                case opcode_CMP_GT:
188
 
                        *ppName = (uchar*) ">";
 
189
                        *ppName = (uchar*) "cmp_>";
189
190
                        break;
190
191
                case opcode_CMP_LTEQ:
191
 
                        *ppName = (uchar*) "<=";
 
192
                        *ppName = (uchar*) "cmp_<=";
192
193
                        break;
193
194
                case opcode_CMP_CONTAINS:
194
195
                        *ppName = (uchar*) "contains";
197
198
                        *ppName = (uchar*) "startswith";
198
199
                        break;
199
200
                case opcode_CMP_GTEQ:
200
 
                        *ppName = (uchar*) ">=";
 
201
                        *ppName = (uchar*) "cmp_>=";
201
202
                        break;
202
203
                case opcode_PUSHSYSVAR:
203
 
                        *ppName = (uchar*) "PUSHSYSVAR";
 
204
                        *ppName = (uchar*) "push_sysvar";
204
205
                        break;
205
206
                case opcode_PUSHMSGVAR:
206
 
                        *ppName = (uchar*) "PUSHMSGVAR";
 
207
                        *ppName = (uchar*) "push_msgvar";
207
208
                        break;
208
209
                case opcode_PUSHCONSTANT:
209
 
                        *ppName = (uchar*) "PUSHCONSTANT";
 
210
                        *ppName = (uchar*) "push_const";
210
211
                        break;
211
212
                case opcode_POP:
212
 
                        *ppName = (uchar*) "POP";
 
213
                        *ppName = (uchar*) "pop";
213
214
                        break;
214
215
                case opcode_UNARY_MINUS:
215
 
                        *ppName = (uchar*) "UNARY_MINUS";
 
216
                        *ppName = (uchar*) "unary_minus";
216
217
                        break;
217
218
                case opcode_STRADD:
218
 
                        *ppName = (uchar*) "STRADD";
 
219
                        *ppName = (uchar*) "strconcat";
 
220
                        break;
 
221
                case opcode_FUNC_CALL:
 
222
                        *ppName = (uchar*) "func_call";
219
223
                        break;
220
224
                default:
221
 
                        *ppName = (uchar*) "INVALID opcode";
 
225
                        *ppName = (uchar*) "!invalid_opcode!";
222
226
                        break;
223
227
        }
224
228