File Coverage

lib/SPVM/Builder/src/spvm_api_class_file.c
Criterion Covered Total %
statement 14 35 40.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 14 35 40.0


line stmt bran cond sub pod time code
1             // Copyright (c) 2023 Yuki Kimoto
2             // MIT License
3              
4             #include
5             #include
6             #include
7             #include
8              
9             #include "spvm_native.h"
10              
11             #include "spvm_api_class_file.h"
12             #include "spvm_compiler.h"
13             #include "spvm_string.h"
14             #include "spvm_class_file.h"
15             #include "spvm_class_file.h"
16              
17 119269           SPVM_API_CLASS_FILE* SPVM_API_CLASS_FILE_new_api(void) {
18 119269           void* env_compiler_init[] = {
19             SPVM_API_CLASS_FILE_get_class_name,
20             SPVM_API_CLASS_FILE_get_file,
21             SPVM_API_CLASS_FILE_set_file,
22             SPVM_API_CLASS_FILE_get_dir,
23             SPVM_API_CLASS_FILE_set_dir,
24             SPVM_API_CLASS_FILE_get_rel_file,
25             SPVM_API_CLASS_FILE_set_rel_file,
26             SPVM_API_CLASS_FILE_get_content,
27             SPVM_API_CLASS_FILE_set_content,
28             SPVM_API_CLASS_FILE_get_content_length,
29             SPVM_API_CLASS_FILE_set_content_length,
30             };
31 119269           SPVM_API_CLASS_FILE* env_compiler = calloc(1, sizeof(env_compiler_init));
32 119269           memcpy(env_compiler, env_compiler_init, sizeof(env_compiler_init));
33            
34 119269           return env_compiler;
35             }
36              
37 119269           void SPVM_API_CLASS_FILE_free_api(SPVM_API_CLASS_FILE* api) {
38 119269           free(api);
39 119269           }
40              
41 0           const char* SPVM_API_CLASS_FILE_get_class_name(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
42 0           return SPVM_CLASS_FILE_get_class_name(compiler, class_file);
43             }
44              
45 0           const char* SPVM_API_CLASS_FILE_get_file(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
46 0           return SPVM_CLASS_FILE_get_file(compiler, class_file);
47             }
48              
49 0           void SPVM_API_CLASS_FILE_set_file(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file, const char* file) {
50 0           SPVM_CLASS_FILE_set_file(compiler, class_file, file);
51 0           }
52              
53 0           const char* SPVM_API_CLASS_FILE_get_dir(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
54 0           return SPVM_CLASS_FILE_get_dir(compiler, class_file);
55             }
56              
57 0           void SPVM_API_CLASS_FILE_set_dir(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file, const char* dir) {
58 0           SPVM_CLASS_FILE_set_dir(compiler, class_file, dir);
59 0           }
60              
61 99           const char* SPVM_API_CLASS_FILE_get_rel_file(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
62 99           return SPVM_CLASS_FILE_get_rel_file(compiler, class_file);
63             }
64              
65 0           void SPVM_API_CLASS_FILE_set_rel_file(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file, const char* rel_file) {
66 0           SPVM_CLASS_FILE_set_rel_file(compiler, class_file, rel_file);
67 0           }
68              
69 99           const char* SPVM_API_CLASS_FILE_get_content(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
70 99           return SPVM_CLASS_FILE_get_content(compiler, class_file);
71             }
72              
73 0           void SPVM_API_CLASS_FILE_set_content(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file, const char* content) {
74 0           SPVM_CLASS_FILE_set_content(compiler, class_file, content);
75 0           }
76              
77 99           int32_t SPVM_API_CLASS_FILE_get_content_length(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file) {
78 99           return SPVM_CLASS_FILE_get_content_length(compiler, class_file);
79             }
80              
81 0           void SPVM_API_CLASS_FILE_set_content_length(SPVM_COMPILER* compiler, SPVM_CLASS_FILE* class_file, int32_t content_length) {
82 0           SPVM_CLASS_FILE_set_content_length(compiler, class_file, content_length);
83 0           }
84