|
JVM
|
#include <stdio.h>#include <stdint.h>#include "constantpool.h"#include "attributes.h"#include "fields.h"#include "methods.h"

Go to the source code of this file.
Classes | |
| struct | JavaClass |
Typedefs | |
| typedef struct JavaClass | JavaClass |
Functions | |
| void | openClassFile (JavaClass *jc, const char *path) |
| Opens a class file and parse it, storing the class information in the JavaClass structure. More... | |
| void | closeClassFile (JavaClass *jc) |
| Closes the .class file and releases resources used by the JavaClass struct. More... | |
| const char * | decodeJavaClassStatus (enum JavaClassStatus) |
| Decodes JavaClassStatus enumeration elements. More... | |
| void | decodeAccessFlags (uint16_t flags, char *buffer, int32_t buffer_len, enum AccessFlagsType acctype) |
| Given flags of a certain method/field/class, this class will convert the bits to a string telling which flags are set to 1, writing the result in the output buffer. More... | |
| void | printClassFileDebugInfo (JavaClass *jc) |
| void | printClassFileInfo (JavaClass *jc) |
| enum AccessFlags |
| enum AccessFlagsType |
| enum JavaClassStatus |
| void closeClassFile | ( | JavaClass * | jc | ) |
Closes the .class file and releases resources used by the JavaClass struct.
| JavaClass* | jc - pointer to the class to be closed. |


| void decodeAccessFlags | ( | uint16_t | flags, |
| char * | buffer, | ||
| int32_t | buffer_len, | ||
| enum AccessFlagsType | acctype | ||
| ) |
Given flags of a certain method/field/class, this class will convert the bits to a string telling which flags are set to 1, writing the result in the output buffer.
| uint16_t | flags - the flags of the method/field/class | |
| [out] | char* | buffer - pointer to where the string will be stored |
| int32_t | buffer_len - length of the buffer | |
| enum | AccessFlagsType acctype - type of access flags, telling if it is a class, a method or a field. |
This method will write at most buffer_len characters to the output buffer. Depending on parameter acctype, meaning for some bits might change.


| const char* decodeJavaClassStatus | ( | enum JavaClassStatus | status | ) |
Decodes JavaClassStatus enumeration elements.
| enum | JavaClassStatus status - identifier of the enumeration to be translated. |

| void openClassFile | ( | JavaClass * | jc, |
| const char * | path | ||
| ) |
Opens a class file and parse it, storing the class information in the JavaClass structure.
| JavaClass* | jc - pointer to the structure that will hold the class data |
| const | char* path - string containing the path to the class file to be read |
This function opens the .class file and reads its content from the file by filling in the fields of the JavaClass struct. A bunch of other functions from different modules are called to read some pieces of the class file. Various checks are made during the parsing of the read data.


| void printClassFileDebugInfo | ( | JavaClass * | jc | ) |

| void printClassFileInfo | ( | JavaClass * | jc | ) |
