File: type_desc.h

package info (click to toggle)
clamav 0.98.7+dfsg-0+deb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 60,204 kB
  • ctags: 49,129
  • sloc: cpp: 267,090; ansic: 152,211; sh: 35,196; python: 2,630; makefile: 2,220; perl: 1,690; pascal: 1,218; lisp: 184; csh: 117; xml: 38; asm: 32; exp: 4
file content (94 lines) | stat: -rw-r--r-- 3,041 bytes parent folder | download | duplicates (3)
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
/*
 *  ClamAV bytecode internal API
 *
 *  Copyright (C) 2009 Sourcefire, Inc.
 *
 *  Authors: Török Edvin
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program 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.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *  MA 02110-1301, USA.
 */
#ifndef TYPE_DESC_H
#define TYPE_DESC_H

#include "clambc.h"
struct cli_bc_ctx;

enum derived_t {
  DFunctionType,
  DPointerType,
  DStructType,
  DPackedStructType,
  DArrayType
};

struct cli_bc_type {
    enum derived_t kind;
    uint16_t *containedTypes;
    unsigned numElements;
    uint32_t size;
    unsigned align;
};

typedef uint32_t (*cli_apicall_int2)(struct cli_bc_ctx *, uint32_t, uint32_t);
typedef uint32_t (*cli_apicall_pointer)(struct cli_bc_ctx *, void*, uint32_t);
typedef uint32_t (*cli_apicall_int1)(struct cli_bc_ctx *, uint32_t);
typedef void* (*cli_apicall_malloclike)(struct cli_bc_ctx *, uint32_t);
typedef int32_t (*cli_apicall_ptrbuffdata)(struct cli_bc_ctx *, void*, uint32_t, uint32_t, uint32_t, uint32_t);
typedef int32_t (*cli_apicall_allocobj)(struct cli_bc_ctx *);
typedef void* (*cli_apicall_bufget)(struct cli_bc_ctx *, int32_t, uint32_t);
typedef int32_t (*cli_apicall_int3)(struct cli_bc_ctx *, int32_t, int32_t, int32_t);
typedef int32_t (*cli_apicall_2bufs)(struct cli_bc_ctx *, void*, int32_t, void*, int32_t);
typedef int32_t (*cli_apicall_ptrbufid)(struct cli_bc_ctx *, void*, int32_t, int32_t);

struct cli_apicall {
    const char *name;
    uint16_t type;/* type id in cli_apicall_types array */
    uint16_t idx;
    uint8_t kind;
};

struct cli_apiglobal {
    const char *name;
    enum bc_global globalid;
    uint16_t type;
    unsigned offset;
};

#ifdef __cplusplus
extern "C" {
#endif
extern const struct cli_bc_type cli_apicall_types[];
extern const unsigned cli_apicall_maxtypes;

extern const struct cli_apiglobal cli_globals[];

extern const struct cli_apicall cli_apicalls[];
extern const cli_apicall_int2 cli_apicalls0[];
extern const cli_apicall_pointer cli_apicalls1[];
extern const cli_apicall_int1 cli_apicalls2[];
extern const cli_apicall_malloclike cli_apicalls3[];
extern const cli_apicall_ptrbuffdata cli_apicalls4[];
extern const cli_apicall_allocobj cli_apicalls5[];
extern const cli_apicall_bufget cli_apicalls6[];
extern const cli_apicall_int3 cli_apicalls7[];
extern const cli_apicall_2bufs cli_apicalls8[];
extern const cli_apicall_ptrbufid cli_apicalls9[];
extern const unsigned cli_apicall_maxapi;
extern const unsigned cli_apicall_maxglobal;

#ifdef __cplusplus
}
#endif
#endif