python27-sys: compile.h

This commit is contained in:
Daniel Grunwald 2015-09-18 22:13:21 +02:00
parent d87a4596ef
commit a0cda1a66b
3 changed files with 38 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "python27-sys"
version = "0.1.0"
version = "0.1.1"
description = "FFI Declarations for Python 2.7"
readme = "README.md"
keywords = [
@ -20,7 +20,7 @@ exclude = [
]
[dependencies]
libc = "*"
libc = "0.1"
[build-dependencies]
pkg-config = "0.3.5"

View File

@ -0,0 +1,31 @@
use libc::{c_char, c_int};
use pythonrun::*;
use code::*;
use pyarena::PyArena;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PyFutureFeatures {
pub ff_features: c_int,
pub ff_lineno: c_int,
}
pub const FUTURE_NESTED_SCOPES : &'static str = "nested_scopes";
pub const FUTURE_GENERATORS : &'static str = "generators";
pub const FUTURE_DIVISION : &'static str = "division";
pub const FUTURE_ABSOLUTE_IMPORT : &'static str = "absolute_import";
pub const FUTURE_WITH_STATEMENT : &'static str = "with_statement";
pub const FUTURE_PRINT_FUNCTION : &'static str = "print_function";
pub const FUTURE_UNICODE_LITERALS : &'static str = "unicode_literals";
extern "C" {
pub fn PyNode_Compile(arg1: *mut Struct__node,
arg2: *const c_char) -> *mut PyCodeObject;
pub fn PyAST_Compile(arg1: *mut Struct__mod, arg2: *const c_char,
arg3: *mut PyCompilerFlags, arg4: *mut PyArena)
-> *mut PyCodeObject;
pub fn PyFuture_FromAST(arg1: *mut Struct__mod,
arg2: *const c_char)
-> *mut PyFutureFeatures;
}

View File

@ -50,6 +50,7 @@ pub use ceval::*;
pub use import::*;
pub use objectabstract::*;
pub use code::*;
pub use compile::*;
pub use eval::*;
pub use structmember::PyMemberDef;
@ -108,7 +109,7 @@ mod import;
mod objectabstract;
mod code;
// mod compile; // TODO: incomplete
mod compile;
mod eval;
// mod pyctype; // TODO: incomplete
@ -121,6 +122,9 @@ mod eval;
// Additional headers that are not exported by Python.h
pub mod structmember;
pub const Py_single_input: libc::c_int = 256;
pub const Py_file_input: libc::c_int = 257;
pub const Py_eval_input: libc::c_int = 258;
#[cfg(not(py_sys_config="Py_USING_UNICODE"))]
#[inline(always)]