mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Add isc_lex_isfile().
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: lex.h,v 1.19 2000/06/22 21:57:39 tale Exp $ */
|
/* $Id: lex.h,v 1.20 2000/07/10 05:11:18 marka Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_LEX_H
|
#ifndef ISC_LEX_H
|
||||||
#define ISC_LEX_H 1
|
#define ISC_LEX_H 1
|
||||||
@@ -342,6 +342,20 @@ isc_lex_getsourceline(isc_lex_t *lex);
|
|||||||
* Current line number or 0 if no current source.
|
* Current line number or 0 if no current source.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
isc_boolean_t
|
||||||
|
isc_lex_isfile(isc_lex_t *lex);
|
||||||
|
/*
|
||||||
|
* Return whether the current input source is a file.
|
||||||
|
*
|
||||||
|
* Requires:
|
||||||
|
* 'lex' is a valid lexer.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* ISC_TRUE if the current input is a file,
|
||||||
|
* ISC_FALSE otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* ISC_LEX_H */
|
#endif /* ISC_LEX_H */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: lex.c,v 1.31 2000/06/23 22:32:10 brister Exp $ */
|
/* $Id: lex.c,v 1.32 2000/07/10 05:11:17 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -718,3 +718,17 @@ isc_lex_getsourceline(isc_lex_t *lex) {
|
|||||||
|
|
||||||
return (source->line);
|
return (source->line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isc_boolean_t
|
||||||
|
isc_lex_isfile(isc_lex_t *lex) {
|
||||||
|
inputsource *source;
|
||||||
|
|
||||||
|
REQUIRE(VALID_LEX(lex));
|
||||||
|
|
||||||
|
source = HEAD(lex->sources);
|
||||||
|
|
||||||
|
if (source == NULL)
|
||||||
|
return (ISC_FALSE);
|
||||||
|
|
||||||
|
return (source->is_file);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user