retire PUBLIC, PRIVATE and FORWARD

This commit is contained in:
Ben Gras
2012-03-25 20:25:53 +02:00
parent 6a73e85ad1
commit 7336a67dfe
603 changed files with 5776 additions and 5779 deletions

View File

@@ -1,11 +1,11 @@
#include "inc.h"
PUBLIC int identifier = 0x1234;
PUBLIC endpoint_t who_e;
PUBLIC int call_type;
PUBLIC endpoint_t SELF_E;
int identifier = 0x1234;
endpoint_t who_e;
int call_type;
endpoint_t SELF_E;
PRIVATE struct {
static struct {
int type;
int (*func)(message *);
int reply; /* whether the reply action is passed through */
@@ -21,14 +21,14 @@ PRIVATE struct {
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
PRIVATE int verbose = 0;
static int verbose = 0;
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
PUBLIC int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
message m;
@@ -107,7 +107,7 @@ PUBLIC int main(int argc, char *argv[])
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -125,7 +125,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the ipc server. */
@@ -140,7 +140,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;

View File

@@ -25,10 +25,10 @@ struct sem_struct {
struct semaphore sems[SEMMSL];
};
PRIVATE struct sem_struct sem_list[SEMMNI];
PRIVATE int sem_list_nr = 0;
static struct sem_struct sem_list[SEMMNI];
static int sem_list_nr = 0;
PRIVATE struct sem_struct *sem_find_key(key_t key)
static struct sem_struct *sem_find_key(key_t key)
{
int i;
if (key == IPC_PRIVATE)
@@ -39,7 +39,7 @@ PRIVATE struct sem_struct *sem_find_key(key_t key)
return NULL;
}
PRIVATE struct sem_struct *sem_find_id(int id)
static struct sem_struct *sem_find_id(int id)
{
int i;
for (i = 0; i < sem_list_nr; i++)
@@ -51,7 +51,7 @@ PRIVATE struct sem_struct *sem_find_id(int id)
/*===========================================================================*
* do_semget *
*===========================================================================*/
PUBLIC int do_semget(message *m)
int do_semget(message *m)
{
key_t key;
int nsems, flag, id;
@@ -98,7 +98,7 @@ PUBLIC int do_semget(message *m)
return OK;
}
PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore)
static void send_message_to_process(endpoint_t who, int ret, int ignore)
{
message m;
@@ -106,7 +106,7 @@ PRIVATE void send_message_to_process(endpoint_t who, int ret, int ignore)
sendnb(who, &m);
}
PRIVATE void remove_semaphore(struct sem_struct *sem)
static void remove_semaphore(struct sem_struct *sem)
{
int i, nr;
@@ -129,7 +129,7 @@ PRIVATE void remove_semaphore(struct sem_struct *sem)
}
#if 0
PRIVATE void show_semaphore(void)
static void show_semaphore(void)
{
int i, j, k;
@@ -164,7 +164,7 @@ PRIVATE void show_semaphore(void)
}
#endif
PRIVATE void remove_process(endpoint_t pt)
static void remove_process(endpoint_t pt)
{
int i;
@@ -210,7 +210,7 @@ PRIVATE void remove_process(endpoint_t pt)
}
}
PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove)
static void update_one_semaphore(struct sem_struct *sem, int is_remove)
{
int i, j, nr;
struct semaphore *semaphore;
@@ -266,7 +266,7 @@ PRIVATE void update_one_semaphore(struct sem_struct *sem, int is_remove)
}
}
PRIVATE void update_semaphores(void)
static void update_semaphores(void)
{
int i;
@@ -277,7 +277,7 @@ PRIVATE void update_semaphores(void)
/*===========================================================================*
* do_semctl *
*===========================================================================*/
PUBLIC int do_semctl(message *m)
int do_semctl(message *m)
{
int r, i;
long opt;
@@ -437,7 +437,7 @@ PUBLIC int do_semctl(message *m)
/*===========================================================================*
* do_semop *
*===========================================================================*/
PUBLIC int do_semop(message *m)
int do_semop(message *m)
{
int id, i, j, r;
struct sembuf *sops;
@@ -589,7 +589,7 @@ out:
/*===========================================================================*
* is_sem_nil *
*===========================================================================*/
PUBLIC int is_sem_nil(void)
int is_sem_nil(void)
{
return (sem_list_nr == 0);
}
@@ -597,7 +597,7 @@ PUBLIC int is_sem_nil(void)
/*===========================================================================*
* sem_process_vm_notify *
*===========================================================================*/
PUBLIC void sem_process_vm_notify(void)
void sem_process_vm_notify(void)
{
endpoint_t pt;
int r;

View File

@@ -9,10 +9,10 @@ struct shm_struct {
vir_bytes page;
phys_bytes phys;
};
PRIVATE struct shm_struct shm_list[MAX_SHM_NR];
PRIVATE int shm_list_nr = 0;
static struct shm_struct shm_list[MAX_SHM_NR];
static int shm_list_nr = 0;
PRIVATE struct shm_struct *shm_find_key(key_t key)
static struct shm_struct *shm_find_key(key_t key)
{
int i;
if (key == IPC_PRIVATE)
@@ -23,7 +23,7 @@ PRIVATE struct shm_struct *shm_find_key(key_t key)
return NULL;
}
PRIVATE struct shm_struct *shm_find_id(int id)
static struct shm_struct *shm_find_id(int id)
{
int i;
for (i = 0; i < shm_list_nr; i++)
@@ -35,7 +35,7 @@ PRIVATE struct shm_struct *shm_find_id(int id)
/*===========================================================================*
* do_shmget *
*===========================================================================*/
PUBLIC int do_shmget(message *m)
int do_shmget(message *m)
{
struct shm_struct *shm;
long key, size, old_size;
@@ -106,7 +106,7 @@ PUBLIC int do_shmget(message *m)
/*===========================================================================*
* do_shmat *
*===========================================================================*/
PUBLIC int do_shmat(message *m)
int do_shmat(message *m)
{
int id, flag;
vir_bytes addr;
@@ -150,7 +150,7 @@ PUBLIC int do_shmat(message *m)
/*===========================================================================*
* update_refcount_and_destroy *
*===========================================================================*/
PUBLIC void update_refcount_and_destroy(void)
void update_refcount_and_destroy(void)
{
int i, j;
@@ -182,7 +182,7 @@ PUBLIC void update_refcount_and_destroy(void)
/*===========================================================================*
* do_shmdt *
*===========================================================================*/
PUBLIC int do_shmdt(message *m)
int do_shmdt(message *m)
{
vir_bytes addr;
phys_bytes paddr;
@@ -216,7 +216,7 @@ PUBLIC int do_shmdt(message *m)
/*===========================================================================*
* do_shmctl *
*===========================================================================*/
PUBLIC int do_shmctl(message *m)
int do_shmctl(message *m)
{
int id = m->SHMCTL_ID;
int cmd = m->SHMCTL_CMD;
@@ -328,7 +328,7 @@ PUBLIC int do_shmctl(message *m)
}
#if 0
PRIVATE void list_shm_ds(void)
static void list_shm_ds(void)
{
int i;
printf("key\tid\tpage\n");
@@ -343,7 +343,7 @@ PRIVATE void list_shm_ds(void)
/*===========================================================================*
* is_shm_nil *
*===========================================================================*/
PUBLIC int is_shm_nil(void)
int is_shm_nil(void)
{
return (shm_list_nr == 0);
}

View File

@@ -1,6 +1,6 @@
#include "inc.h"
PUBLIC int check_perm(struct ipc_perm *req, endpoint_t who, int mode)
int check_perm(struct ipc_perm *req, endpoint_t who, int mode)
{
int req_mode;
int cur_mode;