/*
* Copyright (c) 1987,1997, Prentice Hall
* All rights reserved.
*
* Redistribution and use of the MINIX operating system in source and
* binary forms, with or without modification, are permitted provided
* that the following conditions are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* - Neither the name of Prentice Hall nor the names of the software
* authors or contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @addtogroup FileSystemImpl
* @{
*/
/**
* @file proto.h
* @brief Function prototypes for the File System implementation.
*/
#ifndef _PROTO_H
#define _PROTO_H
#include "block.h"
#include "inode.h"
#include "super.h"
#include "file.h"
#include "../share/shared_proto.h"
/* block.c */
int init_block(void);
block_t *get_block(block_num_t block);
block_t *get_zero_block(void);
void read_block(block_t *bp);
/* dir.c */
int do_sum(void);
int do_readentry(void);
/* filedes.c */
filp_t *find_filp(inode_t *rip);
int get_fd(int start, int *k, filp_t **fpt);
filp_t *get_filp(int fild);
/* inode.c */
void dup_inode(inode_t *rip);
void put_inode(inode_t *rip);
inode_t *get_inode(int numb);
void read_inode(inode_t *rip);
/* open.c */
int do_close(void);
int do_lseek(void);
int do_open(void);
/* path.c */
inode_t *eat_path(char *path);
inode_t *last_dir(char *path, char *string, int string_length);
inode_t *advance(inode_t *dirp, char *string, int string_length);
int search_dir(register inode_t *ldir_ptr,
char string [NAME_MAX], ino_t *numb, int flag);
int search_dir_ex(register inode_t *ldir_ptr,
char string[NAME_MAX_EX], ino_t *numb, int flag);
/* printing.c */
int init_printing(void);
int print_console(char *str);
int print_console_int(char *str, int arg);
/* read.c */
int do_read(void);
block_num_t read_map(inode_t *rip, offset_t position);
zone_t rd_indir(block_t *bp, int index);
/* stadir.c */
int do_chdir(void);
int do_fstat(void);
int do_stat(void);
/* super.c */
int init_super_block(void);
super_block_t *get_super(void);
int read_super(super_block_t *sp);
/* utility.c */
int fetch_name(char *path, int len);
int no_sys(void);
unsigned conv2(int norm, int w);
long conv4(int norm, long x);
int fs_strncmp(const char *src, const char *dst, size_t len);
#endif /* _PROTO_H */
/**
* }
*/