mkproto.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>

Include dependency graph for mkproto.c:

Go to the source code of this file.

Defines

#define DEF_UID   2
#define DEF_GID   1
#define DEF_PROT   0555
#define DEF_BLOCKS   360
#define DEF_INODES   63
#define DEF_INDENTSTR   "\t"
#define major(x)   ( (x>>8) & 0377)
#define minor(x)   (x & 0377)

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (void descend,(char *dirname))
 _PROTOTYPE (void display_attrib,(char *name, struct stat *st))
 _PROTOTYPE (void usage,(char *binname))
 _PROTOTYPE (void open_outfile,(void))
int main (int argc, argv)
void descend (char *dirname)
void display_attrib (char *name, struct stat *st)
void usage (char *binname)
void open_outfile ()

Variables

int count
int origlen
int tabs
int gid
int uid
int prot
int same_uid
int same_gid
int same_prot
int blocks
int inodes
int block_given
int inode_given
int dprot
char * indentstr
char * proto_file
char * top
FILEoutfile
int optind
char * optarg


Define Documentation

#define DEF_BLOCKS   360
 

Definition at line 18 of file mkproto.c.

Referenced by main(), and usage().

#define DEF_GID   1
 

Definition at line 16 of file mkproto.c.

Referenced by main(), and usage().

#define DEF_INDENTSTR   "\t"
 

Definition at line 20 of file mkproto.c.

Referenced by main().

#define DEF_INODES   63
 

Definition at line 19 of file mkproto.c.

Referenced by main(), and usage().

#define DEF_PROT   0555
 

Definition at line 17 of file mkproto.c.

Referenced by main(), and usage().

#define DEF_UID   2
 

Definition at line 15 of file mkproto.c.

Referenced by main(), and usage().

#define major x   )     ( (x>>8) & 0377)
 

Definition at line 23 of file mkproto.c.

#define minor x   )     (x & 0377)
 

Definition at line 24 of file mkproto.c.


Function Documentation

_PROTOTYPE void  open_outfile,
(void) 
 

_PROTOTYPE void  usage,
(char *binname) 
 

_PROTOTYPE void  display_attrib,
(char *name, struct stat *st
 

_PROTOTYPE void  descend,
(char *dirname) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

void descend char *  dirname  ) 
 

Definition at line 131 of file mkproto.c.

References count, dirent::d_name, display_attrib(), fprintf(), i, indentstr, malloc(), NULL, opendir, outfile, PATH_MAX, readdir, S_IFDIR, S_IFMT, st, stat::st_mode, stat, stderr, strcat(), strcpy(), strlen(), and tabs.

Referenced by fts_build(), and main().

void display_attrib char *  name,
struct stat st
 

Definition at line 201 of file mkproto.c.

References fprintf(), gid, i, indentstr, prot, S_IFBLK, S_IFCHR, S_IFDIR, S_IFMT, S_ISGID, S_ISUID, same_gid, same_prot, same_uid, st, stat::st_gid, stat::st_mode, stat::st_uid, tabs, and uid.

Referenced by descend(), and main().

int main int  argc,
argv 
 

Definition at line 44 of file mkproto.c.

References atoi, block_given, blocks, count, DEF_BLOCKS, DEF_GID, DEF_INDENTSTR, DEF_INODES, DEF_PROT, DEF_UID, descend(), display_attrib(), EOF, fprintf(), getopt(), gid, indentstr, inode_given, inodes, open_outfile(), optarg, optind, origlen, outfile, prot, proto_file, S_IFDIR, S_IFMT, same_gid, same_prot, same_uid, sscanf(), st, stat::st_mode, stat, stderr, strlen(), tabs, top, uid, and usage.

void open_outfile  ) 
 

Definition at line 244 of file mkproto.c.

References fopen(), fprintf(), NULL, proto_file, stderr, and stdout.

Referenced by files_merge(), main(), and sort().

void usage char *  binname  ) 
 

Definition at line 228 of file mkproto.c.

References DEF_BLOCKS, DEF_GID, DEF_INODES, DEF_PROT, DEF_UID, exit(), fprintf(), and stderr.


Variable Documentation

int block_given
 

Definition at line 30 of file mkproto.c.

Referenced by main().

int blocks
 

Definition at line 29 of file mkproto.c.

Referenced by _countBlocks(), copy(), file_mdu(), main(), and skip_entry().

int count
 

Definition at line 28 of file mkproto.c.

int dprot
 

Definition at line 30 of file mkproto.c.

int gid
 

Definition at line 29 of file mkproto.c.

char* indentstr
 

Definition at line 31 of file mkproto.c.

Referenced by descend(), display_attrib(), and main().

int inode_given
 

Definition at line 30 of file mkproto.c.

Referenced by main().

int inodes
 

Definition at line 29 of file mkproto.c.

Referenced by Draw_Offset(), and main().

char* optarg
 

Definition at line 59 of file options.c.

int optind
 

Definition at line 29 of file getopt.c.

int origlen
 

Definition at line 28 of file mkproto.c.

Referenced by main(), and TGZfname().

FILE* outfile
 

Definition at line 33 of file mkproto.c.

int prot
 

Definition at line 29 of file mkproto.c.

Referenced by display_attrib(), and main().

char* proto_file
 

Definition at line 32 of file mkproto.c.

Referenced by main(), and open_outfile().

int same_gid
 

Definition at line 29 of file mkproto.c.

Referenced by display_attrib(), and main().

int same_prot
 

Definition at line 29 of file mkproto.c.

Referenced by display_attrib(), and main().

int same_uid
 

Definition at line 29 of file mkproto.c.

Referenced by display_attrib(), and main().

int tabs
 

Definition at line 28 of file mkproto.c.

Referenced by descend(), display_attrib(), and main().

char * top
 

Definition at line 32 of file mkproto.c.

int uid
 

Definition at line 29 of file mkproto.c.


Generated on Fri Apr 14 23:06:58 2006 for minix by  doxygen 1.4.6