mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac6a0aff32 | ||
|
|
637f7a9220 | ||
|
|
51a41340c6 | ||
|
|
f22591bb38 | ||
|
|
31df0b838f | ||
|
|
5a8d2bbd2c | ||
|
|
52214d0f8a | ||
|
|
7e1f2cb2d6 | ||
|
|
044dc4073b | ||
|
|
a1bbd38c28 | ||
|
|
5d9e9cbeec | ||
|
|
a4b6322ed4 | ||
|
|
b82c9bc4b1 | ||
|
|
794af1025b | ||
|
|
2afbf3642f | ||
|
|
8525a9e126 | ||
|
|
a3aba01b57 | ||
|
|
630ce00c86 | ||
|
|
a4279f3803 | ||
|
|
2c94aa3c7a | ||
|
|
53dcde3453 | ||
|
|
99f0f65965 | ||
|
|
1a95ed2365 | ||
|
|
9129c087c9 | ||
|
|
9f391f06f7 | ||
|
|
e2f5d94b4d | ||
|
|
15ce719fae | ||
|
|
f9b4f1d807 | ||
|
|
644ddb6663 | ||
|
|
3cbb51830a | ||
|
|
1ebef995ee | ||
|
|
8c415b9652 | ||
|
|
1b23214ad3 | ||
|
|
bf9b40d503 | ||
|
|
75800470b0 | ||
|
|
70a513e889 | ||
|
|
8dd5362cd5 | ||
|
|
b7feffe294 | ||
|
|
7c4a24533e | ||
|
|
d54ab5c35b | ||
|
|
86d29a8406 | ||
|
|
a20f123a6d | ||
|
|
074fa6d0ff | ||
|
|
0a99fb8a57 | ||
|
|
a4d35f7ec9 | ||
|
|
ced4972289 | ||
|
|
8030ee68e4 | ||
|
|
9eaf726688 | ||
|
|
aab87ccda7 | ||
|
|
cb9e7419be | ||
|
|
ed9ec7475a | ||
|
|
5db9f4c938 | ||
|
|
4519dd4972 | ||
|
|
da5ea45637 | ||
|
|
ce407bb9e8 | ||
|
|
df52d0d6f9 | ||
|
|
eac858025b | ||
|
|
f9ef817353 | ||
|
|
5090da62b5 | ||
|
|
08fc57666c | ||
|
|
ea46dbef94 | ||
|
|
38fc0b7e52 | ||
|
|
c08e245ba4 | ||
|
|
1dfd3f149b | ||
|
|
7d1ca46e56 | ||
|
|
efb1694a28 | ||
|
|
fab4b76caf | ||
|
|
20e0bdccf7 | ||
|
|
f8a7e2e43a | ||
|
|
44f9f53049 | ||
|
|
82ead61c46 | ||
|
|
c6315db4f2 | ||
|
|
c9a179253e | ||
|
|
5f74e488d7 | ||
|
|
6c1e7d54f6 | ||
|
|
f9731130a0 | ||
|
|
d1064be6fc | ||
|
|
ae13bcc209 | ||
|
|
1f57f2aefe | ||
|
|
27cc06c335 | ||
|
|
da65ba8477 | ||
|
|
4e9bf00c8b | ||
|
|
e565ef3cf4 | ||
|
|
3370b81664 | ||
|
|
1890ca523a | ||
|
|
370d1051c9 | ||
|
|
c006e942cd | ||
|
|
7ba0609a3f | ||
|
|
cd5b27470d | ||
|
|
5ffbfe9aff | ||
|
|
950795ac2a | ||
|
|
0c8294b691 | ||
|
|
f2a3141efd | ||
|
|
1b0c8991e2 | ||
|
|
74e1498136 | ||
|
|
6ea509c10d | ||
|
|
d2bbe69ce9 | ||
|
|
5fddaa130d | ||
|
|
a6e4a33c8d | ||
|
|
f1d8c30e0c | ||
|
|
6757939478 | ||
|
|
df4c7333d1 | ||
|
|
21032d6471 | ||
|
|
732aad5b3c | ||
|
|
bb3b9ee4a8 | ||
|
|
85c1bd5a40 | ||
|
|
29bb08eef1 | ||
|
|
4307dfe19b | ||
|
|
d0816bbaf5 | ||
|
|
572b585623 | ||
|
|
6df61cf597 | ||
|
|
1c6a95d5c5 | ||
|
|
1810099995 | ||
|
|
e9eac38d6d | ||
|
|
23694e8df9 | ||
|
|
fa43078dab | ||
|
|
1d138da62c | ||
|
|
698c69f4f3 | ||
|
|
6d5b30bc68 | ||
|
|
f182491301 | ||
|
|
e268c79ca9 | ||
|
|
bc07f59304 | ||
|
|
4c395b4418 | ||
|
|
20884f6d29 | ||
|
|
a8c250b215 | ||
|
|
d069c98174 | ||
|
|
ac9aaea8d4 | ||
|
|
b00d04aaa4 | ||
|
|
4dc202d35e | ||
|
|
c62ebf3662 | ||
|
|
dace380b08 | ||
|
|
a43966b183 | ||
|
|
2bfb6c885d | ||
|
|
dd1f100f5c | ||
|
|
ef1fdf5b8b | ||
|
|
ccb226ef75 | ||
|
|
7417a4d8e4 | ||
|
|
a5a212f642 | ||
|
|
5d709bcdb5 | ||
|
|
70ece6c4a0 | ||
|
|
405dc3ea6c | ||
|
|
39a57ed2e5 | ||
|
|
57def253ae | ||
|
|
3bc2a24a3a | ||
|
|
92f0a06788 | ||
|
|
ba11592b2c | ||
|
|
0992611bf0 | ||
|
|
800c8c64cf | ||
|
|
b529037728 | ||
|
|
7404b2e846 | ||
|
|
cfc2593d84 | ||
|
|
a84f29dc6d | ||
|
|
2abd9a70e2 | ||
|
|
f462287294 | ||
|
|
e0a57962b1 | ||
|
|
ab9d0406da | ||
|
|
8c1647dc82 | ||
|
|
c67de2d075 | ||
|
|
a6ffb6c02a | ||
|
|
da54cf461f | ||
|
|
9a5ade334f | ||
|
|
3dfc511a33 | ||
|
|
1fe22719b1 | ||
|
|
c0d11bde1d | ||
|
|
6fb3de52cb | ||
|
|
210c1115e9 | ||
|
|
abb7a6759f | ||
|
|
bf879a9795 | ||
|
|
393b396ebf | ||
|
|
a6d6ebabe6 | ||
|
|
60df095c46 | ||
|
|
6702db9247 | ||
|
|
d021bf6bad | ||
|
|
96e6f83423 | ||
|
|
bf760518ef | ||
|
|
fff7bcfca2 | ||
|
|
7e002902d5 | ||
|
|
feef427cdf |
No files matched your search
@@ -9,3 +9,5 @@ stamp-h
|
||||
libtool
|
||||
Makefile.in
|
||||
config.log
|
||||
config.h.in
|
||||
mono-*.tar.gz
|
||||
@@ -1 +1,2 @@
|
||||
Miguel de Icaza ([email protected])
|
||||
Paolo Molaro ([email protected])
|
||||
@@ -1,3 +1,32 @@
|
||||
2001-07-15 Sean MacIsaac <[email protected]>
|
||||
|
||||
* doc/download: added instructions for cygwin
|
||||
|
||||
* doc/c-sharp: removed bit about compiling
|
||||
|
||||
* status/compare-assembly.cs: basedir should be there if
|
||||
parameters are provided.
|
||||
|
||||
* status/makefile: made targets to dump info.
|
||||
|
||||
2001-07-15 Joe Shaw <[email protected]>
|
||||
|
||||
* configure.in: Don't create doc/Makefile as there's nothing there
|
||||
to make.
|
||||
|
||||
* Makefile.am: Don't build the doc directory because there's no
|
||||
Makefile.am there.
|
||||
|
||||
* autogen.sh: Call aclocal with the $ACLOCAL_FLAGS env var.
|
||||
|
||||
2001-07-15 Miguel de Icaza <[email protected]>
|
||||
|
||||
* doc/class-library (A): Updated FAQ with question on error 1595.
|
||||
|
||||
2001-07-14 Miguel de Icaza <[email protected]>
|
||||
|
||||
* doc/index:
|
||||
|
||||
Wed Jul 11 00:36:36 CEST 2001 Paolo Molaro <[email protected]>
|
||||
|
||||
* status/*: scripts and data to create statistics about the
|
||||
|
||||
@@ -1,8 +1,42 @@
|
||||
This is MonoNet.
|
||||
This is Mono.
|
||||
|
||||
Ximian's portable implementation of .NET
|
||||
A directory roadmap:
|
||||
|
||||
doc/
|
||||
Contains documentation and the web site contents.
|
||||
|
||||
mono/
|
||||
The core of the executable.
|
||||
|
||||
metadata/
|
||||
The library to deal with executables and libraries for
|
||||
.NET
|
||||
|
||||
dis/
|
||||
CIL executable Disassembler
|
||||
|
||||
cli/
|
||||
Common code for the JIT and the interpreter.
|
||||
|
||||
cil/
|
||||
Common Intermediate Representation, XML
|
||||
definition of the CIL bytecodes.
|
||||
|
||||
interp/
|
||||
Interpreter for CLI executables.
|
||||
|
||||
* Using Mono
|
||||
|
||||
Once you have installed the software, you can run a few programs:
|
||||
|
||||
monodis program.exe
|
||||
|
||||
That will dump the bytecodes for program.exe. Monodis support
|
||||
a number of options that dumps various metadata tables
|
||||
(chapter 23 of the Partition III).
|
||||
|
||||
You can try the interpreter like this:
|
||||
|
||||
mono-int program.exe
|
||||
|
||||
|
||||
----------
|
||||
|
||||
To edit the go-mono website, see doc/README.
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
libtoolize --automake
|
||||
automake -a
|
||||
autoheader
|
||||
aclocal
|
||||
aclocal $ACLOCAL_FLAGS
|
||||
autoconf
|
||||
./configure $*
|
||||
./configure $*
|
||||
+11
-1
@@ -1,6 +1,6 @@
|
||||
AC_INIT(README)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.3)
|
||||
AM_INIT_AUTOMAKE(mono, 0.5)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_PROG_CC
|
||||
@@ -23,6 +23,15 @@ GLIB_LIBS=`glib-config --libs glib`
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
|
||||
GMODULE_CFLAGS=`glib-config --cflags gmodule`
|
||||
GMODULE_LIBS=`glib-config --libs gmodule`
|
||||
|
||||
AC_SUBST(GMODULE_CFLAGS)
|
||||
AC_SUBST(GMODULE_LIBS)
|
||||
|
||||
AC_CHECK_LIB(ffi, ffi_prep_cif, ,[
|
||||
AC_MSG_ERROR(libffi 1.20 or higher is required.)])
|
||||
|
||||
CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations'
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
@@ -32,6 +41,7 @@ mono/Makefile
|
||||
mono/metadata/Makefile
|
||||
mono/dis/Makefile
|
||||
mono/cil/Makefile
|
||||
mono/cli/Makefile
|
||||
mono/interpreter/Makefile
|
||||
doc/Makefile
|
||||
])
|
||||
@@ -0,0 +1,3 @@
|
||||
Makefile.in
|
||||
Makefile
|
||||
all-docs
|
||||
@@ -0,0 +1,19 @@
|
||||
WEB_FILES= \
|
||||
c-sharp class-library contact contributing documentation download \
|
||||
faq gcc-frontend ideas index passport rationale resources \
|
||||
roadmap runtime status team testing thanks tools
|
||||
|
||||
OTHERS= pending resources-pending todo
|
||||
|
||||
EXTRA_DIST = $(WEB_FILES) README $(OTHERS)
|
||||
|
||||
all-docs: $(WEB_FILES)
|
||||
cat rationale roadmap c-sharp tools class-library \
|
||||
runtime documentation download faq contributing \
|
||||
resources status > all-docs
|
||||
|
||||
webit:
|
||||
(cd web; make && make push)
|
||||
|
||||
push-notes:
|
||||
scp release-notes/mono* www@www:/web/cvsmodules/mono/archive
|
||||
+12
-15
@@ -82,7 +82,7 @@
|
||||
parents are.
|
||||
</ul>
|
||||
|
||||
Interesting tasks:
|
||||
Interesting and Fun hacks to the compiler:
|
||||
|
||||
<ul>
|
||||
* Finishing the JB port from Java to C#. If you are
|
||||
@@ -95,6 +95,17 @@
|
||||
JB will allow us to move from the Berkeley Yacc
|
||||
based Jay to a Bison-based compiler (better error
|
||||
reporting and recovery).
|
||||
|
||||
* Semantic Analysis: Return path coverage and
|
||||
initialization before use coverage are two great
|
||||
features of C# that help reduce the number of bugs
|
||||
in applications. It is one interesting hack.
|
||||
|
||||
* TypeRefManager. This exists currently in its infancy only.
|
||||
|
||||
* Enum resolutions: it is another fun hack, as enums can be defined
|
||||
in terms of themselves (<tt>enum X { a = b + 1, b = 5 }</tt>).
|
||||
|
||||
</ul>
|
||||
|
||||
** Questions and Answers
|
||||
@@ -133,19 +144,5 @@ A: No, currently I am using Jay which is a port of Berkeley Yacc to
|
||||
In the future I want to port one of the Bison/Java ports to C# for
|
||||
the parser.
|
||||
|
||||
Q: How do I compile it?
|
||||
|
||||
A: Compiling MCS currently requires you to run my port of <a
|
||||
href="http://primates.ximian.com/~miguel/code/jay.cs.tar.gz">Jay to
|
||||
C#</a> on a Unix system to generate the parser, and then you need
|
||||
to use Microsoft's .NET csc.exe compiler to compile the compiler.
|
||||
|
||||
You only need to compile the compiler compiler (C code), the
|
||||
samples are Java samples that I did not port, and you do not need
|
||||
them.
|
||||
|
||||
It might be simple to port Jay.cs to Windows, but I have not tried
|
||||
this.
|
||||
|
||||
You might also want to look at the <a href="faq.html#gcc">GCC</a>
|
||||
section on the main FAQ
|
||||
+32
-7
@@ -3,10 +3,30 @@
|
||||
The Class Library should be compatible with Microsoft's .NET
|
||||
implementation.
|
||||
|
||||
Please see the <a href="class-status.html">Class Status</a>
|
||||
page for a status of who is working on which classes.
|
||||
|
||||
We will write as much code as possible in C#. We may need to
|
||||
interface with code written in C to gain access to the
|
||||
functionality of
|
||||
libraries like libart, Gtk+, and libc.
|
||||
functionality of libraries like libart, Gtk+, and libc.
|
||||
|
||||
** Contributing
|
||||
|
||||
We welcome contributions to the the Class Library. To get
|
||||
started, check the status page for information about which
|
||||
APIs are being worked on, and how to get in touch with
|
||||
individual maintainers.
|
||||
|
||||
If you want to work on a class, first check the <a
|
||||
href="download.html">Classes Distribution</a> to see if it is
|
||||
not implemented yet, if not, check the <a
|
||||
href="class-status.html">Class Status</a> to see if someone is
|
||||
already working on it, and maybe contact them.
|
||||
|
||||
If nobody is working on it, mail <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
with the class you want to implement and CC <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
|
||||
** Layout
|
||||
|
||||
@@ -140,10 +160,15 @@
|
||||
|
||||
In those cases, use the keyword "LAMESPEC".
|
||||
|
||||
** Contributing
|
||||
** FAQ
|
||||
|
||||
We welcome contributions to the the Class Library. To get
|
||||
started, check the status page for information about which
|
||||
APIs are being worked on, and how to get in touch with
|
||||
individual maintainers.
|
||||
Frequently asked questions about the class library:
|
||||
|
||||
Q: I am writing a new class that overrides one of the system classes,
|
||||
and I am getting a 1595 warning from the compiler. Should we use a
|
||||
different namespace?
|
||||
|
||||
A: There is a quick solution to the problem, you can pass the command
|
||||
line argument /nowarn:1595 and this will effectively let you use
|
||||
your implementation of the code, while overriding the ones from the
|
||||
system assemblies.
|
||||
@@ -0,0 +1,16 @@
|
||||
* Status of the various pieces of the class library
|
||||
|
||||
You can browse the status of the class library and see who has
|
||||
registered to work on what parts of the system. These list
|
||||
work-in-progress components currently.
|
||||
|
||||
Browse the current <a href="class-status/index.html">status</a>.
|
||||
|
||||
You can also download the XML <a
|
||||
href="class-status/maintainers.xml">maintainers</a> file that
|
||||
contains the actual maintainers list.
|
||||
|
||||
You can also download the master <a
|
||||
href="class-status/class.xml">Class Status XML</a> file.
|
||||
|
||||
|
||||
+9
-2
@@ -18,6 +18,15 @@
|
||||
something that would help tremendously would be to help with
|
||||
small duties in the project that need to be addressed.
|
||||
|
||||
** Bug reporting
|
||||
|
||||
If you find bugs in Mono, please make sure you enter a bug
|
||||
report so we can keep track of problems in Mono.
|
||||
|
||||
To enter bug reports go to <a href="http://bugzilla.ximian.com">
|
||||
http://bugzilla.ximian.com</a> and enter bug reports against
|
||||
your favorite component (Mono, Runtime, C# compiler).
|
||||
|
||||
** Small tasks
|
||||
|
||||
A few smaller tasks are here, dropped in no particular order:
|
||||
@@ -29,8 +38,6 @@
|
||||
|
||||
* <b>Mono/doc and web site:</b> They need to be
|
||||
packaged up in the official `distribution'
|
||||
|
||||
* <b>Enthusiasts: </b>
|
||||
</ul>
|
||||
|
||||
* Special note
|
||||
|
||||
+114
-5
@@ -10,33 +10,142 @@
|
||||
test suite and the class library are in the `mcs' package, we
|
||||
will move this later into `mono' itself.
|
||||
|
||||
The mcs compiler requires the `jay' parser generator, this is
|
||||
available in module `jay'.
|
||||
In order to make mcs and the class libraries you will need the
|
||||
GNU make tools. These may be obtained for the Windows
|
||||
environment from <a href="www.cygwin.com">cygwin.com</a>.
|
||||
|
||||
You will also need to get GLIB, from: <a
|
||||
href="ftp://ftp.gtk.org/pub/gtk/v1.2/glib-1.2.10.tar.gz">ftp://ftp.gtk.org/pub/gtk/v1.2/glib-1.2.10.tar.gz</a>
|
||||
|
||||
<a name="sources">
|
||||
** Sources
|
||||
|
||||
Currently we will be providing CVS snapshots every day, until
|
||||
we make the first tarball release.
|
||||
|
||||
<ul>
|
||||
<b>July 12th, 2001</b>
|
||||
<a name="july-22">
|
||||
<b>July 22, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-22-Jul-2001.tar.gz">mcs-22-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-22-Jul-19-2001.tar.gz">Differences since 19</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-22">Release Notes</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-19">
|
||||
<b>July 19th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-19-Jul-2001.tar.gz">mcs-19-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-17-Jul-19-2001.tar.gz">Differences since 17</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-19">Release Notes</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-17">
|
||||
<b>July 17th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-17-Jul-2001.tar.gz">mcs-17-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-15-Jul-17-2001.tar.gz">Differences since 15</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-17">Release Notes</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-15">
|
||||
<b>July 15th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-15-Jul-2001.tar.gz">mcs-15-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mono-0.4.tar.gz">mono-0.4.tar.gz</a>: Packaged Source Code.
|
||||
* <a href="archive/mono-0.4">Release Notes</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-14">
|
||||
<b>July 14th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/jay.cs.tar.gz">archive/jay.cs.tar.gz</a>: Sources to Jay.
|
||||
* <a href="archive/mcs-12-Jul-2001.tar.gz">mcs-12-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mono-0.3.tar.gz">mono-0.3.tar.gz</a>: Packaged Source Code.
|
||||
</ul>
|
||||
|
||||
<a name="july-8">
|
||||
<b>July 8th, 2001</b>
|
||||
|
||||
<ul>
|
||||
* <a href="archive/jay.cs.tar.gz">archive/jay.cs.tar.gz</a>: Sources.
|
||||
* <a href="archive/mcs-08-Jul-2001.tar.gz">mcs-08-Jul-2001.tar.gz</a>: CVS Snapshot
|
||||
* <a href="archive/mono-08-Jul-2001.tar.gz">mono-08-Jul-2001.tar.gz</a>: CVS Snapshot
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<a name="install">
|
||||
** Installing the software
|
||||
|
||||
To install and work on the compiler and the class libraries,
|
||||
follow these instructions:
|
||||
|
||||
<ul>
|
||||
* Install <a href="http://www.cygwin.org">CygWin</a> first.
|
||||
|
||||
* Untar the MCS distribution (see below for information).
|
||||
|
||||
* Go into the MCS directory and type `make windows'
|
||||
</ul>
|
||||
|
||||
To compile the mono runtime on windows:
|
||||
|
||||
<ul>
|
||||
* Install <a href="http://www.cygwin.org">CygWin</a> first.
|
||||
|
||||
* Once installed, in a terminal window or a cygwin
|
||||
window (a shortcut should be on your desktop), untar the glib
|
||||
distribution:
|
||||
|
||||
<pre>
|
||||
tar xzvf glib-1.2.10.tar.gz
|
||||
</pre>
|
||||
|
||||
* Configure, compile and install glib, like this:
|
||||
|
||||
<pre>
|
||||
./configure --prefix=/usr/bin
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
|
||||
* Unpack the mono distribution:
|
||||
|
||||
<pre>
|
||||
tar xzvf mono-XXX.tar.gz
|
||||
</pre>
|
||||
|
||||
* Configure, compile and install:
|
||||
|
||||
<pre>
|
||||
./configure --prefix=//c/mono
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
To compile the mono runtime on Unix:
|
||||
|
||||
<ul>
|
||||
|
||||
* Download the mono distribution
|
||||
|
||||
* Unpack the mono distribution:
|
||||
|
||||
<pre>
|
||||
tar xzvf mono-XXX.tar.gz
|
||||
</pre>
|
||||
|
||||
* Configure, compile and install:
|
||||
<pre>
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
** CVS
|
||||
|
||||
We are trying to figure out where to put our CVS repository.
|
||||
We are debating between the GNOME CVS or SourceForge. Watch
|
||||
this spot.
|
||||
|
||||
|
||||
@@ -138,8 +138,8 @@ A: We like the features that the CLI and its related technologies
|
||||
Q: Will I be able to write proprietary applications that run with
|
||||
Mono?
|
||||
|
||||
A: Yes. We will make sure that the licensing will allow developers to
|
||||
create proprietary applications.
|
||||
A: Yes. The licensing scheme is planned to allow proprietary
|
||||
developers to write applications with Mono.
|
||||
|
||||
Q: What license is Mono on?
|
||||
|
||||
@@ -147,10 +147,8 @@ A: The C# Compiler is released under the terms of the GPL. The class
|
||||
libraries will be under the LGPL or the GPL with a special
|
||||
exception. The runtime libraries are under the LGPL.
|
||||
|
||||
Here is the exception for the class libraries:
|
||||
|
||||
The library is distributed under the terms of the GNU General
|
||||
Public License with the following exception:
|
||||
Since the LGPL is not suitable for embedded systems development, we
|
||||
are also licensing the libraries under the GPL with the following exception:
|
||||
|
||||
If you link this library against your own program, then you do not
|
||||
need to release the source code for that program. However, any
|
||||
@@ -162,6 +160,15 @@ A: The C# Compiler is released under the terms of the GPL. The class
|
||||
href="http://www.gnu.org/software/classpath/classpath.html">GNU
|
||||
Classpath.</a>
|
||||
|
||||
Q: But in Object Oriented Programming I need to subclass your library
|
||||
functions, does that mean that I am making modifications to your
|
||||
library and hence I would have to distribute my sources under the
|
||||
LGPL?
|
||||
|
||||
A: No. Object Oriented Programming in the class library is a well
|
||||
understood interface barrier, so you can actually develop
|
||||
proprietary applications with the Mono libraries.
|
||||
|
||||
Q: Will you accept code under the XXX License?
|
||||
|
||||
A: If the XXX License is compatible with the license we use in that
|
||||
@@ -235,6 +242,13 @@ Q: What is your opinion?
|
||||
A: You can read my personal <a href="passport.html">opinion on
|
||||
passport</a>.
|
||||
|
||||
Q: Will Mono running on Linux make Passport available for Linux?
|
||||
|
||||
A: The Passport toolkit for Linux-based web servers is available from
|
||||
Microsoft.
|
||||
|
||||
Again, Mono has nothing to do with Passport.
|
||||
|
||||
** Mono and Windows
|
||||
|
||||
Q: Will Mono allow me to run Microsoft Office on Linux?
|
||||
@@ -389,6 +403,12 @@ A: The CIL is better suited to be JITed than JVM byte codes, but you
|
||||
can interpret them as trivially as you can interpret JVM byte
|
||||
codes.
|
||||
|
||||
Q: Could Java target the CLI?
|
||||
|
||||
A: Yes, Java could target the CLI. We have details on a <a
|
||||
href="ideas.html#guavac">project</a> that someone could take on to
|
||||
make this happen.
|
||||
|
||||
** Extending Mono
|
||||
|
||||
Q: Would you allow other classes other than those in the
|
||||
@@ -443,8 +463,34 @@ A: We are also researching <a
|
||||
href="http://www.gnu.org/software/lightning/lightning.html">GNU
|
||||
Lightning</a>.
|
||||
|
||||
<a name="ximian-and-microsoft">
|
||||
** Ximian and Microsoft
|
||||
|
||||
Q: I read that Microsoft is helping out Ximian, is this true?
|
||||
|
||||
A: Initial contact between David Stutz and Miguel de Icaza happened.
|
||||
It was a friendly conversation. Microsoft is interested in other
|
||||
implementing .NET and are willing to help make the ECMA spec more
|
||||
accurate for this purpose.
|
||||
|
||||
We were initially contacted by Sam Ruby at the ECMA TG3 committee
|
||||
to discuss the same issue. And we are glad to have good contacts
|
||||
to ask questions about the specs.
|
||||
|
||||
Q: Do you fear that Microsoft will change the spec and render Mono useless?
|
||||
|
||||
A: No. Microsoft proved with the CLI and the C# language that it was
|
||||
possible to create a powerful foundation for many languages to
|
||||
interoperate. We will always have that.
|
||||
|
||||
Even if changes happened in the platform which were undocumented
|
||||
(which is very unlikely), the existing platform has a value on its
|
||||
own.
|
||||
|
||||
Miguel once explained its motivation for working on Mono to Dave
|
||||
Winer, and his mail got posted <a
|
||||
href="http://scriptingnews.userland.com/stories/storyReader$1275">here</a>
|
||||
|
||||
Q: Didn't Miguel de Icaza say that `Unix Sucks'?
|
||||
|
||||
A: Yes, he did, as a catch phrase in his opening remark on the Ottawa
|
||||
@@ -538,12 +584,6 @@ Q: Why are you writing a JIT engine instead of a front-end to GCC?
|
||||
A: The JIT engine and runtime engine will be able to execute CIL
|
||||
executables generated on Windows.
|
||||
|
||||
** Mono and GNU
|
||||
|
||||
Q: Is Mono part of the GNU project?
|
||||
|
||||
A: Mono is a Ximian project, that is also part of the GNU project.
|
||||
|
||||
** Mono and Portability
|
||||
|
||||
Q: Will Mono work on other variants of Unix?
|
||||
@@ -593,17 +633,16 @@ A: We can not predict the future, but a conservative estimate is that
|
||||
Q: You say that the CLI allows multiple languages to execute on the
|
||||
same environment. Isn't this the purpose of CORBA?
|
||||
|
||||
A: CORBA can be used for this purpose, but think of CORBA mostly as a
|
||||
inter-process (local machine or remote machine) communication
|
||||
system.
|
||||
A: The key difference between CORBA (and COM) and the CLI is that the
|
||||
CLI allows "data-level interoperability" because every
|
||||
language/component uses the same data layout and memory management.
|
||||
|
||||
Think of the CLI to be targeted to interoperation of languages in
|
||||
the same process, and CORBA as being a nifty addition for
|
||||
out-of-process.
|
||||
|
||||
Sure, we have used CORBA for in-proc components, but the lack of an
|
||||
ABI for in-proc components does not translate into a good framework
|
||||
for in-proc systems
|
||||
|
||||
|
||||
This means you can operate directly upon the datatypes that someone
|
||||
else provides, without having to go via their interfaces. It also
|
||||
means you don't have to "marshall" (convert) parameters (data
|
||||
layouts are the same, so you can just pass components directly) and
|
||||
you don't have to worry about memory managment, because all
|
||||
languages/components share the same garbage collector and address
|
||||
space. This means much less copying and no need for reference
|
||||
counting.
|
||||
|
||||
@@ -3,13 +3,28 @@
|
||||
Here are a few ideas of tools, classes and projects that you
|
||||
could start. More are forthcoming.
|
||||
|
||||
<a name="runtime">
|
||||
** Runtime
|
||||
|
||||
We need a verifier that can be run on an executable (assembly)
|
||||
and tells whether the metadata for the executable is correct
|
||||
or not. It should report any anomalies.
|
||||
|
||||
For a list of anomalies in assemblies, check the various assertions
|
||||
that are described on the ECMA documentation.
|
||||
|
||||
This will help test our generated executables and can be also
|
||||
used as an external verifier.
|
||||
|
||||
<a name="classes">
|
||||
** Classes
|
||||
|
||||
<ul>
|
||||
TODO=jxta,The JXTA Peer to Peer foundation
|
||||
* Implement a JXTA protocol implementation:
|
||||
<a href="http://www.jxta.org">http://www.jxta.org</a>
|
||||
|
||||
TODO=camel,Mail API
|
||||
* Implement a Mail API, similar to Camel or JavaMail (Camel has
|
||||
significant architecture features that are required on a real
|
||||
mailer).
|
||||
@@ -18,23 +33,87 @@
|
||||
<a href="http://cvs.gnome.org/bonsai/rview.cgi?dir=evolution%2Fcamel">
|
||||
Camel implementation</a>.
|
||||
|
||||
Such an implementation could be used both with
|
||||
Microsoft .NET and Mono.
|
||||
|
||||
TODO=multimedia
|
||||
* Interfacing to Multimedia systems. You might want
|
||||
to look into the Quicktime API. I know <a
|
||||
href="mailto:[email protected]">Vladimir</a> has
|
||||
researched the problem before
|
||||
|
||||
TODO=gtk,Gtk+ wrappers for Mono and .NET
|
||||
* Wrap the Gtk+ API. This is simple and can be done
|
||||
on Windows as Gtk+ 2.0 works on Windows.
|
||||
|
||||
This work can also be used on Windows and will
|
||||
enable developers on Windows to use some of Gtk+'s
|
||||
advanced features.
|
||||
|
||||
The idea is to wrap the Gtk+ API and allow us to
|
||||
build GUI applications using Gtk+ and in the future
|
||||
other Gtk+-based libraries from Mono (Gal, GtkHTML).
|
||||
|
||||
There is extensive knowledge on wrapping Gtk+ in
|
||||
other languages (this has been done this for Perl,
|
||||
Python, Java, Scheme, Haskel and other languages in
|
||||
the past).
|
||||
</ul>
|
||||
|
||||
<a name="projects">
|
||||
** Projects
|
||||
|
||||
<ul>
|
||||
TODO=xmlStorage,
|
||||
* Implement an xmlStorageSystem for the CLI:
|
||||
<a href="http://www.soapware.org/xmlStorageSystem">
|
||||
http://www.soapware.org/xmlStorageSystem</a>
|
||||
|
||||
TODO=guavac,Java compiler for .NET
|
||||
* You could take one of the existing Java compilers
|
||||
(Guavac comes to mind as it is so nice) and modify
|
||||
it to generate .NET code rather than JVM byte
|
||||
codes.
|
||||
|
||||
This should be a pretty straightforward task.
|
||||
Guavac has the advantage of being written in C++ and
|
||||
it could be compiled with the Microsoft Managed C++
|
||||
compiler and produce a .NET executable with it.
|
||||
|
||||
TODO=CORBA,CORBA implementation
|
||||
* Build a CORBA interoperability engine for the CLR.
|
||||
You do not need to do all of the work, just talking
|
||||
the protocol will get us a long way (<a
|
||||
href="http://www.omg.org">The OMG site</a> has the CORBA specs).
|
||||
href="http://www.omg.org">The OMG site</a> has the
|
||||
CORBA specs).
|
||||
|
||||
Get in touch with David Taylor (dtaylo11 at bigpond
|
||||
dot net dot au) as he has been working on this
|
||||
project.
|
||||
|
||||
TODO=Bonobo,Bonobo for Mono
|
||||
* Once CORBA is done, implement the Bonobo interfaces
|
||||
to allow people to use Bonobo components in Mono and
|
||||
Mono components with Bonobo. The best of both worlds!
|
||||
|
||||
TODO=moniker,Object Naming System with Monikers
|
||||
* A naming space for Mono. An object naming space is
|
||||
a very powerful tool. Bonobo implements a moniker
|
||||
system that is more powerful than the original
|
||||
moniker concept that was pioneered by COM/OLE in the
|
||||
Microsoft world.
|
||||
|
||||
Our implementation builds on a concept, and we have
|
||||
made it simpler, more powerful, more extensible and
|
||||
a much better mechanism than the equivalent monikers
|
||||
on Windows.
|
||||
|
||||
Implementing Mono monikers would benefit both
|
||||
Windows users using .NET and Mono users on Unix and
|
||||
Windows.
|
||||
|
||||
Here is <a
|
||||
href="http://primates.ximian.com/~miguel/monikers.html">an
|
||||
overview of the moniker system</a> in Bonobo.
|
||||
|
||||
</ul>
|
||||
@@ -1,20 +1,13 @@
|
||||
** Jul 12, 2001
|
||||
<a href="http://www.ximian.com">Ximian</a> announced the
|
||||
launch of the Mono project, an effort to create a <a
|
||||
href="http://www.gnu.org/philosophy/free-sw.html">Free
|
||||
Software</a> (sometimes called open source) implementation of
|
||||
the .NET Development Framework.
|
||||
|
||||
I keep getting questions about my opinion on Passport, even when
|
||||
Mono has <b>nothing</b> to do with it. I finally <a
|
||||
href="passport.html">wrote something.</a>
|
||||
|
||||
** Jul 9, 2001
|
||||
|
||||
Today <a href="http://www.ximian.com">Ximian</a> announced the
|
||||
launch of the Mono
|
||||
project, an effort to create a free software
|
||||
(sometimes called open source) implementation of the .NET
|
||||
Development Framework.
|
||||
|
||||
If you have questions about the
|
||||
project, please read our list of <a
|
||||
href="faq.html">Frequently Asked Questions</a>.
|
||||
You can read our <a href="rationale.html">rationale</a> for
|
||||
this project. If you have questions about the project, please
|
||||
read our list of <a href="faq.html">Frequently Asked
|
||||
Questions</a> or contact us.
|
||||
|
||||
You might also want to <a href="download.html">Download the
|
||||
source</a> for our work so far.
|
||||
@@ -26,6 +19,62 @@
|
||||
You can contact the team at: <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
|
||||
** JUl 25, 2001
|
||||
|
||||
The slides for <A href="Presentations/O-Reilly">my
|
||||
presentation</a> at <a href="http://www.oreilly.com">O'Reilly
|
||||
Open Source Software Convention</a>
|
||||
|
||||
** Jul 22, 2001
|
||||
|
||||
Another release of the class libraries is out, check the <a
|
||||
href="archive/mcs-22">MCS 22-July Release Notes</a>. You can
|
||||
get the new class libraries from <a
|
||||
href="download.html#july-22">here</a>
|
||||
|
||||
** Jul 19, 2001
|
||||
|
||||
Another release of the class libraries is out, check the <a
|
||||
href="archive/mcs-19">MCS 19-July Release Notes</a>. You can
|
||||
get the new class libraries from <a
|
||||
href="download.html#july-19">here</a>
|
||||
|
||||
** Jul 17, 2001
|
||||
|
||||
Another release of the class libraries is out, check the <a
|
||||
href="archive/mcs-17">MCS 17-July Release Notes</a>. You can
|
||||
get the new class libraries from <a
|
||||
href="download.html#july-17">here</a>
|
||||
|
||||
Do not forget to check out the updated <a href="faq.html">FAQ</a>.
|
||||
|
||||
Got Sean's new <a href="class-status/index.html">Class
|
||||
Status</a> web pages up. These are a lot better than mine, and
|
||||
we are now keeping better track of contributors.
|
||||
|
||||
** Jul 15, 2001
|
||||
|
||||
Another release of Mono is out, check the <a
|
||||
href="archive/mono-0.4">Mono 0.4 Release Notes</a>. Get it <a
|
||||
href="download.html#july-15">here</a>.
|
||||
|
||||
** Jul 14, 2001
|
||||
|
||||
A <a
|
||||
href="http://mail.ximian.com/archives/public/mono-list/2001-July/000399.html">new
|
||||
release</a> of the
|
||||
runtime, compiler and classes has been made. Get it <a href="download.html#july-14">here</a>
|
||||
|
||||
** Jul 12, 2001
|
||||
|
||||
I keep getting questions about my opinion on Passport, even when
|
||||
Mono has <b>nothing</b> to do with it. I finally <a
|
||||
href="passport.html">wrote something.</a>
|
||||
|
||||
** Jul 9, 2001
|
||||
|
||||
Project launched.
|
||||
|
||||
** O'Reilly
|
||||
|
||||
Brian posted a story on <a
|
||||
|
||||
+13
-4
@@ -132,10 +132,7 @@
|
||||
For instant messaging (another pieces of the Hailstorm bit),
|
||||
you want to use a non-centralized system like Sun's <a
|
||||
href="http://www.jxta.org">JXTA</a>. Some people mailed me to
|
||||
mention Jabber as a messaging platform. Jabber suffers from
|
||||
the same problems that a centralized Passport has. If you
|
||||
want to do things right, you want to start with a fully
|
||||
distributed system.
|
||||
mention Jabber as a messaging platform.
|
||||
|
||||
It could also just use the user e-mail address as the `key' to
|
||||
choose the registrar (msn.com, hotmail.com -> passport.com;
|
||||
@@ -210,6 +207,18 @@
|
||||
Currently, we are too far from the point where this is a real
|
||||
issue.
|
||||
|
||||
** Passport and endangering Open Source.
|
||||
|
||||
A few people have said: `Mono will allow Passport to be
|
||||
available for Linux and that is bad'. This is plain
|
||||
miss-information.
|
||||
|
||||
Currently, you can obtain Passport for Linux from Microsoft
|
||||
itself and deploy it today on your Web server. Mono does not
|
||||
even enter the picture here. Go to passport.com and download
|
||||
the toolkit and you will see with your own eyes that passport
|
||||
is <B>already</b> available for Linux.
|
||||
|
||||
** Disclaimer
|
||||
|
||||
This is just a group of personal thoughts of mine that I have
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
To: [email protected], [email protected]
|
||||
Subject: July 12 snapshots.
|
||||
FCC: ~/Mail/outbox.txt
|
||||
X-Windows: Sometimes you fill a vacuum and it still sucks.
|
||||
--text follows this line--
|
||||
|
||||
Hey!
|
||||
|
||||
July 12 snapshots of class libraries, the compiler and the mono
|
||||
runtime are available.
|
||||
|
||||
New on this release:
|
||||
|
||||
* Runtime (module: mono)
|
||||
|
||||
The beginning of a simple interpreter that Paolo started
|
||||
workign on (can run really simple .NET programs).
|
||||
|
||||
Disassembler copes with more elements of the binary format and
|
||||
more tokens are decoded. Paolo is working now on moving some
|
||||
of these to the metadata library.
|
||||
|
||||
More tables are dumped.
|
||||
|
||||
* Class libraries (module: mcs/class)
|
||||
|
||||
Many new more classes are in from Joe, Vladimir, Jeff, Sean
|
||||
and yours truly.
|
||||
|
||||
Sean fixed the build process, and it is now possible to
|
||||
compile with a single command the assemblies. We will be
|
||||
revisiting this mechanism in the future to compile per-OS
|
||||
assemblies (ie, Unix, Windows, MacOS, etc).
|
||||
|
||||
* Compiler (module mcs/mcs)
|
||||
|
||||
Not much done this week, just a few fixes here and there, and
|
||||
more work to make it easy to compiler.
|
||||
|
||||
* Documentation (module: mono/doc)
|
||||
|
||||
All the changes to the web site are there for your browsing
|
||||
pleasure. We still need to integrate the status system in
|
||||
there.
|
||||
|
||||
Miguel.
|
||||
@@ -0,0 +1,43 @@
|
||||
To: [email protected]
|
||||
Subject: Sunday snapshot available.
|
||||
Gcc: mail.2001-07
|
||||
--text follows this line--
|
||||
|
||||
Hey guys,
|
||||
|
||||
I promise I will not be doing these so often once we have the CVS
|
||||
server up. In the meantime:
|
||||
|
||||
* MCS
|
||||
|
||||
Sean got the classes to compile in a single go. You
|
||||
will need CygWin (www.cygwin.org) to compile though
|
||||
(GNU make and stuff is required).
|
||||
|
||||
System.Xml.XmlReader contribution from Jason
|
||||
(WOOHHOO!!). It also contains a nice test-suite for
|
||||
his functions, and in his new code bit, his
|
||||
implementation is faster than Microsoft's
|
||||
|
||||
We now ship `jay' as part of the distribution to allow
|
||||
you to compile the compiler with the same `make'
|
||||
command. Small fixes to the parser as well were
|
||||
introduced.
|
||||
|
||||
* Mono 0.4
|
||||
|
||||
Paolo's interpreter supports call instructions and has
|
||||
the test suite program that he posted about.
|
||||
|
||||
|
||||
All documentation ships now in the mono-0.4.tar.gz
|
||||
|
||||
Notes:
|
||||
|
||||
As usual, MCS is targeted to be compiled on a Windows machine
|
||||
(you will need Cygwin).
|
||||
|
||||
Mono is targeted to be compiled on a Unix machine or a Windows
|
||||
machine running Cygwin.
|
||||
|
||||
Miguel.
|
||||
@@ -77,6 +77,7 @@
|
||||
|
||||
* <a
|
||||
href="http://www.southern-storm.com.au/portable_net.html">Portable.NET:</a>
|
||||
Another implementation of the CLI and C# compiler.
|
||||
|
||||
* <a href="http://nunit.sourceforge.net">NUnit:</a> A
|
||||
testing framework for .NET classes.
|
||||
|
||||
+55
-32
@@ -1,17 +1,13 @@
|
||||
The MonoNet runtime
|
||||
* The Mono runtime
|
||||
|
||||
The MonoNet runtime will implement the JIT engine (and a byte
|
||||
The Mono runtime will implement the JIT engine (and a byte
|
||||
code interpreter for quickly porting to new systems), the
|
||||
class loader, the garbage collector, threading system and
|
||||
metadata access libraries.
|
||||
|
||||
Currently the runtime contains the beginning of an image
|
||||
loader and metadata access entry points. Since Beta2 has been
|
||||
now released, it is possible to resume work using the ECMA
|
||||
specs and testing with Beta2-generated executables.
|
||||
|
||||
The runtime core will be implemented in C, in a library
|
||||
"libMonoVES.so".
|
||||
Currently the runtime has an image loader and metadata access
|
||||
entry points. The runtime comes with a simple interpreter
|
||||
that can execute very simple programs.
|
||||
|
||||
** Executing MSIL/CIL images
|
||||
|
||||
@@ -19,7 +15,8 @@
|
||||
external assemblies to our own version of the assemblies on
|
||||
GNU/Linux.
|
||||
|
||||
Our roadmap looks like this:
|
||||
Our roadmap looks like this, this has been updated as of
|
||||
<b>Jul 15, 2001</b>:
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -31,14 +28,15 @@
|
||||
run CIL byte code on a system where no JIT is
|
||||
available.
|
||||
|
||||
* Milestone 3: IA32 translating-JIT engine.
|
||||
* Milestone 3: Define an <i>lburg</i> instruction
|
||||
selector for the JITer for Intel. Although slower
|
||||
at JITing than a streaming JITer, it generates
|
||||
better code. The same grammar can later be used for
|
||||
the stream jitter.
|
||||
|
||||
* Milestone 4: non-Intel port of the JIT engine.
|
||||
* Milestone 4: Implement JITer.
|
||||
|
||||
* Milestone 5: Optimizing JIT engine port for IA32.
|
||||
|
||||
* Milestone 6: non-Intel port of the Optimizing JIT
|
||||
engine.
|
||||
* Milestone 5: Port of the JITer to non IA32 systems.
|
||||
</ul>
|
||||
|
||||
A setup similar to the Kaffe JIT engine can be used to
|
||||
@@ -46,25 +44,38 @@
|
||||
will be focused on getting a IA32 version running first.
|
||||
|
||||
The JIT engine should work on Linux and Win32, although you
|
||||
might need to install the CygWin32 development tools to get a
|
||||
will need to install the CygWin32 development tools to get a
|
||||
Unix-like compilation environment.
|
||||
|
||||
** JIT Engine
|
||||
** JIT Engine (<b>updated, Jul 14th, 2001</b>)
|
||||
|
||||
Currently we are evaluating various mechanisms for our JIT
|
||||
engine (<a
|
||||
href="http://www.intel.com/research/mrl/orp/">ORP</a>, <a
|
||||
href="http://www.gnu.org/software/lightning/">GNU
|
||||
Lightning</a>, and <a
|
||||
href="http://www.eecs.harvard.edu/~nr/toolkit/">NJ Machine
|
||||
Toolkit</a>.).
|
||||
We will be using a code-generator generator approach for our
|
||||
JITer. Given the properties of CIL byte codes, we can take
|
||||
full advantage of a real instruction selector for our code
|
||||
generator.
|
||||
|
||||
We have not made a decision yet, but we might want to use a
|
||||
Code Generator Generator for the Common Intermediate Language,
|
||||
as that is likely going to allow us to create better code
|
||||
(There are a couple of books that deal with this technique: "A
|
||||
There are a couple of books that deal with this technique: "A
|
||||
Retargetable C Compiler" and "Advanced Compiler Design and
|
||||
Implementation").
|
||||
Implementation" are good references. You can also get a
|
||||
technical description of <a
|
||||
href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/iburg.pdf&pub=ACM">lbrug</a>
|
||||
|
||||
Previously we had looked at a number of JIT engines and tools,
|
||||
but they would not take full advantage of the CIL properties:
|
||||
|
||||
<ul>
|
||||
* <a
|
||||
href="http://www.intel.com/research/mrl/orp/">ORP</a>
|
||||
|
||||
* <a
|
||||
href="http://www.gnu.org/software/lightning/">GNU
|
||||
Lightning</a>
|
||||
|
||||
* href="http://www.eecs.harvard.edu/~nr/toolkit/">NJ Machine
|
||||
Toolkit</a>.).
|
||||
|
||||
* VCODE.
|
||||
</ul>
|
||||
|
||||
** Garbage Collection
|
||||
|
||||
@@ -85,9 +96,17 @@
|
||||
* Garbage collection list and FAQ:<br>
|
||||
<a href="http://www.iecc.com/gclist/">http://www.iecc.com/gclist/</a>
|
||||
|
||||
* The Microsoft .NET Garbage Collection Implementation:<br>
|
||||
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp</a>
|
||||
* "GC points in a Threaded Environment":<br>
|
||||
<a href="http://research.sun.com/techrep/1998/abstract-70.html">
|
||||
http://research.sun.com/techrep/1998/abstract-70.html</a>
|
||||
|
||||
* "A Generational Mostly-concurrent Garbage Collector":
|
||||
<a href="http://http://research.sun.com/techrep/2000/abstract-88.html">
|
||||
http://http://research.sun.com/techrep/2000/abstract-88.html</a>
|
||||
|
||||
* Details on The Microsoft .NET Garbage Collection Implementation:<br>
|
||||
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp</a>
|
||||
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI2.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI2.asp</a>
|
||||
</ul>
|
||||
|
||||
** Useful links
|
||||
@@ -116,3 +135,7 @@
|
||||
calls, these in turn are required for reusing some of the
|
||||
GNOME libraries that will reduce the work we have to do to
|
||||
deliver a complete class library.
|
||||
|
||||
To implement PInvoke we are looking into using the <a
|
||||
href="http://sources.redhat.com/libffi">Foreign Function
|
||||
Interface</a> Library from Cygnus.
|
||||
+11
-17
@@ -1,6 +1,6 @@
|
||||
* Project Status
|
||||
|
||||
|
||||
|
||||
Pieces of Mono that have been implemented:
|
||||
|
||||
<ul>
|
||||
@@ -10,35 +10,29 @@
|
||||
|
||||
* Metadata library: Can currently parse and load
|
||||
information from .NET modules (executables and DLL
|
||||
files). It has a few bugs outstanding (table
|
||||
dimension computation is incorrect).
|
||||
files).
|
||||
|
||||
Parsing of Exception tables is missing.
|
||||
|
||||
It lacks Token to (Table, Index) mapping, but this
|
||||
should be trivial to write.
|
||||
|
||||
* Disassembler: Can disassemble .NET modules. Still
|
||||
lacking exception handling as well as useful debugging
|
||||
tools (hex dumping, token dumping).
|
||||
|
||||
* Class Libraries: Only a few classes have been
|
||||
implemented.
|
||||
* Class Libraries: You can check the current status in the
|
||||
<a href="class-status.html">Class Status page</a>
|
||||
</ul>
|
||||
|
||||
Tasks on the critical path:
|
||||
|
||||
<ul>
|
||||
* Method and Field resolution.
|
||||
* Bytecode interpreter: (Paolo is working on this).
|
||||
|
||||
* Bytecode interpreter: Not implemented yet.
|
||||
* Simple JIT: Not implemented yet (Miguel is
|
||||
researching the code-generator generator)
|
||||
|
||||
* Simple JIT: Not implemented yet.
|
||||
|
||||
* Garbage collection engine.
|
||||
* Garbage collection engine (Dick is working on this, his contact is <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If you want to work on any task here, please mail <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
@@ -4,22 +4,64 @@
|
||||
Mono-based solution. Some of these tools can be developed on
|
||||
Windows before Mono is fully finished.
|
||||
|
||||
All of these tools should be written using C#.
|
||||
|
||||
For the tools that are typically command line tools: Try to
|
||||
write these as components that could load their input from
|
||||
streams or collections of streams, and implement the command
|
||||
line tools as wrappers around those classes.
|
||||
|
||||
For example, we will be making the C# compiler a component
|
||||
that could be reused by applications that might have a use for
|
||||
the various bits of the compiler (either to embed the
|
||||
compiler, or reuse the code generator part of it).
|
||||
|
||||
This is important so that these components (compiler,
|
||||
assembler, linker, etc) can be integrated later into the
|
||||
visual development environment (hopefully with the help of the
|
||||
SharpDevelop hackers).
|
||||
|
||||
TODO=ilasm,IL Assembler
|
||||
** IL Assembler.
|
||||
|
||||
This assembler should basically take as input a file
|
||||
containing IL bytecodes as specified in the `Partition II' of
|
||||
the ECMA spec, and produce a binary file.
|
||||
|
||||
TODO=al,Assembly Linker
|
||||
** Assembly Linker.
|
||||
|
||||
This tool is used to construct assemblies, which are basically
|
||||
deployment units for CLI executables.
|
||||
|
||||
TODO=debugger,Debugger
|
||||
** Debugger
|
||||
|
||||
We will need a debugging API to debug CLI applications and
|
||||
then a debugger component that can be used in an IDE
|
||||
environment.
|
||||
|
||||
TODO=ide,Integrated Development Environment
|
||||
** Integrated Development Environment
|
||||
|
||||
There is already a project to create a C# development
|
||||
environment (SharpDevelop). People could work with the
|
||||
SharpDevelop hackers to produce a unified development environment.
|
||||
environment: <a
|
||||
href="http://www.icsharpcode.net/OpenSource/SD/default.asp">SharpDevelop</a>.
|
||||
People should work with the SharpDevelop hackers to produce a
|
||||
unified development environment.
|
||||
|
||||
Please work with the SharpDevelop hackers to build a good IDE.
|
||||
We will work on creating an embedable compiler component and
|
||||
an embeddable debugger component that can be used withing
|
||||
SharpDevelop
|
||||
|
||||
TODO=hbrowser,Help Browser
|
||||
** Help Browser
|
||||
|
||||
We need a good help browser that can be used to browse all the
|
||||
Mono documentation.
|
||||
|
||||
|
||||
We need a good help browser that can be used to browse
|
||||
documentation. Ideally this help browser can accept as input
|
||||
XML Docbook input and an assorted set of file formats
|
||||
(Microsoft Help, Unix manual pages, Unix Info pages)
|
||||
|
||||
Look at the GNOME DevHelp for a good set of ideas on how to
|
||||
implement this.
|
||||
@@ -3,6 +3,7 @@
|
||||
0,Mono,rationale.html,rationale.src
|
||||
1,Runtime,runtime.html,runtime.src
|
||||
1,Classes,class-library.html,class-library.src
|
||||
2,Class Status,class-status.html,class-status.src
|
||||
1,C# Compiler,c-sharp.html,c-sharp.src
|
||||
1,Status,status.html,status.src
|
||||
0,Contributing,contributing.html,contributing.src
|
||||
|
||||
+4
-2
@@ -14,11 +14,13 @@ while (<>){
|
||||
} elsif (/^\t\t\* (.*)$/) {
|
||||
print "<li>$1\n";
|
||||
} elsif (/^Q: (.*)$/){
|
||||
print "<p><a name=\"q$q\"><b>Question $q:</b> $1\n";
|
||||
print "<p><a name=\"q$q\"></a><b>Question $q:</b> $1\n";
|
||||
$q++;
|
||||
} elsif (/^A: (.*)$/){
|
||||
print "$1\n";
|
||||
} else {
|
||||
} elsif (/^TODO=(.*),$/){
|
||||
print "<a name=\"$1\">\n";
|
||||
} else {
|
||||
print "$_\n";
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -1,6 +1,7 @@
|
||||
SOURCES= \
|
||||
../contributing \
|
||||
../class-library \
|
||||
../class-status \
|
||||
../contact \
|
||||
../c-sharp \
|
||||
../documentation \
|
||||
|
||||
@@ -47,13 +47,13 @@
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="black" width="1"><img src="images/pixel.gif" width="1"></td>
|
||||
<td bgcolor="white">
|
||||
<td bgcolor="white" align="left" width="80%" valign="top">
|
||||
<table cellpadding="16">
|
||||
<tr><td>
|
||||
#CONTENT#
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
<td bgcolor="black"><img src="images/pixel.gif" width="1"></td>
|
||||
<td width="100"><img src="images/pixel.gif"></td>
|
||||
</tr>
|
||||
|
||||
+9
-1
@@ -1 +1,9 @@
|
||||
Miguel de Icaza ([email protected])
|
||||
C# Compiler:
|
||||
Miguel de Icaza ([email protected])
|
||||
|
||||
Class Libraries:
|
||||
Jeff Stedfast ([email protected])
|
||||
Joe Shaw ([email protected])
|
||||
Miguel de Icaza ([email protected])
|
||||
Sean MacIsaac ([email protected])
|
||||
Vladimir Vukicevic ([email protected])
|
||||
@@ -0,0 +1,3 @@
|
||||
2001-07-20 Patrik Torstensson ([email protected])
|
||||
|
||||
* Added directory: System.Web.Caching
|
||||
@@ -0,0 +1,520 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements a cache for Web applications and other. The difference from the MS.NET implementation is that we
|
||||
/// support to use the Cache object as cache in our applications.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The Singleton cache is created per application domain, and it remains valid as long as the application domain remains active.
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// Usage of the singleton cache:
|
||||
///
|
||||
/// Cache objManager = Cache.SingletonCache;
|
||||
///
|
||||
/// String obj = "tobecached";
|
||||
/// objManager.Add("kalle", obj);
|
||||
/// </example>
|
||||
public class Cache : System.Collections.IEnumerable, System.IDisposable
|
||||
{
|
||||
// Declarations
|
||||
|
||||
// MS.NET Does only have the cache connected to the HttpRuntime and we don't have the HttpRuntime (yet)
|
||||
static Cache objSingletonCache = new Cache();
|
||||
|
||||
private bool _boolDisposed;
|
||||
|
||||
// Helper objects
|
||||
private CacheExpires _objExpires;
|
||||
|
||||
// The data storage
|
||||
// Todo: Make a specialized storage for the cache entries?
|
||||
// todo: allow system to replace the storage?
|
||||
private System.Collections.Hashtable _arrEntries;
|
||||
private System.Threading.ReaderWriterLock _lockEntries;
|
||||
|
||||
static private System.TimeSpan _datetimeOneYear = System.TimeSpan.FromDays(365);
|
||||
|
||||
// Number of items in the cache
|
||||
private long _longItems;
|
||||
|
||||
// Constructor
|
||||
public Cache()
|
||||
{
|
||||
_boolDisposed = false;
|
||||
_longItems = 0;
|
||||
|
||||
_lockEntries = new System.Threading.ReaderWriterLock();
|
||||
_arrEntries = new System.Collections.Hashtable();
|
||||
|
||||
_objExpires = new CacheExpires(this);
|
||||
}
|
||||
|
||||
// Public methods and properties
|
||||
|
||||
//
|
||||
/// <summary>
|
||||
/// Returns a static version of the cache. In MS.NET the cache is stored in the System.Web.HttpRuntime
|
||||
/// but we keep it here as a singleton (right now anyway).
|
||||
/// </summary>
|
||||
public static Cache SingletonCache
|
||||
{
|
||||
get
|
||||
{
|
||||
if (objSingletonCache == null)
|
||||
{
|
||||
throw new System.InvalidOperationException();
|
||||
}
|
||||
|
||||
return objSingletonCache;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used in the absoluteExpiration parameter in an Insert method call to indicate the item should never expire. This field is read-only.
|
||||
/// </summary>
|
||||
public static readonly System.DateTime NoAbsoluteExpiration = System.DateTime.MaxValue;
|
||||
|
||||
/// <summary>
|
||||
/// Used as the slidingExpiration parameter in an Insert method call to disable sliding expirations. This field is read-only.
|
||||
/// </summary>
|
||||
public static readonly System.TimeSpan NoSlidingExpiration = System.TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Internal method to create a enumerator and over all public items in the cache and is used by GetEnumerator method.
|
||||
/// </summary>
|
||||
/// <returns>Returns IDictionaryEnumerator that contains all public items in the cache</returns>
|
||||
private System.Collections.IDictionaryEnumerator CreateEnumerator()
|
||||
{
|
||||
System.Collections.Hashtable objTable;
|
||||
|
||||
_lockEntries.AcquireReaderLock(int.MaxValue);
|
||||
try
|
||||
{
|
||||
// Create a new hashtable to return as collection of public items
|
||||
objTable = new System.Collections.Hashtable(_arrEntries.Count);
|
||||
|
||||
foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
|
||||
{
|
||||
if (objEntry.Key != null)
|
||||
{
|
||||
// Check if this is a public entry
|
||||
if (((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Public))
|
||||
{
|
||||
// Add to the collection
|
||||
objTable.Add(objEntry.Key, ((CacheEntry) objEntry.Value).Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_lockEntries.ReleaseReaderLock();
|
||||
}
|
||||
|
||||
return objTable.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implementation of IEnumerable interface and calls the GetEnumerator that returns
|
||||
/// IDictionaryEnumerator.
|
||||
/// </summary>
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Virtual override of the IEnumerable.GetEnumerator() method, returns a specialized enumerator.
|
||||
/// </summary>
|
||||
public virtual System.Collections.IDictionaryEnumerator GetEnumerator()
|
||||
{
|
||||
return CreateEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Touches a object in the cache. Used to update expire time and hit count.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The identifier for the cache item to retrieve.</param>
|
||||
public void Touch(string strKey)
|
||||
{
|
||||
// Just touch the object
|
||||
Get(strKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified item to the Cache object with dependencies, expiration and priority policies, and a
|
||||
/// delegate you can use to notify your application when the inserted item is removed from the Cache.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
/// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
|
||||
/// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
|
||||
/// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
|
||||
/// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
|
||||
/// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
|
||||
/// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
|
||||
/// <returns>The Object item added to the Cache.</returns>
|
||||
public object Add(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
|
||||
{
|
||||
if (_boolDisposed)
|
||||
{
|
||||
throw new System.ObjectDisposedException("System.Web.Cache");
|
||||
}
|
||||
|
||||
if (strKey == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("strKey");
|
||||
}
|
||||
|
||||
if (objItem == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("objItem");
|
||||
}
|
||||
|
||||
if (slidingExpiration > _datetimeOneYear)
|
||||
{
|
||||
throw new System.ArgumentOutOfRangeException("slidingExpiration");
|
||||
}
|
||||
|
||||
CacheEntry objEntry;
|
||||
CacheEntry objNewEntry;
|
||||
|
||||
long longHitRange = 10000;
|
||||
|
||||
// todo: check decay and make up the minHit range
|
||||
|
||||
objEntry = new CacheEntry(this, strKey, objItem, objDependency, eventRemoveCallback, absolutExpiration, slidingExpiration, longHitRange, true, enumPriority);
|
||||
|
||||
System.Threading.Interlocked.Increment(ref _longItems);
|
||||
|
||||
// If we have any kind of expiration add into the CacheExpires class
|
||||
if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
|
||||
{
|
||||
// Add it to CacheExpires
|
||||
_objExpires.Add(objEntry);
|
||||
}
|
||||
|
||||
// Check and get the new item..
|
||||
objNewEntry = UpdateCache(strKey, objEntry, true, CacheItemRemovedReason.Removed);
|
||||
|
||||
if (objNewEntry != null)
|
||||
{
|
||||
// Return added item
|
||||
return objEntry.Item;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts an item into the Cache object with a cache key to reference its location and using default values
|
||||
/// provided by the CacheItemPriority and CacheItemPriorityDecay enumerations.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
public void Insert(string strKey, object objItem)
|
||||
{
|
||||
Add(strKey, objItem, null, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts an object into the Cache that has file or key dependencies.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
/// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
|
||||
public void Insert(string strKey, object objItem, CacheDependency objDependency)
|
||||
{
|
||||
Add(strKey, objItem, objDependency, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts an object into the Cache with dependencies and expiration policies.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
/// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
|
||||
/// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
|
||||
/// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
|
||||
public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration)
|
||||
{
|
||||
Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts an object into the Cache object with dependencies, expiration and priority policies, and a delegate
|
||||
/// you can use to notify your application when the inserted item is removed from the Cache.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
/// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
|
||||
/// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
|
||||
/// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
|
||||
/// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
|
||||
/// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
|
||||
/// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
|
||||
public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
|
||||
{
|
||||
Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, enumPriority, enumPriorityDecay, eventRemoveCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the specified item from the Cache object.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key for the cache item to remove.</param>
|
||||
/// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
|
||||
public object Remove(string strKey)
|
||||
{
|
||||
return Remove(strKey, CacheItemRemovedReason.Removed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method that updates the cache, decremenents the number of existing items and call close on the cache entry. This method
|
||||
/// is also used from the ExpiresBuckets class to remove an item during GC flush.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key for the cache item to remove.</param>
|
||||
/// <param name="enumReason">Reason why the item is removed.</param>
|
||||
/// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
|
||||
internal object Remove(string strKey, CacheItemRemovedReason enumReason)
|
||||
{
|
||||
CacheEntry objEntry = UpdateCache(strKey, null, true, enumReason);
|
||||
|
||||
if (objEntry != null)
|
||||
{
|
||||
System.Threading.Interlocked.Decrement(ref _longItems);
|
||||
|
||||
// Close the cache entry (calls the remove delegate)
|
||||
objEntry.Close(enumReason);
|
||||
|
||||
return objEntry.Item;
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the specified item from the Cache object.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The identifier for the cache item to retrieve.</param>
|
||||
/// <returns>The retrieved cache item, or a null reference.</returns>
|
||||
public object Get(string strKey)
|
||||
{
|
||||
CacheEntry objEntry = UpdateCache(strKey, null, false, CacheItemRemovedReason.Expired);
|
||||
|
||||
if (objEntry == null)
|
||||
{
|
||||
return null;
|
||||
} else
|
||||
{
|
||||
return objEntry.Item;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method used for removing, updating and adding CacheEntries into the cache.
|
||||
/// </summary>
|
||||
/// <param name="strKey">The identifier for the cache item to modify</param>
|
||||
/// <param name="objEntry">CacheEntry to use for overwrite operation, if this parameter is null and overwrite true the item is going to be removed</param>
|
||||
/// <param name="boolOverwrite">If true the objEntry parameter is used to overwrite the strKey entry</param>
|
||||
/// <param name="enumReason">Reason why an item was removed</param>
|
||||
/// <returns></returns>
|
||||
private CacheEntry UpdateCache(string strKey, CacheEntry objEntry, bool boolOverwrite, CacheItemRemovedReason enumReason)
|
||||
{
|
||||
if (_boolDisposed)
|
||||
{
|
||||
throw new System.ObjectDisposedException("System.Web.Cache", "Can't update item(s) in a disposed cache");
|
||||
}
|
||||
|
||||
if (strKey == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("System.Web.Cache");
|
||||
}
|
||||
|
||||
long ticksNow = System.DateTime.Now.Ticks;
|
||||
long ticksExpires = long.MaxValue;
|
||||
|
||||
bool boolGetItem = false;
|
||||
bool boolExpiried = false;
|
||||
bool boolWrite = false;
|
||||
bool boolRemoved = false;
|
||||
|
||||
// Are we getting the item from the hashtable
|
||||
if (boolOverwrite == false && strKey.Length > 0 && objEntry == null)
|
||||
{
|
||||
boolGetItem = true;
|
||||
}
|
||||
|
||||
// TODO: Optimize this method, move out functionality outside the lock
|
||||
_lockEntries.AcquireReaderLock(int.MaxValue);
|
||||
try
|
||||
{
|
||||
if (boolGetItem)
|
||||
{
|
||||
objEntry = (CacheEntry) _arrEntries[strKey];
|
||||
if (objEntry == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (objEntry != null)
|
||||
{
|
||||
// Check if we have expired
|
||||
if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
|
||||
{
|
||||
if (objEntry.Expires < ticksNow)
|
||||
{
|
||||
// We have expired, remove the item from the cache
|
||||
boolWrite = true;
|
||||
boolExpiried = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we going to modify the hashtable
|
||||
if (boolWrite || (boolOverwrite && !boolExpiried))
|
||||
{
|
||||
// Upgrade our lock to write
|
||||
System.Threading.LockCookie objCookie = _lockEntries.UpgradeToWriterLock(int.MaxValue);
|
||||
try
|
||||
{
|
||||
// Check if we going to just modify an existing entry (or add)
|
||||
if (boolOverwrite && objEntry != null)
|
||||
{
|
||||
_arrEntries[strKey] = objEntry;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We need to remove the item, fetch the item first
|
||||
objEntry = (CacheEntry) _arrEntries[strKey];
|
||||
if (objEntry != null)
|
||||
{
|
||||
_arrEntries.Remove(strKey);
|
||||
}
|
||||
|
||||
boolRemoved = true;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_lockEntries.DowngradeFromWriterLock(ref objCookie);
|
||||
}
|
||||
}
|
||||
|
||||
// If the entry haven't expired or been removed update the info
|
||||
if (!boolExpiried && !boolRemoved)
|
||||
{
|
||||
// Update that we got a hit
|
||||
objEntry.Hits++;
|
||||
if (objEntry.HasSlidingExpiration)
|
||||
{
|
||||
ticksExpires = ticksNow + objEntry.SlidingExpiration;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_lockEntries.ReleaseLock();
|
||||
|
||||
}
|
||||
|
||||
// If the item was removed we need to remove it from the CacheExpired class also
|
||||
if (boolRemoved)
|
||||
{
|
||||
if (objEntry != null)
|
||||
{
|
||||
if (objEntry.HasAbsoluteExpiration || objEntry.HasSlidingExpiration)
|
||||
{
|
||||
_objExpires.Remove(objEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// Return the entry, it's not up to the UpdateCache to call Close on the entry
|
||||
return objEntry;
|
||||
}
|
||||
|
||||
// If we have sliding expiration and we have a correct hit, update the expiration manager
|
||||
if (objEntry.HasSlidingExpiration)
|
||||
{
|
||||
_objExpires.Update(objEntry, ticksExpires);
|
||||
}
|
||||
|
||||
// Return the cache entry
|
||||
return objEntry;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of items stored in the cache.
|
||||
/// </summary>
|
||||
long Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _longItems;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cache item at the specified key.
|
||||
/// </summary>
|
||||
public object this[string strKey]
|
||||
{
|
||||
get
|
||||
{
|
||||
return Get(strKey);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Insert(strKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called to close the cache when the AppDomain is closing down or the GC has decided it's time to destroy the object.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_boolDisposed = true;
|
||||
|
||||
_lockEntries.AcquireReaderLock(int.MaxValue);
|
||||
try
|
||||
{
|
||||
foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
|
||||
{
|
||||
if (objEntry.Key != null)
|
||||
{
|
||||
// Check if this is active
|
||||
if ( ((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Removed) )
|
||||
{
|
||||
try
|
||||
{
|
||||
((CacheEntry) objEntry.Value).Close(CacheItemRemovedReason.Removed);
|
||||
}
|
||||
catch (System.Exception objException)
|
||||
{
|
||||
System.Diagnostics.Debug.Fail("System.Web.Cache.Dispose() Exception when closing cache entry", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_lockEntries.ReleaseReaderLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the relative priority of items stored in the Cache.
|
||||
/// </summary>
|
||||
public enum CacheItemPriority {
|
||||
AboveNormal,
|
||||
BelowNormal,
|
||||
Default,
|
||||
High,
|
||||
Low,
|
||||
Normal,
|
||||
NotRemovable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the rate at which the priority of items stored in the Cache are downgraded when not accessed frequently.
|
||||
/// </summary>
|
||||
public enum CacheItemPriorityDecay {
|
||||
Default,
|
||||
Fast,
|
||||
Medium,
|
||||
Never,
|
||||
Slow
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the reason an item was removed from the Cache.
|
||||
/// </summary>
|
||||
public enum CacheItemRemovedReason {
|
||||
DependencyChanged,
|
||||
Expired,
|
||||
Removed,
|
||||
Underused
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a callback method for notifying applications when a cached item is removed from the Cache.
|
||||
/// </summary>
|
||||
/// <param name="key">The index location for the item removed from the cache. </param>
|
||||
/// <param name="value">The Object item removed from the cache. </param>
|
||||
/// <param name="reason">The reason the item was removed from the cache, as specified by the CacheItemRemovedReason enumeration.</param>
|
||||
public delegate void CacheItemRemovedCallback(string key, object value, CacheItemRemovedReason reason);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to handle cache dependency, right now this class is only a mookup
|
||||
/// </summary>
|
||||
public class CacheDependency : System.IDisposable
|
||||
{
|
||||
private bool _boolDisposed;
|
||||
|
||||
public CacheDependency()
|
||||
{
|
||||
_boolDisposed = false;
|
||||
}
|
||||
|
||||
public delegate void CacheDependencyCallback(CacheDependency objDependency);
|
||||
|
||||
public event CacheDependencyCallback Changed;
|
||||
|
||||
public void OnChanged()
|
||||
{
|
||||
if (_boolDisposed)
|
||||
{
|
||||
throw new System.ObjectDisposedException("System.Web.CacheDependency");
|
||||
}
|
||||
|
||||
if (Changed != null)
|
||||
{
|
||||
Changed(this);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDisposed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _boolDisposed;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasEvents
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_boolDisposed)
|
||||
{
|
||||
throw new System.ObjectDisposedException("System.Web.CacheDependency");
|
||||
}
|
||||
|
||||
if (Changed != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_boolDisposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used in testing.
|
||||
/// </summary>
|
||||
public void Signal()
|
||||
{
|
||||
OnChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Class responsible for representing a cache entry.
|
||||
/// </summary>
|
||||
public class CacheEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the status of the current cache entry
|
||||
/// </summary>
|
||||
public enum Flags
|
||||
{
|
||||
Removed = 0,
|
||||
Public = 1
|
||||
}
|
||||
|
||||
private CacheItemPriority _enumPriority;
|
||||
|
||||
private long _longHits;
|
||||
|
||||
private byte _byteExpiresBucket;
|
||||
private int _intExpiresIndex;
|
||||
|
||||
private long _ticksExpires;
|
||||
private long _ticksSlidingExpiration;
|
||||
|
||||
private string _strKey;
|
||||
private object _objItem;
|
||||
|
||||
private long _longMinHits;
|
||||
|
||||
private Flags _enumFlags;
|
||||
|
||||
private CacheDependency _objDependency;
|
||||
private Cache _objCache;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new cache entry
|
||||
/// </summary>
|
||||
/// <param name="strKey">The cache key used to reference the item.</param>
|
||||
/// <param name="objItem">The item to be added to the cache.</param>
|
||||
/// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
|
||||
/// <param name="dtExpires">The time at which the added object expires and is removed from the cache. </param>
|
||||
/// <param name="tsSpan">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
|
||||
/// <param name="longMinHits">Used to detect and control if the item should be flushed due to under usage</param>
|
||||
/// <param name="boolPublic">Defines if the item is public or not</param>
|
||||
/// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
|
||||
public CacheEntry( Cache objManager, string strKey, object objItem, CacheDependency objDependency, CacheItemRemovedCallback eventRemove,
|
||||
System.DateTime dtExpires, System.TimeSpan tsSpan, long longMinHits, bool boolPublic, CacheItemPriority enumPriority )
|
||||
{
|
||||
if (boolPublic)
|
||||
{
|
||||
SetFlag(Flags.Public);
|
||||
}
|
||||
|
||||
_strKey = strKey;
|
||||
_objItem = objItem;
|
||||
_objCache = objManager;
|
||||
|
||||
_onRemoved += eventRemove;
|
||||
|
||||
_enumPriority = enumPriority;
|
||||
|
||||
_ticksExpires = dtExpires.Ticks;
|
||||
|
||||
_ticksSlidingExpiration = tsSpan.Ticks;
|
||||
|
||||
// If we have a sliding expiration it overrides the absolute expiration (MS behavior)
|
||||
if (tsSpan.Ticks != System.TimeSpan.Zero.Ticks)
|
||||
{
|
||||
_ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
|
||||
}
|
||||
|
||||
_objDependency = objDependency;
|
||||
if (_objDependency != null)
|
||||
{
|
||||
if (_objDependency.IsDisposed)
|
||||
{
|
||||
throw new System.ObjectDisposedException("System.Web.CacheDependency");
|
||||
}
|
||||
|
||||
// Add the entry to the cache dependency handler (we support multiple entries per handler)
|
||||
_objDependency.Changed += new CacheDependency.CacheDependencyCallback(OnChanged);
|
||||
}
|
||||
|
||||
_longMinHits = longMinHits;
|
||||
}
|
||||
|
||||
private event CacheItemRemovedCallback _onRemoved;
|
||||
|
||||
public void OnChanged(CacheDependency objDependency)
|
||||
{
|
||||
_objCache.Remove(_strKey, CacheItemRemovedReason.DependencyChanged);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleans up the cache entry, removes the cache dependency and calls the remove delegate.
|
||||
/// </summary>
|
||||
/// <param name="enumReason">The reason why the cache entry are going to be removed</param>
|
||||
public void Close(CacheItemRemovedReason enumReason)
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
// Check if the item already is removed
|
||||
if (TestFlag(Flags.Removed))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetFlag(Flags.Removed);
|
||||
|
||||
if (_onRemoved != null)
|
||||
{
|
||||
// Call the delegate to tell that we are now removing the entry
|
||||
try
|
||||
{
|
||||
_onRemoved(_strKey, _objItem, enumReason);
|
||||
}
|
||||
catch (System.Exception objException)
|
||||
{
|
||||
System.Diagnostics.Debug.Fail("System.Web.CacheEntry.Close() Exception when calling remove delegate", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have a dependency, remove the entry
|
||||
if (_objDependency != null)
|
||||
{
|
||||
_objDependency.Changed -= new CacheDependency.CacheDependencyCallback(OnChanged);
|
||||
if (!_objDependency.HasEvents)
|
||||
{
|
||||
_objDependency.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests a specific flag is set or not.
|
||||
/// </summary>
|
||||
/// <param name="oFlag">Flag to test agains</param>
|
||||
/// <returns>Returns true if the flag is set.</returns>
|
||||
public bool TestFlag(Flags oFlag)
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
if ((_enumFlags & oFlag) != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets a specific flag.
|
||||
/// </summary>
|
||||
/// <param name="oFlag">Flag to set.</param>
|
||||
public void SetFlag(Flags oFlag)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
_enumFlags |= oFlag;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the object has minimum hit usage flushing enabled.
|
||||
/// </summary>
|
||||
public bool HasUsage
|
||||
{
|
||||
get {
|
||||
if (_longMinHits == System.Int64.MaxValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the entry has absolute expiration.
|
||||
/// </summary>
|
||||
public bool HasAbsoluteExpiration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ticksExpires == System.DateTime.MaxValue.Ticks)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the entry has sliding expiration enabled.
|
||||
/// </summary>
|
||||
public bool HasSlidingExpiration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ticksSlidingExpiration == System.TimeSpan.Zero.Ticks)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the current expires bucket the entry is active in.
|
||||
/// </summary>
|
||||
public byte ExpiresBucket
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
return _byteExpiresBucket;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
_byteExpiresBucket = ExpiresBucket;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the current index in the expires bucket of the current cache entry.
|
||||
/// </summary>
|
||||
public int ExpiresIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
return _intExpiresIndex;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
_intExpiresIndex = ExpiresIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the expiration of the cache entry.
|
||||
/// </summary>
|
||||
public long Expires
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
return _ticksExpires;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
_ticksExpires = Expires;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sliding expiration value. The return value is in ticks (since 0/0-01 in 100nanosec)
|
||||
/// </summary>
|
||||
public long SlidingExpiration
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ticksSlidingExpiration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current cached item.
|
||||
/// </summary>
|
||||
public object Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return _objItem;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current cache identifier.
|
||||
/// </summary>
|
||||
public string Key
|
||||
{
|
||||
get
|
||||
{
|
||||
return _strKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets the current number of hits on the cache entry.
|
||||
/// </summary>
|
||||
public long Hits
|
||||
{
|
||||
// todo: Could be optimized by using interlocked methods..
|
||||
get
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
return _longHits;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
_longHits = Hits;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns minimum hits for the usage flushing rutine.
|
||||
/// </summary>
|
||||
public long MinimumHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return _longMinHits;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the priority of the cache entry.
|
||||
/// </summary>
|
||||
public CacheItemPriority Priority
|
||||
{
|
||||
get
|
||||
{
|
||||
return _enumPriority;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Class responsible for handling time based flushing of entries in the cache. The class creates
|
||||
/// and manages 60 buckets each holding every item that expires that minute. The bucket calculated
|
||||
/// for an entry is one minute more than the timeout just to make sure that the item end up in the
|
||||
/// bucket where it should be flushed.
|
||||
/// </summary>
|
||||
public class CacheExpires : System.IDisposable
|
||||
{
|
||||
static int _intFlush;
|
||||
static long _ticksPerBucket = 600000000;
|
||||
static long _ticksPerCycle = _ticksPerBucket * 60;
|
||||
|
||||
private ExpiresBucket[] _arrBuckets;
|
||||
private System.Threading.Timer _objTimer;
|
||||
private Cache _objManager;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="objManager">The cache manager, used when flushing items in a bucket.</param>
|
||||
public CacheExpires(Cache objManager)
|
||||
{
|
||||
_objManager = objManager;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the class.
|
||||
/// </summary>
|
||||
private void Initialize()
|
||||
{
|
||||
// Create one bucket per minute
|
||||
_arrBuckets = new ExpiresBucket[60];
|
||||
|
||||
byte bytePos = 0;
|
||||
do
|
||||
{
|
||||
_arrBuckets[bytePos] = new ExpiresBucket(bytePos, _objManager);
|
||||
bytePos++;
|
||||
} while (bytePos < 60);
|
||||
|
||||
// GC Bucket controller
|
||||
_intFlush = System.DateTime.Now.Minute - 1;
|
||||
_objTimer = new System.Threading.Timer(new System.Threading.TimerCallback(GarbageCleanup), null, 10000, 60000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a Cache entry to the correct flush bucket.
|
||||
/// </summary>
|
||||
/// <param name="objEntry">Cache entry to add.</param>
|
||||
public void Add(CacheEntry objEntry)
|
||||
{
|
||||
long ticksNow = System.DateTime.Now.Ticks;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// If the entry doesn't have a expires time we assume that the entry is due to expire now.
|
||||
if (objEntry.Expires == 0)
|
||||
{
|
||||
objEntry.Expires = ticksNow;
|
||||
}
|
||||
|
||||
_arrBuckets[GetHashBucket(objEntry.Expires)].Add(objEntry);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(CacheEntry objEntry)
|
||||
{
|
||||
long ticksNow = System.DateTime.Now.Ticks;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// If the entry doesn't have a expires time we assume that the entry is due to expire now.
|
||||
if (objEntry.Expires == 0)
|
||||
{
|
||||
objEntry.Expires = ticksNow;
|
||||
}
|
||||
|
||||
_arrBuckets[GetHashBucket(objEntry.Expires)].Remove(objEntry);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(CacheEntry objEntry, long ticksExpires)
|
||||
{
|
||||
long ticksNow = System.DateTime.Now.Ticks;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// If the entry doesn't have a expires time we assume that the entry is due to expire now.
|
||||
if (objEntry.Expires == 0)
|
||||
{
|
||||
objEntry.Expires = ticksNow;
|
||||
}
|
||||
|
||||
_arrBuckets[GetHashBucket(objEntry.Expires)].Update(objEntry, ticksExpires);
|
||||
}
|
||||
}
|
||||
|
||||
public void GarbageCleanup(object State)
|
||||
{
|
||||
ExpiresBucket objBucket;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
// Do cleanup of the bucket
|
||||
objBucket = _arrBuckets[(++_intFlush) % 60];
|
||||
}
|
||||
|
||||
// Flush expired items in the current bucket (defined by _intFlush)
|
||||
objBucket.FlushExpiredItems();
|
||||
}
|
||||
|
||||
private int GetHashBucket(long ticks)
|
||||
{
|
||||
// Get bucket to add expire item into, add one minute to the bucket just to make sure that we get it in the bucket gc
|
||||
return (int) (((((ticks + 60000) % _ticksPerCycle) / _ticksPerBucket) + 1) % 60);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by the cache for cleanup.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
// Cleanup the internal timer
|
||||
if (_objTimer != null)
|
||||
{
|
||||
_objTimer.Dispose();
|
||||
_objTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
2001-07-20 Patrik Torstensson ([email protected])
|
||||
|
||||
* Cache.cs: Implemented. (90% ready)
|
||||
* CacheDefinitions.cs: Implemented.
|
||||
* CacheDependency.cs: Added. (20% ready)
|
||||
* CacheExpires: Implemented.
|
||||
* CacheEntry.cs: Implemented. (95% ready, going to be changed due to CacheDependecy support)
|
||||
* ExpiresBuckets.cs: Implemented.
|
||||
@@ -0,0 +1,253 @@
|
||||
//
|
||||
// System.Web.Caching
|
||||
//
|
||||
// Author:
|
||||
// Patrik Torstensson ([email protected])
|
||||
//
|
||||
// (C) Copyright Patrik Torstensson, 2001
|
||||
//
|
||||
namespace System.Web.Caching
|
||||
{
|
||||
/// <summary>
|
||||
/// Responsible for holding a cache entry in the linked list bucket.
|
||||
/// </summary>
|
||||
public struct ExpiresEntry
|
||||
{
|
||||
public CacheEntry _objEntry;
|
||||
public long _ticksExpires;
|
||||
public int _intNext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds cache entries that has a expiration in a bucket list.
|
||||
/// </summary>
|
||||
public class ExpiresBucket
|
||||
{
|
||||
private static int MIN_ENTRIES = 16;
|
||||
|
||||
private byte _byteID;
|
||||
private int _intSize;
|
||||
private int _intCount;
|
||||
private int _intNext;
|
||||
|
||||
private Cache _objManager;
|
||||
|
||||
private ExpiresEntry [] _arrEntries;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new bucket.
|
||||
/// </summary>
|
||||
/// <param name="bucket">Current bucket ID.</param>
|
||||
/// <param name="objManager">Cache manager reponsible for the item(s) in the expires bucket.</param>
|
||||
public ExpiresBucket(byte bucket, Cache objManager)
|
||||
{
|
||||
_objManager = objManager;
|
||||
Initialize(bucket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the expires bucket, creates a linked list of MIN_ENTRIES.
|
||||
/// </summary>
|
||||
/// <param name="bucket">Bucket ID.</param>
|
||||
private void Initialize(byte bucket)
|
||||
{
|
||||
_byteID = bucket;
|
||||
_intNext = 0;
|
||||
_intCount = 0;
|
||||
|
||||
_arrEntries = new ExpiresEntry[MIN_ENTRIES];
|
||||
_intSize = MIN_ENTRIES;
|
||||
|
||||
int intPos = 0;
|
||||
do
|
||||
{
|
||||
_arrEntries[intPos]._intNext = intPos + 1;
|
||||
_arrEntries[intPos]._ticksExpires = System.DateTime.MaxValue.Ticks;
|
||||
|
||||
intPos++;
|
||||
} while (intPos < _intSize);
|
||||
|
||||
_arrEntries[_intSize - 1]._intNext = -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Expands the bucket linked array list.
|
||||
/// </summary>
|
||||
private void Expand()
|
||||
{
|
||||
ExpiresEntry [] arrData;
|
||||
int intPos = 0;
|
||||
int intOldSize;
|
||||
|
||||
lock(this)
|
||||
{
|
||||
intOldSize = _intSize;
|
||||
_intSize *= 2;
|
||||
|
||||
// Create a new array and copy the old data into the new array
|
||||
arrData = new ExpiresEntry[_intSize];
|
||||
do
|
||||
{
|
||||
arrData[intPos] = _arrEntries[intPos];
|
||||
intPos++;
|
||||
} while (intPos < intOldSize);
|
||||
|
||||
_intNext = intPos;
|
||||
|
||||
// Initialize the "new" positions.
|
||||
do
|
||||
{
|
||||
arrData[intPos]._intNext = intPos + 1;
|
||||
intPos++;
|
||||
} while (intPos < _intSize);
|
||||
|
||||
arrData[_intSize - 1]._intNext = -1;
|
||||
|
||||
_arrEntries = arrData;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a cache entry into the expires bucket.
|
||||
/// </summary>
|
||||
/// <param name="objEntry">Cache Entry object to be added.</param>
|
||||
public void Add(CacheEntry objEntry)
|
||||
{
|
||||
if (_intNext == -1)
|
||||
{
|
||||
Expand();
|
||||
}
|
||||
|
||||
lock(this)
|
||||
{
|
||||
_arrEntries[_intNext]._ticksExpires = objEntry.Expires;
|
||||
_arrEntries[_intNext]._objEntry = objEntry;
|
||||
|
||||
_intNext = _arrEntries[_intNext]._intNext;
|
||||
|
||||
_intCount++;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a cache entry from the expires bucket.
|
||||
/// </summary>
|
||||
/// <param name="objEntry">Cache entry to be removed.</param>
|
||||
public void Remove(CacheEntry objEntry)
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
// Check if this is our bucket
|
||||
if (objEntry.ExpiresIndex != _byteID) return;
|
||||
if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
|
||||
if (_arrEntries.Length < objEntry.ExpiresIndex) return;
|
||||
|
||||
_intCount--;
|
||||
|
||||
_arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresBucket = byte.MaxValue;
|
||||
_arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresIndex = int.MaxValue;
|
||||
_arrEntries[objEntry.ExpiresIndex]._objEntry = null;
|
||||
_intNext = _arrEntries[objEntry.ExpiresIndex]._intNext;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates a cache entry in the expires bucket, this is called during a hit of an item if the
|
||||
/// cache item has a sliding expiration. The function is responsible for updating the cache
|
||||
/// entry.
|
||||
/// </summary>
|
||||
/// <param name="objEntry">Cache entry to update.</param>
|
||||
/// <param name="ticksExpires">New expiration value for the cache entry.</param>
|
||||
public void Update(CacheEntry objEntry, long ticksExpires)
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
// Check if this is our bucket
|
||||
if (objEntry.ExpiresIndex != _byteID) return;
|
||||
if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
|
||||
if (_arrEntries.Length < objEntry.ExpiresIndex) return;
|
||||
|
||||
_arrEntries[objEntry.ExpiresIndex]._ticksExpires = ticksExpires;
|
||||
_arrEntries[objEntry.ExpiresIndex]._objEntry.Expires = ticksExpires;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flushes all cache entries that has expired and removes them from the cache manager.
|
||||
/// </summary>
|
||||
public void FlushExpiredItems()
|
||||
{
|
||||
ExpiresEntry objEntry;
|
||||
CacheEntry [] arrCacheEntries;
|
||||
|
||||
int intCachePos;
|
||||
int intPos;
|
||||
long ticksNow;
|
||||
|
||||
ticksNow = System.DateTime.Now.Ticks;
|
||||
|
||||
intCachePos = 0;
|
||||
|
||||
// Lookup all items that needs to be removed, this is done in a two part
|
||||
// operation to minimize the locking time.
|
||||
lock (this)
|
||||
{
|
||||
arrCacheEntries = new CacheEntry[_intSize];
|
||||
|
||||
intPos = 0;
|
||||
do
|
||||
{
|
||||
objEntry = _arrEntries[intPos];
|
||||
if (objEntry._objEntry != null)
|
||||
{
|
||||
if (objEntry._ticksExpires < ticksNow)
|
||||
{
|
||||
arrCacheEntries[intCachePos++] = objEntry._objEntry;
|
||||
|
||||
objEntry._objEntry.ExpiresBucket = byte.MaxValue;
|
||||
objEntry._objEntry.ExpiresIndex = int.MaxValue;
|
||||
objEntry._objEntry = null;
|
||||
_intNext = objEntry._intNext;
|
||||
}
|
||||
}
|
||||
|
||||
intPos++;
|
||||
} while (intPos < _intSize);
|
||||
}
|
||||
|
||||
// If we have any entries to remove, go ahead and call the cache manager remove.
|
||||
if (intCachePos > 0)
|
||||
{
|
||||
intPos = 0;
|
||||
do
|
||||
{
|
||||
_objManager.Remove(arrCacheEntries[intPos].Key, CacheItemRemovedReason.Expired);
|
||||
|
||||
intPos++;
|
||||
} while (intPos < intCachePos);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current size of the expires bucket.
|
||||
/// </summary>
|
||||
public int Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return _arrEntries.Length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns number of items in the bucket.
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _intCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Cache.cs
|
||||
CacheDefinitions.cs
|
||||
CacheDependency.cs
|
||||
CacheEntry.cs
|
||||
CacheExpires.cs
|
||||
ExpiresBuckets.cs
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
||||
DIRS=System.Web.Caching
|
||||
|
||||
all:
|
||||
@echo "You must use 'make windows' or 'make unix'."
|
||||
@echo "'make unix' is broken for now."
|
||||
|
||||
windows: make-list
|
||||
$(CSC) /target:library /out:System.Web.dll /nowarn:1595 @list
|
||||
|
||||
unix:
|
||||
@echo "'make unix' is broken for now."
|
||||
|
||||
make-list:
|
||||
for i in $(DIRS); do \
|
||||
cat $$i/common.src $$i/windows.src | sed "s/^/$$i\\\\/"; \
|
||||
done > list
|
||||
@@ -0,0 +1,2 @@
|
||||
*.dll
|
||||
list
|
||||
@@ -0,0 +1,57 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// Driver.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
public class Driver
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
XmlReader xmlReader = null;
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
xmlReader = new XmlTextReader(Console.In);
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlReader = new XmlTextReader(args[0]);
|
||||
}
|
||||
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
Console.WriteLine("NodeType = {0}", xmlReader.NodeType);
|
||||
Console.WriteLine(" Name = {0}", xmlReader.Name);
|
||||
Console.WriteLine(" IsEmptyElement = {0}", xmlReader.IsEmptyElement);
|
||||
Console.WriteLine(" HasAttributes = {0}", xmlReader.HasAttributes);
|
||||
Console.WriteLine(" AttributeCount = {0}", xmlReader.AttributeCount);
|
||||
Console.WriteLine(" HasValue = {0}", xmlReader.HasValue);
|
||||
Console.WriteLine(" Value = {0}", xmlReader.Value);
|
||||
Console.WriteLine(" Depth = {0}", xmlReader.Depth);
|
||||
|
||||
if (xmlReader.HasAttributes)
|
||||
{
|
||||
while (xmlReader.MoveToNextAttribute())
|
||||
{
|
||||
Console.WriteLine(" AttributeName = {0}", xmlReader.Name);
|
||||
Console.WriteLine(" AttributeValue = {0}", xmlReader.Value);
|
||||
|
||||
while (xmlReader.ReadAttributeValue())
|
||||
{
|
||||
Console.WriteLine(" AttributeValueNodeType = {0}", xmlReader.NodeType);
|
||||
Console.WriteLine(" AttributeValueName = {0}", xmlReader.Name);
|
||||
Console.WriteLine(" AttributeValueValue = {0}", xmlReader.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.IXmlLineInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public interface IXmlLineInfo
|
||||
{
|
||||
int LineNumber { get; }
|
||||
int LinePosition { get; }
|
||||
|
||||
bool HasLineInfo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// Profile.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
public class Profile
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
XmlReader xmlReader = null;
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
xmlReader = new XmlTextReader(Console.In);
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlReader = new XmlTextReader(args[0]);
|
||||
}
|
||||
|
||||
int nodes = 0;
|
||||
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
while (xmlReader.Read())
|
||||
{
|
||||
++nodes;
|
||||
}
|
||||
|
||||
DateTime end = DateTime.Now;
|
||||
|
||||
Console.WriteLine("time = {0}", end - start);
|
||||
|
||||
Console.WriteLine("nodes = {0}", nodes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.ReadState.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public enum ReadState
|
||||
{
|
||||
Closed,
|
||||
EndOfFile,
|
||||
Error,
|
||||
Initial,
|
||||
Interactive
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.WhitespaceHandling.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public enum WhitespaceHandling
|
||||
{
|
||||
All,
|
||||
None,
|
||||
Signifigant
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlChar.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
internal class XmlChar
|
||||
{
|
||||
internal static bool IsWhitespace(int ch)
|
||||
{
|
||||
return ch == 0x20 || ch == 0x9 || ch == 0xD || ch == 0xA;
|
||||
}
|
||||
|
||||
internal static bool IsFirstNameChar(int ch)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (ch >= 0 && ch <= 0xFFFF)
|
||||
{
|
||||
result = (nameBitmap[(firstNamePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static bool IsNameChar(int ch)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (ch >= 0 && ch <= 0xFFFF)
|
||||
{
|
||||
result = (nameBitmap[(namePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static byte[] firstNamePages =
|
||||
{
|
||||
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
|
||||
0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
|
||||
0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
private static byte[] namePages =
|
||||
{
|
||||
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
|
||||
0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
|
||||
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
|
||||
0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
private static uint[] nameBitmap =
|
||||
{
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
|
||||
0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
|
||||
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
|
||||
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
|
||||
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
|
||||
0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
|
||||
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
|
||||
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
|
||||
0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
|
||||
0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
|
||||
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
|
||||
0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
|
||||
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
|
||||
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
|
||||
0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
|
||||
0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
|
||||
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
|
||||
0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
|
||||
0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
|
||||
0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
|
||||
0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
|
||||
0x40000000, 0xF580C900, 0x00000007, 0x02010800,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
|
||||
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
|
||||
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
|
||||
0x00000000, 0x00004C40, 0x00000000, 0x00000000,
|
||||
0x00000007, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
|
||||
0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
|
||||
0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
|
||||
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
|
||||
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
|
||||
0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
|
||||
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
|
||||
0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
|
||||
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
|
||||
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
|
||||
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
|
||||
0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
|
||||
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
|
||||
0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
|
||||
0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
|
||||
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
|
||||
0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
|
||||
0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
|
||||
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
|
||||
0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
|
||||
0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
|
||||
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
|
||||
0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
|
||||
0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
|
||||
0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
|
||||
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
|
||||
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
|
||||
0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlNameTable.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public abstract class XmlNameTable
|
||||
{
|
||||
public abstract string Add(string name);
|
||||
public abstract string Add(char[] buffer, int offset, int length);
|
||||
public abstract string Get(string name);
|
||||
public abstract string Get(char[] buffer, int offset, int length);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlNamespaceManager.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public class XmlNamespaceManager : IEnumerable
|
||||
{
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlNodeType.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public enum XmlNodeType
|
||||
{
|
||||
Attribute,
|
||||
CDATA,
|
||||
Comment,
|
||||
Document,
|
||||
DocumentFragment,
|
||||
DocumentType,
|
||||
Element,
|
||||
EndElement,
|
||||
EndEntity,
|
||||
Entity,
|
||||
EntityReference,
|
||||
None,
|
||||
Notation,
|
||||
ProcessingInstruction,
|
||||
SignifigantWhitespace,
|
||||
Text,
|
||||
Whitespace,
|
||||
XmlDeclaration
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlParserContext.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public class XmlParserContext
|
||||
{
|
||||
// constructors
|
||||
|
||||
public XmlParserContext(
|
||||
XmlNameTable nameTable,
|
||||
XmlNamespaceManager namespaceManager,
|
||||
string xmlLang,
|
||||
XmlSpace xmlSpace) :
|
||||
|
||||
this(
|
||||
nameTable,
|
||||
namespaceManager,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
xmlLang,
|
||||
xmlSpace
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public XmlParserContext(
|
||||
XmlNameTable nameTable,
|
||||
XmlNamespaceManager namespaceManager,
|
||||
string docTypeName,
|
||||
string publicID,
|
||||
string systemID,
|
||||
string internalSubset,
|
||||
string baseURI,
|
||||
string xmlLang,
|
||||
XmlSpace xmlSpace)
|
||||
{
|
||||
this.nameTable = nameTable;
|
||||
this.namespaceManager = namespaceManager;
|
||||
this.docTypeName = docTypeName;
|
||||
this.publicID = publicID;
|
||||
this.systemID = systemID;
|
||||
this.internalSubset = internalSubset;
|
||||
this.baseURI = baseURI;
|
||||
this.xmlLang = xmlLang;
|
||||
this.xmlSpace = xmlSpace;
|
||||
}
|
||||
|
||||
// properties
|
||||
|
||||
public string BaseURI
|
||||
{
|
||||
get { return baseURI; }
|
||||
set { baseURI = value; }
|
||||
}
|
||||
|
||||
public string DocTypeName
|
||||
{
|
||||
get { return docTypeName; }
|
||||
set { docTypeName = value; }
|
||||
}
|
||||
|
||||
public string InternalSubset
|
||||
{
|
||||
get { return internalSubset; }
|
||||
set { internalSubset = value; }
|
||||
}
|
||||
|
||||
public XmlNamespaceManager NamespaceManager
|
||||
{
|
||||
get { return namespaceManager; }
|
||||
set { namespaceManager = value; }
|
||||
}
|
||||
|
||||
public XmlNameTable NameTable
|
||||
{
|
||||
get { return nameTable; }
|
||||
set { nameTable = nameTable; }
|
||||
}
|
||||
|
||||
public string PublicId
|
||||
{
|
||||
get { return publicID; }
|
||||
set { publicID = value; }
|
||||
}
|
||||
|
||||
public string SystemId
|
||||
{
|
||||
get { return systemID; }
|
||||
set { systemID = value; }
|
||||
}
|
||||
|
||||
public string XmlLang
|
||||
{
|
||||
get { return xmlLang; }
|
||||
set { xmlLang = value; }
|
||||
}
|
||||
|
||||
public XmlSpace XmlSpace
|
||||
{
|
||||
get { return xmlSpace; }
|
||||
set { xmlSpace = value; }
|
||||
}
|
||||
|
||||
// privates
|
||||
|
||||
private string baseURI;
|
||||
private string docTypeName;
|
||||
private string internalSubset;
|
||||
private XmlNamespaceManager namespaceManager;
|
||||
private XmlNameTable nameTable;
|
||||
private string publicID;
|
||||
private string systemID;
|
||||
private string xmlLang;
|
||||
private XmlSpace xmlSpace;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlReader.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public abstract class XmlReader
|
||||
{
|
||||
// properties
|
||||
|
||||
public abstract int AttributeCount { get; }
|
||||
|
||||
public abstract string BaseURI { get; }
|
||||
|
||||
public virtual bool CanResolveEntity
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract int Depth { get; }
|
||||
|
||||
public abstract bool EOF { get; }
|
||||
|
||||
public virtual bool HasAttributes
|
||||
{
|
||||
get
|
||||
{
|
||||
return AttributeCount > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract bool HasValue { get; }
|
||||
|
||||
public abstract bool IsDefault { get; }
|
||||
|
||||
public abstract bool IsEmptyElement { get; }
|
||||
|
||||
public abstract string this[int i] { get; }
|
||||
|
||||
public abstract string this[string name] { get; }
|
||||
|
||||
public abstract string this[
|
||||
string localName,
|
||||
string namespaceName]
|
||||
{ get; }
|
||||
|
||||
public abstract string LocalName { get; }
|
||||
|
||||
public abstract string Name { get; }
|
||||
|
||||
public abstract string NamespaceURI { get; }
|
||||
|
||||
public abstract XmlNameTable NameTable { get; }
|
||||
|
||||
public abstract XmlNodeType NodeType { get; }
|
||||
|
||||
public abstract string Prefix { get; }
|
||||
|
||||
public abstract char QuoteChar { get; }
|
||||
|
||||
public abstract ReadState ReadState { get; }
|
||||
|
||||
public abstract string Value { get; }
|
||||
|
||||
public abstract string XmlLang { get; }
|
||||
|
||||
public abstract XmlSpace XmlSpace { get; }
|
||||
|
||||
// methods
|
||||
|
||||
public abstract void Close();
|
||||
|
||||
public abstract string GetAttribute(int i);
|
||||
|
||||
public abstract string GetAttribute(string name);
|
||||
|
||||
public abstract string GetAttribute(
|
||||
string localName,
|
||||
string namespaceName);
|
||||
|
||||
public static bool IsName(string s)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (s != null && s.Length > 0)
|
||||
{
|
||||
char[] chars = s.ToCharArray();
|
||||
|
||||
if (XmlChar.IsFirstNameChar(chars[0]))
|
||||
{
|
||||
int i = 1;
|
||||
int n = chars.Length;
|
||||
|
||||
while (i < n && XmlChar.IsNameChar(chars[i]))
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
result = i == n;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool IsNameToken(string s)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (s != null && s.Length > 0)
|
||||
{
|
||||
char[] chars = s.ToCharArray();
|
||||
|
||||
int i = 0;
|
||||
int n = chars.Length;
|
||||
|
||||
while (i < n && XmlChar.IsNameChar(chars[i]))
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
result = i == n;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual bool IsStartElement()
|
||||
{
|
||||
// TODO: implement me.
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool IsStartElement(string name)
|
||||
{
|
||||
// TODO: implement me.
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool IsStartElement(
|
||||
string localName,
|
||||
string namespaceName)
|
||||
{
|
||||
// TODO: implement me.
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract string LookupNamespace(string prefix);
|
||||
|
||||
public abstract void MoveToAttribute(int i);
|
||||
|
||||
public abstract bool MoveToAttribute(string name);
|
||||
|
||||
public abstract bool MoveToAttribute(
|
||||
string localName,
|
||||
string namespaceName);
|
||||
|
||||
public virtual XmlNodeType MoveToContent()
|
||||
{
|
||||
// TODO: implement me.
|
||||
return XmlNodeType.None;
|
||||
}
|
||||
|
||||
public abstract bool MoveToElement();
|
||||
|
||||
public abstract bool MoveToFirstAttribute();
|
||||
|
||||
public abstract bool MoveToNextAttribute();
|
||||
|
||||
public abstract bool Read();
|
||||
|
||||
public abstract bool ReadAttributeValue();
|
||||
|
||||
public virtual string ReadElementString()
|
||||
{
|
||||
// TODO: implement me.
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual string ReadElementString(string name)
|
||||
{
|
||||
// TODO: implement me.
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual string ReadElementString(
|
||||
string localName,
|
||||
string namespaceName)
|
||||
{
|
||||
// TODO: implement me.
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void ReadEndElement()
|
||||
{
|
||||
// TODO: implement me.
|
||||
}
|
||||
|
||||
public abstract string ReadInnerXml();
|
||||
|
||||
public abstract string ReadOuterXml();
|
||||
|
||||
public virtual void ReadStartElement()
|
||||
{
|
||||
// TODO: implement me.
|
||||
}
|
||||
|
||||
public virtual void ReadStartElement(string name)
|
||||
{
|
||||
// TODO: implement me.
|
||||
}
|
||||
|
||||
public virtual void ReadStartElement(
|
||||
string localName,
|
||||
string namespaceName)
|
||||
{
|
||||
// TODO: implement me.
|
||||
}
|
||||
|
||||
public abstract string ReadString();
|
||||
|
||||
public abstract void ResolveEntity();
|
||||
|
||||
public virtual void Skip()
|
||||
{
|
||||
// TODO: implement me.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlResolver.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public abstract class XmlResolver
|
||||
{
|
||||
public abstract ICredentials Credentials { set; }
|
||||
|
||||
public abstract object GetEntity(
|
||||
Uri absoluteUri,
|
||||
string role,
|
||||
Type type);
|
||||
|
||||
public abstract Uri ResolveUri(
|
||||
Uri baseUri,
|
||||
string relativeUri);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
//
|
||||
// System.Xml.XmlSpace.cs
|
||||
//
|
||||
// Author:
|
||||
// Jason Diamond ([email protected])
|
||||
//
|
||||
// (C) 2001 Jason Diamond http://injektilo.org/
|
||||
//
|
||||
|
||||
namespace System.Xml
|
||||
{
|
||||
public enum XmlSpace
|
||||
{
|
||||
Default,
|
||||
None,
|
||||
Preserve
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,12 @@
|
||||
IXmlLineInfo.cs
|
||||
ReadState.cs
|
||||
WhitespaceHandling.cs
|
||||
XmlChar.cs
|
||||
XmlNamespaceManager.cs
|
||||
XmlNameTable.cs
|
||||
XmlNodeType.cs
|
||||
XmlParserContext.cs
|
||||
XmlReader.cs
|
||||
XmlResolver.cs
|
||||
XmlSpace.cs
|
||||
XmlTextReader.cs
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
||||
DIRS=System.Xml
|
||||
|
||||
all:
|
||||
@echo "You must use 'make windows' or 'make unix'."
|
||||
@echo "'make unix' is broken for now."
|
||||
|
||||
windows: make-list
|
||||
$(CSC) /target:library /out:System.XML.dll /nowarn:1595 @list
|
||||
|
||||
unix:
|
||||
@echo "'make unix' is broken for now."
|
||||
|
||||
make-list:
|
||||
for i in $(DIRS); do \
|
||||
cat $$i/common.src $$i/windows.src | sed "s/^/$$i\\\\/"; \
|
||||
done > list
|
||||
@@ -0,0 +1,2 @@
|
||||
System.dll
|
||||
list
|
||||
@@ -1,51 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Revision
|
||||
// Build Number
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified - the assembly cannot be signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine.
|
||||
// (*) If the key file and a key name attributes are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP - that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the file is installed into the CSP and used.
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
2001-07-15 Sean MacIsaac <[email protected]>
|
||||
|
||||
* CodeGenerator.cs: moved using statement out of namespace
|
||||
declaration.
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
using System.CodeDom;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
namespace System.CodeDom.Compiler {
|
||||
|
||||
using System.CodeDom;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
public abstract class CodeGenerator : ICodeGenerator {
|
||||
protected TextWriter output;
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
ICodeGenerator.cs
|
||||
CodeGenerator.cs
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -1,51 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Revision
|
||||
// Build Number
|
||||
//
|
||||
// You can specify all the value or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified - the assembly cannot be signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine.
|
||||
// (*) If the key file and a key name attributes are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP - that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the file is installed into the CSP and used.
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
@@ -1,5 +1,19 @@
|
||||
2001-07-12 Sean MacIsaac <[email protected]>
|
||||
2001-07-15 Sean MacIsaac <[email protected]>
|
||||
|
||||
* MemberAttributes.cs: Added so rest of classes would compile.
|
||||
|
||||
* FieldDirection.cs: Added so rest of classes would compile.
|
||||
|
||||
* CodeTypeMember.cs: Added so rest of classes would compile.
|
||||
|
||||
* CodeTypeDeclaration.cs: Added so rest of classes would compile.
|
||||
|
||||
* CodeObject.cs: Added so rest of classes would compile.
|
||||
|
||||
* CodeBinaryOperatorType.cs: Added so rest of classes would compile.
|
||||
|
||||
2001-07-12 Sean MacIsaac <[email protected]>
|
||||
|
||||
* All files implementing IList: Added IsFixedSize property.
|
||||
|
||||
* All files: Changed CodeDOM to CodeDom.
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// System.CodeDom CodeBinaryOperatorType Enum implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
namespace System.CodeDom {
|
||||
public enum CodeBinaryOperatorType {
|
||||
Add,
|
||||
Assign,
|
||||
BitwiseAnd,
|
||||
BitwiseOr,
|
||||
BooleanAnd,
|
||||
BooleanOr,
|
||||
Divide,
|
||||
GreaterThan,
|
||||
GreaterThanOrEqual,
|
||||
IdentityEquality,
|
||||
IdentityInequality,
|
||||
LessThan,
|
||||
LessThanOrEqual,
|
||||
Modulus,
|
||||
Multiply,
|
||||
Subtract,
|
||||
ValueEquality
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,12 @@
|
||||
//
|
||||
// System.CodeDom CodeReturnStatement Class implementation
|
||||
// System.CodeDom CodeMethodReturnStatement class implementation
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
// Sean MacIsaac (macisaac@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
namespace System.CodeDom {
|
||||
public class CodeMethodReturnStatement : CodeStatement {
|
||||
|
||||
public class CodeReturnStatement : CodeStatement {
|
||||
CodeExpression expression;
|
||||
|
||||
public CodeReturnStatement ()
|
||||
{
|
||||
}
|
||||
|
||||
public CodeReturnStatement (CodeExpression expression)
|
||||
{
|
||||
this.expression = expression;
|
||||
}
|
||||
|
||||
//
|
||||
// Properties
|
||||
//
|
||||
CodeExpression Expression {
|
||||
get {
|
||||
return expression;
|
||||
}
|
||||
|
||||
set {
|
||||
expression = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// System.CodeDom CodeObject class implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
public class CodeObject {
|
||||
|
||||
}
|
||||
@@ -1,47 +1,12 @@
|
||||
//
|
||||
// System.CodeDom CodeStatement Class implementation
|
||||
// System.CodeDom CodeStatement class implementation
|
||||
//
|
||||
// Author:
|
||||
// Miguel de Icaza (miguel@ximian.com)
|
||||
// Sean MacIsaac (macisaac@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
namespace System.CodeDom {
|
||||
public class CodeStatement : CodeObject {
|
||||
|
||||
public class CodeStatement {
|
||||
|
||||
CodeLinePragma codeLinePragma;
|
||||
object userData;
|
||||
|
||||
//
|
||||
// Constructors
|
||||
//
|
||||
public CodeStatement ()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Properties
|
||||
//
|
||||
public CodeLinePragma LinePragma {
|
||||
get {
|
||||
return codeLinePragma;
|
||||
}
|
||||
|
||||
set {
|
||||
codeLinePragma = value;
|
||||
}
|
||||
}
|
||||
|
||||
public object UserData {
|
||||
get {
|
||||
return userData;
|
||||
}
|
||||
|
||||
set {
|
||||
userData = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// System.CodeDom CodeTypeDeclaration Class implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
public class CodeTypeDeclaration : CodeTypeMember {
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// System.CodeDom CodeTypeMember Class implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
public class CodeTypeMember : CodeObject {
|
||||
private string name;
|
||||
|
||||
public string Name {
|
||||
get {
|
||||
return name;
|
||||
}
|
||||
set {
|
||||
name = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// System.CodeDom FieldDirection Enum implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
namespace System.CodeDom {
|
||||
public enum FieldDirection {
|
||||
In, Out, Ref
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// System.CodeDom MemberAttributes Enum implementation
|
||||
//
|
||||
// Author:
|
||||
// Sean MacIsaac ([email protected])
|
||||
//
|
||||
// (C) 2001 Ximian, Inc.
|
||||
//
|
||||
|
||||
namespace System.CodeDom {
|
||||
public enum MemberAttributes {
|
||||
Abstract,
|
||||
AccessMask,
|
||||
Assembly,
|
||||
Const,
|
||||
Family,
|
||||
FamilyAndAssembly,
|
||||
FamilyOrAssembly,
|
||||
Final,
|
||||
New,
|
||||
Overloaded,
|
||||
Override,
|
||||
Private,
|
||||
Public,
|
||||
ScopeMask,
|
||||
Static,
|
||||
VTableMask
|
||||
}
|
||||
}
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
CodeArrayCreateExpression.cs
|
||||
CodeAssignStatement.cs
|
||||
CodeAttachEventStatement.cs
|
||||
CodeAttributeArgument.cs
|
||||
CodeAttributeArgumentCollection.cs
|
||||
CodeAttributeBlock.cs
|
||||
CodeAttributeDeclaration.cs
|
||||
CodeAttributeDeclarationCollection.cs
|
||||
CodeBaseReferenceExpression.cs
|
||||
CodeBinaryOperatorExpression.cs
|
||||
CodeBinaryOperatorType.cs
|
||||
CodeCastExpression.cs
|
||||
CodeCatchClause.cs
|
||||
CodeCatchClauseCollection.cs
|
||||
CodeClass.cs
|
||||
CodeClassCollection.cs
|
||||
CodeClassConstructor.cs
|
||||
CodeClassDelegate.cs
|
||||
CodeClassMember.cs
|
||||
CodeClassMemberCollection.cs
|
||||
CodeCommentStatement.cs
|
||||
CodeConstructor.cs
|
||||
CodeDelegateCreateExpression.cs
|
||||
CodeDelegateInvokeExpression.cs
|
||||
CodeDelegateInvokeStatement.cs
|
||||
CodeDetachEventStatement.cs
|
||||
CodeExpression.cs
|
||||
CodeExpressionCollection.cs
|
||||
CodeFieldReferenceExpression.cs
|
||||
CodeForLoopStatement.cs
|
||||
CodeIfStatement.cs
|
||||
CodeIndexerExpression.cs
|
||||
CodeLinePragma.cs
|
||||
CodeLiteralClassMember.cs
|
||||
CodeLiteralExpression.cs
|
||||
CodeLiteralNamespace.cs
|
||||
CodeLiteralStatement.cs
|
||||
CodeMemberEvent.cs
|
||||
CodeMemberField.cs
|
||||
CodeMemberMethod.cs
|
||||
CodeMemberProperty.cs
|
||||
CodeMethodInvokeExpression.cs
|
||||
CodeMethodInvokeStatement.cs
|
||||
CodeMethodReturnStatement.cs
|
||||
CodeNamespace.cs
|
||||
CodeNamespaceImport.cs
|
||||
CodeNamespaceImportCollection.cs
|
||||
CodeObject.cs
|
||||
CodeObjectCreateExpression.cs
|
||||
CodeParameterDeclarationExpression.cs
|
||||
CodeParameterDeclarationExpressionCollection.cs
|
||||
CodePrimitiveExpression.cs
|
||||
CodePropertyReferenceExpression.cs
|
||||
CodeStatement.cs
|
||||
CodeStatementCollection.cs
|
||||
CodeThisReferenceExpression.cs
|
||||
CodeThrowExceptionStatement.cs
|
||||
CodeTryCatchFinallyStatement.cs
|
||||
CodeTypeDeclaration.cs
|
||||
CodeTypeMember.cs
|
||||
CodeTypeOfExpression.cs
|
||||
CodeTypeReferenceExpression.cs
|
||||
CodeVariableDeclarationStatement.cs
|
||||
FieldDirection.cs
|
||||
MemberAttributes.cs
|
||||
@@ -1,2 +0,0 @@
|
||||
CodeClassCollection.cs: Code-X-Collection.cs
|
||||
sed -e 's/@CONTAINEE@/Class/g' -e 's/@arrayname@/classes/g' < Code-X-Collection.cs > CodeClassCollection.cs
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
dx ()
|
||||
{
|
||||
sed -e "s/@CONTAINEE@/$1/g" -e "s/@arrayname@/$2/g" < Code-X-Collection.cs > Code$1Collection.cs
|
||||
}
|
||||
|
||||
dx AttributeArgument attributeArgs
|
||||
dx AttributeDeclaration attributeDecls
|
||||
dx CatchClause catchClauses
|
||||
dx Class classes
|
||||
dx ClassMember classMembers
|
||||
dx Expression expressions
|
||||
dx NamespaceImport namespaceImports
|
||||
dx ParameterDeclarationExpression parameterDeclExprs
|
||||
dx Statement statements
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,13 @@
|
||||
2001-07-17 John Barnette <[email protected]>
|
||||
* StringCollection.cs:
|
||||
Implemented and working according to spec.
|
||||
* StringIterator.cs:
|
||||
(ADDED) Implemented and working according to spec.
|
||||
* StringCollectionTest.cs:
|
||||
(ADDED) Initial revision contains 17 tests; all of 'em
|
||||
run correctly. More complicated tests to follow.
|
||||
|
||||
2001-07-15 Sean MacIsaac <[email protected]>
|
||||
|
||||
* StringCollection.cs: Added so that CodeDom.* would compile.
|
||||
|
||||
@@ -0,0 +1,362 @@
|
||||
/**
|
||||
* System.Collections.Specialized.NamaValueCollection class implementation
|
||||
*
|
||||
* Author: Gleb Novodran
|
||||
*/
|
||||
// created on 7/21/2001 at 5:15 PM
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Collections.Specialized{
|
||||
public class NameValueCollection : NameObjectCollectionBase
|
||||
{
|
||||
string[] cachedAllKeys = null;
|
||||
string[] cachedAll = null;
|
||||
|
||||
//--------------------- Constructors -----------------------------
|
||||
|
||||
/// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
|
||||
/// has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
|
||||
/// </summary>
|
||||
public NameValueCollection() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
|
||||
/// has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
|
||||
///</summary>
|
||||
public NameValueCollection( int capacity ) : base(capacity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary> SDK: Copies the entries from the specified NameValueCollection to a new
|
||||
/// NameValueCollection with the same initial capacity as the number of entries copied
|
||||
/// and using the same case-insensitive hash code provider and the same case-insensitive
|
||||
/// comparer as the source collection.
|
||||
/// </summary>
|
||||
/// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
|
||||
/// NameObjectCollectionBase to the same assembly
|
||||
|
||||
/* public NameValueCollection( NameValueCollection col ) : base(col.HashCodeProvider,col.Comparer)
|
||||
{
|
||||
if (col==null)
|
||||
throw new ArgumentNullException("Null argument is not allowed");
|
||||
Add(col);
|
||||
}
|
||||
*/
|
||||
///<summary>SDK: Initializes a new instance of the NameValueCollection class that is empty,
|
||||
///has the default initial capacity and uses the specified hash code provider and
|
||||
///the specified comparer.</summary>
|
||||
public NameValueCollection( IHashCodeProvider hashProvider, IComparer comparer )
|
||||
: base(hashProvider, comparer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SDK: Copies the entries from the specified NameValueCollection to a new NameValueCollection
|
||||
/// with the specified initial capacity or the same initial capacity as the number of entries
|
||||
/// copied, whichever is greater, and using the default case-insensitive hash code provider and
|
||||
/// the default case-insensitive comparer.
|
||||
/// </summary>
|
||||
/// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
|
||||
/// NameObjectCollectionBase to the same assembly
|
||||
|
||||
/* public NameValueCollection( int capacity, NameValueCollection col )
|
||||
: base(capacity, col.get_HashCodeProvider(),col.Comparer)
|
||||
{
|
||||
if (col==null)
|
||||
throw new ArgumentNullException("Null argument is not allowed");
|
||||
Add(col);
|
||||
}
|
||||
*/
|
||||
/// <summary>
|
||||
/// SDK: Initializes a new instance of the NameValueCollection class that is serializable
|
||||
/// and uses the specified System.Runtime.Serialization.SerializationInfo and
|
||||
/// System.Runtime.Serialization.StreamingContext.
|
||||
/// </summary>
|
||||
protected NameValueCollection( SerializationInfo info, StreamingContext context )
|
||||
:base(info, context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SDK: Initializes a new instance of the NameValueCollection class that is empty,
|
||||
/// has the specified initial capacity and uses the specified hash code provider and
|
||||
/// the specified comparer.
|
||||
/// </summary>
|
||||
public NameValueCollection( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
|
||||
:base(capacity, hashProvider, comparer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------- Public Instance Properties -------------------------------
|
||||
|
||||
|
||||
///<summary> SDK:
|
||||
/// Gets all the keys in the NameValueCollection.
|
||||
/// The arrays returned by AllKeys are cached for better performance and are
|
||||
/// automatically refreshed when the collection changes. A derived class can
|
||||
/// invalidate the cached version by calling InvalidateCachedArrays, thereby
|
||||
/// forcing the arrays to be recreated.
|
||||
/// </summary>
|
||||
public virtual string[] AllKeys
|
||||
{
|
||||
get {
|
||||
if (cachedAllKeys==null)
|
||||
cachedAllKeys = BaseGetAllKeys();
|
||||
return this.cachedAllKeys;
|
||||
}
|
||||
}
|
||||
|
||||
public string this[ int index ]
|
||||
{
|
||||
get{
|
||||
return this.Get(index);
|
||||
}
|
||||
}
|
||||
|
||||
public string this[ string name ] {
|
||||
get{
|
||||
return this.Get(name);
|
||||
}
|
||||
set{
|
||||
this.Set(name,value);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////// Public Instance Methods //////////////////////////////
|
||||
|
||||
/// <summary> SDK: Copies the entries in the specified NameValueCollection
|
||||
/// to the current NameValueCollection.</summary>
|
||||
/// LAMESPEC: see description that comes this Add(string, string)
|
||||
|
||||
public void Add( NameValueCollection c ){
|
||||
|
||||
if (this.IsReadOnly)
|
||||
throw new NotSupportedException("Collection is read-only");
|
||||
if (c==null)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
InvalidateCachedArrays();
|
||||
ArrayList values = null;
|
||||
|
||||
int max = c.Count;
|
||||
for(int i=0; i<max; i++){
|
||||
values=(ArrayList)BaseGet(c.GetKey(i));
|
||||
if (values==null)
|
||||
values = new ArrayList();
|
||||
values.AddRange((ArrayList)c.BaseGet(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary> SDK: Adds an entry with the specified name and value to the
|
||||
/// NameValueCollection. </summary>
|
||||
///
|
||||
/// LAMESPEC:
|
||||
/// in SDK doc: If the same value already exists under the same key in the collection,
|
||||
/// the new value overwrites the old value.
|
||||
/// however the Microsoft implemenatation in this case just adds one more value
|
||||
/// in other words after
|
||||
/// <code>
|
||||
/// NameValueCollection nvc;
|
||||
/// nvc.Add("LAZY","BASTARD")
|
||||
/// nvc.Add("LAZY","BASTARD")
|
||||
/// </code>
|
||||
/// nvc.Get("LAZY") will be "BASTARD,BASTARD" instead of "BASTARD"
|
||||
|
||||
public virtual void Add( string name, string val )
|
||||
{
|
||||
|
||||
if (this.IsReadOnly)
|
||||
throw new NotSupportedException("Collection is read-only");
|
||||
|
||||
InvalidateCachedArrays();
|
||||
ArrayList values = (ArrayList)BaseGet(name);
|
||||
if (values==null){
|
||||
values = new ArrayList();
|
||||
if (val!=null)
|
||||
values.Add(val);
|
||||
BaseAdd(name,values);
|
||||
}
|
||||
else {
|
||||
if (val!=null)
|
||||
values.Add(val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary> SDK: Invalidates the cached arrays and removes all entries from
|
||||
/// the NameValueCollection.</summary>
|
||||
|
||||
public void Clear(){
|
||||
if (this.IsReadOnly)
|
||||
throw new NotSupportedException("Collection is read-only");
|
||||
InvalidateCachedArrays();
|
||||
BaseClear();
|
||||
}
|
||||
|
||||
/// <summary> SDK: Copies the entire NameValueCollection to a compatible one-dimensional Array,
|
||||
/// starting at the specified index of the target array.</summary>
|
||||
|
||||
public void CopyTo( Array dest, int index )
|
||||
{
|
||||
if (dest==null)
|
||||
throw new ArgumentNullException("Null argument - dest");
|
||||
if (index<0)
|
||||
throw new ArgumentOutOfRangeException("index is less than 0");
|
||||
// throw new Exception("Not implemented yet");
|
||||
|
||||
//TODO: add implementation here
|
||||
if (cachedAll==null)
|
||||
RefreshCachedAll();
|
||||
cachedAll.CopyTo(dest, index);
|
||||
}
|
||||
protected void RefreshCachedAll()
|
||||
{
|
||||
this.cachedAll=null;
|
||||
int max = this.Count;
|
||||
cachedAll = new string[max];
|
||||
for(int i=0;i<max;i++){
|
||||
cachedAll[i] = this.Get(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary> SDK: Gets the values at the specified index of the NameValueCollection combined
|
||||
/// into one comma-separated list.</summary>
|
||||
|
||||
public virtual string Get( int index )
|
||||
{
|
||||
ArrayList values = (ArrayList)BaseGet(index);
|
||||
// if index is out of range BaseGet throws an ArgumentOutOfRangeException
|
||||
|
||||
return AsSingleString(values);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SDK: Gets the values associated with the specified key from the NameValueCollection
|
||||
* combined into one comma-separated list.
|
||||
*/
|
||||
public virtual string Get( string name )
|
||||
{
|
||||
ArrayList values = (ArrayList)BaseGet(name);
|
||||
/* if (values==null)
|
||||
Console.WriteLine("BaseGet returned null");*/
|
||||
return AsSingleString(values);
|
||||
// -------------------------------------------------------------
|
||||
|
||||
}
|
||||
/// <summary></summary>
|
||||
private static string AsSingleString(ArrayList values)
|
||||
{
|
||||
const char separator = ',';
|
||||
|
||||
if (values==null)
|
||||
return null;
|
||||
int max = values.Count;
|
||||
|
||||
if (max==0)
|
||||
return null;
|
||||
//TODO: reimplement this
|
||||
StringBuilder sb = new StringBuilder((string)values[0]);
|
||||
for (int i=1; i<max; i++){
|
||||
sb.Append(separator);
|
||||
sb.Append(values[i]);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>SDK: Gets the key at the specified index of the NameValueCollection.</summary>
|
||||
public virtual string GetKey( int index )
|
||||
{
|
||||
return BaseGetKey(index);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>SDK: Gets the values at the specified index of the NameValueCollection.</summary>
|
||||
|
||||
public virtual string[] GetValues( int index )
|
||||
{
|
||||
ArrayList values = (ArrayList)BaseGet(index);
|
||||
|
||||
return AsStringArray(values);
|
||||
}
|
||||
|
||||
|
||||
public virtual string[] GetValues( string name )
|
||||
{
|
||||
ArrayList values = (ArrayList)BaseGet(name);
|
||||
|
||||
return AsStringArray(values);
|
||||
}
|
||||
|
||||
private static string[] AsStringArray(ArrayList values){
|
||||
|
||||
int max = values.Count;//get_Count();
|
||||
if (max==0)
|
||||
return null;
|
||||
|
||||
string[] valArray =new string[max];
|
||||
values.CopyTo(valArray);
|
||||
return valArray;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SDK: Gets a value indicating whether the NameValueCollection contains keys that
|
||||
/// are not a null reference
|
||||
/// </summary>
|
||||
|
||||
public bool HasKeys()
|
||||
{
|
||||
return BaseHasKeys();
|
||||
}
|
||||
|
||||
public virtual void Remove( string name )
|
||||
{
|
||||
if (this.IsReadOnly)
|
||||
throw new NotSupportedException("Collection is read-only");
|
||||
InvalidateCachedArrays();
|
||||
BaseRemove(name);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of an entry in the NameValueCollection.
|
||||
/// </summary>
|
||||
public virtual void Set( string name, string value )
|
||||
{
|
||||
if (this.IsReadOnly)
|
||||
throw new NotSupportedException("Collection is read-only");
|
||||
InvalidateCachedArrays();
|
||||
|
||||
ArrayList values = new ArrayList();
|
||||
values.Add(value);
|
||||
BaseSet(name,values);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//---------------------- Protected Instance Methods ----------------------
|
||||
|
||||
protected void InvalidateCachedArrays()
|
||||
{
|
||||
cachedAllKeys = null;
|
||||
cachedAll = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
/* System.Collections.Specialized.StringCollection.cs
|
||||
* Authors:
|
||||
* John Barnette ([email protected])
|
||||
* Sean MacIsaac ([email protected])
|
||||
*
|
||||
* Copyright (C) 2001 John Barnette
|
||||
* (C) Ximian, Inc. http://www.ximian.com
|
||||
*
|
||||
* NOTES:
|
||||
* I bet Microsoft uses ArrayList as a backing store for this; I wonder what
|
||||
* the performance difference will be.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Collections.Specialized {
|
||||
public class StringCollection : IList, ICollection, IEnumerable {
|
||||
private static int InitialCapacity = 11;
|
||||
private static float CapacityMultiplier = 2.0f;
|
||||
|
||||
private int count;
|
||||
private int modCount;
|
||||
|
||||
private string[] entries;
|
||||
|
||||
// Public Constructor
|
||||
public StringCollection() {
|
||||
entries = new string[InitialCapacity];
|
||||
count = 0;
|
||||
modCount = 0;
|
||||
}
|
||||
|
||||
// Public Instance Properties
|
||||
public int Count {
|
||||
get { return count; }
|
||||
}
|
||||
|
||||
public bool IsFixedSize {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool IsSynchronized {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
object IList.this[int index] {
|
||||
get { return this[index]; }
|
||||
set { this[index] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string this[int index] {
|
||||
get {
|
||||
if (index < 0 || index >= count) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
|
||||
return entries[index];
|
||||
}
|
||||
|
||||
set {
|
||||
if (index < 0 || index >= count) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
|
||||
modCount++;
|
||||
entries[index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public object SyncRoot {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
|
||||
// Public Instance Methods
|
||||
|
||||
int IList.Add(object value) {
|
||||
return Add(value.ToString());
|
||||
}
|
||||
|
||||
public int Add(string value) {
|
||||
modCount++;
|
||||
Resize(count + 1);
|
||||
int index = count++;
|
||||
entries[index] = value;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
public void AddRange(string[] value) {
|
||||
int numEntries = value.Length;
|
||||
|
||||
modCount++;
|
||||
Resize(count + numEntries);
|
||||
Array.Copy(value, 0, entries, count, numEntries);
|
||||
count += numEntries;
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
modCount++;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
bool IList.Contains(object value) {
|
||||
return Contains(value.ToString());
|
||||
}
|
||||
|
||||
public bool Contains(string value) {
|
||||
foreach (string entry in entries) {
|
||||
if (value.Equals(entry)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ICollection.CopyTo(Array array, int index) {
|
||||
if (array == null) {
|
||||
throw new ArgumentNullException("array");
|
||||
} else if (index < 0) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
} else if (array.Rank > 1) {
|
||||
throw new ArgumentException("array");
|
||||
} else if (index >= array.Length) {
|
||||
throw new ArgumentException("index");
|
||||
} else if (array.Length - index < count) {
|
||||
throw new ArgumentException("array");
|
||||
}
|
||||
|
||||
Array.Copy(entries, 0, array, index, count);
|
||||
}
|
||||
|
||||
public void CopyTo(string[] array, int index) {
|
||||
if (array == null) {
|
||||
throw new ArgumentNullException("array");
|
||||
} else if (index < 0) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
} else if (array.Rank > 1) {
|
||||
throw new ArgumentException("array");
|
||||
} else if (index >= array.Length) {
|
||||
throw new ArgumentException("index");
|
||||
} else if (array.Length - index < count) {
|
||||
throw new ArgumentException("array");
|
||||
}
|
||||
|
||||
Array.Copy(entries, 0, array, index, count);
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() {
|
||||
return new InternalEnumerator(this);
|
||||
}
|
||||
|
||||
public StringEnumerator GetEnumerator() {
|
||||
return new StringEnumerator(this);
|
||||
}
|
||||
|
||||
int IList.IndexOf(object value) {
|
||||
return IndexOf(value.ToString());
|
||||
}
|
||||
|
||||
public int IndexOf(string value) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (value.Equals(entries[i])) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void IList.Insert(int index, object value) {
|
||||
Insert(index, value.ToString());
|
||||
}
|
||||
|
||||
public void Insert(int index, string value) {
|
||||
if (index < 0 || index > count) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
|
||||
modCount++;
|
||||
Resize(count + 1);
|
||||
Array.Copy(entries, index, entries, index + 1, count - index);
|
||||
entries[index] = value;
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
void IList.Remove(object value) {
|
||||
Remove(value.ToString());
|
||||
}
|
||||
|
||||
public void Remove(string value) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (value.Equals(entries[i])) {
|
||||
RemoveAt(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAt(int index) {
|
||||
if (index < 0 || index >= count) {
|
||||
throw new ArgumentOutOfRangeException("index");
|
||||
}
|
||||
|
||||
int remaining = count - index - 1;
|
||||
|
||||
modCount++;
|
||||
|
||||
if (remaining > 0) {
|
||||
Array.Copy(entries, index + 1, entries, index, remaining);
|
||||
}
|
||||
|
||||
count--;
|
||||
entries[count] = null;
|
||||
}
|
||||
|
||||
|
||||
// Private Instance Methods
|
||||
|
||||
private void Resize(int minSize) {
|
||||
int oldSize = entries.Length;
|
||||
|
||||
if (minSize > oldSize) {
|
||||
string[] oldEntries = entries;
|
||||
int newSize = (int) (oldEntries.Length * CapacityMultiplier);
|
||||
|
||||
if (newSize < minSize) newSize = minSize;
|
||||
entries = new string[newSize];
|
||||
Array.Copy(oldEntries, 0, entries, 0, count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Private classes
|
||||
|
||||
private class InternalEnumerator : IEnumerator {
|
||||
private StringCollection data;
|
||||
private int index;
|
||||
private int myModCount;
|
||||
|
||||
public InternalEnumerator(StringCollection data) {
|
||||
this.data = data;
|
||||
myModCount = data.modCount;
|
||||
index = -1;
|
||||
}
|
||||
|
||||
|
||||
// Public Instance Properties
|
||||
|
||||
public object Current {
|
||||
get {
|
||||
if (myModCount != data.modCount) {
|
||||
throw new InvalidOperationException();
|
||||
} else if (index < 0 || index > data.count - 1) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
return data[index];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Public Instance Methods
|
||||
|
||||
public bool MoveNext() {
|
||||
if (myModCount != data.modCount) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
if (++index >= data.count - 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
if (myModCount != data.modCount) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/* System.Collections.Specialized.StringEnumerator.cs
|
||||
* Authors:
|
||||
* John Barnette ([email protected])
|
||||
*
|
||||
* Copyright (C) 2001 John Barnette
|
||||
*/
|
||||
|
||||
namespace System.Collections.Specialized {
|
||||
public class StringEnumerator {
|
||||
private StringCollection coll;
|
||||
private IEnumerator enumerable;
|
||||
|
||||
// assembly-scoped constructor
|
||||
internal StringEnumerator(StringCollection coll) {
|
||||
this.coll = coll;
|
||||
this.enumerable = ((IEnumerable)coll).GetEnumerator();
|
||||
}
|
||||
|
||||
// Public Instance Properties
|
||||
|
||||
public string Current {
|
||||
get { return (string) enumerable.Current; }
|
||||
}
|
||||
|
||||
|
||||
// Public Instance Methods
|
||||
|
||||
public bool MoveNext() {
|
||||
return enumerable.MoveNext();
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
enumerable.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
BitVector32.cs
|
||||
StringCollection.cs
|
||||
StringEnumerator.cs
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// System.Net.Sockets.AddressFamily.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public enum AddressFamily
|
||||
{
|
||||
AppleTalk,
|
||||
Atm,
|
||||
Banyan,
|
||||
Ccitt,
|
||||
Chaos,
|
||||
Cluster,
|
||||
DataKit,
|
||||
DataLink,
|
||||
DecNet,
|
||||
Ecma,
|
||||
FireFox,
|
||||
HyperChannel,
|
||||
Ieee12844,
|
||||
ImpLink,
|
||||
InterNetwork,
|
||||
InterNetworkV6,
|
||||
Ipx,
|
||||
Irda,
|
||||
Iso,
|
||||
Lat,
|
||||
Max,
|
||||
NetBios,
|
||||
NetworkDesigners,
|
||||
NS,
|
||||
Osi,
|
||||
Pup,
|
||||
Sna,
|
||||
Unix,
|
||||
Unknown,
|
||||
Unspecified,
|
||||
VoiceView
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// System.Net.Sockets.LingerOption.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
// <remarks>
|
||||
// Encapsulates a linger option.
|
||||
// </remarks>
|
||||
public class LingerOption
|
||||
{
|
||||
protected bool enabled;
|
||||
protected int seconds;
|
||||
|
||||
public LingerOption (bool enable, int secs)
|
||||
{
|
||||
enabled = enable;
|
||||
seconds = secs;
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get { return enabled; }
|
||||
set { enabled = value; }
|
||||
}
|
||||
|
||||
public int LingerTime
|
||||
{
|
||||
get { return seconds; }
|
||||
set { seconds = value; }
|
||||
}
|
||||
|
||||
public override bool Equals (object o)
|
||||
{
|
||||
return (enabled == o.enabled) && (seconds == o.seconds);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return seconds;
|
||||
}
|
||||
|
||||
public string ToString()
|
||||
{
|
||||
string ret;
|
||||
if (enabled) {
|
||||
ret = "off";
|
||||
}
|
||||
else {
|
||||
ret = seconds.ToString();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// System.Net.Sockets.MulticastOption.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
// <remarks>
|
||||
// Encapsulates a multicast option
|
||||
// </remarks>
|
||||
public class MulticastOption
|
||||
{
|
||||
protected IPAddress group;
|
||||
protected IPAddress local;
|
||||
|
||||
public MulticastOption (IPAddress grp)
|
||||
{
|
||||
group = grp;
|
||||
}
|
||||
|
||||
public MulticastOption (IPAddress grp, IPAddress addr)
|
||||
{
|
||||
group = grp;
|
||||
local = addr;
|
||||
}
|
||||
|
||||
public IPAddress Group
|
||||
{
|
||||
get { return group; }
|
||||
set { group = value; }
|
||||
}
|
||||
|
||||
public IPAddress LocalAddress
|
||||
{
|
||||
get { return local; }
|
||||
set { local = value; }
|
||||
}
|
||||
|
||||
public override bool Equals (object o)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return group.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return group.ToString() + " " + local.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// System.Net.Sockets.NetworkStream.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public class NetworkStream : Stream
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// System.Net.Sockets.ProtocolFamily.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public enum ProtocolFamily
|
||||
{
|
||||
AppleTalk,
|
||||
Atm,
|
||||
Banyan,
|
||||
Ccitt,
|
||||
Chaos,
|
||||
Cluster,
|
||||
DataKit,
|
||||
DataLink,
|
||||
DecNet,
|
||||
Ecma,
|
||||
FireFox,
|
||||
HyperChannel,
|
||||
Ieee12844,
|
||||
ImpLink,
|
||||
InterNetwork,
|
||||
InterNetworkV6,
|
||||
Ipx,
|
||||
Irda,
|
||||
Iso,
|
||||
Lat,
|
||||
Max,
|
||||
NetBios,
|
||||
NetworkDesigners,
|
||||
NS,
|
||||
Osi,
|
||||
Pup,
|
||||
Sna,
|
||||
Unix,
|
||||
Unknown,
|
||||
Unspecified,
|
||||
VoiceView
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// System.Net.Sockets.ProtocolType.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public enum ProtocolType
|
||||
{
|
||||
Ggp,
|
||||
Icmp,
|
||||
Idp,
|
||||
Igmp,
|
||||
Ip,
|
||||
Ipx,
|
||||
ND,
|
||||
Pup,
|
||||
Raw,
|
||||
Spx,
|
||||
SpxII,
|
||||
Tcp,
|
||||
Udp,
|
||||
Unknown,
|
||||
Unspecified
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// System.Net.Sockets.SelectMode.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public enum SelectMode
|
||||
{
|
||||
SelectError,
|
||||
SelectRead,
|
||||
SelectWrite
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// System.Net.Sockets.Socket.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public class Socket : IDisposable
|
||||
{
|
||||
public Socket (AddressFamily af, SocketType type, ProtocolType prot)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// System.Net.Sockets.NetworkStream.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
// <remarks>
|
||||
// A socket exception. Does this REALLY need to
|
||||
// be derived from Win32Exception? It seems a
|
||||
// little lame.
|
||||
//
|
||||
// This needs some work...
|
||||
// </remarks>
|
||||
public class SocketException : Exception
|
||||
{
|
||||
protected int error_code;
|
||||
protected int native_code;
|
||||
protected string help_link;
|
||||
protected string message;
|
||||
|
||||
public SocketException ()
|
||||
{
|
||||
error_code = 0;
|
||||
}
|
||||
|
||||
public SocketException (int error)
|
||||
{
|
||||
error_code = error;
|
||||
}
|
||||
|
||||
public SocketException (SerializationInfo info, StreamingContext cxt)
|
||||
{
|
||||
}
|
||||
|
||||
public override int ErrorCode
|
||||
{
|
||||
get { return error_code; }
|
||||
}
|
||||
|
||||
public override string HelpLink
|
||||
{
|
||||
get { return help_link; }
|
||||
set { help_link = value; }
|
||||
}
|
||||
|
||||
public override Exception InnerException
|
||||
{
|
||||
get { return inner_exception }
|
||||
}
|
||||
|
||||
public override string Message
|
||||
{
|
||||
get { return message; }
|
||||
}
|
||||
|
||||
public override int NativeErrorCode
|
||||
{
|
||||
get { return native_code; }
|
||||
}
|
||||
|
||||
public override string Source
|
||||
{
|
||||
get { return source; }
|
||||
}
|
||||
|
||||
public override string StackTrace
|
||||
{
|
||||
get { return stack_trace; }
|
||||
}
|
||||
|
||||
public override MethodBase TargetSite
|
||||
{
|
||||
get { return target_site; }
|
||||
}
|
||||
|
||||
protected override int HResult
|
||||
{
|
||||
get { return hresult; }
|
||||
set { hresult = value; }
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return native_code;
|
||||
}
|
||||
|
||||
public override void GetObjectData( SerializationInfo info, StreamingContext cxt )
|
||||
{
|
||||
// TODO: fill this in
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return error_code + " " + help_link;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// System.Net.Sockets.SocketFlags.cs
|
||||
//
|
||||
// Author:
|
||||
// Andrew Sutton
|
||||
//
|
||||
// (C) Andrew Sutton
|
||||
//
|
||||
|
||||
namespace System.Net.Sockets
|
||||
{
|
||||
public enum SocketFlags
|
||||
{
|
||||
DontRoute,
|
||||
MaxIOVectorLength,
|
||||
None,
|
||||
OutOfBand,
|
||||
Partial,
|
||||
Peek
|
||||
}
|
||||
}
|
||||
Loaded 100 of 392 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user