Sha256: a111662e29598e53d722cf86610eb6b859ffe89504d3a1843b2853cc7e4b7640

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

require 'ffi'

module FFI
  module CPL
    class List < ::FFI::Struct
      layout :data, :pointer,
        :next, List.ptr

      module ListFunctions
        def self.included(base)
          base.extend(ClassMethods)
        end

        module ClassMethods
          extend ::FFI::Library
          ffi_lib [FFI::CURRENT_PROCESS, FFI::GDAL.gdal_library_path]

          #-------------------------------------------------------------------
          # Functions
          #-------------------------------------------------------------------
          attach_function :CPLListAppend, [List.ptr, :pointer], List.ptr
          attach_function :CPLListInsert, [List.ptr, :pointer, :int], List.ptr
          attach_function :CPLListGetLast, [List.ptr], List.ptr
          attach_function :CPLListGet, [List.ptr, :int], List.ptr
          attach_function :CPLListCount, [List.ptr], :int

          attach_function :CPLListRemove, [List.ptr, :int], List.ptr
          attach_function :CPLListDestroy, [List.ptr], :void

          attach_function :CPLListGetNext, [List.ptr], List.ptr
          attach_function :CPLListGetData, [List.ptr], :pointer
        end
      end

      include ListFunctions
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta15 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta14 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta13 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta12 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta11 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta10 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta9 lib/ffi/cpl/list.rb
ffi-gdal-1.0.0.beta8 lib/ffi/cpl/list.rb