Skip to content

workbunny/ffi-ide-helper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFI Ide Helper

This package provides an extended autocomplete for PHP FFI in a PhpStorm IDE.

Features

Autocomplete by built-in C/C++ types

Automatic type inference

Type inference from pointers

Distinguishes pointers from values

Custom auto-complete by structures


And maybe something else... Offer as PR =))

Pointers Generator

  1. Create Configuration (like ffi-gen-config.php)
// Example C/C++ header declaration:
//
// typedef struct MyExampleStruct { ... } MyExampleStruct;
// extern void foo(MyExampleStruct* a);
// extern void foo(MyExampleStruct** b);
// 

return [
    'out'   => __DIR__ . '/resources/stubs',
    'types' => [
        'MyExampleStruct' => ['pointers' => 2],
    //  ^^^^^^^^^^^^^^^^                   ^ - Number of pointers.
    //  Your Class Name                        Number 2 means that will be created
    //                                         "MyExampleStructPtr" and "MyExampleStructPtrPtr" pointers
    ],
];
  1. Generate
$ vendor/bin/ffi-generator.php ffi-gen-config.php

About

PHP FFI Helper for IDEA-based IDEs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%