File: pyerr.lsh

package info (click to toggle)
lush 1.0%2Bfinal-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 19,256 kB
  • ctags: 4,254
  • sloc: ansic: 45,498; sh: 3,138; cpp: 2,456; makefile: 372; lisp: 79; python: 5
file content (239 lines) | stat: -rw-r--r-- 6,806 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "python/python-config")


#? *** pyerr

;; dummy function that adds Python C header files in C file
(eval `(de dummy_pyerr () ,python-cpheader-cmd ()))

#? * (dummy_pyerr)
#? * (pyerr_setnone <om>)
#? * (pyerr_setobject <o1> <om>)
#? * (pyerr_setstring <o1> <om>)
#? * (pyerr_occurred)
#? * (pyerr_clear)
#? * (pyerr_fetch <o1> <o2> <om>)
#? * (pyerr_restore <o1> <o2> <om>)
#? * (pyerr_givenexceptionmatches <o1> <om>)
#? * (pyerr_exceptionmatches <om>)
#? * (pyerr_normalizeexception <o1> <o2> <om>)
#? * (pyerr_badargument)
#? * (pyerr_nomemory)
#? * (pyerr_setfromerrno <om>)
#? * (pyerr_setfromerrnowithfilename <o1> <om>)
#? * (pyerr_badinternalcall)
#? * (_pyerr_badinternalcall <filename> <lineno>)
#? * (pyerr_writeunraisable <om>)
#? * (pyerr_warn <o1> <om>)
#? * (pyerr_warnexplicit <o1> <o2> <s> <p> <m> <om>)
#? * (pyerr_checksignals)
#? * (pyerr_setinterrupt)
#? * (pyerr_syntaxlocation <o1> <im>)
#? * (pyerr_programtext <o1> <im>)
#? * (pyerr_print)
#? * (pyerr_printex <im>)
#? * (pyerr_display <o1> <o2> <om>)
#? * (pyerr_newexception <name> <base> <dict>)

;; ********************************************************

(de PyErr_SetNone ( om )
    ((-gptr-"PyObject *") om)   
    #{  PyErr_SetNone( $om );  #} 
    ())

(de PyErr_SetObject ( o1  om )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") om)   
    #{  PyErr_SetObject( $o1   ,$om );  #} 
    ())

(de PyErr_SetString ( o1  om )
    ((-gptr-"PyObject *") o1)  
    ((-str-) om)   
    #{  PyErr_SetString( $o1 ,(const char *)$om->data );  #} 
    ())

(de PyErr_Occurred ()
    (gptr  #{  PyErr_Occurred(  )  #} ))        ;; PyObject * -> gptr

(de PyErr_Clear ()
    #{ PyErr_Clear(  );  #} 
    ())

(de PyErr_Fetch ( o1  o2  om )
    ((-gptr-"PyObject **") o1)  
    ((-gptr-"PyObject **") o2)  
    ((-gptr-"PyObject **") om)   
    #{  PyErr_Fetch( $o1   ,$o2   ,$om );  #} 
    ())

(de PyErr_Restore ( o1  o2  om )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)  
    ((-gptr-"PyObject *") om)   
    #{  PyErr_Restore( $o1   ,$o2   ,$om );  #} 
    ())

(de PyErr_GivenExceptionMatches ( o1  om )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") om)   
    (int  #{  PyErr_GivenExceptionMatches( $o1   ,$om )  #} ))

(de PyErr_ExceptionMatches ( om )
    ((-gptr-"PyObject *") om)   
    (int  #{  PyErr_ExceptionMatches( $om )  #} ))

(de PyErr_NormalizeException ( o1  o2  om )
    ((-gptr- "PyObject**") o1)  
    ((-gptr- "PyObject**") o2)  
    ((-gptr- "PyObject**") om)   
    #{  PyErr_NormalizeException( $o1 ,$o2 ,$om );  #} 
    ())

(de PyErr_BadArgument ()
    (int  #{  PyErr_BadArgument(  )  #} ))

(de PyErr_NoMemory ()
    (gptr  #{  PyErr_NoMemory(  )  #} ))        ;; PyObject * -> gptr

(de PyErr_SetFromErrno ( om )
    ((-gptr-"PyObject *") om)   
    (gptr  #{  PyErr_SetFromErrno( $om )  #} ))        ;; PyObject * -> gptr

(de PyErr_SetFromErrnoWithFilename ( o1  om )
    ((-gptr-"PyObject *") o1)  
    ((-str-) om)   
    (gptr  #{  PyErr_SetFromErrnoWithFilename( $o1 ,$om->data )  #} ))        ;; PyObject * -> gptr

(de PyErr_BadInternalCall ()
    #{ PyErr_BadInternalCall(); #} 
    ())

(de _PyErr_BadInternalCall ( filename  lineno )
    ((-str-) filename)  
    ((-int-) lineno)   
    #{ _PyErr_BadInternalCall( $filename->data   ,$lineno );  #} 
    ())

(de PyErr_WriteUnraisable ( om )
    ((-gptr-"PyObject *") om)   
    #{  PyErr_WriteUnraisable( $om );  #} 
    ())

(de PyErr_Warn ( o1  om )
    ((-gptr-"PyObject *") o1)  
    ((-str-) om)   
    (int  #{  PyErr_Warn( $o1 ,$om->data )  #} ))

(de PyErr_WarnExplicit ( o1  o2  s  p  m  om )
    ((-gptr-"PyObject *") o1)  
    ((-str-) o2)  
    ((-str-) s)  
    ((-int-) p)  
    ((-str-) m)  
    ((-gptr-"PyObject *") om)   
    (int  #{  PyErr_WarnExplicit( $o1 ,$o2->data ,$s->data ,$p ,$m->data ,$om )  #} ))

(de PyErr_CheckSignals ()
    (int  #{  PyErr_CheckSignals(  )  #} ))

(de PyErr_SetInterrupt ()
    #{ PyErr_SetInterrupt( );  #} 
    ())

(de PyErr_SyntaxLocation ( o1  im )
    ((-str-) o1)  
    ((-int-) im)   
    #{  PyErr_SyntaxLocation( $o1->data ,$im );  #} 
    ())

(de PyErr_ProgramText ( o1  im )
    ((-str-) o1)  
    ((-int-) im)   
    (gptr  #{  PyErr_ProgramText( $o1->data ,$im )  #} ))        ;; PyObject * -> gptr

(de PyErr_Print ()
    #{ PyErr_Print( );  #} 
    ())

(de PyErr_PrintEx ( im )
    ((-int-) im)   
    #{  PyErr_PrintEx( $im );  #} 
    ())

(de PyErr_Display ( o1  o2  om )
    ((-gptr-"PyObject *") o1)  
    ((-gptr-"PyObject *") o2)  
    ((-gptr-"PyObject *") om)   
    #{  PyErr_Display( $o1   ,$o2   ,$om );  #} 
    ())

(de PyErr_NewException (name  base  dict )
    ((-str-) name)  
    ((-gptr-"PyObject *") base)  
    ((-gptr-"PyObject *") dict)   
    (gptr  #{  PyErr_NewException($name->data ,$base   ,$dict )  #} ))        ;; PyObject * -> gptr

()
;; ********************************************************

(dhc-make ()
  dummy_pyerr
  pyerr_setnone
  pyerr_setobject
  pyerr_setstring
  pyerr_occurred
  pyerr_clear
  pyerr_fetch
  pyerr_restore
  pyerr_givenexceptionmatches
  pyerr_exceptionmatches
  pyerr_normalizeexception
  pyerr_badargument
  pyerr_nomemory
  pyerr_setfromerrno
  pyerr_setfromerrnowithfilename
  pyerr_badinternalcall
  _pyerr_badinternalcall
  pyerr_writeunraisable
  pyerr_warn
  pyerr_warnexplicit
  pyerr_checksignals
  pyerr_setinterrupt
  pyerr_syntaxlocation
  pyerr_programtext
  pyerr_print
  pyerr_printex
  pyerr_display
  pyerr_newexception
)