retire _PROTOTYPE

. only good for obsolete K&R support
	. also remove a stray ansi.h and the proto cmd
This commit is contained in:
Ben Gras
2012-03-24 16:16:34 +01:00
parent cf720a028a
commit 6a73e85ad1
475 changed files with 5256 additions and 6252 deletions

View File

@@ -7,14 +7,12 @@
#include "global.h"
#include "proto.h"
FORWARD _PROTOTYPE( int mthread_increase_thread_pool, (void) );
FORWARD _PROTOTYPE( void mthread_thread_init, (mthread_thread_t thread,
mthread_attr_t *tattr,
void *(*proc)(void *),
void *arg) );
FORWARD int mthread_increase_thread_pool(void);
FORWARD void mthread_thread_init(mthread_thread_t thread, mthread_attr_t
*tattr, void *(*proc)(void *), void *arg);
FORWARD _PROTOTYPE( void mthread_thread_stop, (mthread_thread_t thread));
FORWARD _PROTOTYPE( void mthread_trampoline, (void) );
FORWARD void mthread_thread_stop(mthread_thread_t thread);
FORWARD void mthread_trampoline(void);
PRIVATE int initialized = 0;
#ifndef PGSHIFT

View File

@@ -3,9 +3,9 @@
#include "proto.h"
PRIVATE struct __mthread_attr *va_front, *va_rear;
FORWARD _PROTOTYPE( void mthread_attr_add, (mthread_attr_t *a) );
FORWARD _PROTOTYPE( void mthread_attr_remove, (mthread_attr_t *a) );
FORWARD _PROTOTYPE( int mthread_attr_valid, (mthread_attr_t *a) );
FORWARD void mthread_attr_add(mthread_attr_t *a);
FORWARD void mthread_attr_remove(mthread_attr_t *a);
FORWARD int mthread_attr_valid(mthread_attr_t *a);
/*===========================================================================*
* mthread_init_valid_attributes *

View File

@@ -4,9 +4,9 @@
#ifdef MTHREAD_STRICT
PRIVATE struct __mthread_cond *vc_front, *vc_rear;
FORWARD _PROTOTYPE( void mthread_cond_add, (mthread_cond_t *c) );
FORWARD _PROTOTYPE( void mthread_cond_remove, (mthread_cond_t *c) );
FORWARD _PROTOTYPE( int mthread_cond_valid, (mthread_cond_t *c) );
FORWARD void mthread_cond_add(mthread_cond_t *c);
FORWARD void mthread_cond_remove(mthread_cond_t *c);
FORWARD int mthread_cond_valid(mthread_cond_t *c);
#else
# define mthread_cond_add(c) ((*c)->mc_magic = MTHREAD_INIT_MAGIC)
# define mthread_cond_remove(c) ((*c)->mc_magic = MTHREAD_NOT_INUSE)

View File

@@ -4,8 +4,8 @@
#ifdef MTHREAD_STRICT
PRIVATE struct __mthread_mutex *vm_front, *vm_rear;
FORWARD _PROTOTYPE( void mthread_mutex_add, (mthread_mutex_t *m) );
FORWARD _PROTOTYPE( void mthread_mutex_remove, (mthread_mutex_t *m) );
FORWARD void mthread_mutex_add(mthread_mutex_t *m);
FORWARD void mthread_mutex_remove(mthread_mutex_t *m);
#else
# define mthread_mutex_add(m) ((*m)->mm_magic = MTHREAD_INIT_MAGIC)
# define mthread_mutex_remove(m) ((*m)->mm_magic = MTHREAD_NOT_INUSE)

View File

@@ -2,67 +2,64 @@
#define __MTHREAD_PROTO_H__
/* allocate.c */
_PROTOTYPE( mthread_tcb_t * mthread_find_tcb, (mthread_thread_t thread) );
_PROTOTYPE( void mthread_thread_reset, (mthread_thread_t thread) );
mthread_tcb_t * mthread_find_tcb(mthread_thread_t thread);
void mthread_thread_reset(mthread_thread_t thread);
/* attribute.c */
_PROTOTYPE( void mthread_init_valid_attributes, (void) );
void mthread_init_valid_attributes(void);
#ifdef MDEBUG
_PROTOTYPE( int mthread_attr_verify, (void) );
int mthread_attr_verify(void);
#endif
/* cond.c */
_PROTOTYPE( void mthread_init_valid_conditions, (void) );
void mthread_init_valid_conditions(void);
#ifdef MDEBUG
_PROTOTYPE( int mthread_cond_verify, (void) );
int mthread_cond_verify(void);
#endif
/* key.c */
_PROTOTYPE( void mthread_init_keys, (void) );
_PROTOTYPE( void mthread_cleanup_values, (void) );
void mthread_init_keys(void);
void mthread_cleanup_values(void);
/* misc.c */
#ifdef MDEBUG
#define mthread_panic(m) mthread_panic_f(__FILE__, __LINE__, (m))
_PROTOTYPE( void mthread_panic_f, (const char *file, int line,
const char *msg) );
void mthread_panic_f(const char *file, int line, const char *msg);
#define mthread_debug(m) mthread_debug_f(__FILE__, __LINE__, (m))
_PROTOTYPE( void mthread_debug_f, (const char *file, int line,
const char *msg) );
void mthread_debug_f(const char *file, int line, const char *msg);
#else
_PROTOTYPE( void mthread_panic_s, (void) );
void mthread_panic_s(void);
# define mthread_panic(m) mthread_panic_s()
# define mthread_debug(m)
#endif
/* mutex.c */
_PROTOTYPE( void mthread_init_valid_mutexes, (void) );
void mthread_init_valid_mutexes(void);
#ifdef MTHREAD_STRICT
_PROTOTYPE( int mthread_mutex_valid, (mthread_mutex_t *mutex) );
int mthread_mutex_valid(mthread_mutex_t *mutex);
#else
# define mthread_mutex_valid(x) ((*x)->mm_magic == MTHREAD_INIT_MAGIC)
#endif
#ifdef MDEBUG
_PROTOTYPE( int mthread_mutex_verify, (void) );
int mthread_mutex_verify(void);
#endif
/* schedule.c */
_PROTOTYPE( int mthread_getcontext, (ucontext_t *ctxt) );
_PROTOTYPE( void mthread_init_scheduler, (void) );
_PROTOTYPE( void mthread_schedule, (void) );
_PROTOTYPE( void mthread_suspend, (mthread_state_t state) );
_PROTOTYPE( void mthread_unsuspend, (mthread_thread_t thread) );
int mthread_getcontext(ucontext_t *ctxt);
void mthread_init_scheduler(void);
void mthread_schedule(void);
void mthread_suspend(mthread_state_t state);
void mthread_unsuspend(mthread_thread_t thread);
/* queue.c */
#ifdef MDEBUG
_PROTOTYPE( void mthread_dump_queue, (mthread_queue_t *queue) );
void mthread_dump_queue(mthread_queue_t *queue);
#endif
_PROTOTYPE( void mthread_queue_init, (mthread_queue_t *queue) );
_PROTOTYPE( void mthread_queue_add, (mthread_queue_t *queue,
mthread_thread_t thread) );
_PROTOTYPE( mthread_thread_t mthread_queue_remove, (mthread_queue_t *queue));
_PROTOTYPE( int mthread_queue_isempty, (mthread_queue_t *queue) );
void mthread_queue_init(mthread_queue_t *queue);
void mthread_queue_add(mthread_queue_t *queue, mthread_thread_t thread);
mthread_thread_t mthread_queue_remove(mthread_queue_t *queue);
int mthread_queue_isempty(mthread_queue_t *queue);
#endif