-int lexer_lexstring(uint8_t const*, int);
-#define PUSHTOK(T,L) yypush_parse(apc_pstate, T, L, apc_cstate)
-
-/* Init
- Establishes yy states
-*/
-int scanner_init
-( void )
-{ if (apc_pstate != NULL || apc_cstate != NULL)
- scanner_quit();
- apc_pstate = yypstate_new();
- apc_cstate = yycstate_new();
- return (apc_pstate == NULL || apc_cstate == NULL);
-}
-
-/* Quit
- Free initialized memory
-*/
-void scanner_quit
-( void )
-{ yypstate_delete(apc_pstate);
- yycstate_delete(apc_cstate);
- apc_pstate = NULL;
- apc_cstate = NULL;
-}
-
-/* Scan the provided path
- Changes working directory to the provided pathname and, if successful, sends
- a directory stream of the provided path to scanner_scandir
-*/
-int scanner_scanpath
-( char const* pathname )
-{ DIR* dirp;
- errno = 0;
- if ((dirp = opendir(pathname)) == NULL || errno)
- { fprintf(stderr, "Path %s could not be accessed\n", pathname);
- return -1;
- }
- if (chdir(pathname))
- return -1;
- return scanner_scandir(dirp);
-}
+int lexer_init(void);
+extern //lexer.rl
+void lexer_quit(void);
+extern //lexer.rl
+int lexer_lexfile(uint8_t*);
+extern //lexer.rl
+int lexer_lexdir(uint8_t*);
+extern //lexer.rl
+void lexer_closedir(void);