#include "parser.tab.h"
/* Public */
-int scanner_init(void);
-void scanner_quit(void);
-int scanner(void);
+int scanner_init(void);
+void scanner_quit(void);
+int scanner(void);
/* Private */
#ifndef DL_STACKSIZE
#define DL_STACKSIZE 64
#define ERR_DEPTH "Fatal: Maximum directory depth of " $(DL_STACKSIZE) \
" exceeded during directory scan\n"
#define ERR_DL "Fatal: Directory List Stack Corruption %x\n", DL_LEN()
-#define TOK_CLOPEN 0x55, 1 //TODO
-#define TOK_CLCLOSE 0x56, 1 //TODO
()
{ struct dirent* direntp;
struct DIR* DIRp;
DL_PUSH(opendir(CWDSTR));
if (DL_CURDIR() == NULL) //open the cwd
goto libfail;
- lexer_pushtok(TOK_CLOPEN); //Push "Open Directory" token
+ lexer_pushtok(CLOPEN, 0); //Push "Open Directory" token
return dredge_current_depth(); //Filter and sort the current depth
}
else if (DL_LEN() >= 0) //Any dirs left? (Including root)
goto libfail;
if (DL_LEN() == -1) //If we just popped root,
return 0; //we're done
- lexer_pushtok(TOK_CLCLOSE); //Else push "Close Directory" token,
+ lexer_pushtok(CLCLOSE, 0); //Else push "Close Directory" token,
if (!chdir("..")) //move up a directory and
goto parse; //start over
}
return DPS_LEN();
}
+