2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Add isc_lex_isfile().

This commit is contained in:
Mark Andrews
2000-07-10 05:11:18 +00:00
parent 74c2797077
commit b47f3dc885
2 changed files with 30 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
* 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
#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.
*/
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
#endif /* ISC_LEX_H */

View File

@@ -15,7 +15,7 @@
* 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>
@@ -718,3 +718,17 @@ isc_lex_getsourceline(isc_lex_t *lex) {
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);
}