Coccinelle release 1.0.0-rc4
[bpt/coccinelle.git] / pycaml / modif-orig.txt
1 --- a/pycaml_ml.c 2004-12-02 17:17:07.000000000 +0100
2 +++ b/pycaml_ml.c 2008-03-27 12:15:23.000000000 +0100
3 @@ -554,6 +554,7 @@
4 extern DL_IMPORT(PyObject *) PyObject_GetAttrString(PyObject *, char *);
5 /* 17 */
6 extern DL_IMPORT(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
7 +extern DL_IMPORT(PyObject *) PyObject_CallObject(PyObject *, PyObject *);
8 /* 18 */
9 extern DL_IMPORT(int) PyObject_IsTrue(PyObject *);
10 extern DL_IMPORT(int) PyObject_Not(PyObject *);
11 @@ -654,6 +655,7 @@
12 extern DL_IMPORT(PyObject *) PyTuple_New(int size);
13 /* 18 */
14 extern DL_IMPORT(int) PyTuple_Size(PyObject *);
15 +extern DL_IMPORT(int) PyTuple_Check(PyObject *);
16 /* 40 */
17 extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
18 /* 41 */
19 @@ -883,6 +885,47 @@
20 #endif//MAYBE_RUN
21 #endif//DONT_COMPILE_THIS
22
23 +/* HST FIXUP */
24 +#undef PyRun_SimpleString
25 +int PyRun_SimpleString(const char* command) { return PyRun_SimpleStringFlags(command, NULL); }
26 +
27 +#undef PyRun_AnyFile
28 +int PyRun_AnyFile(FILE* fp, const char* filename) { return PyRun_AnyFileExFlags(fp, filename, 0, NULL); }
29 +
30 +#undef PyRun_SimpleFile
31 +int PyRun_SimpleFile(FILE* fp, const char* filename) { return PyRun_SimpleFileExFlags(fp, filename, 0, NULL); }
32 +
33 +#undef PyRun_InteractiveOne
34 +int PyRun_InteractiveOne(FILE* fp, const char* filename) { return PyRun_InteractiveOneFlags(fp, filename, NULL); }
35 +
36 +#undef PyRun_InteractiveLoop
37 +int PyRun_InteractiveLoop(FILE* fp, const char* filename) { return PyRun_InteractiveLoopFlags(fp, filename, NULL); }
38 +
39 +#undef PyRun_AnyFileEx
40 +int PyRun_AnyFileEx(FILE* fp, const char* filename, int closeit) { return PyRun_AnyFileExFlags(fp, filename, closeit, NULL); }
41 +
42 +#undef PyRun_SimpleFileEx
43 +int PyRun_SimpleFileEx(FILE* fp, const char* filename, int closeit) { return PyRun_SimpleFileExFlags(fp, filename, closeit, NULL); }
44 +
45 +#undef PyRun_String
46 +PyObject* PyRun_String(const char* str, int start, PyObject* globals, PyObject* locals) { return PyRun_StringFlags(str, start, globals, locals, NULL); }
47 +
48 +#undef PyRun_File
49 +PyObject* PyRun_File(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals) { return PyRun_FileExFlags(fp, filename, start, globals, locals, 0, NULL); }
50 +
51 +#undef PyRun_FileEx
52 +PyObject* PyRun_FileEx(FILE* fp, const char* filename, int start, PyObject* globals, PyObject* locals, int closeit) { return PyRun_FileExFlags(fp, filename, start, globals, locals, closeit, NULL); }
53 +
54 +#undef Py_CompileString
55 +PyObject* Py_CompileString(const char* str, const char* filename, int start) { return Py_CompileStringFlags(str, filename, start, NULL); }
56 +
57 +#undef PyRange_New
58 +PyObject* PyRange_New(PyObject* start, PyObject* stop, PyObject* step) { return PyObject_CallFunction((PyObject*)&PyRange_Type, "lll", start, stop, step); }
59 +
60 +#undef PyTuple_Check
61 +int PyTuple_Check(PyObject* op) { return PyObject_TypeCheck(op, &PyTuple_Type); }
62 +/* END HST FIXUP */
63 +
64 /* Value -> Pyobject */
65
66 value pywrapvalue( value cb ) {
67 @@ -963,6 +1006,7 @@
68 { (void *)PyObject_GetAttrString, 16, "PyObject_GetAttrString" },
69 /* 17 */
70 { (void *)PyObject_GetAttr, 17, "PyObject_GetAttr" },
71 + { (void *)PyObject_CallObject, 17, "PyObject_CallObject" },
72 /* 18 */
73 { (void *)PyObject_IsTrue, 18, "PyObject_IsTrue" },
74 { (void *)PyObject_Not, 18, "PyObject_Not" },
75 @@ -1051,6 +1095,7 @@
76 { (void *)PyTuple_New, 39, "PyTuple_New" },
77 /* 18 */
78 { (void *)PyTuple_Size, 18, "PyTuple_Size" },
79 + { (void *)PyTuple_Check, 18, "PyTuple_Check" },
80 /* 40 */
81 { (void *)PyTuple_GetItem, 40, "PyTuple_GetItem" },
82 /* 41 */
83 @@ -1385,3 +1430,24 @@
84
85 CAMLreturn(Val_unit);
86 }
87 +
88 +value pycaml_setargs(value argv) {
89 + CAMLparam1(argv);
90 + char* cargv[1];
91 +
92 + cargv[0] = String_val(argv);
93 +
94 + PySys_SetArgv(1, cargv);
95 +
96 + CAMLreturn0;
97 +}
98 +
99 +value pytrue( value unit ) {
100 + CAMLparam1(unit);
101 + CAMLreturn(pywrap(Py_True));
102 +}
103 +
104 +value pyfalse(value unit) {
105 + CAMLparam1(unit);
106 + CAMLreturn(pywrap(Py_False));
107 +}