Skip to content

Commit

Permalink
Move files to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
jbboehr committed Feb 6, 2024
1 parent 3853265 commit d24bd99
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
21 changes: 12 additions & 9 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
# vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab

# args
PHP_ARG_ENABLE(vyrtue, whether to enable vyrtue support,
[ --enable-vyrtue Enable vyrtue support])
PHP_ARG_ENABLE(vyrtue, whether to enable vyrtue support,
[ --enable-vyrtue Enable vyrtue support])

PHP_ARG_ENABLE(vyrtue-debug, whether to enable vyrtue debug support,
[ --enable-vyrtue-debug Enable vyrtue debug support])

AC_DEFUN([PHP_VYRTUE_ADD_SOURCES], [
PHP_VYRTUE_SOURCES="$PHP_VYRTUE_SOURCES $1"
])

# main
if test "$PHP_VYRTUE" != "no"; then
# compilers
AC_PROG_CC_STDC
AC_PROG_CC_C99

AC_MSG_CHECKING([if compiling with gcc])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
Expand All @@ -35,14 +34,18 @@ if test "$PHP_VYRTUE" != "no"; then
[CLANG=yes], [CLANG=no])
AC_MSG_RESULT([$CLANG])

# programs
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

if test "$PHP_VYRTUE_DEBUG" == "yes"; then
AC_DEFINE([VYRTUE_DEBUG], [1], [Enable vyrtue debug support])
fi

PHP_VYRTUE_ADD_SOURCES([
php_vyrtue.c
src/extension.c
src/preprocess.c
])

#PHP_ADD_BUILD_DIR(src)
PHP_ADD_BUILD_DIR(src)
PHP_INSTALL_HEADERS([ext/vyrtue], [php_vyrtue.h])
PHP_NEW_EXTENSION(vyrtue, $PHP_VYRTUE_SOURCES, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_EXTENSION_DEP(vyrtue, ast, true)
Expand Down
14 changes: 7 additions & 7 deletions php_vyrtue.c → src/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@
#include "config.h"
#endif

#include <stdio.h>
#include <string.h>

#include "Zend/zend_API.h"
#include "Zend/zend_constants.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_ini.h"
#include "Zend/zend_modules.h"
#include "Zend/zend_operators.h"
#include "main/php.h"
#include "main/php_ini.h"
#include "main/SAPI.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"

#include "php_vyrtue.h"

ZEND_DECLARE_MODULE_GLOBALS(vyrtue);

static void (*original_ast_process)(zend_ast *ast) = NULL;

// void vyrtue_ast_process_file(zend_ast *ast);
void vyrtue_ast_process_file(zend_ast *ast);

PHP_INI_BEGIN()
PHP_INI_END()
Expand All @@ -35,7 +31,7 @@ VYRTUE_PUBLIC zend_never_inline void vyrtue_ast_process(zend_ast *ast)
original_ast_process(ast);
}

// vyrtue_ast_process_file(ast);
vyrtue_ast_process_file(ast);
}

static PHP_RINIT_FUNCTION(vyrtue)
Expand Down Expand Up @@ -89,7 +85,11 @@ static PHP_GINIT_FUNCTION(vyrtue)
memset(vyrtue_globals, 0, sizeof(zend_vyrtue_globals));
}

const zend_function_entry vyrtue_functions[] = {PHP_FE_END};
const zend_function_entry vyrtue_functions[] = {
#ifdef VYRTUE_DEBUG
#endif
PHP_FE_END,
};

static const zend_module_dep vyrtue_deps[] = {
{"ast", NULL, NULL, MODULE_DEP_OPTIONAL},
Expand Down
18 changes: 18 additions & 0 deletions src/preprocess.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <string.h>

#include "Zend/zend_API.h"
#include "Zend/zend_exceptions.h"
#include "main/php.h"
#include "main/php_streams.h"
#include "ext/standard/php_string.h"
#include "php_vyrtue.h"

VYRTUE_PUBLIC void vyrtue_ast_process_file(zend_ast *ast)
{
// todo
}

0 comments on commit d24bd99

Please sign in to comment.