aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parser.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-02-20 09:17:28 +0000
committerNicola Mettifogo2007-02-20 09:17:28 +0000
commit5886d3ed7f6bdcc957174d33a3f31bcd68a9739f (patch)
treebf6ede51d6e1111adecfcc9863cee2153886c71e /engines/parallaction/parser.cpp
parent1bd5f9932b45e92dd73097df26acfe127df39c05 (diff)
downloadscummvm-rg350-5886d3ed7f6bdcc957174d33a3f31bcd68a9739f.tar.gz
scummvm-rg350-5886d3ed7f6bdcc957174d33a3f31bcd68a9739f.tar.bz2
scummvm-rg350-5886d3ed7f6bdcc957174d33a3f31bcd68a9739f.zip
cleanup and small fixes
svn-id: r25738
Diffstat (limited to 'engines/parallaction/parser.cpp')
-rw-r--r--engines/parallaction/parser.cpp96
1 files changed, 12 insertions, 84 deletions
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index b17b080d5b..ead9383a2e 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -28,40 +28,12 @@
namespace Parallaction {
char _tokens[20][40];
-/*
-static char *_src = NULL;
+Script::Script(const char* s) : _src(s) {
-
-void parseInit(char *s) {
- _src = s;
}
-char *parseNextLine(char *s, uint16 count) {
-
- uint16 _si;
- char v2 = 0;
- for ( _si = 0; _si<count; _si++) {
-
- v2 = *_src++;
- if (v2 == 0xA || v2 == -1) break;
- if (v2 != -1 && _si < count) s[_si] = v2;
- }
-
- if (_si == 0 && v2 == -1)
- return 0;
-
- s[_si] = 0xA;
- s[_si+1] = '\0';
-
- return s;
-}
-*/
-LocScript::LocScript(const char* s) : _src(s) {
-
-}
-
-char *LocScript::readLine(char *buf, size_t bufSize) {
+char *Script::readLine(char *buf, size_t bufSize) {
uint16 _si;
char v2 = 0;
@@ -82,24 +54,24 @@ char *LocScript::readLine(char *buf, size_t bufSize) {
}
-uint32 LocScript::read(void *dataPtr, uint32 dataSize) {
- error("binary read not supported on LocScript streams");
+uint32 Script::read(void *dataPtr, uint32 dataSize) {
+ error("binary read not supported on Script streams");
}
-bool LocScript::eos() const {
- error("EoS not supported on LocScript streams");
+bool Script::eos() const {
+ error("EoS not supported on Script streams");
}
-uint32 LocScript::pos() const {
- error("position not supported on LocScript streams");
+uint32 Script::pos() const {
+ error("position not supported on Script streams");
}
-uint32 LocScript::size() const {
- error("can't get size of LocScript streams");
+uint32 Script::size() const {
+ error("can't get size of Script streams");
}
-void LocScript::seek(int32 offset, int whence) {
- error("seek not supported on LocScript streams");
+void Script::seek(int32 offset, int whence) {
+ error("seek not supported on Script streams");
}
// looks for next token in a string
@@ -199,49 +171,5 @@ uint16 fillBuffers(Common::SeekableReadStream &stream, bool errorOnEOF) {
return fillTokens(line);
}
-/*
-//
-// FIXME
-// this function does the same Job as fillBuffers, except that
-// it gets input from a SeekableStream instead of a memory buffer
-//
-uint16 tableFillBuffers(Common::SeekableReadStream &stream) {
-
- clearTokens();
- char buf[200];
- char *line = NULL;
- do {
- line = stream.readLine(buf, 200);
- if (line == NULL) {
- return 0;
- }
- line = Common::ltrim(line);
- } while (strlen(line) == 0 || line[0] == '#');
-
- return fillTokens(line);
-}
-
-
-// FIXME
-// this function does the same Job as fillBuffers, except that
-// it gets input from an ArchivedFile instead of a memory buffer
-//
-uint16 scriptFillBuffers(ArchivedFile *file) {
-
- clearTokens();
-
- char buf[200];
- char *line = NULL;
- do {
- line = readArchivedFileText(buf, 200, file);
- if (line == NULL) {
- return 0;
- }
- line = Common::ltrim(line);
- } while (strlen(line) == 0 || line[0] == '#');
-
- return fillTokens(line);
-}
-*/
} // namespace Parallaction