aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c/src/eventHandler.c
blob: 080117f97ea6cc9e8b148d517bd2e815ec3c7e9b (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * Copyright (C) 2004-2005 by Objective Systems, Inc.
 *
 * This software is furnished under an open source license and may be 
 * used and copied only in accordance with the terms of this license. 
 * The text of the license may generally be found in the root 
 * directory of this installation in the COPYING file.  It 
 * can also be viewed online at the following URL:
 *
 *   http://www.obj-sys.com/open/license.html
 *
 * Any redistributions of this file including modified versions must 
 * maintain this copyright notice.
 *
 *****************************************************************************/

#include <asterisk.h>
#include <asterisk/lock.h>

#include "eventHandler.h"

void setEventHandler (OOCTXT* pctxt, EventHandler* pHandler)
{
   pctxt->pEventHandler = pHandler;
}

void removeEventHandler (OOCTXT* pctxt)
{
   pctxt->pEventHandler = 0;
}

void invokeStartElement (OOCTXT* pctxt, const char* name, int index)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->startElement (name, index);
   }
}

void invokeEndElement (OOCTXT* pctxt, const char* name, int index)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->endElement (name, index);
   }
}

void invokeBoolValue (OOCTXT* pctxt, ASN1BOOL value)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->boolValue (value);
   }
}

void invokeIntValue (OOCTXT* pctxt, ASN1INT value)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->intValue (value);
   }
}

void invokeUIntValue (OOCTXT* pctxt, ASN1UINT value)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->uIntValue (value);
   }
}

void invokeBitStrValue (OOCTXT* pctxt, ASN1UINT numbits, 
                        const ASN1OCTET* data)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->bitStrValue (numbits, data);
   }
}

void invokeOctStrValue (OOCTXT* pctxt, ASN1UINT numocts, 
                        const ASN1OCTET* data)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->octStrValue (numocts, data);
   }
}

void invokeCharStrValue (OOCTXT* pctxt, const char* value)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->charStrValue (value);
   }
}

void invokeCharStr16BitValue (OOCTXT* pctxt, ASN1UINT nchars, 
                              ASN116BITCHAR* data)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->charStr16BitValue (nchars, data);
   }
}

void invokeNullValue (OOCTXT* pctxt)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->nullValue ();
   }
}

void invokeOidValue (OOCTXT* pctxt, ASN1UINT numSubIds, ASN1UINT* pSubIds)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->oidValue (numSubIds, pSubIds);
   }
}

void invokeEnumValue (OOCTXT* pctxt, ASN1UINT value)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->enumValue (value);
   }
}

void invokeOpenTypeValue (OOCTXT* pctxt, ASN1UINT numocts, 
                          const ASN1OCTET* data)
{
   if (0 != pctxt->pEventHandler) {
      pctxt->pEventHandler->openTypeValue (numocts, data);
   }
}