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

@@ -5,14 +5,14 @@
#define BUF_SIZE 4096
PRIVATE char buf[BUF_SIZE + 1];
PRIVATE size_t off, left, used;
PRIVATE off_t skip;
static char buf[BUF_SIZE + 1];
static size_t off, left, used;
static off_t skip;
/*===========================================================================*
* buf_init *
*===========================================================================*/
PUBLIC void buf_init(off_t start, size_t len)
void buf_init(off_t start, size_t len)
{
/* Initialize the buffer for fresh use. The first 'start' bytes of the
* produced output are to be skipped. After that, up to a total of
@@ -28,7 +28,7 @@ PUBLIC void buf_init(off_t start, size_t len)
/*===========================================================================*
* buf_printf *
*===========================================================================*/
PUBLIC void buf_printf(char *fmt, ...)
void buf_printf(char *fmt, ...)
{
/* Add formatted text to the end of the buffer.
*/
@@ -84,7 +84,7 @@ PUBLIC void buf_printf(char *fmt, ...)
/*===========================================================================*
* buf_append *
*===========================================================================*/
PUBLIC void buf_append(char *data, size_t len)
void buf_append(char *data, size_t len)
{
/* Add arbitrary data to the end of the buffer.
*/
@@ -116,7 +116,7 @@ PUBLIC void buf_append(char *data, size_t len)
/*===========================================================================*
* buf_get *
*===========================================================================*/
PUBLIC size_t buf_get(char **ptr)
size_t buf_get(char **ptr)
{
/* Return the buffer's starting address and the length of the used
* part, not counting the trailing null character for the latter.

View File

@@ -5,7 +5,7 @@
#define CONFIG_MAX_CPUS 1
#endif
PRIVATE const char * x86_flag[] = {
static const char * x86_flag[] = {
"fpu",
"vme",
"de",
@@ -72,7 +72,7 @@ PRIVATE const char * x86_flag[] = {
"",
};
PRIVATE void print_cpu_flags(u32_t * flags)
static void print_cpu_flags(u32_t * flags)
{
int i, j;
@@ -86,7 +86,7 @@ PRIVATE void print_cpu_flags(u32_t * flags)
buf_printf("\n");
}
PRIVATE void print_cpu(struct cpu_info * cpu_info, unsigned id)
static void print_cpu(struct cpu_info * cpu_info, unsigned id)
{
buf_printf("%-16s: %d\n", "processor", id);
@@ -113,7 +113,7 @@ PRIVATE void print_cpu(struct cpu_info * cpu_info, unsigned id)
buf_printf("\n");
}
PUBLIC void root_cpuinfo(void)
void root_cpuinfo(void)
{
struct cpu_info cpu_info[CONFIG_MAX_CPUS];
struct machine machine;

View File

@@ -3,10 +3,10 @@
#include "inc.h"
#include "cpuinfo.h"
FORWARD void init_hook(void);
static void init_hook(void);
/* The hook functions that will be called by VTreeFS. */
PRIVATE struct fs_hooks hooks = {
static struct fs_hooks hooks = {
init_hook,
NULL, /* cleanup_hook */
lookup_hook,
@@ -19,7 +19,7 @@ PRIVATE struct fs_hooks hooks = {
/*===========================================================================*
* construct_tree *
*===========================================================================*/
PRIVATE void construct_tree(struct inode *dir, struct file *files)
static void construct_tree(struct inode *dir, struct file *files)
{
/* Construct a tree of static files from a null-terminated array of
* file structures, recursively creating directories which have their
@@ -50,7 +50,7 @@ PRIVATE void construct_tree(struct inode *dir, struct file *files)
/*===========================================================================*
* init_hook *
*===========================================================================*/
PRIVATE void init_hook(void)
static void init_hook(void)
{
/* Initialization hook. Generate the static part of the tree.
*/
@@ -69,7 +69,7 @@ PRIVATE void init_hook(void)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(void)
int main(void)
{
/* ProcFS entry point.
*/

View File

@@ -6,18 +6,18 @@
#include <minix/vm.h>
#define S_FRAME_SIZE 4096 /* use malloc if larger than this */
PRIVATE char s_frame[S_FRAME_SIZE]; /* static storage for process frame */
PRIVATE char *frame; /* pointer to process frame buffer */
static char s_frame[S_FRAME_SIZE]; /* static storage for process frame */
static char *frame; /* pointer to process frame buffer */
FORWARD void pid_psinfo(int slot);
FORWARD void pid_cmdline(int slot);
FORWARD void pid_environ(int slot);
FORWARD void pid_map(int slot);
static void pid_psinfo(int slot);
static void pid_cmdline(int slot);
static void pid_environ(int slot);
static void pid_map(int slot);
/* The files that are dynamically created in each PID directory. The data field
* contains each file's read function. Subdirectories are not yet supported.
*/
PUBLIC struct file pid_files[] = {
struct file pid_files[] = {
{ "psinfo", REG_ALL_MODE, (data_t) pid_psinfo },
{ "cmdline", REG_ALL_MODE, (data_t) pid_cmdline },
{ "environ", REG_ALL_MODE, (data_t) pid_environ },
@@ -28,7 +28,7 @@ PUBLIC struct file pid_files[] = {
/*===========================================================================*
* is_zombie *
*===========================================================================*/
PRIVATE int is_zombie(int slot)
static int is_zombie(int slot)
{
/* Is the given slot a zombie process?
*/
@@ -40,7 +40,7 @@ PRIVATE int is_zombie(int slot)
/*===========================================================================*
* pid_psinfo *
*===========================================================================*/
PRIVATE void pid_psinfo(int i)
static void pid_psinfo(int i)
{
/* Print information used by ps(1) and top(1).
*/
@@ -182,7 +182,7 @@ PRIVATE void pid_psinfo(int i)
/*===========================================================================*
* put_frame *
*===========================================================================*/
PRIVATE void put_frame(void)
static void put_frame(void)
{
/* If we allocated memory dynamically during a call to get_frame(),
* free it up here.
@@ -195,7 +195,7 @@ PRIVATE void put_frame(void)
/*===========================================================================*
* get_frame *
*===========================================================================*/
PRIVATE int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep,
static int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep,
size_t *nargsp)
{
/* Get the execution frame from the top of the given process's stack.
@@ -256,7 +256,7 @@ PRIVATE int get_frame(int slot, vir_bytes *basep, vir_bytes *sizep,
/*===========================================================================*
* pid_cmdline *
*===========================================================================*/
PRIVATE void pid_cmdline(int slot)
static void pid_cmdline(int slot)
{
/* Dump the process's command line as it is contained in the process
* itself. Each argument is terminated with a null character.
@@ -288,7 +288,7 @@ PRIVATE void pid_cmdline(int slot)
/*===========================================================================*
* pid_environ *
*===========================================================================*/
PRIVATE void pid_environ(int slot)
static void pid_environ(int slot)
{
/* Dump the process's initial environment as it is contained in the
* process itself. Each entry is terminated with a null character.
@@ -334,7 +334,7 @@ PRIVATE void pid_environ(int slot)
/*===========================================================================*
* dump_regions *
*===========================================================================*/
PRIVATE int dump_regions(int slot)
static int dump_regions(int slot)
{
/* Print the virtual memory regions of a process.
*/
@@ -380,7 +380,7 @@ PRIVATE int dump_regions(int slot)
/*===========================================================================*
* dump_segments *
*===========================================================================*/
PRIVATE void dump_segments(int slot)
static void dump_segments(int slot)
{
/* Print the memory segments of a process.
*/
@@ -400,7 +400,7 @@ PRIVATE void dump_segments(int slot)
/*===========================================================================*
* pid_map *
*===========================================================================*/
PRIVATE void pid_map(int slot)
static void pid_map(int slot)
{
/* Print a memory map of the process. Obtain the information from VM if
* possible; otherwise fall back on segments from the kernel.

View File

@@ -5,13 +5,13 @@
#include <minix/dmap.h>
#include "cpuinfo.h"
FORWARD void root_hz(void);
FORWARD void root_uptime(void);
FORWARD void root_loadavg(void);
FORWARD void root_kinfo(void);
FORWARD void root_meminfo(void);
FORWARD void root_pci(void);
FORWARD void root_dmap(void);
static void root_hz(void);
static void root_uptime(void);
static void root_loadavg(void);
static void root_kinfo(void);
static void root_meminfo(void);
static void root_pci(void);
static void root_dmap(void);
struct file root_files[] = {
{ "hz", REG_ALL_MODE, (data_t) root_hz },
@@ -28,7 +28,7 @@ struct file root_files[] = {
/*===========================================================================*
* root_hz *
*===========================================================================*/
PRIVATE void root_hz(void)
static void root_hz(void)
{
/* Print the system clock frequency.
*/
@@ -39,7 +39,7 @@ PRIVATE void root_hz(void)
/*===========================================================================*
* root_loadavg *
*===========================================================================*/
PRIVATE void root_loadavg(void)
static void root_loadavg(void)
{
/* Print load averages.
*/
@@ -61,7 +61,7 @@ PRIVATE void root_loadavg(void)
/*===========================================================================*
* root_uptime *
*===========================================================================*/
PRIVATE void root_uptime(void)
static void root_uptime(void)
{
/* Print the current uptime.
*/
@@ -78,7 +78,7 @@ PRIVATE void root_uptime(void)
/*===========================================================================*
* root_kinfo *
*===========================================================================*/
PRIVATE void root_kinfo(void)
static void root_kinfo(void)
{
/* Print general kernel information.
*/
@@ -93,7 +93,7 @@ PRIVATE void root_kinfo(void)
/*===========================================================================*
* root_meminfo *
*===========================================================================*/
PRIVATE void root_meminfo(void)
static void root_meminfo(void)
{
/* Print general memory information.
*/
@@ -109,7 +109,7 @@ PRIVATE void root_meminfo(void)
/*===========================================================================*
* root_pci *
*===========================================================================*/
PRIVATE void root_pci(void)
static void root_pci(void)
{
/* Print information about PCI devices present in the system.
*/
@@ -147,7 +147,7 @@ PRIVATE void root_pci(void)
/*===========================================================================*
* root_dmap *
*===========================================================================*/
PRIVATE void root_dmap(void)
static void root_dmap(void)
{
struct dmap dmap[NR_DEVICES];
int i;

View File

@@ -2,16 +2,16 @@
#include "inc.h"
PUBLIC struct proc proc[NR_PROCS + NR_TASKS];
PUBLIC struct mproc mproc[NR_PROCS];
PUBLIC struct fproc fproc[NR_PROCS];
struct proc proc[NR_PROCS + NR_TASKS];
struct mproc mproc[NR_PROCS];
struct fproc fproc[NR_PROCS];
PRIVATE int nr_pid_entries;
static int nr_pid_entries;
/*===========================================================================*
* slot_in_use *
*===========================================================================*/
PRIVATE int slot_in_use(int slot)
static int slot_in_use(int slot)
{
/* Return whether the given slot is in use by a process.
*/
@@ -24,7 +24,7 @@ PRIVATE int slot_in_use(int slot)
/*===========================================================================*
* check_owner *
*===========================================================================*/
PRIVATE int check_owner(struct inode *node, int slot)
static int check_owner(struct inode *node, int slot)
{
/* Check if the owner user and group ID of the inode are still in sync
* the current effective user and group ID of the given process.
@@ -42,7 +42,7 @@ PRIVATE int check_owner(struct inode *node, int slot)
/*===========================================================================*
* make_stat *
*===========================================================================*/
PRIVATE void make_stat(struct inode_stat *stat, int slot, int index)
static void make_stat(struct inode_stat *stat, int slot, int index)
{
/* Fill in an inode_stat structure for the given process slot and
* per-pid file index (or NO_INDEX for the process subdirectory root).
@@ -68,7 +68,7 @@ PRIVATE void make_stat(struct inode_stat *stat, int slot, int index)
/*===========================================================================*
* dir_is_pid *
*===========================================================================*/
PRIVATE int dir_is_pid(struct inode *node)
static int dir_is_pid(struct inode *node)
{
/* Return whether the given node is a PID directory.
*/
@@ -80,7 +80,7 @@ PRIVATE int dir_is_pid(struct inode *node)
/*===========================================================================*
* update_proc_table *
*===========================================================================*/
PRIVATE int update_proc_table(void)
static int update_proc_table(void)
{
/* Get the process table from the kernel.
* Check the magic number in the table entries.
@@ -103,7 +103,7 @@ PRIVATE int update_proc_table(void)
/*===========================================================================*
* update_mproc_table *
*===========================================================================*/
PRIVATE int update_mproc_table(void)
static int update_mproc_table(void)
{
/* Get the process table from PM.
* Check the magic number in the table entries.
@@ -127,7 +127,7 @@ PRIVATE int update_mproc_table(void)
/*===========================================================================*
* update_fproc_table *
*===========================================================================*/
PRIVATE int update_fproc_table(void)
static int update_fproc_table(void)
{
/* Get the process table from VFS.
*/
@@ -138,7 +138,7 @@ PRIVATE int update_fproc_table(void)
/*===========================================================================*
* update_tables *
*===========================================================================*/
PRIVATE int update_tables(void)
static int update_tables(void)
{
/* Get the process tables from the kernel, PM, and VFS.
*/
@@ -156,7 +156,7 @@ PRIVATE int update_tables(void)
/*===========================================================================*
* init_tree *
*===========================================================================*/
PUBLIC int init_tree(void)
int init_tree(void)
{
/* Initialize this module, before VTreeFS is started. As part of the
* process, check if we're not compiled against a kernel different from
@@ -181,7 +181,7 @@ PUBLIC int init_tree(void)
/*===========================================================================*
* out_of_inodes *
*===========================================================================*/
PRIVATE void out_of_inodes(void)
static void out_of_inodes(void)
{
/* Out of inodes - the NR_INODES value is set too low. We can not do
* much, but we might be able to continue with degraded functionality,
@@ -201,7 +201,7 @@ PRIVATE void out_of_inodes(void)
/*===========================================================================*
* construct_pid_dirs *
*===========================================================================*/
PRIVATE void construct_pid_dirs(void)
static void construct_pid_dirs(void)
{
/* Regenerate the set of PID directories in the root directory of the
* file system. Add new directories and delete old directories as
@@ -288,7 +288,7 @@ PRIVATE void construct_pid_dirs(void)
/*===========================================================================*
* make_one_pid_entry *
*===========================================================================*/
PRIVATE void make_one_pid_entry(struct inode *parent, char *name, int slot)
static void make_one_pid_entry(struct inode *parent, char *name, int slot)
{
/* Construct one file in a PID directory, if a file with the given name
* should exist at all.
@@ -321,7 +321,7 @@ PRIVATE void make_one_pid_entry(struct inode *parent, char *name, int slot)
/*===========================================================================*
* make_all_pid_entries *
*===========================================================================*/
PRIVATE void make_all_pid_entries(struct inode *parent, int slot)
static void make_all_pid_entries(struct inode *parent, int slot)
{
/* Construct all files in a PID directory.
*/
@@ -347,7 +347,7 @@ PRIVATE void make_all_pid_entries(struct inode *parent, int slot)
/*===========================================================================*
* construct_pid_entries *
*===========================================================================*/
PRIVATE void construct_pid_entries(struct inode *parent, char *name)
static void construct_pid_entries(struct inode *parent, char *name)
{
/* Construct one requested file entry, or all file entries, in a PID
* directory.
@@ -377,7 +377,7 @@ PRIVATE void construct_pid_entries(struct inode *parent, char *name)
/*===========================================================================*
* pid_read *
*===========================================================================*/
PRIVATE void pid_read(struct inode *node)
static void pid_read(struct inode *node)
{
/* Data is requested from one of the files in a PID directory. Call the
* function that is responsible for generating the data for that file.
@@ -402,7 +402,7 @@ PRIVATE void pid_read(struct inode *node)
/*===========================================================================*
* pid_link *
*===========================================================================*/
PRIVATE int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max))
static int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max))
{
/* The contents of a symbolic link in a PID directory are requested.
* This function is a placeholder for future use.
@@ -417,7 +417,7 @@ PRIVATE int pid_link(struct inode *UNUSED(node), char *ptr, int UNUSED(max))
/*===========================================================================*
* lookup_hook *
*===========================================================================*/
PUBLIC int lookup_hook(struct inode *parent, char *name,
int lookup_hook(struct inode *parent, char *name,
cbdata_t UNUSED(cbdata))
{
/* Path name resolution hook, for a specific parent and name pair.
@@ -464,7 +464,7 @@ PUBLIC int lookup_hook(struct inode *parent, char *name,
/*===========================================================================*
* getdents_hook *
*===========================================================================*/
PUBLIC int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata))
int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata))
{
/* Directory entry retrieval hook, for potentially all files in a
* directory. Make sure that all files that are supposed to be
@@ -485,7 +485,7 @@ PUBLIC int getdents_hook(struct inode *node, cbdata_t UNUSED(cbdata))
/*===========================================================================*
* read_hook *
*===========================================================================*/
PUBLIC int read_hook(struct inode *node, off_t off, char **ptr,
int read_hook(struct inode *node, off_t off, char **ptr,
size_t *len, cbdata_t cbdata)
{
/* Regular file read hook. Call the appropriate callback function to
@@ -509,7 +509,7 @@ PUBLIC int read_hook(struct inode *node, off_t off, char **ptr,
/*===========================================================================*
* rdlink_hook *
*===========================================================================*/
PUBLIC int rdlink_hook(struct inode *node, char *ptr, size_t max,
int rdlink_hook(struct inode *node, char *ptr, size_t max,
cbdata_t UNUSED(cbdata))
{
/* Symbolic link resolution hook. Not used yet.

View File

@@ -5,7 +5,7 @@
/*===========================================================================*
* procfs_getloadavg *
*===========================================================================*/
PUBLIC int procfs_getloadavg(struct load *loadavg, int nelem)
int procfs_getloadavg(struct load *loadavg, int nelem)
{
/* Retrieve system load average information.
*/