* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-#include <stdio.h>
+
+#include "sdlemu_config.h"
+
+#include <stdlib.h> // For atoi()
+#include <stdio.h> // For fopen() and friends
+#include <cstring> // For strcmp()
#include <string>
#include <list>
-#include "sdlemu_config.h"
using namespace std;
for(p = vec.begin(); p != vec.end(); p++) {
string::size_type lastPos = (*p).LineName().find_first_not_of(delim, 0);
string::size_type pos = (*p).LineName().find_first_of(delim, lastPos);
-
+
if(string::npos != pos && string::npos != lastPos) {
string s = (*p).LineName().substr(lastPos, pos - lastPos);
(*p).add_token_variable(s);
void string_tokenize_value()
{
list<token_list>::iterator p;
- const string delim = " =\n\t";
-
+ const string delim = " =\n\t\r"; // "\r" needed for Win32 compatibility...
+
for(p = vec.begin(); p != vec.end(); p++) {
string::size_type lastPos = (*p).LineName().find_first_of(delim, 0);
string::size_type pos = (*p).LineName().find_first_not_of(delim, lastPos);
-
+
if(string::npos != pos && string::npos != lastPos) {
string s = (*p).LineName().substr(pos);
(*p).add_token_value(s);
char *s = new char[len];
fread(s, 1, len, f);
string str(s);
-
- const string delim = "\n";
+
+ const string delim = "\n\r"; // "\r" needed for Win32 compatibility...
string::size_type lastPos = str.find_first_not_of(delim, 0);
string::size_type pos = str.find_first_of(delim, lastPos);
-
+
while (string::npos != pos || string::npos != lastPos) {
string string = str.substr(lastPos, pos - lastPos);
if(string[0] == '#')