summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-04-12 01:41:25 +0000
committerkitty <kitty@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-04-12 01:41:25 +0000
commit8c55cfb6eccb2815ea1ad12ae881273b7e4b986d (patch)
treee45408475cb5ca20294705924877c118d746bafc
parent54827c77fe7962576228348402b2eaf16208b2db (diff)
downloadATCD-8c55cfb6eccb2815ea1ad12ae881273b7e4b986d.tar.gz
ChangeLogTag: Thu Apr 11 20:37:53 2002 Krishnakumar B <kitty@cs.wustl.edu>
-rw-r--r--ACEXML/common/FileCharStream.cpp13
-rw-r--r--ACEXML/common/FileCharStream.h2
-rw-r--r--ChangeLog14
-rw-r--r--ChangeLogs/ChangeLog-02a14
-rw-r--r--ChangeLogs/ChangeLog-03a14
-rw-r--r--ace/OS.h3
-rw-r--r--ace/OS.i24
7 files changed, 75 insertions, 9 deletions
diff --git a/ACEXML/common/FileCharStream.cpp b/ACEXML/common/FileCharStream.cpp
index f24aabc16ea..8509478d831 100644
--- a/ACEXML/common/FileCharStream.cpp
+++ b/ACEXML/common/FileCharStream.cpp
@@ -34,6 +34,11 @@ ACEXML_FileCharStream::open (const ACEXML_Char *name)
if (this->infile_ == NULL)
return -1;
+ ACE_stat statbuf;
+ if (ACE_OS::stat (name, &statbuf) < 0)
+ return -1;
+
+ this->size_ = statbuf.st_size;
this->filename_ = ACE::strnew (name);
return 0;
}
@@ -41,9 +46,10 @@ ACEXML_FileCharStream::open (const ACEXML_Char *name)
int
ACEXML_FileCharStream::available (void)
{
- // @@ how?
-
- return -1;
+ long curr;
+ if ((curr = ACE_OS::ftell (this->infile_)) < 0)
+ return -1;
+ return (this->size_ - curr);
}
int
@@ -53,6 +59,7 @@ ACEXML_FileCharStream::close (void)
this->filename_ = 0;
ACE_OS::fclose (this->infile_);
this->infile_ = NULL;
+ this->size_ = 0;
return 0;
}
diff --git a/ACEXML/common/FileCharStream.h b/ACEXML/common/FileCharStream.h
index 3a2d8219bc3..5caf0793bec 100644
--- a/ACEXML/common/FileCharStream.h
+++ b/ACEXML/common/FileCharStream.h
@@ -69,6 +69,8 @@ public:
private:
ACEXML_Char *filename_;
+ off_t size_;
+
FILE *infile_;
};
diff --git a/ChangeLog b/ChangeLog
index 1616f624524..3e6d9d8007c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Thu Apr 11 20:37:53 2002 Krishnakumar B <kitty@cs.wustl.edu>
+
+ * ace/OS.i (ftell):
+ * ace/OS.h:
+
+ Added new wrappers for ftell, fgetpos & fsetpos.
+
+ * ACEXML/common/FileCharStream.cpp:
+ * ACEXML/common/FileCharStream.h:
+
+ Implemented the previously unavailable available() call.
+
Thu Apr 11 20:06:41 2002 Steve Huston <shuston@riverace.com>
* examples/C++NPv2/display_logfile.cpp: Spacing/line length
@@ -19,7 +31,7 @@ Thu Apr 11 22:07:40 UTC 2002 Don Hinton <dhinton@ieee.org>
Thu Apr 11 20:04:22 UTC 2002 Don Hinton <dhinton@ieee.org>
- * ace/ARGV.h: Rolled back the change and readded ACE.h.
+ * ace/ARGV.h: Rolled back the change and readded ACE.h.
Too many error down the line to fix.
* ace/Sample_History.cpp: Added include of OS.h.
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 1616f624524..3e6d9d8007c 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,15 @@
+Thu Apr 11 20:37:53 2002 Krishnakumar B <kitty@cs.wustl.edu>
+
+ * ace/OS.i (ftell):
+ * ace/OS.h:
+
+ Added new wrappers for ftell, fgetpos & fsetpos.
+
+ * ACEXML/common/FileCharStream.cpp:
+ * ACEXML/common/FileCharStream.h:
+
+ Implemented the previously unavailable available() call.
+
Thu Apr 11 20:06:41 2002 Steve Huston <shuston@riverace.com>
* examples/C++NPv2/display_logfile.cpp: Spacing/line length
@@ -19,7 +31,7 @@ Thu Apr 11 22:07:40 UTC 2002 Don Hinton <dhinton@ieee.org>
Thu Apr 11 20:04:22 UTC 2002 Don Hinton <dhinton@ieee.org>
- * ace/ARGV.h: Rolled back the change and readded ACE.h.
+ * ace/ARGV.h: Rolled back the change and readded ACE.h.
Too many error down the line to fix.
* ace/Sample_History.cpp: Added include of OS.h.
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 1616f624524..3e6d9d8007c 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,15 @@
+Thu Apr 11 20:37:53 2002 Krishnakumar B <kitty@cs.wustl.edu>
+
+ * ace/OS.i (ftell):
+ * ace/OS.h:
+
+ Added new wrappers for ftell, fgetpos & fsetpos.
+
+ * ACEXML/common/FileCharStream.cpp:
+ * ACEXML/common/FileCharStream.h:
+
+ Implemented the previously unavailable available() call.
+
Thu Apr 11 20:06:41 2002 Steve Huston <shuston@riverace.com>
* examples/C++NPv2/display_logfile.cpp: Spacing/line length
@@ -19,7 +31,7 @@ Thu Apr 11 22:07:40 UTC 2002 Don Hinton <dhinton@ieee.org>
Thu Apr 11 20:04:22 UTC 2002 Don Hinton <dhinton@ieee.org>
- * ace/ARGV.h: Rolled back the change and readded ACE.h.
+ * ace/ARGV.h: Rolled back the change and readded ACE.h.
Too many error down the line to fix.
* ace/Sample_History.cpp: Added include of OS.h.
diff --git a/ace/OS.h b/ace/OS.h
index 356b1cb48f2..f340985b462 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -4778,6 +4778,9 @@ public:
static int fseek (FILE *fp,
long offset,
int ptrname);
+ static long ftell (FILE* fp);
+ static int fgetpos (FILE* fp, fpos_t* pos);
+ static int fsetpos (FILE* fp, fpos_t* pos);
static int fstat (ACE_HANDLE,
ACE_stat *);
static int lstat (const char *,
diff --git a/ace/OS.i b/ace/OS.i
index 38861682e69..f4c538c5b78 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -5509,9 +5509,9 @@ ACE_OS::setsockopt (ACE_HANDLE handle,
int optlen)
{
ACE_OS_TRACE ("ACE_OS::setsockopt");
-
+
#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) && defined(SO_REUSEPORT)
- // To work around an inconsistency with Microsofts implementation of
+ // To work around an inconsistency with Microsofts implementation of
// sockets, we will check for SO_REUSEADDR, and ignore it. Winsock
// always behaves as if SO_REUSEADDR=1. Some implementations have the
// same behaviour as Winsock, but use a new name for it. SO_REUSEPORT.
@@ -5522,7 +5522,7 @@ ACE_OS::setsockopt (ACE_HANDLE handle,
if (level == SOL_SOCKET) {
if (optname == SO_REUSEADDR) {
return 0; // Not supported by Winsock
- }
+ }
if (optname == SO_REUSEPORT) {
optname = SO_REUSEADDR;
}
@@ -10136,6 +10136,24 @@ ACE_OS::fseek (FILE *fp, long offset, int whence)
#endif /* ACE_HAS_PACE */
}
+ACE_INLINE long
+ACE_OS::ftell (FILE* fp)
+{
+ ACE_OSCALL_RETURN (::ftell (fp), long, -1);
+}
+
+ACE_INLINE int
+ACE_OS::fgetpos (FILE* fp, fpos_t* pos)
+{
+ ACE_OSCALL_RETURN (::fgetpos (fp, pos), int, -1);
+}
+
+ACE_INLINE int
+ACE_OS::fsetpos (FILE* fp, fpos_t* pos)
+{
+ ACE_OSCALL_RETURN (::fsetpos (fp, pos), int, -1);
+}
+
ACE_INLINE pid_t
ACE_OS::waitpid (pid_t pid,
ACE_exitcode *status,