Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7030b1f

Browse files
almodule.c: added close method, equivalent to closeport.
thread.h: use PROTO instead of _P for prototypes.
1 parent 248a50c commit 7030b1f

3 files changed

Lines changed: 37 additions & 36 deletions

File tree

Include/pythread.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#ifndef _THREAD_H_included
22
#define _THREAD_H_included
33

4+
#ifndef PROTO
45
#if defined(__STDC__) || defined(__cplusplus)
5-
#define _P(args) args
6+
#define PROTO(args) args
67
#else
7-
#define _P(args) ()
8+
#define PROTO(args) ()
9+
#endif
810
#endif
911

1012
typedef void *type_lock;
@@ -14,30 +16,28 @@ typedef void *type_sema;
1416
extern "C" {
1517
#endif
1618

17-
void init_thread _P((void));
18-
int start_new_thread _P((void (*)(void *), void *));
19-
void exit_thread _P((void));
20-
void _exit_thread _P((void));
19+
void init_thread PROTO((void));
20+
int start_new_thread PROTO((void (*)(void *), void *));
21+
void exit_thread PROTO((void));
22+
void _exit_thread PROTO((void));
2123

22-
type_lock allocate_lock _P((void));
23-
void free_lock _P((type_lock));
24-
int acquire_lock _P((type_lock, int));
24+
type_lock allocate_lock PROTO((void));
25+
void free_lock PROTO((type_lock));
26+
int acquire_lock PROTO((type_lock, int));
2527
#define WAIT_LOCK 1
2628
#define NOWAIT_LOCK 0
27-
void release_lock _P((type_lock));
29+
void release_lock PROTO((type_lock));
2830

29-
type_sema allocate_sema _P((int));
30-
void free_sema _P((type_sema));
31-
void down_sema _P((type_sema));
32-
void up_sema _P((type_sema));
31+
type_sema allocate_sema PROTO((int));
32+
void free_sema PROTO((type_sema));
33+
void down_sema PROTO((type_sema));
34+
void up_sema PROTO((type_sema));
3335

34-
void exit_prog _P((int));
35-
void _exit_prog _P((int));
36+
void exit_prog PROTO((int));
37+
void _exit_prog PROTO((int));
3638

3739
#ifdef __cplusplus
3840
}
3941
#endif
4042

41-
#undef _P
42-
4343
#endif

Include/thread.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#ifndef _THREAD_H_included
22
#define _THREAD_H_included
33

4+
#ifndef PROTO
45
#if defined(__STDC__) || defined(__cplusplus)
5-
#define _P(args) args
6+
#define PROTO(args) args
67
#else
7-
#define _P(args) ()
8+
#define PROTO(args) ()
9+
#endif
810
#endif
911

1012
typedef void *type_lock;
@@ -14,30 +16,28 @@ typedef void *type_sema;
1416
extern "C" {
1517
#endif
1618

17-
void init_thread _P((void));
18-
int start_new_thread _P((void (*)(void *), void *));
19-
void exit_thread _P((void));
20-
void _exit_thread _P((void));
19+
void init_thread PROTO((void));
20+
int start_new_thread PROTO((void (*)(void *), void *));
21+
void exit_thread PROTO((void));
22+
void _exit_thread PROTO((void));
2123

22-
type_lock allocate_lock _P((void));
23-
void free_lock _P((type_lock));
24-
int acquire_lock _P((type_lock, int));
24+
type_lock allocate_lock PROTO((void));
25+
void free_lock PROTO((type_lock));
26+
int acquire_lock PROTO((type_lock, int));
2527
#define WAIT_LOCK 1
2628
#define NOWAIT_LOCK 0
27-
void release_lock _P((type_lock));
29+
void release_lock PROTO((type_lock));
2830

29-
type_sema allocate_sema _P((int));
30-
void free_sema _P((type_sema));
31-
void down_sema _P((type_sema));
32-
void up_sema _P((type_sema));
31+
type_sema allocate_sema PROTO((int));
32+
void free_sema PROTO((type_sema));
33+
void down_sema PROTO((type_sema));
34+
void up_sema PROTO((type_sema));
3335

34-
void exit_prog _P((int));
35-
void _exit_prog _P((int));
36+
void exit_prog PROTO((int));
37+
void _exit_prog PROTO((int));
3638

3739
#ifdef __cplusplus
3840
}
3941
#endif
4042

41-
#undef _P
42-
4343
#endif

Modules/almodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ al_getstatus (self, args)
490490

491491
static struct methodlist port_methods[] = {
492492
{"closeport", al_closeport},
493+
{"close", al_closeport},
493494
{"getfd", al_getfd},
494495
{"fileno", al_getfd},
495496
{"getfilled", al_getfilled},

0 commit comments

Comments
 (0)