1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-07-05 16:37:38 -04:00

Review prototypes of function with filenames and lock flag.

This commit is contained in:
Renaud 2013-09-19 15:33:56 +08:00
parent fb6d6bd595
commit 0aea939e21
2 changed files with 15 additions and 13 deletions

16
file.c
View File

@ -205,9 +205,9 @@ static int resetkey(void)
* getfile() * getfile()
* *
* char fname[]; file name to find * char fname[]; file name to find
* int lockfl; check the file for locks? * boolean lockfl; check the file for locks?
*/ */
int getfile(char *fname, int lockfl) int getfile( const char *fname, boolean lockfl)
{ {
struct buffer *bp; struct buffer *bp;
struct line *lp; struct line *lp;
@ -271,9 +271,9 @@ int getfile(char *fname, int lockfl)
* and before it is read. * and before it is read.
* *
* char fname[]; name of file to read * char fname[]; name of file to read
* int lockfl; check for file locks? * boolean lockfl; check for file locks?
*/ */
int readin(char *fname, int lockfl) int readin(const char *fname, boolean lockfl)
{ {
struct line *lp1; struct line *lp1;
struct line *lp2; struct line *lp2;
@ -409,9 +409,9 @@ int readin(char *fname, int lockfl)
* I suppose that this information could be put in * I suppose that this information could be put in
* a better place than a line of code. * a better place than a line of code.
*/ */
void makename(char *bname, char *fname) void makename(char *bname, const char *fname)
{ {
char *cp1; const char *cp1;
char *cp2; char *cp2;
cp1 = &fname[0]; cp1 = &fname[0];
@ -548,7 +548,7 @@ int filesave(int f, int n)
* a macro for this. Most of the grief is error * a macro for this. Most of the grief is error
* checking of some sort. * checking of some sort.
*/ */
int writeout(char *fn) int writeout( const char *fn)
{ {
int s; int s;
struct line *lp; struct line *lp;
@ -631,7 +631,7 @@ int filename(int f, int n)
* buffer, Called by insert file command. Return the final * buffer, Called by insert file command. Return the final
* status of the read. * status of the read.
*/ */
int ifile(char *fname) int ifile( const char *fname)
{ {
struct line *lp0; struct line *lp0;
struct line *lp1; struct line *lp1;

12
file.h
View File

@ -1,6 +1,8 @@
#ifndef _FILE_H_ #ifndef _FILE_H_
#define _FILE_H_ #define _FILE_H_
#include "retcode.h"
#ifndef CRYPT #ifndef CRYPT
#error CRYPT should be defined. #error CRYPT should be defined.
#elif CRYPT #elif CRYPT
@ -12,14 +14,14 @@ int fileread( int f, int n) ;
int insfile( int f, int n) ; int insfile( int f, int n) ;
int filefind( int f, int n) ; int filefind( int f, int n) ;
int viewfile( int f, int n) ; int viewfile( int f, int n) ;
int getfile( char *fname, int lockfl) ; int getfile( const char *fname, boolean lockfl) ;
int readin( char *fname, int lockfl) ; int readin( const char *fname, boolean lockfl) ;
void makename( char *bname, char *fname) ; void makename( char *bname, const char *fname) ;
void unqname( char *name) ; void unqname( char *name) ;
int filewrite( int f, int n) ; int filewrite( int f, int n) ;
int filesave( int f, int n) ; int filesave( int f, int n) ;
int writeout( char *fn) ; int writeout( const char *fn) ;
int filename( int f, int n) ; int filename( int f, int n) ;
int ifile( char *fname) ; int ifile( const char *fname) ;
#endif #endif