1
0
mirror of https://github.com/deuill/go-php.git synced 2024-09-21 08:50:45 +00:00
go-php/context/context.h
Alex Palaistras 7ed2c81ec6 Move NewContext function to engine package
Call order is now enforced when using the root `php` package by moving
the `NewContext` function in the `engine` package, as a method of the
`Engine` method receiver. Further clean-ups have been made to the code
as a result of this change.
2015-10-16 14:42:15 +01:00

24 lines
850 B
C

// Copyright 2015 Alexander Palaistras. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef CONTEXT_H
#define CONTEXT_H
typedef struct _engine_context {
#ifdef ZTS
void *ptsrm_ls; // Pointer to TSRM local storage.
#endif
void *parent; // Pointer to parent Go context, used for passing to callbacks.
int (*write)(struct _engine_context *context, const char *msg, unsigned int len);
} engine_context;
engine_context *context_new(void *parent);
void context_exec(engine_context *context, char *filename);
void context_eval(engine_context *context, char *script);
void context_bind(engine_context *context, char *name, void *zvalptr);
int context_write(engine_context *context, const char *str, unsigned int len);
void context_destroy(engine_context *context);
#endif