core/Database.cpp
changeset 1656 b0b86d57530c
parent 1406 f5c07ec3c052
child 1947 e73a1e51833b
     1.1 --- a/core/Database.cpp	Tue Oct 30 20:43:59 2007 +0000
     1.2 +++ b/core/Database.cpp	Wed Oct 31 05:04:07 2007 +0000
     1.3 @@ -75,21 +75,21 @@
     1.4  
     1.5  void DBManager::OnSourceModLevelChange(const char *mapName)
     1.6  {
     1.7 -	SMCParseError err;
     1.8 -	unsigned int line = 0;
     1.9 +	SMCError err;
    1.10 +	SMCStates states = {0, 0};
    1.11  
    1.12  	/* We lock and don't give up the lock until we're done.
    1.13  	 * This way the thread's search won't be searching through a
    1.14  	 * potentially empty/corrupt list, which would be very bad.
    1.15  	 */
    1.16  	m_pConfigLock->Lock();
    1.17 -	if ((err = textparsers->ParseFile_SMC(m_Filename, this, &line, NULL)) != SMCParse_Okay)
    1.18 +	if ((err = textparsers->ParseFile_SMC(m_Filename, this, &states)) != SMCError_Okay)
    1.19  	{
    1.20  		g_Logger.LogError("[SM] Detected parse error(s) in file \"%s\"", m_Filename);
    1.21 -		if (err != SMCParse_Custom)
    1.22 +		if (err != SMCError_Custom)
    1.23  		{
    1.24  			const char *txt = textparsers->GetSMCErrorString(err);
    1.25 -			g_Logger.LogError("[SM] Line %d: %s", line, txt);
    1.26 +			g_Logger.LogError("[SM] Line %d: %s", states.line, txt);
    1.27  		}
    1.28  	}
    1.29  	m_pConfigLock->Unlock();
    1.30 @@ -141,12 +141,12 @@
    1.31  }
    1.32  
    1.33  ConfDbInfo s_CurInfo;
    1.34 -SMCParseResult DBManager::ReadSMC_NewSection(const char *name, bool opt_quotes)
    1.35 +SMCResult DBManager::ReadSMC_NewSection(const SMCStates *states, const char *name)
    1.36  {
    1.37  	if (m_ParseLevel)
    1.38  	{
    1.39  		m_ParseLevel++;
    1.40 -		return SMCParse_Continue;
    1.41 +		return SMCResult_Continue;
    1.42  	}
    1.43  
    1.44  	if (m_ParseState == DBPARSE_LEVEL_NONE)
    1.45 @@ -165,14 +165,14 @@
    1.46  		m_ParseLevel++;
    1.47  	}
    1.48  
    1.49 -	return SMCParse_Continue;
    1.50 +	return SMCResult_Continue;
    1.51  }
    1.52  
    1.53 -SMCParseResult DBManager::ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes)
    1.54 +SMCResult DBManager::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
    1.55  {
    1.56  	if (m_ParseLevel)
    1.57  	{
    1.58 -		return SMCParse_Continue;
    1.59 +		return SMCResult_Continue;
    1.60  	}
    1.61  
    1.62  	if (m_ParseState == DBPARSE_LEVEL_MAIN)
    1.63 @@ -203,7 +203,7 @@
    1.64  		}
    1.65  	}
    1.66  
    1.67 -	return SMCParse_Continue;
    1.68 +	return SMCResult_Continue;
    1.69  }
    1.70  
    1.71  #define ASSIGN_VAR(var) \
    1.72 @@ -213,12 +213,12 @@
    1.73  		s_CurInfo.info.var = m_StrTab.GetString(s_CurInfo.var); \
    1.74  	}
    1.75  
    1.76 -SMCParseResult DBManager::ReadSMC_LeavingSection()
    1.77 +SMCResult DBManager::ReadSMC_LeavingSection(const SMCStates *states)
    1.78  {
    1.79  	if (m_ParseLevel)
    1.80  	{
    1.81  		m_ParseLevel--;
    1.82 -		return SMCParse_Continue;
    1.83 +		return SMCResult_Continue;
    1.84  	}
    1.85  
    1.86  	if (m_ParseState == DBPARSE_LEVEL_DATABASE)
    1.87 @@ -239,10 +239,10 @@
    1.88  		m_ParseState = DBPARSE_LEVEL_MAIN;
    1.89  	} else if (m_ParseState == DBPARSE_LEVEL_MAIN) {
    1.90  		m_ParseState = DBPARSE_LEVEL_NONE;
    1.91 -		return SMCParse_Halt;
    1.92 +		return SMCResult_Halt;
    1.93  	}
    1.94  
    1.95 -	return SMCParse_Continue;
    1.96 +	return SMCResult_Continue;
    1.97  }
    1.98  #undef ASSIGN_VAR
    1.99