aboutsummaryrefslogtreecommitdiff
path: root/MultiSource/Applications/hbd/sig.h
blob: d479fa4db474698eb6cef9ab107057d4b2e7d396 (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
/* sig.h */
/*
   Java Decompiler 
   Copyright (c) 1994-2003, Pete Ryland.
   Distributed under the GNU GPL Version 2.
   This package is available from http://pdr.cx/hbd/
*/

#ifndef SIG_H
#define SIG_H

#include <stdio.h>

/* The Java types */
typedef enum {
  VOID, BYTE, CHAR, SHORT,
  INT, LONG, FLOAT, DOUBLE,
  OBJECT, ARRAY, BOOLEAN, FUNC,
  CMPTYPE, /* -1, 0, or 1 */
  UNKNOWN, UNKNOWN_1, UNKNOWN_4,
  UNKNOWN_8
} Type;

/* This converts a signature string to a type */
Type sig2type(char* sig);

/* This contains string representations of the types */
extern char *type2str[];

/* These defines are used for converting sigs */
#define SIGNATURE_ANY           'A'
#define SIGNATURE_ARRAY         '['
#define SIGNATURE_BYTE          'B'
#define SIGNATURE_CHAR          'C'
#define SIGNATURE_CLASS         'L'
#define SIGNATURE_ENDCLASS      ';'
#define SIGNATURE_ENUM          'E'
#define SIGNATURE_FLOAT         'F'
#define SIGNATURE_DOUBLE        'D'
#define SIGNATURE_FUNC          '('
#define SIGNATURE_ENDFUNC       ')'
#define SIGNATURE_INT           'I'
#define SIGNATURE_LONG          'J'
#define SIGNATURE_SHORT         'S'
#define SIGNATURE_VOID          'V'
#define SIGNATURE_BOOLEAN       'Z'

#define SIGNATURE_ANY_STRING            "A"
#define SIGNATURE_ARRAY_STRING          "["
#define SIGNATURE_BYTE_STRING           "B"
#define SIGNATURE_CHAR_STRING           "C"
#define SIGNATURE_CLASS_STRING          "L"
#define SIGNATURE_ENDCLASS_STRING       ";"
#define SIGNATURE_ENUM_STRING           "E"
#define SIGNATURE_FLOAT_STRING          "F"
#define SIGNATURE_DOUBLE_STRING         "D"
#define SIGNATURE_FUNC_STRING           "("
#define SIGNATURE_ENDFUNC_STRING        ")"
#define SIGNATURE_INT_STRING            "I"
#define SIGNATURE_LONG_STRING           "J"
#define SIGNATURE_SHORT_STRING          "S"
#define SIGNATURE_VOID_STRING           "V"
#define SIGNATURE_BOOLEAN_STRING        "Z"

/* Forward declaration */
struct Classfile;

/* This prints the method name with return type
   and parameters in the format used in Java source files */
int printsigname(Classfile *c, FILE *outfile,
                 char *&sig, char *name, void *mi);

#endif