Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0c813319
Commit
0c813319
authored
Feb 20, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added config file for Tk-python
Removed mwerksglue.c (which was useless anyway)
parent
8207be00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
166 deletions
+13
-166
Mac/mwerks/mwerksglue.c
Mac/mwerks/mwerksglue.c
+0
-166
Mac/mwerks/old/mwerks_nsgusitk_config.h
Mac/mwerks/old/mwerks_nsgusitk_config.h
+13
-0
No files found.
Mac/mwerks/mwerksglue.c
deleted
100644 → 0
View file @
8207be00
/*
** Glue code for MetroWerks CodeWarrior, which misses
** unix-like routines for file-access.
*/
#ifdef __MWERKS__
#include <Types.h>
#include <Files.h>
#include <Strings.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
/* #define DBGMALLOC /**/
#ifdef DBGMALLOC
#define NMALLOC 50000
static
long
m_index
;
static
long
m_addrs
[
NMALLOC
];
static
long
m_sizes
[
NMALLOC
];
static
long
m_lastaddr
;
#define SSLOP 2
#define SLOP (SSLOP+0)
void
m_abort
()
{
printf
(
"ABORT
\n
"
);
exit
(
1
);
}
void
*
checkrv
(
ptr
,
size
)
void
*
ptr
;
int
size
;
{
long
b
=
(
long
)
ptr
,
e
=
(
long
)
ptr
+
size
+
SSLOP
;
int
i
;
if
(
m_index
>=
NMALLOC
)
{
printf
(
"too many mallocs
\n
"
);
m_abort
();
}
m_lastaddr
=
(
long
)
ptr
;
for
(
i
=
0
;
i
<
m_index
;
i
++
)
{
if
(
m_addrs
[
i
]
>
0
&&
b
<
m_addrs
[
i
]
+
m_sizes
[
i
]
&&
e
>
m_addrs
[
i
]
)
{
printf
(
"overlapping block with %d
\n
"
,
i
);
m_abort
();
}
}
m_sizes
[
m_index
]
=
size
;
m_addrs
[
m_index
++
]
=
(
long
)
ptr
;
*
(
short
*
)
ptr
=
m_index
-
1
;
return
(
void
*
)((
char
*
)
ptr
+
SSLOP
);
}
void
*
checkfree
(
ptr
)
void
*
ptr
;
{
int
i
;
if
(
ptr
==
0
)
{
printf
(
"free null
\n
"
);
m_abort
();
}
m_lastaddr
=
(
long
)
ptr
;
for
(
i
=
0
;
i
<
m_index
;
i
++
)
{
if
(
m_addrs
[
i
]
==
(
long
)
ptr
-
SSLOP
)
{
m_addrs
[
i
]
=
-
m_addrs
[
i
];
ptr
=
(
void
*
)((
char
*
)
ptr
-
SSLOP
);
if
(
*
(
short
*
)
ptr
!=
i
)
{
int
saved_i
=
i
,
saved_ptr
=
*
(
short
*
)
ptr
;
printf
(
"Wrong starter value
\n
"
);
m_abort
();
}
return
ptr
;
}
}
printf
(
"free unknown
\n
"
);
m_abort
();
return
0
;
}
void
*
m_malloc
(
size
)
{
void
*
ptr
;
ptr
=
malloc
(
size
+
SLOP
);
if
(
!
ptr
)
{
printf
(
"malloc failure
\n
"
);
m_abort
();
}
return
checkrv
(
ptr
,
size
);
}
void
*
m_realloc
(
optr
,
size
)
void
*
optr
;
{
void
*
ptr
;
ptr
=
checkfree
(
ptr
);
ptr
=
realloc
(
ptr
,
size
+
SLOP
);
if
(
!
ptr
)
{
printf
(
"realloc failure
\n
"
);
m_abort
();
}
return
checkrv
(
ptr
,
size
);
}
void
*
m_calloc
(
size
,
nelem
)
{
void
*
ptr
;
ptr
=
calloc
(
1
,
nelem
*
size
+
SLOP
);
return
checkrv
(
ptr
,
nelem
*
size
);
}
void
m_free
(
ptr
)
void
*
ptr
;
{
ptr
=
checkfree
(
ptr
);
free
(
ptr
);
}
#endif
/* DBGMALLOC */
#ifdef CW4
int
fileno
(
fp
)
FILE
*
fp
;
{
if
(
fp
==
stdin
)
return
0
;
else
if
(
fp
==
stdout
)
return
1
;
else
if
(
fp
==
stderr
)
return
2
;
else
return
3
;
}
int
isatty
(
fd
)
int
fd
;
{
return
(
fd
>=
0
&&
fd
<=
2
);
}
int
unlink
(
old
)
char
*
old
;
{
OSErr
err
;
if
((
err
=
FSDelete
((
ConstStr255Param
)
Pstring
(
old
),
0
))
==
noErr
)
return
0
;
errno
=
err
;
return
-
1
;
}
#endif
/* CW4 */
#endif
/* __MWERKS__ */
Mac/mwerks/old/mwerks_nsgusitk_config.h
0 → 100644
View file @
0c813319
#define HAVE_CONFIG_H
// #define USE_STDWIN
// #define USE_MACTCP
#define USE_BGEN
//#define USE_MACSPEECH
// #define USE_IMG
//#define USE_MACCTB
#define USE_TK
#define MAC_TCL
#ifdef __powerc
#define USE_MAC_DYNAMIC_LOADING
#endif
#define USE_GUSI
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment