/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2013, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Error location */
FilePos CfgErrorPos;
-/* Input sources for the configuration */
+/* Input source for the configuration */
static const char* CfgName = 0;
-static const char* CfgBuf = 0;
/* Other input stuff */
static int C = ' ';
static void NextChar (void)
/* Read the next character from the input file */
{
- if (CfgBuf) {
- /* Read from buffer */
- C = (unsigned char)(*CfgBuf);
- if (C == 0) {
- C = EOF;
- } else {
- ++CfgBuf;
- }
- } else {
- /* Read from the file */
- C = getc (InputFile);
- }
+ /* Read from the file */
+ C = getc (InputFile);
/* Count columns */
if (C != EOF) {
-void CfgSetBuf (const char* Buf)
-/* Set a memory buffer for the config */
-{
- CfgBuf = Buf;
-}
-
-
-
int CfgAvail (void)
/* Return true if we have a configuration available */
{
- return CfgName != 0 || CfgBuf != 0;
+ return CfgName != 0;
}
void CfgOpenInput (void)
/* Open the input file if we have one */
{
- /* If we have a config name given, open the file, otherwise we will read
- * from a buffer.
- */
- if (!CfgBuf) {
-
- /* Open the file */
- InputFile = fopen (CfgName, "r");
- if (InputFile == 0) {
- Error ("Cannot open `%s': %s", CfgName, strerror (errno));
- }
-
+ /* Open the file */
+ InputFile = fopen (CfgName, "r");
+ if (InputFile == 0) {
+ Error ("Cannot open `%s': %s", CfgName, strerror (errno));
}
/* Initialize variables */
C = ' ';
InputPos.Line = 1;
InputPos.Col = 0;
- InputPos.Name = GetStringId (CfgBuf? "[builtin config]" : CfgName);
+ InputPos.Name = GetStringId (CfgName);
/* Start the ball rolling ... */
CfgNextTok ();
/* */
/* */
/* */
-/* (C) 1998-2012, Ullrich von Bassewitz */
+/* (C) 1998-2013, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
void CfgSetName (const char* Name);
/* Set a name for a config file */
-void CfgSetBuf (const char* Buf);
-/* Set a memory buffer for the config */
-
int CfgAvail (void);
/* Return true if we have a configuration available */
-