version 1.61, 2005/11/13 07:49:02 |
version 1.62, 2005/11/18 20:56:52 |
|
|
* Open a file for reading. |
* Open a file for reading. |
*/ |
*/ |
int |
int |
ffropen(const char *fn, BUFFER *bp) |
ffropen(const char *fn, struct buffer *bp) |
{ |
{ |
struct stat statbuf; |
struct stat statbuf; |
|
|
|
|
* Open a file for writing. |
* Open a file for writing. |
*/ |
*/ |
int |
int |
ffwopen(const char *fn, BUFFER *bp) |
ffwopen(const char *fn, struct buffer *bp) |
{ |
{ |
int fd; |
int fd; |
mode_t mode = DEFFILEMODE; |
mode_t mode = DEFFILEMODE; |
|
|
*/ |
*/ |
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
ffclose(BUFFER *bp) |
ffclose(struct buffer *bp) |
{ |
{ |
(void) fclose(ffp); |
(void) fclose(ffp); |
return (FIOSUC); |
return (FIOSUC); |
|
|
* buffer. Return the status. |
* buffer. Return the status. |
*/ |
*/ |
int |
int |
ffputbuf(BUFFER *bp) |
ffputbuf(struct buffer *bp) |
{ |
{ |
LINE *lp, *lpend; |
struct line *lp, *lpend; |
|
|
lpend = bp->b_linep; |
lpend = bp->b_linep; |
for (lp = lforw(lpend); lp != lpend; lp = lforw(lp)) { |
for (lp = lforw(lpend); lp != lpend; lp = lforw(lp)) { |
|
|
#endif /* NO_DIRED */ |
#endif /* NO_DIRED */ |
|
|
struct filelist { |
struct filelist { |
LIST fl_l; |
struct list fl_l; |
char fl_name[NFILEN + 2]; |
char fl_name[NFILEN + 2]; |
}; |
}; |
|
|
/* |
/* |
* return list of file names that match the name in buf. |
* return list of file names that match the name in buf. |
*/ |
*/ |
LIST * |
struct list * |
make_file_list(char *buf) |
make_file_list(char *buf) |
{ |
{ |
char *dir, *file, *cp; |
char *dir, *file, *cp; |
int len, preflen, ret; |
int len, preflen, ret; |
DIR *dirp; |
DIR *dirp; |
struct dirent *dent; |
struct dirent *dent; |
LIST *last; |
struct list *last; |
struct filelist *current; |
struct filelist *current; |
char prefixx[NFILEN + 1]; |
char prefixx[NFILEN + 1]; |
|
|
|
|
} |
} |
current->fl_l.l_next = last; |
current->fl_l.l_next = last; |
current->fl_l.l_name = current->fl_name; |
current->fl_l.l_name = current->fl_name; |
last = (LIST *) current; |
last = (struct list *) current; |
} |
} |
closedir(dirp); |
closedir(dirp); |
|
|