~pythonregexp2.7/python/issue2636

« back to all changes in this revision

Viewing changes to Mac/Modules/file/filesupport.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:36:32 UTC
  • mfrom: (39021.1.402 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609143632-wwwkx92u1t5l7yd3
Merged in changes from the latest python source snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# XXXX TO DO:
7
7
# - Implement correct missing FSSpec handling for Alias methods
8
8
# - Implement FInfo
 
9
#
 
10
# WARNING WARNING WARNING
 
11
#   The file _Filemodule.c was modified manually, don't run this script
 
12
#   unless you really know what you're doing.
 
13
 
 
14
import sys
 
15
sys.exit(42)
9
16
 
10
17
import string
11
18
 
199
206
        return Py_BuildValue("u#", itself->unicode, itself->length);
200
207
}
201
208
 
 
209
#ifndef __LP64__
202
210
/*
203
211
** Get pathname for a given FSSpec
204
212
*/
244
252
        }
245
253
        return 0;
246
254
}
 
255
#endif /* !__LP64__ */
247
256
 
248
257
"""
249
258
 
250
259
finalstuff = finalstuff + """
 
260
 
 
261
#ifndef __LP64__
251
262
int
252
263
PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
253
264
{
286
297
        return 0;
287
298
}
288
299
 
 
300
#endif /* !__LP64__ */
 
301
 
289
302
int
290
303
PyMac_GetFSRef(PyObject *v, FSRef *fsr)
291
304
{
309
322
        }
310
323
        /* XXXX Should try unicode here too */
311
324
        /* Otherwise we try to go via an FSSpec */
 
325
#ifndef __LP64__
312
326
        if (FSSpec_Check(v)) {
313
327
                fss = ((FSSpecObject *)v)->ob_itself;
314
328
                if ((err=FSpMakeFSRef(&fss, fsr)) == 0)
317
331
                return 0;
318
332
        }
319
333
        PyErr_SetString(PyExc_TypeError, "FSRef, FSSpec or pathname required");
 
334
#else /* __LP64__ */
 
335
        PyErr_SetString(PyExc_TypeError, "FSRef or pathname required");
 
336
#endif /* __LP64__ */
320
337
        return 0;
321
338
}
322
339
 
 
340
#ifndef __LP64__
323
341
extern PyObject *
324
342
PyMac_BuildFSSpec(FSSpec *spec)
325
343
{
326
344
        return FSSpec_New(spec);
327
345
}
 
346
#endif /* __LP64__ */
328
347
 
329
348
extern PyObject *
330
349
PyMac_BuildFSRef(FSRef *spec)
334
353
"""
335
354
 
336
355
initstuff = initstuff + """
 
356
#ifndef __LP64__
337
357
PyMac_INIT_TOOLBOX_OBJECT_NEW(FSSpec *, PyMac_BuildFSSpec);
 
358
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec);
 
359
#endif /* !__LP64__*/
338
360
PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
339
 
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec);
340
361
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSRef, PyMac_GetFSRef);
341
362
"""
342
363