| 1 | package SPVM::Resource::Zlib; | ||
| 2 | |||
| 3 | 1 | our $VERSION = "1.010"; | |
| 4 | |||
| 5 | 1 | 1; | |
| 6 | |||
| 7 | =head1 Name | ||
| 8 | |||
| 9 | SPVM::Resource::Zlib - zlib Resources | ||
| 10 | |||
| 11 | =head1 Description | ||
| 12 | |||
| 13 | SPVM::Resource::Zlib class in L<SPVM> is a L<resource|SPVM::Document::Resource> class for L<zlib|https://github.com/madler/zlib> library. | ||
| 14 | |||
| 15 | =head1 Usage | ||
| 16 | |||
| 17 | MyClass.config: | ||
| 18 | |||
| 19 | my $config = SPVM::Builder::Config->new_c99; | ||
| 20 | |||
| 21 | $config->use_resource('Resource::Zlib'); | ||
| 22 | |||
| 23 | $config; | ||
| 24 | |||
| 25 | MyClass.c: | ||
| 26 | |||
| 27 | #include <zlib.h> | ||
| 28 | |||
| 29 | const char* file = "foo.gz"; | ||
| 30 | |||
| 31 | gzFile gz_fh = gzopen(file, "rb"); | ||
| 32 | |||
| 33 | =head1 Original Product | ||
| 34 | |||
| 35 | L<zlib|https://github.com/madler/zlib> | ||
| 36 | |||
| 37 | =head1 Original Product Version | ||
| 38 | |||
| 39 | L<zlib v1.3.1|https://github.com/madler/zlib/releases/tag/v1.3.1> | ||
| 40 | |||
| 41 | =head1 Language | ||
| 42 | |||
| 43 | The C language | ||
| 44 | |||
| 45 | =head1 Language Standard | ||
| 46 | |||
| 47 | C99 | ||
| 48 | |||
| 49 | =head1 Header Files | ||
| 50 | |||
| 51 | =over 2 | ||
| 52 | |||
| 53 | =item * C<spvm_socket_util.h> | ||
| 54 | |||
| 55 | =item * C<crc32.h> | ||
| 56 | |||
| 57 | =item * C<deflate.h> | ||
| 58 | |||
| 59 | =item * C<gzguts.h> | ||
| 60 | |||
| 61 | =item * C<inffast.h> | ||
| 62 | |||
| 63 | =item * C<inffixed.h> | ||
| 64 | |||
| 65 | =item * C<inflate.h> | ||
| 66 | |||
| 67 | =item * C<inftrees.h> | ||
| 68 | |||
| 69 | =item * C<trees.h> | ||
| 70 | |||
| 71 | =item * C<zconf.h> | ||
| 72 | |||
| 73 | =item * C<zlib.h> | ||
| 74 | |||
| 75 | =item * C<zutil.h> | ||
| 76 | |||
| 77 | =back | ||
| 78 | |||
| 79 | =head1 Source Files | ||
| 80 | |||
| 81 | =over 2 | ||
| 82 | |||
| 83 | =item * C<adler32.c> | ||
| 84 | |||
| 85 | =item * C<compress.c> | ||
| 86 | |||
| 87 | =item * C<crc32.c> | ||
| 88 | |||
| 89 | =item * C<deflate.c> | ||
| 90 | |||
| 91 | =item * C<gzclose.c> | ||
| 92 | |||
| 93 | =item * C<gzlib.c> | ||
| 94 | |||
| 95 | =item * C<gzread.c> | ||
| 96 | |||
| 97 | =item * C<gzwrite.c> | ||
| 98 | |||
| 99 | =item * C<infback.c> | ||
| 100 | |||
| 101 | =item * C<inffast.c> | ||
| 102 | |||
| 103 | =item * C<inflate.c> | ||
| 104 | |||
| 105 | =item * C<inftrees.c> | ||
| 106 | |||
| 107 | =item * C<trees.c> | ||
| 108 | |||
| 109 | =item * C<uncompr.c> | ||
| 110 | |||
| 111 | =item * C<zutil.c> | ||
| 112 | |||
| 113 | =back | ||
| 114 | |||
| 115 | =head1 Compiler Flags | ||
| 116 | |||
| 117 | =over 2 | ||
| 118 | |||
| 119 | =item * -D_LARGEFILE64_SOURCE | ||
| 120 | |||
| 121 | =item * -D_DEFAULT_SOURCE | ||
| 122 | |||
| 123 | =back | ||
| 124 | |||
| 125 | =head1 How to Create Resource | ||
| 126 | |||
| 127 | =head2 Download | ||
| 128 | |||
| 129 | mkdir -p .tmp | ||
| 130 | git clone https://github.com/madler/zlib .tmp/zlib | ||
| 131 | git -C .tmp/zlib checkout tags/v1.3.1 -b branch_v1.3.1 | ||
| 132 | git -C .tmp/zlib branch | ||
| 133 | |||
| 134 | =head2 Extracting Header Files | ||
| 135 | |||
| 136 | The header files of C<zlib> is copied into the C<include> directory by the following command. | ||
| 137 | |||
| 138 | rsync -av --include='*.h' --exclude='*' .tmp/zlib/ lib/SPVM/Resource/Zlib.native/include/ | ||
| 139 | |||
| 140 | =head2 Extracting Source Files | ||
| 141 | |||
| 142 | The source files of C<zlib> are copied into the C<src> directory by the following command. | ||
| 143 | |||
| 144 | rsync -av --exclude='*.h' .tmp/zlib/ lib/SPVM/Resource/Zlib.native/src/ | ||
| 145 | |||
| 146 | The used L<source files|/"Source Files"> are extracted by the following command. | ||
| 147 | |||
| 148 | find lib/SPVM/Resource/Zlib.native/src/* | perl -p -e 's|^\Qlib/SPVM/Resource/Zlib.native/src/||' | grep -P '^\w+\.c$' | ||
| 149 | |||
| 150 | =head1 Repository | ||
| 151 | |||
| 152 | L<SPVM::Resource::Zlib - Github|https://github.com/yuki-kimoto/SPVM-Resource-Zlib> | ||
| 153 | |||
| 154 | =head1 Author | ||
| 155 | |||
| 156 | Yuki Kimoto C<kimoto.yuki@gmail.com> | ||
| 157 | |||
| 158 | =head1 Copyright & License | ||
| 159 | |||
| 160 | Copyright (c) 2023 Yuki Kimoto | ||
| 161 | |||
| 162 | MIT License |