retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include <dirent.h>
|
||||
|
||||
PUBLIC struct buf {
|
||||
struct buf {
|
||||
char b_data[_MAX_BLOCK_SIZE]; /* ordinary user data */
|
||||
block_t b_blocknr; /* block number of its (minor) device */
|
||||
char b_count; /* number of users of this buffer */
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
#include <minix/bdev.h>
|
||||
#include "buf.h"
|
||||
|
||||
FORWARD int read_block(struct buf *);
|
||||
static int read_block(struct buf *);
|
||||
|
||||
PUBLIC struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the
|
||||
struct buf *bp_to_pickup = buf; /* This is a pointer to the next node in the
|
||||
* buffer cache to pick up*/
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(block)
|
||||
struct buf *get_block(block)
|
||||
register block_t block; /* which block is wanted? */
|
||||
{
|
||||
register struct buf *bp, *free_bp;
|
||||
@@ -76,7 +76,7 @@ register block_t block; /* which block is wanted? */
|
||||
/*===========================================================================*
|
||||
* put_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_block(bp)
|
||||
void put_block(bp)
|
||||
register struct buf *bp; /* pointer to the buffer to be released */
|
||||
{
|
||||
if (bp == NULL) return; /* it is easier to check here than in caller */
|
||||
@@ -87,7 +87,7 @@ register struct buf *bp; /* pointer to the buffer to be released */
|
||||
/*===========================================================================*
|
||||
* read_block *
|
||||
*===========================================================================*/
|
||||
PRIVATE int read_block(bp)
|
||||
static int read_block(bp)
|
||||
register struct buf *bp; /* buffer pointer */
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_putnode()
|
||||
int fs_putnode()
|
||||
{
|
||||
/* Find the inode specified by the request message and decrease its counter. */
|
||||
int count;
|
||||
@@ -40,7 +40,7 @@ PUBLIC int fs_putnode()
|
||||
/*===========================================================================*
|
||||
* release_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC int release_dir_record(dir)
|
||||
int release_dir_record(dir)
|
||||
struct dir_record *dir;
|
||||
{
|
||||
/* Release a dir record (decrement the counter) */
|
||||
@@ -65,7 +65,7 @@ struct dir_record *dir;
|
||||
/*===========================================================================*
|
||||
* get_free_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *get_free_dir_record(void)
|
||||
struct dir_record *get_free_dir_record(void)
|
||||
{
|
||||
/* Get a free dir record */
|
||||
struct dir_record *dir;
|
||||
@@ -85,7 +85,7 @@ PUBLIC struct dir_record *get_free_dir_record(void)
|
||||
/*===========================================================================*
|
||||
* get_dir_record *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *get_dir_record(id_dir_record)
|
||||
struct dir_record *get_dir_record(id_dir_record)
|
||||
ino_t id_dir_record;
|
||||
{
|
||||
struct dir_record *dir = NULL;
|
||||
@@ -115,7 +115,7 @@ ino_t id_dir_record;
|
||||
/*===========================================================================*
|
||||
* get_free_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
/* Get a free extended attribute structure */
|
||||
struct ext_attr_rec *dir;
|
||||
for(dir = ext_attr_recs; dir < &ext_attr_recs[NR_ATTR_RECS]; dir++) {
|
||||
@@ -132,7 +132,7 @@ PUBLIC struct ext_attr_rec *get_free_ext_attr(void) {
|
||||
/*===========================================================================*
|
||||
* create_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
{
|
||||
/* Fill an extent structure from the data read on the device */
|
||||
if (ext == NULL) return(EINVAL);
|
||||
@@ -161,7 +161,7 @@ PUBLIC int create_ext_attr(struct ext_attr_rec *ext,char *buffer)
|
||||
/*===========================================================================*
|
||||
* create_ext_attr *
|
||||
*===========================================================================*/
|
||||
PUBLIC int create_dir_record(dir,buffer,address)
|
||||
int create_dir_record(dir,buffer,address)
|
||||
struct dir_record *dir;
|
||||
char *buffer;
|
||||
u32_t address;
|
||||
@@ -218,7 +218,7 @@ u32_t address;
|
||||
/*===========================================================================*
|
||||
* load_dir_record_from_disk *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dir_record *load_dir_record_from_disk(address)
|
||||
struct dir_record *load_dir_record_from_disk(address)
|
||||
u32_t address;
|
||||
{
|
||||
/* This function load a particular dir record from a specific address
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "const.h"
|
||||
|
||||
PUBLIC struct dir_record {
|
||||
struct dir_record {
|
||||
u8_t length; /* The length of the record */
|
||||
u8_t ext_attr_rec_length;
|
||||
u32_t loc_extent_l; /* The same data (in this case loc_extent)is */
|
||||
@@ -30,7 +30,7 @@ PUBLIC struct dir_record {
|
||||
|
||||
} dir_records[NR_DIR_RECORDS];
|
||||
|
||||
PUBLIC struct ext_attr_rec {
|
||||
struct ext_attr_rec {
|
||||
u32_t own_id;
|
||||
u32_t group_id;
|
||||
u16_t permissions;
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
#include "glo.h"
|
||||
|
||||
/* Declare some local functions. */
|
||||
FORWARD void get_work(message *m_in);
|
||||
static void get_work(message *m_in);
|
||||
|
||||
/* 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);
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(void) {
|
||||
int main(void) {
|
||||
endpoint_t who_e;
|
||||
int ind, error, transid;
|
||||
|
||||
@@ -78,7 +78,7 @@ PUBLIC int main(void) {
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -96,7 +96,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the iso9660fs server. */
|
||||
|
||||
@@ -111,7 +111,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *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;
|
||||
@@ -127,7 +127,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(m_in)
|
||||
static void get_work(m_in)
|
||||
message *m_in; /* pointer to message */
|
||||
{
|
||||
int s; /* receive status */
|
||||
@@ -138,7 +138,7 @@ message *m_in; /* pointer to message */
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void reply(who, m_out)
|
||||
void reply(who, m_out)
|
||||
int who;
|
||||
message *m_out; /* report result */
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_sync()
|
||||
int fs_sync()
|
||||
{
|
||||
/* Always mounted read only, so nothing to sync */
|
||||
return(OK); /* sync() can't fail */
|
||||
@@ -17,7 +17,7 @@ PUBLIC int fs_sync()
|
||||
/*===========================================================================*
|
||||
* fs_new_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_new_driver(void)
|
||||
int fs_new_driver(void)
|
||||
{
|
||||
/* Set a new driver endpoint for this device. */
|
||||
dev_t dev;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_readsuper() {
|
||||
int fs_readsuper() {
|
||||
|
||||
cp_grant_id_t label_gid;
|
||||
size_t label_len;
|
||||
@@ -61,7 +61,7 @@ PUBLIC int fs_readsuper() {
|
||||
/*===========================================================================*
|
||||
* fs_mountpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_mountpoint()
|
||||
int fs_mountpoint()
|
||||
{
|
||||
/* This function looks up the mount point, it checks the condition whether
|
||||
* the partition can be mounted on the inode or not.
|
||||
@@ -93,7 +93,7 @@ PUBLIC int fs_mountpoint()
|
||||
/*===========================================================================*
|
||||
* fs_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_unmount(void) {
|
||||
int fs_unmount(void) {
|
||||
release_v_pri(&v_pri); /* Release the super block */
|
||||
bdev_close(fs_dev);
|
||||
unmountdone = TRUE;
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
#include "buf.h"
|
||||
|
||||
FORWARD char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
static char *get_name(char *name, char string[NAME_MAX+1]);
|
||||
static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
|
||||
dir_record **res_inop, size_t *offsetp);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_lookup() {
|
||||
int fs_lookup() {
|
||||
cp_grant_id_t grant;
|
||||
int r, len, flags;
|
||||
size_t offset;
|
||||
@@ -80,7 +80,7 @@ PUBLIC int fs_lookup() {
|
||||
/*===========================================================================*
|
||||
* search_dir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int search_dir(ldir_ptr,string,numb)
|
||||
int search_dir(ldir_ptr,string,numb)
|
||||
register struct dir_record *ldir_ptr; /* dir record parent */
|
||||
char string[NAME_MAX]; /* component to search for */
|
||||
ino_t *numb; /* pointer to new dir record */
|
||||
@@ -182,7 +182,7 @@ PUBLIC int search_dir(ldir_ptr,string,numb)
|
||||
/*===========================================================================*
|
||||
* parse_path *
|
||||
*===========================================================================*/
|
||||
PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp)
|
||||
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp)
|
||||
ino_t dir_ino;
|
||||
ino_t root_ino;
|
||||
int flags;
|
||||
@@ -281,7 +281,7 @@ size_t *offsetp;
|
||||
/*===========================================================================*
|
||||
* advance *
|
||||
*===========================================================================*/
|
||||
PUBLIC int advance(dirp, string, resp)
|
||||
int advance(dirp, string, resp)
|
||||
struct dir_record *dirp; /* inode for directory to be searched */
|
||||
char string[NAME_MAX]; /* component name to look for */
|
||||
struct dir_record **resp; /* resulting inode */
|
||||
@@ -323,7 +323,7 @@ struct dir_record **resp; /* resulting inode */
|
||||
/*===========================================================================*
|
||||
* get_name *
|
||||
*===========================================================================*/
|
||||
PRIVATE char *get_name(path_name, string)
|
||||
static char *get_name(path_name, string)
|
||||
char *path_name; /* path name to parse */
|
||||
char string[NAME_MAX+1]; /* component extracted from 'old_name' */
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/*===========================================================================*
|
||||
* fs_access *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_access()
|
||||
int fs_access()
|
||||
{
|
||||
struct dir_record *rip;
|
||||
int r = OK;
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#endif
|
||||
#include "buf.h"
|
||||
|
||||
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
|
||||
static char getdents_buf[GETDENTS_BUFSIZ];
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* fs_read *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_read(void) {
|
||||
int fs_read(void) {
|
||||
int r, chunk, block_size;
|
||||
int nrbytes;
|
||||
cp_grant_id_t gid;
|
||||
@@ -76,7 +76,7 @@ PUBLIC int fs_read(void) {
|
||||
/*===========================================================================*
|
||||
* fs_bread *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_bread(void)
|
||||
int fs_bread(void)
|
||||
{
|
||||
int r, rw_flag, chunk, block_size;
|
||||
cp_grant_id_t gid;
|
||||
@@ -134,7 +134,7 @@ PUBLIC int fs_bread(void)
|
||||
/*===========================================================================*
|
||||
* fs_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_getdents(void) {
|
||||
int fs_getdents(void) {
|
||||
struct dir_record *dir;
|
||||
ino_t ino;
|
||||
cp_grant_id_t gid;
|
||||
@@ -280,7 +280,7 @@ PUBLIC int fs_getdents(void) {
|
||||
/*===========================================================================*
|
||||
* read_chunk *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed)
|
||||
int read_chunk(dir, position, off, chunk, left, gid, buf_off, block_size, completed)
|
||||
register struct dir_record *dir;/* pointer to inode for file to be rd/wr */
|
||||
u64_t position; /* position within file to read or write */
|
||||
unsigned off; /* off within the current block */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*===========================================================================*
|
||||
* stat_dir_record *
|
||||
*===========================================================================*/
|
||||
PRIVATE int stat_dir_record(
|
||||
static int stat_dir_record(
|
||||
register struct dir_record *dir, /* pointer to dir record to stat */
|
||||
int pipe_pos, /* position in a pipe, supplied by fstat() */
|
||||
endpoint_t who_e, /* Caller endpoint */
|
||||
@@ -78,7 +78,7 @@ PRIVATE int stat_dir_record(
|
||||
/*===========================================================================*
|
||||
* fs_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_stat()
|
||||
int fs_stat()
|
||||
{
|
||||
register int r; /* return value */
|
||||
struct dir_record *dir;
|
||||
@@ -96,7 +96,7 @@ PUBLIC int fs_stat()
|
||||
/*===========================================================================*
|
||||
* fs_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_fstatfs()
|
||||
int fs_fstatfs()
|
||||
{
|
||||
struct statfs st;
|
||||
int r;
|
||||
@@ -114,7 +114,7 @@ PUBLIC int fs_fstatfs()
|
||||
/*===========================================================================*
|
||||
* fs_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_statvfs()
|
||||
int fs_statvfs()
|
||||
{
|
||||
struct statvfs st;
|
||||
int r;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/* This function is called when the filesystem is umounted. It releases the
|
||||
* super block. */
|
||||
PUBLIC int release_v_pri(v_pri)
|
||||
int release_v_pri(v_pri)
|
||||
register struct iso9660_vd_pri *v_pri;
|
||||
{
|
||||
/* Release the root dir record */
|
||||
@@ -21,7 +21,7 @@ PUBLIC int release_v_pri(v_pri)
|
||||
/* This function fullfill the super block data structure using the information
|
||||
* contained in the stream buf. Such stream is physically read from the device
|
||||
* . */
|
||||
PUBLIC int create_v_pri(v_pri,buf,address)
|
||||
int create_v_pri(v_pri,buf,address)
|
||||
register struct iso9660_vd_pri *v_pri;
|
||||
register char* buf;
|
||||
register unsigned long address;
|
||||
@@ -80,7 +80,7 @@ PUBLIC int create_v_pri(v_pri,buf,address)
|
||||
|
||||
/* This function reads from a ISO9660 filesystem (in the device dev) the
|
||||
* super block and saves it in v_pri. */
|
||||
PUBLIC int read_vds(
|
||||
int read_vds(
|
||||
register struct iso9660_vd_pri *v_pri,
|
||||
register dev_t dev
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define ROOT_INO_NR 1
|
||||
|
||||
/* Structure for the primary volume descriptor */
|
||||
PUBLIC struct iso9660_vd_pri {
|
||||
struct iso9660_vd_pri {
|
||||
u8_t vd_type;
|
||||
char standard_id[ISO9660_SIZE_STANDARD_ID];
|
||||
u8_t vd_version;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "inc.h"
|
||||
|
||||
PUBLIC int (*fs_call_vec[])(void) = {
|
||||
int (*fs_call_vec[])(void) = {
|
||||
no_sys, /* 0: not used */
|
||||
no_sys, /* 1: not used */
|
||||
fs_putnode, /* 2 */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*===========================================================================*
|
||||
* do_noop *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_noop(void)
|
||||
int do_noop(void)
|
||||
{
|
||||
/* Do not do anything. */
|
||||
return(OK);
|
||||
@@ -17,7 +17,7 @@ PUBLIC int do_noop(void)
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys(void)
|
||||
int no_sys(void)
|
||||
{
|
||||
/* Somebody has used an illegal system call number */
|
||||
return(EINVAL);
|
||||
|
||||
Reference in New Issue
Block a user