~pythonregexp2.7/python/issue2636-12

« back to all changes in this revision

Viewing changes to Mac/Modules/res/_Resmodule.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:52:42 UTC
  • mfrom: (39033.1.3 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609145242-9m268zc6u87rp1vp
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include "Python.h"
5
5
 
6
6
 
7
 
 
8
7
#include "pymactoolbox.h"
9
8
 
10
9
/* Macro to test whether a weak-loaded CFM function exists */
414
413
        return _res;
415
414
}
416
415
 
 
416
#ifndef __LP64__
417
417
static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
418
418
{
419
419
        PyObject *_res = NULL;
431
431
        return _res;
432
432
 
433
433
}
 
434
#endif /* !__LP64__ */
434
435
 
435
436
static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
436
437
{
501
502
         PyDoc_STR("(long newSize) -> None")},
502
503
        {"GetNextFOND", (PyCFunction)ResObj_GetNextFOND, 1,
503
504
         PyDoc_STR("() -> (Handle _rv)")},
 
505
#ifndef __LP64__
504
506
        {"as_Control", (PyCFunction)ResObj_as_Control, 1,
505
507
         PyDoc_STR("Return this resource/handle as a Control")},
506
508
        {"as_Menu", (PyCFunction)ResObj_as_Menu, 1,
507
509
         PyDoc_STR("Return this resource/handle as a Menu")},
 
510
#endif /* !__LP64__ */
508
511
        {"LoadResource", (PyCFunction)ResObj_LoadResource, 1,
509
512
         PyDoc_STR("() -> None")},
510
513
        {"AutoDispose", (PyCFunction)ResObj_AutoDispose, 1,
1152
1155
        return _res;
1153
1156
}
1154
1157
 
 
1158
#ifndef __LP64__
1155
1159
static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
1156
1160
{
1157
1161
        PyObject *_res = NULL;
1287
1291
        _res = Py_None;
1288
1292
        return _res;
1289
1293
}
 
1294
#endif /* !__LP64__ */
1290
1295
 
1291
1296
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
1292
1297
{
1327
1332
        return _res;
1328
1333
}
1329
1334
 
 
1335
#ifndef __LP64__
1330
1336
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
1331
1337
{
1332
1338
        PyObject *_res = NULL;
1394
1400
        return _res;
1395
1401
}
1396
1402
 
 
1403
 
1397
1404
static PyObject *Res_GetNextResourceFile(PyObject *_self, PyObject *_args)
1398
1405
{
1399
1406
        PyObject *_res = NULL;
1413
1420
                             nextRefNum);
1414
1421
        return _res;
1415
1422
}
 
1423
#endif /* !__LP64__ */
1416
1424
 
1417
1425
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
1418
1426
{
1438
1446
        return _res;
1439
1447
}
1440
1448
 
 
1449
 
 
1450
#ifndef __LP64__
1441
1451
static PyObject *Res_FSCreateResFile(PyObject *_self, PyObject *_args)
1442
1452
{
1443
1453
        PyObject *_res = NULL;
1534
1544
                             PyMac_BuildFSSpec, &newSpec);
1535
1545
        return _res;
1536
1546
}
 
1547
#endif /* __LP64__ */
1537
1548
 
1538
1549
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
1539
1550
{
1544
1555
        UniCharCount forkNameLength__len__;
1545
1556
        int forkNameLength__in_len__;
1546
1557
        SignedByte permissions;
1547
 
        SInt16 refNum;
 
1558
        ResFileRefNum refNum;
1548
1559
#ifndef FSOpenResourceFile
1549
1560
        PyMac_PRECHECK(FSOpenResourceFile);
1550
1561
#endif
1637
1648
         PyDoc_STR("(short refNum) -> (short _rv)")},
1638
1649
        {"SetResFileAttrs", (PyCFunction)Res_SetResFileAttrs, 1,
1639
1650
         PyDoc_STR("(short refNum, short attrs) -> None")},
 
1651
#ifndef __LP64__
1640
1652
        {"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
1641
1653
         PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
1642
1654
        {"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
1647
1659
         PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
1648
1660
        {"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
1649
1661
         PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
 
1662
#endif /* !__LP64__ */
1650
1663
        {"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
1651
1664
         PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
1652
1665
        {"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
1653
1666
         PyDoc_STR("(SInt16 refNum) -> None")},
 
1667
#ifndef __LP64__
1654
1668
        {"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
1655
1669
         PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
1656
1670
        {"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
1659
1673
         PyDoc_STR("() -> (SInt16 refNum)")},
1660
1674
        {"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
1661
1675
         PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
 
1676
#endif /* __LP64__ */
1662
1677
        {"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
1663
1678
         PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
 
1679
#ifndef __LP64__
1664
1680
        {"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
1665
1681
         PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
1666
1682
        {"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
1667
1683
         PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
1668
1684
        {"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
1669
1685
         PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
 
1686
#endif /* __LP64__ */
1670
1687
        {"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
1671
1688
         PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
1672
1689
        {"Handle", (PyCFunction)Res_Handle, 1,
1676
1693
 
1677
1694
 
1678
1695
 
1679
 
 
1680
1696
/* Alternative version of ResObj_New, which returns None for null argument */
1681
1697
PyObject *OptResObj_New(Handle itself)
1682
1698
{