Name

SPVM::Resource::Libpng - The Resource of The libpng Library

Description

SPVM::Resource::Libpng is a resource of SPVM for the libpng library.

Usage

MyClass.config:

my $config = SPVM::Builder::Config->new_c99(file => __FILE__);

$config->use_resource('Resource::Zlib');
$config->use_resource('Resource::Libpng');

$config;

MyClass.c:

#include <png.h>

int32_t SPVM__MyClass__test(SPVM_ENV* env, SPVM_VALUE* stack) {
  
  png_colorp palette;
  
  return 0;
}

Original Product

libpng

Original Product Version

libpng v1.6.39

Language

The C language

Language Specification

C99

Required Resources

Header Files

  • pngconf.h

  • pngdebug.h

  • png.h

  • pnginfo.h

  • pnglibconf.h

  • pngpriv.h

  • pngstruct.h

Source Files

  • png.c

  • pngerror.c

  • pngget.c

  • pngmem.c

  • pngpread.c

  • pngread.c

  • pngrio.c

  • pngrtran.c

  • pngrutil.c

  • pngset.c

  • pngtest.c

  • pngtrans.c

  • pngwio.c

  • pngwrite.c

  • pngwtran.c

  • pngwutil.c

How to Create Resource

Donwload

mkdir -p original.tmp
git clone https://github.com/glennrp/libpng.git original.tmp/libpng
git -C original.tmp/libpng checkout tags/v1.6.39 -b branch_v1.6.39
git -C original.tmp/libpng branch

Extracting Header Files

The header files of libpng is copied into the include directory by the following command.

rsync -av --include='*.h' --exclude='*' original.tmp/libpng/ lib/SPVM/Resource/Libpng.native/include/

cp lib/SPVM/Resource/Libpng.native/src/scripts/pnglibconf.h.prebuilt lib/SPVM/Resource/Libpng.native/include/pnglibconf.h

Extracting Source Files

The source files of libpng are copied into the src directory by the following command.

rsync -av --exclude='*.h' original.tmp/libpng/ lib/SPVM/Resource/Libpng.native/src/

The used source files are extracted by the following command.

find lib/SPVM/Resource/Libpng.native/src/* | perl -p -e 's|^\Qlib/SPVM/Resource/Libpng.native/src/||' | grep -P '^\w+\.c$' | grep -v -P '^example\.c'

Repository

SPVM::Resource::Libpng - Github

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License