[bcl+runtime] Multiple small cleanups to Android.
[submodule "external/corert"]
path = external/corert
url = git://github.com/mono/corert.git
+[submodule "external/xunit-binaries"]
+ path = external/xunit-binaries
+ url = git://github.com/mono/xunit-binaries.git
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite = $(mcslib)/monolite
-mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
-monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
+monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
.PHONY: get-monolite-latest
get-monolite-latest:
-rm -fr $(mcslib)/monolite-*
-mkdir -p $(mcslib)
test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
- cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
+ cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
if BITCODE
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
-# when bumping version number below, keep it in sync with man/mono.1 too
-AC_INIT(mono, [4.9.1],
+AC_INIT(mono, [5.1.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
+MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
+MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
+
+# This is the version number of the corlib-runtime interface. When
+# making changes to this interface (by changing the layout
+# of classes the runtime knows about, changing icall signature or
+# semantics etc), increment this variable.
+#
+# This can be reset to 0 when Mono's version number is bumped
+# since it's part of the corlib version (the prefix '1' in the full
+# version number is to ensure the number isn't treated as octal in C)
+MONO_CORLIB_COUNTER=1
+MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
+
+AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
+AC_SUBST(MONO_CORLIB_VERSION)
+
case $host_os in
*cygwin* )
echo "Run configure using ./configure --host=i686-pc-mingw32"
mono/tests/tests-config
mono/tests/assemblyresolve/Makefile
mono/tests/gc-descriptors/Makefile
+mono/tests/testing_gac/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/mini/Makefile
}')]
echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
+ echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
if test x$host_darwin = xyes; then
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
for frame in thread.frames[:+num_frames]:
pc = str(frame.addr)
- fmt = ' %c %s'
var = frame
- if pc[0] == '0':
+ function_name = frame.GetFunctionName()
+ if function_name == "ves_exec_method_with_context":
+ try:
+ s = 'frame->runtime_method->method'
+ klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
+ methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
+
+ ipoffset = frame.EvaluateExpression('ip').GetValueAsUnsigned()
+ insn = ''
+ if ipoffset != 0:
+ ipoffset -= frame.EvaluateExpression('rtm->code').GetValueAsUnsigned()
+ insn = "\"" + frame.EvaluateExpression('mono_interp_opname [*ip]').summary[1:-1] + "\""
+ var = '%s::%s @ %d %s || %s' % (klassname, methodname, ipoffset, insn, frame)
+ except Exception as e:
+ print "DBG: execfail:" + str(e)
+ elif function_name == "mono_interp_transform_method":
+ try:
+ s = 'runtime_method->method'
+ klassname = frame.EvaluateExpression('(char*) ' + s + '->klass->name').summary[1:-1]
+ methodname = frame.EvaluateExpression('(char*) ' + s + '->name').summary[1:-1]
+ var = 'transforming %s::%s || %s' % (klassname, methodname, frame)
+ except Exception as e:
+ print "DBG: transformfail:" + str(e)
+ elif pc[0] == '0':
try:
framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1]
var = 'frame #%i: %s%s' % (frame.idx, pc, framestr)
except:
pass
- print fmt % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var)
+ print ' %c %s' % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var)
def monobt(debugger, command, result, dict):
opts = {'all_bt': False, 'num_frames': None}
# This initializer is being run from LLDB in the embedded command interpreter
# Add any commands contained in this module to LLDB
debugger.HandleCommand('command script add -f monobt.monobt monobt')
- print '"monobt" command installed'
\ No newline at end of file
+ debugger.HandleCommand('command alias mbt monobt')
+ print '"monobt" command installed'
mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/deploy/.stamp
$(TOOL_MAKE) $@
-deploy/.stamp: convert.exe Makefile.am
+deploy/.stamp: convert.exe Makefile.am exdoc
$(mkdir_p) html
runtimedir=`cd ../runtime && pwd`; export runtimedir; \
MONO_PATH=$(CLASS) perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
EXCLUDE_SYMLINKS = NO
EXPAND_ONLY_PREDEF = NO
EXTENSION_MAPPING = c=C h=C
-EXTRACT_ALL = YES
+EXTRACT_ALL = NO
EXTRACT_STATIC = YES
EXT_LINKS_IN_WINDOW = NO
FILE_PATTERNS = *.c *.h
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST = YES
GENERATE_HTML = YES
-GENERATE_PERLMOD = YES
GENERATE_LEGEND = YES
-GENERATE_TESTLIST = YES
+GENERATE_PERLMOD = NO
+GENERATE_TESTLIST = NO
GENERATE_TODOLIST = YES
GENERATE_TREEVIEW = YES
GRAPHICAL_HIERARCHY = YES
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
OUTPUT_LANGUAGE = English
+PREDEFINED = "HAVE_SGEN_GC="
PROJECT_NAME = "Mono"
QT_AUTOBRIEF = NO
QUIET = NO
SKIP_FUNCTION_MACROS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = YES
+SORT_MEMBER_DOCS = YES
SOURCE_BROWSER = YES
SOURCE_TOOLTIPS = YES
STRIP_CODE_COMMENTS = NO
WARNINGS = YES
WARN_IF_DOC_ERROR = YES
WARN_IF_UNDOCUMENTED = YES
-WARN_NO_PARAMDOC = NO
+WARN_NO_PARAMDOC = YES
#!/usr/bin/perl
-if ($ARGV[0] eq "-h"){
- $sourcedir = $ARGV[1];
- $dir = $sourcedir;
- $html = 1;
- shift @ARGV;
- shift @ARGV;
+use warnings;
+use strict;
+
+use Getopt::Long;
+use Pod::Usage;
+
+# Options
+my $HELP = 0;
+my $SOURCE_DIR = '';
+my $TARGET_DIR = '';
+my $WARNINGS = 0;
+
+GetOptions(
+ "help" => \$HELP,
+ "html|h=s" => \$SOURCE_DIR,
+ "target|t=s" => \$TARGET_DIR,
+ "warnings|W" => \$WARNINGS,
+) or pod2usage(1);
+
+pod2usage(0) if $HELP;
+
+exdoc();
+
+#
+# Main entry point.
+#
+sub exdoc {
+ my %templates = ();
+ my %docs = ();
+ my $stylesheet = load_stylesheet($SOURCE_DIR);
+ load_templates($SOURCE_DIR, \%templates);
+ process_source_files(\%docs);
+ merge(\%docs, \%templates, \$stylesheet);
+}
+
+#
+# Load CSS stylesheet.
+#
+sub load_stylesheet {
+ my ($dir_path) = @_;
+ my $file_path = "$dir_path/api-style.css";
+ open (my $file, '<', $file_path) or die "Could not open $file_path";
+ local $/;
+ my $contents = <$file>;
+ close $file;
+ return $contents;
}
-open (FILE, "$dir/api-style.css" || die "Did not find $dir/api-style.css");
-while (<FILE>){
- $css = $css . $_;
+
+#
+# Load HTML templates.
+#
+sub load_templates {
+ my ($dir_path, $templates) = @_;
+ opendir (my $dir, "$dir_path/sources/") or die "Could not open $dir_path";
+ while (my $file_name = readdir ($dir)) {
+ next if $file_name !~ /mono-api-.*\.html$/;
+ open (my $file, "$dir_path/sources/$file_name") or die "Could not open $file_name";
+ my $contents = '';
+ my @api = ();
+ while (<$file>) {
+ $contents .= $_;
+ if (/name="api:(.*?)"/) {
+ s/.*name="api:(\w+?)".*/$1/;
+ push @api, $_;
+ }
+ }
+ close $file;
+ $templates->{$file_name}->{contents} = $contents;
+ $templates->{$file_name}->{api} = \@api;
+ }
+ closedir $dir;
}
-if ($ARGV[0] eq "-t"){
- $dir = $ARGV[1];
- shift @ARGV;
+#
+# Extract documentation from all source files.
+#
+sub process_source_files {
+ my ($docs) = @_;
+ for my $file_path (@ARGV) {
+ process_source_file($file_path, $docs);
+ }
}
-if ($html){
- opendir (D, "$sourcedir/sources/") || die "Can not open $dir";
- while ($n = readdir (D)){
- if ($n =~ /mono-api-.*\.html$/){
- open (IN, "$sourcedir/sources/$n") || die "Can not open $n";
- $files[$filecount] = $n;
- while (<IN>){
- @files_content[$filecount] .= $_;
- if (/name="api:(.*?)"/){
- $_ =~ s/.*name="api:(\w+?)".*/\1/;
- $apis[$filecount] .= "$_";
- }
- }
- $filecount++;
- close IN;
- }
+#
+# Extract documentation from a single source file.
+#
+sub process_source_file {
+ my ($file_path, $docs) = @_;
+ open (my $file, '<', $file_path) or die "Could not open $file_path";
+ while (<$file>) {
+ next if (!/\/\*\* *\n/);
+ process_function($file, $file_path, $docs);
}
+ close $file;
}
-while (<ARGV>){
- if (/\/\*\* *\n/){
- &process_doc;
- } else {
- #print "IGNORING: $_";
- }
+#
+# Extract documentation from a single function.
+#
+sub process_function {
+
+ my ($file, $file_path, $docs) = @_;
+
+ my $PARAMETER_SECTION = 0;
+ my $BODY_SECTION = 1;
+ my $RETURN_SECTION = 2;
+ my $section = $PARAMETER_SECTION;
+
+ my $name = do {
+ $_ = <$file>;
+ chomp;
+ s/^ \* //;
+ s/:$//;
+ $_
+ };
+
+ # Ignore irrelevant functions, and those with the wrong doc format.
+ return if $name !~ /^mono_\w+$/;
+
+ my $deprecated;
+ my @parameters = ();
+ my $body = '';
+ my $returns = '';
+ my $prototype = '';
+
+ while (<$file>) {
+
+ # We've reached the last line in the documentation block.
+ if (/^ \*\*?\//) {
+
+ # Grab function prototype.
+ while (<$file>) {
+ $prototype .= $_;
+ last if /\{/;
+ }
+
+ # Clean up prototype.
+ $prototype = do {
+ $_ = $prototype;
+ # Strip braces and trailing whitespace.
+ s/{//;
+ s/ +$//;
+ # Turn "Type * xxx" into "Type* xxx"
+ s/^(\w+)\W+\*/$1*/;
+ $_;
+ };
+
+ # Process formatting within sections.
+ for my $parameter (@parameters) {
+ process_formatting(\$parameter->{description}, $file_path, $.);
+ }
+ process_formatting(\$returns, $file_path, $.);
+ process_formatting(\$body, $file_path, $.);
+ if (defined($deprecated)) {
+ process_formatting(\$deprecated, $file_path, $.);
+ }
+ $body =~ s/\n/ /g;
+
+ if (exists($docs->{body}->{$name})) {
+ my $origin = $docs->{origin}->{$name};
+ if ($WARNINGS) {
+ warn
+ "$file_path:$.: Redundant documentation for $name\n",
+ "$origin->{file}:$origin->{line}: Previously defined here\n";
+ }
+ }
+ $docs->{origin}->{$name} = { file => $file_path, line => $. };
+ $docs->{body}->{$name} = $body;
+ $docs->{parameters}->{$name} = \@parameters;
+ $docs->{deprecated}->{$name} = $deprecated if defined $deprecated;
+ $docs->{return}->{$name} = $returns;
+ $docs->{prototype}->{$name} = $prototype;
+ last;
+
+ }
+
+ # Strip newlines and asterisk prefix.
+ chomp;
+ s/^ +\*//;
+
+ # Replace blank lines with paragraph breaks.
+ $_ = '<p>' if /^\s*$/;
+
+ if ($section == $PARAMETER_SECTION) {
+ if (/\s*\\param +(\w+)(.*)/) {
+ # print "$file_path:$.: warning: Got parameter $1\n";
+ push @parameters, { name => $1, description => $2 };
+ } elsif (/\s*\\deprecated(.*)/) {
+ # print "$file_path:$.: warning: Got deprecated annotation\n";
+ $deprecated = $1;
+ } elsif (/\s*(\w+):(.*)/) {
+ if ($1 eq 'deprecated') {
+ warn "$file_path:$.: Old-style monodoc notation 'deprecated:' used\n"
+ if $WARNINGS;
+ $deprecated = $2;
+ } else {
+ warn "$file_path:$.: Old-style monodoc notation 'param:' used\n"
+ if $WARNINGS;
+ push @parameters, { name => $1, description => $2 };
+ }
+ } else {
+ # $body = "\t$_\n";
+ $section = $BODY_SECTION;
+ redo;
+ }
+ } elsif ($section == $BODY_SECTION) {
+ if (s/(Returns?:\s*|\\returns?\s*)//) {
+ $returns = "\t$_\n";
+ $section = $RETURN_SECTION;
+ } else {
+ $body .= "\n\t$_";
+ }
+ } elsif ($section == $RETURN_SECTION) {
+ $returns .= "\n\t$_";
+ } else {
+ die "Invalid section $section\n";
+ }
+ }
+}
+
+#
+# Substitute formatting within documentation text.
+#
+sub process_formatting {
+ my ($content, $file_path, $current_line) = @_;
+ $_ = $$content;
+
+ # Constants
+ s{NULL}{<code>NULL</code>}g;
+ s{TRUE}{<code>TRUE</code>}g;
+ s{FALSE}{<code>FALSE</code>}g;
+
+ # Parameters
+ warn "$file_path:$current_line: Old-style monodoc notation '\@param' used\n"
+ if s{@(\w+)}{<i>$1</i>}g && $WARNINGS;
+ s{\\p +(\w+)}{<i>$1</i>}g;
+
+ # Code
+ warn "$file_path:$current_line: Old-style monodoc notation '#code' used\n"
+ if s{#(\w+)}{<code>$1</code>}g && $WARNINGS;
+ warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
+ if s{\`((?!api:)[:.\w\*]+)\`}{<code>$1</code>}g && $WARNINGS;
+ s{\\c +(\S+(?<![.,:;]))}{<code>$1</code>}g;
+
+ $$content = $_;
}
-if ($html){
- for ($f = 0; $f < $filecount; $f++){
- $name = $files[$f];
- open (OUT, "> $dir/html/$name") || die "Can not create $dir/html/$name";
- print "Merging: $name\n";
- print OUT<<EOF;
+#
+# Merge templates with stylesheet and documentation extracted from sources.
+#
+sub merge {
+ my ($docs, $templates, $stylesheet) = @_;
+ my $last = '';
+ for my $name (keys %$templates) {
+ open (my $output_file, '>', "$TARGET_DIR/html/$name")
+ or die "Could not create $TARGET_DIR/html/$name";
+ print "Merging: $name\n";
+ print $output_file <<EOF;
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$name</title>
<style type="text/css">
-$css
+$stylesheet
</style>
</head>
<body>
<div class="mapi-docs">
EOF
- @a = split (/\n/, $files_content[$f]);
- $strikeextra = "";
- $api_shown = 0;
- for ($ai = 0; $ai < $#a; $ai++){
- $line = $a[$ai];
-
- ($api,$caption) = $line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/;
- if ($api ne ""){
- if ($api_shown == 1){
- print OUT "</div> <!-- class=mapi -->\n\n";
- if ($deprecated{$api}){
- $strike = "mapi-strike";
- $strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $deprecated{$api};
- } else {
- $strike = "";
- $strikeextra = "";
- }
- }
- $api_shown = 1;
- $proto = $prototype{$api};
- if ($proto eq ""){
- $proto = "$api";
- }
-
- print OUT<<EOF;
+ my @a = split (/\n/, $templates->{$name}->{contents});
+ my $strike = '';
+ my $strikeextra = '';
+ my $api_shown = 0;
+ for (my $ai = 0; $ai < $#a; $ai++) {
+ my $line = $a[$ai];
+ if (my ($api, $caption) = ($line =~ /<h4><a name=\"api:(\w+)\">(\w+)<\/a><\/h4>/)) {
+ if ($api_shown == 1) {
+ print $output_file "</div> <!-- class=mapi -->\n\n";
+ if ($docs->{deprecated}->{$api}) {
+ $strike = "mapi-strike";
+ $strikeextra = "</div><br><div class='mapi-deprecated'><b>Deprecated:</b> " . $docs->{deprecated}->{$api};
+ } else {
+ $strike = "";
+ $strikeextra = "";
+ }
+ }
+ $api_shown = 1;
+ my $proto = $docs->{prototype}->{$api} // $api;
+
+ print $output_file <<EOF;
<a name="api:$api"></a>
<div class="mapi">
<div class="mapi-entry $strike"><code>$api$strikeextra</code></div>
<div class="mapi-prototype">$proto</div>
<p>
EOF
- $ppars = $arguments{$api};
- if ($ppars ne "" && (!($ppars =~ /^[ \t]+$/))){
- print OUT " <div class=\"mapi-section\">Parameters</div>\n";
- print OUT " <table class=\"mapi-parameters\"><tbody>".${arguments{$api}}."</tbody></table>";
- }
-
- &opt_print ("Return value", $returns{$api}, 0);
- &opt_print ("Description", $bodies{$api}, 0);
- print OUT " </div><!--mapi-description-->\n </div><!--height container-->\n";
- } else {
- if ($line =~ /@API_IDX@/){
- $apis_toc = &create_toc ($apis[$f]);
- $line =~ s/\@API_IDX\@/$apis_toc/;
- }
- if ($line =~ /^<h4/){
- print OUT "</div>\n";
- $api_shown = 0;
- }
- if ($line =~ /`/){
- }
- print OUT "$line\n";
- }
- }
- print OUT<<EOF;
- </div>
-</body>
-</html>
-EOF
- close OUT;
- system ("$ENV{runtimedir}/mono-wrapper convert.exe $dir/html/$name $dir/html/x-$name");
-
-
- # clean up the mess that AgilityPack does, it CDATAs our CSS
- open HACK, "$dir/html/x-$name" || die "Could not open $dir/html/x-$name";
- open HACKOUT, ">$dir/deploy/$name" || die "Could not open output";
-
- $line = 0;
- $doprint = 0;
- while (<HACK>){
- print HACKOUT $last if ($doprint);
- $line++;
- s/^\/\/<!\[CDATA\[//;
- s/^\/\/\]\]>\/\///;
-
- # Remove the junk <span> wrapper generated by AgilityPack
- if ($line==1){
- s/<span>//;
- }
- if (/<style type/){
- # Replace the CSS in the XHTML output with the original CSS
- print HACKOUT $_;
- print HACKOUT $css;
- while (<HACK>){
- last if (/<\/style>/);
- }
- }
- $last = $_;
- $doprint = 1;
- }
- if (!($last =~ /span/)){
- print HACKOUT $last;
- }
-
- #system ("cp.exe $dir/html/$name $dir/deploy/$name");
- }
-}
+ if (exists ($docs->{parameters}->{$api})) {
+ my $ppars = $docs->{parameters}->{$api};
+ if (@$ppars) {
+ print $output_file
+ " <div class=\"mapi-section\">Parameters</div>\n",
+ " <table class=\"mapi-parameters\"><tbody>",
+ render_parameters($ppars),
+ "</tbody></table>";
+ }
+ }
+
+ opt_print ($output_file, "Return value", $docs->{return}->{$api});
+ opt_print ($output_file, "Description", $docs->{body}->{$api});
+ print $output_file " </div><!--mapi-description-->\n </div><!--height container-->\n";
+ } else {
+ if ($line =~ /\@API_IDX\@/) {
+ my $apis_toc = create_toc ($docs, $templates->{$name}->{api});
+ $line =~ s/\@API_IDX\@/$apis_toc/;
+ }
+ if ($line =~ /^<h4/) {
+ print $output_file "</div>\n";
+ $api_shown = 0;
+ }
+ if ($line =~ /`/) {
+ }
+ print $output_file "$line\n";
+ }
+ }
+ print $output_file
+ " </div>",
+ "</body>",
+ "</html>";
+ close $output_file;
+ system ("$ENV{runtimedir}/mono-wrapper convert.exe $TARGET_DIR/html/$name $TARGET_DIR/html/x-$name");
-sub process_doc {
- $doc = "";
- $func = <>;
- chop $func;
- $func =~ s/^ \* //;
- $func =~ s/:$//;
- print "Function: $func\n" if (!$html);
- $args = "";
- $inbody = 0;
- $returns = "";
- $body = "";
- $functions[$fn++] = $func;
- $deprecated = 0;
- # Process arguments
- while (<>){
- s/NULL/<code>NULL<\/code>/g;
- s/TRUE/<code>TRUE<\/code>/g;
- s/FALSE/<code>FALSE<\/code>/g;
- if (/^ \*\*?\//){
- $body =~ s/@(\w+)/<i>\1<\/i>/g;
- $returns =~ s/@(\w+)/<i>\1<\/i>/g;
- $args =~ s/@(\w+)/<i>\1<\/i>/g;
-
- $body =~ s/#(\w+)/<code>\1<\/code>/g;
- $returns =~ s/#(\w+)/<code>\1<\/code>/g;
- $args =~ s/#(\w+)/<code>\1<\/code>/g;
-
- $returns =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
- $args =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
- $body =~ s/\`([:.\w\*]+)\`/<code>\1<\/code>/g;
-
- $body =~ s/\n/ /;
- $bodies{$func} = $body;
- $arguments{$func} = $args;
- $deprecated{$func} = $deprecated;
- $returns{$func} = $returns;
- $proto = "";
- while (<>){
- $proto .= $_;
- last if (/\{/);
- }
- $proto =~ s/{//;
- # clean it up a little, remove newlines, empty space at end
- $proto =~ s/ +$//;
- # Turn "Type * xxx" into "Type* xxx"
- $proto =~ s/^(\w+)\W+\*/\1\*/;
- $prototype{$func} = $proto;
- return;
- }
- chop;
- s/^\ \*//;
- $_ = "<p>" if (/^\s*$/);
-
- if ($inbody == 0){
- if (/\s*(\w+):(.*)/){
- if ($1 eq "deprecated"){
- $deprecated = $2;
- } else {
- #$args .= "<dt><i>$1:</i></dt><dd>$2</dd>";
- $args .= "<tr><td><i>$1</i><td>$2</td></td></tr>";
- }
- } else {
-
- $body = "\t$_\n";
-
- $inbody = 1;
- }
- } elsif ($inbody == 1) {
- if (/Returns?:/){
- s/Returns?://;
- $returns = "\t$_\n";
- $inbody = 2;
- } else {
- $body .= "\n\t$_";
- }
- } else {
- $returns .= "\n\t$_";
- }
-
- }
+ # Clean up the mess that AgilityPack makes (it CDATAs our CSS).
+ open (my $hack_input, '<', "$TARGET_DIR/html/x-$name")
+ or die "Could not open $TARGET_DIR/html/x-$name";
+ open (my $hack_output, '>', "$TARGET_DIR/deploy/$name")
+ or die "Could not open output";
+
+ my $line = 0;
+ my $doprint = 0;
+ while (<$hack_input>) {
+ print $hack_output $last if ($doprint);
+ $line++;
+ s/^\/\/<!\[CDATA\[//;
+ s/^\/\/\]\]>\/\///;
+
+ # Remove the junk <span> wrapper generated by AgilityPack.
+ if ($line==1) {
+ s/<span>//;
+ }
+ if (/<style type/) {
+ # Replace the CSS in the XHTML output with the original CSS.
+ print $hack_output $_;
+ print $hack_output $$stylesheet;
+ while (<$hack_input>) {
+ last if (/<\/style>/);
+ }
+ }
+ $last = $_;
+ $doprint = 1;
+ }
+ if (!($last =~ /span/)) {
+ print $hack_output $last;
+ }
+ # system ("cp.exe $TARGET_DIR/html/$name $TARGET_DIR/deploy/$name");
+ }
}
sub create_toc {
- my ($apis_listed) = @_;
+ my ($docs, $apis_listed) = @_;
my $type_size = 0;
my $name_size = 0;
- my $ret, $xname, $args, $line;
- $apis_toc = "";
+ my ($ret, $xname, $args);
+ my $apis_toc = "";
-
- # Try to align things, so compute type size, method size, and arguments
- foreach $line (split /\n/, $apis_listed){
- $p = $prototype{$line};
- ($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
- $tl = length ($ret);
- $pl = length ($xname);
-
- $type_size = $tl if ($tl > $type_size);
- $name_size = $pl if ($pl > $name_size);
+ # Try to align things; compute type size, method size, and arguments.
+ foreach my $line (split /\n/, $apis_listed) {
+ if (exists ($docs->{prototype}->{$line})) {
+ my $p = $docs->{prototype}->{$line};
+ if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
+ my $tl = length ($ret);
+ my $pl = length ($xname);
+ $type_size = $tl if ($tl > $type_size);
+ $name_size = $pl if ($pl > $name_size);
+ }
+ }
}
$type_size++;
$name_size++;
- foreach $line (split /\n/, $apis_listed){
- chop;
- $p = $prototype{$line};
- ($ret, $xname, $args) = $p =~ /(.*)\n(\w+)[ \t](.*)/;
- if ($xname eq ""){
- $xname = $line;
- }
-
- $rspace = " " x ($type_size - length ($ret));
- $nspace = " " x ($name_size - length ($xname));
- $args = &format ($args, length ($ret . $rspace . $xname . $nspace), 60);
- $apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
+ foreach my $line (split /\n/, $apis_listed) {
+ chomp($line);
+ if (exists($docs->{prototype}->{$line})) {
+ my $p = $docs->{prototype}->{$line};
+ if (my ($ret, $xname, $args) = ($p =~ /(.*)\n(\w+)[ \t](.*)/)) {
+ $xname = $line if $xname eq "";
+ my $rspace = " " x ($type_size - length ($ret));
+ my $nspace = " " x ($name_size - length ($xname));
+ $args = wrap ($args, length ($ret . $rspace . $xname . $nspace), 60);
+ $apis_toc .= "$ret$rspace<a href=\"\#api:$line\">$xname</a>$nspace$args\n";
+ }
+ }
}
return $apis_toc;
}
-#
-# Formats the rest of the arguments in a way that will fit in N columns
-#
-sub format {
+sub wrap {
my ($args, $size, $limit) = @_;
my $sret = "";
-# return $args if ((length (args) + size) < $limit);
+ # return $args if ((length (args) + size) < $limit);
- $remain = $limit - $size;
- @sa = split /,/, $args;
- $linelen = $size;
- foreach $arg (@sa){
- if ($sret eq ""){
- $sret = $arg . ", ";
- $linelen += length ($sret);
- } else {
- if ($linelen + length ($arg) < $limit){
- $sret .= "FITS" . $arg . ", ";
- } else {
- $newline = " " x ($size) . $arg . ", ";
- $linelen = length ($newline);
- $sret .= "\n" . $newline;
- }
- }
+ my $remain = $limit - $size;
+ my @sa = split /,/, $args;
+ my $linelen = $size;
+ foreach my $arg (@sa) {
+ if ($sret eq "") {
+ $sret = $arg . ", ";
+ $linelen += length ($sret);
+ } else {
+ if ($linelen + length ($arg) < $limit) {
+ $sret .= "FITS" . $arg . ", ";
+ } else {
+ my $newline = " " x ($size) . $arg . ", ";
+ my $linelen = length ($newline);
+ $sret .= "\n" . $newline;
+ }
+ }
}
$sret =~ s/, $/;/;
return $sret;
}
+#
+# Print a section if non-empty.
+#
sub opt_print {
- my ($caption, $opttext, $quote) = @_;
+ my ($output, $caption, $opttext) = @_;
+ if (defined($opttext) && $opttext ne '' && $opttext !~ /^[ \t]+$/) {
+ print $output
+ " <div class=\"mapi-section\">$caption</div>\n",
+ " <div>$opttext</div>\n";
+ }
+}
- if ($opttext ne "" && (!($opttext =~ /^[ \t]+$/))){
- print OUT " <div class=\"mapi-section\">$caption</div>\n";
- print OUT " <div>$opttext</div>\n";
+#
+# Render parameter information as table.
+#
+sub render_parameters {
+ my ($parameters) = @_;
+ my $result = '';
+ for my $parameter (@$parameters) {
+ $result .= "<tr><td><i>$parameter->{name}</i></td><td>$parameter->{description}</td></tr>";
}
+ return $result;
}
+
+__END__
+
+=head1 NAME
+
+exdoc - Compiles API docs from Mono sources and HTML templates.
+
+=head1 SYNOPSIS
+
+ exdoc [OPTIONS] [FILE...]
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--help>
+
+Print this help message.
+
+=item B<--html> I<DIR>, B<-h> I<DIR>
+
+Use I<DIR> as the input path for HTML sources.
+
+=item B<--target> I<DIR>, B<-t> I<DIR>
+
+Use I<DIR> as the target path for output.
+
+=item B<--warnings>, B<-W>
+
+Enable warnings about documentation errors.
+
+=back
+
+=head1 DESCRIPTION
+
+Reads HTML templates and C sources, extracting documentation from the sources and splicing it into the templates.
+
+=cut
<h4><a name="api:mono_profiler_startup">mono_profiler_startup</a></h4>
<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
-<h4><a name="api:mono_profiler_gc_event">mono_profiler_gc_event</a></h4>
-<h4><a name="api:mono_profiler_gc_heap_resize">mono_profiler_gc_heap_resize</a></h4>
<h4><a name="api:mono_profiler_stat_hit">mono_profiler_stat_hit</a></h4>
-Subproject commit 1ab0b08ad40962d4f794f12ce042b98d2148df52
+Subproject commit 229946f543f65db2b102188427cda4b68fc08ee6
-Subproject commit 63c51e726292149b4868db71baa883e5ad173766
+Subproject commit f646c9d6a61cfc067df42b0e452448c4da7d144b
-Subproject commit 31eda261991f9f6c1add1686b6d3799f835b2978
+Subproject commit 8dce492077a2cd43abff2e9d4e0c9e186f44af2e
-Subproject commit e4d9784ac37b9ebf4757175c92bc7a3ec9fd867a
+Subproject commit 1bdcf6b7bfbe3b03fdaa76f6124d0d7374f08615
--- /dev/null
+Subproject commit b8e20d265b368dd6252703d5afd038d0b028e388
.if t .sp .5v
.if n .sp
..
-.TH csharp 1 "4 September 2008"
+.TH csharp 1 "22 March 2017"
.SH NAME
-csharp, gsharp \- Interactive C# Shell
+csharp \- Interactive C# Shell and Scripting
.SH SYNOPSIS
.B csharp [--attach PID] [-e EXPRESSION] [file1 [file2]]
-[options]
-.P
-.B gsharp [file1 [file2]]
+[compiler-options] [--|-s script-options]
.SH DESCRIPTION
The
.I csharp
-is an interactive C# shell that allows the user to enter and evaluate
-C# statements and expressions from the command line. The regular
+command is an interactive C# shell and scripting host that allows
+the user to enter and evaluate C# statements and expressions from
+the command line or execute C# scripts.
+The regular
.I mcs
command line options can be used in this version of the compiler.
.PP
-The
-.I gsharp
-command is a GUI version of the C# interpreter that uses Gtk# and
-provides an area to attach widgets as well. This version can be
-attached to other Gtk# applications in a safe way as it injects itself
-into the main loop of a Gtk# application, avoiding any problems
-arising from the multi-threaded nature of injecting itself into a
-target process.
-.PP
Files specified in the command line will be loaded and executed as
scripts.
.PP
command can be used as an interpreter executed by executables flagged
with the Unix execute attribute. To do this, make the first line of
your C# source code look like this:
+.PP
.nf
-"#!/usr/bin/csharp"
-Console.WriteLine ("Hello, World");
+ #!/usr/bin/csharp
+ Console.WriteLine ("Hello, World");
+.fi
+.PP
+Starting with Mono 5.0, command line arguments may now be passed
+to the
+.I csharp
+command by specifying either the
+.I -s
+or
+.I --
+(script) options.
+.PP
+The
+.I -s
+option is ideal for interpreting executable scripts that utilize
+shebang syntax (introduced in Mono 2.10). This allows command line
+arguments to be passed to and consumed cleanly by the script:
+.PP
+.nf
+ #!/usr/bin/csharp -s
+ foreach (var arg in Args)
+ Console.WriteLine ($"script argument: {arg}");
.fi
.SH OPTIONS
The commands accept all of the commands that are available to the
command, so you can reference assemblies, specify paths, language
level and so on from the command line. In addition, the following
command line options are supported:
+.TP
+.I "\-s" SCRIPT_FILE
+This option is ideal for authoring executable scripts that utilize
+the Unix shebang feature. Unix will implicitly append as an argument
+the path of the script to execute. When the executable is invoked,
+any arguments then passed to it will be available in the
+.I Args
+global. Example:
+.I "#!/usr/bin/env csharp -s"
+.TP
+.I "\-\-"
+Any arguments that follow will not be passed to the compiler driver,
+and instead will be made available in the
+.I Args
+global. Example:
+.I csharp -- a b c
+will result in Args = { "a", "b", "c" } in the interactive shell.
.TP
.I "\-\-attach"
This is an advanced option and should only be used if you have a deep
invoked directly from the shell. These are the available properties
and methods:
.TP
+.I Args
+An easy to consume array of any arguments specified after either
+.I -s
+or
+.I --
+on the command line. Ideal for self-executing scripts utilizing the
+.I -s
+option.
+.TP
.I void LoadAssembly(string assembly)
Loads the given assembly. This is equivalent to passing the compiler
the -r: flag with the specified string.
\fImono\fP is a runtime implementation of the ECMA Common Language
Infrastructure. This can be used to run ECMA and .NET applications.
.PP
-The runtime contains a native code generator that transforms the
-Common Intermediate Language into native code.
-.PP
-The code generator can operate in two modes: just in time compilation
-(JIT) or ahead of time compilation (AOT). Since code can be
-dynamically loaded, the runtime environment and the JIT are always
-present, even if code is compiled ahead of time.
-.PP
The runtime loads the specified
.I file
and optionally passes
.I file
is an ECMA assembly. They typically have a .exe or .dll extension.
.PP
+These executables can reference additionaly functionality in the form
+of assembly references. By default those assembly references are
+resolved as follows: the \fBmscorlib.dll\fR is resolved from the
+system profile that is configured by Mono, and other assemblies are
+loaded from the Global Assembly Cache (GAC).
+.PP
+The runtime contains a native code generator that transforms the
+Common Intermediate Language into native code.
+.PP
+The code generator can operate in two modes: just in time compilation
+(JIT) or ahead of time compilation (AOT). Since code can be
+dynamically loaded, the runtime environment and the JIT are always
+present, even if code is compiled ahead of time.
+.PP
The runtime provides a number of configuration options for running
applications, for developing and debugging, and for testing and
debugging the runtime itself.
.PP
-The \fImono\fP command uses the Boehm conservative garbage collector
-while the \fImono-sgen\fP command uses a moving and generational
+The \fImono\fP command uses the moving and generational SGen garbage collector
+while the \fImono-boehm\fP command uses the conservative Boehm
garbage collector.
.SH PORTABILITY
On Unix-based systems, Mono provides a mechanism to emulate the
precompiling code, you might want to compile with all optimizations
(-O=all). Pre-compiled code is position independent code.
.Sp
-Pre compilation is just a mechanism to reduce startup time, increase
+Precompilation is just a mechanism to reduce startup time, increase
code sharing across multiple mono processes and avoid just-in-time
compilation program startup costs. The original assembly must still
be present, as the metadata is contained there.
.RS
.ne 8
.TP
-.I autoreg
-The AOT compiler will emit a (ELF only) library initializer to automatically
-register the aot compiled module with the runtime. This is only useful in static
-mode
-.TP
.I asmonly
Instructs the AOT compiler to output assembly code instead of an
object file.
If specified, forces the generated AOT files to be bound to the
runtime version of the compiling Mono. This will prevent the AOT
files from being consumed by a different Mono runtime.
-.I full
-.Sp
-This is currently an experimental feature as it is not complete.
-This instructs Mono to precompile code that has historically not been
-precompiled with AOT.
.TP
.I data-outfile=FILE.dll.aotdata
.Sp
.I mono_install_load_aot_data_hook
method.
.TP
+.I direct-icalls
+.Sp
+When this option is specified, icalls (internal calls made from the
+standard library into the mono runtime code) are invoked directly
+instead of going through the operating system symbol lookup operation.
+This requires use of the
+.I static
+option.
+.TP
.I direct-pinvoke
.Sp
When this option is specified, P/Invoke methods are invoked directly
instead of going through the operating system symbol lookup operation.
+This requires use of the
+.I static
+option.
+.TP
+.I dwarfdebug
+Instructs the AOT compiler to emit DWARF debugging information. When
+used together with the nodebug option, only DWARF debugging
+information is emitted, but not the information that can be used at
+runtime.
+.TP
+.I full
+.Sp
+This creates binaries which can be used with the --full-aot option.
+.TP
+.I hybrid
+.Sp
+This creates binaries which can be used with the --hybrid-aot option.
+.TP
+.I llvm
+AOT will be performed with the LLVM backend instead of the Mono backend where possible. This will be slower to compile but most likely result in a performance improvement.
+.TP
+.I llvmonly
+AOT will be performed with the LLVM backend exclusively and the Mono backend will not be used. The only output in this mode will be the bitcode file normally specified with the
+.I llvm-outfile
+option. Use of
+.I llvmonly
+automatically enables the
+.I full
+and
+.I llvm
+options. This feature is experimental.
+.TP
+.I llvm-outfile=[filename]
+Gives the path for the temporary LLVM bitcode file created during AOT.
+.TP
+.I info
+Print the architecture the AOT in this copy of Mono targets and quit.
+.TP
+.I ld-flags
+Additional flags to pass to the C linker (if the current AOT mode calls for invoking it).
.TP
.I llvm-path=<PREFIX>
Same for the llvm tools 'opt' and 'llc'.
.I nimt-trampolines=[number]
When compiling in full aot mode, the IMT trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
-Defaults to 128.
+Defaults to 512.
+.TP
+.I ngsharedvt-trampolines=[number]
+When compiling in full aot mode, the value type generic sharing trampolines must be precreated
+in the AOT image. You can add additional method trampolines with this argument.
+Defaults to 512.
.TP
.I nodebug
Instructs the AOT compiler to not output any debugging information.
method. The AOT compiler usually generates direct calls for certain
methods that do not require going through the PLT (for example,
methods that are known to not require a hook like a static
-constructor) or call into simple internal calls.
-.TP
-.I dwarfdebug
-Instructs the AOT compiler to emit DWARF debugging information. When
-used together with the nodebug option, only DWARF debugging
-information is emitted, but not the information that can be used at
-runtime.
+constructor) or call into simple internal calls.
.TP
.I nrgctx-trampolines=[number]
When compiling in full aot mode, the generic sharing trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
-Defaults to 1024.
+Defaults to 4096.
+.TP
+.I nrgctx-fetch-trampolines=[number]
+When compiling in full aot mode, the generic sharing fetch trampolines must be precreated
+in the AOT image. You can add additional method trampolines with this argument.
+Defaults to 128.
.TP
.I ntrampolines=[number]
When compiling in full aot mode, the method trampolines must be precreated
in the AOT image. You can add additional method trampolines with this argument.
-Defaults to 1024.
+Defaults to 4096.
.TP
.I outfile=[filename]
Instructs the AOT compiler to save the output to the specified file.
If the AOT compiler cannot compile a method for any reason, enabling this flag
will output the skipped methods to the console.
.TP
+.I profile=[file]
+Specify a file to use for profile-guided optimization. See the "AOT PROFILING" section. To specify multiple files, include the
+.I profile
+option multiple times.
+.TP
+.I profile-only
+AOT *only* the methods described in the files specified with the
+.I profile
+option. See the "AOT PROFILING" section.
+.TP
.I readonly-value=namespace.typename.fieldname=type/value
Override the value of a static readonly field. Usually, during JIT
compilation, the static constructor is ran eagerly, so the value of
This option can be specified multiple times and it doesn't prevent the static
constructor for the type defining the field to execute with the usual rules
at runtime (hence possibly computing a different value for the field).
-
.TP
.I save-temps,keep-temps
Instructs the AOT compiler to keep temporary files.
.I stats
Print various stats collected during AOT compilation.
.TP
+.I temp_path=[path]
+Explicitly specify path to store temporary files created during AOT compilation.
+.TP
.I threads=[number]
This is an experimental option for the AOT compiler to use multiple threads
when compiling the methods.
example, --tool=prefix=arm-linux-gnueabi- will make the AOT compiler run
'arm-linux-gnueabi-as' instead of 'as'.
.TP
-.I write-symbols
-Instructs the AOT compiler to emit debug symbol information.
+.I verbose
+Prints additional information about type loading failures.
+.TP
+.I write-symbols,no-write-symbols
+Instructs the AOT compiler to emit (or not emit) debug symbol information.
.PP
For more information about AOT, see: http://www.mono-project.com/docs/advanced/aot/
.RE
This instructs the Mono runtime to
start a debugging agent inside the Mono runtime and connect it to a
client user interface will control the Mono process.
-This option is typically used by IDEs, like the MonoDevelop IDE.
-.PP
+This option is typically used by IDEs, like the MonoDevelop or Visual Studio IDEs.
+.RS
The configuration is specified using one of more of the following options:
.RS
.ne 8
Mono will print out to stdout the IP address and port where it is listening.
.TP
.I setpgid=[y/n]
-If set to yes, Mono will call \fBsetpgid(0, 0)\fB on startup, if that function
+If set to yes, Mono will call \fBsetpgid(0, 0)\fR on startup, if that function
is available on the system. This is useful for ensuring that signals delivered
to a process that is executing the debuggee are not propagated to the debuggee,
-e.g. when Ctrl-C sends \fBSIGINT\fB to the \fBsdb\fB tool.
+e.g. when Ctrl-C sends \fBSIGINT\fR to the \fBsdb\fR tool.
.TP
.I suspend=[y/n]
Defaults to yes, with the default option Mono will suspend the vm on startup
collection a bit.
.TP
\fB--full-aot\fR
-This is an experimental flag that instructs the Mono runtime to not
+This flag instructs the Mono runtime to not
generate any code at runtime and depend exclusively on the code
-generated from using mono --aot=full previously. This is useful for
-platforms that do not permit dynamic code generation.
+generated from using mono --aot=full previously. This is useful for
+platforms that do not permit dynamic code generation, or if you need
+to run assemblies that have been stripped of IL (for example using
+mono-cil-strip).
.Sp
Notice that this feature will abort execution at runtime if a codepath
in your program, or Mono's class libraries attempts to generate code
\fB--help\fR, \fB-h\fR
Displays usage instructions.
.TP
+\fB--hybrid-aot\fR
+This flag allows the Mono runtime to run assemblies
+that have been stripped of IL, for example using mono-cil-strip. For this to
+work, the assembly must have been AOT compiled with --aot=hybrid.
+
+This flag is similar to --full-aot, but it does not disable the JIT. This means
+you can use dynamic features such as System.Reflection.Emit.
+.TP
\fB--llvm\fR
If the Mono runtime has been compiled with LLVM support (not available
in all configurations), Mono will use the LLVM optimization and code
Turns on profiling. For more information about profiling applications
and code coverage see the sections "PROFILING" and "CODE COVERAGE"
below.
-.TP
+.Sp
This option can be used multiple times, each time will load an
additional profiler. This allows developers to use modules that
extend the JIT through the Mono profiling interface.
when pressed. Useful to find out where the program is executing at a
given point. This only displays the stack trace of a single thread.
.TP
-\fBinit-stacks\FR
+\fBinit-stacks\fR
Instructs the runtime to initialize the stack with
some known values (0x2a on x86-64) at the start of a method to assist
in debuggin the JIT engine.
http://www.mono-project.com
.SH SEE ALSO
.PP
-certmgr(1), csharp(1), mcs(1), mdb(1), monocov(1), monodis(1),
-mono-config(5), mozroots(1), mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8).
+certmgr(1), cert-sync(1), csharp(1), gacutil(1), mcs(1), mdb(1), monocov(1), monodis(1),
+mono-config(5), mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8).
.PP
For more information on AOT:
http://www.mono-project.com/docs/advanced/aot/
common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
test -n '$(MONO_VERSION)'
- sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' $< > $@
+ test -n '$(MONO_CORLIB_VERSION)'
+ sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
PLATFORMS = darwin linux win32
PROFILES = \
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";
+ public const int MonoCorlibVersion = @MONO_CORLIB_VERSION@;
#if MOBILE
// Versions of .NET Framework for Silverlight 4.0
intermediate_clean=$(subst /,-,$(intermediate))
csproj-library:
config_file=`basename $(LIBRARY) .dll`-$(intermediate_clean)$(PROFILE).input; \
- case "$(thisdir)" in *"Facades"*) config_file=Facades_$$config_file;; esac; \
+ case "$(thisdir)" in *"Facades"*) config_file=Facades_$$config_file;; *"legacy"*) config_file=legacy_$$config_file;; esac; \
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
(echo $(is_boot); \
echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
# make dist will collect files in .sources files from all profiles
dist-local: dist-default
subs=' ' ; \
- for f in `$(topdir)/tools/removecomments.sh $(filter-out $(wildcard *_test.dll.sources) $(wildcard *exclude.sources),$(wildcard *.sources))` $(TEST_FILES) ; do \
+ for f in `$(topdir)/tools/removecomments.sh $(filter-out $(wildcard *_test.dll.sources) $(wildcard *_xtest.dll.sources) $(wildcard *exclude.sources),$(wildcard *.sources))` $(TEST_FILES) ; do \
case $$f in \
../*) : ;; \
*.g.cs) : ;; \
# -*- makefile -*-
#
-# Platform-specific makefile rules. This one's for linux.
+# Platform-specific makefile rules. This one's for macOS.
#
PLATFORM_MCS_FLAGS =
PLATFORM_RUNTIME = $(RUNTIME)
PLATFORM_CORLIB = mscorlib.dll
-PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac,
+PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac,MacNotWorking,
EXTERNAL_MCS = mcs
EXTERNAL_MBAS = mbas
NO_CONSOLE = yes
PROFILE_DISABLE_BTLS=1
+MONO_FEATURE_APPLETLS=1
+ONLY_APPLETLS=1
NO_MULTIPLE_APPDOMAINS=1
NO_PROCESS_START=1
NO_MONO_SECURITY=1
+MONO_FEATURE_APPLETLS=
+ONLY_APPLETLS=
+MONO_FEATURE_APPLE_X509=1
# so we need a System.dll that can do that.
#NO_PROCESS_START=1
NO_MONO_SECURITY=1
+MONO_FEATURE_APPLETLS=
+ONLY_APPLETLS=
+MONO_FEATURE_APPLE_X509=1
FRAMEWORK_VERSION = 4.5
XBUILD_VERSION = 4.0
+MONO_FEATURE_APPLETLS=1
NO_CONSOLE = yes
PROFILE_DISABLE_BTLS=1
+MONO_FEATURE_APPLETLS=1
+ONLY_APPLETLS=1
NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY=1
NO_SYSTEM_DESIGN_DEPENDENCY=1
NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY=1
-
PROFILE_DISABLE_BTLS=1
+MONO_FEATURE_APPLETLS=1
+ONLY_APPLETLS=1
ifndef NO_TEST
test_nunit_lib = nunitlite.dll
+xunit_core := xunit.core xunit.abstractions xunit.assert
+xunit_deps := System.Runtime
+xunit_class_deps := Xunit.NetCore.Extensions
+
+xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
+xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$(xunit_deps))
+
+xunit_libs_dep = $(xunit_class_deps:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%.dll)
+xunit_libs_ref += $(xunit_libs_dep:%=-r:%)
TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
+XTEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(XTEST_LIB_REFS))
test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)%)
test_nunit_ref = $(test_nunit_dep:%=-r:%)
endif
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
+
test_sourcefile_excludes = $(test_lib).exclude.sources
test_pdb = $(test_lib:.dll=.pdb)
test_flags = -r:$(the_assembly) $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
+xtest_sourcefile = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
+
+ifeq ($(wildcard $(xtest_sourcefile)),)
+xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
+endif
+
+xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
+
+xtest_response = $(depsdir)/$(xtest_lib).response
+xtest_makefrag = $(depsdir)/$(xtest_lib).makefrag
+xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS)
+
ifndef HAVE_CS_TESTS
HAVE_CS_TESTS := $(wildcard $(test_sourcefile))
endif
HAVE_SOURCE_EXCLUDES := $(wildcard $(test_sourcefile_excludes))
+HAVE_CS_XTESTS := $(wildcard $(xtest_sourcefile))
+
endif # !NO_TEST
ifndef NO_TEST
echo "stamp" >$@
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
+
+$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)Xunit.NetCore.Extensions.dll:
+ $(MAKE) -C $(topdir)/class/Xunit.NetCore.Extensions
+
endif
test_assemblies :=
endif
+
+ifdef HAVE_CS_XTESTS
+
+XTEST_HARNESS_PATH = $(topdir)/../external/xunit-binaries
+XTEST_HARNESS = $(XTEST_HARNESS_PATH)/xunit.console.exe
+XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit TestResult-$(PROFILE)-xunit.xml
+XTEST_TRAIT := -notrait category=failing -notrait category=nonnetcoreapptests -notrait Benchmark=true -notrait category=outerloop
+
+ifdef FIXTURE
+XTEST_HARNESS_FLAGS += -class $(FIXTURE)
+endif
+
+ifdef TESTNAME
+XTEST_HARNESS_FLAGS += -method $(TESTNAME)
+endif
+
+check: run-xunit-test-local
+run-xunit-test: run-xunit-test-local
+xunit-test-local: $(xunit_test_lib)
+run-xunit-test-local: run-xunit-test-lib
+
+# ln -s is a HACK for xunit runner to require xunit.execution.desktop.dll file in local folder on .net only
+run-xunit-test-lib: xunit-test-local
+ @ln -fs $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll
+ ok=:; \
+ PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
+ $$ok
+ @rm -f xunit.execution.desktop.dll
+
+$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep)
+ $(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response)
+
+xtest_response_preprocessed = $(xtest_response)_preprocessed
+
+# This handles .excludes/.sources pairs, as well as resolving the
+# includes that occur in .sources files
+$(xtest_response): $(xtest_sourcefile)
+ $(SHELL) $(topdir)/build/gensources.sh $@ '$(xtest_sourcefile)' '$(xtest_sourcefile_excludes)'
+
+$(xtest_makefrag): $(xtest_response)
+ @echo Creating $@ ...
+ @sed 's,^,$(xunit_test_lib): ,' $< >$@
+
+-include $(xtest_makefrag)
+
+endif
+
+
.PHONY: patch-nunitlite-appconfig
/lib
/compat/
+monolite-*.tar.gz
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
+package-monolite-latest:
+ MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
+ $(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
+ tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
+
dist-default: dist-monolite
dist-local: dist-default
yield return kvp.Value;
}
- public void RemoveProperty (BuildProperty propertyToRemove)
+ public void RemoveProperty (BuildProperty property)
{
- if (propertyToRemove == null)
- throw new ArgumentNullException ("propertyToRemove");
+ if (property == null)
+ throw new ArgumentNullException ("property");
if (FromXml) {
- if (!propertyToRemove.FromXml)
+ if (!property.FromXml)
throw new InvalidOperationException ("The specified property does not belong to the current property group.");
- propertyToRemove.XmlElement.ParentNode.RemoveChild (propertyToRemove.XmlElement);
- properties.Remove (propertyToRemove);
+ property.XmlElement.ParentNode.RemoveChild (property.XmlElement);
+ properties.Remove (property);
} else
- propertiesByName.Remove (propertyToRemove.Name);
+ propertiesByName.Remove (property.Name);
}
public void RemoveProperty (string propertyName)
return build_records.GetOrAdd (key, _ => new BuildRecord (this));
}
- public void BuildStartedHandler (object sender, BuildStartedEventArgs args)
+ public void BuildStartedHandler (object sender, BuildStartedEventArgs e)
{
- GetBuildRecord (sender).BuildStartedHandler (sender, args);
+ GetBuildRecord (sender).BuildStartedHandler (sender, e);
}
- public void BuildFinishedHandler (object sender, BuildFinishedEventArgs args)
+ public void BuildFinishedHandler (object sender, BuildFinishedEventArgs e)
{
- GetBuildRecord (sender).BuildFinishedHandler (args);
+ GetBuildRecord (sender).BuildFinishedHandler (e);
((IDictionary) build_records).Remove (sender);
}
{
GetBuildRecord (sender).PopEvent (args);
}
- public void ProjectStartedHandler (object sender, ProjectStartedEventArgs args)
+ public void ProjectStartedHandler (object sender, ProjectStartedEventArgs e)
{
- GetBuildRecord (sender).ProjectStartedHandler (args);
+ GetBuildRecord (sender).ProjectStartedHandler (e);
}
- public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs args)
+ public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs e)
{
- GetBuildRecord (sender).ProjectFinishedHandler (args);
+ GetBuildRecord (sender).ProjectFinishedHandler (e);
}
- public void TargetStartedHandler (object sender, TargetStartedEventArgs args)
+ public void TargetStartedHandler (object sender, TargetStartedEventArgs e)
{
- GetBuildRecord (sender).TargetStartedHandler (args);
+ GetBuildRecord (sender).TargetStartedHandler (e);
}
- public void TargetFinishedHandler (object sender, TargetFinishedEventArgs args)
+ public void TargetFinishedHandler (object sender, TargetFinishedEventArgs e)
{
- GetBuildRecord (sender).TargetFinishedHandler (args);
+ GetBuildRecord (sender).TargetFinishedHandler (e);
}
- public void TaskStartedHandler (object sender, TaskStartedEventArgs args)
+ public void TaskStartedHandler (object sender, TaskStartedEventArgs e)
{
- GetBuildRecord (sender).TaskStartedHandler (args);
+ GetBuildRecord (sender).TaskStartedHandler (e);
}
- public void TaskFinishedHandler (object sender, TaskFinishedEventArgs args)
+ public void TaskFinishedHandler (object sender, TaskFinishedEventArgs e)
{
- GetBuildRecord (sender).TaskFinishedHandler (args);
+ GetBuildRecord (sender).TaskFinishedHandler (e);
}
- public void MessageHandler (object sender, BuildMessageEventArgs args)
+ public void MessageHandler (object sender, BuildMessageEventArgs e)
{
- GetBuildRecord (sender).MessageHandler (args);
+ GetBuildRecord (sender).MessageHandler (e);
}
- public void WarningHandler (object sender, BuildWarningEventArgs args)
+ public void WarningHandler (object sender, BuildWarningEventArgs e)
{
- GetBuildRecord (sender).WarningHandler (args);
+ GetBuildRecord (sender).WarningHandler (e);
}
- public void ErrorHandler (object sender, BuildErrorEventArgs args)
+ public void ErrorHandler (object sender, BuildErrorEventArgs e)
{
- GetBuildRecord (sender).ErrorHandler (args);
+ GetBuildRecord (sender).ErrorHandler (e);
}
[MonoTODO]
- public void CustomEventHandler (object sender, CustomBuildEventArgs args)
+ public void CustomEventHandler (object sender, CustomBuildEventArgs e)
{
- build_records [sender].CustomHandler (args);
+ build_records [sender].CustomHandler (e);
}
void SetColor (ConsoleColor color)
}
[MonoTODO ("Not tested")]
- public void AddNewImport (string importLocation,
- string importCondition)
+ public void AddNewImport (string projectFile,
+ string condition)
{
- if (importLocation == null)
- throw new ArgumentNullException ("importLocation");
+ if (projectFile == null)
+ throw new ArgumentNullException ("projectFile");
XmlElement importElement = xmlDocument.CreateElement ("Import", XmlNamespace);
xmlDocument.DocumentElement.AppendChild (importElement);
- importElement.SetAttribute ("Project", importLocation);
- if (!String.IsNullOrEmpty (importCondition))
- importElement.SetAttribute ("Condition", importCondition);
+ importElement.SetAttribute ("Project", projectFile);
+ if (!String.IsNullOrEmpty (condition))
+ importElement.SetAttribute ("Condition", condition);
AddImport (importElement, null, false);
MarkProjectAsDirty ();
Load (projectFileName, ProjectLoadSettings.None);
}
- public void Load (string projectFileName, ProjectLoadSettings settings)
+ public void Load (string projectFileName, ProjectLoadSettings projectLoadSettings)
{
- project_load_settings = settings;
+ project_load_settings = projectLoadSettings;
if (String.IsNullOrEmpty (projectFileName))
throw new ArgumentNullException ("projectFileName");
[MonoTODO]
// NOTE: does not modify imported projects
- public void RemoveItemGroupsWithMatchingCondition (string matchingCondition)
+ public void RemoveItemGroupsWithMatchingCondition (string matchCondition)
{
throw new NotImplementedException ();
}
isDirty = false;
}
- public void Save (TextWriter outTextWriter)
+ public void Save (TextWriter textWriter)
{
- xmlDocument.Save (outTextWriter);
+ xmlDocument.Save (textWriter);
isDirty = false;
}
throw new NotImplementedException ();
}
- public void SetProjectExtensions (string id, string xmlText)
+ public void SetProjectExtensions (string id, string content)
{
if (id == null)
throw new ArgumentNullException ("id");
- if (xmlText == null)
- throw new ArgumentNullException ("xmlText");
+ if (content == null)
+ throw new ArgumentNullException ("content");
XmlNode projectExtensions, node;
xmlDocument.DocumentElement.AppendChild (projectExtensions);
node = xmlDocument.CreateElement (id, XmlNamespace);
- node.InnerXml = xmlText;
+ node.InnerXml = content;
projectExtensions.AppendChild (node);
} else {
node = xmlDocument.SelectSingleNode (String.Format ("/tns:Project/tns:ProjectExtensions/tns:{0}", id), XmlNamespaceManager);
projectExtensions.AppendChild (node);
}
- node.InnerXml = xmlText;
+ node.InnerXml = content;
}
}
// FIXME: shouldn't we remove it from XML?
- public void RemoveTask (BuildTask buildTask)
+ public void RemoveTask (BuildTask taskElement)
{
- if (buildTask == null)
- throw new ArgumentNullException ("buildTask");
- buildTasks.Remove (buildTask);
+ if (taskElement == null)
+ throw new ArgumentNullException ("taskElement");
+ buildTasks.Remove (taskElement);
}
bool Build ()
get { return Line == 0 ? File : String.Format ("{0} ({1}{2})", File, Line, Column != 0 ? "," + Column : String.Empty); }
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var o = other as ElementLocation;
+ var o = obj as ElementLocation;
return (object) o != null && o.File == File && o.Line == Line && o.Column == Column;
}
+ "{data.Items.Count} #Targets={data.Targets.Count}")]
public class Project
{
- public Project (XmlReader xml)
- : this (ProjectRootElement.Create (xml))
+ public Project (XmlReader xmlReader)
+ : this (ProjectRootElement.Create (xmlReader))
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion)
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion, projectCollection)
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection, loadSettings)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion, projectCollection, loadSettings)
{
}
{
public class ProjectCollection : IDisposable
{
- public delegate void ProjectAddedEventHandler (object target, ProjectAddedToProjectCollectionEventArgs args);
+ public delegate void ProjectAddedEventHandler (object sender, ProjectAddedToProjectCollectionEventArgs e);
public class ProjectAddedToProjectCollectionEventArgs : EventArgs
{
- public ProjectAddedToProjectCollectionEventArgs (ProjectRootElement project)
+ public ProjectAddedToProjectCollectionEventArgs (ProjectRootElement element)
{
- if (project == null)
+ if (element == null)
throw new ArgumentNullException ("project");
- ProjectRootElement = project;
+ ProjectRootElement = element;
}
public ProjectRootElement ProjectRootElement { get; private set; }
{
}
- public ProjectCollection (ToolsetDefinitionLocations toolsetDefinitionLocations)
- : this (null, null, toolsetDefinitionLocations)
+ public ProjectCollection (ToolsetDefinitionLocations toolsetLocations)
+ : this (null, null, toolsetLocations)
{
}
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
<Name>System-net_4_x</Name>\r
</ProjectReference>\r
- <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
+ <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+ <Name>Mono.Cecil-net_4_x</Name>\r
+ </ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
<Folder Include="Properties\" />\r
LIBRARY_SNK = ../mono.snk
LIBRARY_PACKAGE = none
-LIB_REFS = System.Core
+LIB_REFS = System.Core System
LIB_MCS_FLAGS = -keyfile:$(LIBRARY_SNK) -d:NET_4_0 /publicsign
NO_TEST = yes
<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
<PropertyGroup>\r
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
<DebugType>full</DebugType>\r
<NoWarn>1699</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;NET_4_0</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>1699</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;NET_4_0</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\Code.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\CodeReader.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\CodeWriter.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\Document.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\ExceptionHandler.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\ILProcessor.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\Instruction.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\MethodBody.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\OpCode.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\OpCodes.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\SequencePoint.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\Symbols.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\VariableDefinition.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\VariableReference.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\BlobHeap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\Buffers.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\CodedIndex.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\ElementType.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\GuidHeap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\Heap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\MetadataToken.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\Row.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\StringHeap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\TableHeap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\TokenType.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\UserStringHeap.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\Utilities.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\BinaryStreamReader.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\BinaryStreamWriter.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\ByteBuffer.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\ByteBufferEqualityComparer.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\DataDirectory.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\Image.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\ImageReader.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\ImageWriter.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\Section.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\TextMap.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\*.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\*.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\*.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\ArrayType.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyDefinition.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyFlags.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\SecurityDeclaration.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\SentinelType.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TargetRuntime.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Cecil\Treatments.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeAttributes.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinition.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinitionCollection.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSpecification.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSystem.cs" />\r
<Compile Include="..\..\..\external\cecil\Mono.Cecil\VariantType.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Collections.Generic\Collection.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Collections.Generic\ReadOnlyCollection.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\CryptoConvert.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\CryptoService.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono\Actions.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono\Empty.cs" />\r
- <Compile Include="..\..\..\external\cecil\Mono\Funcs.cs" />\r
- <Compile Include="..\..\..\external\cecil\System.Runtime.CompilerServices\ExtensionAttribute.cs" />\r </ItemGroup>\r
+ <Compile Include="..\..\..\external\cecil\Mono.Cecil\WindowsRuntimeProjections.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Collections.Generic\*.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\*.cs" />\r
+ <Compile Include="..\..\..\external\cecil\Mono\*.cs" />\r
+ <Compile Include="..\..\..\external\cecil\ProjectInfo.cs" />\r
+ <Compile Include="..\..\..\external\cecil\System.Security.Cryptography\*.cs" />\r
+ <Compile Include="Consts.cs" />\r </ItemGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
<Target Name="BeforeBuild">\r
<Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
<Name>System.Core-net_4_x</Name>\r
</ProjectReference>\r
+ <ProjectReference Include="../System/System-net_4_x.csproj">\r
+ <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
+ <Name>System-net_4_x</Name>\r
+ </ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
<Folder Include="Properties\" />\r
../../../external/cecil/Mono.Cecil.PE/*.cs
../../../external/cecil/Mono.Collections.Generic/*.cs
../../../external/cecil/Mono.Security.Cryptography/*.cs
-../../../external/cecil/System.Security.Cryptography/*.cs
../../../external/cecil/Mono.Cecil/ArrayType.cs
../../../external/cecil/Mono.Cecil/AssemblyDefinition.cs
<Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
<Name>System.Core-net_4_x</Name>\r
</ProjectReference>\r
- <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
+ <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+ <Name>Mono.Cecil-net_4_x</Name>\r
+ </ProjectReference>\r
<ProjectReference Include="../Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj">\r
<Project>{CF14D34A-F69B-47FB-A99C-D25C77198F30}</Project>\r
<Name>Mono.Cecil.Mdb-net_4_x</Name>\r
}
try {
- socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ socket = new Socket (endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
IAsyncResult ares = socket.BeginConnect (endPoint, null, null);
int timeout_ms = timeout * 1000;
if (timeout > 0 && !ares.IsCompleted && !ares.AsyncWaitHandle.WaitOne (timeout_ms, false))
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
<Name>System-net_4_x</Name>\r
</ProjectReference>\r
- <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
+ <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+ <Name>Mono.Cecil-net_4_x</Name>\r
+ </ProjectReference>\r
<ProjectReference Include="../System.Core/System.Core-net_4_x.csproj">\r
<Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
<Name>System.Core-net_4_x</Name>\r
res.Add (attr);
return res.ToArray ();
}
+
+ public string FullName {
+ get {
+ string type_namespace = DeclaringType.Namespace;
+ string type_name = DeclaringType.Name;
+ StringBuilder sb = new StringBuilder ();
+ if (type_namespace != String.Empty)
+ sb.Append (type_namespace).Append (".");
+ sb.Append (type_name);
+ sb.Append (":");
+ sb.Append (Name);
+ return sb.ToString ();
+ }
+ }
}
}
+++ /dev/null
-namespace Mono.Security.Interface
-{
- delegate MonoTlsProvider MonoTlsProviderFactoryDelegate ();
-
- static partial class MonoTlsProviderFactory
- {
- internal static MonoTlsProviderFactoryDelegate _PrivateFactoryDelegate;
- }
-}
#include Mono.Security.dll.sources
../corlib/CommonCrypto/CommonCrypto.cs
../corlib/CommonCrypto/RC4CommonCrypto.cs
-Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in" />\r
+ <Compile Include="..\..\build\common\Consts.cs" />\r
<Compile Include="Novell.Directory.Ldap.Asn1\Asn1Boolean.cs" />\r
<Compile Include="Novell.Directory.Ldap.Asn1\Asn1Choice.cs" />\r
<Compile Include="Novell.Directory.Ldap.Asn1\Asn1Decoder.cs" />\r
Novell.Directory.Ldap/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
Novell.Directory.Ldap/SupportClass.cs
Novell.Directory.Ldap.Utilclass/Base64.cs
Novell.Directory.Ldap.Utilclass/DN.cs
return host.CreateDeprecatedConfigContext (configPath);
}
- public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
+ public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
- return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
+ return host.DecryptSection (encryptedXml, protectionProvider, protectedConfigSection);
}
public virtual void DeleteStream (string streamName)
host.DeleteStream (streamName);
}
- public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
+ public virtual string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
- return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
+ return host.EncryptSection (clearTextXml, protectionProvider, protectedConfigSection);
}
- public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
+ public virtual string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath)
{
- return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
+ return host.GetConfigPathFromLocationSubPath (configPath, locationSubPath);
}
public virtual Type GetConfigType (string typeName, bool throwOnError)
return host.Impersonate ();
}
- public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
+ public virtual void Init (IInternalConfigRoot configRoot, params object[] hostInitParams)
{
- host.Init (root, hostInitParams);
+ host.Init (configRoot, hostInitParams);
}
- public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
+ public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams)
{
- host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
+ host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, configRoot, hostInitConfigurationParams);
}
public virtual bool IsAboveApplication (string configPath)
{
object CreateConfigurationContext (string configPath, string locationSubPath);
object CreateDeprecatedConfigContext (string configPath);
- string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
+ string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
void DeleteStream (string streamName);
- string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
- string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath);
+ string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
+ string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath);
Type GetConfigType (string typeName, bool throwOnError);
string GetConfigTypeName (Type t);
void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady);
string GetStreamNameForConfigSource (string streamName, string configSource);
object GetStreamVersion (string streamName);
IDisposable Impersonate ();
- void Init (IInternalConfigRoot root, params object[] hostInitParams);
- void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams);
+ void Init (IInternalConfigRoot configRoot, params object[] hostInitParams);
+ void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams);
bool IsAboveApplication (string configPath);
bool IsConfigRecordRequired (string configPath);
bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition);
[MonoTODO]
protected internal override string SerializeSection (
- ConfigurationElement parent, string name, ConfigurationSaveMode mode)
+ ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
{
if (File == "") {
- return base.SerializeSection (parent, name, mode);
+ return base.SerializeSection (parentElement, name, saveMode);
}
else {
throw new NotImplementedException ();
get { return RootSectionGroup.Sections; }
}
- public ConfigurationSection GetSection (string path)
+ public ConfigurationSection GetSection (string sectionName)
{
- string[] parts = path.Split ('/');
+ string[] parts = sectionName.Split ('/');
if (parts.Length == 1)
return Sections [parts[0]];
return null;
}
- public ConfigurationSectionGroup GetSectionGroup (string path)
+ public ConfigurationSectionGroup GetSectionGroup (string sectionGroupName)
{
- string[] parts = path.Split ('/');
+ string[] parts = sectionGroupName.Split ('/');
ConfigurationSectionGroup group = SectionGroups [parts[0]];
for (int n=1; group != null && n<parts.Length; n++)
group = group.SectionGroups [parts [n]];
Save (ConfigurationSaveMode.Modified, false);
}
- public void Save (ConfigurationSaveMode mode)
+ public void Save (ConfigurationSaveMode saveMode)
{
- Save (mode, false);
+ Save (saveMode, false);
}
- public void Save (ConfigurationSaveMode mode, bool forceUpdateAll)
+ public void Save (ConfigurationSaveMode saveMode, bool forceSaveAll)
{
- if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
+ if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
if (saveStart != null)
saveStart (this, new ConfigurationSaveEventArgs (streamName, true, null, ctx));
- Save (stream, mode, forceUpdateAll);
+ Save (stream, saveMode, forceSaveAll);
system.Host.WriteCompleted (streamName, true, ctx);
} catch (Exception ex) {
saveEx = ex;
SaveAs (filename, ConfigurationSaveMode.Modified, false);
}
- public void SaveAs (string filename, ConfigurationSaveMode mode)
+ public void SaveAs (string filename, ConfigurationSaveMode saveMode)
{
- SaveAs (filename, mode, false);
+ SaveAs (filename, saveMode, false);
}
[MonoInternalNote ("Detect if file has changed")]
- public void SaveAs (string filename, ConfigurationSaveMode mode, bool forceUpdateAll)
+ public void SaveAs (string filename, ConfigurationSaveMode saveMode, bool forceSaveAll)
{
- if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
+ if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
string dir = Path.GetDirectoryName (Path.GetFullPath (filename));
if (!Directory.Exists (dir))
Directory.CreateDirectory (dir);
- Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), mode, forceUpdateAll);
+ Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), saveMode, forceSaveAll);
}
void Save (Stream stream, ConfigurationSaveMode mode, bool forceUpdateAll)
}
[MonoTODO]
- protected virtual void ListErrors (IList list)
+ protected virtual void ListErrors (IList errorList)
{
throw new NotImplementedException ();
}
return defaultCollection;
}
- protected internal object this [ConfigurationProperty property] {
- get { return this [property.Name]; }
- set { this [property.Name] = value; }
+ protected internal object this [ConfigurationProperty prop] {
+ get { return this [prop.Name]; }
+ set { this [prop.Name] = value; }
}
- protected internal object this [string property_name] {
+ protected internal object this [string propertyName] {
get {
- PropertyInformation pi = ElementInformation.Properties [property_name];
+ PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
- throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
+ throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
return pi.Value;
}
set {
- PropertyInformation pi = ElementInformation.Properties [property_name];
+ PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
- throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
+ throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
SetPropertyValue (pi.Property, value, false);
return false;
}
- protected virtual bool OnDeserializeUnrecognizedElement (string element, XmlReader reader)
+ protected virtual bool OnDeserializeUnrecognizedElement (string elementName, XmlReader reader)
{
return false;
}
}
protected internal virtual void Unmerge (
- ConfigurationElement source, ConfigurationElement parent,
- ConfigurationSaveMode updateMode)
+ ConfigurationElement sourceElement, ConfigurationElement parentElement,
+ ConfigurationSaveMode saveMode)
{
- if (parent != null && source.GetType() != parent.GetType())
+ if (parentElement != null && sourceElement.GetType() != parentElement.GetType())
throw new ConfigurationErrorsException ("Can't unmerge two elements of different type");
- bool isMinimalOrModified = updateMode == ConfigurationSaveMode.Minimal ||
- updateMode == ConfigurationSaveMode.Modified;
+ bool isMinimalOrModified = saveMode == ConfigurationSaveMode.Minimal ||
+ saveMode == ConfigurationSaveMode.Modified;
- foreach (PropertyInformation prop in source.ElementInformation.Properties)
+ foreach (PropertyInformation prop in sourceElement.ElementInformation.Properties)
{
if (prop.ValueOrigin == PropertyValueOrigin.Default)
continue;
PropertyInformation unmergedProp = ElementInformation.Properties [prop.Name];
object sourceValue = prop.Value;
- if (parent == null || !parent.HasValue (prop.Name)) {
+ if (parentElement == null || !parentElement.HasValue (prop.Name)) {
unmergedProp.Value = sourceValue;
continue;
}
if (sourceValue == null)
continue;
- object parentValue = parent [prop.Name];
+ object parentValue = parentElement [prop.Name];
if (!prop.IsElement) {
if (!object.Equals (sourceValue, parentValue) ||
- (updateMode == ConfigurationSaveMode.Full) ||
- (updateMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
+ (saveMode == ConfigurationSaveMode.Full) ||
+ (saveMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
unmergedProp.Value = sourceValue;
continue;
}
- var sourceElement = (ConfigurationElement) sourceValue;
- if (isMinimalOrModified && !sourceElement.IsModified ())
+ var sourceElementValue = (ConfigurationElement) sourceValue;
+ if (isMinimalOrModified && !sourceElementValue.IsModified ())
continue;
if (parentValue == null) {
unmergedProp.Value = sourceValue;
continue;
}
- var parentElement = (ConfigurationElement) parentValue;
+ var parentElementValue = (ConfigurationElement) parentValue;
ConfigurationElement copy = (ConfigurationElement) unmergedProp.Value;
- copy.Unmerge (sourceElement, parentElement, updateMode);
+ copy.Unmerge (sourceElementValue, parentElementValue, saveMode);
}
}
return false;
}
- protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode updateMode)
+ protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
{
ConfigurationElementCollection source = (ConfigurationElementCollection) sourceElement;
ConfigurationElementCollection parent = (ConfigurationElementCollection) parentElement;
object key = source.GetElementKey (sitem);
ConfigurationElement pitem = parent != null ? parent.BaseGet (key) as ConfigurationElement : null;
ConfigurationElement nitem = CreateNewElementInternal (null);
- if (pitem != null && updateMode != ConfigurationSaveMode.Full) {
- nitem.Unmerge (sitem, pitem, updateMode);
- if (nitem.HasValues (pitem, updateMode))
+ if (pitem != null && saveMode != ConfigurationSaveMode.Full) {
+ nitem.Unmerge (sitem, pitem, saveMode);
+ if (nitem.HasValues (pitem, saveMode))
BaseAdd (nitem);
} else {
nitem.Unmerge (sitem, null, ConfigurationSaveMode.Full);
}
}
- if (updateMode == ConfigurationSaveMode.Full)
+ if (saveMode == ConfigurationSaveMode.Full)
EmitClear = true;
else if (parent != null) {
for (int n=0; n<parent.Count; n++) {
: this (name, type, NoDefaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
- public ConfigurationProperty (string name, Type type, object default_value)
- : this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
+ public ConfigurationProperty (string name, Type type, object defaultValue)
+ : this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- ConfigurationPropertyOptions flags)
- :this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), flags, null)
+ string name, Type type, object defaultValue,
+ ConfigurationPropertyOptions options)
+ :this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), options, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- TypeConverter converter,
- ConfigurationValidatorBase validation,
- ConfigurationPropertyOptions flags)
- : this (name, type, default_value, converter, validation, flags, null)
+ string name, Type type, object defaultValue,
+ TypeConverter typeConverter,
+ ConfigurationValidatorBase validator,
+ ConfigurationPropertyOptions options)
+ : this (name, type, defaultValue, typeConverter, validator, options, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- TypeConverter converter,
- ConfigurationValidatorBase validation,
- ConfigurationPropertyOptions flags,
+ string name, Type type, object defaultValue,
+ TypeConverter typeConverter,
+ ConfigurationValidatorBase validator,
+ ConfigurationPropertyOptions options,
string description)
{
this.name = name;
- this.converter = converter != null ? converter : TypeDescriptor.GetConverter (type);
- if (default_value != null) {
- if (default_value == NoDefaultValue) {
+ this.converter = typeConverter != null ? typeConverter : TypeDescriptor.GetConverter (type);
+ if (defaultValue != null) {
+ if (defaultValue == NoDefaultValue) {
switch (Type.GetTypeCode (type)) {
case TypeCode.Object:
- default_value = null;
+ defaultValue = null;
break;
case TypeCode.String:
- default_value = String.Empty;
+ defaultValue = String.Empty;
break;
default:
- default_value = Activator.CreateInstance (type);
+ defaultValue = Activator.CreateInstance (type);
break;
}
}
else
- if (!type.IsAssignableFrom (default_value.GetType ())) {
- if (!this.converter.CanConvertFrom (default_value.GetType ()))
+ if (!type.IsAssignableFrom (defaultValue.GetType ())) {
+ if (!this.converter.CanConvertFrom (defaultValue.GetType ()))
throw new ConfigurationErrorsException (String.Format ("The default value for property '{0}' has a different type than the one of the property itself: expected {1} but was {2}",
- name, type, default_value.GetType ()));
+ name, type, defaultValue.GetType ()));
- default_value = this.converter.ConvertFrom (default_value);
+ defaultValue = this.converter.ConvertFrom (defaultValue);
}
}
- this.default_value = default_value;
- this.flags = flags;
+ this.default_value = defaultValue;
+ this.flags = options;
this.type = type;
- this.validation = validation != null ? validation : new DefaultValidator ();
+ this.validation = validator != null ? validator : new DefaultValidator ();
this.description = description;
}
}
[MonoTODO]
- public void ForceDeclaration (bool require)
+ public void ForceDeclaration (bool force)
{
- this.require_declaration = require;
+ this.require_declaration = force;
}
public void ForceDeclaration ()
{
}
- public new ConnectionStringSettings this [string Name]
+ public new ConnectionStringSettings this [string name]
{
get {
foreach (ConfigurationElement c in this) {
if (!(c is ConnectionStringSettings))
continue;
- if (string.Compare(((ConnectionStringSettings) c).Name, Name, true,
+ if (string.Compare(((ConnectionStringSettings) c).Name, name, true,
System.Globalization.CultureInfo.InvariantCulture) == 0)
return c as ConnectionStringSettings;
Protection API, and is unimplemented in Mono. For portability's sake,
it is suggested that you use the RsaProtectedConfigurationProvider.";
[MonoNotSupported (NotSupportedReason)]
- public override XmlNode Decrypt (XmlNode encrypted_node)
+ public override XmlNode Decrypt (XmlNode encryptedNode)
{
throw new NotSupportedException (NotSupportedReason);
}
return false;
}
- protected internal override void DeserializeSection (XmlReader reader)
+ protected internal override void DeserializeSection (XmlReader xmlReader)
{
- xml = reader.ReadOuterXml ();
+ xml = xmlReader.ReadOuterXml ();
}
[MonoTODO]
- protected internal override void Reset (ConfigurationElement parentElement)
+ protected internal override void Reset (ConfigurationElement parentSection)
{
- base.Reset (parentElement);
+ base.Reset (parentSection);
}
[MonoTODO]
base.ResetModified ();
}
- protected internal override string SerializeSection (ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
+ protected internal override string SerializeSection (ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode)
{
return xml;
}
CheckFileMap (level, map);
- if (locationSubPath == null)
+ if (locationSubPath == null) {
switch (level) {
case ConfigurationUserLevel.PerUserRoaming:
if (map.RoamingUserConfigFilename == null)
locationSubPath = "local";
break;
}
-
- configPath = null;
- string next = null;
-
- locationConfigPath = null;
+ }
if (locationSubPath == "exe" || locationSubPath == null && map.ExeConfigFilename != null) {
configPath = "exe";
- next = "machine";
+ locationSubPath = "machine";
locationConfigPath = map.ExeConfigFilename;
+ return;
}
if (locationSubPath == "local" && map.LocalUserConfigFilename != null) {
configPath = "local";
- next = "roaming";
+ locationSubPath = "roaming";
locationConfigPath = map.LocalUserConfigFilename;
+ return;
}
if (locationSubPath == "roaming" && map.RoamingUserConfigFilename != null) {
configPath = "roaming";
- next = "exe";
+ locationSubPath = "exe";
locationConfigPath = map.RoamingUserConfigFilename;
+ return;
}
- if ((locationSubPath == "machine" || configPath == null) && map.MachineConfigFilename != null) {
+ if (locationSubPath == "machine" && map.MachineConfigFilename != null) {
configPath = "machine";
- next = null;
+ locationSubPath = null;
+ locationConfigPath = null;
+ return;
}
- locationSubPath = next;
+
+ throw new NotImplementedException ();
}
}
{
}
- public abstract XmlNode Decrypt (XmlNode encrypted_node);
+ public abstract XmlNode Decrypt (XmlNode encryptedNode);
public abstract XmlNode Encrypt (XmlNode node);
}
[MonoTODO]
protected internal override void Unmerge (
- ConfigurationElement source, ConfigurationElement parent,
- ConfigurationSaveMode updateMode)
+ ConfigurationElement sourceElement, ConfigurationElement parentElement,
+ ConfigurationSaveMode saveMode)
{
- base.Unmerge (source, parent, updateMode);
+ base.Unmerge (sourceElement, parentElement, saveMode);
}
[ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
return ((ProviderSettings)element).Name;
}
- public void Remove (string key)
+ public void Remove (string name)
{
- BaseRemove (key);
+ BaseRemove (name);
}
- public ProviderSettings this [int n]
+ public ProviderSettings this [int index]
{
- get { return (ProviderSettings) BaseGet (n); }
- set { BaseAdd (n, value); }
+ get { return (ProviderSettings) BaseGet (index); }
+ set { BaseAdd (index, value); }
}
public new ProviderSettings this [string key]
}
[MonoTODO]
- public override XmlNode Decrypt (XmlNode encrypted_node)
+ public override XmlNode Decrypt (XmlNode encryptedNode)
{
XmlDocument doc = new ConfigurationXmlDocument ();
- doc.Load (new StringReader (encrypted_node.OuterXml));
+ doc.Load (new StringReader (encryptedNode.OuterXml));
EncryptedXml ex = new EncryptedXml (doc);
return raw_xml;
}
- public void ProtectSection (string provider)
+ public void ProtectSection (string protectionProvider)
{
- protection_provider = ProtectedConfiguration.GetProvider (provider, true);
+ protection_provider = ProtectedConfiguration.GetProvider (protectionProvider, true);
}
[MonoTODO]
- public void ForceDeclaration (bool require)
+ public void ForceDeclaration (bool force)
{
}
protection_provider = null;
}
- public void SetRawXml (string xml)
+ public void SetRawXml (string rawXml)
{
- raw_xml = xml;
+ raw_xml = rawXml;
}
[MonoTODO]
using System.IO;
namespace System.Configuration {
- public delegate void ValidatorCallback (object o);
+ public delegate void ValidatorCallback (object value);
}
using System.Security.AccessControl;
using System.Security.Permissions;
using System.Security.Principal;
+using System.IO.MemoryMappedFiles;
namespace Microsoft.Win32.SafeHandles
{
handle = preexistingHandle;
}
- [MonoTODO]
protected override bool ReleaseHandle ()
{
- throw new NotImplementedException ();
+ MemoryMapImpl.CloseMapping (handle);
+ handle = IntPtr.Zero;
+ return true;
}
}
}
<Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECKeyXmlFormat.cs" />\r
<Compile Include="..\referencesource\System.Core\System\Security\Cryptography\NCryptNative.cs" />\r
<Compile Include="..\referencesource\System.Core\System\Security\Cryptography\RsaCng.cs" />\r
+ <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\X509Certificates\TrustStatus.cs" />\r
<Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\LockRecursionException.cs" />\r
<Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs" />\r
<Compile Include="..\referencesource\System.Core\System\threading\Tasks\TaskExtensions.cs" />\r
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
-
namespace System.IO.MemoryMappedFiles
{
internal static class MemoryMapImpl {
}
}
-
public class MemoryMappedFile : IDisposable {
// MemoryMappedFileAccess fileAccess;
// string name;
//
FileStream stream;
bool keepOpen;
- IntPtr handle;
+ SafeMemoryMappedFileHandle handle;
public static MemoryMappedFile CreateFromFile (string path)
{
IntPtr handle = MemoryMapImpl.OpenFile (path, mode, null, out capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None);
return new MemoryMappedFile () {
- handle = handle,
+ handle = new SafeMemoryMappedFileHandle (handle, true),
// fileAccess = MemoryMappedFileAccess.ReadWrite,
// fileCapacity = capacity
};
IntPtr handle = MemoryMapImpl.OpenFile (path, mode, mapName, out capacity, access, MemoryMappedFileOptions.None);
return new MemoryMappedFile () {
- handle = handle,
+ handle = new SafeMemoryMappedFileHandle (handle, true),
// fileAccess = access,
// name = mapName,
// fileCapacity = capacity
MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
return new MemoryMappedFile () {
- handle = handle,
+ handle = new SafeMemoryMappedFileHandle (handle, true),
// fileAccess = access,
// name = mapName,
// fileCapacity = capacity,
MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
return new MemoryMappedFile () {
- handle = handle,
+ handle = new SafeMemoryMappedFileHandle (handle, true),
// fileAccess = access,
// name = mapName,
// fileCapacity = capacity,
IntPtr handle = MemoryMapImpl.OpenFile (null, mode, mapName, out capacity, access, options);
return new MemoryMappedFile () {
- handle = handle,
+ handle = new SafeMemoryMappedFileHandle (handle, true),
// fileAccess = access,
// name = mapName,
// fileCapacity = capacity
public MemoryMappedViewStream CreateViewStream (long offset, long size, MemoryMappedFileAccess access)
{
- var view = MemoryMappedView.Create (handle, offset, size, access);
+ var view = MemoryMappedView.Create (handle.DangerousGetHandle (), offset, size, access);
return new MemoryMappedViewStream (view);
}
public MemoryMappedViewAccessor CreateViewAccessor (long offset, long size, MemoryMappedFileAccess access)
{
- var view = MemoryMappedView.Create (handle, offset, size, access);
+ var view = MemoryMappedView.Create (handle.DangerousGetHandle (), offset, size, access);
return new MemoryMappedViewAccessor (view);
}
protected virtual void Dispose (bool disposing)
{
- if (disposing){
- if (stream != null){
+ if (disposing) {
+ if (stream != null) {
if (keepOpen == false)
stream.Close ();
stream = null;
}
- if (handle != IntPtr.Zero) {
- MemoryMapImpl.CloseMapping (handle);
- handle = IntPtr.Zero;
- }
+ }
+ if (handle != null) {
+ handle.Dispose ();
+ handle = null;
}
}
KeyValue = KeyBuilder.Key (KeySizeValue >> 3);
}
- public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV)
+ public override ICryptoTransform CreateDecryptor (byte[] key, byte[] iv)
{
if ((Mode == CipherMode.CFB) && (FeedbackSize > 64))
throw new CryptographicException ("CFB with Feedbaack > 64 bits");
- return new AesTransform (this, false, rgbKey, rgbIV);
+ return new AesTransform (this, false, key, iv);
}
- public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV)
+ public override ICryptoTransform CreateEncryptor (byte[] key, byte[] iv)
{
if ((Mode == CipherMode.CFB) && (FeedbackSize > 64))
throw new CryptographicException ("CFB with Feedbaack > 64 bits");
- return new AesTransform (this, true, rgbKey, rgbIV);
+ return new AesTransform (this, true, key, iv);
}
// I suppose some attributes differs ?!? because this does not look required
[Test]
public void CallNullableGetValueOrDefault () // #568989
{
+#if MOBILE
+ // ensure that int?.GetValueOrDefault won't be removed by the linker
+ Assert.AreEqual (0, ((int?)0).GetValueOrDefault (3));
+#endif
+
var value = Expression.Parameter (typeof (int?), "value");
var default_parameter = Expression.Parameter (typeof (int), "default");
System.Security.Cryptography/SHA384CryptoServiceProvider.cs
System.Security.Cryptography/SHA512CryptoServiceProvider.cs
+../referencesource/System.Core/System/Security/Cryptography/X509Certificates/TrustStatus.cs
+
../../../external/corefx/src/System.Collections/src/System/Collections/Generic/BitHelper.cs
../../../external/corefx/src/System.Collections/src/System/Collections/Generic/HashSet.cs
../../../external/corefx/src/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/IRuntimeVariables.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuleCache.cs
-../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuntimeOps.ExpressionQuoter.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuntimeOps.RuntimeVariableList.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuntimeOps.MergedRuntimeVariables.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuntimeOps.RuntimeVariables.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.cs
../../../external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/VariableBinder.cs
+
+../../../external/corefx/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/RuntimeOps.ExpressionQuoter.cs
/// </summary>\r
/// <param name="connectionString">specifies file or server connection</param>\r
[DbLinqToDo]\r
- public DataContext(string connectionString)\r
+ public DataContext(string fileOrServerOrConnection)\r
{\r
Profiler.At("START DataContext(string)");\r
- IVendor ivendor = GetVendor(ref connectionString);\r
+ IVendor ivendor = GetVendor(ref fileOrServerOrConnection);\r
\r
- IDbConnection dbConnection = ivendor.CreateDbConnection(connectionString);\r
+ IDbConnection dbConnection = ivendor.CreateDbConnection(fileOrServerOrConnection);\r
Init(new DatabaseContext(dbConnection), null, ivendor);\r
\r
Profiler.At("END DataContext(string)");\r
-//
+//
// System.Data.OracleClient.OracleCommandBuilder.cs
//
// based on the SqlCommandBuilder in mcs/class/System.Data/System.Data.SqlClient
}
[MonoTODO]
- protected override void ApplyParameterInfo (DbParameter dbParameter,
- DataRow row,
+ protected override void ApplyParameterInfo (DbParameter parameter,
+ DataRow datarow,
StatementType statementType,
bool whereClause)
{
}
[MonoTODO]
- protected override string GetParameterName (int position)
+ protected override string GetParameterName (int parameterOrdinal)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- protected override string GetParameterPlaceholder (int position)
+ protected override string GetParameterPlaceholder (int parameterOrdinal)
{
throw new NotImplementedException ();
}
$(wildcard Test/System.Data/schemas/*.xsd) \
Test/test-config-file \
Test/System.Data/binserialize/*.bin \
+ Test/ProviderTests/sql/*.sql \
SqliteTest.db \
corefx.common.sources
ConnectionString = connectionString;
}
- public SqlConnection (string connectionString, SqlCredential cred)
+ public SqlConnection (string connectionString, SqlCredential credential)
{
ConnectionString = connectionString;
- Credentials = cred;
+ Credentials = credential;
}
#endregion // Constructors
#region Constructors
- public SqlCredential (string user, SecureString password)
+ public SqlCredential (string userId, SecureString password)
{
- if (user == null)
- throw new ArgumentNullException("UserID");
+ if (userId == null)
+ throw new ArgumentNullException("userId");
if (password == null)
- throw new ArgumentNullException("Password");
- this.uid = user;
+ throw new ArgumentNullException("password");
+ this.uid = userId;
this.pwd = password;
}
Mono.Data.SqlExpressions/DataColumnExpressionTest.cs
Mono.Data.SqlExpressions/DateComparisonTest.cs
+ProviderTests/Common/ConnectionConfig.cs
+ProviderTests/Common/ConnectionManager.cs
+ProviderTests/Common/DBHelper.cs
+ProviderTests/Common/DataProvider.cs
+ProviderTests/Common/EngineConfig.cs
+ProviderTests/Common/EngineType.cs
+ProviderTests/Common/ProviderTestsConfigurationHandler.cs
+ProviderTests/System.Data.Odbc/OdbcCommandBuilderTest.cs
+ProviderTests/System.Data.Odbc/OdbcCommandTest.cs
+ProviderTests/System.Data.Odbc/OdbcDataReaderTest.cs
+ProviderTests/System.Data.Odbc/OdbcDataAdapterTest.cs
+ProviderTests/System.Data.Odbc/OdbcParameterTest.cs
+ProviderTests/System.Data.Odbc/OdbcParameterCollectionTest.cs
+ProviderTests/ProviderIndependant/DataReaderTest.cs
+ProviderTests/ProviderIndependant/DbDataReaderTest.cs
+ProviderTests/ProviderIndependant/IDbCommandTest.cs
+ProviderTests/System.Data.SqlClient/SqlClientFactoryTest.cs
+ProviderTests/System.Data.SqlClient/SqlCommandBuilderTest.cs
+ProviderTests/System.Data.SqlClient/SqlCommandTest.cs
+ProviderTests/System.Data.SqlClient/SqlDataReaderTest.cs
+ProviderTests/System.Data.SqlClient/SqlDataAdapterTest.cs
+ProviderTests/System.Data.SqlClient/SqlTransactionTest.cs
+ProviderTests/System.Data.SqlClient/SqlConnectionStringBuilderTest.cs
+ProviderTests/System.Data.SqlClient/SqlConnectionTest.cs
+ProviderTests/System.Data.SqlClient/SqlParameterTest.cs
+ProviderTests/System.Data.SqlClient/SqlParameterCollectionTest.cs
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_CONFIGURATION
+
using System;
using System.Collections;
using System.Configuration;
using System.Globalization;
using System.Xml;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
internal sealed class ConnectionConfig
{
}
}
}
+
+#endif
\ No newline at end of file
// SOFTWARE.
using System;
-using System.Configuration;
+using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+#if !NO_ODBC
+using System.Data.Odbc;
+#endif
+using System.Data.SqlClient;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using NUnit.Framework;
-
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
public class ConnectionManager
{
- private static ConnectionManager Instance;
- private DbConnection _connection;
- private string _connectionString;
- private EngineConfig _engine;
+ private static ConnectionManager instance;
+ private ConnectionHolder<SqlConnection> sql;
+
+ private const string OdbcEnvVar = "SYSTEM_DATA_ODBC";
+ private const string SqlEnvVar = "SYSTEM_DATA_MSSQL";
- static ConnectionManager ()
+ private ConnectionManager ()
{
- Instance = new ConnectionManager ();
+ //Environment.SetEnvironmentVariable(OdbcEnvVar, @"Driver={MySQL ODBC 5.3 Unicode Driver};server=127.0.0.1;uid=sa;pwd=qwerty123;";
+ //Environment.SetEnvironmentVariable(SqlEnvVar, @"server=127.0.0.1;database=master;user id=sa;password=qwerty123";
+
+ // Generate a random db name
+ DatabaseName = "monotest" + Guid.NewGuid().ToString().Substring(0, 7);
+
+ sql = CreateSqlConfig (SqlEnvVar);
+ if (sql != null)
+ CreateMssqlDatabase();
+
+#if !NO_ODBC
+ odbc = CreateOdbcConfig (OdbcEnvVar);
+ if (odbc != null)
+ CreateMysqlDatabase();
+#endif
}
- private ConnectionManager ()
+ static ConnectionHolder<SqlConnection> CreateSqlConfig (string envVarName)
+ {
+ string connectionString = Environment.GetEnvironmentVariable (envVarName);
+ if (string.IsNullOrEmpty (connectionString))
+ return null;
+
+ SqlConnection connection;
+#if MOBILE
+ connection = new SqlConnection ();
+#else
+ DbProviderFactory factory = DbProviderFactories.GetFactory ("System.Data.SqlClient");
+ connection = (SqlConnection)factory.CreateConnection ();
+#endif
+
+ var engine = new EngineConfig {
+ Type = EngineType.SQLServer,
+ ClientVersion = 9,
+ QuoteCharacter = """,
+ SupportsMicroseconds = true,
+ SupportsUniqueIdentifier = true,
+ SupportsTimestamp = true,
+ };
+
+ return new ConnectionHolder<SqlConnection> (engine, connection, connectionString);
+ }
+
+#if !NO_ODBC
+ static ConnectionHolder<OdbcConnection> CreateOdbcConfig (string envVarName)
+ {
+ string connectionString = Environment.GetEnvironmentVariable (envVarName);
+ if (string.IsNullOrEmpty (connectionString))
+ return null;
+
+ DbProviderFactory factory = DbProviderFactories.GetFactory ("System.Data.Odbc");
+ var connection = (OdbcConnection)factory.CreateConnection ();
+
+ var engine = new EngineConfig {
+ Type = EngineType.MySQL,
+ QuoteCharacter = "`",
+ RemovesTrailingSpaces = true,
+ EmptyBinaryAsNull = true,
+ SupportsDate = true,
+ SupportsTime = true
+ };
+
+ return new ConnectionHolder<OdbcConnection> (engine, connection, connectionString);
+ }
+#endif
+
+ private void CreateMssqlDatabase()
{
- string connection_name = Environment.GetEnvironmentVariable ("PROVIDER_TESTS_CONNECTION");
- if (connection_name == null || connection_name.Length == 0)
- throw new ArgumentException ("PROVIDER_TESTS_CONNECTION environment variable is not set.");
-
- ConnectionConfig [] connections = (ConnectionConfig [])
- ConfigurationManager.GetSection ("providerTests");
- foreach (ConnectionConfig connConfig in connections) {
- if (connConfig.Name != connection_name)
- continue;
-
- _connectionString = connConfig.ConnectionString;
- DbProviderFactory factory = DbProviderFactories.GetFactory (
- connConfig.Factory);
- _connection = factory.CreateConnection ();
- _connection.ConnectionString = _connectionString;
- _connectionString = _connection.ConnectionString;
- _engine = connConfig.Engine;
- return;
+ DBHelper.ExecuteNonQuery(sql.Connection, $"CREATE DATABASE [{DatabaseName}]");
+ sql.Connection.ChangeDatabase(DatabaseName);
+
+ string query = File.ReadAllText(@"Test/ProviderTests/sql/sqlserver.sql");
+
+ var queries = SplitSqlStatements(query);
+ foreach (var subQuery in queries)
+ {
+ DBHelper.ExecuteNonQuery(sql.Connection, subQuery);
}
+ }
+
+#if !NO_ODBC
+ private void CreateMysqlDatabase()
+ {
+ DBHelper.ExecuteNonQuery(odbc.Connection, $"CREATE DATABASE {DatabaseName}");
+ odbc.Connection.ChangeDatabase(DatabaseName);
+ odbc.ConnectionString += $"database={DatabaseName}";
- throw new ArgumentException ("Connection '" + connection_name + "' not found.");
+ string query = File.ReadAllText("Test/ProviderTests/sql/MySQL_5.sql");
+
+ var groups = query.Replace("delimiter ", "")
+ .Split(new[] { "//\n" }, StringSplitOptions.RemoveEmptyEntries);
+
+ foreach (var subQuery in groups[0].Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Concat(groups.Skip(1)))
+ {
+ DBHelper.ExecuteNonQuery(odbc.Connection, subQuery);
+ }
}
+#endif
- public static ConnectionManager Singleton {
- get {return Instance;}
+ private void DropMssqlDatabase()
+ {
+ sql.Connection.ChangeDatabase("master");
+ string query = $"ALTER DATABASE [{DatabaseName}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;\nDROP DATABASE [{DatabaseName}]";
+ DBHelper.ExecuteNonQuery(sql.Connection, query);
}
- public
- DbConnection
- Connection {
- get {return _connection;}
+#if !NO_ODBC
+ private void DropMysqlDatabase()
+ {
+ string query = $"DROP DATABASE [{DatabaseName}]";
+ DBHelper.ExecuteNonQuery(odbc.Connection, query);
}
+#endif
- public string ConnectionString {
- get {return _connectionString;}
+ // Split SQL script by "GO" statements
+ private static IEnumerable<string> SplitSqlStatements(string sqlScript)
+ {
+ var statements = Regex.Split(sqlScript,
+ $@"^[\t ]*GO[\t ]*\d*[\t ]*(?:--.*)?$",
+ RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase);
+ return statements.Where(x => !string.IsNullOrWhiteSpace(x)).Select(x => x.Trim(' ', '\r', '\n'));
}
- internal EngineConfig Engine {
- get { return _engine; }
+ public static ConnectionManager Instance => instance ?? (instance = new ConnectionManager());
+
+ public string DatabaseName { get; }
+
+#if !NO_ODBC
+
+ private ConnectionHolder<OdbcConnection> odbc;
+
+ public ConnectionHolder<OdbcConnection> Odbc
+ {
+ get
+ {
+ if (odbc == null)
+ Assert.Ignore($"{OdbcEnvVar} environment variable is not set");
+ return odbc;
+ }
+ }
+#endif
+
+ public ConnectionHolder<SqlConnection> Sql
+ {
+ get
+ {
+ if (sql == null)
+ Assert.Ignore($"{SqlEnvVar} environment variable is not set");
+ return sql;
+ }
}
- public void OpenConnection ()
+ public void Close()
{
- if (!(_connection.State == ConnectionState.Closed || _connection.State == ConnectionState.Broken))
- _connection.Close ();
- _connection.ConnectionString = _connectionString;
- _connection.Open ();
+ sql?.CloseConnection();
+#if !NO_ODBC
+ odbc?.CloseConnection();
+#endif
}
+ }
+
+ public class ConnectionHolder<TConnection> where TConnection : DbConnection
+ {
+ private TConnection connection;
+
+ public EngineConfig EngineConfig { get; }
+
+ public TConnection Connection
+ {
+ get
+ {
+ if (!(connection.State == ConnectionState.Closed ||
+ connection.State == ConnectionState.Broken))
+ connection.Close();
+ connection.ConnectionString = ConnectionString;
+ connection.Open();
+ return connection;
+ }
+ }
+
+ public void CloseConnection()
+ {
+ if (connection != null && connection.State != ConnectionState.Closed)
+ connection.Close();
+ }
+
+ public string ConnectionString { get; set; }
- public void CloseConnection ()
+ public ConnectionHolder(EngineConfig engineConfig, TConnection connection, string connectionString)
{
- if (_connection != null && _connection.State != ConnectionState.Closed)
- _connection.Close ();
+ EngineConfig = engineConfig;
+ this.connection = connection;
+ ConnectionString = connectionString;
}
}
}
using System;
using System.Data;
-using System.Data.Common;
using System.Text;
-using Mono.Data;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
public sealed class DBHelper
{
using System.Data;
using System.Data.SqlClient;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
public class DataProvider
{
query += "Select * from datetime_family order by id ASC;";
SqlDataAdapter adapter = new SqlDataAdapter (query,
- ConnectionManager.Singleton.ConnectionString);
+ ConnectionManager.Instance.Sql.ConnectionString);
adapter.TableMappings.Add ("Table", "numeric_family");
adapter.TableMappings.Add ("Table1", "string_family");
adapter.TableMappings.Add ("Table2", "binary_family");
//
using System;
-using System.Configuration;
using System.Globalization;
using System.Xml;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
- internal sealed class EngineConfig
+ public sealed class EngineConfig
{
private string name;
private string quoteCharacter;
private EngineType type;
private int clientVersion;
- private EngineConfig ()
+ public EngineConfig ()
{
}
/// </summary>
public string QuoteCharacter {
get { return quoteCharacter; }
+ set { quoteCharacter = value; }
}
public EngineType Type {
get { return type; }
+ set { type = value; }
}
public bool RemovesTrailingSpaces {
get { return removesTrailingSpaces; }
+ set { removesTrailingSpaces = value; }
}
public bool EmptyBinaryAsNull {
get { return emptyBinaryAsNull; }
+ set { emptyBinaryAsNull = value; }
}
public bool SupportsMicroseconds {
get { return supportsMicroseconds; }
+ set { supportsMicroseconds = value; }
}
public bool SupportsUniqueIdentifier {
get { return supportsUniqueIdentifier; }
+ set { supportsUniqueIdentifier = value; }
}
public bool SupportsDate {
get { return supportsDate; }
+ set { supportsDate = value; }
}
public bool SupportsTime {
get { return supportsTime; }
+ set { supportsTime = value; }
}
public bool SupportsTimestamp {
get { return supportsTimestamp; }
+ set { supportsTimestamp = value; }
}
public int ClientVersion {
get { return clientVersion; }
+ set { clientVersion = value; }
}
public static EngineConfig FromXml (XmlNode config)
string msg = string.Format (CultureInfo.InvariantCulture,
"Invalid value '{0}' for attribute {1}.",
value, name);
- throw new ConfigurationErrorsException (msg, cause, node);
+ throw new ArgumentOutOfRangeException (msg, cause);
}
static Exception CreateAttributeMissingException (string name, XmlNode node)
{
string msg = string.Format (CultureInfo.InvariantCulture,
"Missing '{0}' attribute.", name);
- throw new ConfigurationErrorsException (msg, node);
+ throw new ArgumentException (msg);
}
}
}
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
public enum EngineType
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_CONFIGURATION
+
using System;
using System.Collections;
using System.Configuration;
using System.Text;
using System.Xml;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
class ProviderTestsConfigurationHandler : IConfigurationSectionHandler
{
}
}
}
+
+#endif
\ No newline at end of file
using System;
using System.Data;
using System.Data.Common;
-using System.Data.Odbc;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Globalization;
using System.Text;
-
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
[TestFixture]
- [Category ("odbc")]
[Category ("sqlserver")]
public class DataReaderTest
{
[SetUp]
public void SetUp ()
{
- conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
}
[TearDown]
public void TearDown ()
{
- if (cmd != null)
- cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ cmd?.Dispose ();
+ ConnectionManager.Instance.Close();
}
[Test]
}
[Test]
+ [Category("NotWorking")]
public void GetChars_Reader_NoData ()
{
//Console.WriteLine ("GetChars_Reader_NoData - first_executereader");
try {
rdr.GetChars (-1, 0, (char []) null, 0, 0);
Assert.Fail ("#A1");
- } catch (InvalidOperationException ex) {
+ } catch (IndexOutOfRangeException ex) {
// No data exists for the row/column
- Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#A2");
Assert.IsNull (ex.InnerException, "#A3");
Assert.IsNotNull (ex.Message, "#A4");
}
try {
rdr.GetChars (-1, 0, (char []) null, 0, 0);
Assert.Fail ("#C1");
- } catch (InvalidOperationException ex) {
+ } catch (IndexOutOfRangeException ex) {
// No data exists for the row/column
- Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
Assert.IsNull (ex.InnerException, "#C3");
Assert.IsNotNull (ex.Message, "#C4");
}
cmd.CommandText = "SELECT * FROM employee WHERE lname='kumar'";
reader = cmd.ExecuteReader ();
- switch (ConnectionManager.Singleton.Engine.Type) {
+ switch (ConnectionManager.Instance.Sql.EngineConfig.Type) {
case EngineType.SQLServer:
Assert.AreEqual ("int", reader.GetDataTypeName (0), "#1");
break;
[Test]
public void GetSchemaTable_Command_Disposed ()
{
- if (RunningOnMono && (conn is OdbcConnection))
+ if (RunningOnMono)
Assert.Ignore ("Our statement handle is closed when we dispose the (Odbc)Command");
IDataReader reader = null;
cmd.CommandText = "select id, fname, id + 20 as plustwenty from employee";
reader = cmd.ExecuteReader (CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo);
Assert.IsFalse (reader.IsClosed, "#1");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
Assert.IsTrue (reader.IsClosed, "#2");
} finally {
if (reader != null)
}
[Test]
+ [Category("NotWorking")]
public void GetBytes_DataIndex_Overflow ()
{
cmd.CommandText = "SELECT type_blob FROM binary_family where id = 2";
}
[Test]
+ [Category("NotWorking")]
public void GetValues_Reader_Closed ()
{
//Console.WriteLine ("GetValues_Reader_Closed - first_executereader");
try {
rdr.GetValues ((object []) null);
Assert.Fail ("#1");
- } catch (InvalidOperationException ex) {
+ } catch (ArgumentNullException ex) {
// No data exists for the row/column
- Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
}
[Test]
+ [Category("NotWorking")]
public void GetValues_Reader_NoData ()
{
//Console.WriteLine ("GetValues_Reader_NoData - first_executereader");
try {
rdr.GetValues ((object []) null);
Assert.Fail ("#A1");
- } catch (InvalidOperationException ex) {
+ } catch (ArgumentNullException ex) {
// No data exists for the row/column
- Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#A2");
Assert.IsNull (ex.InnerException, "#A3");
Assert.IsNotNull (ex.Message, "#A4");
}
try {
rdr.GetValues ((object []) null);
Assert.Fail ("#C1");
- } catch (InvalidOperationException ex) {
+ } catch (ArgumentNullException ex) {
// No data exists for the row/column
- Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
Assert.IsNull (ex.InnerException, "#C3");
Assert.IsNotNull (ex.Message, "#C4");
}
using System;
using System.Data;
using System.Data.Common;
-using System.Data.Odbc;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Globalization;
-
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
[TestFixture]
- [Category ("odbc")]
[Category ("sqlserver")]
public class DbDataReaderTest
{
[SetUp]
public void SetUp ()
{
- conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
}
[TearDown]
public void TearDown ()
{
- if (cmd != null)
- cmd.Dispose ();
- if (rdr != null)
- rdr.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ cmd?.Dispose ();
+ rdr?.Dispose ();
+ ConnectionManager.Instance.Close ();
}
[Test]
using System;
using System.Data;
using System.Data.Common;
-
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected
{
[TestFixture]
[Category ("odbc"), Category ("sqlserver")]
[SetUp]
public void SetUp ()
{
- conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
}
{
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Close ();
}
[Test]
Assert.AreEqual (new byte [] { 0x32, 0x56, 0x00, 0x44, 0x22 }, val, "#A3");
}
- ConnectionManager.Singleton.CloseConnection ();
- conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
using (IDataReader reader = cmd.ExecuteReader (behavior)) {
Assert.IsTrue (reader.Read (), "#B1");
Assert.IsTrue (reader.Read (), "#C");
}
- ConnectionManager.Singleton.CloseConnection ();
- conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
+
using (IDataReader reader = cmd.ExecuteReader (behavior)) {
Assert.IsTrue (reader.Read (), "#D");
ProviderIndependant/DataReaderTest.cs
ProviderIndependant/DbDataReaderTest.cs
ProviderIndependant/IDbCommandTest.cs
+System.Data.SqlClient/SqlClientFactoryTest.cs
System.Data.SqlClient/SqlCommandBuilderTest.cs
System.Data.SqlClient/SqlCommandTest.cs
System.Data.SqlClient/SqlDataReaderTest.cs
System.Data.SqlClient/SqlDataAdapterTest.cs
System.Data.SqlClient/SqlTransactionTest.cs
+System.Data.SqlClient/SqlConnectionStringBuilderTest.cs
System.Data.SqlClient/SqlConnectionTest.cs
System.Data.SqlClient/SqlParameterTest.cs
+System.Data.SqlClient/SqlParameterCollectionTest.cs
\ No newline at end of file
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Common;
using System.Data.Odbc;
-using Mono.Data;
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
[Test]
public void GetInsertCommandTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
try {
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetInsertCommandTestWithExpression ()
{
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type == EngineType.MySQL)
Assert.Ignore ("Schema info from MySQL is incomplete");
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
try {
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetUpdateCommandTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
try {
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("FIXME: Auto SQL generation during Update requires a valid SelectCommand")]
public void GetUpdateCommandDBConcurrencyExceptionTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreEqual (1, ex.RowCount, "#6");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
+ [Category("NotWorking")]
public void GetInsertCommandTest_option_true ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertInsertParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetInsertCommandTest_option_false ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertInsertParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
+ [Category("NotWorking")]
public void GetUpdateCommandTest_option_true ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname, id+1 as next_id from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertUpdateParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetUpdateCommandTest_option_false ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname, id+1 as next_id from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertUpdateParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
+ [Category("NotWorking")]
public void GetDeleteCommandTest_option_true ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname, id+1 as next_id from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertDeleteParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetDeleteCommandTest_option_false ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
string selectQuery = "select id, lname, id+1 as next_id from employee where id = 3";
OdbcDataAdapter da = new OdbcDataAdapter (selectQuery, conn);
Assert.AreSame (conn, cmd.Connection, "#2");
AssertDeleteParameters (cmd, "#3:");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void GetDeleteCommandTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
try {
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuotePrefix_DeleteCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuotePrefix_InsertCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuotePrefix_UpdateCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuoteSuffix_DeleteCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuoteSuffix_InsertCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Ignore ("QuoteSuffix and QuotePrefix are now in DbCommandBuilder, while commands are in implementation classes. Result: we cannot perform this check until we refactor this.")]
public void QuoteSuffix_UpdateCommand_Generated ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
OdbcCommand cmd = null;
} finally {
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
public void QuoteIdentifier2 ()
{
OdbcCommandBuilder cb;
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
- string quote_char = ConnectionManager.Singleton.Engine.QuoteCharacter;
+ string quote_char = ConnectionManager.Instance.Odbc.EngineConfig.QuoteCharacter;
try {
cb = new OdbcCommandBuilder ();
Assert.AreEqual (" ", cb.QuoteIdentifier (" ", conn), "#E11");
Assert.AreEqual ("\r", cb.QuoteIdentifier ("\r", conn), "#E12");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
Assert.AreEqual ("p1", cmd.Parameters [0].ParameterName, prefix + "ParameterName (0)");
Assert.AreEqual ("id", cmd.Parameters [0].SourceColumn, prefix + "SourceColumn (0)");
Assert.IsNull (cmd.Parameters [0].Value, prefix + "Value (0)");
- Assert.AreEqual (DbType.AnsiString, cmd.Parameters [1].DbType, prefix + "DbType (1)");
+ Assert.AreEqual (DbType.String, cmd.Parameters [1].DbType, prefix + "DbType (1)");
Assert.AreEqual ("p2", cmd.Parameters [1].ParameterName, prefix + "ParameterName (1)");
Assert.AreEqual ("lname", cmd.Parameters [1].SourceColumn, prefix + "SourceColumn (1)");
Assert.IsNull (cmd.Parameters [1].Value, prefix + "Value (1)");
Assert.AreEqual ("p1", cmd.Parameters [0].ParameterName, prefix + "ParameterName (0)");
Assert.AreEqual ("id", cmd.Parameters [0].SourceColumn, prefix + "SourceColumn (0)");
Assert.IsNull (cmd.Parameters [0].Value, prefix + "Value (0)");
- Assert.AreEqual (DbType.AnsiString, cmd.Parameters [1].DbType, prefix + "DbType (1)");
+ Assert.AreEqual (DbType.String, cmd.Parameters [1].DbType, prefix + "DbType (1)");
Assert.AreEqual ("p2", cmd.Parameters [1].ParameterName, prefix + "ParameterName (1)");
Assert.AreEqual ("lname", cmd.Parameters [1].SourceColumn, prefix + "SourceColumn (1)");
Assert.IsNull (cmd.Parameters [1].Value, prefix + "Value (1)");
Assert.AreEqual ("p4", cmd.Parameters [3].ParameterName, prefix + "ParameterName (3)");
Assert.AreEqual ("lname", cmd.Parameters [3].SourceColumn, prefix + "SourceColumn (3)");
Assert.AreEqual (1, cmd.Parameters [3].Value, prefix + "Value (3)");
- Assert.AreEqual (DbType.AnsiString, cmd.Parameters [4].DbType, prefix + "DbType (4)");
+ Assert.AreEqual (DbType.String, cmd.Parameters [4].DbType, prefix + "DbType (4)");
Assert.AreEqual ("p5", cmd.Parameters [4].ParameterName, prefix + "ParameterName (4)");
Assert.AreEqual ("lname", cmd.Parameters [4].SourceColumn, prefix + "SourceColumn (4)");
Assert.IsNull (cmd.Parameters [4].Value, prefix + "Value (4)");
Assert.AreEqual ("p2", cmd.Parameters [1].ParameterName, prefix + "ParameterName (1)");
Assert.AreEqual ("lname", cmd.Parameters [1].SourceColumn, prefix + "SourceColumn (1)");
Assert.AreEqual (1, cmd.Parameters [1].Value, prefix + "Value (1)");
- Assert.AreEqual (DbType.AnsiString, cmd.Parameters [2].DbType, prefix + "DbType (2)");
+ Assert.AreEqual (DbType.String, cmd.Parameters [2].DbType, prefix + "DbType (2)");
Assert.AreEqual ("p3", cmd.Parameters [2].ParameterName, prefix + "ParameterName (2)");
Assert.AreEqual ("lname", cmd.Parameters [2].SourceColumn, prefix + "SourceColumn (2)");
Assert.IsNull (cmd.Parameters [2].Value, prefix + "Value (2)");
// FIXME: Add test for ContinueUpdateOnError property
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Common;
using System.Data.Odbc;
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
[SetUp]
public void SetUp ()
{
- conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Odbc.Connection;
cmd = conn.CreateCommand ();
}
{
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Close ();
}
[Test]
cmd.CommandText = "select count(*) from employee where id <= ?;";
cmd.Parameters.Add ("@un", OdbcType.Int).Value = 3;
ret = cmd.ExecuteNonQuery ();
- switch (ConnectionManager.Singleton.Engine.Type) {
+ switch (ConnectionManager.Instance.Odbc.EngineConfig.Type) {
case EngineType.SQLServer:
Assert.AreEqual (-1, ret, "#1");
break;
cmd.CommandText = "select * from employee where id <= ?;";
cmd.Parameters.Add ("@un", OdbcType.Int).Value = 3;
ret = cmd.ExecuteNonQuery ();
- switch (ConnectionManager.Singleton.Engine.Type) {
+ switch (ConnectionManager.Instance.Odbc.EngineConfig.Type) {
case EngineType.SQLServer:
Assert.AreEqual (-1, ret, "#2");
break;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from employee where id <= 3;";
ret = cmd.ExecuteNonQuery ();
- switch (ConnectionManager.Singleton.Engine.Type) {
+ switch (ConnectionManager.Instance.Odbc.EngineConfig.Type) {
case EngineType.SQLServer:
Assert.AreEqual (-1, ret, "#3");
break;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Odbc;
using NUnit.Framework;
-namespace MonoTests.System.Data.Odbc
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
[Test]
public void FillTest ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- try {
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
+ try
+ {
// For this Test, you must create sample table
// called person-age, with a non-zero number of rows
// and non-zero number of columns
"#4 column values must not be of size 0");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
+ [Ignore]
public void InsertUtf8Test ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- try {
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
+ try
+ {
DoExecuteNonQuery ((OdbcConnection) conn,
"CREATE TABLE odbc_ins_utf8_test(ival int not null, sval varchar(20))");
Assert.AreEqual (DoExecuteNonQuery ((OdbcConnection) conn,
3);
} finally {
DoExecuteNonQuery ((OdbcConnection) conn, "DROP TABLE odbc_ins_utf8_test");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Common;
using System.Data.Odbc;
using System.Globalization;
using System.Text;
-
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
[SetUp]
public void SetUp ()
{
- conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Odbc.Connection;
cmd = conn.CreateCommand ();
}
{
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Close ();
}
[Test]
Assert.AreEqual (totalsize, ret, "#C1");
}
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
[Test]
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#A:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#A:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#A:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#A:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#A:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#A:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#A:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#A:BaseColumnName_IsNull");
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#C:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#C:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#C:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#C:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#C:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#C:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#C:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#C:BaseColumnName_IsNull");
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#E:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#E:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#E:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#E:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#E:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#E:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#E:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#E:BaseColumnName_IsNull");
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#G:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#G:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#G:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#G:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#G:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#G:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#G:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#G:BaseColumnName_IsNull");
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#I:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#I:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#I:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#I:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#I:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#I:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#I:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#I:BaseColumnName_IsNull");
Assert.IsTrue (pkRow.IsNull ("BaseSchemaName"), "#K:BaseSchemaName_IsNull");
Assert.AreEqual (DBNull.Value, pkRow ["BaseSchemaName"], "#K:BaseSchemaName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseCatalogName"), "#K:BaseCatalogName_IsNull");
- Assert.AreEqual ("monotest", pkRow ["BaseCatalogName"], "#K:BaseCatalogName_Value");
+ Assert.AreEqual (ConnectionManager.Instance.DatabaseName, pkRow ["BaseCatalogName"], "#K:BaseCatalogName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseTableName"), "#K:BaseTableName_IsNull");
Assert.AreEqual ("employee", pkRow ["BaseTableName"], "#K:BaseTableName_Value");
Assert.IsFalse (pkRow.IsNull ("BaseColumnName"), "#K:BaseColumnName_IsNull");
// MySQL currently does not support output parameters
// in its ODBC connector:
// http://www.paragon-cs.com/mag/issue3.pdf
- if (ConnectionManager.Singleton.Engine.Type != EngineType.SQLServer)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type != EngineType.SQLServer)
Assert.Ignore ("MySQL does not (yet) support output parameters using ODBC.");
IDataReader reader = null;
[Test]
public void FindZeroInToStringTest ()
{
- if (ConnectionManager.Singleton.Engine.Type != EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type != EngineType.MySQL)
Assert.Ignore ("Only applies to MySQL.");
IDataReader reader = null;
[Test]
public void Bug332404Test ()
{
- if (ConnectionManager.Singleton.Engine.Type != EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type != EngineType.MySQL)
Assert.Ignore ("Only applies to MySQL.");
cmd = new OdbcCommand ("DROP TABLE IF EXISTS odbc_test");
[Test]
public void Bug332400Test ()
{
- if (ConnectionManager.Singleton.Engine.Type != EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type != EngineType.MySQL)
Assert.Ignore ("Only applies to MySQL.");
cmd = new OdbcCommand ("DROP TABLE IF EXISTS blob_test");
[Test]
public void Bug419224Test ()
{
- cmd = new OdbcCommand ("DROP TABLE IF EXISTS bug419224test");
+ cmd = new OdbcCommand ("DROP TABLE IF EXISTS odbc_test");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
- cmd = new OdbcCommand ("CREATE TABLE bug419224test (id_test INTEGER NOT NULL, payload TINYBLOB NOT NULL)");
+ cmd = new OdbcCommand ("CREATE TABLE odbc_test (id_test INTEGER NOT NULL, payload TINYBLOB NOT NULL)");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
- cmd = new OdbcCommand ("INSERT INTO odbc_test (id_test, payload) VALUES (1, 'test for bug419224)");
+ cmd = new OdbcCommand ("INSERT INTO odbc_test (id_test, payload) VALUES (1, 'test for bug419224')");
cmd.Connection = conn;
cmd.ExecuteNonQuery ();
- OdbcDataAdapter Adaptador = new OdbcDataAdapter ();
+ OdbcDataAdapter adaptador = new OdbcDataAdapter ();
+ DataSet lector = new DataSet ();
- DataSet Lector = new DataSet ();
+ adaptador.SelectCommand = new OdbcCommand ("SELECT * FROM odbc_test WHERE id_test=1", (OdbcConnection) conn);
+ adaptador.Fill (lector);
+ var payload = (byte[])lector.Tables[0].Rows[0]["payload"];
+ Assert.AreEqual ("test for bug419224", Encoding.UTF8.GetString(payload));
- Adaptador.SelectCommand = new OdbcCommand ("SELECT * FROM odbc_test WHERE id_test=1", (OdbcConnection) conn);
- Adaptador.Fill (Lector);
- Assert.AreEqual (Lector.Tables[0].Rows[0]["payload"], 1.2346);
+ OdbcDataReader newRdr = cmd.ExecuteReader();
+ // tinyblob column index:
+ int TinyblobIdx = 1;
- OdbcDataReader NewRdr = cmd.ExecuteReader();
+ bool read = newRdr.Read();
- // tinyblob column index:
- int TinyblobIdx = 1;
-
- bool read = NewRdr.Read();
-
- if (read)
- {
- bool ret = NewRdr.IsDBNull(TinyblobIdx);
+ if (read)
+ {
+ bool ret = newRdr.IsDBNull(TinyblobIdx);
Assert.AreEqual (ret, false);
}
}
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Text;
using System.Data;
using NUnit.Framework;
-namespace MonoTests.System.Data.Odbc
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
[Test]
public void ParameterLengthTrimTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand cmd = conn.CreateCommand ();
Assert.AreEqual (15, param.Size, "#1");
Assert.AreEqual (0, cmd.ExecuteScalar(), "#2");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (OdbcType.NVarChar,OdbcCmd.Parameters[1].OdbcType, "#13 Parameters with null value must be of type NVarChar");
Assert.AreEqual (OdbcType.Text,OdbcCmd.Parameters[0].OdbcType, "#14 Parameter at index 0 is of type Text");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertNoOverwriteTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual ("Parameter1", OdbcCmd.Parameters[1].ParameterName, "#8 Parameters inserted without any name must get a default name");
Assert.AreEqual (null, OdbcCmd.Parameters[1].Value, "#9 Parameters inserted without any value must have null value");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertNullTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only one parameter after Insert failed");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertEmptyTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertAlreadyContainedParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (2, OdbcCmd.Parameters.Count, "#3 The collection must contain 2 parameters after Insert failed");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertArgumentGreaterThanCountTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only 1 parameter after Insert failed");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertNegativeArgumentTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only 1 parameter after Insert failed");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void InsertNonOdbcParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only 1 parameter after Insert failed");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual ("Parameter1", OdbcCmd.Parameters[1].ParameterName, "#5 Parameters added without any name must get a default name");
Assert.AreEqual (OdbcType.NVarChar,OdbcCmd.Parameters[1].OdbcType, "#6 Parameters with null value must be of type NVarChar");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeParameterAlreadyContainedTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (2, OdbcCmd.Parameters.Count, "#2 The collection must contain excatly 2 elements after AddRange failed for the third element");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeArgumentNullExceptionTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 If any of the parameters in the range is null, none of them should be added");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeParameterContainedInAnotherCollTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd2.Parameters.Count, "#4 All the elements before the invalid element must be added to the collection of OdbcCmd2");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeMultiDimensionalArrayTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (4, OdbcCmd.Parameters.IndexOf (p5Tmp), "#4 Not all elements are added");
Assert.AreEqual (OdbcType.NVarChar,OdbcCmd.Parameters[4].OdbcType, "#5 Parameters with null value must be of type NVarChar");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddRangeArrayValuesArgumentNullExceptionTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 None of the elememts must be added if any one of them is null");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void ContainsTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.IsFalse (OdbcCmd.Parameters.Contains ((Object)null), "#6 Contains must return false for empty string");
Assert.IsFalse (OdbcCmd.Parameters.Contains ((String)null), "#6 Contains must return false for empty string");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void ContainsNonOdbcParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#3 The collection must contain only one parameter");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void ContainsCaseSensitivityTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (true, OdbcCmd.Parameters.Contains ("@LNAME"), "#3 Case sensitivity failed for Contains, should be case insensitive");
Assert.AreEqual (true, OdbcCmd.Parameters.Contains ("@LnAmE"), "#4 Case sensitivity failed for Contains, should be case insensitive");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void ContainsNotMineTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd1 = conn.CreateCommand ();
Assert.IsTrue (OdbcCmd1.Parameters.Contains (p1));
Assert.IsFalse (OdbcCmd1.Parameters.Contains (p2));
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void IndexOfTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (-1, OdbcCmd.Parameters.IndexOf ((Object)p3Tmp), "#9 non-existing parameter passed as Object did not return index -1");
Assert.AreEqual (-1, OdbcCmd.Parameters.IndexOf ((Object)null), "#10 null parameter passed as Object should return index -1");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void IndexOfCaseSensitivityTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.IndexOf ("@AGE"), "#4 Case sensitivity failed for IndexOf, should be case insensitive");
Assert.AreEqual (1, OdbcCmd.Parameters.IndexOf ("@age"), "#5 Case sensitivity failed for IndexOf, should be case insensitive");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void IndexOfNonOdbcParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#3 The collection must contain only one parameter");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void CopyToTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (null, DestinationParamArray [0], "#5 The remaining elements must remain un-initialized");
Assert.AreEqual (null, DestinationParamArray [3], "#6 The remaining elements must remain un-initialized");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void CopyToArgumentExceptionTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (null, DestinationParamArray [3], "#5 The DestinationParamArray must remain un-initialized");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void CopyToMultiDimensionalArrayTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (null, DestinationParamArray [1, 3], "#5 The DestinationParamArray must remain un-initialized");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void CopyToLowerBoundCheckTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (null, DestinationParamArray [3], "#5 The DestinationParamArray must remain un-initialized");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void DuplicateParameterNameTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.IndexOf ((object) p1Lname));
Assert.AreEqual (1, OdbcCmd.Parameters.IndexOf ((object) p2Lname));
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
OdbcCmd.Parameters.Remove (p1Lname);
Assert.AreEqual (0, OdbcCmd.Parameters.Count, "#2 Collection should not contain any parameters");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveNullTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only one parameter");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveEmptyTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only one parameter");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveNonOdbcParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (1, OdbcCmd.Parameters.Count, "#2 The collection must contain only one parameter");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveNonExistingParameterTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.Count, "#3 The collection should not contain any parameters");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveParameterContainedInAnotherCollTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (2, OdbcCmd2.Parameters.Count, "#6 The parameter collection of OdbcCmd2 should contain 2 parameters");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveAtTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.IndexOf(p2Age), "#13 p2Age should be at index 0");
Assert.AreEqual (1, OdbcCmd.Parameters.IndexOf(p3Tmp), "#14 p3Tmp should be at index 1");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveAtOutOfRangeIndexTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.IndexOf(p1Lname), "#4 p1Lname is not at index 0");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveAtNegativeIndexTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.IndexOf(p1Lname), "#4 p1Lname is not at index 0");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void RemoveAtBoundaryTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (0, OdbcCmd.Parameters.IndexOf(p1Lname), "#4 p1Lname is not at index 0");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void AddWithValueTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual (2,OdbcCmd.Parameters[8].Value, "#50 The parameter at index 8 must have value as 2");
Assert.AreEqual (OdbcType.NVarChar,OdbcCmd.Parameters[8].OdbcType, "#51 Parameter must be of type NVarChar");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
[Test]
public void DefaultNamesAndValuesTest ()
{
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
OdbcCommand OdbcCmd = conn.CreateCommand ();
Assert.AreEqual ("Parameter2",OdbcCmd.Parameters[2].ParameterName, "#12 The parameter must have a default name");
Assert.AreEqual (OdbcType.NVarChar,OdbcCmd.Parameters[2].OdbcType, "#13 Parameters with null value must be of type NVarChar");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Common;
using System.Globalization;
using System.Text;
using System.Threading;
-
-using Mono.Data;
-
using NUnit.Framework;
-namespace MonoTests.System.Data
+
+namespace MonoTests.System.Data.Connected.Odbc
{
[TestFixture]
[Category ("odbc")]
string select_by_id = "select id, type_int from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_bigint from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_binary from binary_family where id = ?";
string delete_data = "delete from binary_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_smallint from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_timestamp from binary_family where id = ?";
string delete_data = "delete from binary_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
OdbcParameter param;
try {
- if (!ConnectionManager.Singleton.Engine.SupportsTimestamp)
+ if (!ConnectionManager.Instance.Odbc.EngineConfig.SupportsTimestamp)
Assert.Ignore ("Timestamp test does not apply to the current driver (" + conn.Driver + ").");
cmd = conn.CreateCommand ();
string select_by_id = "select id, type_tinyint from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
public void StringParamTest ()
{
string query = "select id, fname from employee where fname = ?";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
try {
- ConnectionManager.Singleton.OpenConnection ();
OdbcCommand cmd = (OdbcCommand) conn.CreateCommand ();
cmd.CommandText = query;
Assert.IsTrue (dr.Read (), "#1 no data to test");
Assert.AreEqual (1, (int) dr [0], "#2 value not matching");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
string select_by_id = "select id, type_bit from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#B2");
Assert.AreEqual (2, dr.GetValue (0), "#B2");
Assert.AreEqual (typeof (bool), dr.GetFieldType (1), "#B3");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- // MySQL does not support true BIT type
- Assert.AreEqual (true, dr.GetValue (1), "#B4");
- else
- Assert.AreEqual (false, dr.GetValue (1), "#B4");
+ Assert.AreEqual (false, dr.GetValue (1), "#B4");
Assert.IsFalse (dr.Read (), "#B5");
dr.Close ();
cmd.Dispose ();
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#E2");
Assert.AreEqual (6000, dr.GetValue (0), "#E3");
Assert.AreEqual (typeof (bool), dr.GetFieldType (1), "#E4");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- // MySQL does not support true BIT type
- Assert.AreEqual (true, dr.GetValue (1), "#E5");
- else
- Assert.AreEqual (false, dr.GetValue (1), "#E5");
+ Assert.AreEqual (false, dr.GetValue (1), "#E5");
Assert.IsFalse (dr.Read (), "#E6");
dr.Close ();
cmd.Dispose ();
string select_by_id = "select id, type_char from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#A2");
Assert.AreEqual (1, dr.GetValue (0), "#A3");
Assert.AreEqual (typeof (string), dr.GetFieldType (1), "#A4");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("char", dr.GetValue (1), "#A5");
else
Assert.AreEqual ("char ", dr.GetValue (1), "#A5");
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#C2");
Assert.AreEqual (3, dr.GetValue (0), "#C3");
Assert.AreEqual (typeof (string), dr.GetFieldType (1), "#C4");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual (string.Empty, dr.GetValue (1), "#C5");
else
Assert.AreEqual (" ", dr.GetValue (1), "#C5");
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#E2");
Assert.AreEqual (6000, dr.GetValue (0), "#E3");
Assert.AreEqual (typeof (string), dr.GetFieldType (1), "#E4");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("ABC", dr.GetValue (1), "#E5");
else
Assert.AreEqual ("ABC ", dr.GetValue (1), "#E5");
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#G2");
Assert.AreEqual (6000, dr.GetValue (0), "#G3");
Assert.AreEqual (typeof (string), dr.GetFieldType (1), "#G4");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual (string.Empty, dr.GetValue (1), "#G5");
else
Assert.AreEqual (" ", dr.GetValue (1), "#G5");
string insert_data = "insert into numeric_family (id, type_decimal1, type_decimal2) values (6000, ?, ?)";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
Assert.AreEqual (typeof (decimal), dr.GetFieldType (1), "#L4");
Assert.AreEqual (56789m, dr.GetValue (1), "#L5");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (2), "#L6");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type == EngineType.MySQL)
Assert.AreEqual (9876556.780m, dr.GetValue (2), "#L7");
else
Assert.AreEqual (98765.570m, dr.GetValue (2), "#L7");
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#M2");
Assert.AreEqual (6000, dr.GetValue (0), "#M3");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (1), "#M4");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- Assert.AreEqual (0m, dr.GetValue (1), "#M5");
- else
- Assert.AreEqual (DBNull.Value, dr.GetValue (1), "#M5");
+ Assert.AreEqual (DBNull.Value, dr.GetValue (1), "#M5");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (2), "#M6");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- Assert.AreEqual (0m, dr.GetValue (1), "#M7");
- else
- Assert.AreEqual (DBNull.Value, dr.GetValue (2), "#M7");
- Assert.IsFalse (dr.Read (), "#M8");
+ Assert.AreEqual (DBNull.Value, dr.GetValue(1), "#M7");
+ Assert.AreEqual (DBNull.Value, dr.GetValue (2), "#M8");
+ Assert.IsFalse (dr.Read (), "#M9");
dr.Close ();
cmd.Dispose ();
} finally {
string select_by_id = "select id, type_double from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_data = "select type_blob from binary_family where id = ?";
string delete_data = "delete from binary_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_data = "select type_nchar from string_family where type_nchar = ? and id = ?";
string select_by_id = "select type_nchar from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
-
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#A1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#A2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("nch\u092d\u093er", dr.GetValue (0), "#A3");
else
Assert.AreEqual ("nch\u092d\u093er ", dr.GetValue (0), "#A3");
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#C1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#C2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual (string.Empty, dr.GetValue (0), "#C3");
else
Assert.AreEqual (" ", dr.GetValue (0), "#C3");
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#E1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#E2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("nchar", dr.GetValue (0), "#E3");
else
Assert.AreEqual ("nchar ", dr.GetValue (0), "#E3");
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#F1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#F2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("nch\u0488", dr.GetValue (0), "#F3");
else
Assert.AreEqual ("nch\u0488 ", dr.GetValue (0), "#F3");
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#G1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#G2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual ("ch\u0488r", dr.GetValue (0), "#G3");
else
Assert.AreEqual ("ch\u0488r ", dr.GetValue (0), "#G3");
dr = cmd.ExecuteReader ();
Assert.IsTrue (dr.Read (), "#I1");
Assert.AreEqual (typeof (string), dr.GetFieldType (0), "#I2");
- if (ConnectionManager.Singleton.Engine.RemovesTrailingSpaces)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.RemovesTrailingSpaces)
Assert.AreEqual (string.Empty, dr.GetValue (0), "#I3");
else
Assert.AreEqual (" ", dr.GetValue (0), "#I3");
string select_by_id = "select type_ntext from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select type_text from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_numeric1, type_numeric2 from numeric_family where id = ?";
string insert_data = "insert into numeric_family (id, type_numeric1, type_numeric2) values (6000, ?, ?)";
string delete_data = "delete from numeric_family where id = 6000";
-
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
Assert.AreEqual (typeof (decimal), dr.GetFieldType (1), "#L4");
Assert.AreEqual (56789m, dr.GetValue (1), "#L5");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (2), "#L6");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.Type == EngineType.MySQL)
Assert.AreEqual (9876556.780m, dr.GetValue (2), "#L7");
else
Assert.AreEqual (98765.570m, dr.GetValue (2), "#L7");
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#M2");
Assert.AreEqual (6000, dr.GetValue (0), "#M3");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (1), "#M4");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- Assert.AreEqual (0m, dr.GetValue (1), "#M5");
- else
- Assert.AreEqual (DBNull.Value, dr.GetValue (1), "#M5");
+ Assert.AreEqual (DBNull.Value, dr.GetValue (1), "#M5");
Assert.AreEqual (typeof (decimal), dr.GetFieldType (2), "#M6");
- if (ConnectionManager.Singleton.Engine.Type == EngineType.MySQL)
- Assert.AreEqual (0m, dr.GetValue (1), "#M7");
- else
- Assert.AreEqual (DBNull.Value, dr.GetValue (2), "#M7");
+ Assert.AreEqual (DBNull.Value, dr.GetValue(1), "#M7");
+ Assert.AreEqual (DBNull.Value, dr.GetValue (2), "#M7");
Assert.IsFalse (dr.Read (), "#M8");
dr.Close ();
cmd.Dispose ();
string select_by_id = "select type_nvarchar from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_varbinary from binary_family where id = ?";
string delete_data = "delete from binary_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select type_varchar from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_float from numeric_family where id = ?";
string delete_data = "delete from numeric_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#D2");
Assert.AreEqual (1, dr.GetValue (0), "#D3");
Assert.AreEqual (typeof (float), dr.GetFieldType (1), "#D4");
- Assert.AreEqual (3.40E+38, dr.GetValue (1), "#D5");
+ Assert.AreEqual (3.39999995E+38f, dr.GetValue (1), "#D5");
Assert.IsFalse (dr.Read (), "#D6");
dr.Close ();
cmd.Dispose ();
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#A2");
Assert.AreEqual (1, dr.GetValue (0), "#A2");
Assert.AreEqual (typeof (float), dr.GetFieldType (1), "#A3");
- Assert.AreEqual (3.40E+38, dr.GetValue (1), "#A4");
+ Assert.AreEqual (3.40E+38f, (float)dr.GetValue (1), 0.0000001f, "#A4");
Assert.IsFalse (dr.Read (), "#A5");
dr.Close ();
cmd.Dispose ();
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#B2");
Assert.AreEqual (2, dr.GetValue (0), "#B2");
Assert.AreEqual (typeof (float), dr.GetFieldType (1), "#B3");
- Assert.AreEqual (-3.40E+38, dr.GetValue (1), "#B4");
+ Assert.AreEqual(-3.40E+38f, (float)dr.GetValue(1), 0.0000001f, "#B4");
Assert.IsFalse (dr.Read (), "#B5");
dr.Close ();
cmd.Dispose ();
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#E2");
Assert.AreEqual (6000, dr.GetValue (0), "#E3");
Assert.AreEqual (typeof (float), dr.GetFieldType (1), "#E4");
- Assert.AreEqual (3.40E+38, dr.GetValue (1), "#E5");
+ Assert.AreEqual(3.40E+38f, (float)dr.GetValue(1), 0.0000001f, "#E4");
Assert.IsFalse (dr.Read (), "#E6");
dr.Close ();
cmd.Dispose ();
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#F2");
Assert.AreEqual (6000, dr.GetValue (0), "#F3");
Assert.AreEqual (typeof (float), dr.GetFieldType (1), "#F4");
- Assert.AreEqual (-3.40E+38, dr.GetValue (1), "#F5");
+ Assert.AreEqual (-3.40E+38f, (float)dr.GetValue(1), 0.0000001f, "#F4");
Assert.IsFalse (dr.Read (), "#F6");
dr.Close ();
cmd.Dispose ();
string select_by_id = "select id, type_smalldatetime from datetime_family where id = ?";
string delete_data = "delete from datetime_family where id = 6000";
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
string select_by_id = "select id, type_datetime from datetime_family where id = ?";
string delete_data = "delete from datetime_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
OdbcParameter param;
try {
- DateTime date = DateTime.ParseExact ("9999-12-31 23:59:59.997",
- "yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);
+ DateTime date = DateTime.ParseExact ("9999-12-31 23:59:59",
+ "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
cmd = conn.CreateCommand ();
cmd.CommandText = select_data;
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#A2");
Assert.AreEqual (1, dr [0], "#A3");
Assert.AreEqual (typeof (DateTime), dr.GetFieldType (1), "#A4");
- if (ConnectionManager.Singleton.Engine.SupportsMicroseconds)
+ if (ConnectionManager.Instance.Odbc.EngineConfig.SupportsMicroseconds)
Assert.AreEqual (date, dr [1], "#A5");
else
Assert.AreEqual (new DateTime (9999, 12, 31, 23, 59, 59), dr [1], "#A5");
dr.Close ();
cmd.Dispose ();
- date = new DateTime (1973, 8, 13, 17, 54, 33, 953);
+ date = new DateTime (1973, 8, 13, 17, 54, 34);
cmd = conn.CreateCommand ();
cmd.CommandText = insert_data;
Assert.AreEqual (typeof (int), dr.GetFieldType (0), "#C2");
Assert.AreEqual (6000, dr.GetValue (0), "#C3");
Assert.AreEqual (typeof (DateTime), dr.GetFieldType (1), "#C4");
- if (ConnectionManager.Singleton.Engine.SupportsMicroseconds)
- Assert.AreEqual (date, dr.GetValue (1), "#C5");
- else
- Assert.AreEqual (new DateTime (1973, 8, 13, 17, 54, 33), dr.GetValue (1), "#C5");
+ Assert.AreEqual (new DateTime (1973, 8, 13, 17, 54, 34), dr.GetValue (1), "#C5");
Assert.IsFalse (dr.Read (), "#C6");
dr.Close ();
cmd.Dispose ();
string select_by_id = "select type_date from datetime_family where id = ?";
string delete_data = "delete from datetime_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
OdbcParameter param;
try {
- if (!ConnectionManager.Singleton.Engine.SupportsDate)
+ if (!ConnectionManager.Instance.Odbc.EngineConfig.SupportsDate)
Assert.Ignore ("Date test does not apply to the current driver (" + conn.Driver + ").");
DateTime date = new DateTime (9999, 12, 31);
string select_by_id = "select type_time from datetime_family where id = ?";
string delete_data = "delete from datetime_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
OdbcParameter param;
try {
- if (!ConnectionManager.Singleton.Engine.SupportsTime)
+ if (!ConnectionManager.Instance.Odbc.EngineConfig.SupportsTime)
Assert.Ignore ("Time test does not apply to the current driver (" + conn.Driver + ").");
- TimeSpan time = ConnectionManager.Singleton.Engine.SupportsMicroseconds ?
+ TimeSpan time = ConnectionManager.Instance.Odbc.EngineConfig.SupportsMicroseconds ?
new TimeSpan (23, 58, 59, 953) : new TimeSpan (23, 58, 59);
cmd = conn.CreateCommand ();
string select_by_id = "select id, type_guid from string_family where id = ?";
string delete_data = "delete from string_family where id = 6000";
- OdbcConnection conn = (OdbcConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
IDataReader dr = null;
OdbcCommand cmd = null;
OdbcParameter param;
try {
- if (!ConnectionManager.Singleton.Engine.SupportsUniqueIdentifier)
+ if (!ConnectionManager.Instance.Odbc.EngineConfig.SupportsUniqueIdentifier)
Assert.Ignore ("UniqueIdentifier test does not apply to the current driver (" + conn.Driver + ").");
cmd = conn.CreateCommand ();
[Test]
public void DBNullParameterTest()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- try {
- ConnectionManager.Singleton.OpenConnection ();
+ OdbcConnection conn = ConnectionManager.Instance.Odbc.Connection;
+ try
+ {
OdbcDataAdapter Adaptador = new OdbcDataAdapter ();
DataSet Lector = new DataSet ();
Adaptador.Fill (Lector);
Assert.AreEqual (Lector.Tables[0].Rows[0][0], DBNull.Value, "#1 DBNull parameter not passed correctly");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Odbc.CloseConnection ();
}
}
}
}
}
+
+#endif
\ No newline at end of file
using NUnit.Framework;
using System.Collections;
using System.Security.Permissions;
+
using System.Security;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SqlTypes;
-using Mono.Data;
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
[TestFixtureSetUp]
public void init ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
- engine = ConnectionManager.Singleton.Engine;
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
private static EngineConfig Engine {
{
conn.Open ();
}
+
[TearDown]
public void TearDown ()
{
- conn.Close ();
+ conn?.Close ();
}
[Test]
+ [Category("NotWorking")]
public void GetInsertCommand1 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void GetInsertCommand1_Expression ()
{
SqlCommand cmd = null;
}
[Test] // GetInsertCommand (Boolean)
+ [Category("NotWorking")]
public void GetInsertCommand2 ()
{
SqlCommand cmd = null;
}
[Test] // GetUpdateCommand ()
+ [Category("NotWorking")]
public void GetUpdateCommand1 ()
{
SqlCommand cmd = null;
}
[Test] // GetUpdateCommand (Boolean)
+ [Category("NotWorking")]
public void GetUpdateCommand2 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void GetUpdateCommandDBConcurrencyExceptionTest ()
{
string selectQuery = "select id, fname from employee where id = 1";
}
[Test]
+ [Category("NotWorking")]
public void GetDeleteCommandDBConcurrencyExceptionTest ()
{
string selectQuery = "select id, fname from employee where id = 1";
}
[Test] // GetDeleteCommand ()
+ [Category("NotWorking")]
public void GetDeleteCommand1 ()
{
SqlCommand cmd = null;
}
[Test] // GetDeleteCommand ()
+ [Category("NotWorking")]
public void GetDeleteCommand2 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void DefaultProperties ()
{
SqlCommandBuilder cb = new SqlCommandBuilder ();
Assert.IsFalse (param.IsNullable, "#D:IsNullable");
Assert.AreEqual ("@param1", param.ParameterName, "#D:ParameterName");
Assert.AreEqual (5, param.Precision, "#D:Precision");
- if (ClientVersion == 7)
- Assert.AreEqual (2, param.Scale, "#D:Scale");
- else
- Assert.AreEqual (3, param.Scale, "#D:Scale");
+ Assert.AreEqual (2, param.Scale, "#D:Scale");
//Assert.AreEqual (0, param.Size, "#D:Size");
Assert.AreEqual (SqlDbType.Decimal, param.SqlDbType, "#D:SqlDbType");
Assert.IsNull (param.Value, "#D:Value");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
-
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
Assert.AreEqual ("id", param.SourceColumn, prefix + "SourceColumn (0)");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
else
Assert.AreEqual ("@p4", param.ParameterName, prefix + "ParameterName (3)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (3)");
//Assert.AreEqual (0, param.Size, prefix + "Size (3)");
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
{
SqlConnection conn;
SqlCommand cmd;
- string connectionString = ConnectionManager.Singleton.ConnectionString;
+ string connectionString = ConnectionManager.Instance.Sql.ConnectionString;
EngineConfig engine;
static readonly decimal SMALLMONEY_MAX = 214748.3647m;
[SetUp]
public void SetUp ()
{
- engine = ConnectionManager.Singleton.Engine;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
[Test] // bug #341743
public void Dispose_Connection_Disposed ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
cmd.CommandText = "SELECT 'a'";
}
[Test]
+ [Category("NotWorking")]
public void ExecuteScalar ()
{
conn = new SqlConnection (connectionString);
[Test]
public void ExecuteScalar_CommandText_Empty ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
}
[Test]
+ [Category("NotWorking")]
public void ExecuteNonQuery ()
{
conn = new SqlConnection (connectionString);
}
[Test]
+ [Category("NotWorking")]
public void Prepare_Transaction_Only ()
{
SqlTransaction trans = null;
// Text, without parameters
cmd = new SqlCommand ("select count(*) from whatever");
cmd.Transaction = trans;
- try {
- cmd.Prepare ();
- Assert.Fail ("#A1");
- } catch (NullReferenceException) {
- }
+ cmd.Prepare();
// Text, with parameters
cmd = new SqlCommand ("select count(*) from whatever");
cmd.Parameters.Add ("@TestPar1", SqlDbType.Int);
cmd.Transaction = trans;
- try {
- cmd.Prepare ();
- Assert.Fail ("#B1");
- } catch (NullReferenceException) {
- }
+ Assert.Throws<InvalidOperationException>(() => cmd.Prepare());
// Text, parameters cleared
cmd = new SqlCommand ("select count(*) from whatever");
cmd.Parameters.Add ("@TestPar1", SqlDbType.Int);
cmd.Parameters.Clear ();
cmd.Transaction = trans;
- try {
- cmd.Prepare ();
- Assert.Fail ("#C1");
- } catch (NullReferenceException) {
- }
+ cmd.Prepare();
// StoredProcedure, without parameters
cmd = new SqlCommand ("FindCustomer");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Transaction = trans;
- try {
- cmd.Prepare ();
- Assert.Fail ("#D1");
- } catch (NullReferenceException) {
- }
+ cmd.Prepare();
// StoredProcedure, with parameters
cmd = new SqlCommand ("FindCustomer");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add ("@TestPar1", SqlDbType.Int);
cmd.Transaction = trans;
- try {
- cmd.Prepare ();
- Assert.Fail ("#E1");
- } catch (NullReferenceException) {
- }
+ cmd.Prepare();
}
[Test] // bug #412576
SqlParameter idParam;
SqlParameter dojParam;
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- conn.Open ();
+ conn = ConnectionManager.Instance.Sql.Connection;
// parameters with leading '@'
try {
}
[Test] // bug #319598
+ [Category("NotWorking")]
public void LongStoredProcTest ()
{
if (ClientVersion == 7)
[Test]
public void EnumParameterTest ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- ConnectionManager.Singleton.OpenConnection ();
// create temp sp here, should normally be created in Setup of test
// case, but cannot be done right now because of ug #68978
DBHelper.ExecuteNonQuery (conn, "CREATE PROCEDURE #Bug66630 ("
DBHelper.ExecuteNonQuery (conn, "if exists (select name from sysobjects " +
" where name like '#temp_Bug66630' and type like 'P') " +
" drop procedure #temp_Bug66630; ");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
}
[Test]
+ [Category("NotWorking")]
public void StoredProc_ParameterTest ()
{
string create_query = CREATE_TMP_SP_PARAM_TEST;
[Test]
public void OutputParamSizeTest1 ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = new SqlCommand ();
cmd.Connection = conn;
[Test]
public void OutputParamSizeTest2 ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = new SqlCommand ();
cmd.Connection = conn;
[Test]
public void OutputParamSizeTest3 ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = new SqlCommand ();
cmd.Connection = conn;
[Test]
public void OutputParamSizeTest4 ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = new SqlCommand ();
cmd.Connection = conn;
{
SqlParameter newId, id;
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
cmd.CommandText = "set @NewId=@Id + 2";
{
cmd = new SqlCommand ();
string connectionString1 = null;
- connectionString1 = ConnectionManager.Singleton.ConnectionString + "Asynchronous Processing=true";
+ connectionString1 = ConnectionManager.Instance.Sql.ConnectionString + ";Asynchronous Processing=true";
try {
SqlConnection conn1 = new SqlConnection (connectionString1);
conn1.Open ();
Assert.AreEqual ("kumar", reader["lname"], "#1 ");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
[Test]
+ [Ignore("MS .NET doesn't throw IOE here. TODO: check corefx")]
public void BeginExecuteXmlReaderExceptionTest ()
{
cmd = new SqlCommand ();
try {
/*IAsyncResult result = */cmd.BeginExecuteXmlReader ();
} catch (InvalidOperationException) {
- Assert.AreEqual (ConnectionManager.Singleton.ConnectionString, connectionString, "#1 Connection string has changed");
+ Assert.AreEqual (ConnectionManager.Instance.Sql.ConnectionString, connectionString, "#1 Connection string has changed");
return;
}
Assert.Fail ("Expected Exception InvalidOperationException not thrown");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
public void SqlCommandDisposeTest ()
{
IDataReader reader = null;
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
IDbCommand command = conn.CreateCommand ();
try {
while (reader.Read ()) ;
} finally {
reader.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
out int param3Val,
out int rvalVal)
{
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
try {
SqlParameter param0 = new SqlParameter ("@param0", SqlDbType.Int);
cmd = null;
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
conn = null;
}
}
+ "SELECT @deccheck=deccheck from decimalCheck" + Environment.NewLine
+ "END";
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
-
cmd = conn.CreateCommand ();
cmd.CommandText = create_tbl;
cmd.ExecuteNonQuery ();
cmd.CommandText = create_sp;
cmd.ExecuteNonQuery ();
- cmd.CommandText = "monotest.dbo.sp_bug584833";
+ cmd.CommandText = "dbo.sp_bug584833";
cmd.CommandType = CommandType.StoredProcedure;
SqlCommandBuilder.DeriveParameters (cmd);
cmd.ExecuteNonQuery ();
cmd.Dispose ();
cmd = null;
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
conn = null;
}
+ "SELECT @deccheck=deccheck from decimalCheck" + Environment.NewLine
+ "END";
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
-
+
cmd = conn.CreateCommand ();
cmd.CommandText = create_tbl;
cmd.ExecuteNonQuery ();
cmd.ExecuteNonQuery ();
cmd.Dispose ();
cmd = null;
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
conn = null;
}
}
+ "END";
try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
-
+ conn = ConnectionManager.Instance.Sql.Connection;
+
cmd = conn.CreateCommand ();
cmd.CommandText = create_tbl;
cmd.ExecuteNonQuery ();
cmd.ExecuteNonQuery ();
cmd.Dispose ();
cmd = null;
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
conn = null;
}
}
[Test] // bug#561667
public void CmdDispose_DataReaderReset ()
{
- try {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
- string query1 = "SELECT fname FROM employee where lname='kumar'";
+ conn = ConnectionManager.Instance.Sql.Connection;
+ try
+ {
+ string query1 = "SELECT fname FROM employee where lname='kumar'";
string query2 = "SELECT type_int FROM numeric_family where type_bit = 1";
DataTable t = null;
t = GetColumns(conn, query2);
Assert.AreEqual (int.MaxValue, t.Rows[0][0], "CmdDD#2: Query2 result mismatch");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
conn = null;
}
}
using System;
using System.Text;
using System.Collections;
-
using System.Data;
using System.Data.SqlClient;
#endregion
-namespace MonoTests.System.Data.Common
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
public class SqlConnectionStringBuilderTest
{
private SqlConnectionStringBuilder builder = null;
-
+
[Test]
public void DefaultValuestTest ()
{
Assert.AreEqual (false, builder.TrustServerCertificate, "#1 The default value should be false");
builder.TrustServerCertificate = true;
Assert.AreEqual (true, builder.TrustServerCertificate, "#2 The value returned should be true after setting the value of TrustServerCertificate to true");
- Assert.AreEqual ("Trust Server Certificate=True", builder.ConnectionString, "#3 The value of the key TrustServerCertificate should be added to the connection string");
+ Assert.AreEqual ("TrustServerCertificate=True", builder.ConnectionString, "#3 The value of the key TrustServerCertificate should be added to the connection string");
}
[Test]
Assert.AreEqual ("Latest", builder.TypeSystemVersion, "#1 The default value for the property should be Latest");
builder.TypeSystemVersion = "SQL Server 2005";
Assert.AreEqual ("SQL Server 2005", builder.TypeSystemVersion, "#2 The value for the property should be SQL Server 2005 after setting this value");
- Assert.AreEqual ("Type System Version=SQL Server 2005", builder.ConnectionString, "#3 The value of the key Type System Version should be added to the connection string");
+ Assert.AreEqual ("Type System Version=\"SQL Server 2005\"", builder.ConnectionString, "#3 The value of the key Type System Version should be added to the connection string");
}
[Test]
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
public void SetUp ()
{
events = new ArrayList ();
- connectionString = ConnectionManager.Singleton.ConnectionString;
- engine = ConnectionManager.Singleton.Engine;
+ connectionString = ConnectionManager.Instance.Sql.ConnectionString;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
Assert.AreEqual ((byte) 14, ex.Class, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
- Assert.IsTrue (ex.Message.IndexOf ("'invalidLogin'") != -1, "#6");
Assert.AreEqual (18456, ex.Number, "#7");
Assert.AreEqual ((byte) 1, ex.State, "#8");
} finally {
// Cannot open database "invalidDB" requested
// by the login. The login failed
Assert.AreEqual (typeof (SqlException), ex.GetType (), "#2");
- Assert.AreEqual ((byte) 11, ex.Class, "#3");
+ Assert.AreEqual ((byte) 14, ex.Class, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
- Assert.IsTrue (ex.Message.IndexOf ("invalidDB") != -1, "#6: " + ex.Message);
- Assert.AreEqual (4060, ex.Number, "#7");
+ Assert.AreEqual (18456, ex.Number, "#7");
Assert.AreEqual ((byte) 1, ex.State, "#8");
} finally {
conn.Close ();
}
[Test] // bug #383061
+ [Category("NotWorking")]
public void Open_MaxPoolSize_Reached ()
{
- connectionString += "Pooling=true;Connection Lifetime=6;"
- + "Connect Timeout=3;Max Pool Size=2";
+ connectionString += ";Pooling=true;Connection Lifetime=6;Connect Timeout=3;Max Pool Size=2";
SqlConnection conn1 = new SqlConnection (connectionString);
conn1.Open ();
}
[Test] // bug #443131
+ [Category("NotWorking")]
public void ClearPool ()
{
SqlConnection conn1 = new SqlConnection (connectionString);
}
[Test]
+ [Category("NotWorking")]
public void ChangePasswordTest ()
{
string tmpPassword = "modifiedbymonosqlclient";
public class GetSchemaTest
{
SqlConnection conn = null;
- String connectionString = ConnectionManager.Singleton.ConnectionString;
+ String connectionString = ConnectionManager.Instance.Sql.ConnectionString;
[SetUp]
- public void Setup()
+ public void SetUp()
{
conn = new SqlConnection(connectionString);
conn.Open();
[TearDown]
public void TearDown()
{
- conn.Close();
+ conn?.Close();
}
[Test]
{
foreach (DataColumn col in tab1.Columns)
{
- if (col.ColumnName.ToString() == "database_name" && row[col].ToString() == "monotest")
+ if (col.ColumnName.ToString() == "database_name" && row[col].ToString() == ConnectionManager.Instance.DatabaseName)
{
flag = true;
break;
}
[Test]
+ [Ignore("TODO: fix restrictions")]
public void GetSchemaTest14()
{
bool flag = false;
string [] restrictions = new string[4];
- restrictions[0] = "monotest";
+ restrictions[0] = ConnectionManager.Instance.DatabaseName;
restrictions[1] = "dbo";
restrictions[2] = null;
restrictions[3] = "BASE TABLE";
}
[Test]
+ [Ignore("TODO: fix restrictions")]
public void GetSchemaTest15()
{
bool flag = false;
string [] restrictions = new string[4];
- restrictions[0] = "monotest";
+ restrictions[0] = ConnectionManager.Instance.DatabaseName;
restrictions[1] = null;
restrictions[2] = "binary_family";
restrictions[3] = null;
}
[Test]
+ [Ignore("TODO: fix restrictions")]
public void GetSchemaTest16()
{
bool flag = false;
string [] restrictions = new string[4];
- restrictions[0] = "monotest";
+ restrictions[0] = ConnectionManager.Instance.DatabaseName;
restrictions[1] = null;
restrictions[2] = "sp_get_age";
restrictions[3] = null;
bool flag = false;
string [] restrictions = new string[4];
- restrictions[0] = "monotest";
+ restrictions[0] = ConnectionManager.Instance.DatabaseName;
restrictions[1] = null;
restrictions[2] = "sp_get_age";
restrictions[3] = null;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
-using Mono.Data;
using System.Configuration;
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
SqlDataAdapter adapter;
SqlDataReader dr;
DataSet data;
- string connectionString = ConnectionManager.Singleton.ConnectionString;
+ string connectionString = ConnectionManager.Instance.Sql.ConnectionString;
SqlConnection conn;
EngineConfig engine;
[SetUp]
public void SetUp ()
{
- engine = ConnectionManager.Singleton.Engine;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
}
[Test]
+ [Category("NotWorking")]
public void Update_DeleteRow ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
conn.Open ();
DataTable dt = new DataTable ();
}
[Test]
+ [Category("NotWorking")]
public void Update_InsertRow ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
conn.Open ();
DataTable dt = new DataTable ();
}
[Test]
+ [Category("NotWorking")]
public void Update_UpdateRow ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
conn.Open ();
DataTable dt = new DataTable ();
da.Update(dt);
} finally {
DBHelper.ExecuteSimpleSP (conn, "sp_clean_employee_table");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Singleton.Sql.CloseConnection ();
}
}
Assert.AreEqual (true, rowUpdating, "RowUpdating");
} finally {
DBHelper.ExecuteSimpleSP (conn, "sp_clean_employee_table");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Singleton.Sql.CloseConnection ();
}
}
*/
[Test]
public void NullGuidTest()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
+ conn = ConnectionManager.Instance.Sql.Connection;
try {
- ConnectionManager.Singleton.OpenConnection ();
DBHelper.ExecuteNonQuery (conn, "create table #tmp_guid_table ( " +
" id uniqueidentifier default newid (), " +
" name char (10))");
Assert.AreEqual (1, ds.Tables.Count, "#1");
Assert.AreEqual (DBNull.Value, ds.Tables [0].Rows [1] ["id"], "#2");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
// the bug 68804 - is that the fill hangs!
Assert.AreEqual("Done","Done");
}
[Test]
+ [Category("NotWorking")]
public void Fill_Test_Data ()
{
//Check if a table is created for each resultset
}
[Test]
+ [Category("NotWorking")]
public void MissingSchemaActionTest ()
{
adapter = new SqlDataAdapter (
}
[Test]
+ [Category("NotWorking")]
public void MissingMappingActionTest ()
{
adapter = new SqlDataAdapter ("select id,type_bit from numeric_family where id=1",
}
[Test]
+ [Ignore("TODO: Set SSPI Connection String")]
public void CreateViewSSPITest ()
{
- SqlConnection conn = new SqlConnection (ConfigurationSettings.AppSettings ["SSPIConnString"]);
- conn.Open ();
+ var conn = ConnectionManager.Instance.Sql.Connection;
string sql = "create view MONO_TEST_VIEW as select * from Numeric_family";
SqlConnection conn = null;
[Test]
- public void FillDataAdapterTest () {
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- try {
- ConnectionManager.Singleton.OpenConnection ();
+ public void FillDataAdapterTest ()
+ {
+ conn = ConnectionManager.Instance.Sql.Connection;
+ try
+ {
DataTable dt = new DataTable();
SqlCommand command = new SqlCommand ();
command.CommandText = "Select * from employee;";
Assert.AreEqual (6, dt.Columns.Count, "#2");
} finally {
DBHelper.ExecuteSimpleSP (conn, "sp_clean_employee_table");
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
}
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
+ [Category("NotWorking")]
public class SqlDataReaderTest
{
static byte [] long_bytes = new byte [] {
[TestFixtureSetUp]
public void init ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
cmd = conn.CreateCommand ();
sqlDataset = (new DataProvider()).GetDataSet ();
public void Setup ()
{
conn.Open ();
- engine = ConnectionManager.Singleton.Engine;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
public void TearDown ()
{
- if (reader != null)
- reader.Close ();
-
- conn.Close ();
+ reader?.Close ();
+ conn?.Close ();
}
[Test]
}
Assert.AreEqual (false, dr.Read (), "#2");
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
Assert.AreEqual(548967465189498, id, "#3");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
[Test]
public void GetBytes_BufferIndex_Negative ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ var conn = ConnectionManager.Instance.Sql.Connection;
try {
IDbCommand cmd = conn.CreateCommand ();
Assert.AreEqual (5, size);
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
[Test]
public void GetBytes_DataIndex_Negative ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ var conn = ConnectionManager.Instance.Sql.Connection;
try {
IDbCommand cmd = conn.CreateCommand ();
}
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
[Test]
public void GetBytes_Length_Negative ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- conn.Open ();
+ var conn = ConnectionManager.Instance.Sql.Connection;
try {
IDbCommand cmd = conn.CreateCommand ();
Assert.AreEqual (5, size, "#B2");
}
} finally {
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
len = (int)reader.GetChars (0,0,null,0,0);
arr = new char [10];
for (int i = 0; i < len; ++i) {
- Assert.AreEqual (len - i, reader.GetChars (0, i, null, 0, 0), "#9_" + i);
+ Assert.AreEqual (len, reader.GetChars (0, i, null, 0, 0), "#9_" + i);
Assert.AreEqual (1, reader.GetChars (0, i, arr, 0, 1), "#10_" + i);
Assert.AreEqual (charstring [i], arr [0], "#11_" + i);
}
- Assert.AreEqual (0, reader.GetChars (0, len + 10, null, 0, 0));
+ Assert.AreEqual (10, reader.GetChars (0, len + 10, null, 0, 0));
reader.Close ();
}
Assert.IsTrue (rdr.Read (), "#D2");
Assert.IsTrue (rdr.HasRows, "#D3");
Assert.IsFalse (rdr.NextResult (), "#D4");
- Assert.IsFalse (rdr.HasRows, "#D5");
+ Assert.IsTrue (rdr.HasRows, "#D5");
Assert.IsFalse (rdr.Read (), "#D6");
- Assert.IsFalse (rdr.HasRows, "#D7");
+ Assert.IsTrue(rdr.HasRows, "#D7");
}
cmd.CommandText = "SELECT id FROM employee WHERE id = 666; SELECT 3";
Assert.IsFalse (rdr.Read (), "#E2");
Assert.IsFalse (rdr.HasRows, "#E3");
Assert.IsFalse (rdr.NextResult (), "#E4");
- Assert.IsFalse (rdr.HasRows, "#E5");
+ Assert.IsTrue (rdr.HasRows, "#E5");
Assert.IsFalse (rdr.Read (), "#E6");
- Assert.IsFalse (rdr.HasRows, "#E7");
+ Assert.IsTrue (rdr.HasRows, "#E7");
}
cmd.CommandText = "SELECT id FROM employee WHERE id = 1; SELECT 3";
[Test]
public void GetSchemaTable ()
{
- IDbConnection conn = ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ var conn = ConnectionManager.Instance.Sql.Connection;
IDbCommand cmd = null;
IDataReader reader = null;
cmd.Dispose ();
if (reader != null)
reader.Close ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Sql.CloseConnection ();
}
}
datetimeDataTable);
}
- string connectionString = ConnectionManager.Singleton.ConnectionString;
+ string connectionString = ConnectionManager.Instance.Sql.ConnectionString;
//FIXME : Add more test cases
[Test]
[TestFixture]
[Category ("sqlserver")]
+ [Category("NotWorking")]
public class SqlDataReaderSchemaTest
{
SqlConnection conn;
[SetUp]
public void SetUp ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
+ conn = ConnectionManager.Instance.Sql.Connection;
cmd = conn.CreateCommand ();
- engine = ConnectionManager.Singleton.Engine;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
{
if (cmd != null)
cmd.Dispose ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Close ();
}
[Test]
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (19, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (19, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (23, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (23, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (15, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (15, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (10, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (10, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (19, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (19, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (7, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (7, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (16, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (16, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (5, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (5, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (10, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (10, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (3, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (3, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericPrecision"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericPrecision"], "Value");
- else
- Assert.AreEqual (255, row ["NumericPrecision"], "Value");
+ Assert.AreEqual (255, row ["NumericPrecision"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (3, row ["NumericScale"], "Value");
+ Assert.AreEqual (3, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataTable schemaTable = rdr.GetSchemaTable ();
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("NumericScale"), "IsNull");
- if (ClientVersion > 7)
- Assert.AreEqual (0, row ["NumericScale"], "Value");
- else
- Assert.AreEqual (255, row ["NumericScale"], "Value");
+ Assert.AreEqual (255, row ["NumericScale"], "Value");
}
}
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("ProviderType"), "IsNull");
Assert.AreEqual (0, row ["ProviderType"], "Value");
- }
+ }
}
[Test]
DataRow row = schemaTable.Rows [0];
Assert.IsFalse (row.IsNull ("ProviderType"), "IsNull");
// we currently consider timestamp as binary (due to TDS 7.0?)
- if (ClientVersion > 7)
- Assert.AreEqual (1, row ["ProviderType"], "Value");
- else
- Assert.AreEqual (19, row ["ProviderType"], "Value");
+ Assert.AreEqual (19, row ["ProviderType"], "Value");
}
}
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
public class SqlParameterCollectionTest
- {
-
+ {
[Test]
public void CopyToTest ()
{
Assert.AreEqual (p1Lname, destinationArray[2], "#5 The parameter at index 2 must be p1Lname");
Assert.AreEqual (null, destinationArray[3], "#6 The parameter at index 3 must not change");
}
-
}
}
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
[SetUp]
public void SetUp ()
{
- conn = (SqlConnection) ConnectionManager.Singleton.Connection;
- ConnectionManager.Singleton.OpenConnection ();
- engine = ConnectionManager.Singleton.Engine;
+ conn = ConnectionManager.Instance.Sql.Connection;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
cmd.Dispose ();
if (rdr != null)
rdr.Close ();
- ConnectionManager.Singleton.CloseConnection ();
+ ConnectionManager.Instance.Close ();
}
[Test] // bug #324840
}
[Test] // bug #382635
+ [Category("NotWorking")]
public void ParameterSize_compatibility_Test ()
{
string longstring = "abcdefghijklmnopqrstuvwxyz";
rdr = selectCmd.ExecuteReader ();
Assert.IsTrue (rdr.Read (), "#C1");
- Assert.AreEqual (20, rdr.GetValue (0), "#C2");
- Assert.AreEqual (longstring.Substring (0, 20), rdr.GetValue (1), "#C3");
+ Assert.AreEqual (14, rdr.GetValue (0), "#C2");
+ Assert.AreEqual (longstring.Substring (0, 14), rdr.GetValue (1), "#C3");
rdr.Close ();
}
using NUnit.Framework;
-namespace MonoTests.System.Data.SqlClient
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
[SetUp]
public void SetUp ()
{
- connectionString = ConnectionManager.Singleton.ConnectionString;
- engine = ConnectionManager.Singleton.Engine;
+ connectionString = ConnectionManager.Instance.Sql.ConnectionString;
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
[TearDown]
// operation or the server is not responding
Assert.AreEqual (typeof (SqlException), ex.GetType (), "#B2");
Assert.AreEqual ((byte) 11, ex.Class, "#B3");
- Assert.IsNull (ex.InnerException, "#B4");
Assert.IsNotNull (ex.Message, "#B5");
Assert.AreEqual (-2, ex.Number, "#B6");
Assert.AreEqual ((byte) 0, ex.State, "#B7");
}
[Test]
+ [Ignore("Deesn't work on mono. TODO:Fix")]
public void Save_TransactionName_Null ()
{
if (RunningOnMono)
<sectionGroup name="mono.data">
<section name="providers" type="Mono.Data.ProviderSectionHandler,Mono.Data" />
</sectionGroup>
- <section name="providerTests" type="MonoTests.System.Data.ProviderTestsConfigurationHandler, System.Data.Connected.Tests" />
+ <section name="providerTests" type="MonoTests.System.Data.Connected.ProviderTestsConfigurationHandler, System.Data.Connected.Tests" />
</configSections>
<providerTests>
<engines>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
- <section name="providerTests" type="MonoTests.System.Data.ProviderTestsConfigurationHandler, System.Data.Connected.Tests" />
+ <section name="providerTests" type="MonoTests.System.Data.Connected.ProviderTestsConfigurationHandler, System.Data.Connected.Tests" />
</configSections>
<providerTests>
<engines>
===========================================================================================
*/
-use monotest;
-
/*
=================================== OBJECT NUMERIC_FAMILY =========================
-- TABLE : NUMERIC_FAMILY
`type_text` text NULL,
`type_ntext` longtext CHARACTER SET ucs2 COLLATE ucs2_general_ci NULL);
-grant all privileges on string_family to monotester;
-
insert into string_family values (1, 'char', 'nchà¤à¤¾r', 'varchar', 'nvà¤à¤¾à¤°à¤¤r', 'text', 'ntà¤à¤¾xt');
insert into string_family values (2, '0123456789', '0123456789', 'varchar ', 'nvà¤à¤¾à¤°à¤¤r ', 'longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext ', 'ntà¤à¤¾xt ');
insert into string_family values (3, '', '', '', '', '', '');
`type_time` time NULL,
`type_date` date NULL);
-grant all privileges on datetime_family to monotester;
-
-insert into `datetime_family` values (1,'2037-12-31 23:59:00','9999-12-31 23:59:59.997','23:58:59.953','9999-12-31');
+insert into `datetime_family` values (1,'2037-12-31 23:59:00','9999-12-31 23:59:59','23:58:59','9999-12-31');
insert into `datetime_family` values (4,null,null,null,null);
/*
`doj` datetime NOT NULL,
`email` varchar (50));
-grant all privileges on employee to monotester;
-
insert into `employee` values (1, 'suresh', 'kumar', '1978-08-22', '2001-03-12', 'suresh@gmail.com');
insert into `employee` values (2, 'ramesh', 'rajendran', '1977-02-15', '2005-02-11', 'ramesh@yahoo.com');
insert into `employee` values (3, 'venkat', 'ramakrishnan', '1977-06-12', '2003-12-11', 'ramesh@yahoo.com');
delimiter //
drop procedure if exists sp_clean_employee_table
//
-CREATE DEFINER=`monotester`@`localhost` PROCEDURE `sp_clean_employee_table`()
+CREATE PROCEDURE `sp_clean_employee_table`()
begin
delete from employee where `id` > 6000;
end
-use monotest;
-
-- =================================== OBJECT NUMERIC_FAMILY============================
-- TABLE : NUMERIC_FAMILY
-- data with id > 6000 is not gaurenteed to be read-only.
type_autoincrement int identity (2, 3));
go
-grant all privileges on numeric_family to monotester;
-go
insert into numeric_family (id, type_bit, type_tinyint, type_smallint, type_int, type_bigint, type_decimal1, type_decimal2, type_numeric1, type_numeric2, type_money, type_smallmoney, type_float, type_double)
values (1, 1, 255, 32767, 2147483647, 9223372036854775807, 1000, 4456.432, 1000, 4456.432, 922337203685477.5807, 214748.3647, 3.40E+38, 1.79E+308);
type_timestamp timestamp NULL);
go
-grant all privileges on binary_family to monotester;
-go
-
insert into binary_family (id, type_binary, type_varbinary, type_blob, type_tinyblob, type_mediumblob, type_longblob_image) values (
1,
convert (binary, '5'),
type_ntext ntext NULL);
go
-grant all privileges on string_family to monotester;
-go
-
insert into string_family values (1, 'd222a130-6383-4d36-ac5e-4e6b2591aabf', 'char', N'nchà¤à¤¾r', 'varchar', N'nvà¤à¤¾à¤°à¤¤r', 'text', N'ntà¤à¤¾xt');
insert into string_family values (2, '1c47dd1d-891b-47e8-aac8-f36608b31bc5', '0123456789', '0123456789', 'varchar ', N'nvà¤à¤¾à¤°à¤¤r ', 'longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext longtext ', N'ntà¤à¤¾xt ');
insert into string_family values (3, '3c47dd1d-891b-47e8-aac8-f36608b31bc5', '', '', '', '', '', '');
type_smalldatetime smalldatetime NULL,
type_datetime datetime NULL);
-grant all privileges on datetime_family to monotester;
go
insert into datetime_family values (1,'2037-12-31 23:59:00','9999-12-31 23:59:59:997');
insert into datetime_family values (4,null,null);
email varchar (50) NULL);
go
-grant all privileges on employee to monotester;
-
-go
-
insert into employee values (1, 'suresh', 'kumar', '1978-08-22', '2001-03-12', 'suresh@gmail.com');
insert into employee values (2, 'ramesh', 'rajendran', '1977-02-15', '2005-02-11', 'ramesh@yahoo.com');
insert into employee values (3, 'venkat', 'ramakrishnan', '1977-06-12', '2003-12-11', 'ramesh@yahoo.com');
end
go
-grant execute on sp_clean_employee_table to monotester;
-
-- SP : sp_get_age
if exists (select name from sysobjects where
name = 'sp_get_age' and type = 'P')
end
go
-grant execute on sp_get_age to monotester;
-
-- =================================== END OBJECT EMPLOYEE ============================
-- SP : sp_326182a
end
go
-grant execute on sp_326182a to monotester;
-
-- SP: sp_326182b
if exists (select name from sysobjects where
begin
set @param1 = (@param0 + @param1 + 2)
return 666
-end
-go
-
-grant execute on sp_326182b to monotester;
\ No newline at end of file
+end
\ No newline at end of file
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Common;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Odbc;
}
}
}
+
+#endif
\ No newline at end of file
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+#if !NO_ODBC
using System;
using System.Collections;
using System.Data;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Odbc;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Data;
using System.Data.Odbc;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System.Data.Odbc;
using NUnit.Framework;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Text;
using System.Data;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using System;
using System.Text;
using System.Data;
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+#if !NO_ODBC\r
+\r
using NUnit.Framework;\r
using System;\r
using System.Data;\r
}\r
}\r
}\r
+\r
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_ODBC
+
using NUnit.Framework;
using System;
using System.Data;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_OLEDB
+
using System.Data;
using System.Data.OleDb;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_OLEDB
using System;
using System.Data;
using System.Data.OleDb;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_OLEDB
+
using System;
using System.Data;
+#if !NO_ODBC
using System.Data.Odbc;
+#endif
using System.Data.OleDb;
using NUnit.Framework;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_OLEDB
+
using System.Data.OleDb;
using NUnit.Framework;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !NO_OLEDB
using NUnit.Framework;
using System;
using System.Data;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+#if !NO_OLEDB\r
using NUnit.Framework;\r
using System;\r
using System.Data;\r
}\r
}\r
}\r
+\r
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+#if !NO_OLEDB\r
+\r
using NUnit.Framework;\r
using System;\r
using System.Data;\r
}\r
}\r
}\r
+\r
+#endif
\ No newline at end of file
type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="connectionStrings_test"
type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
+ <section name="providerTests" type="MonoTests.System.Data.Connected.ProviderTestsConfigurationHandler, net_4_x_System.Data_test" />
</configSections>
<system.data>
<DbProviderFactories>
<add name="Publications" providerName="System.Data.SqlClient"
connectionString="Data Source=MyServer;Initial Catalog=pubs;integrated security=SSPI" />
</connectionStrings_test>
+ <providerTests>
+ <engines>
+ <engine
+ name="sqlserver2005"
+ type="SQLServer"
+ clientversion="9"
+ quoteCharacter="""
+ removesTrailingSpaces="false"
+ emptyBinaryAsNull="false"
+ supportsMicroseconds="true"
+ supportsUniqueIdentifier="true"
+ supportsDate="false"
+ supportsTime="false"
+ supportsTimestamp="true" />
+ <engine
+ name="mysql51"
+ type="MySQL"
+ quoteCharacter="`"
+ removesTrailingSpaces="true"
+ emptyBinaryAsNull="true"
+ supportsMicroseconds="false"
+ supportsUniqueIdentifier="false"
+ supportsDate="true"
+ supportsTime="true"
+ supportsTimestamp="false" />
+ </engines>
+ <connections>
+ <connection
+ name="sqlserver-tds"
+ factory="System.Data.SqlClient"
+ connectionString=""
+ engine="sqlserver2005" />
+ <connection
+ name="mysql-odbc"
+ factory="System.Data.Odbc"
+ connectionString=""
+ engine="mysql51" />
+ </connections>
+ </providerTests>
Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/SR.cs
../../build/common/MonoTODOAttribute.cs
+++ /dev/null
-System.Data.Odbc/OdbcCommandBuilderTest.cs
-System.Data.Odbc/OdbcCommandTest.cs
-System.Data.Odbc/OdbcConnectionStringBuilderTest.cs
-System.Data.Odbc/OdbcConnectionTest.cs
-System.Data.Odbc/OdbcDataAdapterTest.cs
-System.Data.Odbc/OdbcDataReaderTest.cs
-System.Data.Odbc/OdbcMetaDataCollectionNamesTest.cs
-System.Data.Odbc/OdbcParameterCollectionTest.cs
-System.Data.Odbc/OdbcParameterTest.cs
-System.Data.Odbc/OdbcPermissionAttributeTest.cs
-System.Data.Odbc/OdbcPermissionTest.cs
-System.Data.OleDb/OleDbCommandTest.cs
-System.Data.OleDb/OleDbConnectionTest.cs
-System.Data.OleDb/OleDbDataAdapterTest.cs
-System.Data.OleDb/OleDbMetaDataCollectionNamesTest.cs
-System.Data.OleDb/OleDbParameterCollectionTest.cs
-System.Data.OleDb/OleDbPermissionAttributeTest.cs
-System.Data.OleDb/OleDbPermissionTest.cs
+++ /dev/null
-System.Data.Odbc/OdbcCommandBuilderTest.cs
-System.Data.Odbc/OdbcCommandTest.cs
-System.Data.Odbc/OdbcConnectionStringBuilderTest.cs
-System.Data.Odbc/OdbcConnectionTest.cs
-System.Data.Odbc/OdbcDataAdapterTest.cs
-System.Data.Odbc/OdbcDataReaderTest.cs
-System.Data.Odbc/OdbcMetaDataCollectionNamesTest.cs
-System.Data.Odbc/OdbcParameterCollectionTest.cs
-System.Data.Odbc/OdbcParameterTest.cs
-System.Data.Odbc/OdbcPermissionAttributeTest.cs
-System.Data.Odbc/OdbcPermissionTest.cs
-System.Data.OleDb/OleDbCommandTest.cs
-System.Data.OleDb/OleDbConnectionTest.cs
-System.Data.OleDb/OleDbDataAdapterTest.cs
-System.Data.OleDb/OleDbMetaDataCollectionNamesTest.cs
-System.Data.OleDb/OleDbParameterCollectionTest.cs
-System.Data.OleDb/OleDbPermissionAttributeTest.cs
-System.Data.OleDb/OleDbPermissionTest.cs
}
public virtual CodeStatementCollection SerializeMember (IDesignerSerializationManager manager,
- object owningobject, MemberDescriptor member)
+ object owningObject, MemberDescriptor member)
{
if (member == null)
throw new ArgumentNullException ("member");
- if (owningobject == null)
- throw new ArgumentNullException ("owningobject");
+ if (owningObject == null)
+ throw new ArgumentNullException ("owningObject");
if (manager == null)
throw new ArgumentNullException ("manager");
CodeStatementCollection statements = new CodeStatementCollection ();
- CodeExpression expression = base.GetExpression (manager, owningobject);
+ CodeExpression expression = base.GetExpression (manager, owningObject);
if (expression == null) {
- string name = manager.GetName (owningobject);
+ string name = manager.GetName (owningObject);
if (name == null)
- name = base.GetUniqueName (manager, owningobject);
+ name = base.GetUniqueName (manager, owningObject);
expression = new CodeVariableReferenceExpression (name);
- base.SetExpression (manager, owningobject, expression);
+ base.SetExpression (manager, owningObject, expression);
}
if (member is PropertyDescriptor)
- base.SerializeProperty (manager, statements, owningobject, (PropertyDescriptor) member);
+ base.SerializeProperty (manager, statements, owningObject, (PropertyDescriptor) member);
if (member is EventDescriptor)
- base.SerializeEvent (manager, statements, owningobject, (EventDescriptor) member);
+ base.SerializeEvent (manager, statements, owningObject, (EventDescriptor) member);
return statements;
}
public virtual CodeStatementCollection SerializeMemberAbsolute (IDesignerSerializationManager manager,
- object owningobject, MemberDescriptor member)
+ object owningObject, MemberDescriptor member)
{
if (member == null)
throw new ArgumentNullException ("member");
- if (owningobject == null)
- throw new ArgumentNullException ("owningobject");
+ if (owningObject == null)
+ throw new ArgumentNullException ("owningObject");
if (manager == null)
throw new ArgumentNullException ("manager");
SerializeAbsoluteContext context = new SerializeAbsoluteContext (member);
manager.Context.Push (context);
- CodeStatementCollection result = this.SerializeMember (manager, owningobject, member);
+ CodeStatementCollection result = this.SerializeMember (manager, owningObject, member);
manager.Context.Pop ();
return result;
}
{
}
- protected CodeExpression SerializeToExpression (IDesignerSerializationManager manager, object instance)
+ protected CodeExpression SerializeToExpression (IDesignerSerializationManager manager, object value)
{
if (manager == null)
throw new ArgumentNullException ("manager");
CodeExpression expression = null;
- if (instance != null)
- expression = this.GetExpression (manager, instance); // 1 - IDesignerSerializationManager.GetExpression
+ if (value != null)
+ expression = this.GetExpression (manager, value); // 1 - IDesignerSerializationManager.GetExpression
if (expression == null) {
- CodeDomSerializer serializer = this.GetSerializer (manager, instance); // 2 - manager.GetSerializer().Serialize()
+ CodeDomSerializer serializer = this.GetSerializer (manager, value); // 2 - manager.GetSerializer().Serialize()
if (serializer != null) {
- object serialized = serializer.Serialize (manager, instance);
+ object serialized = serializer.Serialize (manager, value);
expression = serialized as CodeExpression; // 3 - CodeStatement or CodeStatementCollection
if (expression == null) {
CodeStatement statement = serialized as CodeStatement;
CodeStatementCollection contextStatements = null;
StatementContext context = manager.Context[typeof (StatementContext)] as StatementContext;
- if (context != null && instance != null)
- contextStatements = context.StatementCollection[instance];
+ if (context != null && value != null)
+ contextStatements = context.StatementCollection[value];
if (contextStatements == null)
contextStatements = manager.Context[typeof (CodeStatementCollection)] as CodeStatementCollection;
}
}
}
- if (expression == null && instance != null)
- expression = this.GetExpression (manager, instance); // 4
+ if (expression == null && value != null)
+ expression = this.GetExpression (manager, value); // 4
} else {
- ReportError (manager, "No serializer found for type '" + instance.GetType ().Name + "'");
+ ReportError (manager, "No serializer found for type '" + value.GetType ().Name + "'");
}
}
return expression;
}
- protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, object instance)
+ protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, object value)
{
DesignerSerializerAttribute attrInstance, attrType;
attrType = attrInstance = null;
CodeDomSerializer serializer = null;
- if (instance == null)
+ if (value == null)
serializer = this.GetSerializer (manager, null);
else {
- AttributeCollection attributes = TypeDescriptor.GetAttributes (instance);
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (value);
foreach (Attribute a in attributes) {
DesignerSerializerAttribute designerAttr = a as DesignerSerializerAttribute;
if (designerAttr != null && manager.GetType (designerAttr.SerializerBaseTypeName) == typeof (CodeDomSerializer)) {
}
}
- attributes = TypeDescriptor.GetAttributes (instance.GetType ());
+ attributes = TypeDescriptor.GetAttributes (value.GetType ());
foreach (Attribute a in attributes) {
DesignerSerializerAttribute designerAttr = a as DesignerSerializerAttribute;
if (designerAttr != null && manager.GetType (designerAttr.SerializerBaseTypeName) == typeof (CodeDomSerializer)) {
if (attrType != null && attrInstance != null && attrType.SerializerTypeName != attrInstance.SerializerTypeName)
serializer = Activator.CreateInstance (manager.GetType (attrInstance.SerializerTypeName)) as CodeDomSerializer;
else
- serializer = this.GetSerializer (manager, instance.GetType ());
+ serializer = this.GetSerializer (manager, value.GetType ());
}
return serializer;
}
- protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, Type instanceType)
+ protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, Type valueType)
{
- return manager.GetSerializer (instanceType, typeof (CodeDomSerializer)) as CodeDomSerializer;
+ return manager.GetSerializer (valueType, typeof (CodeDomSerializer)) as CodeDomSerializer;
}
- protected CodeExpression GetExpression (IDesignerSerializationManager manager, object instance)
+ protected CodeExpression GetExpression (IDesignerSerializationManager manager, object value)
{
if (manager == null)
throw new ArgumentNullException ("manager");
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
CodeExpression expression = null;
ExpressionTable expressions = manager.Context[typeof (ExpressionTable)] as ExpressionTable;
if (expressions != null) // 1st try: ExpressionTable
- expression = expressions [instance] as CodeExpression;
+ expression = expressions [value] as CodeExpression;
if (expression == null) { // 2nd try: RootContext
RootContext context = manager.Context[typeof (RootContext)] as RootContext;
- if (context != null && context.Value == instance)
+ if (context != null && context.Value == value)
expression = context.Expression;
}
if (expression == null) { // 3rd try: IReferenceService (instance.property.property.property
- string name = manager.GetName (instance);
+ string name = manager.GetName (value);
if (name == null || name.IndexOf (".") == -1) {
IReferenceService service = manager.GetService (typeof (IReferenceService)) as IReferenceService;
if (service != null) {
- name = service.GetName (instance);
+ name = service.GetName (value);
if (name != null && name.IndexOf (".") != -1) {
string[] parts = name.Split (new char[] { ',' });
- instance = manager.GetInstance (parts[0]);
- if (instance != null) {
- expression = SerializeToExpression (manager, instance);
+ value = manager.GetInstance (parts[0]);
+ if (value != null) {
+ expression = SerializeToExpression (manager, value);
if (expression != null) {
for (int i=1; i < parts.Length; i++)
expression = new CodePropertyReferenceExpression (expression, parts[i]);
return expression;
}
- protected void SetExpression (IDesignerSerializationManager manager, object instance, CodeExpression expression)
+ protected void SetExpression (IDesignerSerializationManager manager, object value, CodeExpression expression)
{
- SetExpression (manager, instance, expression, false);
+ SetExpression (manager, value, expression, false);
}
// XXX: isPreset - what does this do when set?
//
- protected void SetExpression (IDesignerSerializationManager manager, object instance, CodeExpression expression, bool isPreset)
+ protected void SetExpression (IDesignerSerializationManager manager, object value, CodeExpression expression, bool isPreset)
{
if (manager == null)
throw new ArgumentNullException ("manager");
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (expression == null)
throw new ArgumentNullException ("expression");
manager.Context.Append (expressions);
}
- expressions[instance] = expression;
+ expressions[value] = expression;
}
protected bool IsSerialized (IDesignerSerializationManager manager, object value)
}
// XXX: What should honorPreset do?
- protected bool IsSerialized (IDesignerSerializationManager manager, object instance, bool honorPreset)
+ protected bool IsSerialized (IDesignerSerializationManager manager, object value, bool honorPreset)
{
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (manager == null)
throw new ArgumentNullException ("manager");
- if (this.GetExpression (manager, instance) != null)
+ if (this.GetExpression (manager, value) != null)
return true;
else
return false;
return manager.CreateInstance (type, parameters, name, addToContainer);
}
- protected string GetUniqueName (IDesignerSerializationManager manager, object instance)
+ protected string GetUniqueName (IDesignerSerializationManager manager, object value)
{
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (manager == null)
throw new ArgumentNullException ("manager");
- string name = manager.GetName (instance);
+ string name = manager.GetName (value);
if (name == null) {
INameCreationService service = manager.GetService (typeof (INameCreationService)) as INameCreationService;
- name = service.CreateName (null, instance.GetType ());
+ name = service.CreateName (null, value.GetType ());
if (name == null)
- name = instance.GetType ().Name.ToLower ();
- manager.SetName (instance, name);
+ name = value.GetType ().Name.ToLower ();
+ manager.SetName (value, name);
}
return name;
}
return instance;
}
- public object GetSerializer (Type componentType, Type serializerType)
+ public object GetSerializer (Type objectType, Type serializerType)
{
VerifyInSession ();
object serializer = null;
- if (componentType != null) {
+ if (objectType != null) {
// try 1: from cache
//
- _serializersCache.TryGetValue (componentType, out serializer);
+ _serializersCache.TryGetValue (objectType, out serializer);
// check for provider attribute and add it to the list of providers
//
if (serializer != null && !serializerType.IsAssignableFrom (serializer.GetType ()))
serializer = null;
- AttributeCollection attributes = TypeDescriptor.GetAttributes (componentType);
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (objectType);
DefaultSerializationProviderAttribute providerAttribute = attributes[typeof (DefaultSerializationProviderAttribute)]
as DefaultSerializationProviderAttribute;
if (providerAttribute != null && this.GetType (providerAttribute.ProviderTypeName) == serializerType) {
// try 2: DesignerSerializerAttribute
//
- if (serializer == null && componentType != null) {
- AttributeCollection attributes = TypeDescriptor.GetAttributes (componentType);
+ if (serializer == null && objectType != null) {
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (objectType);
DesignerSerializerAttribute serializerAttribute = attributes[typeof (DesignerSerializerAttribute)] as DesignerSerializerAttribute;
if (serializerAttribute != null &&
this.GetType (serializerAttribute.SerializerBaseTypeName) == serializerType) {
}
if (serializer != null)
- _serializersCache[componentType] = serializer;
+ _serializersCache[objectType] = serializer;
}
// try 3: from provider
//
if (serializer == null && _serializationProviders != null) {
foreach (IDesignerSerializationProvider provider in _serializationProviders) {
- serializer = provider.GetSerializer (this, null, componentType, serializerType);
+ serializer = provider.GetSerializer (this, null, objectType, serializerType);
if (serializer != null)
break;
}
_serializationCompleteHandler (this, EventArgs.Empty);
}
- protected virtual Type GetType (string name)
+ protected virtual Type GetType (string typeName)
{
- if (name == null)
- throw new ArgumentNullException ("name");
+ if (typeName == null)
+ throw new ArgumentNullException ("typeName");
this.VerifyInSession ();
Type result = null;
ITypeResolutionService typeResSvc = this.GetService (typeof (ITypeResolutionService)) as ITypeResolutionService;
if (typeResSvc != null)
- result = typeResSvc.GetType (name);
+ result = typeResSvc.GetType (typeName);
if (result == null)
- result = Type.GetType (name);
+ result = Type.GetType (typeName);
return result;
}
}
#endregion
- object IServiceProvider.GetService (Type service)
+ object IServiceProvider.GetService (Type serviceType)
{
- return this.GetService (service);
+ return this.GetService (serviceType);
}
- protected virtual object GetService (Type service)
+ protected virtual object GetService (Type serviceType)
{
object result = null;
if (_serviceProvider != null)
- result = _serviceProvider.GetService (service);
+ result = _serviceProvider.GetService (serviceType);
return result;
}
return _statements.GetEnumerator ();
}
- public CodeStatementCollection this[object owner]
+ public CodeStatementCollection this[object statementOwner]
{
- get { return _statements[owner] as CodeStatementCollection; }
+ get { return _statements[statementOwner] as CodeStatementCollection; }
}
IEnumerator IEnumerable.GetEnumerator()
CodeExpression _expression;
object _value;
- public RootContext (CodeExpression expresion, object value)
+ public RootContext (CodeExpression expression, object value)
{
- if (expresion == null)
+ if (expression == null)
throw new ArgumentNullException ("expression");
if (value == null)
throw new ArgumentNullException ("value");
- _expression = expresion;
+ _expression = expression;
_value = value;
}
// Helper method - not an ISerivceProvider
//
- protected virtual object GetService (Type service)
+ protected virtual object GetService (Type serviceType)
{
if (_component != null && _component.Site != null)
- return _component.Site.GetService (service);
+ return _component.Site.GetService (serviceType);
return null;
}
{
}
- public DesignSurfaceManager (IServiceProvider serviceProvider)
+ public DesignSurfaceManager (IServiceProvider parentProvider)
{
- _parentProvider = serviceProvider;
+ _parentProvider = parentProvider;
this.ServiceContainer.AddService (typeof (IDesignerEventService), new DesignerEventService ());
}
}
- public object GetService (Type service)
+ public object GetService (Type serviceType)
{
if (_serviceContainer != null)
- return _serviceContainer.GetService (service);
+ return _serviceContainer.GetService (serviceType);
return null;
}
protected abstract bool ShowCode (IComponent component, EventDescriptor e, string methodName);
protected abstract bool ShowCode (int lineNumber);
protected abstract bool ShowCode ();
- protected abstract string CreateUniqueMethodName (IComponent component, EventDescriptor eventDescriptor);
- protected abstract ICollection GetCompatibleMethods (EventDescriptor eventDescriptor);
+ protected abstract string CreateUniqueMethodName (IComponent component, EventDescriptor e);
+ protected abstract ICollection GetCompatibleMethods (EventDescriptor e);
protected virtual void FreeMethod (IComponent component, EventDescriptor e, string methodName)
{
}
- protected object GetService (Type service)
+ protected object GetService (Type serviceType)
{
if (_provider != null)
- return _provider.GetService (service);
+ return _provider.GetService (serviceType);
return null;
}
return false;
}
- public virtual bool GlobalInvoke (CommandID commandID, object arg)
+ public virtual bool GlobalInvoke (CommandID commandId, object arg)
{
- if (commandID == null)
- throw new ArgumentNullException ("commandID");
+ if (commandId == null)
+ throw new ArgumentNullException ("commandId");
- MenuCommand command = this.FindCommand (commandID);
+ MenuCommand command = this.FindCommand (commandId);
if (command != null) {
command.Invoke (arg);
return true;
errorList.Add (info.GetString("KEY_ARRAYVALUES" + i));
}
- public TypedDataSetGeneratorException (String error) : base (error)
+ public TypedDataSetGeneratorException (String message) : base (message)
{
}
- public TypedDataSetGeneratorException (String error, Exception inner)
- : base (error, inner)
+ public TypedDataSetGeneratorException (String message, Exception innerException)
+ : base (message, innerException)
{
}
#endregion //Constructors
#region Methods
- public override void GetObjectData (SerializationInfo si, StreamingContext context)
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
- base.GetObjectData (si, context);
+ base.GetObjectData (info, context);
int count = (errorList != null) ? ErrorList.Count : 0;
- si.AddValue ("KEY_ARRAYCOUNT", count);
+ info.AddValue ("KEY_ARRAYCOUNT", count);
for (int i=0; i < count; i++)
- si.AddValue("KEY_ARRAYVALUES" + i, ErrorList [i]);
+ info.AddValue("KEY_ARRAYVALUES" + i, ErrorList [i]);
}
#endregion // Methods
{
int initial_page;
- public BaseDataListComponentEditor (int initial_page)
+ public BaseDataListComponentEditor (int initialPage)
{
- this.initial_page = initial_page;
+ this.initial_page = initialPage;
}
public override bool EditComponent (
}
protected IEnumerable GetDesignTimeDataSource (
- int minimum_rows,
- out bool dummy_data_source)
+ int minimumRows,
+ out bool dummyDataSource)
{
throw new NotImplementedException ();
}
protected IEnumerable GetDesignTimeDataSource (
- IEnumerable selected_data_source,
- int minimum_rows,
- out bool dummy_data_source)
+ IEnumerable selectedDataSource,
+ int minimumRows,
+ out bool dummyDataSource)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public override IEnumerable GetTemplateContainerDataSource (string template_name)
+ public override IEnumerable GetTemplateContainerDataSource (string templateName)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected internal void InvokePropertyBuilder (int initial_page)
+ protected internal void InvokePropertyBuilder (int initialPage)
{
throw new NotImplementedException ();
}
{
}
- public DataListComponentEditor (int initial_page)
- : base (initial_page)
+ public DataListComponentEditor (int initialPage)
+ : base (initialPage)
{
}
throw new NotImplementedException ();
}
- public override void DataBindControl (IDesignerHost designer_host, Control control)
+ public override void DataBindControl (IDesignerHost designerHost, Control control)
{
throw new NotImplementedException ();
}
{
}
- protected override void MapPropertyToStyle (string name, object value)
+ protected override void MapPropertyToStyle (string propName, object varPropValue)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected IEnumerable GetDesignTimeDataSource (int minimum_rows)
+ protected IEnumerable GetDesignTimeDataSource (int minimumRows)
{
throw new NotImplementedException ();
}
protected IEnumerable GetDesignTimeDataSource (
- IEnumerable selected_data_source,
- int minimum_rows)
+ IEnumerable selectedDataSource,
+ int minimumRows)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public override void OnComponentChanged (object sender, ComponentChangedEventArgs e)
+ public override void OnComponentChanged (object source, ComponentChangedEventArgs ce)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected override object CreateInstance (Type item_type)
+ protected override object CreateInstance (Type itemType)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected override object CreateInstance (Type item_type)
+ protected override object CreateInstance (Type itemType)
{
throw new NotImplementedException ();
}
return false;
}
- protected override object GetService (Type service)
+ protected override object GetService (Type serviceType)
{
if (_serviceProvider != null) {
- return _serviceProvider.GetService (service);
+ return _serviceProvider.GetService (serviceType);
}
return null;
}
#region Parenting
- protected void HookChildControls (Control firstControl)
+ protected void HookChildControls (Control firstChild)
{
- if (firstControl != null) {
- foreach (Control control in firstControl.Controls) {
+ if (firstChild != null) {
+ foreach (Control control in firstChild.Controls) {
control.WindowTarget = (IWindowTarget) new WndProcRouter (control, (IMessageReceiver) this);
}
}
}
- protected void UnhookChildControls (Control firstControl)
+ protected void UnhookChildControls (Control firstChild)
{
- if (firstControl != null) {
- foreach (Control control in firstControl.Controls) {
+ if (firstChild != null) {
+ foreach (Control control in firstChild.Controls) {
if (control.WindowTarget is WndProcRouter)
((WndProcRouter) control.WindowTarget).Dispose ();
}
e.UseDefaultCursors = false;
}
- protected virtual void OnDragDrop (DragEventArgs e)
+ protected virtual void OnDragDrop (DragEventArgs de)
{
}
- protected virtual void OnDragEnter (DragEventArgs e)
+ protected virtual void OnDragEnter (DragEventArgs de)
{
}
{
}
- protected virtual void OnDragOver (DragEventArgs e)
+ protected virtual void OnDragOver (DragEventArgs de)
{
}
#endregion
// component - The IComponent to ensure has a context menu service.
// XXX: Not sure exactly what this should do...
//
- protected virtual void EnsureMenuEditorService (IComponent component)
+ protected virtual void EnsureMenuEditorService (IComponent c)
{
- if (this.menuEditorService == null && component is ContextMenu)
+ if (this.menuEditorService == null && c is ContextMenu)
menuEditorService = (IMenuEditorService) GetService (typeof (IMenuEditorService));
}
#endregion
return false;
}
- public virtual bool CanParent (ControlDesigner designer)
+ public virtual bool CanParent (ControlDesigner controlDesigner)
{
- return CanParent (designer.Control);
+ return CanParent (controlDesigner.Control);
}
- protected override void OnDragDrop (DragEventArgs e)
+ protected override void OnDragDrop (DragEventArgs de)
{
IUISelectionService selectionServ = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
if (selectionServ != null) {
// once this is fired the parent control (parentcontroldesigner) will start getting dragover events.
//
- Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (e.X, e.Y)));
+ Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (de.X, de.Y)));
selectionServ.DragDrop (false, this.Control, location.X, location.Y);
}
}
- protected override void OnDragEnter (DragEventArgs e)
+ protected override void OnDragEnter (DragEventArgs de)
{
this.Control.Refresh ();
}
this.Control.Refresh ();
}
- protected override void OnDragOver (DragEventArgs e)
+ protected override void OnDragOver (DragEventArgs de)
{
IUISelectionService selectionServ = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
if (selectionServ != null) {
// once ControlDesigner.MouseDragBegin is called this will start getting dragover events.
//
- Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (e.X, e.Y)));
+ Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (de.X, de.Y)));
selectionServ.DragOver (this.Control, location.X, location.Y);
}
- e.Effect = DragDropEffects.Move;
+ de.Effect = DragDropEffects.Move;
}
#endregion
private const int HTHSCROLL = 6;
private const int HTVSCROLL = 7;
- protected override bool GetHitTest (Point point)
+ protected override bool GetHitTest (Point pt)
{
- if (base.GetHitTest (point)) {
+ if (base.GetHitTest (pt)) {
return true;
}
int hitTestResult = (int) Native.SendMessage (this.Control.Handle,
Native.Msg.WM_NCHITTEST,
IntPtr.Zero,
- (IntPtr) Native.LParam (point.X, point.Y));
+ (IntPtr) Native.LParam (pt.X, pt.Y));
if (hitTestResult == HTHSCROLL || hitTestResult == HTVSCROLL)
return true;
}
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in" />\r
+ <Compile Include="..\..\build\common\Consts.cs" />\r
<Compile Include="..\..\build\common\Locale.cs" />\r
<Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
../../build/common/Locale.cs
System.DirectoryServices/ActiveDirectoryAccessRule.cs
System.DirectoryServices/ActiveDirectoryAuditRule.cs
/// <param name="filter">relative distinguised name of the child
/// </param>
/// <returns>Child entry with the specified name </returns>
- public DirectoryEntry Find(string filter)
+ public DirectoryEntry Find(string name)
{
- DirectoryEntry child=CheckEntry(filter);
+ DirectoryEntry child=CheckEntry(name);
return child;
}
/// <param name="otype"> Type of the child i.e strutcuralObjectClass
/// name of the child </param>
/// <returns>Child entry with the specified name and type</returns>
- public DirectoryEntry Find(string filter, string otype)
+ public DirectoryEntry Find(string name, string schemaClassName)
{
- DirectoryEntry child=CheckEntry(filter);
+ DirectoryEntry child=CheckEntry(name);
if( child != null) {
- if(child.Properties["objectclass"].ContainsCaselessStringValue(otype))
+ if(child.Properties["objectclass"].ContainsCaselessStringValue(schemaClassName))
return child;
else
throw new SystemException("An unknown directory object was requested");
SetUp ();
}
- public DirectoryServicesPermission (DirectoryServicesPermissionEntry[] entries)
+ public DirectoryServicesPermission (DirectoryServicesPermissionEntry[] permissionAccessEntries)
{
SetUp ();
innerCollection = new DirectoryServicesPermissionEntryCollection (this);
- innerCollection.AddRange (entries);
+ innerCollection.AddRange (permissionAccessEntries);
}
public DirectoryServicesPermission (PermissionState state)
SetUp ();
}
- public DirectoryServicesPermission (DirectoryServicesPermissionAccess access, string path)
+ public DirectoryServicesPermission (DirectoryServicesPermissionAccess permissionAccess, string path)
{
SetUp ();
innerCollection = new DirectoryServicesPermissionEntryCollection (this);
- innerCollection.Add (new DirectoryServicesPermissionEntry (access, path));
+ innerCollection.Add (new DirectoryServicesPermissionEntry (permissionAccess, path));
}
public DirectoryServicesPermissionEntryCollection PermissionEntries {
set { List[index] = value; }
}
- public int Add (DirectoryServicesPermissionEntry entry)
+ public int Add (DirectoryServicesPermissionEntry value)
{
- return List.Add (entry);
+ return List.Add (value);
}
- public void AddRange (DirectoryServicesPermissionEntry[] entries)
+ public void AddRange (DirectoryServicesPermissionEntry[] value)
{
- foreach (DirectoryServicesPermissionEntry entry in entries)
+ foreach (DirectoryServicesPermissionEntry entry in value)
Add (entry);
}
- public void AddRange (DirectoryServicesPermissionEntryCollection entries)
+ public void AddRange (DirectoryServicesPermissionEntryCollection value)
{
- foreach (DirectoryServicesPermissionEntry entry in entries)
+ foreach (DirectoryServicesPermissionEntry entry in value)
Add (entry);
}
- public void CopyTo (DirectoryServicesPermissionEntry[] copy_to, int index)
+ public void CopyTo (DirectoryServicesPermissionEntry[] array, int index)
{
foreach (DirectoryServicesPermissionEntry entry in List)
- copy_to[index++] = entry;
+ array[index++] = entry;
}
- public bool Contains (DirectoryServicesPermissionEntry entry)
+ public bool Contains (DirectoryServicesPermissionEntry value)
{
- return List.Contains (entry);
+ return List.Contains (value);
}
- public int IndexOf (DirectoryServicesPermissionEntry entry)
+ public int IndexOf (DirectoryServicesPermissionEntry value)
{
- return List.IndexOf (entry);
+ return List.IndexOf (value);
}
- public void Insert (int pos, DirectoryServicesPermissionEntry entry)
+ public void Insert (int index, DirectoryServicesPermissionEntry value)
{
- List.Insert (pos, entry);
+ List.Insert (index, value);
}
- public void Remove (DirectoryServicesPermissionEntry entry)
+ public void Remove (DirectoryServicesPermissionEntry value)
{
- List.Remove (entry);
+ List.Remove (value);
}
protected override void OnClear ()
}
- public void AddRange(object[] values)
+ public void AddRange(object[] value)
{
- foreach (object value in values)
- Add (value);
+ foreach (object val in value)
+ Add (val);
}
- public void AddRange (PropertyValueCollection coll)
+ public void AddRange (PropertyValueCollection value)
{
- foreach (object value in coll)
- Add (value);
+ foreach (object val in value)
+ Add (val);
}
public int IndexOf( object value )
return false;
}
- public void CopyTo (object[] copy_to, int index)
+ public void CopyTo (object[] array, int index)
{
foreach (object o in List)
- copy_to[index++] = o;
+ array[index++] = o;
}
[MonoTODO]
}
- public ResultPropertyValueCollection this[string key]
+ public ResultPropertyValueCollection this[string name]
{
get {
- return (ResultPropertyValueCollection) this.Dictionary[key.ToLower()];
+ return (ResultPropertyValueCollection) this.Dictionary[name.ToLower()];
}
// set { this.Dictionary[key] = value; }
}
}
//see if collection contains an entry corresponding to key
- public bool Contains(string key)
+ public bool Contains(string propertyName)
{
- return this.Dictionary.Contains(key.ToLower());
+ return this.Dictionary.Contains(propertyName.ToLower());
}
public ICollection PropertyNames
}
}
- public void CopyTo (ResultPropertyValueCollection[] copy_to, int index)
+ public void CopyTo (ResultPropertyValueCollection[] array, int index)
{
foreach (ResultPropertyValueCollection vals in Values)
- copy_to[index++] = vals;
+ array[index++] = vals;
}
}
}
return InnerList.Contains (value);
}
- public void CopyTo (object[] array, int index)
+ public void CopyTo (object[] values, int index)
{
- InnerList.CopyTo (array, index);
+ InnerList.CopyTo (values, index);
}
public int IndexOf (object value)
}
[MonoTODO]
- public void AddRange (SchemaNameCollection coll)
+ public void AddRange (SchemaNameCollection value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void AddRange (string[] coll)
+ public void AddRange (string[] value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public bool Contains (string s)
+ public bool Contains (string value)
{
throw new NotImplementedException();
}
}
[MonoTODO]
- public void CopyTo (string[] copy_to, int pos)
+ public void CopyTo (string[] stringArray, int index)
{
throw new NotImplementedException();
}
[MonoTODO]
- public int IndexOf (string s)
+ public int IndexOf (string value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void Insert (int pos, string s)
+ public void Insert (int index, string value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void Remove (string s)
+ public void Remove (string value)
{
throw new NotImplementedException();
}
//
using System.Collections;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public sealed class CategoryNameCollection : ReadOnlyCollectionBase
{
//
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PaintValueEventArgs : EventArgs
{
private ITypeDescriptorContext context;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System.Security.Permissions;
-
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PropertyValueUIItem
{
//
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class ToolboxComponentsCreatedEventArgs : EventArgs
{
private IComponent[] components;
//
using System.ComponentModel;
-using System.Security.Permissions;
using System.Collections;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class UITypeEditor {
static UITypeEditor ()
//
// AddArc
//
- public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
+ public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
+ public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
+ public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
+ public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
//
// AddBeziers
//
- public void AddBeziers (params Point [] pts)
+ public void AddBeziers (params Point [] points)
{
- if (pts == null)
- throw new ArgumentNullException ("pts");
- Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
+ if (points == null)
+ throw new ArgumentNullException ("points");
+ Status status = GDIPlus.GdipAddPathBeziersI (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
- public void AddBeziers (PointF [] pts)
+ public void AddBeziers (PointF [] points)
{
- if (pts == null)
- throw new ArgumentNullException ("pts");
- Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
+ if (points == null)
+ throw new ArgumentNullException ("points");
+ Status status = GDIPlus.GdipAddPathBeziers (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
//
// AddEllipse
//
- public void AddEllipse (RectangleF r)
+ public void AddEllipse (RectangleF rect)
{
- Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
+ Status status = GDIPlus.GdipAddPathEllipse (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
GDIPlus.CheckStatus (status);
}
- public void AddEllipse (Rectangle r)
+ public void AddEllipse (Rectangle rect)
{
- Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
+ Status status = GDIPlus.GdipAddPathEllipseI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
//
// AddLine
//
- public void AddLine (Point a, Point b)
+ public void AddLine (Point pt1, Point pt2)
{
- Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
+ Status status = GDIPlus.GdipAddPathLineI (nativePath, pt1.X, pt1.Y, pt2.X, pt2.Y);
GDIPlus.CheckStatus (status);
}
- public void AddLine (PointF a, PointF b)
+ public void AddLine (PointF pt1, PointF pt2)
{
- Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
- b.Y);
+ Status status = GDIPlus.GdipAddPathLine (nativePath, pt1.X, pt1.Y, pt2.X,
+ pt2.Y);
GDIPlus.CheckStatus (status);
}
{
}
- public HatchBrush (HatchStyle hatchStyle, Color foreColor)
- : this (hatchStyle, foreColor, Color.Black)
+ public HatchBrush (HatchStyle hatchstyle, Color foreColor)
+ : this (hatchstyle, foreColor, Color.Black)
{
}
- public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
+ public HatchBrush(HatchStyle hatchstyle, Color foreColor, Color backColor)
{
- Status status = GDIPlus.GdipCreateHatchBrush (hatchStyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
+ Status status = GDIPlus.GdipCreateHatchBrush (hatchstyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
GDIPlus.CheckStatus (status);
}
}
[CLSCompliant(false)]
- public ColorMatrix (float[][] matrix)
+ public ColorMatrix (float[][] newColorMatrix)
{
- color00 = matrix [0][0];
- color01 = matrix [0][1];
- color02 = matrix [0][2];
- color03 = matrix [0][3];
- color04 = matrix [0][4];
- color10 = matrix [1][0];
- color11 = matrix [1][1];
- color12 = matrix [1][2];
- color13 = matrix [1][3];
- color14 = matrix [1][4];
- color20 = matrix [2][0];
- color21 = matrix [2][1];
- color22 = matrix [2][2];
- color23 = matrix [2][3];
- color24 = matrix [2][4];
- color30 = matrix [3][0];
- color31 = matrix [3][1];
- color32 = matrix [3][2];
- color33 = matrix [3][3];
- color34 = matrix [3][4];
- color40 = matrix [4][0];
- color41 = matrix [4][1];
- color42 = matrix [4][2];
- color43 = matrix [4][3];
- color44 = matrix [4][4];
+ color00 = newColorMatrix [0][0];
+ color01 = newColorMatrix [0][1];
+ color02 = newColorMatrix [0][2];
+ color03 = newColorMatrix [0][3];
+ color04 = newColorMatrix [0][4];
+ color10 = newColorMatrix [1][0];
+ color11 = newColorMatrix [1][1];
+ color12 = newColorMatrix [1][2];
+ color13 = newColorMatrix [1][3];
+ color14 = newColorMatrix [1][4];
+ color20 = newColorMatrix [2][0];
+ color21 = newColorMatrix [2][1];
+ color22 = newColorMatrix [2][2];
+ color23 = newColorMatrix [2][3];
+ color24 = newColorMatrix [2][4];
+ color30 = newColorMatrix [3][0];
+ color31 = newColorMatrix [3][1];
+ color32 = newColorMatrix [3][2];
+ color33 = newColorMatrix [3][3];
+ color34 = newColorMatrix [3][4];
+ color40 = newColorMatrix [4][0];
+ color41 = newColorMatrix [4][1];
+ color42 = newColorMatrix [4][2];
+ color43 = newColorMatrix [4][3];
+ color44 = newColorMatrix [4][4];
}
// properties
}
}
- public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
+ public EncoderParameter (Encoder encoder, int NumberOfValues, int Type, int Value)
{
this.encoder = encoder;
- this.valuePtr = (IntPtr) value;
- this.valuesCount = numberOfValues;
- this.type = (EncoderParameterValueType) type;
+ this.valuePtr = (IntPtr) Value;
+ this.valuesCount = NumberOfValues;
+ this.type = (EncoderParameterValueType) Type;
}
- public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
+ public EncoderParameter (Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2)
{
this.encoder = encoder;
this.valuesCount = 1;
this.type = EncoderParameterValueType.ValueTypeRationalRange;
this.valuePtr = Marshal.AllocHGlobal (4 * 4);
- int [] valuearray = { numerator1, denominator1, numerator2, denominator2 };
+ int [] valuearray = { numerator1, demoninator1, numerator2, demoninator2 };
Marshal.Copy (valuearray, 0, this.valuePtr, 4);
}
SetColorKey (colorLow, colorHigh, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix)
+ public void SetColorMatrix (ColorMatrix newColorMatrix)
{
- SetColorMatrix (colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
+ SetColorMatrix (newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag)
+ public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag flags)
{
- SetColorMatrix (colorMatrix, colorMatrixFlag, ColorAdjustType.Default);
+ SetColorMatrix (newColorMatrix, flags, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag, ColorAdjustType colorAdjustType)
+ public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
{
- IntPtr cm = ColorMatrix.Alloc (colorMatrix);
+ IntPtr cm = ColorMatrix.Alloc (newColorMatrix);
try {
Status status = GDIPlus.GdipSetImageAttributesColorMatrix (nativeImageAttr,
- colorAdjustType, true, cm, IntPtr.Zero, colorMatrixFlag);
+ type, true, cm, IntPtr.Zero, mode);
GDIPlus.CheckStatus (status);
}
finally {
SetGamma (gamma, ColorAdjustType.Default);
}
- public void SetGamma (float gamma, ColorAdjustType coloradjust)
+ public void SetGamma (float gamma, ColorAdjustType type)
{
- Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, coloradjust, true, gamma);
+ Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, type, true, gamma);
GDIPlus.CheckStatus (status);
}
}
public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
+ string desc)
{
Status status = GDIPlus.GdipRecordMetafileI (referenceHdc, type, ref frameRect, frameUnit,
- description, out nativeObject);
+ desc, out nativeObject);
GDIPlus.CheckStatus (status);
}
}
public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit,
- string description) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
- description)
+ string desc) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
+ desc)
{
}
}
[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
- public static MetafileHeader GetMetafileHeader (IntPtr henhmetafile, WmfPlaceableFileHeader wmfHeader)
+ public static MetafileHeader GetMetafileHeader (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
{
IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
try {
- Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (henhmetafile, header);
+ Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (hmetafile, header);
GDIPlus.CheckStatus (status);
return new MetafileHeader (header);
}
//
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing.Printing {
{
}
- [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
base.GetObjectData (info, context);
}
-
+
private static string GetMessage(PrinterSettings settings)
{
if (settings.PrinterName == null || settings.PrinterName == String.Empty)
//
using System.IO;
-using System.Security.Permissions;
using System.Runtime.InteropServices;
namespace System.Drawing.Text {
GDIPlus.CheckStatus (status);
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void AddMemoryFont (IntPtr memory, int length)
{
// note: MS throw FileNotFoundException if something is bad with the data (except for a null pointer)
using System.IO;
using System.Drawing.Imaging;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing
{
if (resource == null)
throw new ArgumentException ("resource");
- Stream s = type.Assembly.GetManifestResourceStream (type, resource);
+ // For compatibility with the .NET Framework
+ if (type == null)
+ throw new NullReferenceException();
+
+ Stream s = type.GetTypeInfo ().Assembly.GetManifestResourceStream (type, resource);
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resource);
throw new FileNotFoundException (msg);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap ()
{
return GetHbitmap(Color.Gray);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap (Color background)
{
IntPtr HandleBmp;
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHicon ()
{
IntPtr HandleIcon;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing
{
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void Render (IntPtr targetDC)
{
throw new NotImplementedException ();
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing
{
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public BufferedGraphics Allocate (IntPtr targetDC, Rectangle targetRectangle)
{
throw new NotImplementedException ();
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
using System.ComponentModel;
namespace System.Drawing
[Browsable(false)]
public bool IsSystemFont {
get {
- if (systemFontName == null)
- return false;
-
- return StringComparer.InvariantCulture.Compare (systemFontName, string.Empty) != 0;
+ return !string.IsNullOrEmpty (systemFontName);
}
}
}
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont)
{
if (GDIPlus.RunningOnUnix ()) {
}
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont, Graphics graphics)
{
if (graphics == null)
}
Type st = logFont.GetType ();
- if (!st.IsLayoutSequential)
+ if (!st.GetTypeInfo ().IsLayoutSequential)
throw new ArgumentException ("logFont", Locale.GetText ("Layout must be sequential."));
// note: there is no exception if 'logFont' isn't big enough
using System.Drawing.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
using System.Text;
namespace System.Drawing
IntPtr data,
PlayRecordCallback callbackData);
- public delegate bool DrawImageAbort (IntPtr callbackData);
+ public delegate bool DrawImageAbort (IntPtr callbackdata);
internal Graphics (IntPtr nativeGraphics)
{
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHdcInternal (IntPtr hdc)
{
GDIPlus.Display = hdc;
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHwndInternal (IntPtr hwnd)
{
return FromHwnd (hwnd);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ReleaseHdc (IntPtr hdc)
{
ReleaseHdcInternal (hdc);
}
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdc ()
{
ReleaseHdcInternal (deviceContextHdc);
[MonoLimitation ("Can only be used when hdc was provided by Graphics.GetHdc() method")]
[EditorBrowsable (EditorBrowsableState.Never)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdcInternal (IntPtr hdc)
{
Status status = Status.InvalidParameter;
using System.ComponentModel;
using System.Drawing.Imaging;
using System.IO;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
namespace System.Drawing
{
if (resource == null)
throw new ArgumentException ("resource");
- using (Stream s = type.Assembly.GetManifestResourceStream (type, resource)) {
+ // For compatibility with the .NET Framework
+ if (type == null)
+ throw new NullReferenceException();
+
+ using (Stream s = type.GetTypeInfo ().Assembly.GetManifestResourceStream (type, resource)) {
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resource);
throw new FileNotFoundException (msg);
internal Icon (string resourceName, bool undisposable)
{
- using (Stream s = typeof (Icon).Assembly.GetManifestResourceStream (resourceName)) {
+ using (Stream s = typeof (Icon).GetTypeInfo ().Assembly.GetManifestResourceStream (resourceName)) {
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resourceName);
throw new FileNotFoundException (msg);
}
#if !MONOTOUCH
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Icon FromHandle (IntPtr handle)
{
if (handle == IntPtr.Zero)
}
imageData [j] = iidata;
- bihReader.Close();
+ bihReader.Dispose ();
}
- reader.Close();
+ reader.Dispose ();
}
}
}
Status status = GDIPlus.GdipDisposeImage (nativeObject);
// dispose the stream (set under Win32 only if SD owns the stream) and ...
if (stream != null) {
- stream.Close ();
+ stream.Dispose ();
stream = null;
}
// ... set nativeObject to null before (possibly) throwing an exception
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
namespace System.Drawing
{
return result;
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static Region FromHrgn (IntPtr hrgn)
{
if (hrgn == IntPtr.Zero)
}
}
// why is this a instance method ? and not static ?
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ReleaseHrgn (IntPtr regionHandle)
{
if (regionHandle == IntPtr.Zero)
// Sanjay Gupta (gsanjay@novell.com)
// Ravindra (rkumar@novell.com)
// Peter Dennis Bartok (pbartok@novell.com)
-// Sebastien Pouliot <sebastien@ximian.com>
+// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2004 - 2007 Novell, Inc (http://www.novell.com)
//
/// <summary>
/// GDI+ API Functions
/// </summary>
- [SuppressUnmanagedCodeSecurity]
internal static class GDIPlus {
public const int FACESIZE = 32;
public const int LANG_NEUTRAL = 0;
// Copies an array of Points to unmanaged memory
static public IntPtr FromPointToUnManagedMemoryI (Point [] pts)
{
- int nPointSize = Marshal.SizeOf (pts[0]);
+ int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr dest = Marshal.AllocHGlobal (nPointSize * pts.Length);
IntPtr pos = dest;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
// Copies an array of Points to unmanaged memory
static public IntPtr FromPointToUnManagedMemory (PointF [] pts)
{
- int nPointSize = Marshal.SizeOf (pts[0]);
+ int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr dest = Marshal.AllocHGlobal (nPointSize * pts.Length);
IntPtr pos = dest;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
static internal extern Status GdipCreateRegionRect (ref RectangleF rect, out IntPtr region);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateRegionRectI (ref Rectangle rect, out IntPtr region);
+ static internal extern Status GdipCreateRegionRectI (ref Rectangle rect, out IntPtr region);
[DllImport(GdiPlus)]
static internal extern Status GdipCreateRegionPath (IntPtr path, out IntPtr region);
float height, IntPtr graphics, out bool result);
[DllImport(GdiPlus)]
- static internal extern Status GdipIsVisibleRegionRectI (IntPtr region, int x, int y, int width,
+ static internal extern Status GdipIsVisibleRegionRectI (IntPtr region, int x, int y, int width,
int height, IntPtr graphics, out bool result);
[DllImport(GdiPlus)]
static internal extern Status GdipGetRegionData (IntPtr region, byte[] buffer, int bufferSize,
- out int sizeFilled);
+ out int sizeFilled);
[DllImport(GdiPlus)]
static internal extern Status GdipGetRegionScansCount (IntPtr region, out int count, IntPtr matrix);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetRegionScans (IntPtr region, IntPtr rects, out int count,
+ static internal extern Status GdipGetRegionScans (IntPtr region, IntPtr rects, out int count,
IntPtr matrix);
[DllImport(GdiPlus)]
[DllImport(GdiPlus)]
static internal extern Status GdipGetTextureImage (IntPtr texture, out IntPtr image);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTexture (IntPtr image, WrapMode wrapMode, out IntPtr texture);
+ static internal extern Status GdipCreateTexture (IntPtr image, WrapMode wrapMode, out IntPtr texture);
[DllImport(GdiPlus)]
static internal extern Status GdipCreateTextureIAI (IntPtr image, IntPtr imageAttributes, int x, int y, int width, int height, out IntPtr texture);
[DllImport(GdiPlus)]
[DllImport(GdiPlus)]
static internal extern Status GdipFillEllipse (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
[DllImport (GdiPlus)]
- static internal extern Status GdipFillPolygon (IntPtr graphics, IntPtr brush, PointF [] points, int count, FillMode fillMode);
+ static internal extern Status GdipFillPolygon (IntPtr graphics, IntPtr brush, PointF [] points, int count, FillMode fillMode);
[DllImport (GdiPlus)]
- static internal extern Status GdipFillPolygonI (IntPtr graphics, IntPtr brush, Point [] points, int count, FillMode fillMode);
+ static internal extern Status GdipFillPolygonI (IntPtr graphics, IntPtr brush, Point [] points, int count, FillMode fillMode);
[DllImport (GdiPlus)]
- static internal extern Status GdipFillPolygon2 (IntPtr graphics, IntPtr brush, PointF [] points, int count);
+ static internal extern Status GdipFillPolygon2 (IntPtr graphics, IntPtr brush, PointF [] points, int count);
[DllImport (GdiPlus)]
- static internal extern Status GdipFillPolygon2I (IntPtr graphics, IntPtr brush, Point [] points, int count);
+ static internal extern Status GdipFillPolygon2I (IntPtr graphics, IntPtr brush, Point [] points, int count);
[DllImport(GdiPlus)]
static internal extern Status GdipFillRectangle (IntPtr graphics, IntPtr brush, float x1, float y1, float x2, float y2);
[DllImport(GdiPlus)]
[DllImport(GdiPlus)]
internal static extern Status GdipFillClosedCurve2(IntPtr graphics, IntPtr brush,
- PointF [] points, int count, float tension, FillMode fillMode);
+ PointF [] points, int count, float tension, FillMode fillMode);
[DllImport(GdiPlus)]
internal static extern Status GdipFillClosedCurve2I(IntPtr graphics, IntPtr brush,
internal static extern Status GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetNearestColor(IntPtr graphics, out int argb);
+ internal static extern Status GdipGetNearestColor(IntPtr graphics, out int argb);
[DllImport(GdiPlus)]
internal static extern Status GdipIsVisiblePoint(IntPtr graphics, float x, float y, out bool result);
[DllImport(GdiPlus)]
internal static extern Status GdipTransformPoints(IntPtr graphics, CoordinateSpace destSpace,
- CoordinateSpace srcSpace, IntPtr points, int count);
+ CoordinateSpace srcSpace, IntPtr points, int count);
[DllImport(GdiPlus)]
internal static extern Status GdipTransformPointsI(IntPtr graphics, CoordinateSpace destSpace,
internal static extern Status GdipSetStringFormatMeasurableCharacterRanges (IntPtr native,
int cnt, CharacterRange [] range);
- [DllImport(GdiPlus)]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetStringFormatMeasurableCharacterRangeCount (IntPtr native,
out int cnt);
internal static extern Status GdipImageRotateFlip ( IntPtr image, RotateFlipType rotateFlipType );
[DllImport(GdiPlus, CharSet=CharSet.Unicode)]
- internal static extern Status GdipSaveImageToFile (IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
+ internal static extern Status GdipSaveImageToFile (IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
[DllImport(GdiPlus)]
internal static extern Status GdipSaveAdd ( IntPtr image, IntPtr encoderParameters );
[DllImport(GdiPlus)]
- internal static extern Status GdipDrawImagePointsI (IntPtr graphics, IntPtr image, Point [] destPoints, int count);
+ internal static extern Status GdipDrawImagePointsI (IntPtr graphics, IntPtr image, Point [] destPoints, int count);
[DllImport(GdiPlus)]
internal static extern Status GdipDrawImageRectRectI (IntPtr graphics, IntPtr image,
int srcheight, GraphicsUnit srcUnit);
[DllImport(GdiPlus)]
- internal static extern Status GdipCreateStringFormat(StringFormatFlags formatAttributes, int language, out IntPtr native);
+ internal static extern Status GdipCreateStringFormat(StringFormatFlags formatAttributes, int language, out IntPtr native);
[DllImport(GdiPlus)]
internal static extern Status GdipCreateHBITMAPFromBitmap (IntPtr bmp, out IntPtr HandleBmp, int clrbackground);
internal static extern Status GdipCreateHICONFromBitmap (IntPtr bmp, out IntPtr HandleIcon);
[DllImport(GdiPlus)]
- internal static extern Status GdipCreateBitmapFromHICON (IntPtr hicon, out IntPtr bitmap);
+ internal static extern Status GdipCreateBitmapFromHICON (IntPtr hicon, out IntPtr bitmap);
[DllImport(GdiPlus)]
internal static extern Status GdipCreateBitmapFromResource (IntPtr hInstance,
[DllImport (GdiPlus)]
internal static extern Status GdipInvertMatrix (IntPtr matrix);
[DllImport (GdiPlus)]
- internal static extern Status GdipTransformMatrixPoints (IntPtr matrix, PointF [] pts, int count);
+ internal static extern Status GdipTransformMatrixPoints (IntPtr matrix, [In, Out] PointF [] pts, int count);
[DllImport (GdiPlus)]
- internal static extern Status GdipTransformMatrixPointsI (IntPtr matrix, Point [] pts, int count);
+ internal static extern Status GdipTransformMatrixPointsI (IntPtr matrix, [In, Out] Point [] pts, int count);
[DllImport (GdiPlus)]
- internal static extern Status GdipVectorTransformMatrixPoints (IntPtr matrix, PointF [] pts, int count);
+ internal static extern Status GdipVectorTransformMatrixPoints (IntPtr matrix, [In, Out] PointF [] pts, int count);
[DllImport (GdiPlus)]
- internal static extern Status GdipVectorTransformMatrixPointsI (IntPtr matrix, Point [] pts, int count);
+ internal static extern Status GdipVectorTransformMatrixPointsI (IntPtr matrix, [In, Out] Point [] pts, int count);
[DllImport (GdiPlus)]
internal static extern Status GdipIsMatrixInvertible (IntPtr matrix, out bool result);
[DllImport (GdiPlus)]
internal static extern Status GdipSetImageAttributesColorMatrix (IntPtr imageattr,
ColorAdjustType type, bool enableFlag, IntPtr colorMatrix,
- IntPtr grayMatrix, ColorMatrixFlag flags);
+ IntPtr grayMatrix, ColorMatrixFlag flags);
[DllImport (GdiPlus)]
internal static extern Status GdipSetImageAttributesGamma (IntPtr imageattr,
ColorAdjustType colorAdjustType);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr, WrapMode wrap,
+ internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr, WrapMode wrap,
int argb, bool clamp);
// Font
[DllImport(GdiPlus)]
- internal static extern Status GdipCreateFont (IntPtr fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
+ internal static extern Status GdipCreateFont (IntPtr fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
[DllImport(GdiPlus)]
internal static extern Status GdipDeleteFont (IntPtr font);
[DllImport(GdiPlus, CharSet=CharSet.Auto)]
// String Format
[DllImport (GdiPlus)]
- internal static extern Status GdipCreateStringFormat(int formatAttributes, int language, out IntPtr format);
+ internal static extern Status GdipCreateStringFormat(int formatAttributes, int language, out IntPtr format);
[DllImport (GdiPlus)]
internal static extern Status GdipStringFormatGetGenericDefault(out IntPtr format);
[DllImport (GdiPlus)]
private byte[] start_buf;
private int start_buf_pos;
private int start_buf_len;
- private byte[] managedBuf;
+ private byte[] managedBuf;
private const int default_bufsize = 4096;
public GdiPlusStreamHelper (Stream s, bool seekToOrigin)
}
}
- public int StreamGetHeaderImpl (IntPtr buf, int bufsz) {
+ public int StreamGetHeaderImpl (IntPtr buf, int bufsz) {
int bytesRead;
start_buf = new byte[bufsz];
namespace System.Drawing {
- [SuppressUnmanagedCodeSecurity]
internal static class MacSupport {
internal static Hashtable contextReference = new Hashtable ();
internal static object lockobj = new object ();
}
}
- hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
+ hash = MD5.Create ().ComputeHash (pixels);
return ByteArrayToString (hash);
}
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
if (pixel_data == null)
return "--ERROR--";
- byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
+ byte[] hash = MD5.Create ().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
}\r
\r
[MonoTODO]\r
- public static void SetNamedProperty (string name, object property)\r
+ public static void SetNamedProperty (string name, object value)\r
{\r
throw new NotImplementedException ();\r
}\r
{\r
}\r
\r
- public RegistrationException (string msg, Exception innerException)\r
- : base (msg, innerException)\r
+ public RegistrationException (string msg, Exception inner)\r
+ : base (msg, inner)\r
{\r
}\r
\r
public CardSpacePolicyElement (
XmlElement target, XmlElement issuer,
Collection<XmlElement> parameters,
- Uri policyNoticeLink,
- int policyNoticeVersion,
+ Uri privacyNoticeLink,
+ int privacyNoticeVersion,
bool isManagedIssuer)
{
this.target = target;
this.issuer = issuer;
this.parameters = parameters ?? new Collection<XmlElement> ();
- this.policy_link = policyNoticeLink;
- policy_ver = policyNoticeVersion;
+ this.policy_link = privacyNoticeLink;
+ policy_ver = privacyNoticeVersion;
is_managed = isManagedIssuer;
}
[MonoTODO]
public static GenericXmlSecurityToken GetToken (
CardSpacePolicyElement [] policyChain,
- SecurityTokenSerializer serializer)
+ SecurityTokenSerializer tokenSerializer)
{
- return (GenericXmlSecurityToken) get_token.Invoke (impl, new object [] {policyChain, serializer});
+ return (GenericXmlSecurityToken) get_token.Invoke (impl, new object [] {policyChain, tokenSerializer});
}
public static GenericXmlSecurityToken GetToken (
XmlElement endpoint,
IEnumerable<XmlElement> policy,
XmlElement requiredRemoteTokenIssuer,
- SecurityTokenSerializer serializer)
+ SecurityTokenSerializer tokenSerializer)
{
CardSpacePolicyElement pe = new CardSpacePolicyElement (endpoint, requiredRemoteTokenIssuer, new Collection<XmlElement> (new List<XmlElement> (policy)), null, 0, requiredRemoteTokenIssuer != null);
- return GetToken (new CardSpacePolicyElement [] {pe}, serializer);
+ return GetToken (new CardSpacePolicyElement [] {pe}, tokenSerializer);
}
[MonoTODO]
}
[MonoTODO]
- public static Claim CreateDenyOnlyWindowsSidClaim (SecurityIdentifier identifier)
+ public static Claim CreateDenyOnlyWindowsSidClaim (SecurityIdentifier sid)
{
throw new NotImplementedException ();
}
}
public abstract IEnumerable<Claim> FindClaims (
- string resourceType, string right);
+ string claimType, string right);
public abstract IEnumerator<Claim> GetEnumerator ();
// Constructors
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, bool includeWindowsGroups)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, bool includeWindowsGroups)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, DateTime expirationTime)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, DateTime expirationTime)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, bool includeWindowsGroups, DateTime expirationTime)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, bool includeWindowsGroups, DateTime expirationTime)
{
throw new NotImplementedException ();
}
{
[MonoTODO]
public static AuthorizationContext
- CreateDefaultAuthorizationContext (IList<IAuthorizationPolicy> policies)
+ CreateDefaultAuthorizationContext (IList<IAuthorizationPolicy> authorizationPolicies)
{
- if (policies == null)
- throw new ArgumentNullException ("policies");
+ if (authorizationPolicies == null)
+ throw new ArgumentNullException ("authorizationPolicies");
string id = new UniqueId ().ToString ();
DefaultEvaluationContext ctx =
new DefaultEvaluationContext ();
- foreach (IAuthorizationPolicy a in policies) {
+ foreach (IAuthorizationPolicy a in authorizationPolicies) {
object o = null;
a.Evaluate (ctx, ref o);
}
public abstract ReadOnlyCollection<ClaimSet> ClaimSets { get; }
public abstract void AddClaimSet (
- IAuthorizationPolicy authorizationPolicy,
+ IAuthorizationPolicy policy,
ClaimSet claimSet);
- public abstract void RecordExpirationTime (DateTime time);
+ public abstract void RecordExpirationTime (DateTime expirationTime);
}
// default implementation
}
[MonoTODO]
- public KerberosSecurityTokenProvider (string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel, NetworkCredential credential)
+ public KerberosSecurityTokenProvider (string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel, NetworkCredential networkCredential)
{
name = servicePrincipalName;
impersonation_level = tokenImpersonationLevel;
- this.credential = credential;
+ this.credential = networkCredential;
}
string name;
public abstract SecurityTokenAuthenticator
CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
- out SecurityTokenResolver resolver);
+ SecurityTokenRequirement tokenRequirement,
+ out SecurityTokenResolver outOfBandTokenResolver);
public abstract SecurityTokenProvider
- CreateSecurityTokenProvider(SecurityTokenRequirement requirement);
+ CreateSecurityTokenProvider(SecurityTokenRequirement tokenRequirement);
public abstract SecurityTokenSerializer
CreateSecurityTokenSerializer (SecurityTokenVersion version);
EndCancelTokenCore (result);
}
- public SecurityToken RenewToken (TimeSpan timeout, SecurityToken token)
+ public SecurityToken RenewToken (TimeSpan timeout, SecurityToken tokenToBeRenewed)
{
- return RenewTokenCore (timeout, token);
+ return RenewTokenCore (timeout, tokenToBeRenewed);
}
public IAsyncResult BeginRenewToken (
- TimeSpan timeout, SecurityToken token,
+ TimeSpan timeout, SecurityToken tokenToBeRenewed,
AsyncCallback callback, object state)
{
- return BeginRenewTokenCore (timeout, token, callback, state);
+ return BeginRenewTokenCore (timeout, tokenToBeRenewed, callback, state);
}
public SecurityToken EndRenewToken (IAsyncResult result)
throw new NotSupportedException (String.Format ("Token cancellation on this security token provider '{0}' is not supported.", this));
}
- protected virtual SecurityToken RenewTokenCore (TimeSpan timeout, SecurityToken token)
+ protected virtual SecurityToken RenewTokenCore (TimeSpan timeout, SecurityToken tokenToBeRenewed)
{
throw new NotSupportedException (String.Format ("Token renewal on this security token provider '{0}' is not supported.", this));
}
protected virtual IAsyncResult BeginRenewTokenCore (
TimeSpan timeout,
- SecurityToken token,
+ SecurityToken tokenToBeRenewed,
AsyncCallback callback, object state)
{
throw new NotSupportedException (String.Format ("Token renewal on this security token provider '{0}' is not supported.", this));
}
}
- public TValue GetProperty<TValue> (string property)
+ public TValue GetProperty<TValue> (string propertyName)
{
TValue ret;
- if (TryGetProperty<TValue> (property, out ret))
+ if (TryGetProperty<TValue> (propertyName, out ret))
return ret;
- throw new ArgumentException (String.Format ("Property '{0}' was not found.", property));
+ throw new ArgumentException (String.Format ("Property '{0}' was not found.", propertyName));
}
- public bool TryGetProperty<TValue> (string property, out TValue value)
+ public bool TryGetProperty<TValue> (string propertyName, out TValue result)
{
object tmp;
- value = default (TValue);
+ result = default (TValue);
- if (!Properties.TryGetValue (property, out tmp))
+ if (!Properties.TryGetValue (propertyName, out tmp))
return false;
if (tmp == null && !typeof (TValue).IsValueType)
- value = default (TValue);
+ result = default (TValue);
else if (tmp is TValue)
- value = (TValue) tmp;
+ result = (TValue) tmp;
else
- throw new ArgumentException (String.Format ("The value of property '{0}' is of type '{1}', while '{2}' is expected.", property, tmp.GetType (), typeof (TValue)));
- return value != null;
+ throw new ArgumentException (String.Format ("The value of property '{0}' is of type '{1}', while '{2}' is expected.", propertyName, tmp.GetType (), typeof (TValue)));
+ return result != null;
}
}
}
return (byte []) GetRawBuffer ().Clone ();
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
BinaryKeyIdentifierClause other =
- clause as BinaryKeyIdentifierClause;
+ keyIdentifierClause as BinaryKeyIdentifierClause;
if (other == null)
return false;
return Matches (other.GetRawBuffer ());
-//
+//
// BootstrapContext.cs
//
// Author:
}
/// <summary>Initializes a new instance of the <see cref="BootstrapContext"/> class by using the specified security token and token handler.</summary>
- public BootstrapContext (SecurityToken token, SecurityTokenHandler handler)
+ public BootstrapContext (SecurityToken token, SecurityTokenHandler tokenHandler)
{
if (token == null)
throw new ArgumentNullException ("token");
- if (handler == null)
- throw new ArgumentNullException ("handler");
+ if (tokenHandler == null)
+ throw new ArgumentNullException ("tokenHandler");
SecurityToken = token;
- SecurityTokenHandler = handler;
+ SecurityTokenHandler = tokenHandler;
}
/// <summary>Initializes a new instance of the <see cref="BootstrapContext"/> class from a stream.</summary>
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier)
- : this (encryptedKey, encryptionMethod, identifier, null)
+ SecurityKeyIdentifier encryptingKeyIdentifier)
+ : this (encryptedKey, encryptionMethod, encryptingKeyIdentifier, null)
{
}
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier, string carriedKeyName)
- : this (encryptedKey, encryptionMethod, identifier, carriedKeyName, null, 0)
+ SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName)
+ : this (encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, null, 0)
{
}
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier, string carriedKeyName,
+ SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName,
byte [] derivationNonce, int derivationLength)
: base (encryptionMethod, encryptedKey, true, derivationNonce, derivationLength)
{
this.carried_key_name = carriedKeyName;
- this.identifier = identifier;
+ this.identifier = encryptingKeyIdentifier;
this.enc_method = encryptionMethod;
}
return true;
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
EncryptedKeyIdentifierClause e =
- clause as EncryptedKeyIdentifierClause;
+ keyIdentifierClause as EncryptedKeyIdentifierClause;
return e != null && Matches (e.GetRawBuffer (), e.EncryptionMethod, e.CarriedKeyName);
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
{
byte [] key;
- public InMemorySymmetricSecurityKey (byte [] key)
- : this (key, true)
+ public InMemorySymmetricSecurityKey (byte [] symmetricKey)
+ : this (symmetricKey, true)
{
}
- public InMemorySymmetricSecurityKey (byte [] key, bool clone)
+ public InMemorySymmetricSecurityKey (byte [] symmetricKey, bool cloneBuffer)
{
- if (key == null)
- throw new ArgumentNullException ("key");
- this.key = clone ? (byte []) key.Clone() : key;
+ if (symmetricKey == null)
+ throw new ArgumentNullException ("symmetricKey");
+ this.key = cloneBuffer ? (byte []) symmetricKey.Clone() : symmetricKey;
}
// SymmetricSecurityKey implementation
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
get { return owner_type; }
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (clause == null)
- throw new ArgumentNullException ("clause");
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
LocalIdKeyIdentifierClause c =
- clause as LocalIdKeyIdentifierClause;
+ keyIdentifierClause as LocalIdKeyIdentifierClause;
return c != null && Matches (c.LocalId, c.OwnerType);
}
throw new NotImplementedException ();
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (clause == null)
- throw new ArgumentNullException ("clause");
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
RsaKeyIdentifierClause rkic =
- clause as RsaKeyIdentifierClause;
+ keyIdentifierClause as RsaKeyIdentifierClause;
return rkic != null && Matches (rkic.Rsa);
}
[MonoTODO]
public override AsymmetricAlgorithm GetAsymmetricAlgorithm (
- string algorithm, bool privateKey)
+ string algorithm, bool requiresPrivateKey)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
switch (reader.LocalName) {
case "Assertion":
SamlAssertion a = new SamlAssertion ();
- a.ReadXml (reader, samlSerializer, keyInfoTokenSerializer, outOfBandTokenResolver);
+ a.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
assertions.Add (a);
break;
case "AssertionIDReference":
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
foreach (string idref in AssertionIdReferences)
writer.WriteElementString ("saml", "AssertionIDReference", SamlConstants.Namespace, idref);
foreach (SamlAssertion assertion in Assertions)
- assertion.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ assertion.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
}
}
public SamlAssertion (string assertionId, string issuer,
- DateTime issueInstant, SamlConditions conditions,
- SamlAdvice advice, IEnumerable<SamlStatement> statements)
+ DateTime issueInstant, SamlConditions samlConditions,
+ SamlAdvice samlAdvice, IEnumerable<SamlStatement> samlStatements)
{
if (IsInvalidAssertionId (assertionId))
throw new ArgumentException (String.Format ("The assertionId '{0}' must be a valid XML NCName.", assertionId));
if (issuer == null || issuer.Length == 0)
throw new ArgumentException ("issuer");
- if (statements == null)
- throw new ArgumentNullException ("statements");
+ if (samlStatements == null)
+ throw new ArgumentNullException ("samlStatements");
major = 1;
minor = 1;
assertion_id = assertionId;
this.issuer = issuer;
issue_instant = issueInstant;
- this.conditions = conditions;
- this.advice = advice;
- foreach (SamlStatement s in statements) {
+ this.conditions = samlConditions;
+ this.advice = samlAdvice;
+ foreach (SamlStatement s in samlStatements) {
if (s == null)
throw new ArgumentException ("statements contain null item.");
this.statements.Add (s);
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
try {
if (Conditions != null)
- Conditions.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ Conditions.WriteXml (writer, samlSerializer, keyInfoSerializer);
if (Advice != null)
- Advice.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ Advice.WriteXml (writer, samlSerializer, keyInfoSerializer);
foreach (SamlStatement statement in Statements)
- statement.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ statement.WriteXml (writer, samlSerializer, keyInfoSerializer);
} catch (NotImplementedException) {
throw;
} catch (Exception ex) { // bad catch, eh?
[MonoTODO]
protected void ReadSignature (XmlDictionaryReader reader,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver,
SamlSerializer samlSerializer)
{
}
[MonoTODO]
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
writer.WriteStartElement ("saml", "Attribute", SamlConstants.Namespace);
writer.WriteAttributeString ("AttributeName", Name);
[MonoTODO]
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public override void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (SamlSubject == null)
throw new SecurityTokenException ("Subject is null in the AttributeStatement");
writer.WriteStartElement ("saml", "AttributeStatement", SamlConstants.Namespace);
- SamlSubject.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ SamlSubject.WriteXml (writer, samlSerializer, keyInfoSerializer);
foreach (SamlAttribute a in Attributes)
- a.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ a.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
[MonoTODO]
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public override void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
writer.WriteAttributeString ("AuthenticationMethod", AuthenticationMethod);
writer.WriteAttributeString ("AuthenticationInstant",
AuthenticationInstant.ToString (SamlConstants.DateFormat, CultureInfo.InvariantCulture));
- SamlSubject.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ SamlSubject.WriteXml (writer, samlSerializer, keyInfoSerializer);
if (DnsAddress != null || IPAddress != null) {
writer.WriteStartElement ("saml", "SubjectLocality", SamlConstants.Namespace);
if (IPAddress != null)
{
}
- public SamlAuthorityBinding (XmlQualifiedName kind, string binding, string location)
+ public SamlAuthorityBinding (XmlQualifiedName authorityKind, string binding, string location)
{
- if (kind == null)
- throw new ArgumentNullException ("kind");
- AuthorityKind = kind;
+ if (authorityKind == null)
+ throw new ArgumentNullException ("authorityKind");
+ AuthorityKind = authorityKind;
Binding = binding;
Location = location;
}
public class SamlAuthorizationDecisionClaimResource
{
public SamlAuthorizationDecisionClaimResource (
- string resource, SamlAccessDecision decision, string actionName, string actionNamespace)
+ string resource, SamlAccessDecision accessDecision, string actionNamespace, string actionName)
{
this.resource = resource;
- this.decision = decision;
+ this.decision = accessDecision;
this.name = actionName;
this.ns = actionNamespace;
}
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
SecurityTokenSerializer keyInfoSerializer,
- SecurityTokenResolver resolver)
+ SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
throw new ArgumentNullException ("reader");
reader.MoveToContent ();
SamlSubject = new SamlSubject ();
- SamlSubject.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ SamlSubject.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
SamlActions.Clear ();
for (reader.MoveToContent ();
reader.LocalName == "Action" &&
reader.NamespaceURI == SamlConstants.Namespace;
reader.MoveToContent ()) {
SamlAction action = new SamlAction ();
- action.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ action.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
SamlActions.Add (action);
}
if (reader.LocalName == "Evidence" &&
reader.NamespaceURI == SamlConstants.Namespace) {
Evidence = new SamlEvidence ();
- Evidence.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ Evidence.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
reader.MoveToContent ();
}
reader.ReadEndElement ();
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
if (has_not_on_after)
writer.WriteAttributeString ("NotOnOrAfter", NotOnOrAfter.ToString (SamlConstants.DateFormat, invariant));
foreach (SamlCondition cond in Conditions)
- cond.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ cond.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
SecurityTokenSerializer keyInfoSerializer,
- SecurityTokenResolver resolver)
+ SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
throw new ArgumentNullException ("reader");
switch (reader.LocalName) {
case "Assertion":
SamlAssertion a = new SamlAssertion ();
- a.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ a.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
assertions.Add (a);
break;
case "AssertionIDReference":
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAdvice LoadAdvice (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAssertion LoadAssertion (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAttribute LoadAttribute (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlCondition LoadCondition (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlConditions LoadConditions (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlStatement LoadStatement (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlSecurityToken ReadToken (XmlReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
public abstract void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver);
public abstract void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer);
+ SecurityTokenSerializer keyInfoSerializer);
}
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
this.list = new List<SecurityKeyIdentifierClause> ();
}
- public SecurityKeyIdentifier (params SecurityKeyIdentifierClause [] identifiers)
+ public SecurityKeyIdentifier (params SecurityKeyIdentifierClause [] clauses)
{
- this.list = new List<SecurityKeyIdentifierClause> (identifiers);
+ this.list = new List<SecurityKeyIdentifierClause> (clauses);
}
List<SecurityKeyIdentifierClause> list;
get { return is_readonly; }
}
- public SecurityKeyIdentifierClause this [int i] {
- get { return list [i]; }
+ public SecurityKeyIdentifierClause this [int index] {
+ get { return list [index]; }
}
- public void Add (SecurityKeyIdentifierClause item)
+ public void Add (SecurityKeyIdentifierClause clause)
{
if (is_readonly)
throw new InvalidOperationException ("This SecurityKeyIdentifier is read-only.");
- list.Add (item);
+ list.Add (clause);
}
public SecurityKey CreateKey ()
return sb.ToString ();
}
- public bool TryFind<TClause> (out TClause result)
+ public bool TryFind<TClause> (out TClause clause)
where TClause : SecurityKeyIdentifierClause
{
- result = default (TClause);
+ clause = default (TClause);
foreach (SecurityKeyIdentifierClause kic in this)
if (typeof (TClause).IsAssignableFrom (kic.GetType ())) {
- result = (TClause) kic;
+ clause = (TClause) kic;
return true;
}
return false;
this.clause_type = clauseType;
}
- protected SecurityKeyIdentifierClause (string clauseType, byte [] derivationNonce, int derivationLength)
+ protected SecurityKeyIdentifierClause (string clauseType, byte [] nonce, int length)
{
this.clause_type = clauseType;
- if (derivationNonce != null)
- this.nonce = (byte []) derivationNonce.Clone ();
- this.deriv_length = derivationLength;
+ if (nonce != null)
+ this.nonce = (byte []) nonce.Clone ();
+ this.deriv_length = length;
}
string clause_type;
}
[MonoTODO]
- public virtual bool Matches (SecurityKeyIdentifierClause clause)
+ public virtual bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
}
public virtual bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
return false;
}
[MonoTODO]
public virtual SecurityKey ResolveKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (skiClause == null)
- throw new ArgumentNullException ("skiClause");
- if (!MatchesKeyIdentifierClause (skiClause))
- throw new InvalidOperationException (String.Format ("This '{0}' security token does not support resolving '{1}' key identifier clause.", GetType (), skiClause));
- if (skiClause.CanCreateKey)
- return skiClause.CreateKey ();
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
+ if (!MatchesKeyIdentifierClause (keyIdentifierClause))
+ throw new InvalidOperationException (String.Format ("This '{0}' security token does not support resolving '{1}' key identifier clause.", GetType (), keyIdentifierClause));
+ if (keyIdentifierClause.CanCreateKey)
+ return keyIdentifierClause.CreateKey ();
// FIXME: examine it.
if (SecurityKeys.Count == 0)
- throw new InvalidOperationException (String.Format ("This '{0}' security token does not have any keys that can be resolved.", GetType (), skiClause));
+ throw new InvalidOperationException (String.Format ("This '{0}' security token does not have any keys that can be resolved.", GetType (), keyIdentifierClause));
return SecurityKeys [0];
}
}
public class SecurityTokenException : SystemException
{
public SecurityTokenException () : base () {}
- public SecurityTokenException (string msg) : base (msg) {}
- public SecurityTokenException (string msg, Exception inner) : base (msg, inner) {}
+ public SecurityTokenException (string message) : base (message) {}
+ public SecurityTokenException (string message, Exception innerException) : base (message, innerException) {}
protected SecurityTokenException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// SecurityTokenExpiredException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenExpiredException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenExpiredException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenExpiredException(SerializationInfo info, StreamingContext context)
-//
+//
// SecurityTokenNotYetValidException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenNotYetValidException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenNotYetValidException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenNotYetValidException(SerializationInfo info, StreamingContext context)
-//
+//
// SecurityTokenReplayDetectedException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenReplayDetectedException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenReplayDetectedException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenReplayDetectedException(SerializationInfo info, StreamingContext context)
public class SecurityTokenValidationException : SecurityTokenException
{
public SecurityTokenValidationException () : base () {}
- public SecurityTokenValidationException (string msg) : base (msg) {}
- public SecurityTokenValidationException (string msg, Exception inner) : base (msg, inner) {}
+ public SecurityTokenValidationException (string message) : base (message) {}
+ public SecurityTokenValidationException (string message, Exception innerException) : base (message, innerException) {}
protected SecurityTokenValidationException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
}
[MonoTODO]
- public WindowsSecurityToken (WindowsIdentity identity)
+ public WindowsSecurityToken (WindowsIdentity windowsIdentity)
{
throw new NotImplementedException ();
}
- public WindowsSecurityToken (WindowsIdentity identity, string id)
+ public WindowsSecurityToken (WindowsIdentity windowsIdentity, string id)
{
- this.identity = identity;
+ this.identity = windowsIdentity;
this.id = id;
}
get { return serial; }
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
X509IssuerSerialKeyIdentifierClause other =
- clause as X509IssuerSerialKeyIdentifierClause;
+ keyIdentifierClause as X509IssuerSerialKeyIdentifierClause;
return other != null && Matches (other.name, other.serial);
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
LocalIdKeyIdentifierClause l =
- skiClause as LocalIdKeyIdentifierClause;
+ keyIdentifierClause as LocalIdKeyIdentifierClause;
if (l != null)
return l.LocalId == Id;
X509ThumbprintKeyIdentifierClause t =
- skiClause as X509ThumbprintKeyIdentifierClause;
+ keyIdentifierClause as X509ThumbprintKeyIdentifierClause;
if (t != null)
return t.Matches (cert);
X509IssuerSerialKeyIdentifierClause i =
- skiClause as X509IssuerSerialKeyIdentifierClause;
+ keyIdentifierClause as X509IssuerSerialKeyIdentifierClause;
if (i != null)
return i.Matches (cert);
X509SubjectKeyIdentifierClause s =
- skiClause as X509SubjectKeyIdentifierClause;
+ keyIdentifierClause as X509SubjectKeyIdentifierClause;
if (s != null)
return s.Matches (cert);
X509RawDataKeyIdentifierClause r =
- skiClause as X509RawDataKeyIdentifierClause;
+ keyIdentifierClause as X509RawDataKeyIdentifierClause;
if (r != null)
return r.Matches (cert);
public class X509SubjectKeyIdentifierClause : BinaryKeyIdentifierClause
{
[MonoTODO]
- public X509SubjectKeyIdentifierClause (byte [] certificateSubject)
- : base (null, certificateSubject, true)
+ public X509SubjectKeyIdentifierClause (byte [] ski)
+ : base (null, ski, true)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- public static bool TryCreateFrom (X509Certificate2 certificate, out X509SubjectKeyIdentifierClause clause)
+ public static bool TryCreateFrom (X509Certificate2 certificate, out X509SubjectKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
{
public class X509ThumbprintKeyIdentifierClause : BinaryKeyIdentifierClause
{
- public X509ThumbprintKeyIdentifierClause (byte [] certificateThumbprint)
- : base (null, certificateThumbprint, true)
+ public X509ThumbprintKeyIdentifierClause (byte [] thumbprint)
+ : base (null, thumbprint, true)
{
}
public class X509WindowsSecurityToken : X509SecurityToken
{
[MonoTODO]
- public X509WindowsSecurityToken (X509Certificate2 cert, WindowsIdentity identity)
- : base (cert)
+ public X509WindowsSecurityToken (X509Certificate2 certificate, WindowsIdentity windowsIdentity)
+ : base (certificate)
{
throw new NotImplementedException ();
}
- public X509WindowsSecurityToken (X509Certificate2 cert, WindowsIdentity identity, string id)
- : base (cert, id)
+ public X509WindowsSecurityToken (X509Certificate2 certificate, WindowsIdentity windowsIdentity, string id)
+ : base (certificate, id)
{
- this.identity = identity;
+ this.identity = windowsIdentity;
}
WindowsIdentity identity;
-//
+//
// SignatureVerificationFailedException.cs
//
// Author:
: base(message)
{ }
- public SignatureVerificationFailedException(string message, Exception innerException)
- : base(message, innerException)
+ public SignatureVerificationFailedException(string message, Exception inner)
+ : base(message, inner)
{ }
public SignatureVerificationFailedException(SerializationInfo info, StreamingContext context)
throw new NotImplementedException ();
}
- public virtual void Add (string methodName, ManagementBaseObject inParams, ManagementBaseObject outParams)
+ public virtual void Add (string methodName, ManagementBaseObject inParameters, ManagementBaseObject outParameters)
{
throw new NotImplementedException ();
}
LIB_REFS = System
LIB_MCS_FLAGS = /unsafe
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
+XTEST_LIB_REFS = System Facades/System.Threading.Tasks System.Runtime.InteropServices.RuntimeInformation System.Core System.Numerics.Vectors Microsoft.CSharp
+XTEST_LIB_FLAGS = -unsafe
RESX_RESOURCE_STRING = \
../../../external/corefx/src/System.Runtime.Numerics/src/Resources/Strings.resx \
../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/Complex.cs
../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs
+../../../external/corefx/src/System.Numerics.Vectors/src/System/MathF.cs
+
../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs
../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix3x2.cs
../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix4x4.cs
--- /dev/null
+../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
+
+# ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
+../../../external/corefx/src/System.Runtime.Numerics/tests/BigInteger/*.cs
+
+../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs
+
+../../../external/corefx/src/System.Numerics.Vectors/tests/*.cs
_info = new SignerInfoCollection ();
}
- public SignedCms (ContentInfo content)
- : this (content, false)
+ public SignedCms (ContentInfo contentInfo)
+ : this (contentInfo, false)
{
}
- public SignedCms (ContentInfo content, bool detached)
+ public SignedCms (ContentInfo contentInfo, bool detached)
: this ()
{
- if (content == null)
- throw new ArgumentNullException ("content");
+ if (contentInfo == null)
+ throw new ArgumentNullException ("contentInfo");
- _content = content;
+ _content = contentInfo;
_detached = detached;
}
_type = signerIdentifierType;
}
- public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content)
- : this (content, false)
+ public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo)
+ : this (contentInfo, false)
{
_type = signerIdentifierType;
}
- public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content, bool detached)
- : this (content, detached)
+ public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo, bool detached)
+ : this (contentInfo, detached)
{
_type = signerIdentifierType;
}
{
}
- public CipherReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public CipherReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
}
ReferenceType = XmlEncryption.ElementNames.DataReference;
}
- public DataReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public DataReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
ReferenceType = XmlEncryption.ElementNames.DataReference;
}
TransformChain = new TransformChain ();
}
- protected EncryptedReference (string uri, TransformChain tc)
+ protected EncryptedReference (string uri, TransformChain transformChain)
: this ()
{
Uri = uri;
- TransformChain = tc;
+ TransformChain = transformChain;
}
#endregion // Constructors
keyNameMapping.Clear ();
}
- public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symAlg)
+ public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symmetricAlgorithm)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- PaddingMode bak = symAlg.Padding;
+ PaddingMode bak = symmetricAlgorithm.Padding;
try {
- symAlg.Padding = Padding;
- return Transform (encryptedData.CipherData.CipherValue, symAlg.CreateDecryptor (), symAlg.BlockSize / 8, true);
+ symmetricAlgorithm.Padding = Padding;
+ return Transform (encryptedData.CipherData.CipherValue, symmetricAlgorithm.CreateDecryptor (), symmetricAlgorithm.BlockSize / 8, true);
} finally {
- symAlg.Padding = bak;
+ symmetricAlgorithm.Padding = bak;
}
}
return DecryptKey (encryptedKey.CipherData.CipherValue, (SymmetricAlgorithm) keyAlg);
}
- public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+ public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
{
if (keyData == null)
throw new ArgumentNullException ("keyData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- if (symAlg is TripleDES)
- return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symAlg.Key, keyData);
- if (symAlg is Rijndael)
- return SymmetricKeyWrap.AESKeyWrapDecrypt (symAlg.Key, keyData);
+ if (symmetricAlgorithm is TripleDES)
+ return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
+ if (symmetricAlgorithm is Rijndael)
+ return SymmetricKeyWrap.AESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
throw new CryptographicException ("The specified cryptographic transform is not supported.");
}
[MonoTODO ("Test this.")]
- public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+ public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool useOAEP)
{
AsymmetricKeyExchangeDeformatter deformatter = null;
- if (fOAEP)
+ if (useOAEP)
deformatter = new RSAOAEPKeyExchangeDeformatter (rsa);
else
deformatter = new RSAPKCS1KeyExchangeDeformatter (rsa);
throw new NotImplementedException ();
}
- public byte[] EncryptData (byte[] plainText, SymmetricAlgorithm symAlg)
+ public byte[] EncryptData (byte[] plaintext, SymmetricAlgorithm symmetricAlgorithm)
{
- if (plainText == null)
- throw new ArgumentNullException ("plainText");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (plaintext == null)
+ throw new ArgumentNullException ("plaintext");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- PaddingMode bak = symAlg.Padding;
+ PaddingMode bak = symmetricAlgorithm.Padding;
try {
- symAlg.Padding = Padding;
- return EncryptDataCore (plainText, symAlg);
+ symmetricAlgorithm.Padding = Padding;
+ return EncryptDataCore (plaintext, symmetricAlgorithm);
} finally {
- symAlg.Padding = bak;
+ symmetricAlgorithm.Padding = bak;
}
}
return output;
}
- public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symAlg, bool content)
+ public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symmetricAlgorithm, bool content)
{
if (inputElement == null)
throw new ArgumentNullException ("inputElement");
if (content)
- return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symAlg);
+ return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symmetricAlgorithm);
else
- return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symAlg);
+ return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symmetricAlgorithm);
}
- public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+ public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
{
if (keyData == null)
throw new ArgumentNullException ("keyData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- if (symAlg is TripleDES)
- return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symAlg.Key, keyData);
- if (symAlg is Rijndael)
- return SymmetricKeyWrap.AESKeyWrapEncrypt (symAlg.Key, keyData);
+ if (symmetricAlgorithm is TripleDES)
+ return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
+ if (symmetricAlgorithm is Rijndael)
+ return SymmetricKeyWrap.AESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
throw new CryptographicException ("The specified cryptographic transform is not supported.");
}
[MonoTODO ("Test this.")]
- public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+ public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool useOAEP)
{
AsymmetricKeyExchangeFormatter formatter = null;
- if (fOAEP)
+ if (useOAEP)
formatter = new RSAOAEPKeyExchangeFormatter (rsa);
else
formatter = new RSAPKCS1KeyExchangeFormatter (rsa);
throw new ArgumentException ("keyAlg");
}
- public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symAlgUri)
+ public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symmetricAlgorithmUri)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+ SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
byte[] iv = new Byte [symAlg.BlockSize / 8];
Buffer.BlockCopy (encryptedData.CipherData.CipherValue, 0, iv, 0, iv.Length);
return iv;
}
- public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symAlgUri)
+ public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symmetricAlgorithmUri)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- if (symAlgUri == null)
+ if (symmetricAlgorithmUri == null)
return null;
- SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+ SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
symAlg.IV = GetDecryptionIV (encryptedData, encryptedData.EncryptionMethod.KeyAlgorithm);
KeyInfo keyInfo = encryptedData.KeyInfo;
foreach (KeyInfoClause clause in keyInfo) {
KeyAlgorithm = null;
}
- public EncryptionMethod (string strAlgorithm)
+ public EncryptionMethod (string algorithm)
{
- KeyAlgorithm = strAlgorithm;
+ KeyAlgorithm = algorithm;
}
#endregion // Constructors
{
}
- public EncryptionProperty (XmlElement elemProp)
+ public EncryptionProperty (XmlElement elementProperty)
{
- LoadXml (elemProp);
+ LoadXml (elementProperty);
}
#endregion // Constructors
{
}
- public KeyInfoEncryptedKey (EncryptedKey ek)
+ public KeyInfoEncryptedKey (EncryptedKey encryptedKey)
{
- EncryptedKey = ek;
+ EncryptedKey = encryptedKey;
}
#endregion // Constructors
URI = strUri;
}
- public KeyInfoRetrievalMethod (string strUri, string strType)
+ public KeyInfoRetrievalMethod (string strUri, string typeName)
: this (strUri)
{
- Type = strType;
+ Type = typeName;
}
[ComVisible (false)]
ReferenceType = XmlEncryption.ElementNames.KeyReference;
}
- public KeyReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public KeyReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
ReferenceType = XmlEncryption.ElementNames.KeyReference;
}
_flags = DataProtectionPermissionFlags.AllFlags;
}
- public DataProtectionPermission (DataProtectionPermissionFlags flags)
+ public DataProtectionPermission (DataProtectionPermissionFlags flag)
{
// reuse validation by the Flags property
- Flags = flags;
+ Flags = flag;
}
return ((_flags & ~dp._flags) == 0);
}
- public override void FromXml (SecurityElement e)
+ public override void FromXml (SecurityElement securityElement)
{
// General validation in CodeAccessPermission
- PermissionHelper.CheckSecurityElement (e, "e", version, version);
+ PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
// Note: we do not (yet) care about the return value
// as we only accept version 1 (min/max values)
_flags = (DataProtectionPermissionFlags) Enum.Parse (
- typeof (DataProtectionPermissionFlags), e.Attribute ("Flags"));
+ typeof (DataProtectionPermissionFlags), securityElement.Attribute ("Flags"));
}
public override SecurityElement ToXml ()
// It seems to do nothing.
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
}
base.OnInitializeAndValidate (channelEndpointElement);
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
- base.OnInitializeAndValidate (channelEndpointElement);
+ base.OnInitializeAndValidate (serviceEndpointElement);
}
}
}
base.OnInitializeAndValidate (channelEndpointElement);
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
- base.OnInitializeAndValidate (channelEndpointElement);
+ base.OnInitializeAndValidate (serviceEndpointElement);
}
}
}
{
}
- public Atom10ItemFormatter (SyndicationItem feedToWrite)
- : base (feedToWrite)
+ public Atom10ItemFormatter (SyndicationItem itemToWrite)
+ : base (itemToWrite)
{
}
return new XmlSyndicationContent (null, xmlSerializerObject, serializer);
}
- public static XmlSyndicationContent CreateXmlContent (XmlReader reader)
+ public static XmlSyndicationContent CreateXmlContent (XmlReader xmlReader)
{
- return new XmlSyndicationContent (reader);
+ return new XmlSyndicationContent (xmlReader);
}
#endregion
{
}
- public SyndicationItem (string title, string content, Uri feedAlternateLink)
- : this (title, content, feedAlternateLink, null, default (DateTimeOffset))
+ public SyndicationItem (string title, string content, Uri itemAlternateLink)
+ : this (title, content, itemAlternateLink, null, default (DateTimeOffset))
{
}
- public SyndicationItem (string title, string content, Uri feedAlternateLink, string id,
+ public SyndicationItem (string title, string content, Uri itemAlternateLink, string id,
DateTimeOffset lastUpdatedTime)
- : this (title, content != null ? SyndicationContent.CreatePlaintextContent (content) : null, feedAlternateLink, id, lastUpdatedTime)
+ : this (title, content != null ? SyndicationContent.CreatePlaintextContent (content) : null, itemAlternateLink, id, lastUpdatedTime)
{
}
- public SyndicationItem (string title, SyndicationContent content, Uri feedAlternateLink, string id,
+ public SyndicationItem (string title, SyndicationContent content, Uri itemAlternateLink, string id,
DateTimeOffset lastUpdatedTime)
{
Title = title != null ? new TextSyndicationContent (title) : null;
Content = content;
- if (feedAlternateLink != null)
- AddPermalink (feedAlternateLink);
+ if (itemAlternateLink != null)
+ AddPermalink (itemAlternateLink);
Id = id;
LastUpdatedTime = lastUpdatedTime;
}
set { title = value; }
}
- public void AddPermalink (Uri link)
+ public void AddPermalink (Uri permalink)
{
- if (link == null)
- throw new ArgumentNullException ("link");
- Links.Add (SyndicationLink.CreateAlternateLink (link));
+ if (permalink == null)
+ throw new ArgumentNullException ("permalink");
+ Links.Add (SyndicationLink.CreateAlternateLink (permalink));
}
public virtual SyndicationItem Clone ()
return extension.GetObject<TContent> ();
}
- public TContent ReadContent<TContent> (XmlObjectSerializer serializer)
+ public TContent ReadContent<TContent> (XmlObjectSerializer dataContractSerializer)
{
- return extension.GetObject<TContent> (serializer);
+ return extension.GetObject<TContent> (dataContractSerializer);
}
public TContent ReadContent<TContent> (XmlSerializer serializer)
}
#endif
- public WebChannelFactory(Type serviceType)
- : base (serviceType)
+ public WebChannelFactory(Type channelType)
+ : base (channelType)
{
}
- public WebChannelFactory (string configurationName)
- : base (configurationName)
+ public WebChannelFactory (string endpointConfigurationName)
+ : base (endpointConfigurationName)
{
}
OutgoingWebRequestContext outgoing_request;
OutgoingWebResponseContext outgoing_response;
- public WebOperationContext (OperationContext operation)
+ public WebOperationContext (OperationContext operationContext)
{
- if (operation == null)
- throw new ArgumentNullException ("operation");
+ if (operationContext == null)
+ throw new ArgumentNullException ("operationContext");
outgoing_request = new OutgoingWebRequestContext ();
- incoming_response = new IncomingWebResponseContext (operation);
+ incoming_response = new IncomingWebResponseContext (operationContext);
#if !MOBILE
- incoming_request = new IncomingWebRequestContext (operation);
+ incoming_request = new IncomingWebRequestContext (operationContext);
outgoing_response = new OutgoingWebResponseContext ();
#endif
}
}
#endif
- public void Attach (OperationContext context)
+ public void Attach (OperationContext owner)
{
// do nothing
}
- public void Detach (OperationContext context)
+ public void Detach (OperationContext owner)
{
// do nothing
}
{
}
- public WebHttpBinding (WebHttpSecurityMode mode)
+ public WebHttpBinding (WebHttpSecurityMode securityMode)
{
- Initialize (mode);
+ Initialize (securityMode);
}
public WebHttpBinding (string configurationName)
public class UriTemplateMatchException : SystemException
{
public UriTemplateMatchException () : base () {}
- public UriTemplateMatchException (string msg) : base (msg) {}
- public UriTemplateMatchException (string msg, Exception inner) : base (msg, inner) {}
+ public UriTemplateMatchException (string message) : base (message) {}
+ public UriTemplateMatchException (string message, Exception innerException) : base (message, innerException) {}
protected UriTemplateMatchException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
return list;
}
- protected override void InsertItem (int index, TItem kind)
+ protected override void InsertItem (int index, TItem item)
{
- base.InsertItem (index, kind);
+ base.InsertItem (index, item);
}
- protected override void SetItem (int index, TItem kind)
+ protected override void SetItem (int index, TItem item)
{
- base.SetItem (index, kind);
+ base.SetItem (index, item);
}
public T Remove<T> ()
}
protected SynchronizedKeyedCollection (object syncRoot,
- IEqualityComparer<K> comparer, int capacity)
+ IEqualityComparer<K> comparer, int dictionaryCreationThreshold)
: base (syncRoot)
{
- dict = new Dictionary<K, T> (capacity, comparer);
+ dict = new Dictionary<K, T> (dictionaryCreationThreshold, comparer);
}
// see bug #76417
{
}
- public SynchronizedReadOnlyCollection (object sync_root)
- : this (sync_root, new List<T> ())
+ public SynchronizedReadOnlyCollection (object syncRoot)
+ : this (syncRoot, new List<T> ())
{
}
- public SynchronizedReadOnlyCollection (object sync_root, IEnumerable<T> list)
+ public SynchronizedReadOnlyCollection (object syncRoot, IEnumerable<T> list)
{
- if (sync_root == null)
- throw new ArgumentNullException ("sync_root");
+ if (syncRoot == null)
+ throw new ArgumentNullException ("syncRoot");
if (list == null)
throw new ArgumentNullException ("list");
- this.sync_root = sync_root;
+ this.sync_root = syncRoot;
this.l = new List<T> (list);
}
- public SynchronizedReadOnlyCollection (object sync_root, params T [] list)
- : this (sync_root, (IEnumerable<T>) list)
+ public SynchronizedReadOnlyCollection (object syncRoot, params T [] list)
+ : this (syncRoot, (IEnumerable<T>) list)
{
}
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
- Uri listenUri,
+ Uri listenUriBaseAddress,
params object [] parameters)
where TChannel : class, IChannel
{
new BindingParameterCollection ();
foreach (object o in parameters)
pl.Add (o);
- return BuildChannelListener<TChannel> (listenUri, pl);
+ return BuildChannelListener<TChannel> (listenUriBaseAddress, pl);
}
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
- Uri listenUri,
+ Uri listenUriBaseAddress,
BindingParameterCollection parameters)
where TChannel : class, IChannel
{
- return BuildChannelListener<TChannel> (listenUri,
+ return BuildChannelListener<TChannel> (listenUriBaseAddress,
String.Empty, parameters);
}
}
public IAsyncResult BeginAcceptChannel (
- AsyncCallback callback, object asyncState)
+ AsyncCallback callback, object state)
{
return BeginAcceptChannel (
- timeouts.ReceiveTimeout, callback, asyncState);
+ timeouts.ReceiveTimeout, callback, state);
}
public IAsyncResult BeginAcceptChannel (TimeSpan timeout,
- AsyncCallback callback, object asyncState)
+ AsyncCallback callback, object state)
{
- return OnBeginAcceptChannel (timeout, callback, asyncState);
+ return OnBeginAcceptChannel (timeout, callback, state);
}
public TChannel EndAcceptChannel (IAsyncResult result)
protected abstract TChannel OnAcceptChannel (TimeSpan timeout);
protected abstract IAsyncResult OnBeginAcceptChannel (TimeSpan timeout,
- AsyncCallback callback, object asyncState);
+ AsyncCallback callback, object state);
protected abstract TChannel OnEndAcceptChannel (IAsyncResult result);
}
ISecurityCapabilities security;
string scheme = "";
- public CustomBinding (string name)
- : this (name, default_ns)
+ public CustomBinding (string configurationName)
+ : this (configurationName, default_ns)
{
}
// 1)
public static Message CreateMessage (MessageVersion version,
- FaultCode code, string reason, string action)
+ FaultCode faultCode, string reason, string action)
{
- MessageFault fault = MessageFault.CreateFault (code, reason);
+ MessageFault fault = MessageFault.CreateFault (faultCode, reason);
return CreateMessage (version, fault, action);
}
// 2)
public static Message CreateMessage (MessageVersion version,
- FaultCode code, string reason, object detail,
+ FaultCode faultCode, string reason, object detail,
string action)
{
MessageFault fault = MessageFault.CreateFault (
- code, new FaultReason (reason), detail);
+ faultCode, new FaultReason (reason), detail);
return CreateMessage (version, fault, action);
}
return CreateNavigator (XmlSpace.Default);
}
- public XPathNavigator CreateNavigator (int node_quota)
+ public XPathNavigator CreateNavigator (int nodeQuota)
{
- return CreateNavigator (node_quota, XmlSpace.Default);
+ return CreateNavigator (nodeQuota, XmlSpace.Default);
}
[MonoTODO ("supply proper quota")]
}
[MonoTODO ("Handle node_quota and xmlspace")]
- public XPathNavigator CreateNavigator (int node_quota, XmlSpace space)
+ public XPathNavigator CreateNavigator (int nodeQuota, XmlSpace space)
{
if (nav_cache == null) {
- DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2 (new NameTable (), node_quota);
+ DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2 (new NameTable (), nodeQuota);
XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (pw);
CreateMessage ().WriteMessage (w);
nav_cache = pw.CreateDocument ().CreateNavigator ();
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter)
+ XmlObjectSerializer serializer)
{
return new SimpleMessageFault (code, reason, true,
- detail, formatter, String.Empty, String.Empty);
+ detail, serializer, String.Empty, String.Empty);
}
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter, string actor)
+ XmlObjectSerializer serializer, string actor)
{
return new SimpleMessageFault (code, reason,
- true, detail, formatter, actor, String.Empty);
+ true, detail, serializer, actor, String.Empty);
}
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter, string actor, string node)
+ XmlObjectSerializer serializer, string actor, string node)
{
return new SimpleMessageFault (code, reason,
- true, detail, formatter, actor, node);
+ true, detail, serializer, actor, node);
}
// pretty simple implementation class
new Dictionary<Type, XmlObjectSerializer> ();
MessageVersion version;
- public MessageHeaders (MessageHeaders headers)
- : this (headers.MessageVersion)
+ public MessageHeaders (MessageHeaders collection)
+ : this (collection.MessageVersion)
{
- CopyHeadersFrom (headers);
+ CopyHeadersFrom (collection);
}
public MessageHeaders (MessageVersion version)
{
}
- public MessageHeaders (MessageVersion version, int capacity)
+ public MessageHeaders (MessageVersion version, int initialSize)
{
this.version = version;
- l = new List<MessageHeaderInfo> (capacity);
+ l = new List<MessageHeaderInfo> (initialSize);
}
public void Add (MessageHeader header)
}
public MtomMessageEncodingBindingElement (
- MessageVersion version, Encoding encoding)
+ MessageVersion messageVersion, Encoding writeEncoding)
{
- this.version = version;
- this.encoding = encoding;
+ this.version = messageVersion;
+ this.encoding = writeEncoding;
}
public int MaxBufferSize {
}
protected NamedPipeTransportBindingElement (
- NamedPipeTransportBindingElement other)
- : base (other)
+ NamedPipeTransportBindingElement elementToBeCloned)
+ : base (elementToBeCloned)
{
- pool.CopyPropertiesFrom (other.pool);
+ pool.CopyPropertiesFrom (elementToBeCloned.pool);
}
NamedPipeConnectionPoolSettings pool = new NamedPipeConnectionPoolSettings ();
{
}
- protected StreamUpgradeBindingElement (StreamUpgradeBindingElement other)
+ protected StreamUpgradeBindingElement (StreamUpgradeBindingElement elementToBeCloned)
{
}
{
}
- public TransactionFlowBindingElement (TransactionProtocol protocol)
+ public TransactionFlowBindingElement (TransactionProtocol transactionProtocol)
{
- this.protocol = protocol;
+ this.protocol = transactionProtocol;
}
public TransactionProtocol TransactionProtocol {
{
headers = new List<MessageHeaderInfo> ();
}
- public void Add (MessageHeaderInfo header)
+ public void Add (MessageHeaderInfo headerInfo)
{
- headers.Add (header);
+ headers.Add (headerInfo);
}
- public bool Contains (MessageHeaderInfo header)
+ public bool Contains (MessageHeaderInfo headerInfo)
{
- return headers.Contains (header);
+ return headers.Contains (headerInfo);
}
public IEnumerator<MessageHeaderInfo> GetEnumerator ()
return headers.GetEnumerator ();
}
- public void Remove (MessageHeaderInfo header)
+ public void Remove (MessageHeaderInfo headerInfo)
{
- headers.Remove (header);
+ headers.Remove (headerInfo);
}
IEnumerator IEnumerable.GetEnumerator ()
return new BinaryMessageEncodingBindingElement ();
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (BinaryMessageEncodingBindingElement) element;
+ var b = (BinaryMessageEncodingBindingElement) bindingElement;
b.MaxReadPoolSize = MaxReadPoolSize;
b.MaxSessionSize = MaxSessionSize;
b.MaxWritePoolSize = MaxWritePoolSize;
ReaderQuotas.ApplyConfiguration (b.ReaderQuotas);
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (BinaryMessageEncodingElement) element;
+ var b = (BinaryMessageEncodingElement) from;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxSessionSize = b.MaxSessionSize;
MaxWritePoolSize = b.MaxWritePoolSize;
ReaderQuotas.CopyFrom (b.ReaderQuotas);
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (BinaryMessageEncodingBindingElement) element;
+ var b = (BinaryMessageEncodingBindingElement) bindingElement;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxSessionSize = b.MaxSessionSize;
MaxWritePoolSize = b.MaxWritePoolSize;
return sm.Bindings;
}
- public new BindingCollectionElement this [string name] {
+ public new BindingCollectionElement this [string binding] {
get {
- object element = base [name];
+ object element = base [binding];
if (element is BindingCollectionElement)
return (BindingCollectionElement) element;
- throw new NotImplementedException (String.Format ("Could not find {0}", name));
+ throw new NotImplementedException (String.Format ("Could not find {0}", binding));
}
}
return cb;
}
- protected internal void ApplyConfiguration (ClientCredentials cb)
+ protected internal void ApplyConfiguration (ClientCredentials behavior)
{
- cb.SupportInteractive = SupportInteractive;
+ behavior.SupportInteractive = SupportInteractive;
// how is "Type" used?
// ClientCertificate
if (!String.IsNullOrEmpty (ClientCertificate.FindValue))
- cb.ClientCertificate.SetCertificate (ClientCertificate.StoreLocation, ClientCertificate.StoreName, ClientCertificate.X509FindType, ClientCertificate.FindValue);
+ behavior.ClientCertificate.SetCertificate (ClientCertificate.StoreLocation, ClientCertificate.StoreName, ClientCertificate.X509FindType, ClientCertificate.FindValue);
// HttpDigest
if (HttpDigest.ImpersonationLevel != TokenImpersonationLevel.None)
throw new NotImplementedException ();
// IssuedToken
- var bi = cb.IssuedToken;
+ var bi = behavior.IssuedToken;
var ci = IssuedToken;
bi.CacheIssuedTokens = ci.CacheIssuedTokens;
bi.DefaultKeyEntropyMode = ci.DefaultKeyEntropyMode;
// Peer
if (!String.IsNullOrEmpty (Peer.Certificate.FindValue))
- cb.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
+ behavior.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
// cb.Peer.MeshPassword = /* cannot fill it here */
- cb.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
- cb.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
- cb.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
- cb.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
- cb.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
- cb.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
- cb.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
- cb.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
+ behavior.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
+ behavior.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
+ behavior.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
+ behavior.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
+ behavior.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
+ behavior.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
// ServiceCertificate
- var bsc = cb.ServiceCertificate;
+ var bsc = behavior.ServiceCertificate;
var csc = ServiceCertificate;
var bsca = bsc.Authentication;
var csca = csc.Authentication;
// cb.UserNamePassword : not configurable ...
// Windows
- cb.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
- cb.Windows.AllowNtlm = Windows.AllowNtlm;
+ behavior.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
+ behavior.Windows.AllowNtlm = Windows.AllowNtlm;
}
object CreateInstance (string typeName)
return new ReliableSessionBindingElement ();
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (ReliableSessionBindingElement) element;
+ var b = (ReliableSessionBindingElement) bindingElement;
b.AcknowledgementInterval = AcknowledgementInterval;
b.FlowControlEnabled = FlowControlEnabled;
b.InactivityTimeout = InactivityTimeout;
b.ReliableMessagingVersion = ReliableMessagingVersion;
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (ReliableSessionElement) element;
+ var b = (ReliableSessionElement) from;
AcknowledgementInterval = b.AcknowledgementInterval;
FlowControlEnabled = b.FlowControlEnabled;
InactivityTimeout = b.InactivityTimeout;
ReliableMessagingVersion = b.ReliableMessagingVersion;
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (ReliableSessionBindingElement) element;
+ var b = (ReliableSessionBindingElement) bindingElement;
AcknowledgementInterval = b.AcknowledgementInterval;
FlowControlEnabled = b.FlowControlEnabled;
InactivityTimeout = b.InactivityTimeout;
return sb;
}
- protected internal void ApplyConfiguration (ServiceCredentials sb)
+ protected internal void ApplyConfiguration (ServiceCredentials behavior)
{
// IssuedToken
foreach (AllowedAudienceUriElement ae in IssuedTokenAuthentication.AllowedAudienceUris)
- sb.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
- sb.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = IssuedTokenAuthentication.AllowUntrustedRsaIssuers;
- sb.IssuedTokenAuthentication.AudienceUriMode = IssuedTokenAuthentication.AudienceUriMode;
+ behavior.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
+ behavior.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = IssuedTokenAuthentication.AllowUntrustedRsaIssuers;
+ behavior.IssuedTokenAuthentication.AudienceUriMode = IssuedTokenAuthentication.AudienceUriMode;
if (!String.IsNullOrEmpty (IssuedTokenAuthentication.CustomCertificateValidatorType))
- sb.IssuedTokenAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (IssuedTokenAuthentication.CustomCertificateValidatorType);
- sb.IssuedTokenAuthentication.CertificateValidationMode = IssuedTokenAuthentication.CertificateValidationMode;
- sb.IssuedTokenAuthentication.RevocationMode = IssuedTokenAuthentication.RevocationMode;
- sb.IssuedTokenAuthentication.TrustedStoreLocation = IssuedTokenAuthentication.TrustedStoreLocation;
+ behavior.IssuedTokenAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (IssuedTokenAuthentication.CustomCertificateValidatorType);
+ behavior.IssuedTokenAuthentication.CertificateValidationMode = IssuedTokenAuthentication.CertificateValidationMode;
+ behavior.IssuedTokenAuthentication.RevocationMode = IssuedTokenAuthentication.RevocationMode;
+ behavior.IssuedTokenAuthentication.TrustedStoreLocation = IssuedTokenAuthentication.TrustedStoreLocation;
foreach (X509CertificateTrustedIssuerElement ce in IssuedTokenAuthentication.KnownCertificates)
- sb.IssuedTokenAuthentication.KnownCertificates.Add (GetCertificate (ce.StoreLocation, ce.StoreName, ce.X509FindType, ce.FindValue));
+ behavior.IssuedTokenAuthentication.KnownCertificates.Add (GetCertificate (ce.StoreLocation, ce.StoreName, ce.X509FindType, ce.FindValue));
- sb.IssuedTokenAuthentication.SamlSerializer = (SamlSerializer) CreateInstance (IssuedTokenAuthentication.SamlSerializerType);
+ behavior.IssuedTokenAuthentication.SamlSerializer = (SamlSerializer) CreateInstance (IssuedTokenAuthentication.SamlSerializerType);
// Peer
if (!String.IsNullOrEmpty (Peer.Certificate.FindValue))
- sb.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
+ behavior.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
// sb.Peer.MeshPassword = /* cannot fill it here */
- sb.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
- sb.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
- sb.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
- sb.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
- sb.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
- sb.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
- sb.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
- sb.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
+ behavior.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
+ behavior.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
+ behavior.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
+ behavior.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
+ behavior.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
+ behavior.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
// WSSC
- sb.SecureConversationAuthentication.SecurityStateEncoder = (SecurityStateEncoder) CreateInstance (SecureConversationAuthentication.SecurityStateEncoderType);
+ behavior.SecureConversationAuthentication.SecurityStateEncoder = (SecurityStateEncoder) CreateInstance (SecureConversationAuthentication.SecurityStateEncoderType);
// X509
if (!String.IsNullOrEmpty (ServiceCertificate.FindValue))
- sb.ServiceCertificate.SetCertificate (ServiceCertificate.StoreLocation, ServiceCertificate.StoreName, ServiceCertificate.X509FindType, ServiceCertificate.FindValue);
+ behavior.ServiceCertificate.SetCertificate (ServiceCertificate.StoreLocation, ServiceCertificate.StoreName, ServiceCertificate.X509FindType, ServiceCertificate.FindValue);
// UserNamePassword
- sb.UserNameAuthentication.CachedLogonTokenLifetime = UserNameAuthentication.CachedLogonTokenLifetime;
- sb.UserNameAuthentication.CacheLogonTokens = UserNameAuthentication.CacheLogonTokens;
- sb.UserNameAuthentication.CustomUserNamePasswordValidator = (UserNamePasswordValidator) CreateInstance (UserNameAuthentication.CustomUserNamePasswordValidatorType);
- sb.UserNameAuthentication.IncludeWindowsGroups = UserNameAuthentication.IncludeWindowsGroups;
- sb.UserNameAuthentication.MaxCachedLogonTokens = UserNameAuthentication.MaxCachedLogonTokens;
- sb.UserNameAuthentication.MembershipProvider = (MembershipProvider) CreateInstance (UserNameAuthentication.MembershipProviderName);
- sb.UserNameAuthentication.UserNamePasswordValidationMode = UserNameAuthentication.UserNamePasswordValidationMode;
+ behavior.UserNameAuthentication.CachedLogonTokenLifetime = UserNameAuthentication.CachedLogonTokenLifetime;
+ behavior.UserNameAuthentication.CacheLogonTokens = UserNameAuthentication.CacheLogonTokens;
+ behavior.UserNameAuthentication.CustomUserNamePasswordValidator = (UserNamePasswordValidator) CreateInstance (UserNameAuthentication.CustomUserNamePasswordValidatorType);
+ behavior.UserNameAuthentication.IncludeWindowsGroups = UserNameAuthentication.IncludeWindowsGroups;
+ behavior.UserNameAuthentication.MaxCachedLogonTokens = UserNameAuthentication.MaxCachedLogonTokens;
+ behavior.UserNameAuthentication.MembershipProvider = (MembershipProvider) CreateInstance (UserNameAuthentication.MembershipProviderName);
+ behavior.UserNameAuthentication.UserNamePasswordValidationMode = UserNameAuthentication.UserNamePasswordValidationMode;
// Windows
- sb.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
- sb.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
+ behavior.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
+ behavior.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
}
X509Certificate2 GetCertificate (StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
return (ConfigurationElement) Activator.CreateInstance (typeof (ConfigurationElementType), new object [0]);
}
- public void CopyTo (ConfigurationElementType [] array, int index)
+ public void CopyTo (ConfigurationElementType [] array, int start)
{
- base.CopyTo (array, index);
+ base.CopyTo (array, start);
}
- public int IndexOf (ConfigurationElementType item)
+ public int IndexOf (ConfigurationElementType element)
{
- return BaseIndexOf (item);
+ return BaseIndexOf (element);
}
- public void Remove (ConfigurationElementType item)
+ public void Remove (ConfigurationElementType element)
{
- BaseRemove (GetElementKey (item));
+ BaseRemove (GetElementKey (element));
}
public void RemoveAt (int index)
BaseRemoveAt (index);
}
- public void RemoveAt (object index)
+ public void RemoveAt (object key)
{
- BaseRemove (index);
+ BaseRemove (key);
}
}
}
// Methods
- public void ApplyConfiguration (OptionalReliableSession s)
+ public void ApplyConfiguration (OptionalReliableSession optionalReliableSession)
{
- base.ApplyConfiguration (s);
- s.Enabled = this.Enabled;
+ base.ApplyConfiguration (optionalReliableSession);
+ optionalReliableSession.Enabled = this.Enabled;
}
}
// Methods
- public void ApplyConfiguration (ReliableSession s)
+ public void ApplyConfiguration (ReliableSession reliableSession)
{
- s.InactivityTimeout = InactivityTimeout;
- s.Ordered = Ordered;
+ reliableSession.InactivityTimeout = InactivityTimeout;
+ reliableSession.Ordered = Ordered;
}
}
protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement channelEndpointElement);
- protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement channelEndpointElement);
+ protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement);
protected abstract void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement);
- protected abstract void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement);
+ protected abstract void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement);
protected override void Reset (ConfigurationElement parentElement)
{
return sm.StandardEndpoints;
}
- public new EndpointCollectionElement this [string name] {
+ public new EndpointCollectionElement this [string endpoint] {
get {
- object element = base [name];
+ object element = base [endpoint];
if (element is EndpointCollectionElement)
return (EndpointCollectionElement) element;
- throw new ArgumentException (String.Format ("Could not find {0}", name));
+ throw new ArgumentException (String.Format ("Could not find {0}", endpoint));
}
}
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (TextMessageEncodingBindingElement) element;
+ var b = (TextMessageEncodingBindingElement) bindingElement;
b.MaxReadPoolSize = MaxReadPoolSize;
b.MaxWritePoolSize = MaxWritePoolSize;
b.MessageVersion = MessageVersion;
ReaderQuotas.ApplyConfiguration (b.ReaderQuotas);
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (TextMessageEncodingElement) element;
+ var b = (TextMessageEncodingElement) from;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxWritePoolSize = b.MaxWritePoolSize;
MessageVersion = b.MessageVersion;
ReaderQuotas.CopyFrom (b.ReaderQuotas);
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (TextMessageEncodingBindingElement) element;
+ var b = (TextMessageEncodingBindingElement) bindingElement;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxWritePoolSize = b.MaxWritePoolSize;
MessageVersion = b.MessageVersion;
{
}
- public FaultDescription Find (string name)
+ public FaultDescription Find (string action)
{
foreach (FaultDescription d in this)
- if (d.Name == name)
+ if (d.Name == action)
return d;
return null;
}
- public Collection<FaultDescription> FindAll (string name)
+ public Collection<FaultDescription> FindAll (string action)
{
Collection<FaultDescription> ret =
new Collection<FaultDescription> ();
foreach (FaultDescription d in this)
- if (d.Name == name)
+ if (d.Name == action)
ret.Add (d);
return ret;
}
public interface IServiceBehavior
{
void AddBindingParameters (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase,
Collection<ServiceEndpoint> endpoints,
- BindingParameterCollection parameters);
+ BindingParameterCollection bindingParameters);
void ApplyDispatchBehavior (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase);
void Validate (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase);
}
}
XmlSchemaSet xmlSchemas, ICollection<XmlElement> policy);
void ImportContract (WsdlImporter importer,
- WsdlContractConversionContext contractContext);
+ WsdlContractConversionContext context);
void ImportEndpoint (WsdlImporter importer,
- WsdlEndpointConversionContext endpointContext);
+ WsdlEndpointConversionContext context);
}
}
get { return msg; }
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- MetadataConversionError e = other as MetadataConversionError;
+ MetadataConversionError e = obj as MetadataConversionError;
return e != null &&
e.warning == warning &&
e.msg == msg;
ServiceContractGenerationContext contract,
OperationDescription operation,
CodeTypeDeclaration declaringType,
- CodeMemberMethod method,
+ CodeMemberMethod syncMethod,
CodeMemberMethod beginMethod,
CodeMemberMethod endMethod)
{
this.contract = contract;
this.operation = operation;
declaring_type = declaringType;
- this.method = method;
+ this.method = syncMethod;
this.begin_method = beginMethod;
this.end_method = endMethod;
}
{
}
- public PolicyAssertionCollection (IEnumerable<XmlElement> list)
- : base (new List<XmlElement> (list))
+ public PolicyAssertionCollection (IEnumerable<XmlElement> elements)
+ : base (new List<XmlElement> (elements))
{
}
[MonoTODO]
- public bool Contains (string name, string ns)
+ public bool Contains (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
return true;
return false;
}
[MonoTODO]
- public XmlElement Find (string name, string ns)
+ public XmlElement Find (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
return el;
return null;
}
[MonoTODO]
- public Collection<XmlElement> FindAll (string name, string ns)
+ public Collection<XmlElement> FindAll (string localName, string namespaceUri)
{
Collection<XmlElement> ret =
new Collection<XmlElement> ();
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
ret.Add (el);
return ret;
}
[MonoTODO]
- public XmlElement Remove (string name, string ns)
+ public XmlElement Remove (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns) {
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri) {
Remove (el);
return el;
}
}
[MonoTODO]
- public Collection<XmlElement> RemoveAll (string name, string ns)
+ public Collection<XmlElement> RemoveAll (string localName, string namespaceUri)
{
- Collection<XmlElement> list = FindAll (name, ns);
+ Collection<XmlElement> list = FindAll (localName, namespaceUri);
foreach (XmlElement el in list)
Remove (el);
return list;
{
}
- public ServiceContractGenerator (CodeCompileUnit ccu)
- : this (ccu, null)
+ public ServiceContractGenerator (CodeCompileUnit targetCompileUnit)
+ : this (targetCompileUnit, null)
{
}
- public ServiceContractGenerator (ConfigurationType config)
- : this (null, config)
+ public ServiceContractGenerator (ConfigurationType targetConfig)
+ : this (null, targetConfig)
{
}
- public ServiceContractGenerator (CodeCompileUnit ccu, ConfigurationType config)
+ public ServiceContractGenerator (CodeCompileUnit targetCompileUnit, ConfigurationType targetConfig)
{
- if (ccu == null)
+ if (targetCompileUnit == null)
this.ccu = new CodeCompileUnit ();
else
- this.ccu = ccu;
- this.config = config;
+ this.ccu = targetCompileUnit;
+ this.config = targetConfig;
Options |= ServiceContractGenerationOptions.ChannelInterface |
ServiceContractGenerationOptions.ClientClass;
}
set { service_type = value; }
}
- public static ServiceDescription GetService (Type type)
+ public static ServiceDescription GetService (Type serviceType)
{
// null Type is not rejected
ServiceDescription sd = new ServiceDescription ();
- sd.ServiceType = type;
- if (type != null) {
- var att = type.GetCustomAttribute<ServiceBehaviorAttribute> (true);
+ sd.ServiceType = serviceType;
+ if (serviceType != null) {
+ var att = serviceType.GetCustomAttribute<ServiceBehaviorAttribute> (true);
if (att != null) {
sd.Name = att.Name;
sd.Namespace = att.Namespace;
}
if (sd.Name == null)
- sd.Name = type.Name;
+ sd.Name = serviceType.Name;
if (sd.Namespace == null)
sd.Namespace = "http://tempuri.org/";
}
return sd;
}
- public static ServiceDescription GetService (object wellKnown)
+ public static ServiceDescription GetService (object serviceImplementation)
{
// null instance is not rejected
ServiceDescription sd = new ServiceDescription ();
- sd.ServiceType = wellKnown != null ? wellKnown.GetType () : null;
+ sd.ServiceType = serviceImplementation != null ? serviceImplementation.GetType () : null;
return sd;
}
}
{
}
- public ServiceEndpoint Find (Type type)
+ public ServiceEndpoint Find (Type contractType)
{
foreach (ServiceEndpoint e in this)
- if (e.Contract.ContractType == type)
+ if (e.Contract.ContractType == contractType)
return e;
return null;
}
- public ServiceEndpoint Find (Uri uri)
+ public ServiceEndpoint Find (Uri address)
{
foreach (ServiceEndpoint e in this)
- if (e.Address.Uri == uri)
+ if (e.Address.Uri == address)
return e;
return null;
}
- public ServiceEndpoint Find (XmlQualifiedName name)
+ public ServiceEndpoint Find (XmlQualifiedName contractName)
{
foreach (ServiceEndpoint e in this)
- if (e.Contract.Name == name.Name &&
- e.Contract.Namespace == name.Namespace)
+ if (e.Contract.Name == contractName.Name &&
+ e.Contract.Namespace == contractName.Namespace)
return e;
return null;
}
return list;
}
- public Collection<ServiceEndpoint> FindAll (XmlQualifiedName name)
+ public Collection<ServiceEndpoint> FindAll (XmlQualifiedName contractName)
{
Collection<ServiceEndpoint> list =
new Collection<ServiceEndpoint> ();
foreach (ServiceEndpoint e in this)
- if (e.Contract.Name == name.Name &&
- e.Contract.Namespace == name.Namespace)
+ if (e.Contract.Name == contractName.Name &&
+ e.Contract.Namespace == contractName.Namespace)
list.Add (e);
return list;
}
}
public static TypedMessageConverter Create (
- Type type, string action)
+ Type messageContract, string action)
{
- return Create (type, action, TempUri);
+ return Create (messageContract, action, TempUri);
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
string defaultNamespace)
{
- return Create (type, action, defaultNamespace, (DataContractFormatAttribute)null);
+ return Create (messageContract, action, defaultNamespace, (DataContractFormatAttribute)null);
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
DataContractFormatAttribute formatterAttribute)
{
- return Create (type, action, TempUri, formatterAttribute);
+ return Create (messageContract, action, TempUri, formatterAttribute);
}
public static TypedMessageConverter Create (
- Type type,
+ Type messageContract,
string action, string defaultNamespace,
DataContractFormatAttribute formatterAttribute)
{
return new DefaultTypedMessageConverter (
new DataContractMessagesFormatter (
- MessageContractToMessagesDescription (type, defaultNamespace, action),
+ MessageContractToMessagesDescription (messageContract, defaultNamespace, action),
formatterAttribute));
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
XmlSerializerFormatAttribute formatterAttribute)
{
- return Create (type, action, TempUri, formatterAttribute);
+ return Create (messageContract, action, TempUri, formatterAttribute);
}
public static TypedMessageConverter Create (
- Type type, string action, string defaultNamespace,
+ Type messageContract, string action, string defaultNamespace,
XmlSerializerFormatAttribute formatterAttribute)
{
return new DefaultTypedMessageConverter (
new XmlMessagesFormatter (
- MessageContractToMessagesDescription (type, defaultNamespace, action),
+ MessageContractToMessagesDescription (messageContract, defaultNamespace, action),
formatterAttribute));
}
}
public MessageDescription GetMessageDescription (
- MessageBinding message)
+ MessageBinding messageBinding)
{
throw new NotImplementedException ();
}
}
public OperationDescription GetOperationDescription (
- OperationBinding operation)
+ OperationBinding operationBinding)
{
throw new NotImplementedException ();
}
public void ExportEndpoints (
IEnumerable<ServiceEndpoint> endpoints,
- XmlQualifiedName name)
+ XmlQualifiedName wsdlServiceQName)
{
if (endpoints == null)
throw new ArgumentNullException ("endpoints");
- if (name == null)
- throw new ArgumentNullException ("name");
+ if (wsdlServiceQName == null)
+ throw new ArgumentNullException ("wsdlServiceQName");
foreach (ServiceEndpoint ep in endpoints) {
if (ep.Contract.Name == ServiceMetadataBehavior.MexContractName)
beforeImportCalled = true;
}
- public SMBinding ImportBinding (WSBinding binding)
+ public SMBinding ImportBinding (WSBinding wsdlBinding)
{
- return ImportBinding (binding, true).Binding;
+ return ImportBinding (wsdlBinding, true).Binding;
}
ServiceEndpoint ImportBinding (WSBinding binding, bool throwOnError)
}
}
- public ServiceEndpointCollection ImportEndpoints (WSBinding binding)
+ public ServiceEndpointCollection ImportEndpoints (WSBinding wsdlBinding)
{
var coll = new ServiceEndpointCollection ();
- ImportEndpoints (coll, binding);
+ ImportEndpoints (coll, wsdlBinding);
return coll;
}
- public ServiceEndpointCollection ImportEndpoints (PortType portType)
+ public ServiceEndpointCollection ImportEndpoints (PortType wsdlPortType)
{
var coll = new ServiceEndpointCollection ();
foreach (WSServiceDescription wsd in wsdl_documents) {
foreach (WS.Binding binding in wsd.Bindings) {
- if (!binding.Type.Name.Equals (portType.Name))
+ if (!binding.Type.Name.Equals (wsdlPortType.Name))
continue;
ImportEndpoints (coll, binding);
return coll;
}
- public ServiceEndpointCollection ImportEndpoints (Service service)
+ public ServiceEndpointCollection ImportEndpoints (Service wsdlService)
{
var coll = new ServiceEndpointCollection ();
- foreach (Port port in service.Ports) {
+ foreach (Port port in wsdlService.Ports) {
var sep = ImportEndpoint (port, false);
if (sep != null)
coll.Add (sep);
public XmlSerializerOperationBehavior (
OperationDescription operation,
- XmlSerializerFormatAttribute format)
+ XmlSerializerFormatAttribute attribute)
{
if (operation == null)
throw new ArgumentNullException ("operation");
- if (format == null)
- format = new XmlSerializerFormatAttribute ();
- this.format = format;
+ if (attribute == null)
+ attribute = new XmlSerializerFormatAttribute ();
+ this.format = attribute;
this.operation = operation;
}
return false;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
bool retval;
- Message m = buffer.CreateMessage ();
+ Message m = messageBuffer.CreateMessage ();
retval = Match (m);
m.Close ();
set { transport_handler = value; }
}
- public abstract bool HandleException (Exception e);
+ public abstract bool HandleException (Exception exception);
}
}
\ No newline at end of file
Collection<MessageFilter> filters;
public FilterInvalidBodyAccessException () : base ("Not allowed to navigate to body.") {}
- public FilterInvalidBodyAccessException (string msg) : base (msg) {}
- public FilterInvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ public FilterInvalidBodyAccessException (string message) : base (message) {}
+ public FilterInvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected FilterInvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public FilterInvalidBodyAccessException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public FilterInvalidBodyAccessException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public FilterInvalidBodyAccessException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public FilterInvalidBodyAccessException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public interface IDispatchMessageFormatter
{
void DeserializeRequest (Message message, object [] parameters);
- Message SerializeReply (MessageVersion version, object [] parameters, object result);
+ Message SerializeReply (MessageVersion messageVersion, object [] parameters, object result);
}
}
{
public interface IDispatchMessageInspector
{
- object AfterReceiveRequest (ref Message message,
- IClientChannel channel, InstanceContext context);
- void BeforeSendReply (ref Message message, object instance);
+ object AfterReceiveRequest (ref Message request,
+ IClientChannel channel, InstanceContext instanceContext);
+ void BeforeSendReply (ref Message reply, object correlationState);
}
}
{
public interface IDispatchOperationSelector
{
- string SelectOperation (ref Message msg);
+ string SelectOperation (ref Message message);
}
}
{
public interface IErrorHandler
{
- bool HandleError (Exception exception);
- void ProvideFault (Exception exception, MessageVersion version,
+ bool HandleError (Exception error);
+ void ProvideFault (Exception error, MessageVersion version,
ref Message fault);
}
}
{
public interface IInstanceContextInitializer
{
- void Initialize (InstanceContext context, Message message);
+ void Initialize (InstanceContext instanceContext, Message message);
}
}
{
public interface IInstanceProvider
{
- object GetInstance (InstanceContext context);
- object GetInstance (InstanceContext context, Message message);
- void ReleaseInstance (InstanceContext context, object instance);
+ object GetInstance (InstanceContext instanceContext);
+ object GetInstance (InstanceContext instanceContext, Message message);
+ void ReleaseInstance (InstanceContext instanceContext, object instance);
}
}
IEnumerable<KeyValuePair<MessageFilter,TFilterData>>,
IEnumerable
{
- bool GetMatchingFilter (Message message, out MessageFilter result);
- bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result);
+ bool GetMatchingFilter (Message message, out MessageFilter filter);
+ bool GetMatchingFilter (MessageBuffer messageBuffer, out MessageFilter filter);
bool GetMatchingFilters (Message message, ICollection<MessageFilter> results);
- bool GetMatchingFilters (MessageBuffer buffer, ICollection<MessageFilter> results);
+ bool GetMatchingFilters (MessageBuffer messageBuffer, ICollection<MessageFilter> results);
- bool GetMatchingValue (Message message, out TFilterData data);
- bool GetMatchingValue (MessageBuffer buffer, out TFilterData data);
+ bool GetMatchingValue (Message message, out TFilterData value);
+ bool GetMatchingValue (MessageBuffer messageBuffer, out TFilterData value);
bool GetMatchingValues (Message message, ICollection<TFilterData> results);
- bool GetMatchingValues (MessageBuffer buffer, ICollection<TFilterData> results);
+ bool GetMatchingValues (MessageBuffer messageBuffer, ICollection<TFilterData> results);
}
}
-//
+//
// InstanceContextIdleCallback.cs
//
// Author: Atsushi Enomoto (atsushi@ximian.com)
namespace System.ServiceModel.Dispatcher
{
- public delegate void InstanceContextIdleCallback (InstanceContext context);
+ public delegate void InstanceContextIdleCallback (InstanceContext instanceContext);
}
[Serializable]
public abstract class InvalidBodyAccessException : SystemException
{
- protected InvalidBodyAccessException (string msg) : base (msg) {}
- protected InvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ protected InvalidBodyAccessException (string message) : base (message) {}
+ protected InvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected InvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
}
return true;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
// as documented
return true;
return false;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
// as documented
return false;
Collection<MessageFilter> filters;
public MessageFilterException () : this ("MessageFilter node quota exceeded.") {}
- public MessageFilterException (string msg) : base (msg) {}
- public MessageFilterException (string msg, Exception inner) : base (msg, inner) {}
+ public MessageFilterException (string message) : base (message) {}
+ public MessageFilterException (string message, Exception innerException) : base (message, innerException) {}
protected MessageFilterException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public MessageFilterException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public MessageFilterException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public MessageFilterException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public MessageFilterException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public MessageFilterTable ()
: this (0) {} // 0 is the default
- public MessageFilterTable (int default_priority)
+ public MessageFilterTable (int defaultPriority)
{
- this.default_priority = default_priority;
+ this.default_priority = defaultPriority;
table = new Dictionary<MessageFilter, TFilterData> ();
priority_list = new Dictionary<MessageFilter, int> ();
}
return table.ContainsKey (filter);
}
- public void CopyTo (KeyValuePair<MessageFilter, TFilterData> [] array, int index)
+ public void CopyTo (KeyValuePair<MessageFilter, TFilterData> [] array, int arrayIndex)
{
- ((ICollection) table).CopyTo (array, index);
+ ((ICollection) table).CopyTo (array, arrayIndex);
}
protected virtual IMessageFilterTable<TFilterData> CreateFilterTable (MessageFilter filter)
return priority_list [filter];
}
- public bool GetMatchingFilter (Message message, out MessageFilter result)
+ public bool GetMatchingFilter (Message message, out MessageFilter filter)
{
if (message == null)
throw new ArgumentNullException ("message is null");
- result = null;
+ filter = null;
int count = 0;
foreach (MessageFilter f in table.Keys) {
"More than one filter matches.");
count++;
- result = f;
+ filter = f;
}
return count == 1;
}
- public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result)
+ public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter filter)
{
- return GetMatchingFilter (buffer.CreateMessage (), out result);
+ return GetMatchingFilter (buffer.CreateMessage (), out filter);
}
[MonoTODO ("Consider priority")]
Collection<MessageFilter> filters;
public MultipleFilterMatchesException () : base () {}
- public MultipleFilterMatchesException (string msg) : base (msg) {}
- public MultipleFilterMatchesException (string msg, Exception inner) : base (msg, inner) {}
+ public MultipleFilterMatchesException (string message) : base (message) {}
+ public MultipleFilterMatchesException (string message, Exception innerException) : base (message, innerException) {}
protected MultipleFilterMatchesException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public MultipleFilterMatchesException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public MultipleFilterMatchesException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public MultipleFilterMatchesException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public MultipleFilterMatchesException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public class NavigatorInvalidBodyAccessException : InvalidBodyAccessException
{
public NavigatorInvalidBodyAccessException () : base ("Not allowed to navigate to body.") {}
- public NavigatorInvalidBodyAccessException (string msg) : base (msg) {}
- public NavigatorInvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ public NavigatorInvalidBodyAccessException (string message) : base (message) {}
+ public NavigatorInvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected NavigatorInvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
}
{
protected SeekableXPathNavigator () {}
- public abstract XmlNodeOrder ComparePosition (long first, long second);
- public abstract string GetLocalName (long node_position);
- public abstract string GetName (long node_position);
- public abstract string GetNamespace (long node_position);
- public abstract XPathNodeType GetNodeType (long node_position);
- public abstract string GetValue (long node_position);
+ public abstract XmlNodeOrder ComparePosition (long firstPosition, long secondPosition);
+ public abstract string GetLocalName (long nodePosition);
+ public abstract string GetName (long nodePosition);
+ public abstract string GetNamespace (long nodePosition);
+ public abstract XPathNodeType GetNodeType (long nodePosition);
+ public abstract string GetValue (long nodePosition);
public abstract long CurrentPosition { get; set; }
}
{
}
- public XPathMessageContext (NameTable nameTable)
- : base (nameTable)
+ public XPathMessageContext (NameTable table)
+ : base (table)
{
AddNamespace ("s11", Constants.Soap11);
AddNamespace ("s12", Constants.Soap12);
get { return false; } // as documented.
}
- public override int CompareDocument (string uri1, string uri2)
+ public override int CompareDocument (string baseUri, string nextBaseUri)
{
- return String.CompareOrdinal (uri1, uri2);
+ return String.CompareOrdinal (baseUri, nextBaseUri);
}
public override bool PreserveWhitespace (XPathNavigator node)
Initialize (xpath, namespaces);
}
- public XPathMessageFilter (string xpath, XsltContext namespaces)
+ public XPathMessageFilter (string xpath, XsltContext context)
{
- Initialize (xpath, namespaces);
+ Initialize (xpath, context);
}
[MonoTODO]
}
[MonoTODO]
- public XPathMessageFilter (XmlReader reader, XsltContext namespaces)
+ public XPathMessageFilter (XmlReader reader, XsltContext context)
{
- Initialize (reader.ReadString (), namespaces);
+ Initialize (reader.ReadString (), context);
}
private void Initialize (string xpath, XmlNamespaceManager nsmgr)
{
}
- public XPathMessageFilterTable (int quota)
+ public XPathMessageFilterTable (int capacity)
{
- this.quota = quota;
+ this.quota = capacity;
}
[DataMember]
set { quota = value; }
}
- public TFilterData this [MessageFilter key] {
- get { return dict [key]; }
- set { dict [key] = value; }
+ public TFilterData this [MessageFilter filter] {
+ get { return dict [filter]; }
+ set { dict [filter] = value; }
}
public int Count {
dict [item.Key].Equals (item.Value);
}
- public bool ContainsKey (MessageFilter key)
+ public bool ContainsKey (MessageFilter filter)
{
- return dict.ContainsKey (key);
+ return dict.ContainsKey (filter);
}
- public void CopyTo (KeyValuePair<MessageFilter,TFilterData> [] array, int index)
+ public void CopyTo (KeyValuePair<MessageFilter,TFilterData> [] array, int arrayIndex)
{
- if (index < 0 || dict.Count >= array.Length - index)
- throw new ArgumentOutOfRangeException ("index");
+ if (arrayIndex < 0 || dict.Count >= array.Length - arrayIndex)
+ throw new ArgumentOutOfRangeException ("arrayIndex");
foreach (KeyValuePair<MessageFilter,TFilterData> item in dict)
- array [index++] = item;
+ array [arrayIndex++] = item;
}
public IEnumerator<KeyValuePair<MessageFilter,TFilterData>> GetEnumerator ()
return GetEnumerator ();
}
- public bool GetMatchingFilter (Message message, out MessageFilter result)
+ public bool GetMatchingFilter (Message message, out MessageFilter filter)
{
throw new NotImplementedException ();
}
- public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result)
+ public bool GetMatchingFilter (MessageBuffer messageBuffer, out MessageFilter filter)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingFilters (MessageBuffer buffer, ICollection<MessageFilter> results)
+ public bool GetMatchingFilters (MessageBuffer messageBuffer, ICollection<MessageFilter> results)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingValue (MessageBuffer buffer, out TFilterData data)
+ public bool GetMatchingValue (MessageBuffer messageBuffer, out TFilterData data)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingValues (MessageBuffer buffer, ICollection<TFilterData> results)
+ public bool GetMatchingValues (MessageBuffer messageBuffer, ICollection<TFilterData> results)
{
throw new NotImplementedException ();
}
public class XPathNavigatorException : XPathException
{
public XPathNavigatorException () : this ("Navigator node quota exceeded") {}
- public XPathNavigatorException (string msg) : base (msg) {}
- public XPathNavigatorException (string msg, Exception inner)
- : base (msg, inner) {}
+ public XPathNavigatorException (string message) : base (message) {}
+ public XPathNavigatorException (string message, Exception innerException)
+ : base (message, innerException) {}
protected XPathNavigatorException (SerializationInfo info,
StreamingContext context)
: base (info, context) {}
{
}
- public UnregisterInfo (string meshId, Guid registration_id)
+ public UnregisterInfo (string meshId, Guid registrationId)
{
Body.MeshId = meshId;
- Body.RegistrationId = registration_id;
+ Body.RegistrationId = registrationId;
}
public string MeshId {
binding = issuerBinding;
}
- protected IssuedSecurityTokenParameters (IssuedSecurityTokenParameters source)
- : base (source)
+ protected IssuedSecurityTokenParameters (IssuedSecurityTokenParameters other)
+ : base (other)
{
- binding = source.binding;
- issuer_address = source.issuer_address;
- issuer_meta_address = source.issuer_meta_address;
- key_size = source.key_size;
- key_type = source.key_type;
- token_type = source.token_type;
- reqs = new Collection<ClaimTypeRequirement> (source.reqs);
- additional_reqs = new Collection<XmlElement> (source.additional_reqs);
+ binding = other.binding;
+ issuer_address = other.issuer_address;
+ issuer_meta_address = other.issuer_meta_address;
+ key_size = other.key_size;
+ key_type = other.key_type;
+ token_type = other.token_type;
+ reqs = new Collection<ClaimTypeRequirement> (other.reqs);
+ additional_reqs = new Collection<XmlElement> (other.additional_reqs);
}
Binding binding;
{
}
- protected KerberosSecurityTokenParameters (KerberosSecurityTokenParameters source)
- : base (source)
+ protected KerberosSecurityTokenParameters (KerberosSecurityTokenParameters other)
+ : base (other)
{
}
RequireDerivedKeys = true;
}
- protected RsaSecurityTokenParameters (RsaSecurityTokenParameters source)
- : base (source)
+ protected RsaSecurityTokenParameters (RsaSecurityTokenParameters other)
+ : base (other)
{
}
}
#endif
- protected SecureConversationSecurityTokenParameters (SecureConversationSecurityTokenParameters source)
- : base (source)
+ protected SecureConversationSecurityTokenParameters (SecureConversationSecurityTokenParameters other)
+ : base (other)
{
- this.element = (SecurityBindingElement) source.element.Clone ();
- this.cancellable = source.cancellable;
+ this.element = (SecurityBindingElement) other.element.Clone ();
+ this.cancellable = other.cancellable;
#if !MOBILE && !XAMMAC_4_5
this.requirements = new ChannelProtectionRequirements (default_channel_protection_requirements);
#endif
throw new NotSupportedException (String.Format ("X509SecurityToken does not support creation of {0}.", t));
}
- public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause clause)
+ public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause keyIdentifierClause)
{
SecurityContextKeyIdentifierClause sctic =
- clause as SecurityContextKeyIdentifierClause;
+ keyIdentifierClause as SecurityContextKeyIdentifierClause;
return sctic != null && sctic.ContextId == ContextId &&
sctic.Generation == KeyGeneration;
}
this.cancel = requireCancellation;
}
- protected SslSecurityTokenParameters (SslSecurityTokenParameters source)
- : base (source)
+ protected SslSecurityTokenParameters (SslSecurityTokenParameters other)
+ : base (other)
{
- cert = source.cert;
- cancel = source.cancel;
+ cert = other.cert;
+ cancel = other.cancel;
}
bool cert, cancel;
bool extract_groups, allow_unauth;
[MonoTODO]
- public SspiSecurityToken (NetworkCredential cred,
+ public SspiSecurityToken (NetworkCredential networkCredential,
bool extractGroupsForWindowsAccounts,
bool allowUnauthenticatedCallers)
{
[MonoTODO]
public SspiSecurityToken (
TokenImpersonationLevel impersonationLevel,
- bool allowNtlm, NetworkCredential cred)
+ bool allowNtlm, NetworkCredential networkCredential)
{
throw new NotImplementedException ();
}
this.cancel = requireCancellation;
}
- protected SspiSecurityTokenParameters (SspiSecurityTokenParameters source)
- : base (source)
+ protected SspiSecurityTokenParameters (SspiSecurityTokenParameters other)
+ : base (other)
{
- this.cancel = source.cancel;
+ this.cancel = other.cancel;
}
public bool RequireCancellation {
RequireDerivedKeys = false;
}
- protected UserNameSecurityTokenParameters (UserNameSecurityTokenParameters source)
- : base (source)
+ protected UserNameSecurityTokenParameters (UserNameSecurityTokenParameters other)
+ : base (other)
{
}
InclusionMode = inclusionMode;
}
- protected X509SecurityTokenParameters (X509SecurityTokenParameters source)
- : base (source)
+ protected X509SecurityTokenParameters (X509SecurityTokenParameters other)
+ : base (other)
{
- reference_style = source.reference_style;
+ reference_style = other.reference_style;
}
public X509KeyIdentifierClauseType X509ReferenceStyle {
header_types = new ReadOnlyCollection<XmlQualifiedName> (header_types);
}
- public void Union (MessagePartSpecification other)
+ public void Union (MessagePartSpecification specification)
{
- if (other == null)
- throw new ArgumentNullException ("other");
+ if (specification == null)
+ throw new ArgumentNullException ("specification");
if (header_types.IsReadOnly)
throw new InvalidOperationException ("This MessagePartSpecification is read-only.");
- body |= other.body;
- foreach (XmlQualifiedName q in other.header_types)
+ body |= specification.body;
+ foreach (XmlQualifiedName q in specification.header_types)
// Sigh. It could be much better here.
//if (!header_types.Contains (q))
header_types.Add (q);
-//
+//
// ServiceCredentialsSecurityTokenManager.cs
//
// Author:
ServiceCredentials credentials;
public ServiceCredentialsSecurityTokenManager (
- ServiceCredentials credentials)
+ ServiceCredentials parent)
{
- this.credentials = credentials;
+ this.credentials = parent;
}
public ServiceCredentials ServiceCredentials {
[MonoTODO]
public virtual EndpointIdentity GetIdentityOfSelf (
- SecurityTokenRequirement requirement)
+ SecurityTokenRequirement tokenRequirement)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
+ SecurityTokenRequirement tokenRequirement,
out SecurityTokenResolver outOfBandTokenResolver)
{
outOfBandTokenResolver = null;
- if (requirement.TokenType == SecurityTokenTypes.UserName)
- return CreateUserNameAuthenticator (requirement);
- if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509Authenticator (requirement);
- if (requirement.TokenType == SecurityTokenTypes.Rsa)
+ if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
+ return CreateUserNameAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509Authenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
SecurityBindingElement binding;
- if (!requirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
+ if (!tokenRequirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
throw new ArgumentException ("SecurityBindingElement is required in the security token requirement");
SecureConversationSecurityTokenParameters issuedParams;
- if (!requirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
+ if (!tokenRequirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
throw new ArgumentException ("IssuedSecurityTokenParameters are required in the security token requirement");
BindingContext issuerBC;
- if (!requirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
+ if (!tokenRequirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
throw new ArgumentException ("IssuerBindingContext is required in the security token requirement");
SecurityTokenVersion secVer;
- if (!requirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
+ if (!tokenRequirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
throw new ArgumentException ("MessageSecurityVersion property (of type SecurityTokenVersion) is required in the security token requirement");
// FIXME: get parameters from somewhere
outOfBandTokenResolver = resolver;
SecurityContextSecurityTokenAuthenticator sc =
new SecurityContextSecurityTokenAuthenticator ();
- return new SecureConversationSecurityTokenAuthenticator (requirement, sc, resolver);
+ return new SecureConversationSecurityTokenAuthenticator (tokenRequirement, sc, resolver);
}
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
- return CreateSslTokenAuthenticator (requirement);
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
- return CreateSslTokenAuthenticator (requirement);
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
- return CreateSpnegoTokenAuthenticator (requirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
+ return CreateSslTokenAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
+ return CreateSslTokenAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
+ return CreateSpnegoTokenAuthenticator (tokenRequirement);
else
- throw new NotImplementedException ("Not implemented token type: " + requirement.TokenType);
+ throw new NotImplementedException ("Not implemented token type: " + tokenRequirement.TokenType);
}
SpnegoSecurityTokenAuthenticator CreateSpnegoTokenAuthenticator (SecurityTokenRequirement requirement)
[MonoTODO]
public virtual SecurityKeyIdentifierClause CreateKeyIdentifierClauseFromTokenXml (
- XmlElement tokenXml, SecurityTokenReferenceStyle referenceStyle)
+ XmlElement element, SecurityTokenReferenceStyle tokenReferenceStyle)
{
throw new NotImplementedException ();
}
public class AddressAccessDeniedException : CommunicationException
{
public AddressAccessDeniedException () : base () {}
- public AddressAccessDeniedException (string msg) : base (msg) {}
- public AddressAccessDeniedException (string msg, Exception inner) : base (msg, inner) {}
+ public AddressAccessDeniedException (string message) : base (message) {}
+ public AddressAccessDeniedException (string message, Exception innerException) : base (message, innerException) {}
protected AddressAccessDeniedException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
public class AddressAlreadyInUseException : CommunicationException
{
public AddressAlreadyInUseException () : base () {}
- public AddressAlreadyInUseException (string msg) : base (msg) {}
- public AddressAlreadyInUseException (string msg, Exception inner) : base (msg, inner) {}
+ public AddressAlreadyInUseException (string message) : base (message) {}
+ public AddressAlreadyInUseException (string message, Exception innerException) : base (message, innerException) {}
protected AddressAlreadyInUseException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
protected void InitializeEndpoint (
string configurationName,
- EndpointAddress remoteAddress)
+ EndpointAddress address)
{
InitializeEndpoint (CreateDescription ());
- if (remoteAddress != null)
- service_endpoint.Address = remoteAddress;
+ if (address != null)
+ service_endpoint.Address = address;
ApplyConfiguration (configurationName);
}
return ch;
}
- public static TChannel CreateChannel (Binding binding, EndpointAddress address)
+ public static TChannel CreateChannel (Binding binding, EndpointAddress endpointAddress)
{
- return CreateChannelCore (new ChannelFactory<TChannel> (binding, address), f => f.CreateChannel ());
+ return CreateChannelCore (new ChannelFactory<TChannel> (binding, endpointAddress), f => f.CreateChannel ());
}
- public static TChannel CreateChannel (Binding binding, EndpointAddress address, Uri via)
+ public static TChannel CreateChannel (Binding binding, EndpointAddress endpointAddress, Uri via)
{
- return CreateChannelCore (new ChannelFactory<TChannel> (binding), f => f.CreateChannel (address, via));
+ return CreateChannelCore (new ChannelFactory<TChannel> (binding), f => f.CreateChannel (endpointAddress, via));
}
public virtual TChannel CreateChannel (EndpointAddress address, Uri via)
public class ChannelTerminatedException : CommunicationException
{
public ChannelTerminatedException () : base () {}
- public ChannelTerminatedException (string msg) : base (msg) {}
- public ChannelTerminatedException (string msg, Exception inner) : base (msg, inner) {}
+ public ChannelTerminatedException (string message) : base (message) {}
+ public ChannelTerminatedException (string message, Exception innerException) : base (message, innerException) {}
protected ChannelTerminatedException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
{
}
- protected ClientBase (InstanceContext instance)
- : this (instance, "*")
+ protected ClientBase (InstanceContext callbackInstance)
+ : this (callbackInstance, "*")
{
}
- protected ClientBase (InstanceContext instance, string endpointConfigurationName)
+ protected ClientBase (InstanceContext callbackInstance, string endpointConfigurationName)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
- Initialize (instance, endpointConfigurationName, null);
+ Initialize (callbackInstance, endpointConfigurationName, null);
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
string endpointConfigurationName, EndpointAddress remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
if (remoteAddress == null)
throw new ArgumentNullException ("remoteAddress");
- Initialize (instance, endpointConfigurationName, remoteAddress);
+ Initialize (callbackInstance, endpointConfigurationName, remoteAddress);
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
string endpointConfigurationName, string remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (remoteAddress == null)
throw new ArgumentNullException ("endpointAddress");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
- Initialize (instance, endpointConfigurationName, new EndpointAddress (remoteAddress));
+ Initialize (callbackInstance, endpointConfigurationName, new EndpointAddress (remoteAddress));
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
Binding binding, EndpointAddress remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (binding == null)
throw new ArgumentNullException ("binding");
if (remoteAddress == null)
throw new ArgumentNullException ("remoteAddress");
- Initialize (instance, binding, remoteAddress);
+ Initialize (callbackInstance, binding, remoteAddress);
}
protected ClientBase (ServiceEndpoint endpoint)
{
}
- protected ClientBase (InstanceContext instance, ServiceEndpoint endpoint)
- : this (instance, new ChannelFactory<TChannel> (endpoint))
+ protected ClientBase (InstanceContext callbackInstance, ServiceEndpoint endpoint)
+ : this (callbackInstance, new ChannelFactory<TChannel> (endpoint))
{
}
-//
+//
// ClientCredentialsSecurityTokenManager.cs
//
// Author:
{
ClientCredentials credentials;
- public ClientCredentialsSecurityTokenManager (ClientCredentials credentials)
+ public ClientCredentialsSecurityTokenManager (ClientCredentials clientCredentials)
{
- if (credentials == null)
- throw new ArgumentNullException ("credentials");
- this.credentials = credentials;
+ if (clientCredentials == null)
+ throw new ArgumentNullException ("clientCredentials");
+ this.credentials = clientCredentials;
}
public ClientCredentials ClientCredentials {
[MonoTODO]
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
+ SecurityTokenRequirement tokenRequirement,
out SecurityTokenResolver outOfBandTokenResolver)
{
outOfBandTokenResolver = null;
- if (requirement == null)
- throw new ArgumentNullException ("requirement");
- if (requirement.TokenType == SecurityTokenTypes.UserName) {
+ if (tokenRequirement == null)
+ throw new ArgumentNullException ("tokenRequirement");
+ if (tokenRequirement.TokenType == SecurityTokenTypes.UserName) {
// unsupported
}
- else if (requirement.TokenType == SecurityTokenTypes.Rsa)
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
- else if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509Authenticator (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
- return new SspiClientSecurityTokenAuthenticator (this, requirement);
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509Authenticator (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
+ return new SspiClientSecurityTokenAuthenticator (this, tokenRequirement);
else
- throw new NotImplementedException ("Security token type " + requirement.TokenType);
+ throw new NotImplementedException ("Security token type " + tokenRequirement.TokenType);
- throw new NotSupportedException (String.Format ("Security token requirement '{0}' is not supported to create SecurityTokenAuthenticator.", requirement));
+ throw new NotSupportedException (String.Format ("Security token requirement '{0}' is not supported to create SecurityTokenAuthenticator.", tokenRequirement));
}
#region CreateSecurityTokenProvider()
[MonoTODO]
- public override SecurityTokenProvider CreateSecurityTokenProvider (SecurityTokenRequirement requirement)
+ public override SecurityTokenProvider CreateSecurityTokenProvider (SecurityTokenRequirement tokenRequirement)
{
- if (IsIssuedSecurityTokenRequirement (requirement))
- return CreateIssuedTokenProvider (requirement);
+ if (IsIssuedSecurityTokenRequirement (tokenRequirement))
+ return CreateIssuedTokenProvider (tokenRequirement);
bool isInitiator;
// huh, they are not constants but properties.
- if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509SecurityTokenProvider (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation)
- return CreateSecureConversationProvider (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego) {
- if (requirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
- return CreateSslnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego) {
- if (requirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
- return CreateSslnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecurityContext) {
+ if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509SecurityTokenProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation)
+ return CreateSecureConversationProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego) {
+ if (tokenRequirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
+ return CreateSslnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego) {
+ if (tokenRequirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
+ return CreateSslnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecurityContext) {
// FIXME: implement
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego) {
- return CreateSpnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SspiCredential) {
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego) {
+ return CreateSpnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SspiCredential) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.Rsa) {
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.Saml) {
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.Saml) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.UserName)
- return CreateUserNameProvider (requirement);
- else if (requirement.TokenType == SecurityTokenTypes.Kerberos) {
- return CreateKerberosProvider (requirement);
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
+ return CreateUserNameProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.Kerberos) {
+ return CreateKerberosProvider (tokenRequirement);
}
- throw new NotSupportedException (String.Format ("Token type '{0}' is not supported", requirement.TokenType));
+ throw new NotSupportedException (String.Format ("Token type '{0}' is not supported", tokenRequirement.TokenType));
}
UserNameSecurityTokenProvider CreateUserNameProvider (
callback_instance_type = callbackInstanceType;
}
- public DuplexChannelFactory (object callbackInstance)
- : this (new InstanceContext (callbackInstance))
+ public DuplexChannelFactory (object callbackObject)
+ : this (new InstanceContext (callbackObject))
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
string endpointConfigurationName)
- : this (new InstanceContext (callbackInstance), endpointConfigurationName)
+ : this (new InstanceContext (callbackObject), endpointConfigurationName)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
string endpointConfigurationName,
EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), endpointConfigurationName, remoteAddress)
+ : this (new InstanceContext (callbackObject), endpointConfigurationName, remoteAddress)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
ServiceEndpoint endpoint)
- : this (new InstanceContext (callbackInstance), endpoint)
+ : this (new InstanceContext (callbackObject), endpoint)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding)
- : this (new InstanceContext (callbackInstance), binding)
+ : this (new InstanceContext (callbackObject), binding)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding,
string remoteAddress)
- : this (callbackInstance, binding, new EndpointAddress (remoteAddress))
+ : this (callbackObject, binding, new EndpointAddress (remoteAddress))
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding,
EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), binding, remoteAddress)
+ : this (new InstanceContext (callbackObject), binding, remoteAddress)
{
}
}
protected DuplexClientBase (object callbackInstance,
- string bindingConfigurationName, EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), bindingConfigurationName, remoteAddress)
+ string endpointConfigurationName, EndpointAddress remoteAddress)
+ : this (new InstanceContext (callbackInstance), endpointConfigurationName, remoteAddress)
{
}
}
protected DuplexClientBase (InstanceContext callbackInstance,
- string endpointConfigurationName, EndpointAddress address)
- : base (callbackInstance, endpointConfigurationName, address)
+ string endpointConfigurationName, EndpointAddress remoteAddress)
+ : base (callbackInstance, endpointConfigurationName, remoteAddress)
{
}
public void WriteTo (
AddressingVersion addressingVersion,
XmlDictionaryWriter writer,
- XmlDictionaryString localname,
+ XmlDictionaryString localName,
XmlDictionaryString ns)
{
- writer.WriteStartElement (localname, ns);
+ writer.WriteStartElement (localName, ns);
WriteContentsTo (addressingVersion, writer);
writer.WriteEndElement ();
}
public void WriteTo (
AddressingVersion addressingVersion,
- XmlWriter writer, string localname, string ns)
+ XmlWriter writer, string localName, string ns)
{
- writer.WriteStartElement (localname, ns);
+ writer.WriteStartElement (localName, ns);
WriteContentsTo (addressingVersion, writer);
writer.WriteEndElement ();
}
return new X509CertificateEndpointIdentity (primaryCertificate, supportingCertificates);
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- EndpointIdentity e = other as EndpointIdentity;
+ EndpointIdentity e = obj as EndpointIdentity;
return e != null && comparer.Equals (claim, e.claim);
}
return String.Concat ("identity(", claim, ")");
}
- protected void Initialize (Claim claim)
+ protected void Initialize (Claim identityClaim)
{
- Initialize (claim, Claim.DefaultComparer);
+ Initialize (identityClaim, Claim.DefaultComparer);
}
- protected void Initialize (Claim claim, IEqualityComparer<Claim> comparer)
+ protected void Initialize (Claim identityClaim, IEqualityComparer<Claim> claimComparer)
{
- if (claim == null)
- throw new ArgumentNullException ("claim");
- if (comparer == null)
- throw new ArgumentNullException ("comparer");
- this.claim = claim;
- this.comparer = comparer;
+ if (identityClaim == null)
+ throw new ArgumentNullException ("identityClaim");
+ if (claimComparer == null)
+ throw new ArgumentNullException ("claimComparer");
+ this.claim = identityClaim;
+ this.comparer = claimComparer;
}
}
}
{
}
- public FaultException (string msg)
- : this (new FaultReason (msg))
+ public FaultException (string reason)
+ : this (new FaultReason (reason))
{
}
- public FaultException (string msg, FaultCode code)
- : this (new FaultReason (msg), code)
+ public FaultException (string reason, FaultCode code)
+ : this (new FaultReason (reason), code)
{
}
public class MsmqException : ExternalException
{
public MsmqException () : base () {}
- public MsmqException (string msg) : base (msg) {}
- public MsmqException (string msg, int win32ErrorCode) : base (msg, win32ErrorCode) {}
- public MsmqException (string msg, Exception inner) : base (msg, inner) {}
+ public MsmqException (string message) : base (message) {}
+ public MsmqException (string message, int error) : base (message, error) {}
+ public MsmqException (string message, Exception inner) : base (message, inner) {}
protected MsmqException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
public class MsmqPoisonMessageException : PoisonMessageException
{
public MsmqPoisonMessageException () : base () {}
- public MsmqPoisonMessageException (string msg) : base (msg) {}
- public MsmqPoisonMessageException (string msg, Exception inner) : base (msg, inner) {}
+ public MsmqPoisonMessageException (string message) : base (message) {}
+ public MsmqPoisonMessageException (string message, Exception innerException) : base (message, innerException) {}
protected MsmqPoisonMessageException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// OptionalReliableSession.cs
//
// Author:
{
}
- public OptionalReliableSession (ReliableSessionBindingElement binding)
- : base (binding)
+ public OptionalReliableSession (ReliableSessionBindingElement reliableSessionBindingElement)
+ : base (reliableSessionBindingElement)
{
- if (binding == null)
- throw new ArgumentNullException ("binding");
+ if (reliableSessionBindingElement == null)
+ throw new ArgumentNullException ("reliableSessionBindingElement");
}
public bool Enabled {
public class PoisonMessageException : SystemException
{
public PoisonMessageException () : base () {}
- public PoisonMessageException (string msg) : base (msg) {}
- public PoisonMessageException (string msg, Exception inner) : base (msg, inner) {}
+ public PoisonMessageException (string message) : base (message) {}
+ public PoisonMessageException (string message, Exception innerException) : base (message, innerException) {}
protected PoisonMessageException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// ReliableSession.cs
//
// Author:
{
}
- public ReliableSession (ReliableSessionBindingElement binding)
+ public ReliableSession (ReliableSessionBindingElement reliableSessionBindingElement)
{
- if (binding == null)
- throw new ArgumentNullException ("binding");
- InactivityTimeout = binding.InactivityTimeout;
- Ordered = binding.Ordered;
+ if (reliableSessionBindingElement == null)
+ throw new ArgumentNullException ("reliableSessionBindingElement");
+ InactivityTimeout = reliableSessionBindingElement.InactivityTimeout;
+ Ordered = reliableSessionBindingElement.Ordered;
}
public TimeSpan InactivityTimeout { get; set; }
throw new NotImplementedException ();
}
- public RsaEndpointIdentity (X509Certificate2 cert)
+ public RsaEndpointIdentity (X509Certificate2 certificate)
{
- if (cert == null)
- throw new ArgumentNullException ("cert");
- rsa = (RSA) cert.PublicKey.Key;
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ rsa = (RSA) certificate.PublicKey.Key;
}
}
}
{
public class ServiceAuthorizationManager
{
- public virtual bool CheckAccess (OperationContext context)
+ public virtual bool CheckAccess (OperationContext operationContext)
{
- return CheckAccessCore (context);
+ return CheckAccessCore (operationContext);
}
- public virtual bool CheckAccess (OperationContext context, ref Message message)
+ public virtual bool CheckAccess (OperationContext operationContext, ref Message message)
{
- return CheckAccessCore (context);
+ return CheckAccessCore (operationContext);
}
[MonoTODO]
- protected virtual bool CheckAccessCore (OperationContext context)
+ protected virtual bool CheckAccessCore (OperationContext operationContext)
{
return false;
}
[MonoTODO]
- protected virtual ReadOnlyCollection<IAuthorizationPolicy> GetAuthorizationPolicies (OperationContext context)
+ protected virtual ReadOnlyCollection<IAuthorizationPolicy> GetAuthorizationPolicies (OperationContext operationContext)
{
throw new NotImplementedException ();
}
{
}
- public ServiceHost (object serviceInstance,
+ public ServiceHost (object singletonInstance,
params Uri [] baseAddresses)
{
- if (serviceInstance == null)
- throw new ArgumentNullException ("serviceInstance");
- InitializeDescription (serviceInstance,
+ if (singletonInstance == null)
+ throw new ArgumentNullException ("singletonInstance");
+ InitializeDescription (singletonInstance,
new UriSchemeKeyedCollection (baseAddresses));
}
InitializeDescription (baseAddresses);
}
- protected void InitializeDescription (object serviceInstance, UriSchemeKeyedCollection baseAddresses)
+ protected void InitializeDescription (object singletonInstance, UriSchemeKeyedCollection baseAddresses)
{
- instance = serviceInstance;
- InitializeDescription (serviceInstance.GetType (), baseAddresses);
+ instance = singletonInstance;
+ InitializeDescription (singletonInstance.GetType (), baseAddresses);
}
}
}
throw new InvalidOperationException ("The ServiceHost must have at least one application endpoint (that does not include metadata exchange endpoint) defined by either configuration, behaviors or call to AddServiceEndpoint methods.");
}
- protected void LoadConfigurationSection (ServiceElement element)
+ protected void LoadConfigurationSection (ServiceElement serviceSection)
{
- ApplyServiceElement (element);
+ ApplyServiceElement (serviceSection);
}
protected override sealed void OnAbort ()
public class UriSchemeKeyedCollection
: SynchronizedKeyedCollection<string, Uri>
{
- public UriSchemeKeyedCollection (params Uri [] uris)
+ public UriSchemeKeyedCollection (params Uri [] addresses)
: base (new object ())
{
- if (uris == null)
+ if (addresses == null)
/* FIXME: masterinfo says, param name should be
baseAddresses */
- throw new ArgumentNullException ("uris");
+ throw new ArgumentNullException ("addresses");
- for (int i = 0; i < uris.Length; i ++) {
- if (!uris [i].IsAbsoluteUri)
+ for (int i = 0; i < addresses.Length; i ++) {
+ if (!addresses [i].IsAbsoluteUri)
throw new ArgumentException ("Only an absolute URI can be used as a base address");
- if (Contains (uris [i].Scheme))
- throw new ArgumentException ("Collection already contains an address with scheme "+ uris [i].Scheme);
- if (uris [i].Query != String.Empty)
+ if (Contains (addresses [i].Scheme))
+ throw new ArgumentException ("Collection already contains an address with scheme "+ addresses [i].Scheme);
+ if (addresses [i].Query != String.Empty)
throw new ArgumentException ("A base address cannot contain a query string.");
- InsertItem (i, uris [i]);
+ InsertItem (i, addresses [i]);
}
}
-//
+//
// WS2007FederationHttpBinding.cs
//
// Author:
}
[MonoTODO]
- public WS2007FederationHttpBinding (string configurationName)
- : base (configurationName)
+ public WS2007FederationHttpBinding (string configName)
+ : base (configName)
{
throw new NotImplementedException ();
}
-//
+//
// WS2007HttpBinding.cs
//
// Author:
{
}
- public WS2007HttpBinding (SecurityMode mode)
- : base (mode)
+ public WS2007HttpBinding (SecurityMode securityMode)
+ : base (securityMode)
{
}
- public WS2007HttpBinding (SecurityMode mode, bool reliableSessionEnabled)
- : base (mode, reliableSessionEnabled)
+ public WS2007HttpBinding (SecurityMode securityMode, bool reliableSessionEnabled)
+ : base (securityMode, reliableSessionEnabled)
{
}
[MonoTODO]
- public WS2007HttpBinding (string configurationName)
- : base (configurationName)
+ public WS2007HttpBinding (string configName)
+ : base (configName)
{
}
}
}
[MonoTODO]
- public WSFederationHttpBinding (string configurationName)
+ public WSFederationHttpBinding (string configName)
{
throw new NotImplementedException ();
}
-//
+//
// WSHttpBinding.cs
//
// Author:
{
}
- public WSHttpBinding (SecurityMode mode)
- : this (mode, false)
+ public WSHttpBinding (SecurityMode securityMode)
+ : this (securityMode, false)
{
}
- public WSHttpBinding (SecurityMode mode,
+ public WSHttpBinding (SecurityMode securityMode,
bool reliableSessionEnabled)
: base (reliableSessionEnabled)
{
- security = new WSHttpSecurity (mode);
+ security = new WSHttpSecurity (securityMode);
}
[MonoTODO]
- public WSHttpBinding (string configurationName)
+ public WSHttpBinding (string configName)
{
throw new NotImplementedException ();
}
X509Certificate2 primary;
X509Certificate2Collection supporting, all;
- public X509CertificateEndpointIdentity (X509Certificate2 cert)
+ public X509CertificateEndpointIdentity (X509Certificate2 certificate)
{
- if (cert == null)
- throw new ArgumentNullException ("cert");
- primary = cert;
- Initialize (Claim.CreateThumbprintClaim (cert.GetCertHash ()));
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ primary = certificate;
+ Initialize (Claim.CreateThumbprintClaim (certificate.GetCertHash ()));
}
public X509CertificateEndpointIdentity (
this.options = options;
}
- public IAsyncResult BeginCommit (AsyncCallback callback,
- object user_defined_state)
+ public IAsyncResult BeginCommit (AsyncCallback asyncCallback,
+ object asyncState)
{
- this.callback = callback;
- this.user_defined_state = user_defined_state;
+ this.callback = asyncCallback;
+ this.user_defined_state = asyncState;
AsyncCallback cb = null;
- if (callback != null)
+ if (asyncCallback != null)
cb = new AsyncCallback (CommitCallback);
asyncResult = BeginCommitInternal (cb);
return this;
}
- public void EndCommit (IAsyncResult ar)
+ public void EndCommit (IAsyncResult asyncResult)
{
- if (ar != this)
+ if (asyncResult != this)
throw new ArgumentException ("The IAsyncResult parameter must be the same parameter as returned by BeginCommit.", "asyncResult");
- EndCommitInternal (asyncResult);
+ EndCommitInternal (this.asyncResult);
}
private void CommitCallback (IAsyncResult ar)
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface IDtcTransaction
{
- void Abort (IntPtr manager, int whatever, int whatever2);
+ void Abort (IntPtr reason, int retaining, int async);
- void Commit (int whatever, int whatever2, int whatever3);
+ void Commit (int retaining, int commitType, int reserved);
- void GetTransactionInfo (IntPtr whatever);
+ void GetTransactionInfo (IntPtr transactionInformation);
}
}
{
void Initialize ();
- void Rollback (SinglePhaseEnlistment enlistment);
+ void Rollback (SinglePhaseEnlistment singlePhaseEnlistment);
- void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
+ void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}
public interface ISinglePhaseNotification
: IEnlistmentNotification
{
- void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
+ void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}
}
[MonoTODO]
- public void ForceRollback (Exception ex)
+ public void ForceRollback (Exception e)
{
- tx.Rollback (ex, enlisted);
+ tx.Rollback (e, enlisted);
/* See test RMFail2 */
((ManualResetEvent) waitHandle).Set ();
}
[Serializable]
public sealed class SubordinateTransaction : Transaction
{
- public SubordinateTransaction (IsolationLevel level,
+ public SubordinateTransaction (IsolationLevel isoLevel,
ISimpleTransactionSuperior superior)
{
throw new NotImplementedException ();
[MonoTODO]
public DependentTransaction DependentClone (
- DependentCloneOption option)
+ DependentCloneOption cloneOption)
{
DependentTransaction d =
- new DependentTransaction (this, option);
+ new DependentTransaction (this, cloneOption);
dependents.Add (d);
return d;
}
[MonoTODO ("Only SinglePhase commit supported for durable resource managers.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
- public Enlistment EnlistDurable (Guid manager,
- IEnlistmentNotification notification,
- EnlistmentOptions options)
+ public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
+ IEnlistmentNotification enlistmentNotification,
+ EnlistmentOptions enlistmentOptions)
{
throw new NotImplementedException ("DTC unsupported, only SinglePhase commit supported for durable resource managers.");
}
[MonoTODO ("Only Local Transaction Manager supported. Cannot have more than 1 durable resource per transaction. Only EnlistmentOptions.None supported yet.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
- public Enlistment EnlistDurable (Guid manager,
- ISinglePhaseNotification notification,
- EnlistmentOptions options)
+ public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
+ ISinglePhaseNotification singlePhaseNotification,
+ EnlistmentOptions enlistmentOptions)
{
EnsureIncompleteCurrentScope ();
if (pspe != null || Durables.Count > 0)
throw new NotImplementedException ("DTC unsupported, multiple durable resource managers aren't supported.");
- if (options != EnlistmentOptions.None)
+ if (enlistmentOptions != EnlistmentOptions.None)
throw new NotImplementedException ("EnlistmentOptions other than None aren't supported");
- Durables.Add (notification);
+ Durables.Add (singlePhaseNotification);
/* FIXME: Enlistment ?? */
return new Enlistment ();
}
public bool EnlistPromotableSinglePhase (
- IPromotableSinglePhaseNotification notification)
+ IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
{
EnsureIncompleteCurrentScope ();
if (pspe != null || Durables.Count > 0)
return false;
- pspe = notification;
+ pspe = promotableSinglePhaseNotification;
pspe.Initialize();
return true;
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
- IEnlistmentNotification notification,
- EnlistmentOptions options)
+ IEnlistmentNotification enlistmentNotification,
+ EnlistmentOptions enlistmentOptions)
{
- return EnlistVolatileInternal (notification, options);
+ return EnlistVolatileInternal (enlistmentNotification, enlistmentOptions);
}
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
- ISinglePhaseNotification notification,
- EnlistmentOptions options)
+ ISinglePhaseNotification singlePhaseNotification,
+ EnlistmentOptions enlistmentOptions)
{
/* FIXME: Anything extra reqd for this? */
- return EnlistVolatileInternal (notification, options);
+ return EnlistVolatileInternal (singlePhaseNotification, enlistmentOptions);
}
private Enlistment EnlistVolatileInternal (
Rollback (null);
}
- public void Rollback (Exception ex)
+ public void Rollback (Exception e)
{
EnsureIncompleteCurrentScope ();
- Rollback (ex, null);
+ Rollback (e, null);
}
internal void Rollback (Exception ex, object abortingEnlisted)
[MonoTODO]
public static byte [] GetExportCookie (Transaction transaction,
- byte [] exportCookie)
+ byte [] whereabouts)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromDtcTransaction (
- IDtcTransaction dtc)
+ IDtcTransaction transactionNative)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromExportCookie (
- byte [] exportCookie)
+ byte [] cookie)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] token)
+ public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] propagationToken)
{
throw new NotImplementedException ();
}
}
[MonoTODO ("Not implemented")]
- public static void RecoveryComplete (Guid manager)
+ public static void RecoveryComplete (Guid resourceManagerIdentifier)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public static Enlistment Reenlist (Guid manager,
- byte[] recoveryInfo,
- IEnlistmentNotification notification)
+ public static Enlistment Reenlist (Guid resourceManagerIdentifier,
+ byte[] recoveryInformation,
+ IEnlistmentNotification enlistmentNotification)
{
throw new NotImplementedException ();
}
set { timeout = value; }
}
- public static bool operator == (TransactionOptions o1,
- TransactionOptions o2)
+ public static bool operator == (TransactionOptions x,
+ TransactionOptions y)
{
- return o1.level == o2.level &&
- o1.timeout == o2.timeout;
+ return x.level == y.level &&
+ x.timeout == y.timeout;
}
- public static bool operator != (TransactionOptions o1,
- TransactionOptions o2)
+ public static bool operator != (TransactionOptions x,
+ TransactionOptions y)
{
- return o1.level != o2.level ||
- o1.timeout != o2.timeout;
+ return x.level != y.level ||
+ x.timeout != y.timeout;
}
public override bool Equals (object obj)
{
}
- public TransactionScope(TransactionScopeAsyncFlowOption asyncFlow)
+ public TransactionScope(TransactionScopeAsyncFlowOption asyncFlowOption)
: this(TransactionScopeOption.Required,
- TransactionManager.DefaultTimeout, asyncFlow)
+ TransactionManager.DefaultTimeout, asyncFlowOption)
{
}
- public TransactionScope (Transaction transaction)
- : this (transaction, TransactionManager.DefaultTimeout)
+ public TransactionScope (Transaction transactionToUse)
+ : this (transactionToUse, TransactionManager.DefaultTimeout)
{
}
- public TransactionScope (Transaction transaction,
- TimeSpan timeout)
- : this (transaction, timeout, DTCOption.None)
+ public TransactionScope (Transaction transactionToUse,
+ TimeSpan scopeTimeout)
+ : this (transactionToUse, scopeTimeout, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported.")]
- public TransactionScope (Transaction transaction,
- TimeSpan timeout, DTCOption opt)
+ public TransactionScope (Transaction transactionToUse,
+ TimeSpan scopeTimeout, DTCOption interopOption)
{
Initialize (TransactionScopeOption.Required,
- transaction, defaultOptions, opt, timeout, TransactionScopeAsyncFlowOption.Suppress);
+ transactionToUse, defaultOptions, interopOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
- public TransactionScope (TransactionScopeOption option)
- : this (option, TransactionManager.DefaultTimeout)
+ public TransactionScope (TransactionScopeOption scopeOption)
+ : this (scopeOption, TransactionManager.DefaultTimeout)
{
}
- public TransactionScope (TransactionScopeOption option,
- TimeSpan timeout)
- : this (option, timeout, TransactionScopeAsyncFlowOption.Suppress)
+ public TransactionScope (TransactionScopeOption scopeOption,
+ TimeSpan scopeTimeout)
+ : this (scopeOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress)
{
}
{
}
- public TransactionScope (TransactionScopeOption option,
- TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
+ public TransactionScope (TransactionScopeOption scopeOption,
+ TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
- Initialize (option, null, defaultOptions,
- DTCOption.None, timeout, asyncFlow);
+ Initialize (scopeOption, null, defaultOptions,
+ DTCOption.None, scopeTimeout, asyncFlow);
}
public TransactionScope (TransactionScopeOption scopeOption,
- TransactionOptions options)
- : this (scopeOption, options, DTCOption.None)
+ TransactionOptions transactionOptions)
+ : this (scopeOption, transactionOptions, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported")]
public TransactionScope (TransactionScopeOption scopeOption,
- TransactionOptions options,
- DTCOption opt)
+ TransactionOptions transactionOptions,
+ DTCOption interopOption)
{
- Initialize (scopeOption, null, options, opt,
+ Initialize (scopeOption, null, transactionOptions, interopOption,
TransactionManager.DefaultTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
void Initialize (TransactionScopeOption scopeOption,
Transaction tx, TransactionOptions options,
- DTCOption interop, TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
+ DTCOption interop, TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
completed = false;
isRoot = false;
nested = 0;
asyncFlowEnabled = asyncFlow == TransactionScopeAsyncFlowOption.Enabled;
- if (timeout < TimeSpan.Zero)
- throw new ArgumentOutOfRangeException ("timeout");
+ if (scopeTimeout < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("scopeTimeout");
- this.timeout = timeout;
+ this.timeout = scopeTimeout;
oldTransaction = Transaction.CurrentInternal;
TransactionScope scope = new TransactionScope (TransactionScopeOption.Required, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
- Assert.AreEqual (ex.ParamName, "timeout");
+ Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
try {
TransactionScope scope = new TransactionScope (null, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
- Assert.AreEqual (ex.ParamName, "timeout");
+ Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
}
{
}
- public abstract bool ChangePassword (string name, string oldPwd, string newPwd);
- public abstract bool ChangePasswordQuestionAndAnswer (string name, string password, string newPwdQuestion, string newPwdAnswer);
- public abstract MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
- public abstract bool DeleteUser (string name, bool deleteAllRelatedData);
+ public abstract bool ChangePassword (string username, string oldPassword, string newPassword);
+ public abstract bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer);
+ public abstract MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
+ public abstract bool DeleteUser (string username, bool deleteAllRelatedData);
public abstract MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords);
- public abstract MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords);
+ public abstract MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
public abstract MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords);
public abstract int GetNumberOfUsersOnline ();
- public abstract string GetPassword (string name, string answer);
- public abstract MembershipUser GetUser (string name, bool userIsOnline);
+ public abstract string GetPassword (string username, string answer);
+ public abstract MembershipUser GetUser (string username, bool userIsOnline);
public abstract MembershipUser GetUser (object providerUserKey, bool userIsOnline);
public abstract string GetUserNameByEmail (string email);
- public abstract string ResetPassword (string name, string answer);
+ public abstract string ResetPassword (string username, string answer);
public abstract void UpdateUser (MembershipUser user);
- public abstract bool ValidateUser (string name, string password);
+ public abstract bool ValidateUser (string username, string password);
public abstract bool UnlockUser (string userName);
public abstract string ApplicationName { get; set; }
public abstract string PasswordStrengthRegularExpression { get; }
public abstract bool RequiresUniqueEmail { get; }
- protected virtual void OnValidatingPassword (ValidatePasswordEventArgs args)
+ protected virtual void OnValidatingPassword (ValidatePasswordEventArgs e)
{
MembershipValidatePasswordEventHandler eh = events [validatingPasswordEvent] as MembershipValidatePasswordEventHandler;
if (eh != null)
- eh (this, args);
+ eh (this, e);
}
protected virtual byte [] DecryptPassword (byte [] encodedPassword)
return GetPassword (null);
}
- public virtual string GetPassword (string answer)
+ public virtual string GetPassword (string passwordAnswer)
{
- return Provider.GetPassword (UserName, answer);
+ return Provider.GetPassword (UserName, passwordAnswer);
}
public virtual string ResetPassword ()
return ResetPassword (null);
}
- public virtual string ResetPassword (string answer)
+ public virtual string ResetPassword (string passwordAnswer)
{
- string newPass = Provider.ResetPassword (UserName, answer);
+ string newPass = Provider.ResetPassword (UserName, passwordAnswer);
UpdateUser ();
{
}
- public abstract void AddUsersToRoles (string [] usernames, string [] rolenames);
- public abstract void CreateRole (string rolename);
- public abstract bool DeleteRole (string rolename, bool throwOnPopulatedRole);
+ public abstract void AddUsersToRoles (string [] usernames, string [] roleNames);
+ public abstract void CreateRole (string roleName);
+ public abstract bool DeleteRole (string roleName, bool throwOnPopulatedRole);
public abstract string [] FindUsersInRole (string roleName, string usernameToMatch);
public abstract string [] GetAllRoles ();
public abstract string [] GetRolesForUser (string username);
- public abstract string [] GetUsersInRole (string rolename);
- public abstract bool IsUserInRole (string username, string rolename);
- public abstract void RemoveUsersFromRoles (string [] usernames, string [] rolenames);
- public abstract bool RoleExists (string rolename);
+ public abstract string [] GetUsersInRole (string roleName);
+ public abstract bool IsUserInRole (string username, string roleName);
+ public abstract void RemoveUsersFromRoles (string [] usernames, string [] roleNames);
+ public abstract bool RoleExists (string roleName);
public abstract string ApplicationName { get; set; }
}
}
$(CSCOMPILE) $(STANDALONE_TEST_MCS_FLAGS) -out:$@ -target:library @System.Web.Extensions_standalone_test.dll.sources
Test/standalone-tests/Consts.cs: Test/standalone-tests/Consts.cs.in
+ifeq ($(PLATFORM), win32)
+ @sed 's,@SystemWebExtensionsClassDir@,$(shell cygpath -a -m .),' $< > $@
+else
@sed 's,@SystemWebExtensionsClassDir@,$(shell pwd),' $< > $@
+endif
include ../../build/library.make
-//\r
+//\r
// ScriptModule.cs\r
//\r
// Author:\r
{\r
public class ScriptModule : IHttpModule\r
{\r
- protected virtual void Init (HttpApplication context) {\r
- context.PreSendRequestHeaders += new EventHandler (PreSendRequestHeaders);\r
- context.PostAcquireRequestState += new EventHandler (PostAcquireRequestState);\r
- context.AuthenticateRequest += new EventHandler (AuthenticateRequest);\r
+ protected virtual void Init (HttpApplication app) {\r
+ app.PreSendRequestHeaders += new EventHandler (PreSendRequestHeaders);\r
+ app.PostAcquireRequestState += new EventHandler (PostAcquireRequestState);\r
+ app.AuthenticateRequest += new EventHandler (AuthenticateRequest);\r
}\r
\r
void AuthenticateRequest (object sender, EventArgs e) {\r
-//
+//
// ScriptResourceAttribute.cs
//
// Author:
string _scriptResourceName;
string _typeName;
- public ScriptResourceAttribute (string scriptName, string scriptResourceName, string typeName) {
+ public ScriptResourceAttribute (string scriptName, string stringResourceName, string stringResourceClientTypeName) {
_scriptName = scriptName;
- _scriptResourceName = scriptResourceName;
- _typeName = typeName;
+ _scriptResourceName = stringResourceName;
+ _typeName = stringResourceClientTypeName;
}
public string ScriptName {
--- /dev/null
+/Consts.cs
void TestQueryMode_Aspx_Start (string result, TestRunItem runItem)
{
- string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><a disabled=""disabled"">First</a> <span>1</span> <a href=""/Test_QueryMode.aspx?pageNumber=2"">2</a> <a href=""/Test_QueryMode.aspx?pageNumber=3"">3</a> <a href=""/Test_QueryMode.aspx?pageNumber=4"">4</a> <a href=""/Test_QueryMode.aspx?pageNumber=5"">5</a> <a href=""/Test_QueryMode.aspx?pageNumber=6"">...</a> <a href=""/Test_QueryMode.aspx?pageNumber=10"">Last</a> </span>";
+ string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><a class=""aspNetDisabled"">First</a> <span>1</span> <a href=""/Test_QueryMode.aspx?pageNumber=2"">2</a> <a href=""/Test_QueryMode.aspx?pageNumber=3"">3</a> <a href=""/Test_QueryMode.aspx?pageNumber=4"">4</a> <a href=""/Test_QueryMode.aspx?pageNumber=5"">5</a> <a href=""/Test_QueryMode.aspx?pageNumber=6"">...</a> <a href=""/Test_QueryMode.aspx?pageNumber=10"">Last</a> </span>";
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
}
void TestPostBackMode_Aspx_Start (string result, TestRunItem runItem)
{
- string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" disabled=""disabled"" /> <span>1</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">5</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
+ string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" disabled=""disabled"" /> <span>1</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">5</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
}
void TestPostBackMode_Aspx_Page2 (string result, TestRunItem runItem)
{
- string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a> <span>2</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">5</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
+ string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a> <span>2</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">5</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
}
void TestPostBackMode_Aspx_PageNext (string result, TestRunItem runItem)
{
- string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">...</a> <span>6</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">7</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">8</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">9</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">10</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
+ string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">...</a> <span>6</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">7</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">8</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl04','')"">9</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">10</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
}
void TestPostBackMode_Aspx_PagePrev (string result, TestRunItem runItem)
{
- string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <span>5</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
+ string originalHtml = @"<span id=""ctl00_ContentPlaceHolder1_ListView1_DataPager1""><input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl00$ctl00"" value=""First"" /> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl00','')"">1</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl03','')"">4</a> <span>5</span> <a href=""javascript:__doPostBack('ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl01$ctl05','')"">...</a> <input type=""submit"" name=""ctl00$ContentPlaceHolder1$ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>";
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
}
}
properties = new ConfigurationPropertyCollection();
}
- public void Add (AssemblyInfo info)
+ public void Add (AssemblyInfo assemblyInformation)
{
- BaseAdd (info, false);
+ BaseAdd (assemblyInformation, false);
}
public void Clear ()
set { if (BaseGet(index) != null) BaseRemoveAt(index); BaseAdd(index, value); }
}
- public new BufferModeSettings this [string name] {
- get { return (BufferModeSettings) BaseGet (name); }
+ public new BufferModeSettings this [string key] {
+ get { return (BufferModeSettings) BaseGet (key); }
}
protected internal override ConfigurationPropertyCollection Properties {
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
}
- public new EventMappingSettings this [string name] {
- get { return (EventMappingSettings) BaseGet (name); }
+ public new EventMappingSettings this [string key] {
+ get { return (EventMappingSettings) BaseGet (key); }
}
protected internal override ConfigurationPropertyCollection Properties {
{
}
- public void Add (HttpModuleAction httpModuleAction)
+ public void Add (HttpModuleAction httpModule)
{
- BaseAdd (httpModuleAction);
+ BaseAdd (httpModule);
}
public void Clear ()
BaseRemoveAt (index);
}
- public new ProfileSettings this [string name] {
- get { return (ProfileSettings)BaseGet (name); }
+ public new ProfileSettings this [string key] {
+ get { return (ProfileSettings)BaseGet (key); }
}
public ProfileSettings this [int index] {
groupSettings = new ProfileGroupSettingsCollection ();
}
- public override bool Equals (object obj)
+ public override bool Equals (object rootProfilePropertySettingsCollection)
{
- RootProfilePropertySettingsCollection col = obj as RootProfilePropertySettingsCollection;
+ RootProfilePropertySettingsCollection col = rootProfilePropertySettingsCollection as RootProfilePropertySettingsCollection;
if (col == null)
return false;
BaseRemoveAt (index);
}
- public new RuleSettings this [string name] {
- get { return (RuleSettings) BaseGet (name); }
+ public new RuleSettings this [string key] {
+ get { return (RuleSettings) BaseGet (key); }
}
public RuleSettings this [int index] {
this.MappedTagType = mappedTagTypeName;
}
- public override bool Equals (object map)
+ public override bool Equals (object o)
{
- TagMapInfo info = map as TagMapInfo;
+ TagMapInfo info = o as TagMapInfo;
if (info == null)
return false;
get { return "trustLevel"; }
}
- public new TrustLevel this [string name] {
- get { return (TrustLevel) BaseGet (name); }
+ public new TrustLevel this [string key] {
+ get { return (TrustLevel) BaseGet (key); }
}
public TrustLevel this [int index] {
public interface IAppManagerAppDomainFactory
{
[return: MarshalAs (UnmanagedType.Interface)]
- object Create ([In, MarshalAs(UnmanagedType.BStr)] string s,
- [In, MarshalAs(UnmanagedType.BStr)] string app_id);
+ object Create ([In, MarshalAs(UnmanagedType.BStr)] string appId,
+ [In, MarshalAs(UnmanagedType.BStr)] string appPath);
void Stop ();
}
}
{
public interface IWebEventCustomEvaluator
{
- bool CanFire (WebBaseEvent raised_event, RuleFiringRecord record);
+ bool CanFire (WebBaseEvent raisedEvent, RuleFiringRecord record);
}
}
object event_source;
int event_code, event_detail_code;
- protected WebBaseEvent (string message, object event_source, int event_code)
+ protected WebBaseEvent (string message, object eventSource, int eventCode)
{
this.message = message;
- this.event_source = event_source;
- this.event_code = event_code;
+ this.event_source = eventSource;
+ this.event_code = eventCode;
}
- protected WebBaseEvent (string message, object event_source, int event_code, int event_detail_code)
+ protected WebBaseEvent (string message, object eventSource, int eventCode, int eventDetailCode)
{
this.message = message;
- this.event_source = event_source;
- this.event_code = event_code;
- this.event_detail_code = event_detail_code;
+ this.event_source = eventSource;
+ this.event_code = eventCode;
+ this.event_detail_code = eventDetailCode;
}
public static WebApplicationInformation ApplicationInformation {
throw new NotImplementedException ();
}
- public static void Raise (WebBaseEvent event_raised)
+ public static void Raise (WebBaseEvent eventRaised)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public virtual string ToString (bool include_app_info, bool include_custom_event_details)
+ public virtual string ToString (bool includeAppInfo, bool includeCustomEventDetails)
{
throw new NotImplementedException ();
}
public class ActiveDirectoryMembershipProvider : MembershipProvider {
[MonoTODO ("Not implemented")]
- public override bool ChangePassword (string username, string oldPwd, string newPwd)
+ public override bool ChangePassword (string username, string oldPassword, string newPassword)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+ public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
+ public override MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new NotImplementedException ();
}
}
[MonoTODO ("Not implemented")]
- public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public override MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override string GetPassword (string username, string answer)
+ public override string GetPassword (string username, string passwordAnswer)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override string ResetPassword (string username, string answer)
+ public override string ResetPassword (string username, string passwordAnswer)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override bool UnlockUser (string userName)
+ public override bool UnlockUser (string username)
{
throw new NotImplementedException ();
}
return usr;
}
- public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
+ public static MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, out MembershipCreateStatus status)
{
- return CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, null, out status);
+ return CreateUser (username, password, email, passwordQuestion, passwordAnswer, isApproved, null, out status);
}
- public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
+ public static MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
if (String.IsNullOrEmpty (username)) {
status = MembershipCreateStatus.InvalidUserName;
return null;
}
- return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, providerUserKey, out status);
+ return Provider.CreateUser (username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status);
}
public static bool DeleteUser (string username)
return Provider.GetUser (providerUserKey, userIsOnline);
}
- public static string GetUserNameByEmail (string email)
+ public static string GetUserNameByEmail (string emailToMatch)
{
- return Provider.GetUserNameByEmail (email);
+ return Provider.GetUserNameByEmail (emailToMatch);
}
public static void UpdateUser (MembershipUser user)
return Provider.FindUsersByEmail (emailToMatch, pageIndex, pageSize, out totalRecords);
}
- public static MembershipUserCollection FindUsersByName (string nameToMatch)
+ public static MembershipUserCollection FindUsersByName (string usernameToMatch)
{
int totalRecords;
- return Provider.FindUsersByName (nameToMatch, 0, int.MaxValue, out totalRecords);
+ return Provider.FindUsersByName (usernameToMatch, 0, int.MaxValue, out totalRecords);
}
- public static MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public static MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- return Provider.FindUsersByName (nameToMatch, pageIndex, pageSize, out totalRecords);
+ return Provider.FindUsersByName (usernameToMatch, pageIndex, pageSize, out totalRecords);
}
public static string ApplicationName {
}
- public static void AddUsersToRole (string [] usernames, string rolename)
+ public static void AddUsersToRole (string [] usernames, string roleName)
{
- Provider.AddUsersToRoles (usernames, new string[] {rolename});
+ Provider.AddUsersToRoles (usernames, new string[] {roleName});
}
- public static void AddUsersToRoles (string [] usernames, string [] rolenames)
+ public static void AddUsersToRoles (string [] usernames, string [] roleNames)
{
- Provider.AddUsersToRoles (usernames, rolenames);
+ Provider.AddUsersToRoles (usernames, roleNames);
}
- public static void AddUserToRole (string username, string rolename)
+ public static void AddUserToRole (string username, string roleName)
{
- Provider.AddUsersToRoles (new string[] {username}, new string[] {rolename});
+ Provider.AddUsersToRoles (new string[] {username}, new string[] {roleName});
}
- public static void AddUserToRoles (string username, string [] rolenames)
+ public static void AddUserToRoles (string username, string [] roleNames)
{
- Provider.AddUsersToRoles (new string[] {username}, rolenames);
+ Provider.AddUsersToRoles (new string[] {username}, roleNames);
}
- public static void CreateRole (string rolename)
+ public static void CreateRole (string roleName)
{
- Provider.CreateRole (rolename);
+ Provider.CreateRole (roleName);
}
public static void DeleteCookie ()
}
}
- public static bool DeleteRole (string rolename)
+ public static bool DeleteRole (string roleName)
{
- return Provider.DeleteRole (rolename, true);
+ return Provider.DeleteRole (roleName, true);
}
- public static bool DeleteRole (string rolename, bool throwOnPopulatedRole)
+ public static bool DeleteRole (string roleName, bool throwOnPopulatedRole)
{
- return Provider.DeleteRole (rolename, throwOnPopulatedRole);
+ return Provider.DeleteRole (roleName, throwOnPopulatedRole);
}
public static string [] GetAllRoles ()
return Provider.GetRolesForUser (username);
}
- public static string [] GetUsersInRole (string rolename)
+ public static string [] GetUsersInRole (string roleName)
{
- return Provider.GetUsersInRole (rolename);
+ return Provider.GetUsersInRole (roleName);
}
- public static bool IsUserInRole (string rolename)
+ public static bool IsUserInRole (string roleName)
{
- return IsUserInRole (CurrentUser, rolename);
+ return IsUserInRole (CurrentUser, roleName);
}
- public static bool IsUserInRole (string username, string rolename)
+ public static bool IsUserInRole (string username, string roleName)
{
if (String.IsNullOrEmpty (username))
return false;
- return Provider.IsUserInRole (username, rolename);
+ return Provider.IsUserInRole (username, roleName);
}
- public static void RemoveUserFromRole (string username, string rolename)
+ public static void RemoveUserFromRole (string username, string roleName)
{
- Provider.RemoveUsersFromRoles (new string[] {username}, new string[] {rolename});
+ Provider.RemoveUsersFromRoles (new string[] {username}, new string[] {roleName});
}
- public static void RemoveUserFromRoles (string username, string [] rolenames)
+ public static void RemoveUserFromRoles (string username, string [] roleNames)
{
- Provider.RemoveUsersFromRoles (new string[] {username}, rolenames);
+ Provider.RemoveUsersFromRoles (new string[] {username}, roleNames);
}
- public static void RemoveUsersFromRole (string [] usernames, string rolename)
+ public static void RemoveUsersFromRole (string [] usernames, string roleName)
{
- Provider.RemoveUsersFromRoles (usernames, new string[] {rolename});
+ Provider.RemoveUsersFromRoles (usernames, new string[] {roleName});
}
- public static void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+ public static void RemoveUsersFromRoles (string [] usernames, string [] roleNames)
{
- Provider.RemoveUsersFromRoles (usernames, rolenames);
+ Provider.RemoveUsersFromRoles (usernames, roleNames);
}
- public static bool RoleExists (string rolename)
+ public static bool RoleExists (string roleName)
{
- return Provider.RoleExists (rolename);
+ return Provider.RoleExists (roleName);
}
- public static string[] FindUsersInRole (string rolename, string usernameToMatch)
+ public static string[] FindUsersInRole (string roleName, string usernameToMatch)
{
- return Provider.FindUsersInRole (rolename, usernameToMatch);
+ return Provider.FindUsersInRole (roleName, usernameToMatch);
}
public static string ApplicationName {
throw new ArgumentException (String.Format ("invalid format for {0}", pName));
}
- public override bool ChangePassword (string username, string oldPwd, string newPwd)
+ public override bool ChangePassword (string username, string oldPassword, string newPassword)
{
if (username != null) username = username.Trim ();
- if (oldPwd != null) oldPwd = oldPwd.Trim ();
- if (newPwd != null) newPwd = newPwd.Trim ();
+ if (oldPassword != null) oldPassword = oldPassword.Trim ();
+ if (newPassword != null) newPassword = newPassword.Trim ();
CheckParam ("username", username, 256);
- CheckParam ("oldPwd", oldPwd, 128);
- CheckParam ("newPwd", newPwd, 128);
+ CheckParam ("oldPassword", oldPassword, 128);
+ CheckParam ("newPassword", newPassword, 128);
- if (!CheckPassword (newPwd))
+ if (!CheckPassword (newPassword))
throw new ArgumentException (string.Format (
"New Password invalid. New Password length minimum: {0}. Non-alphanumeric characters required: {1}.",
MinRequiredPasswordLength,
MinRequiredNonAlphanumericCharacters));
using (DbConnection connection = CreateConnection ()) {
- PasswordInfo pi = ValidateUsingPassword (username, oldPwd);
+ PasswordInfo pi = ValidateUsingPassword (username, oldPassword);
if (pi != null) {
- EmitValidatingPassword (username, newPwd, false);
- string db_password = EncodePassword (newPwd, pi.PasswordFormat, pi.PasswordSalt);
+ EmitValidatingPassword (username, newPassword, false);
+ string db_password = EncodePassword (newPassword, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
}
}
- public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+ public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
if (username != null) username = username.Trim ();
- if (newPwdQuestion != null) newPwdQuestion = newPwdQuestion.Trim ();
- if (newPwdAnswer != null) newPwdAnswer = newPwdAnswer.Trim ();
+ if (newPasswordQuestion != null) newPasswordQuestion = newPasswordQuestion.Trim ();
+ if (newPasswordAnswer != null) newPasswordAnswer = newPasswordAnswer.Trim ();
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("newPwdQuestion", newPwdQuestion, 128);
+ CheckParam ("newPasswordQuestion", newPasswordQuestion, 128);
if (RequiresQuestionAndAnswer)
- CheckParam ("newPwdAnswer", newPwdAnswer, 128);
+ CheckParam ("newPasswordAnswer", newPasswordAnswer, 128);
using (DbConnection connection = CreateConnection ()) {
PasswordInfo pi = ValidateUsingPassword (username, password);
if (pi != null) {
- string db_passwordAnswer = EncodePassword (newPwdAnswer, pi.PasswordFormat, pi.PasswordSalt);
+ string db_passwordAnswer = EncodePassword (newPasswordAnswer, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
AddParameter (command, "@ApplicationName", ApplicationName);
AddParameter (command, "@UserName", username);
- AddParameter (command, "@NewPasswordQuestion", newPwdQuestion);
+ AddParameter (command, "@NewPasswordQuestion", newPasswordQuestion);
AddParameter (command, "@NewPasswordAnswer", db_passwordAnswer);
DbParameter returnValue = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
public override MembershipUser CreateUser (string username,
string password,
string email,
- string pwdQuestion,
- string pwdAnswer,
+ string passwordQuestion,
+ string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)
if (username != null) username = username.Trim ();
if (password != null) password = password.Trim ();
if (email != null) email = email.Trim ();
- if (pwdQuestion != null) pwdQuestion = pwdQuestion.Trim ();
- if (pwdAnswer != null) pwdAnswer = pwdAnswer.Trim ();
+ if (passwordQuestion != null) passwordQuestion = passwordQuestion.Trim ();
+ if (passwordAnswer != null) passwordAnswer = passwordAnswer.Trim ();
/* some initial validation */
if (username == null || username.Length == 0 || username.Length > 256 || username.IndexOf (',') != -1) {
return null;
}
if (RequiresQuestionAndAnswer &&
- (pwdQuestion == null ||
- pwdQuestion.Length == 0 || pwdQuestion.Length > 256)) {
+ (passwordQuestion == null ||
+ passwordQuestion.Length == 0 || passwordQuestion.Length > 256)) {
status = MembershipCreateStatus.InvalidQuestion;
return null;
}
if (RequiresQuestionAndAnswer &&
- (pwdAnswer == null ||
- pwdAnswer.Length == 0 || pwdAnswer.Length > 128)) {
+ (passwordAnswer == null ||
+ passwordAnswer.Length == 0 || passwordAnswer.Length > 128)) {
status = MembershipCreateStatus.InvalidAnswer;
return null;
}
password = EncodePassword (password, PasswordFormat, passwordSalt);
if (RequiresQuestionAndAnswer)
- pwdAnswer = EncodePassword (pwdAnswer, PasswordFormat, passwordSalt);
+ passwordAnswer = EncodePassword (passwordAnswer, PasswordFormat, passwordSalt);
/* make sure the hashed/encrypted password and
* answer are still under 128 characters. */
}
if (RequiresQuestionAndAnswer) {
- if (pwdAnswer.Length > 128) {
+ if (passwordAnswer.Length > 128) {
status = MembershipCreateStatus.InvalidAnswer;
return null;
}
AddParameter (command, "@Password", password);
AddParameter (command, "@PasswordSalt", passwordSalt);
AddParameter (command, "@Email", email);
- AddParameter (command, "@PasswordQuestion", pwdQuestion);
- AddParameter (command, "@PasswordAnswer", pwdAnswer);
+ AddParameter (command, "@PasswordQuestion", passwordQuestion);
+ AddParameter (command, "@PasswordAnswer", passwordAnswer);
AddParameter (command, "@IsApproved", isApproved);
AddParameter (command, "@CurrentTimeUtc", Now);
AddParameter (command, "@CreateDate", Now);
}
}
- public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public override MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- CheckParam ("nameToMatch", nameToMatch, 256);
+ CheckParam ("usernameToMatch", usernameToMatch, 256);
if (pageIndex < 0)
throw new ArgumentException ("pageIndex must be >= 0");
AddParameter (command, "@PageIndex", pageIndex);
AddParameter (command, "@PageSize", pageSize);
- AddParameter (command, "@UserNameToMatch", nameToMatch);
+ AddParameter (command, "@UserNameToMatch", usernameToMatch);
AddParameter (command, "@ApplicationName", ApplicationName);
// return value
AddParameter (command, "@ReturnValue", ParameterDirection.ReturnValue, null);
}
}
- public override string GetPassword (string username, string answer)
+ public override string GetPassword (string username, string passwordAnswer)
{
if (!EnablePasswordRetrieval)
throw new NotSupportedException ("this provider has not been configured to allow the retrieval of passwords");
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("answer", answer, 128);
+ CheckParam ("passwordAnswer", passwordAnswer, 128);
PasswordInfo pi = GetPasswordInfo (username);
if (pi == null)
throw new ProviderException ("An error occurred while retrieving the password from the database");
- string user_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);
+ string user_answer = EncodePassword (passwordAnswer, pi.PasswordFormat, pi.PasswordSalt);
string password = null;
using (DbConnection connection = CreateConnection ()) {
ProvidersHelper.GetDbProviderFactory (connectionString.ProviderName);
}
- public override string ResetPassword (string username, string answer)
+ public override string ResetPassword (string username, string passwordAnswer)
{
if (!EnablePasswordReset)
throw new NotSupportedException ("this provider has not been configured to allow the resetting of passwords");
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("answer", answer, 128);
+ CheckParam ("passwordAnswer", passwordAnswer, 128);
using (DbConnection connection = CreateConnection ()) {
EmitValidatingPassword (username, newPassword, false);
string db_password = EncodePassword (newPassword, pi.PasswordFormat, pi.PasswordSalt);
- string db_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);
+ string db_answer = EncodePassword (passwordAnswer, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
return dbp;
}
- public override void AddUsersToRoles (string [] usernames, string [] rolenames)
+ public override void AddUsersToRoles (string [] usernames, string [] roleNames)
{
Hashtable h = new Hashtable ();
}
h = new Hashtable ();
- foreach (string r in rolenames) {
+ foreach (string r in roleNames) {
if (r == null)
throw new ArgumentNullException ("null element in rolenames array");
if (h.ContainsKey (r))
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleNames", String.Join (",", rolenames));
+ AddParameter (command, "@RoleNames", String.Join (",", roleNames));
AddParameter (command, "@UserNames", String.Join (",", usernames));
AddParameter (command, "@ApplicationName", ApplicationName);
AddParameter (command, "@CurrentTimeUtc", DateTime.UtcNow);
}
}
- public override void CreateRole (string rolename)
+ public override void CreateRole (string roleName)
{
- if (rolename == null)
- throw new ArgumentNullException ("rolename");
+ if (roleName == null)
+ throw new ArgumentNullException ("roleName");
- if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (',') != -1)
+ if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (',') != -1)
throw new ArgumentException ("rolename is in invalid format");
using (DbConnection connection = CreateConnection ()) {
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
command.ExecuteNonQuery ();
int returnValue = (int) dbpr.Value;
if (returnValue == 1)
- throw new ProviderException (rolename + " already exists in the database");
+ throw new ProviderException (roleName + " already exists in the database");
else
return;
}
}
- public override bool DeleteRole (string rolename, bool throwOnPopulatedRole)
+ public override bool DeleteRole (string roleName, bool throwOnPopulatedRole)
{
- if (rolename == null)
- throw new ArgumentNullException ("rolename");
+ if (roleName == null)
+ throw new ArgumentNullException ("roleName");
- if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (',') != -1)
+ if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (',') != -1)
throw new ArgumentException ("rolename is in invalid format");
using (DbConnection connection = CreateConnection ()) {
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@DeleteOnlyIfRoleIsEmpty", throwOnPopulatedRole);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
if (returnValue == 1)
return false; //role does not exist
else if (returnValue == 2 && throwOnPopulatedRole)
- throw new ProviderException (rolename + " is not empty");
+ throw new ProviderException (roleName + " is not empty");
else
return false;
}
}
}
- public override string [] GetUsersInRole (string rolename)
+ public override string [] GetUsersInRole (string roleName)
{
using (DbConnection connection = CreateConnection ()) {
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@ApplicationName", ApplicationName);
DbDataReader reader = command.ExecuteReader ();
ProvidersHelper.GetDbProviderFactory (connectionString.ProviderName);
}
- public override bool IsUserInRole (string username, string rolename)
+ public override bool IsUserInRole (string username, string roleName)
{
using (DbConnection connection = CreateConnection ()) {
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@UserName", username);
AddParameter (command, "@ApplicationName", ApplicationName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
}
}
- public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+ public override void RemoveUsersFromRoles (string [] usernames, string [] roleNames)
{
Hashtable h = new Hashtable ();
}
h = new Hashtable ();
- foreach (string r in rolenames) {
+ foreach (string r in roleNames) {
if (r == null)
throw new ArgumentNullException ("null element in rolenames array");
if (h.ContainsKey (r))
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@UserNames", String.Join (",", usernames));
- AddParameter (command, "@RoleNames", String.Join (",", rolenames));
+ AddParameter (command, "@RoleNames", String.Join (",", roleNames));
AddParameter (command, "@ApplicationName", ApplicationName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
}
}
- public override bool RoleExists (string rolename)
+ public override bool RoleExists (string roleName)
{
using (DbConnection connection = CreateConnection ()) {
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
command.ExecuteNonQuery ();
get { return container.IsSynchronized; }
}
- public object this [string key] {
- get { return container [key]; }
- set { container [key] = value; }
+ public object this [string name] {
+ get { return container [name]; }
+ set { container [name] = value; }
}
public object this [int index] {
{
///methods
void Abandon ();
- void Add (string itemName, object itemValue);
+ void Add (string name, object value);
void Clear ();
- void CopyTo (Array sessionValues, int index);
+ void CopyTo (Array array, int index);
IEnumerator GetEnumerator ();
- void Remove (string itemName);
+ void Remove (string name);
void RemoveAll ();
void RemoveAt (int index);
void Initialize ();
bool InitializeRequest (HttpContext context, bool suppressAutoDetectRedirect, out bool supportSessionIDReissue);
void RemoveSessionID (HttpContext context);
- void SaveSessionID (HttpContext context, string sessionID, out bool isRedirected, out bool isCookieAdded);
+ void SaveSessionID (HttpContext context, string id, out bool redirected, out bool cookieAdded);
bool Validate (string id);
}
}
{
///methods
void Clear ();
- void Remove (string itemName);
+ void Remove (string name);
void RemoveAt (int index);
///properties
HttpStaticObjectsCollection staticObjects;
int timeout;
- public SessionStateStoreData (ISessionStateItemCollection items,
- HttpStaticObjectsCollection objects,
+ public SessionStateStoreData (ISessionStateItemCollection sessionItems,
+ HttpStaticObjectsCollection staticObjects,
int timeout)
{
- sessionItems = items;
- staticObjects = objects;
+ this.sessionItems = sessionItems;
+ this.staticObjects = staticObjects;
this.timeout = timeout;
}
}
}
- protected internal virtual void BeginRender (HtmlTextWriter w)
+ protected internal virtual void BeginRender (HtmlTextWriter writer)
{
- w.BeginRender();
+ writer.BeginRender();
}
protected internal virtual void CreateChildControls ()
control.CreateChildControls ();
}
- protected internal virtual void EndRender (HtmlTextWriter w)
+ protected internal virtual void EndRender (HtmlTextWriter writer)
{
- w.EndRender ();
+ writer.EndRender ();
}
protected internal virtual void LoadAdapterControlState (object state)
control.OnUnload(e);
}
- protected internal virtual void Render (HtmlTextWriter w)
+ protected internal virtual void Render (HtmlTextWriter writer)
{
Control control = Control;
if (control != null)
- control.Render (w);
+ control.Render (writer);
}
- protected internal virtual void RenderChildren (HtmlTextWriter w)
+ protected internal virtual void RenderChildren (HtmlTextWriter writer)
{
Control control = Control;
if (control != null)
- control.RenderChildren (w);
+ control.RenderChildren (writer);
}
protected internal virtual object SaveAdapterControlState ()
radioButtons.Add(radioButton);
}
- public virtual void RenderBeginHyperlink (HtmlTextWriter w,
+ public virtual void RenderBeginHyperlink (HtmlTextWriter writer,
string targetUrl,
bool encodeUrl,
- string softKeyLabel)
+ string softkeyLabel)
{
- InternalRenderBeginHyperlink (w, targetUrl, encodeUrl, softKeyLabel, null);
+ InternalRenderBeginHyperlink (writer, targetUrl, encodeUrl, softkeyLabel, null);
}
- public virtual void RenderBeginHyperlink (HtmlTextWriter w,
+ public virtual void RenderBeginHyperlink (HtmlTextWriter writer,
string targetUrl,
bool encodeUrl,
- string softKeyLabel,
+ string softkeyLabel,
string accessKey)
{
if (accessKey != null && accessKey.Length > 1)
throw new ArgumentOutOfRangeException("accessKey");
- InternalRenderBeginHyperlink (w, targetUrl, encodeUrl, softKeyLabel, accessKey);
+ InternalRenderBeginHyperlink (writer, targetUrl, encodeUrl, softkeyLabel, accessKey);
}
void InternalRenderBeginHyperlink (HtmlTextWriter w,
}
- public virtual void RenderEndHyperlink (HtmlTextWriter w)
+ public virtual void RenderEndHyperlink (HtmlTextWriter writer)
{
- w.RenderEndTag();
+ writer.RenderEndTag();
}
- public virtual void RenderPostBackEvent (HtmlTextWriter w,
+ public virtual void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text)
{
- RenderPostBackEvent (w, target, argument, softKeyLabel, text, Page.Request.FilePath, null, true);
+ RenderPostBackEvent (writer, target, argument, softkeyLabel, text, Page.Request.FilePath, null, true);
}
- public virtual void RenderPostBackEvent (HtmlTextWriter w,
+ public virtual void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text,
string postUrl,
string accessKey)
{
- RenderPostBackEvent (w, target, argument, softKeyLabel, text, postUrl, accessKey, true);
+ RenderPostBackEvent (writer, target, argument, softkeyLabel, text, postUrl, accessKey, true);
}
- protected void RenderPostBackEvent (HtmlTextWriter w,
+ protected void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text,
string postUrl,
string accessKey,
{
string url = String.Format ("{0}?__VIEWSTATE={1}&__EVENTTARGET={2}&__EVENTARGUMENT={3}&__PREVIOUSPAGE={4}",
postUrl, HttpUtility.UrlEncode (Page.GetSavedViewState ()), target, argument, Page.Request.FilePath);
- RenderBeginHyperlink (w, url, encode, softKeyLabel, accessKey);
- w.Write(text);
- RenderEndHyperlink(w);
+ RenderBeginHyperlink (writer, url, encode, softkeyLabel, accessKey);
+ writer.Write(text);
+ RenderEndHyperlink(writer);
}
public virtual string TransformText (string text)
return text;
}
- protected internal virtual string GetPostBackFormReference (string formID)
+ protected internal virtual string GetPostBackFormReference (string formId)
{
- return String.Format("document.forms['{0}']", formID);
+ return String.Format("document.forms['{0}']", formId);
}
ListDictionary radio_button_group;
base.OnPreRender(e);
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
/* Need to always render: method, action and id
*/
if (RenderingCompatibilityLessThan40)
// LAMESPEC: MSDN says the 'name' attribute is rendered only in
// Legacy mode, this is not true.
- w.WriteAttribute ("name", Name);
+ writer.WriteAttribute ("name", Name);
}
- w.WriteAttribute ("method", Method);
+ writer.WriteAttribute ("method", Method);
if (String.IsNullOrEmpty (customAction))
- w.WriteAttribute ("action", action, true);
+ writer.WriteAttribute ("action", action, true);
/*
* This is a hack that guarantees the ID is set properly for HtmlControl to
string submit = page != null ? page.GetSubmitStatements () : null;
if (!String.IsNullOrEmpty (submit)) {
Attributes.Remove ("onsubmit");
- w.WriteAttribute ("onsubmit", submit);
+ writer.WriteAttribute ("onsubmit", submit);
}
/* enctype and target should not be written if
*/
string enctype = Enctype;
if (!String.IsNullOrEmpty (enctype))
- w.WriteAttribute ("enctype", enctype);
+ writer.WriteAttribute ("enctype", enctype);
string target = Target;
if (!String.IsNullOrEmpty (target))
- w.WriteAttribute ("target", target);
+ writer.WriteAttribute ("target", target);
string defaultbutton = DefaultButton;
if (!String.IsNullOrEmpty (defaultbutton)) {
ID));
if (page != null && DetermineRenderUplevel ()) {
- w.WriteAttribute (
+ writer.WriteAttribute (
"onkeypress",
"javascript:return " + page.WebFormScriptReference + ".WebForm_FireDefaultButton(event, '" + c.ClientID + "')");
}
Attributes.Remove ("enctype");
Attributes.Remove ("target");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
}
- protected internal override void RenderChildren (HtmlTextWriter w)
+ protected internal override void RenderChildren (HtmlTextWriter writer)
{
Page page = Page;
page.RegisterForm (this);
}
if (page != null)
- page.OnFormRender (w, ClientID);
- base.RenderChildren (w);
+ page.OnFormRender (writer, ClientID);
+ base.RenderChildren (writer);
if (page != null)
- page.OnFormPostRender (w, ClientID);
+ page.OnFormPostRender (writer, ClientID);
}
/* According to corcompare */
[MonoTODO ("why override?")]
- public override void RenderControl (HtmlTextWriter w)
+ public override void RenderControl (HtmlTextWriter writer)
{
- base.RenderControl (w);
+ base.RenderControl (writer);
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter output)
{
- base.Render (w);
+ base.Render (output);
}
}
}
}
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
- PreProcessRelativeReference (w, "src");
+ PreProcessRelativeReference (writer, "src");
/* MS does not seem to render the src attribute if it
* is empty. Firefox, at least, will fetch the current
if (src == null || src.Length == 0)
Attributes.Remove ("src");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
/* MS closes the HTML element at the end of
* the attributes too, according to the nunit
* tests
*/
- w.Write (" /");
+ writer.Write (" /");
}
}
}
}
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
/* If there is no "name" attribute,
* LoadPostData doesn't work...
*/
- w.WriteAttribute ("name", Name);
+ writer.WriteAttribute ("name", Name);
Attributes.Remove ("name");
/* Don't render the databinding attributes */
Attributes.Remove ("datatextfield");
Attributes.Remove ("datavaluefield");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
}
- protected internal override void RenderChildren (HtmlTextWriter w)
+ protected internal override void RenderChildren (HtmlTextWriter writer)
{
- base.RenderChildren (w);
+ base.RenderChildren (writer);
if (items == null)
return;
- w.WriteLine ();
+ writer.WriteLine ();
bool done_sel = false;
int count = items.Count;
for (int i = 0; i < count; i++) {
ListItem item = items[i];
- w.Indent++;
+ writer.Indent++;
/* Write the <option> elements this
* way so that the output HTML matches
* element, cos that breaks other
* stuff.)
*/
- w.WriteBeginTag ("option");
+ writer.WriteBeginTag ("option");
if (item.Selected && !done_sel) {
- w.WriteAttribute ("selected", "selected");
+ writer.WriteAttribute ("selected", "selected");
if (!Multiple) {
done_sel = true;
}
}
- w.WriteAttribute ("value", item.Value, true);
+ writer.WriteAttribute ("value", item.Value, true);
if (item.HasAttributes) {
AttributeCollection attrs = item.Attributes;
foreach (string key in attrs.Keys)
- w.WriteAttribute (key, HttpUtility.HtmlAttributeEncode (attrs [key]));
+ writer.WriteAttribute (key, HttpUtility.HtmlAttributeEncode (attrs [key]));
}
- w.Write (HtmlTextWriter.TagRightChar);
+ writer.Write (HtmlTextWriter.TagRightChar);
- w.Write (HttpUtility.HtmlEncode(item.Text));
- w.WriteEndTag ("option");
- w.WriteLine ();
+ writer.Write (HttpUtility.HtmlEncode(item.Text));
+ writer.WriteEndTag ("option");
+ writer.WriteLine ();
- w.Indent--;
+ writer.Indent--;
}
}
InnerList.AddRange (connectionInterfaces);
}
- public bool Contains (Type t)
+ public bool Contains (Type value)
{
- return InnerList.Contains (t);
+ return InnerList.Contains (value);
}
public void CopyTo (Type[] array,
InnerList.CopyTo (array, index);
}
- public int IndexOf (Type t)
+ public int IndexOf (Type value)
{
- return InnerList.IndexOf (t);
+ return InnerList.IndexOf (value);
}
public Type this [ int index ] {
{
public class ConsumerConnectionPoint : ConnectionPoint
{
- public ConsumerConnectionPoint (MethodInfo callBack, Type interFace,
- Type control, string name, string id,
- bool allowsMultiConnections) : base (callBack, interFace,
- control, name, id, allowsMultiConnections)
+ public ConsumerConnectionPoint (MethodInfo callbackMethod, Type interfaceType,
+ Type controlType, string displayName, string id,
+ bool allowsMultipleConnections) : base (callbackMethod, interfaceType,
+ controlType, displayName, id, allowsMultipleConnections)
{
}
{
public class ProviderConnectionPoint : ConnectionPoint
{
- public ProviderConnectionPoint (MethodInfo callBack, Type interFace,
- Type control, string name, string id,
- bool allowsMultiConnections) : base (callBack, interFace,
- control, name, id, allowsMultiConnections)
+ public ProviderConnectionPoint (MethodInfo callbackMethod, Type interfaceType,
+ Type controlType, string displayName, string id,
+ bool allowsMultipleConnections) : base (callbackMethod, interfaceType,
+ controlType, displayName, id, allowsMultipleConnections)
{
}
get { return id;}
}
- public WebPartVerb (string id, string clientHandler) {
+ public WebPartVerb (string id, string clientClickHandler) {
this.id = id;
- this.clientClickHandler = clientHandler;
+ this.clientClickHandler = clientClickHandler;
stateBag = new StateBag ();
- stateBag.Add ("clientClickHandler", clientHandler);
+ stateBag.Add ("clientClickHandler", clientClickHandler);
}
base.OnInit(e);
}
- protected internal override void OnPreRender (EventArgs eee)
+ protected internal override void OnPreRender (EventArgs e)
{
Hashtable ht = null;
ht = ChooseAd ();
}
- AdCreatedEventArgs e = new AdCreatedEventArgs (ht);
- OnAdCreated (e);
- createdargs = e;
+ AdCreatedEventArgs ev = new AdCreatedEventArgs (ht);
+ OnAdCreated (ev);
+ createdargs = ev;
}
throw new NotImplementedException ();
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
AdCreatedEventArgs e = createdargs;
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
if (e.NavigateUrl != null && e.NavigateUrl.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Href, ResolveAdUrl (e.NavigateUrl));
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, ResolveAdUrl (e.NavigateUrl));
if (Target != null && Target.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Target, Target);
+ writer.AddAttribute (HtmlTextWriterAttribute.Target, Target);
- w.RenderBeginTag (HtmlTextWriterTag.A);
+ writer.RenderBeginTag (HtmlTextWriterTag.A);
if (e.ImageUrl != null && e.ImageUrl.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveAdUrl (e.ImageUrl));
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, ResolveAdUrl (e.ImageUrl));
- w.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? String.Empty : e.AlternateText);
- w.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag (); // img
- w.RenderEndTag (); // a
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? String.Empty : e.AlternateText);
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag (); // img
+ writer.RenderEndTag (); // a
}
string ResolveAdUrl (string url)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
if (Page != null) {
}
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
public static bool CanConvert (string text,
return BaseCompareValidator.Convert(text, type, false, out value);
}
- protected static bool Compare (string left, string right, ValidationCompareOperator op, ValidationDataType type)
+ protected static bool Compare (string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
{
- return BaseCompareValidator.Compare(left, false, right, false, op, type);
+ return BaseCompareValidator.Compare(leftText, false, rightText, false, op, type);
}
protected override bool DetermineRenderUplevel ()
return order.ToString ();
}
- protected static int GetFullYear (int two_digit_year)
+ protected static int GetFullYear (int shortYear)
{
/* This is an implementation that matches the
* docs on msdn, but MS doesn't seem to go by
int cutoff = CutoffYear;
int twodigitcutoff = cutoff % 100;
- if (two_digit_year <= twodigitcutoff)
- return cutoff - twodigitcutoff + two_digit_year;
+ if (shortYear <= twodigitcutoff)
+ return cutoff - twodigitcutoff + shortYear;
else
- return cutoff - twodigitcutoff - 100 + two_digit_year;
+ return cutoff - twodigitcutoff - 100 + shortYear;
}
[DefaultValue (false)]
return Convert(text, type, cultureInvariant, out value);
}
- protected static bool Compare (string left,
+ protected static bool Compare (string leftText,
bool cultureInvariantLeftText,
- string right,
+ string rightText,
bool cultureInvariantRightText,
ValidationCompareOperator op,
ValidationDataType type)
{
object lo, ro;
- if (!Convert(left, type, cultureInvariantLeftText, out lo))
+ if (!Convert(leftText, type, cultureInvariantLeftText, out lo))
return false;
/* DataTypeCheck is a unary operator that only
/* pretty crackladen, but if we're unable to
* convert the rhs to @type, the comparison
* succeeds */
- if (!Convert(right, type, cultureInvariantRightText, out ro))
+ if (!Convert(rightText, type, cultureInvariantRightText, out ro))
return true;
int comp = ((IComparable)lo).CompareTo((IComparable)ro);
return o.ToString ();
}
- public static PropertyDescriptor GetValidationProperty (object o)
+ public static PropertyDescriptor GetValidationProperty (object component)
{
PropertyDescriptorCollection props;
System.ComponentModel.AttributeCollection col;
- props = TypeDescriptor.GetProperties (o);
- col = TypeDescriptor.GetAttributes (o);
+ props = TypeDescriptor.GetProperties (component);
+ col = TypeDescriptor.GetAttributes (component);
foreach (Attribute at in col) {
ValidationPropertyAttribute vpa = at as ValidationPropertyAttribute;
get { return true; }
}
- protected virtual string FormatDataValue (object value, bool encode)
+ protected virtual string FormatDataValue (object dataValue, bool encode)
{
string res;
bool htmlEncodeFormatString = HtmlEncodeFormatString;
- string stringValue = (value != null) ? value.ToString () : String.Empty;
- if (value == null || (stringValue.Length == 0 && ConvertEmptyStringToNull)) {
+ string stringValue = (dataValue != null) ? dataValue.ToString () : String.Empty;
+ if (dataValue == null || (stringValue.Length == 0 && ConvertEmptyStringToNull)) {
if (NullDisplayText.Length == 0) {
encode = false;
res = " ";
string format = DataFormatString;
if (!String.IsNullOrEmpty (format)) {
if (!encode || htmlEncodeFormatString)
- res = String.Format (format, value);
+ res = String.Format (format, dataValue);
else
res = String.Format (format, encode ? HttpUtility.HtmlEncode (stringValue) : stringValue);
} else
return base.Initialize (sortingEnabled, control);
}
- protected virtual string FormatDataTextValue (object value)
+ protected virtual string FormatDataTextValue (object dataTextValue)
{
if (DataTextFormatString.Length > 0)
- return String.Format (DataTextFormatString, value);
- else if (value == null)
+ return String.Format (DataTextFormatString, dataTextValue);
+ else if (dataTextValue == null)
return String.Empty;
else
- return value.ToString ();
+ return dataTextValue.ToString ();
}
public override void InitializeCell (DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
RaisePostBackEvent (eventArgument);
}
- protected virtual void RaisePostBackEvent (string arg)
+ protected virtual void RaisePostBackEvent (string eventArgument)
{
- ValidateEvent (UniqueID, arg);
- if (arg.Length < 1)
+ ValidateEvent (UniqueID, eventArgument);
+ if (eventArgument.Length < 1)
return;
- if (arg[0] == 'V') { // Goes to Next or Previous month
+ if (eventArgument[0] == 'V') { // Goes to Next or Previous month
DateTime prev = VisibleDate;
- int days = Int32.Parse (arg.Substring (1));
+ int days = Int32.Parse (eventArgument.Substring (1));
DateTime dt = GetGlobalCalendar().AddDays (dateZenith, days);
VisibleDate = dt;
OnVisibleMonthChanged (VisibleDate, prev);
return;
}
- if (arg[0] == 'R') { // Selects a range of dates
+ if (eventArgument[0] == 'R') { // Selects a range of dates
string num, date, days;
- num = arg.Substring (1);
+ num = eventArgument.Substring (1);
days = num.Substring (num.Length - 2, 2);
date = num.Substring (0, num.Length - 2);
DateTime d = GetGlobalCalendar().AddDays (dateZenith, Int32.Parse (date));
}
// Selects a single day
- int daysFromZenith = Int32.Parse (arg);
+ int daysFromZenith = Int32.Parse (eventArgument);
DateTime day = GetGlobalCalendar().AddDays (dateZenith, daysFromZenith);
SelectedDates.SelectRange (day, day);
OnSelectionChanged ();
return false;
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
Page page = Page;
if (page != null) {
if (!RenderingCompatibilityLessThan40)
ControlStyle.PrependCssClass (DisabledCssClass);
else
- w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
need_span = true;
}
if (need_span) {
- AddDisplayStyleAttribute (w);
- ControlStyle.AddAttributesToRender (w, this);
+ AddDisplayStyleAttribute (writer);
+ ControlStyle.AddAttributesToRender (writer, this);
}
string tt = ToolTip;
if (tt != null && tt.Length > 0){
- w.AddAttribute ("title", tt);
+ writer.AddAttribute ("title", tt);
need_span = true;
}
- if (HasAttributes && AddAttributesForSpan (w))
+ if (HasAttributes && AddAttributesForSpan (writer))
need_span = true;
if (need_span)
- w.RenderBeginTag (HtmlTextWriterTag.Span);
+ writer.RenderBeginTag (HtmlTextWriterTag.Span);
TextAlign align = TextAlign;
if (align == TextAlign.Right) {
- RenderInput (w, enabled);
- RenderLabel (w);
+ RenderInput (writer, enabled);
+ RenderLabel (writer);
} else {
- RenderLabel (w);
- RenderInput (w, enabled);
+ RenderLabel (writer);
+ RenderInput (writer, enabled);
}
if (need_span)
- w.RenderEndTag ();
+ writer.RenderEndTag ();
}
void RenderInput (HtmlTextWriter w, bool enabled)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "CompareValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "operator", Operator.ToString ());
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool ControlPropertiesValid ()
base.DataBind();
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
/* make sure all the child controls have been created */
EnsureChildControls ();
/* and then... */
- base.Render (w);
+ base.Render (writer);
}
void ICompositeControlDesignerAccessor.RecreateChildControls ()
return new ControlParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
if (control == null)
return null;
return new CookieParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Request == null)
+ if (context == null || context.Request == null)
return null;
- HttpCookie c = ctx.Request.Cookies [CookieName];
+ HttpCookie c = context.Request.Cookies [CookieName];
if (c == null)
return null;
{
DataControlField containerField;
- public DataControlFieldCell (DataControlField containerField) : this (HtmlTextWriterTag.Td, containerField)
+ public DataControlFieldCell (DataControlField containingField) : this (HtmlTextWriterTag.Td, containingField)
{
}
- protected DataControlFieldCell (HtmlTextWriterTag tagKey, DataControlField containerField) : base (tagKey)
+ protected DataControlFieldCell (HtmlTextWriterTag tagKey, DataControlField containingField) : base (tagKey)
{
- this.containerField = containerField;
+ this.containerField = containingField;
}
public DataControlField ContainingField {
}
[Browsable (false)]
- public DataControlField this [int i] {
- get { return (DataControlField) ((IList)this) [i]; }
+ public DataControlField this [int index] {
+ get { return (DataControlField) ((IList)this) [index]; }
}
protected override void OnInsertComplete (int index, object value)
{
TableHeaderScope scope;
- public DataControlFieldHeaderCell (DataControlField containerField): base (HtmlTextWriterTag.Th, containerField)
+ public DataControlFieldHeaderCell (DataControlField containingField): base (HtmlTextWriterTag.Th, containingField)
{
}
#endregion // IDataItemContainer Properties
#region Public Instance Methods
- protected override bool OnBubbleEvent(object source, EventArgs args)
+ protected override bool OnBubbleEvent(object source, EventArgs e)
{
// Nikhil Kothari, pg 312-313:
- if (args is CommandEventArgs) {
- RaiseBubbleEvent(this, new DataGridCommandEventArgs(this, source, (CommandEventArgs)args));
+ if (e is CommandEventArgs) {
+ RaiseBubbleEvent(this, new DataGridCommandEventArgs(this, source, (CommandEventArgs)e));
return true;
}
- return base.OnBubbleEvent (source, args);
+ return base.OnBubbleEvent (source, e);
}
protected internal virtual void SetItemType(ListItemType itemType)
return true;
}
- protected virtual void LoadViewState (object savedState)
+ protected virtual void LoadViewState (object state)
{
- if (savedState is Pair) {
- Pair p = (Pair) savedState;
+ if (state is Pair) {
+ Pair p = (Pair) state;
object[] akeys = (object[]) p.First;
object[] avals = (object[]) p.Second;
for (int n=0; n<akeys.Length; n++) {
keyTable [akeys[n]] = avals [n];
}
- } else if (savedState is object[]) {
- object[] avals = (object[]) savedState;
+ } else if (state is object[]) {
+ object[] avals = (object[]) state;
for (int n=0; n<avals.Length; n++)
keyTable [keyNames[n]] = avals [n];
}
return style;
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
- PagedDataSource dataSource = new PagedDataSource ();
- dataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? data : null;
- dataSource.AllowPaging = AllowPaging;
- dataSource.PageSize = 1;
- dataSource.CurrentPageIndex = PageIndex;
+ PagedDataSource pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? dataSource : null;
+ pagedDataSource.AllowPaging = AllowPaging;
+ pagedDataSource.PageSize = 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
if (dataBinding && CurrentMode != DetailsViewMode.Insert) {
DataSourceView view = GetData ();
if (view != null && view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
}
- bool showPager = AllowPaging && (dataSource.PageCount > 1);
+ bool showPager = AllowPaging && (pagedDataSource.PageCount > 1);
Controls.Clear ();
table = CreateTable ();
// Gets the current data item
if (AllowPaging) {
- PageCount = dataSource.DataSourceCount;
+ PageCount = pagedDataSource.DataSourceCount;
if (PageIndex >= PageCount && PageCount > 0)
- pageIndex = dataSource.CurrentPageIndex = PageCount - 1;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ pageIndex = pagedDataSource.CurrentPageIndex = PageCount - 1;
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
if (e.MoveNext ())
dataItem = e.Current;
}
} else {
int page = 0;
object lastItem = null;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
for (; e.MoveNext (); page++) {
lastItem = e.Current;
if (page == PageIndex)
if (showPager && PagerSettings.Position == PagerPosition.Top ||
PagerSettings.Position == PagerPosition.TopAndBottom) {
topPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (topPagerRow, dataSource);
+ InitializePager (topPagerRow, pagedDataSource);
table.Rows.Add (topPagerRow);
}
if (showPager && PagerSettings.Position == PagerPosition.Bottom ||
PagerSettings.Position == PagerPosition.TopAndBottom) {
bottomPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (bottomPagerRow, dataSource);
+ InitializePager (bottomPagerRow, pagedDataSource);
table.Rows.Add (bottomPagerRow);
}
}
return rstate;
}
- protected virtual void InitializePager (DetailsViewRow row, PagedDataSource dataSource)
+ protected virtual void InitializePager (DetailsViewRow row, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
cell.ColumnSpan = 2;
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
return dic;
}
- protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includePrimaryKey)
+ protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includeKeys)
{
foreach (DetailsViewRow row in Rows) {
if (row.Cells.Count < 1)
if (c != null)
c.ContainingField.ExtractValuesFromCell (fieldValues, c, row.RowState, includeReadOnlyFields);
}
- if (!includePrimaryKey && DataKeyNames != null)
+ if (!includeKeys && DataKeyNames != null)
foreach (string key in DataKeyNames)
fieldValues.Remove (key);
}
}
}
public
- void SetPageIndex (int newIndex)
+ void SetPageIndex (int index)
{
- DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);
+ DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (index);
OnPageIndexChanging (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
RequireBinding ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null)
+ if (savedState == null)
return;
- object[] state = (object[]) ob;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
pageCount = (int) state[2];
ControlStyle.LoadViewState (states [12]);
}
- void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+ void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
{
- RaiseCallbackEvent (eventArgs);
+ RaiseCallbackEvent (eventArgument);
}
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] clientData = eventArgs.Split ('|');
+ string[] clientData = eventArgument.Split ('|');
PageIndex = int.Parse (clientData[0]);
RaisePostBackEvent (clientData[1]);
IOrderedDictionary keys;
IOrderedDictionary values;
- public DetailsViewDeleteEventArgs (int index)
+ public DetailsViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal DetailsViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
object argument;
IOrderedDictionary values;
- public DetailsViewInsertEventArgs (object argument)
+ public DetailsViewInsertEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal DetailsViewInsertEventArgs (object argument, IOrderedDictionary values)
this.rows = rows;
}
- public DetailsViewRow this [int i] {
- get { return (DetailsViewRow) rows [i]; }
+ public DetailsViewRow this [int index] {
+ get { return (DetailsViewRow) rows [index]; }
}
public void CopyTo (DetailsViewRow[] array, int index)
IOrderedDictionary newValues;
IOrderedDictionary oldValues;
- public DetailsViewUpdateEventArgs (object argument)
+ public DetailsViewUpdateEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal DetailsViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
return new FontUnit (n);
}
- public string ToString (IFormatProvider fmt)
+ public string ToString (IFormatProvider formatProvider)
{
if (type == FontSize.NotSet)
return String.Empty;
else if (type == FontSize.AsUnit)
- return unit.ToString (fmt);
+ return unit.ToString (formatProvider);
else
return font_size_names [(int) type];
}
return new FormParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- HttpRequest req = ctx != null ? ctx.Request : null;
+ HttpRequest req = context != null ? context.Request : null;
if (req == null)
return null;
return arg;
}
- protected virtual FormViewRow CreateRow (int rowIndex, DataControlRowType rowType, DataControlRowState rowState)
+ protected virtual FormViewRow CreateRow (int itemIndex, DataControlRowType rowType, DataControlRowState rowState)
{
if (rowType == DataControlRowType.Pager)
- return new FormViewPagerRow (rowIndex, rowType, rowState);
+ return new FormViewPagerRow (itemIndex, rowType, rowState);
else
- return new FormViewRow (rowIndex, rowType, rowState);
+ return new FormViewRow (itemIndex, rowType, rowState);
}
void RequireBinding ()
return style;
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
- PagedDataSource dataSource = new PagedDataSource ();
- dataSource.DataSource = CurrentMode != FormViewMode.Insert ? data : null;
- dataSource.AllowPaging = AllowPaging;
- dataSource.PageSize = 1;
- dataSource.CurrentPageIndex = PageIndex;
+ PagedDataSource pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = CurrentMode != FormViewMode.Insert ? dataSource : null;
+ pagedDataSource.AllowPaging = AllowPaging;
+ pagedDataSource.PageSize = 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
if (dataBinding && CurrentMode != FormViewMode.Insert) {
DataSourceView view = GetData ();
if (view != null && view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
}
PagerSettings pagerSettings = PagerSettings;
- bool showPager = AllowPaging && pagerSettings.Visible && (dataSource.PageCount > 1);
+ bool showPager = AllowPaging && pagerSettings.Visible && (pagedDataSource.PageCount > 1);
Controls.Clear ();
table = CreateTable ();
// Gets the current data item
if (AllowPaging) {
- PageCount = dataSource.DataSourceCount;
+ PageCount = pagedDataSource.DataSourceCount;
if (PageIndex >= PageCount && PageCount > 0)
- pageIndex = dataSource.CurrentPageIndex = PageCount - 1;
+ pageIndex = pagedDataSource.CurrentPageIndex = PageCount - 1;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
if (e.MoveNext ())
dataItem = e.Current;
}
} else {
int page = 0;
object lastItem = null;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
for (; e.MoveNext (); page++) {
lastItem = e.Current;
if (page == PageIndex)
if (showPager && pagerSettings.Position == PagerPosition.Top || pagerSettings.Position == PagerPosition.TopAndBottom) {
topPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (topPagerRow, dataSource);
+ InitializePager (topPagerRow, pagedDataSource);
table.Rows.Add (topPagerRow);
}
if (showPager && pagerSettings.Position == PagerPosition.Bottom || pagerSettings.Position == PagerPosition.TopAndBottom) {
bottomPagerRow = CreateRow (0, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (bottomPagerRow, dataSource);
+ InitializePager (bottomPagerRow, pagedDataSource);
table.Rows.Add (bottomPagerRow);
}
return rstate;
}
- protected virtual void InitializePager (FormViewRow row, PagedDataSource dataSource)
+ protected virtual void InitializePager (FormViewRow row, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
cell.ColumnSpan = 2;
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
RequireBinding ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
+ if (savedState == null) return;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
pageCount = (int) state[2];
{
object source;
- public FormViewCommandEventArgs (object source, CommandEventArgs arguments) : base (arguments)
+ public FormViewCommandEventArgs (object commandSource, CommandEventArgs originalArgs) : base (originalArgs)
{
- this.source = source;
+ this.source = commandSource;
}
public object CommandSource {
IOrderedDictionary keys;
IOrderedDictionary values;
- public FormViewDeleteEventArgs (int index)
+ public FormViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal FormViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
object argument;
IOrderedDictionary values;
- public FormViewInsertEventArgs (object argument)
+ public FormViewInsertEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal FormViewInsertEventArgs (object argument, IOrderedDictionary values)
get;
set;
}
- public FormViewRow (int rowIndex, DataControlRowType rowType, DataControlRowState rowState)
+ public FormViewRow (int itemIndex, DataControlRowType rowType, DataControlRowState rowState)
{
- this.rowIndex = rowIndex;
+ this.rowIndex = itemIndex;
this.rowType = rowType;
this.rowState = rowState;
}
IOrderedDictionary oldValues;
IOrderedDictionary newValues;
- public FormViewUpdateEventArgs (object argument)
+ public FormViewUpdateEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal FormViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
}
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
// clear GridView
Controls.Clear ();
table = null;
rows = null;
- if (data == null)
+ if (dataSource == null)
return 0;
- PagedDataSource dataSource;
+ PagedDataSource pagedDataSource;
if (dataBinding) {
DataSourceView view = GetData ();
- dataSource = new PagedDataSource ();
- dataSource.DataSource = data;
+ pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = dataSource;
if (AllowPaging) {
- dataSource.AllowPaging = true;
- dataSource.PageSize = PageSize;
+ pagedDataSource.AllowPaging = true;
+ pagedDataSource.PageSize = PageSize;
if (view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
- if (PageIndex >= dataSource.PageCount)
- pageIndex = dataSource.PageCount - 1;
- dataSource.CurrentPageIndex = PageIndex;
+ if (PageIndex >= pagedDataSource.PageCount)
+ pageIndex = pagedDataSource.PageCount - 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
}
- PageCount = dataSource.PageCount;
+ PageCount = pagedDataSource.PageCount;
} else {
- dataSource = new PagedDataSource ();
- dataSource.DataSource = data;
+ pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = dataSource;
if (AllowPaging) {
- dataSource.AllowPaging = true;
- dataSource.PageSize = PageSize;
- dataSource.CurrentPageIndex = PageIndex;
+ pagedDataSource.AllowPaging = true;
+ pagedDataSource.PageSize = PageSize;
+ pagedDataSource.CurrentPageIndex = PageIndex;
}
}
// Creates the set of fields to show
_dataEnumerator = null;
- ICollection fieldCollection = CreateColumns (dataSource, dataBinding);
+ ICollection fieldCollection = CreateColumns (pagedDataSource, dataBinding);
int fieldCount = fieldCollection.Count;
DataControlField dcf;
DataControlField[] fields = new DataControlField [fieldCount];
enumerator = _dataEnumerator;
skip_first = true;
} else
- enumerator = dataSource.GetEnumerator ();
+ enumerator = pagedDataSource.GetEnumerator ();
// Main table creation
Table mainTable = ContainedTable;
if (list.Count == 0) {
if (createPager && (PagerSettings.Position == PagerPosition.Top || PagerSettings.Position == PagerPosition.TopAndBottom)) {
- topPagerRow = CreatePagerRow (fieldCount, dataSource);
+ topPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
OnRowCreated (new GridViewRowEventArgs (topPagerRow));
mainTable.Rows.Add (topPagerRow);
if (dataBinding) {
}
if (createPager && (PagerSettings.Position == PagerPosition.Bottom || PagerSettings.Position == PagerPosition.TopAndBottom)) {
- bottomPagerRow = CreatePagerRow (fieldCount, dataSource);
+ bottomPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
OnRowCreated (new GridViewRowEventArgs (bottomPagerRow));
mainTable.Rows.Add (bottomPagerRow);
if (dataBinding) {
return -1;
if (AllowPaging)
- return dataSource.DataSourceCount;
+ return pagedDataSource.DataSourceCount;
else
return list.Count;
}
return row;
}
- protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource dataSource)
+ protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
if (columnSpan > 1)
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
Sort (newSortExpression, newDirection);
}
- public virtual void Sort (string newSortExpression, SortDirection newSortDirection)
+ public virtual void Sort (string sortExpression, SortDirection sortDirection)
{
- GridViewSortEventArgs args = new GridViewSortEventArgs (newSortExpression, newSortDirection);
+ GridViewSortEventArgs args = new GridViewSortEventArgs (sortExpression, sortDirection);
OnSorting (args);
if (args.Cancel)
return;
OnSorted (EventArgs.Empty);
}
public
- void SelectRow (int index)
+ void SelectRow (int rowIndex)
{
- GridViewSelectEventArgs args = new GridViewSelectEventArgs (index);
+ GridViewSelectEventArgs args = new GridViewSelectEventArgs (rowIndex);
OnSelectedIndexChanging (args);
if (!args.Cancel) {
RequireBinding ();
}
}
public
- void SetPageIndex (int newIndex)
+ void SetPageIndex (int rowIndex)
{
- GridViewPageEventArgs args = new GridViewPageEventArgs (newIndex);
+ GridViewPageEventArgs args = new GridViewPageEventArgs (rowIndex);
OnPageIndexChanging (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
OnPageIndexChanged (EventArgs.Empty);
}
public
- void SetEditRow (int index)
+ void SetEditRow (int rowIndex)
{
- GridViewEditEventArgs args = new GridViewEditEventArgs (index);
+ GridViewEditEventArgs args = new GridViewEditEventArgs (rowIndex);
OnRowEditing (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
currentEditNewValues = null;
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null)
+ if (savedState == null)
return;
- object[] state = (object[]) ob;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
selectedIndex = (int) state[2];
((IStateManager)sortedDescendingHeaderStyle).LoadViewState (states [15]);
}
- void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+ void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
{
- RaiseCallbackEvent (eventArgs);
+ RaiseCallbackEvent (eventArgument);
}
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] clientData = eventArgs.Split ('|');
+ string[] clientData = eventArgument.Split ('|');
PageIndex = int.Parse (clientData[0]);
SortExpression = HttpUtility.UrlDecode (clientData [1]);
SortDirection = (SortDirection) int.Parse (clientData [2]);
return sw.ToString ();
}
- string ICallbackContainer.GetCallbackScript (IButtonControl control, string argument)
+ string ICallbackContainer.GetCallbackScript (IButtonControl buttonControl, string argument)
{
- return GetCallbackScript (control, argument);
+ return GetCallbackScript (buttonControl, argument);
}
- protected virtual string GetCallbackScript (IButtonControl control, string argument)
+ protected virtual string GetCallbackScript (IButtonControl buttonControl, string argument)
{
if (EnableSortingAndPagingCallbacks) {
Page page = Page;
if (page != null)
page.ClientScript.RegisterForEventValidation (UniqueID, argument);
- return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + control.CommandName + "$" + control.CommandArgument + "\"); return false;";
+ return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + buttonControl.CommandName + "$" + buttonControl.CommandArgument + "\"); return false;";
} else
return null;
}
IOrderedDictionary keys;
IOrderedDictionary values;
- public GridViewDeleteEventArgs (int index)
+ public GridViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal GridViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
this.rows = rows;
}
- public GridViewRow this [int i] {
- get { return (GridViewRow) rows [i]; }
+ public GridViewRow this [int index] {
+ get { return (GridViewRow) rows [index]; }
}
public void CopyTo (GridViewRow[] array, int index)
typeof (RectangleHotSpot)
};
- public HotSpot this [int idx] {
- get { return (HotSpot) ((IList)this)[idx]; }
+ public HotSpot this [int index] {
+ get { return (HotSpot) ((IList)this)[index]; }
}
public int Add (HotSpot spot)
return ((IList)this).Add (spot);
}
- protected override object CreateKnownType (int idx)
+ protected override object CreateKnownType (int index)
{
- switch (idx) {
+ switch (index) {
case 0:
return new CircleHotSpot ();
case 1:
return _knownTypes;
}
- public void Insert (int idx, HotSpot spot)
+ public void Insert (int index, HotSpot spot)
{
- ((IList)this).Insert (idx, spot);
+ ((IList)this).Insert (index, spot);
}
protected override void OnValidate (object o)
((IList)this).Remove (spot);
}
- public void RemoveAt (int idx)
+ public void RemoveAt (int index)
{
- ((IList)this).RemoveAt (idx);
+ ((IList)this).RemoveAt (index);
}
protected override void SetDirtyObject (object o)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
- AddDisplayStyleAttribute (w);
+ base.AddAttributesToRender (writer);
+ AddDisplayStyleAttribute (writer);
if (!IsEnabled)
return;
// add attributes - only if they're not empty
string t = Target;
string s = NavigateUrl;
if (s.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Href, ResolveClientUrl (s));
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, ResolveClientUrl (s));
if (t.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Target, t);
+ writer.AddAttribute (HtmlTextWriterAttribute.Target, t);
}
protected override void AddParsedSubObject (object obj)
base.LoadViewState (savedState);
}
- protected internal override void RenderContents (HtmlTextWriter w)
+ protected internal override void RenderContents (HtmlTextWriter writer)
{
if (HasControls () || HasRenderMethodDelegate ()) {
- base.RenderContents (w);
+ base.RenderContents (writer);
return;
}
string image_url = ImageUrl;
if (!String.IsNullOrEmpty (image_url)) {
string str = ToolTip;
if (!String.IsNullOrEmpty (str))
- w.AddAttribute (HtmlTextWriterAttribute.Title, str);
+ writer.AddAttribute (HtmlTextWriterAttribute.Title, str);
- w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveClientUrl (image_url));
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, ResolveClientUrl (image_url));
str = Text;
- w.AddAttribute (HtmlTextWriterAttribute.Alt, str);
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag ();
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, str);
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag ();
} else
- w.Write (Text);
+ writer.Write (Text);
}
[Bindable(true)]
set { ViewState ["Text"] = value; }
}
- protected virtual string FormatDataNavigateUrlValue (object value)
+ protected virtual string FormatDataNavigateUrlValue (object dataUrlValue)
{
string format = DataNavigateUrlFormatString;
if (format == "")
format = null;
- return DataBinder.FormatResult (value, format);
+ return DataBinder.FormatResult (dataUrlValue, format);
}
- protected virtual string FormatDataTextValue (object value)
+ protected virtual string FormatDataTextValue (object dataTextValue)
{
string format = DataTextFormatString;
if (format == "")
format = null;
- return DataBinder.FormatResult (value, format);
+ return DataBinder.FormatResult (dataTextValue, format);
}
public override void Initialize ()
ctrl.Target = Target;
}
- public override void InitializeCell (TableCell cell, int column_index, ListItemType item_type)
+ public override void InitializeCell (TableCell cell, int columnIndex, ListItemType itemType)
{
- base.InitializeCell (cell, column_index, item_type);
+ base.InitializeCell (cell, columnIndex, itemType);
- switch (item_type)
+ switch (itemType)
{
case ListItemType.Separator:
case ListItemType.Pager:
PropertyDescriptor[] urlProperties;
static string[] emptyFields;
- public override bool Initialize (bool sortingEnabled, Control control)
+ public override bool Initialize (bool enableSorting, Control control)
{
- return base.Initialize (sortingEnabled, control);
+ return base.Initialize (enableSorting, control);
}
[EditorAttribute ("System.Web.UI.Design.WebControls.DataFieldEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
PropertyDescriptor imageProperty;
PropertyDescriptor textProperty;
- public override bool Initialize (bool sortingEnabled, Control control)
+ public override bool Initialize (bool enableSorting, Control control)
{
- return base.Initialize (sortingEnabled, control);
+ return base.Initialize (enableSorting, control);
}
[DefaultValueAttribute ("")]
}
}
- protected virtual string FormatImageUrlValue (object value)
+ protected virtual string FormatImageUrlValue (object dataValue)
{
- if (value == null)
+ if (dataValue == null)
return null;
else if (DataImageUrlFormatString.Length > 0)
- return string.Format (DataImageUrlFormatString, value);
+ return string.Format (DataImageUrlFormatString, dataValue);
else
- return value.ToString ();
+ return dataValue.ToString ();
}
protected virtual string GetFormattedAlternateText (Control controlContainer)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
page.VerifyRenderingInServerForm (this);
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
bool enabled = IsEnabled;
string onclick = OnClientClick;
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick);
}
if (onclick.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
+ writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
if (enabled && page != null) {
PostBackOptions options = GetPostBackOptions ();
string href = page.ClientScript.GetPostBackEventReference (options, true);
- w.AddAttribute (HtmlTextWriterAttribute.Href, href);
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, href);
}
- AddDisplayStyleAttribute (w);
+ AddDisplayStyleAttribute (writer);
}
protected virtual void RaisePostBackEvent (string eventArgument)
}
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
public virtual void ClearSelection ()
{
}
- public static ListItem FromString (string text)
+ public static ListItem FromString (string s)
{
- return new ListItem (text);
+ return new ListItem (s);
}
public override bool Equals (object o)
}
protected internal
- override void Render (HtmlTextWriter output)
+ override void Render (HtmlTextWriter writer)
{
if (Mode == LiteralMode.Encode)
- output.Write (HttpUtility.HtmlEncode (Text));
+ writer.Write (HttpUtility.HtmlEncode (Text));
else
- output.Write (Text);
+ writer.Write (Text);
}
}
}
return null;
}
- protected override void LoadViewState (object savedState)
+ protected override void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object [] states = (object []) savedState;
+ object [] states = (object []) state;
base.LoadViewState (states[0]);
if (states[1] != null)
base.OnInit (e);
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
+ if (savedState == null) return;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
selectedItemPath = state[1] as string;
}
base.DataBind ();
}
- protected override bool OnBubbleEvent (object source, EventArgs args)
+ protected override bool OnBubbleEvent (object source, EventArgs e)
{
- if (!(args is CommandEventArgs))
+ if (!(e is CommandEventArgs))
return false;
- MenuEventArgs menuArgs = args as MenuEventArgs;
+ MenuEventArgs menuArgs = e as MenuEventArgs;
if (menuArgs != null && string.Equals (menuArgs.CommandName, MenuItemClickCommandName))
OnMenuItemClick (menuArgs);
return true;
return types;
}
- public int IndexOf (MenuItemBinding binding)
+ public int IndexOf (MenuItemBinding value)
{
- return ((IList)this).IndexOf (binding);
+ return ((IList)this).IndexOf (value);
}
public void Insert (int index, MenuItemBinding binding)
item.Menu = menu;
}
- public MenuItem this [int i] {
- get { return (MenuItem) items [i]; }
+ public MenuItem this [int index] {
+ get { return (MenuItem) items [index]; }
}
public void Add (MenuItem child)
}
}
- public bool Contains (MenuItem child)
+ public bool Contains (MenuItem c)
{
- return items.Contains (child);
+ return items.Contains (c);
}
- public void CopyTo (Array itemArray, int index)
+ public void CopyTo (Array array, int index)
{
- items.CopyTo (itemArray, index);
+ items.CopyTo (array, index);
}
- public void CopyTo (MenuItem[] itemArray, int index)
+ public void CopyTo (MenuItem[] array, int index)
{
- items.CopyTo (itemArray, index);
+ items.CopyTo (array, index);
}
public IEnumerator GetEnumerator ()
return items.GetEnumerator ();
}
- public int IndexOf (MenuItem item)
+ public int IndexOf (MenuItem value)
{
- return items.IndexOf (item);
+ return items.IndexOf (value);
}
- public void Remove (MenuItem item)
+ public void Remove (MenuItem value)
{
- int i = IndexOf (item);
+ int i = IndexOf (value);
if (i == -1) return;
items.RemoveAt (i);
if (menu != null)
- item.Menu = null;
+ value.Menu = null;
if (marked) {
SetDirty ();
}
return ((IList)this).Contains (style);
}
- public void CopyTo (MenuItemStyle[] array, int index)
+ public void CopyTo (MenuItemStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
object dataItem;
int index;
- public MenuItemTemplateContainer (int itemIndex, MenuItem menuItem)
+ public MenuItemTemplateContainer (int itemIndex, MenuItem dataItem)
{
- index = itemIndex;
- dataItem = menuItem;
+ this.index = itemIndex;
+ this.dataItem = dataItem;
}
- protected override bool OnBubbleEvent (object source, EventArgs args)
+ protected override bool OnBubbleEvent (object source, EventArgs e)
{
- CommandEventArgs command = args as CommandEventArgs;
+ CommandEventArgs command = e as CommandEventArgs;
if (command == null)
return false;
remove { Events.RemoveHandler (ActiveViewChangedEvent, value); }
}
- protected override void AddParsedSubObject (object ob)
+ protected override void AddParsedSubObject (object obj)
{
- if (ob is View)
- Controls.Add (ob as View);
+ if (obj is View)
+ Controls.Add (obj as View);
// LAMESPEC: msdn talks that only View contorls are allowed, for others controls HttpException should be thrown
// but actually, aspx praser adds LiteralControl controls.
//else
return source.GetEnumerator ();
}
- public PropertyDescriptorCollection GetItemProperties (PropertyDescriptor [] list_accessors)
+ public PropertyDescriptorCollection GetItemProperties (PropertyDescriptor [] listAccessors)
{
ITypedList typed = source as ITypedList;
if (typed == null)
return null;
- return typed.GetItemProperties (list_accessors);
+ return typed.GetItemProperties (listAccessors);
}
- public string GetListName (PropertyDescriptor [] list_accessors)
+ public string GetListName (PropertyDescriptor [] listAccessors)
{
return String.Empty; // as documented
}
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
string image = BackImageUrl;
if (image != "") {
image = ResolveClientUrl (image);
- w.AddStyleAttribute (HtmlTextWriterStyle.BackgroundImage, image);
+ writer.AddStyleAttribute (HtmlTextWriterStyle.BackgroundImage, image);
}
if (!String.IsNullOrEmpty (DefaultButton) && Page != null) {
Page.ClientScript.RegisterWebFormClientScript ();
- w.AddAttribute ("onkeypress",
+ writer.AddAttribute ("onkeypress",
"javascript:return " + Page.WebFormScriptReference + ".WebForm_FireDefaultButton(event, '" + button.ClientID + "')");
}
if (Direction != ContentDirection.NotSet) {
- w.AddAttribute (HtmlTextWriterAttribute.Dir, Direction == ContentDirection.RightToLeft ? "rtl" : "ltr", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Dir, Direction == ContentDirection.RightToLeft ? "rtl" : "ltr", false);
}
switch (ScrollBars) {
case ScrollBars.Auto:
- w.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "auto");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "auto");
break;
case ScrollBars.Both:
- w.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "scroll");
break;
case ScrollBars.Horizontal:
- w.AddStyleAttribute (HtmlTextWriterStyle.OverflowX, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.OverflowX, "scroll");
break;
case ScrollBars.Vertical:
- w.AddStyleAttribute (HtmlTextWriterStyle.OverflowY, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.OverflowY, "scroll");
break;
}
if (!Wrap) {
- w.AddStyleAttribute (HtmlTextWriterStyle.WhiteSpace, "nowrap");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.WhiteSpace, "nowrap");
}
string align = "";
}
if (align != "")
- w.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, align);
+ writer.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, align);
}
PanelStyle PanelStyle {
get { return (ControlStyle as PanelStyle); }
EventHandler _parametersChanged;
- public int Add (Parameter param)
+ public int Add (Parameter parameter)
{
- return ((IList)this).Add (param);
+ return ((IList)this).Add (parameter);
}
public int Add (string name, string value)
return ((IList)this).Add (new Parameter (name, dbType, value));
}
- protected override object CreateKnownType (int idx)
+ protected override object CreateKnownType (int index)
{
- switch (idx) {
+ switch (index) {
case 0:
return new ControlParameter ();
case 1:
param.UpdateValue (context, control);
}
- public void Insert (int idx, Parameter param)
+ public void Insert (int index, Parameter parameter)
{
- ((IList)this).Insert (idx, param);
+ ((IList)this).Insert (index, parameter);
}
protected override void OnClearComplete ()
OnParametersChanged (EventArgs.Empty);
}
- protected override void OnInsert (int idx, object value)
+ protected override void OnInsert (int index, object value)
{
- base.OnInsert (idx, value);
+ base.OnInsert (index, value);
((Parameter)value).SetOwnerCollection (this);
}
- protected override void OnInsertComplete (int idx, object value)
+ protected override void OnInsertComplete (int index, object value)
{
- base.OnInsertComplete (idx, value);
+ base.OnInsertComplete (index, value);
OnParametersChanged (EventArgs.Empty);
}
throw new ArgumentException ("o is not a Parameter");
}
- public void Remove (Parameter param)
+ public void Remove (Parameter parameter)
{
- ((IList)this).Remove (param);
+ ((IList)this).Remove (parameter);
}
- public void RemoveAt (int idx)
+ public void RemoveAt (int index)
{
- ((IList)this).RemoveAt (idx);
+ ((IList)this).RemoveAt (index);
}
protected override void SetDirtyObject (object o)
return -1;
}
- public Parameter this[int idx] {
+ public Parameter this[int index] {
get {
- return (Parameter) ((IList)this)[idx];
+ return (Parameter) ((IList)this)[index];
}
set {
- ((IList)this)[idx] = value;
+ ((IList)this)[index] = value;
}
}
remove { _parametersChanged -= value; }
}
- public bool Contains (Parameter param)
+ public bool Contains (Parameter parameter)
{
- return ((IList)this).Contains (param);
+ return ((IList)this).Contains (parameter);
}
- public void CopyTo (Parameter[] paramArray, int index)
+ public void CopyTo (Parameter[] parameterArray, int index)
{
- ((IList)this).CopyTo (paramArray, index);
+ ((IList)this).CopyTo (parameterArray, index);
}
- public int IndexOf (Parameter param)
+ public int IndexOf (Parameter parameter)
{
- return ((IList)this).IndexOf (param);
+ return ((IList)this).IndexOf (parameter);
}
protected override void OnRemoveComplete (int index, object value)
return new QueryStringParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Request == null)
+ if (context == null || context.Request == null)
return null;
- return ctx.Request.QueryString [QueryStringField];
+ return context.Request.QueryString [QueryStringField];
}
[DefaultValueAttribute ("")]
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "RegularExpressionValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "validationexpression", ValidationExpression, true);
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool EvaluateIsValid ()
public sealed class RepeatInfo {
// What is baseControl for ?
- public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
+ public void RenderRepeater (HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
PrintValues (user);
RepeatLayout layout = RepeatLayout;
}
if (RepeatDirection == RepeatDirection.Vertical) {
if (listLayout)
- RenderList (w, user, controlStyle, baseControl);
+ RenderList (writer, user, controlStyle, baseControl);
else
- RenderVert (w, user, controlStyle, baseControl);
+ RenderVert (writer, user, controlStyle, baseControl);
} else {
if (listLayout)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts only support vertical layout.");
- RenderHoriz (w, user, controlStyle, baseControl);
+ RenderHoriz (writer, user, controlStyle, baseControl);
}
}
// attributes
[ToolboxData ("<{0}:RequiredFieldValidator runat=\"server\" ErrorMessage=\"RequiredFieldValidator\"></{0}:RequiredFieldValidator>")]
public class RequiredFieldValidator : BaseValidator {
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "RequiredFieldValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "initialvalue", InitialValue, true);
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool EvaluateIsValid ()
string value;
bool is_valid;
- public ServerValidateEventArgs (string value, bool is_valid)
+ public ServerValidateEventArgs (string value, bool isValid)
{
this.value = value;
- this.is_valid = is_valid;
+ this.is_valid = isValid;
}
public string Value {
return new SessionParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Session == null)
+ if (context == null || context.Session == null)
return null;
- return ctx.Session [SessionField];
+ return context.Session [SessionField];
}
[DefaultValueAttribute ("")]
{
SiteMapNodeCollection collection;
- public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNode node)
- : this (owner, viewName, new SiteMapNodeCollection (node))
+ public SiteMapDataSourceView (SiteMapDataSource owner, string name, SiteMapNode node)
+ : this (owner, name, new SiteMapNodeCollection (node))
{
}
- public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNodeCollection collection)
- : base (owner, viewName)
+ public SiteMapDataSourceView (SiteMapDataSource owner, string name, SiteMapNodeCollection collection)
+ : base (owner, name)
{
this.collection = collection;
}
}
[MonoTODO ("why override?")]
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
- base.Render (w);
+ base.Render (writer);
}
- protected internal override void RenderContents (HtmlTextWriter w)
+ protected internal override void RenderContents (HtmlTextWriter writer)
{
string skip_id = ClientID + "_SkipLink";
string altText = SkipLinkText;
if (needAnchor) {
// Anchor start
- w.AddAttribute (HtmlTextWriterAttribute.Href, "#" + skip_id);
- w.RenderBeginTag (HtmlTextWriterTag.A);
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, "#" + skip_id);
+ writer.RenderBeginTag (HtmlTextWriterTag.A);
// Image
- w.AddAttribute (HtmlTextWriterAttribute.Alt, altText);
- w.AddAttribute (HtmlTextWriterAttribute.Height, "0");
- w.AddAttribute (HtmlTextWriterAttribute.Width, "0");
- w.AddAttribute (HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif"));
- w.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag ();
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, altText);
+ writer.AddAttribute (HtmlTextWriterAttribute.Height, "0");
+ writer.AddAttribute (HtmlTextWriterAttribute.Width, "0");
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif"));
+ writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag ();
- w.RenderEndTag ();
+ writer.RenderEndTag ();
}
- base.RenderContents (w);
+ base.RenderContents (writer);
if (needAnchor) {
- w.AddAttribute(HtmlTextWriterAttribute.Id, skip_id);
- w.RenderBeginTag(HtmlTextWriterTag.A);
- w.RenderEndTag();
+ writer.AddAttribute(HtmlTextWriterAttribute.Id, skip_id);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.RenderEndTag();
}
}
return View.Delete (null, null);
}
- public IEnumerable Select (DataSourceSelectArguments args)
+ public IEnumerable Select (DataSourceSelectArguments arguments)
{
- return View.Select (args);
+ return View.Select (arguments);
}
public int Update ()
registered_class = name;
}
- public CssStyleCollection GetStyleAttributes (IUrlResolutionService resolver)
+ public CssStyleCollection GetStyleAttributes (IUrlResolutionService urlResolver)
{
CssStyleCollection col = new CssStyleCollection ();
- FillStyleAttributes (col, resolver);
+ FillStyleAttributes (col, urlResolver);
return col;
}
return ((IList)this).Contains (style);
}
- public void CopyTo (SubMenuStyle[] array, int index)
+ public void CopyTo (SubMenuStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
"search"
};
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
switch (TextMode) {
case TextBoxMode.MultiLine:
if (Columns != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Cols, Columns.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Cols, Columns.ToString (), false);
else
- w.AddAttribute (HtmlTextWriterAttribute.Cols, "20", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Cols, "20", false);
if (Rows != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Rows, Rows.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Rows, Rows.ToString (), false);
else
- w.AddAttribute (HtmlTextWriterAttribute.Rows, "2", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Rows, "2", false);
if (!Wrap)
- w.AddAttribute (HtmlTextWriterAttribute.Wrap, "off", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Wrap, "off", false);
break;
case TextBoxMode.Password:
if (TextMode == TextBoxMode.Password)
- w.AddAttribute (HtmlTextWriterAttribute.Type, "password", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Type, "password", false);
else {
- w.AddAttribute (HtmlTextWriterAttribute.Type, "text", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Type, "text", false);
if (Text.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Value, Text);
+ writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
}
if (Columns != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Size, Columns.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Size, Columns.ToString (), false);
if (MaxLength != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Maxlength, MaxLength.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Maxlength, MaxLength.ToString (), false);
if (AutoCompleteType != AutoCompleteType.None && TextMode == TextBoxMode.SingleLine)
if (AutoCompleteType != AutoCompleteType.Disabled)
- w.AddAttribute (HtmlTextWriterAttribute.VCardName, VCardValues [(int) AutoCompleteType]);
+ writer.AddAttribute (HtmlTextWriterAttribute.VCardName, VCardValues [(int) AutoCompleteType]);
else
- w.AddAttribute (HtmlTextWriterAttribute.AutoComplete, "off", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.AutoComplete, "off", false);
break;
}
if (AutoPostBack) {
- w.AddAttribute ("onkeypress", "if (WebForm_TextBoxKeyHandler(event) == false) return false;", false);
+ writer.AddAttribute ("onkeypress", "if (WebForm_TextBoxKeyHandler(event) == false) return false;", false);
if (page != null) {
string onchange = page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true);
onchange = String.Concat ("setTimeout('", onchange.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)");
- w.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange));
+ writer.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange));
}
} else if (page != null)
page.ClientScript.RegisterForEventValidation (UniqueID, String.Empty);
if (ReadOnly)
- w.AddAttribute (HtmlTextWriterAttribute.ReadOnly, "ReadOnly", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.ReadOnly, "ReadOnly", false);
- w.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
+ writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override void AddParsedSubObject (object obj)
}
protected internal
- override void Render (HtmlTextWriter w)
+ override void Render (HtmlTextWriter writer)
{
// Why didn't msft just override RenderContents!?
- RenderBeginTag (w);
+ RenderBeginTag (writer);
if (TextMode == TextBoxMode.MultiLine) {
- w.WriteLine ();
- HttpUtility.HtmlEncode (Text, w);
+ writer.WriteLine ();
+ HttpUtility.HtmlEncode (Text, writer);
}
- RenderEndTag (w);
+ RenderEndTag (writer);
}
protected virtual
Expanded = !Expanded.GetValueOrDefault(false);
}
- void IStateManager.LoadViewState (object savedState)
+ void IStateManager.LoadViewState (object state)
{
- LoadViewState (savedState);
+ LoadViewState (state);
}
- protected virtual void LoadViewState (object savedState)
+ protected virtual void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object[] states = (object[]) savedState;
+ object[] states = (object[]) state;
ViewState.LoadViewState (states [0]);
if (tree != null && SelectedFlag)
return ((IList)this).Contains (binding);
}
- public void CopyTo (TreeNodeBinding[] array, int index)
+ public void CopyTo (TreeNodeBinding[] bindingArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (bindingArray, index);
}
protected override object CreateKnownType (int index)
node.Tree = tree;
}
- public TreeNode this [int i] {
- get { return (TreeNode) items [i]; }
+ public TreeNode this [int index] {
+ get { return (TreeNode) items [index]; }
}
public void Add (TreeNode child)
}
}
- public bool Contains (TreeNode child)
+ public bool Contains (TreeNode c)
{
- return items.Contains (child);
+ return items.Contains (c);
}
public void CopyTo (TreeNode[] nodeArray, int index)
return items.GetEnumerator ();
}
- public int IndexOf (TreeNode node)
+ public int IndexOf (TreeNode value)
{
- return items.IndexOf (node);
+ return items.IndexOf (value);
}
- public void Remove (TreeNode node)
+ public void Remove (TreeNode value)
{
- int i = IndexOf (node);
+ int i = IndexOf (value);
if (i == -1) return;
items.RemoveAt (i);
if (tree != null)
- node.Tree = null;
+ value.Tree = null;
if (marked) {
SetDirty ();
}
return ((IList)this).Contains (style);
}
- public void CopyTo (TreeNodeStyle[] array, int index)
+ public void CopyTo (TreeNodeStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
return null;
}
- protected override void LoadViewState (object savedState)
+ protected override void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object [] states = (object []) savedState;
+ object [] states = (object []) state;
base.LoadViewState (states[0]);
if (states[1] != null)
}
string callbackResult;
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] args = eventArgs.Split ('|');
+ string[] args = eventArgument.Split ('|');
RequiresDataBinding = true;
EnsureDataBound ();
return ToString (Helpers.InvariantCulture);
}
- public string ToString (IFormatProvider provider)
+ public string ToString (IFormatProvider formatProvider)
{
if (type == 0)
return String.Empty;
string ex = GetExtension (type);
- return value.ToString (provider) + ex;
+ return value.ToString (formatProvider) + ex;
}
}
throw new NotImplementedException ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object state)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
- base.LoadControlState (state[0]);
- activeStepIndex = (int) state[1];
- history = (ArrayList) state[2];
+ if (state == null) return;
+ object[] controlState = (object[]) state;
+ base.LoadControlState (controlState[0]);
+ activeStepIndex = (int) controlState[1];
+ history = (ArrayList) controlState[2];
}
protected internal override object SaveControlState ()
int nxtStepIndex;
bool cancel;
- public WizardNavigationEventArgs (int currentIndex, int nextIndex)
+ public WizardNavigationEventArgs (int currentStepIndex, int nextStepIndex)
{
- this.curStepIndex = currentIndex;
- this.nxtStepIndex = nextIndex;
+ this.curStepIndex = currentStepIndex;
+ this.nxtStepIndex = nextStepIndex;
cancel = false;
}
//
namespace System.Web.UI.WebControls {
- public delegate void WizardNavigationEventHandler (object source, WizardNavigationEventArgs e);
+ public delegate void WizardNavigationEventHandler (object sender, WizardNavigationEventArgs e);
}
this.bag = bag;
}
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- AttributeCollection other = obj as AttributeCollection;
+ AttributeCollection other = o as AttributeCollection;
if (other == null) {
return false;
}
return (bool) attr_render [null];
}
- protected override bool OnStyleAttributeRender (string styleAttrName, string value, HtmlTextWriterStyle key)
+ protected override bool OnStyleAttributeRender (string name, string value, HtmlTextWriterStyle key)
{
return key == HtmlTextWriterStyle.Display;
}
- protected override bool OnTagRender (string name, HtmlTextWriterTag tag)
+ protected override bool OnTagRender (string name, HtmlTextWriterTag key)
{
- return tag != HtmlTextWriterTag.Span;
+ return key != HtmlTextWriterTag.Span;
}
}
}
{
BuildTemplateMethod templateMethod;
- public CompiledTemplateBuilder (BuildTemplateMethod templateMethod)
+ public CompiledTemplateBuilder (BuildTemplateMethod buildTemplateMethod)
{
- this.templateMethod = templateMethod;
+ this.templateMethod = buildTemplateMethod;
}
- public void InstantiateIn (Control ctrl)
+ public void InstantiateIn (Control container)
{
- templateMethod (ctrl);
+ templateMethod (container);
}
}
}
Page.SetFocus (this);
}
- protected internal virtual void LoadControlState (object state)
+ protected internal virtual void LoadControlState (object savedState)
{
}
return new SimpleEnumerator (this);
}
- public virtual int IndexOf (Control c)
+ public virtual int IndexOf (Control value)
{
- if (controls == null || c == null)
+ if (controls == null || value == null)
return -1;
- return Array.IndexOf (controls, c);
+ return Array.IndexOf (controls, value);
}
public virtual void Remove (Control value)
object propertyValue;
Type propertyType;
- public ControlValuePropertyAttribute (string propName)
+ public ControlValuePropertyAttribute (string name)
{
- this.propertyName = propName;
+ this.propertyName = name;
}
- public ControlValuePropertyAttribute (string propName, object propValue)
+ public ControlValuePropertyAttribute (string name, object defaultValue)
{
- this.propertyName = propName;
- this.propertyValue = propValue;
+ this.propertyName = name;
+ this.propertyValue = defaultValue;
}
- public ControlValuePropertyAttribute (string propName, Type type, string propValue)
+ public ControlValuePropertyAttribute (string name, Type type, string defaultValue)
{
- this.propertyName = propName;
- this.propertyValue = propValue;
+ this.propertyName = name;
+ this.propertyValue = defaultValue;
this.propertyType = type;
}
return prop.GetValue (container, args);
}
- public static string GetIndexedPropertyValue (object container, string expr, string format)
+ public static string GetIndexedPropertyValue (object container, string propName, string format)
{
- object result = GetIndexedPropertyValue (container, expr);
+ object result = GetIndexedPropertyValue (container, propName);
return FormatResult (result, format);
}
}
[EditorBrowsable (EditorBrowsableState.Never)]
- public override void RenderControl (HtmlTextWriter tw)
+ public override void RenderControl (HtmlTextWriter writer)
{
- base.RenderControl (tw);
+ base.RenderControl (writer);
}
[EditorBrowsable (EditorBrowsableState.Never)]
this.sortExpression = sortExpression;
}
- public DataSourceSelectArguments (int startingRowIndex, int maxRows)
+ public DataSourceSelectArguments (int startRowIndex, int maximumRows)
{
- this.startingRowIndex = startingRowIndex;
- this.maxRows = maxRows;
+ this.startingRowIndex = startRowIndex;
+ this.maxRows = maximumRows;
}
- public DataSourceSelectArguments (string sortExpression, int startingRowIndex, int maxRows)
+ public DataSourceSelectArguments (string sortExpression, int startRowIndex, int maximumRows)
{
this.sortExpression = sortExpression;
- this.startingRowIndex = startingRowIndex;
- this.maxRows = maxRows;
+ this.startingRowIndex = startRowIndex;
+ this.maxRows = maximumRows;
}
- public void AddSupportedCapabilities (DataSourceCapabilities srcCapabilities)
+ public void AddSupportedCapabilities (DataSourceCapabilities capabilities)
{
- this.dsc = this.dsc | srcCapabilities;
+ this.dsc = this.dsc | capabilities;
}
// MSDN: The DataSourceSelectArguments class overrides the Object.Equals method to test
OnDataSourceViewChanged (EventArgs.Empty);
}
- public virtual void Delete (IDictionary keys, IDictionary values,
- DataSourceViewOperationCallback callBack)
+ public virtual void Delete (IDictionary keys, IDictionary oldValues,
+ DataSourceViewOperationCallback callback)
{
- if (callBack == null)
+ if (callback == null)
throw new ArgumentNullException ("callBack");
int rowAffected;
try {
- rowAffected = ExecuteDelete (keys, values);
+ rowAffected = ExecuteDelete (keys, oldValues);
}
catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
- protected virtual int ExecuteDelete(IDictionary keys, IDictionary values)
+ protected virtual int ExecuteDelete(IDictionary keys, IDictionary oldValues)
{
throw new NotSupportedException ();
}
- protected virtual int ExecuteInsert (IDictionary keys)
+ protected virtual int ExecuteInsert (IDictionary values)
{
throw new NotSupportedException();
}
}
public virtual void Insert (IDictionary values,
- DataSourceViewOperationCallback callBack)
+ DataSourceViewOperationCallback callback)
{
- if (callBack == null)
- throw new ArgumentNullException("callBack");
+ if (callback == null)
+ throw new ArgumentNullException("callback");
int rowAffected;
try {
rowAffected = ExecuteInsert (values);
} catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
- protected virtual void OnDataSourceViewChanged (EventArgs eventArgs)
+ protected virtual void OnDataSourceViewChanged (EventArgs e)
{
if (eventsList != null) {
EventHandler evtHandler = eventsList [EventDataSourceViewChanged] as EventHandler;
if (evtHandler != null)
- evtHandler(this, eventArgs);
+ evtHandler(this, e);
}
}
return;
}
- public virtual void Select (DataSourceSelectArguments selectArgs,
- DataSourceViewSelectCallback callBack)
+ public virtual void Select (DataSourceSelectArguments arguments,
+ DataSourceViewSelectCallback callback)
{
- if (callBack == null)
+ if (callback == null)
throw new ArgumentNullException("callBack");
- selectArgs.RaiseUnsupportedCapabilitiesError (this);
+ arguments.RaiseUnsupportedCapabilitiesError (this);
- IEnumerable selectList = ExecuteSelect (selectArgs);
- callBack (selectList);
+ IEnumerable selectList = ExecuteSelect (arguments);
+ callback (selectList);
}
public virtual void Update(IDictionary keys, IDictionary values,
- IDictionary oldValues, DataSourceViewOperationCallback callBack)
+ IDictionary oldValues, DataSourceViewOperationCallback callback)
{
- if (callBack == null)
- throw new ArgumentNullException ("callBack");
+ if (callback == null)
+ throw new ArgumentNullException ("callback");
int rowAffected;
try {
rowAffected = ExecuteUpdate (keys, values, oldValues);
} catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
public virtual bool CanDelete { get { return false; } }
namespace System.Web.UI
{
- public delegate bool DataSourceViewOperationCallback (int recordsAffected, Exception exception);
+ public delegate bool DataSourceViewOperationCallback (int affectedRecords, Exception ex);
}
OnChanged (new EventArgs ());
}
- public bool Contains (string propertyName)
+ public bool Contains (string propName)
{
- return list.Contains (propertyName);
+ return list.Contains (propName);
}
public void CopyTo (Array array, int index)
list.CopyTo (array, index);
}
- public void CopyTo (ExpressionBinding [] bindings, int index)
+ public void CopyTo (ExpressionBinding [] array, int index)
{
if (index < 0)
throw new ArgumentNullException ("Index cannot be negative");
- if (index >= bindings.Length)
+ if (index >= array.Length)
throw new ArgumentException ("Index cannot be greater than or equal to length of array passed");
- if (list.Count > (bindings.Length - index + 1))
+ if (list.Count > (array.Length - index + 1))
throw new ArgumentException ("Number of elements in source is greater than available space from index to end of destination");
foreach (string key in list.Keys)
- bindings [index++] = (ExpressionBinding) list [key];
+ array [index++] = (ExpressionBinding) list [key];
}
public IEnumerator GetEnumerator ()
}
- public virtual void AddAttribute (string name, string value, bool fEncode)
+ public virtual void AddAttribute (string name, string value, bool fEndode)
{
- if (fEncode)
+ if (fEndode)
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (name, value, GetAttributeKey (name));
b.Write (format, arg0, arg1);
}
- public override void Write (string format, params object [] args)
+ public override void Write (string format, params object [] arg)
{
OutputTabs ();
- b.Write (format, args);
+ b.Write (format, arg);
}
public override void Write (string s)
newline = true;
}
- public override void WriteLine (string format, params object [] args)
+ public override void WriteLine (string format, params object [] arg)
{
OutputTabs ();
- b.WriteLine (format, args);
+ b.WriteLine (format, arg);
newline = true;
}
}
}
- protected internal override void Render (HtmlTextWriter writer)
+ protected internal override void Render (HtmlTextWriter output)
{
- writer.Write (_text);
+ output.Write (_text);
}
protected override ControlCollection CreateControlCollection ()
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- protected virtual void SavePageStateToPersistenceMedium (object viewState)
+ protected virtual void SavePageStateToPersistenceMedium (object state)
{
PageStatePersister persister = this.PageStatePersister;
if (persister == null)
return;
- Pair pair = viewState as Pair;
+ Pair pair = state as Pair;
if (pair != null) {
persister.ViewState = pair.First;
persister.ControlState = pair.Second;
} else
- persister.ViewState = viewState;
+ persister.ViewState = state;
persister.Save ();
}
[MonoDocumentationNote ("Not implemented. Only used by .net aspx parser")]
[EditorBrowsable (EditorBrowsableState.Never)]
- protected object GetWrappedFileDependencies (string [] list)
+ protected object GetWrappedFileDependencies (string [] virtualFileDependencies)
{
- return list;
+ return virtualFileDependencies;
}
[MonoDocumentationNote ("Does nothing. Used by .net aspx parser")]
{
}
- public virtual IHttpHandler GetHandler (HttpContext context, string requestType, string url, string path)
+ public virtual IHttpHandler GetHandler (HttpContext context, string requestType, string virtualPath, string path)
{
- return PageParser.GetCompiledPageInstance (url, path, context);
+ return PageParser.GetCompiledPageInstance (virtualPath, path, context);
}
public virtual void ReleaseHandler (IHttpHandler handler)
[Serializable]
public sealed class Pair
{
- public Pair (object first, object second)
+ public Pair (object x, object y)
{
- First = first;
- Second = second;
+ First = x;
+ Second = y;
}
public Pair ()
Type containerType;
BindingDirection direction;
- public TemplateContainerAttribute (Type containerType, BindingDirection direction)
+ public TemplateContainerAttribute (Type containerType, BindingDirection bindingDirection)
{
this.containerType = containerType;
- this.direction = direction;
+ this.direction = bindingDirection;
}
public BindingDirection BindingDirection {
return LoadControl (type, null);
}
- public Control LoadControl (Type type, object[] parameters)
+ public Control LoadControl (Type t, object[] parameters)
{
object [] attrs = null;
- if (type != null)
- type.GetCustomAttributes (typeof (PartialCachingAttribute), true);
+ if (t != null)
+ t.GetCustomAttributes (typeof (PartialCachingAttribute), true);
if (attrs != null && attrs.Length == 1) {
PartialCachingAttribute attr = (PartialCachingAttribute) attrs [0];
- PartialCachingControl ctrl = new PartialCachingControl (type, parameters);
+ PartialCachingControl ctrl = new PartialCachingControl (t, parameters);
ctrl.VaryByParams = attr.VaryByParams;
ctrl.VaryByControls = attr.VaryByControls;
ctrl.VaryByCustom = attr.VaryByCustom;
return ctrl;
}
- object control = Activator.CreateInstance (type, parameters);
+ object control = Activator.CreateInstance (t, parameters);
if (control is UserControl)
((UserControl) control).InitializeAsUserControl (Page);
return DataBinder.Eval (Page.GetDataItem(), expression, format);
}
- protected internal object XPath (string xpathexpression)
+ protected internal object XPath (string xPathExpression)
{
- return XPathBinder.Eval (Page.GetDataItem(), xpathexpression);
+ return XPathBinder.Eval (Page.GetDataItem(), xPathExpression);
}
- protected internal object XPath (string xpathexpression, IXmlNamespaceResolver resolver)
+ protected internal object XPath (string xPathExpression, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, null, resolver);
+ return XPathBinder.Eval (Page.GetDataItem (), xPathExpression, null, resolver);
}
- protected internal string XPath (string xpathexpression, string format)
+ protected internal string XPath (string xPathExpression, string format)
{
- return XPathBinder.Eval (Page.GetDataItem(), xpathexpression, format);
+ return XPathBinder.Eval (Page.GetDataItem(), xPathExpression, format);
}
- protected internal string XPath (string xpathexpression, string format, IXmlNamespaceResolver resolver)
+ protected internal string XPath (string xPathExpression, string format, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, format, resolver);
+ return XPathBinder.Eval (Page.GetDataItem (), xPathExpression, format, resolver);
}
- protected internal IEnumerable XPathSelect (string xpathexpression)
+ protected internal IEnumerable XPathSelect (string xPathExpression)
{
- return XPathBinder.Select (Page.GetDataItem(), xpathexpression);
+ return XPathBinder.Select (Page.GetDataItem(), xPathExpression);
}
- protected internal IEnumerable XPathSelect (string xpathexpression, IXmlNamespaceResolver resolver)
+ protected internal IEnumerable XPathSelect (string xPathExpression, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Select (Page.GetDataItem (), xpathexpression, resolver);
+ return XPathBinder.Select (Page.GetDataItem (), xPathExpression, resolver);
}
// IFilterResolutionService
{
}
- public static object Eval (object container, string xpath)
+ public static object Eval (object container, string xPath)
{
- return Eval (container, xpath, (IXmlNamespaceResolver)null);
+ return Eval (container, xPath, (IXmlNamespaceResolver)null);
}
- public static object Eval (object container, string xpath, IXmlNamespaceResolver resolver)
+ public static object Eval (object container, string xPath, IXmlNamespaceResolver resolver)
{
- if (xpath == null || xpath.Length == 0)
- throw new ArgumentNullException ("xpath");
+ if (xPath == null || xPath.Length == 0)
+ throw new ArgumentNullException ("xPath");
IXPathNavigable factory = container as IXPathNavigable;
if (factory == null)
throw new ArgumentException ("container");
- object result = factory.CreateNavigator ().Evaluate (xpath, resolver);
+ object result = factory.CreateNavigator ().Evaluate (xPath, resolver);
XPathNodeIterator itr = result as XPathNodeIterator;
if (itr != null) {
return result;
}
- public static string Eval (object container, string xpath, string format)
+ public static string Eval (object container, string xPath, string format)
{
- return Eval (container, xpath, format, null);
+ return Eval (container, xPath, format, null);
}
- public static string Eval (object container, string xpath, string format, IXmlNamespaceResolver resolver)
+ public static string Eval (object container, string xPath, string format, IXmlNamespaceResolver resolver)
{
- object result = Eval (container, xpath, resolver);
+ object result = Eval (container, xPath, resolver);
if (result == null)
return String.Empty;
return String.Format (format, result);
}
- public static IEnumerable Select (object container, string xpath)
+ public static IEnumerable Select (object container, string xPath)
{
- return Select (container, xpath, null);
+ return Select (container, xPath, null);
}
- public static IEnumerable Select (object container, string xpath, IXmlNamespaceResolver resolver)
+ public static IEnumerable Select (object container, string xPath, IXmlNamespaceResolver resolver)
{
- if (xpath == null || xpath.Length == 0)
- throw new ArgumentNullException ("xpath");
+ if (xPath == null || xPath.Length == 0)
+ throw new ArgumentNullException ("xPath");
IXPathNavigable factory = container as IXPathNavigable;
if (factory == null)
throw new ArgumentException ("container");
- XPathNodeIterator itr = factory.CreateNavigator ().Select (xpath, resolver);
+ XPathNodeIterator itr = factory.CreateNavigator ().Select (xPath, resolver);
ArrayList ret = new ArrayList ();
while (itr.MoveNext ()) {
last_modified_from_file_dependencies = true;
}
- public void SetMaxAge (TimeSpan date)
+ public void SetMaxAge (TimeSpan delta)
{
- if (date < TimeSpan.Zero)
- throw new ArgumentOutOfRangeException ("date");
+ if (delta < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("delta");
- if (HaveMaxAge && MaxAge < date)
+ if (HaveMaxAge && MaxAge < delta)
return;
- MaxAge = date;
+ MaxAge = delta;
HaveMaxAge = true;
}
}
}
- public bool this [ string param ] {
+ public bool this [ string header ] {
get {
- if (param == null)
+ if (header == null)
throw new ArgumentNullException ();
- return parms.Contains (param);
+ return parms.Contains (header);
}
set {
- if (param == null)
+ if (header == null)
throw new ArgumentNullException ();
ignore_parms = false;
if (value)
- if (!parms.Contains (param))
- parms.Add (param, true);
+ if (!parms.Contains (header))
+ parms.Add (header, true);
else
- parms.Remove (param);
+ parms.Remove (header);
}
}
}
return GetLocalObjectFromFactory (virtualPath, resourceKey, culture);
}
- public object GetSection (string name)
+ public object GetSection (string sectionName)
{
- return WebConfigurationManager.GetSection (name);
+ return WebConfigurationManager.GetSection (sectionName);
}
object IServiceProvider.GetService (Type service)
return HttpContext.GetGlobalResourceObject (classKey, resourceKey, culture);
}
- public override object GetLocalResourceObject (string overridePath, string resourceKey)
+ public override object GetLocalResourceObject (string virtualPath, string resourceKey)
{
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey);
+ return HttpContext.GetLocalResourceObject (virtualPath, resourceKey);
}
- public override object GetLocalResourceObject (string overridePath, string resourceKey, CultureInfo culture)
+ public override object GetLocalResourceObject (string virtualPath, string resourceKey, CultureInfo culture)
{
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey, culture);
+ return HttpContext.GetLocalResourceObject (virtualPath, resourceKey, culture);
}
public override object GetSection (string sectionName)
BaseClear ();
}
- public void CopyTo (Array array, int index)
+ public void CopyTo (Array dest, int index)
{
/* XXX this is kind of gross and inefficient
* since it makes a copy of the superclass's
* list */
object[] values = BaseGetAllValues();
- values.CopyTo (array, index);
+ values.CopyTo (dest, index);
}
public string GetKey (int index)
return (HttpPostedFile)BaseGet (index);
}
- public HttpPostedFile Get (string key)
+ public HttpPostedFile Get (string name)
{
- return (HttpPostedFile)BaseGet (key);
+ return (HttpPostedFile)BaseGet (name);
}
- public HttpPostedFile this [string key] {
+ public HttpPostedFile this [string name] {
get {
- return Get (key);
+ return Get (name);
}
}
return (IHttpModule)BaseGet (index);
}
- public IHttpModule Get (string key)
+ public IHttpModule Get (string name)
{
- return (IHttpModule)BaseGet (key);
+ return (IHttpModule)BaseGet (name);
}
- public IHttpModule this [string key] {
+ public IHttpModule this [string name] {
get {
- return Get (key);
+ return Get (name);
}
}
}
[SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
- public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
- base.GetObjectData (info, ctx);
+ base.GetObjectData (info, context);
info.AddValue ("_virtualPath", virtualPath);
info.AddValue ("_parserErrors", errors);
info.AddValue ("_line", line);
w.AppendToLog (param);
}
- public override string ApplyAppPathModifier (string overridePath)
+ public override string ApplyAppPathModifier (string virtualPath)
{
- return w.ApplyAppPathModifier (overridePath);
+ return w.ApplyAppPathModifier (virtualPath);
}
public override void BinaryWrite (byte [] buffer)
buf.Add ((byte)ch);
}
- public static string UrlDecode (string s, Encoding e)
+ public static string UrlDecode (string str, Encoding e)
{
- if (null == s)
+ if (null == str)
return null;
- if (s.IndexOf ('%') == -1 && s.IndexOf ('+') == -1)
- return s;
+ if (str.IndexOf ('%') == -1 && str.IndexOf ('+') == -1)
+ return str;
if (e == null)
e = Encoding.UTF8;
- long len = s.Length;
+ long len = str.Length;
var bytes = new List <byte> ();
int xchar;
char ch;
for (int i = 0; i < len; i++) {
- ch = s [i];
- if (ch == '%' && i + 2 < len && s [i + 1] != '%') {
- if (s [i + 1] == 'u' && i + 5 < len) {
+ ch = str [i];
+ if (ch == '%' && i + 2 < len && str [i + 1] != '%') {
+ if (str [i + 1] == 'u' && i + 5 < len) {
// unicode hex sequence
- xchar = GetChar (s, i + 2, 4);
+ xchar = GetChar (str, i + 2, 4);
if (xchar != -1) {
WriteCharBytes (bytes, (char)xchar, e);
i += 5;
} else
WriteCharBytes (bytes, '%', e);
- } else if ((xchar = GetChar (s, i + 1, 2)) != -1) {
+ } else if ((xchar = GetChar (str, i + 1, 2)) != -1) {
WriteCharBytes (bytes, (char)xchar, e);
i += 2;
} else {
return UrlEncode(str, Encoding.UTF8);
}
- public static string UrlEncode (string s, Encoding Enc)
+ public static string UrlEncode (string str, Encoding e)
{
- if (s == null)
+ if (str == null)
return null;
- if (s == String.Empty)
+ if (str == String.Empty)
return String.Empty;
bool needEncode = false;
- int len = s.Length;
+ int len = str.Length;
for (int i = 0; i < len; i++) {
- char c = s [i];
+ char c = str [i];
if ((c < '0') || (c < 'A' && c > '9') || (c > 'Z' && c < 'a') || (c > 'z')) {
if (HttpEncoder.NotEncoded (c))
continue;
}
if (!needEncode)
- return s;
+ return str;
// avoided GetByteCount call
- byte [] bytes = new byte[Enc.GetMaxByteCount(s.Length)];
- int realLen = Enc.GetBytes (s, 0, s.Length, bytes, 0);
+ byte [] bytes = new byte[e.GetMaxByteCount(str.Length)];
+ int realLen = e.GetBytes (str, 0, str.Length, bytes, 0);
return Encoding.ASCII.GetString (UrlEncodeToBytes (bytes, 0, realLen));
}
return sb.ToString ();
}
- public static string UrlPathEncode (string s)
+ public static string UrlPathEncode (string str)
{
- return HttpEncoder.Current.UrlPathEncode (s);
+ return HttpEncoder.Current.UrlPathEncode (str);
}
public static NameValueCollection ParseQueryString (string query)
{
}
- public ParserErrorCollection (ParserError[] errors)
+ public ParserErrorCollection (ParserError[] value)
{
- InnerList.AddRange (errors);
+ InnerList.AddRange (value);
}
public ParserError this [int index]
set { InnerList[index] = value; }
}
- public int Add (ParserError error)
+ public int Add (ParserError value)
{
- return List.Add (error);
+ return List.Add (value);
}
- public void AddRange (ParserErrorCollection collection)
+ public void AddRange (ParserErrorCollection value)
{
- InnerList.AddRange (collection);
+ InnerList.AddRange (value);
}
- public void AddRange (ParserError[] errors)
+ public void AddRange (ParserError[] value)
{
- InnerList.AddRange (errors);
+ InnerList.AddRange (value);
}
- public bool Contains (ParserError error)
+ public bool Contains (ParserError value)
{
- return InnerList.Contains (error);
+ return InnerList.Contains (value);
}
- public void CopyTo (ParserError[] errors, int index)
+ public void CopyTo (ParserError[] array, int index)
{
- List.CopyTo (errors, index);
+ List.CopyTo (array, index);
}
- public int IndexOf (ParserError error)
+ public int IndexOf (ParserError value)
{
- return InnerList.IndexOf (error);
+ return InnerList.IndexOf (value);
}
- public void Insert (int index, ParserError error)
+ public void Insert (int index, ParserError value)
{
- InnerList.Insert (index, error);
+ InnerList.Insert (index, value);
}
- public void Remove (ParserError error)
+ public void Remove (ParserError value)
{
- InnerList.Remove (error);
+ InnerList.Remove (value);
}
}
}
return new SiteMapHierarchicalDataSourceView (this);
}
- public virtual bool IsAccessibleToUser (System.Web.HttpContext ctx)
+ public virtual bool IsAccessibleToUser (System.Web.HttpContext context)
{
- return provider.IsAccessibleToUser (ctx, this);
+ return provider.IsAccessibleToUser (context, this);
}
public override string ToString()
return node;
}
- public override bool Equals (object ob)
+ public override bool Equals (object obj)
{
- SiteMapNode node = ob as SiteMapNode;
+ SiteMapNode node = obj as SiteMapNode;
if (node == null) return false;
if (node.key != key ||
Add (value);
}
- public SiteMapNodeCollection (SiteMapNode[] values)
+ public SiteMapNodeCollection (SiteMapNode[] value)
{
- AddRangeInternal (values);
+ AddRangeInternal (value);
}
- public SiteMapNodeCollection (SiteMapNodeCollection values)
+ public SiteMapNodeCollection (SiteMapNodeCollection value)
{
- AddRangeInternal (values);
+ AddRangeInternal (value);
}
internal static SiteMapNodeCollection EmptyCollection {
remove { events.AddHandler (traceFinishedEvent, value); }
}
- public TraceContext (HttpContext Context)
+ public TraceContext (HttpContext context)
{
- _Context = Context;
+ _Context = context;
}
internal bool HaveTrace {
}
}
- public void Warn(string msg)
+ public void Warn(string message)
{
- Write (String.Empty, msg, null, true);
+ Write (String.Empty, message, null, true);
}
- public void Warn(string category, string msg)
+ public void Warn(string category, string message)
{
- Write (category, msg, null, true);
+ Write (category, message, null, true);
}
- public void Warn (string category, string msg, Exception error)
+ public void Warn (string category, string message, Exception errorInfo)
{
- Write (category, msg, error, true);
+ Write (category, message, errorInfo, true);
}
- public void Write (string msg)
+ public void Write (string message)
{
- Write (String.Empty, msg, null, false);
+ Write (String.Empty, message, null, false);
}
- public void Write (string category, string msg)
+ public void Write (string category, string message)
{
- Write (category, msg, null, false);
+ Write (category, message, null, false);
}
- public void Write (string category, string msg, Exception error)
+ public void Write (string category, string message, Exception errorInfo)
{
- Write (category, msg, error, false);
+ Write (category, message, errorInfo, false);
}
void Write (string category, string msg, Exception error, bool Warning)
static void Main (string[] args)
{
try {
- Run (args);
+ var success = Run (args);
+
+ if (!success)
+ Environment.Exit (1);
} catch (Exception ex) {
Die ("Exception caught:{0}{1}", Environment.NewLine, ex.ToString ());
}
}
- static void Run (string[] args)
+ static bool Run (string[] args)
{
bool showHelp = false;
string testName = null;
writer.Dispose ();
}
}
+
+ return failedCounter == 0;
}
static string FormatReport (StandaloneTest test)
-//
+//
// Authors:
// Jonathan Pobst (monkey@jpobst.com)
// Francis Fisher (frankie@terrorise.me.uk)
}
}
[MonoTODO]
- public string this[string propName] {
+ public string this[string name] {
get {
throw new NotImplementedException ();
}
{
public int Compare (DataGridViewColumn o1, DataGridViewColumn o2)
{
- if (o1.DisplayIndex == o2.DisplayIndex)
- // Here we avoid the equal value swapping that both Array.Sort and ArrayList.Sort
- // do occasionally and preserve the user column insertation order.
- return 1;
- else
- return o1.DisplayIndex - o2.DisplayIndex;
+ return o1.DisplayIndex.CompareTo (o2.DisplayIndex);
}
}
}
f.Show ();
dgv.Columns.Add ("A1", "A1");
- Assert.AreEqual (0, dgv.Columns[0].Index, "A1");
- Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "B1");
+ Assert.AreEqual (0, dgv.Columns[0].Index, "#1");
+ Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "#2");
+ Assert.AreEqual ("A1", dgv.Columns[0].Name, "#3");
+
dgv.Columns.Add ("A2", "A2");
- Assert.AreEqual (0, dgv.Columns[0].Index, "A2");
- Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "B2");
- Assert.AreEqual (1, dgv.Columns[1].Index, "A3");
- Assert.AreEqual (1, dgv.Columns[1].DisplayIndex, "B3");
+ Assert.AreEqual (0, dgv.Columns[0].Index, "#10");
+ Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "#11");
+ Assert.AreEqual ("A1", dgv.Columns[0].Name, "#12");
+ Assert.AreEqual (1, dgv.Columns[1].Index, "#13");
+ Assert.AreEqual (1, dgv.Columns[1].DisplayIndex, "#14");
+ Assert.AreEqual ("A2", dgv.Columns[1].Name, "#15");
dgv.Columns.Insert (0, new DataGridViewTextBoxColumn ());
- Assert.AreEqual (0, dgv.Columns[0].Index, "A4");
- Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "B4");
- Assert.AreEqual (1, dgv.Columns[1].Index, "A5");
- Assert.AreEqual (1, dgv.Columns[1].DisplayIndex, "B5");
- Assert.AreEqual (2, dgv.Columns[2].Index, "A6");
- Assert.AreEqual (2, dgv.Columns[2].DisplayIndex, "B6");
+ Assert.AreEqual (0, dgv.Columns[0].Index, "#20");
+ Assert.AreEqual (0, dgv.Columns[0].DisplayIndex, "#21");
+ Assert.AreEqual ("", dgv.Columns[0].Name, "#22");
+
+ Assert.AreEqual (1, dgv.Columns[1].Index, "#23");
+ Assert.AreEqual (1, dgv.Columns[1].DisplayIndex, "#24");
+ Assert.AreEqual ("A1", dgv.Columns[1].Name, "#25");
+ Assert.AreEqual (2, dgv.Columns[2].Index, "#26");
+ Assert.AreEqual (2, dgv.Columns[2].DisplayIndex, "#27");
+ Assert.AreEqual ("A2", dgv.Columns[2].Name, "#28");
dgv.Columns.RemoveAt (1);
Assert.AreEqual (0, dgv.Columns[0].Index, "A7");
}
#endif
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var cwa = other as ContentWrapperAttribute;
+ var cwa = obj as ContentWrapperAttribute;
if (cwa == null)
return false;
return ContentWrapper != null ? ContentWrapper == cwa.ContentWrapper : cwa.ContentWrapper == null;
static readonly char [] comma_or_parens = new char [] {',', '(', ')'};
- public static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> list)
+ public static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> result)
{
if (typeNameList == null)
throw new ArgumentNullException ("typeNameList");
if (namespaceResolver == null)
throw new ArgumentNullException ("namespaceResolver");
- list = null;
+ result = null;
int idx = 0;
int parens = 0;
XamlTypeName tn;
ret.Add (tn);
}
- list = ret;
+ result = ret;
return true;
}
public XamlType TargetType { get; private set; }
- public static bool operator == (XamlValueConverter<TConverterBase> left, XamlValueConverter<TConverterBase> right)
+ public static bool operator == (XamlValueConverter<TConverterBase> converter1, XamlValueConverter<TConverterBase> converter2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (converter1) ? IsNull (converter2) : converter1.Equals (converter2);
}
static bool IsNull (XamlValueConverter<TConverterBase> a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlValueConverter<TConverterBase> left, XamlValueConverter<TConverterBase> right)
+ public static bool operator != (XamlValueConverter<TConverterBase> converter1, XamlValueConverter<TConverterBase> converter2)
{
- return IsNull (left) ? !IsNull (right) : IsNull (right) || left.ConverterType != right.ConverterType || left.TargetType != right.TargetType || left.Name != right.Name;
+ return IsNull (converter1) ? !IsNull (converter2) : IsNull (converter2) || converter1.ConverterType != converter2.ConverterType || converter1.TargetType != converter2.TargetType || converter1.Name != converter2.Name;
}
public bool Equals (XamlValueConverter<TConverterBase> other)
get { return LookupValueSerializer (); }
}
- public static bool operator == (XamlMember left, XamlMember right)
+ public static bool operator == (XamlMember xamlMember1, XamlMember xamlMember2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (xamlMember1) ? IsNull (xamlMember2) : xamlMember1.Equals (xamlMember2);
}
static bool IsNull (XamlMember a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlMember left, XamlMember right)
+ public static bool operator != (XamlMember xamlMember1, XamlMember xamlMember2)
{
- return !(left == right);
+ return !(xamlMember1 == xamlMember2);
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var x = other as XamlMember;
+ var x = obj as XamlMember;
return Equals (x);
}
Save (xw, instance);
}
- public static void Save (TextWriter textWriter, object instance)
+ public static void Save (TextWriter writer, object instance)
{
- using (var xw = XmlWriter.Create (textWriter, new XmlWriterSettings () { OmitXmlDeclaration = true, Indent = true }))
+ using (var xw = XmlWriter.Create (writer, new XmlWriterSettings () { OmitXmlDeclaration = true, Indent = true }))
Save (xw, instance);
}
- public static void Save (XmlWriter xmlWriter, object instance)
+ public static void Save (XmlWriter writer, object instance)
{
- Save (new XamlXmlWriter (xmlWriter, new XamlSchemaContext ()), instance);
+ Save (new XamlXmlWriter (writer, new XamlSchemaContext ()), instance);
}
- public static void Save (XamlWriter xamlWriter, object instance)
+ public static void Save (XamlWriter writer, object instance)
{
- if (xamlWriter == null)
- throw new ArgumentNullException ("xamlWriter");
- var r = new XamlObjectReader (instance, xamlWriter.SchemaContext);
- Transform (r, xamlWriter);
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ var r = new XamlObjectReader (instance, writer.SchemaContext);
+ Transform (r, writer);
}
public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter)
return stn != null ? stn.Name : Name;
}
- public static bool operator == (XamlType left, XamlType right)
+ public static bool operator == (XamlType xamlType1, XamlType xamlType2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (xamlType1) ? IsNull (xamlType2) : xamlType1.Equals (xamlType2);
}
static bool IsNull (XamlType a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlType left, XamlType right)
+ public static bool operator != (XamlType xamlType1, XamlType xamlType2)
{
- return !(left == right);
+ return !(xamlType1 == xamlType2);
}
public bool Equals (XamlType other)
intl.WriteNamespace (namespaceDeclaration);
}
- public override void WriteStartObject (XamlType xamlType)
+ public override void WriteStartObject (XamlType type)
{
- intl.WriteStartObject (xamlType);
+ intl.WriteStartObject (type);
}
public override void WriteValue (object value)
ifndef MOBILE_PROFILE
LIB_MCS_FLAGS += -d:CODEDOM
-TEST_LIB_REFS = System.Drawing $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
+TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
+
+ifndef NO_SYSTEM_DRAWING_DEPENDENCY
+TEST_LIB_REFS += System.Drawing
+endif
+
else
LIB_MCS_FLAGS += -nowarn:618
TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core
TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
endif
+ifdef MONO_FEATURE_APPLETLS
+LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLETLS
+endif
+
+ifdef ONLY_APPLETLS
+LIB_MCS_FLAGS += -d:ONLY_APPLETLS
+endif
+
ifndef PROFILE_DISABLE_BTLS
ifdef HAVE_BTLS
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// AppleCertificateHelper.cs
+//
+// Author:
+// Martin Baulig <martin.baulig@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc.
+//
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+namespace Mono.AppleTls
+{
+ static class AppleCertificateHelper
+ {
+ public static SecIdentity GetIdentity (X509Certificate certificate)
+ {
+ /*
+ * If we got an 'X509Certificate2', then we require it to have a private key
+ * and import it.
+ */
+ var certificate2 = certificate as X509Certificate2;
+ if (certificate2 != null)
+ return SecIdentity.Import (certificate2);
+
+ /*
+ * Otherwise, we require the private key to be in the keychain.
+ */
+ using (var secCert = new SecCertificate (certificate)) {
+ return SecKeyChain.FindIdentity (secCert, true);
+ }
+ }
+
+ public static SecIdentity GetIdentity (X509Certificate certificate, out SecCertificate[] intermediateCerts)
+ {
+ var identity = GetIdentity (certificate);
+
+ var impl2 = certificate.Impl as X509Certificate2Impl;
+ if (impl2 == null || impl2.IntermediateCertificates == null) {
+ intermediateCerts = new SecCertificate [0];
+ return identity;
+ }
+
+ try {
+ intermediateCerts = new SecCertificate [impl2.IntermediateCertificates.Count];
+ for (int i = 0; i < intermediateCerts.Length; i++)
+ intermediateCerts [i] = new SecCertificate (impl2.IntermediateCertificates [i]);
+
+ return identity;
+ } catch {
+ identity.Dispose ();
+ throw;
+ }
+ }
+
+ public static bool InvokeSystemCertificateValidator (
+ ICertificateValidator2 validator, string targetHost, bool serverMode,
+ X509CertificateCollection certificates,
+ ref MonoSslPolicyErrors errors, ref int status11)
+ {
+ if (certificates == null) {
+ errors |= MonoSslPolicyErrors.RemoteCertificateNotAvailable;
+ return false;
+ }
+
+ if (!string.IsNullOrEmpty (targetHost)) {
+ var pos = targetHost.IndexOf (':');
+ if (pos > 0)
+ targetHost = targetHost.Substring (0, pos);
+ }
+
+ var policy = SecPolicy.CreateSslPolicy (!serverMode, targetHost);
+ var trust = new SecTrust (certificates, policy);
+
+ if (validator.Settings.TrustAnchors != null) {
+ var status = trust.SetAnchorCertificates (validator.Settings.TrustAnchors);
+ if (status != SecStatusCode.Success)
+ throw new InvalidOperationException (status.ToString ());
+ trust.SetAnchorCertificatesOnly (false);
+ }
+
+ var result = trust.Evaluate ();
+ if (result == SecTrustResult.Unspecified)
+ return true;
+
+ errors |= MonoSslPolicyErrors.RemoteCertificateChainErrors;
+ return false;
+ }
+ }
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// AppleTlsContext.cs
+//
+// Author:
+// Martin Baulig <martin.baulig@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc.
+//
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Net;
+using System.Text;
+using System.Globalization;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+using SSA = System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+using Mono.Net;
+using Mono.Net.Security;
+using Mono.Util;
+
+using ObjCRuntime;
+
+namespace Mono.AppleTls
+{
+ class AppleTlsContext : MobileTlsContext
+ {
+ public const string SecurityLibrary = "/System/Library/Frameworks/Security.framework/Security";
+
+ GCHandle handle;
+ IntPtr context;
+ IntPtr connectionId;
+ SslReadFunc readFunc;
+ SslWriteFunc writeFunc;
+
+ SecIdentity serverIdentity;
+ SecIdentity clientIdentity;
+
+ X509Certificate remoteCertificate;
+ X509Certificate localClientCertificate;
+ MonoTlsConnectionInfo connectionInfo;
+ bool havePeerTrust;
+ bool isAuthenticated;
+ bool handshakeFinished;
+ int handshakeStarted;
+
+ bool closed;
+ bool disposed;
+ bool closedGraceful;
+ int pendingIO;
+
+ Exception lastException;
+
+ public AppleTlsContext (
+ MobileAuthenticatedStream parent, bool serverMode, string targetHost,
+ SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
+ X509CertificateCollection clientCertificates, bool askForClientCert)
+ : base (parent, serverMode, targetHost, enabledProtocols,
+ serverCertificate, clientCertificates, askForClientCert)
+ {
+ handle = GCHandle.Alloc (this);
+ connectionId = GCHandle.ToIntPtr (handle);
+ readFunc = NativeReadCallback;
+ writeFunc = NativeWriteCallback;
+
+ if (IsServer) {
+ if (serverCertificate == null)
+ throw new ArgumentNullException ("serverCertificate");
+ }
+ }
+
+ public IntPtr Handle {
+ get {
+ if (!HasContext)
+ throw new ObjectDisposedException ("AppleTlsContext");
+ return context;
+ }
+ }
+
+ public override bool HasContext {
+ get { return !disposed && context != IntPtr.Zero; }
+ }
+
+ [System.Diagnostics.Conditional ("APPLE_TLS_DEBUG")]
+ protected new void Debug (string message, params object[] args)
+ {
+ Console.Error.WriteLine ("MobileTlsStream({0}): {1}", Parent.ID, string.Format (message, args));
+ }
+
+ void CheckStatusAndThrow (SslStatus status, params SslStatus[] acceptable)
+ {
+ var last = Interlocked.Exchange (ref lastException, null);
+ if (last != null)
+ throw last;
+
+ if (status == SslStatus.Success || Array.IndexOf (acceptable, status) > -1)
+ return;
+
+ switch (status) {
+ case SslStatus.ClosedAbort:
+ throw new IOException ("Connection closed.");
+
+ case SslStatus.BadCert:
+ throw new TlsException (AlertDescription.BadCertificate);
+
+ case SslStatus.UnknownRootCert:
+ case SslStatus.NoRootCert:
+ case SslStatus.XCertChainInvalid:
+ throw new TlsException (AlertDescription.CertificateUnknown, status.ToString ());
+
+ case SslStatus.CertExpired:
+ case SslStatus.CertNotYetValid:
+ throw new TlsException (AlertDescription.CertificateExpired);
+
+ case SslStatus.Protocol:
+ throw new TlsException (AlertDescription.ProtocolVersion);
+
+ default:
+ throw new TlsException (AlertDescription.InternalError, "Unknown Secure Transport error `{0}'.", status);
+ }
+ }
+
+ #region Handshake
+
+ public override bool IsAuthenticated {
+ get { return isAuthenticated; }
+ }
+
+ public override void StartHandshake ()
+ {
+ Debug ("StartHandshake: {0}", IsServer);
+
+ if (Interlocked.CompareExchange (ref handshakeStarted, 1, 1) != 0)
+ throw new InvalidOperationException ();
+
+ InitializeConnection ();
+
+ SetSessionOption (SslSessionOption.BreakOnCertRequested, true);
+ SetSessionOption (SslSessionOption.BreakOnClientAuth, true);
+ SetSessionOption (SslSessionOption.BreakOnServerAuth, true);
+
+ if (IsServer) {
+ SecCertificate[] intermediateCerts;
+ serverIdentity = AppleCertificateHelper.GetIdentity (LocalServerCertificate, out intermediateCerts);
+ if (serverIdentity == null)
+ throw new SSA.AuthenticationException ("Unable to get server certificate from keychain.");
+
+ SetCertificate (serverIdentity, intermediateCerts);
+ for (int i = 0; i < intermediateCerts.Length; i++)
+ intermediateCerts [i].Dispose ();
+ }
+ }
+
+ public override void FinishHandshake ()
+ {
+ InitializeSession ();
+
+ isAuthenticated = true;
+ }
+
+ public override void Flush ()
+ {
+ }
+
+ public override bool ProcessHandshake ()
+ {
+ if (handshakeFinished)
+ throw new NotSupportedException ("Handshake already finished.");
+
+ while (true) {
+ lastException = null;
+ var status = SSLHandshake (Handle);
+ Debug ("Handshake: {0} - {0:x}", status);
+
+ CheckStatusAndThrow (status, SslStatus.WouldBlock, SslStatus.PeerAuthCompleted, SslStatus.PeerClientCertRequested);
+
+ if (status == SslStatus.PeerAuthCompleted) {
+ RequirePeerTrust ();
+ } else if (status == SslStatus.PeerClientCertRequested) {
+ RequirePeerTrust ();
+ if (remoteCertificate == null)
+ throw new TlsException (AlertDescription.InternalError, "Cannot request client certificate before receiving one from the server.");
+ localClientCertificate = SelectClientCertificate (remoteCertificate, null);
+ if (localClientCertificate == null)
+ continue;
+ clientIdentity = AppleCertificateHelper.GetIdentity (localClientCertificate);
+ if (clientIdentity == null)
+ throw new TlsException (AlertDescription.CertificateUnknown);
+ SetCertificate (clientIdentity, new SecCertificate [0]);
+ } else if (status == SslStatus.WouldBlock) {
+ return false;
+ } else if (status == SslStatus.Success) {
+ handshakeFinished = true;
+ return true;
+ }
+ }
+ }
+
+ void RequirePeerTrust ()
+ {
+ if (!havePeerTrust) {
+ EvaluateTrust ();
+ havePeerTrust = true;
+ }
+ }
+
+ void EvaluateTrust ()
+ {
+ InitializeSession ();
+
+ /*
+ * We're using .NET's SslStream semantics here.
+ *
+ * A server must always provide a valid certificate.
+ *
+ * However, in server mode, "ask for client certificate" means that
+ * we ask the client to provide a certificate, then invoke the client
+ * certificate validator - passing 'null' if the client didn't provide
+ * any.
+ *
+ */
+
+ var trust = GetPeerTrust (!IsServer);
+ X509CertificateCollection certificates;
+
+ if (trust == null || trust.Count == 0) {
+ remoteCertificate = null;
+ if (!IsServer)
+ throw new TlsException (AlertDescription.CertificateUnknown);
+ certificates = null;
+ } else {
+ if (trust.Count > 1)
+ Debug ("WARNING: Got multiple certificates in SecTrust!");
+
+ certificates = new X509CertificateCollection ();
+ for (int i = 0; i < trust.Count; i++)
+ certificates.Add (trust [(IntPtr)i].ToX509Certificate ());
+
+ remoteCertificate = certificates [0];
+ Debug ("Got peer trust: {0}", remoteCertificate);
+ }
+
+ bool ok;
+ try {
+ ok = ValidateCertificate (certificates);
+ } catch (Exception ex) {
+ Debug ("Certificate validation failed: {0}", ex);
+ throw new TlsException (AlertDescription.CertificateUnknown, "Certificate validation threw exception.");
+ }
+
+ if (!ok)
+ throw new TlsException (AlertDescription.CertificateUnknown);
+ }
+
+ void InitializeConnection ()
+ {
+ context = SSLCreateContext (IntPtr.Zero, IsServer ? SslProtocolSide.Server : SslProtocolSide.Client, SslConnectionType.Stream);
+
+ var result = SSLSetIOFuncs (Handle, readFunc, writeFunc);
+ CheckStatusAndThrow (result);
+
+ result = SSLSetConnection (Handle, connectionId);
+ CheckStatusAndThrow (result);
+
+ if ((EnabledProtocols & SSA.SslProtocols.Tls) != 0)
+ MinProtocol = SslProtocol.Tls_1_0;
+ else if ((EnabledProtocols & SSA.SslProtocols.Tls11) != 0)
+ MinProtocol = SslProtocol.Tls_1_1;
+ else
+ MinProtocol = SslProtocol.Tls_1_2;
+
+ if ((EnabledProtocols & SSA.SslProtocols.Tls12) != 0)
+ MaxProtocol = SslProtocol.Tls_1_2;
+ else if ((EnabledProtocols & SSA.SslProtocols.Tls11) != 0)
+ MaxProtocol = SslProtocol.Tls_1_1;
+ else
+ MaxProtocol = SslProtocol.Tls_1_0;
+
+#if APPLE_TLS_DEBUG
+ foreach (var c in GetSupportedCiphers ())
+ Debug (" {0} SslCipherSuite.{1} {2:x} {3}", IsServer ? "Server" : "Client", c, (int)c, (CipherSuiteCode)c);
+#endif
+
+ if (Settings != null && Settings.EnabledCiphers != null) {
+ SslCipherSuite [] ciphers = new SslCipherSuite [Settings.EnabledCiphers.Length];
+ for (int i = 0 ; i < Settings.EnabledCiphers.Length; ++i)
+ ciphers [i] = (SslCipherSuite)Settings.EnabledCiphers[i];
+ SetEnabledCiphers (ciphers);
+ }
+
+ if (AskForClientCertificate)
+ SetClientSideAuthenticate (SslAuthenticate.Try);
+
+ IPAddress address;
+ if (!IsServer && !string.IsNullOrEmpty (TargetHost) &&
+ !IPAddress.TryParse (TargetHost, out address)) {
+ PeerDomainName = ServerName;
+ }
+ }
+
+ void InitializeSession ()
+ {
+ if (connectionInfo != null)
+ return;
+
+ var cipher = NegotiatedCipher;
+ var protocol = GetNegotiatedProtocolVersion ();
+ Debug ("GET CONNECTION INFO: {0:x}:{0} {1:x}:{1} {2}", cipher, protocol, (TlsProtocolCode)protocol);
+
+ connectionInfo = new MonoTlsConnectionInfo {
+ CipherSuiteCode = (CipherSuiteCode)cipher,
+ ProtocolVersion = GetProtocol (protocol),
+ PeerDomainName = PeerDomainName
+ };
+ }
+
+ static TlsProtocols GetProtocol (SslProtocol protocol)
+ {
+ switch (protocol) {
+ case SslProtocol.Tls_1_0:
+ return TlsProtocols.Tls10;
+ case SslProtocol.Tls_1_1:
+ return TlsProtocols.Tls11;
+ case SslProtocol.Tls_1_2:
+ return TlsProtocols.Tls12;
+ default:
+ throw new NotSupportedException ();
+ }
+ }
+
+ public override MonoTlsConnectionInfo ConnectionInfo {
+ get { return connectionInfo; }
+ }
+
+ internal override bool IsRemoteCertificateAvailable {
+ get { return remoteCertificate != null; }
+ }
+
+ internal override X509Certificate LocalClientCertificate {
+ get { return localClientCertificate; }
+ }
+
+ public override X509Certificate RemoteCertificate {
+ get { return remoteCertificate; }
+ }
+
+ public override TlsProtocols NegotiatedProtocol {
+ get { return connectionInfo.ProtocolVersion; }
+ }
+
+ #endregion
+
+ #region General P/Invokes
+
+ [DllImport (SecurityLibrary )]
+ extern static /* OSStatus */ SslStatus SSLGetProtocolVersionMax (/* SSLContextRef */ IntPtr context, out SslProtocol maxVersion);
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetProtocolVersionMax (/* SSLContextRef */ IntPtr context, SslProtocol maxVersion);
+
+ public SslProtocol MaxProtocol {
+ get {
+ SslProtocol value;
+ var result = SSLGetProtocolVersionMax (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ set {
+ var result = SSLSetProtocolVersionMax (Handle, value);
+ CheckStatusAndThrow (result);
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLGetProtocolVersionMin (/* SSLContextRef */ IntPtr context, out SslProtocol minVersion);
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetProtocolVersionMin (/* SSLContextRef */ IntPtr context, SslProtocol minVersion);
+
+ public SslProtocol MinProtocol {
+ get {
+ SslProtocol value;
+ var result = SSLGetProtocolVersionMin (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ set {
+ var result = SSLSetProtocolVersionMin (Handle, value);
+ CheckStatusAndThrow (result);
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLGetNegotiatedProtocolVersion (/* SSLContextRef */ IntPtr context, out SslProtocol protocol);
+
+ public SslProtocol GetNegotiatedProtocolVersion ()
+ {
+ SslProtocol value;
+ var result = SSLGetNegotiatedProtocolVersion (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLGetSessionOption (/* SSLContextRef */ IntPtr context, SslSessionOption option, out bool value);
+
+ public bool GetSessionOption (SslSessionOption option)
+ {
+ bool value;
+ var result = SSLGetSessionOption (Handle, option, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetSessionOption (/* SSLContextRef */ IntPtr context, SslSessionOption option, bool value);
+
+ public void SetSessionOption (SslSessionOption option, bool value)
+ {
+ var result = SSLSetSessionOption (Handle, option, value);
+ CheckStatusAndThrow (result);
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetClientSideAuthenticate (/* SSLContextRef */ IntPtr context, SslAuthenticate auth);
+
+ public void SetClientSideAuthenticate (SslAuthenticate auth)
+ {
+ var result = SSLSetClientSideAuthenticate (Handle, auth);
+ CheckStatusAndThrow (result);
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLHandshake (/* SSLContextRef */ IntPtr context);
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLGetSessionState (/* SSLContextRef */ IntPtr context, ref SslSessionState state);
+
+ public SslSessionState SessionState {
+ get {
+ var value = SslSessionState.Invalid;
+ var result = SSLGetSessionState (Handle, ref value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetPeerID (/* SSLContextRef */ IntPtr context, /* const void** */ out IntPtr peerID, /* size_t* */ out IntPtr peerIDLen);
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLSetPeerID (/* SSLContextRef */ IntPtr context, /* const void* */ byte* peerID, /* size_t */ IntPtr peerIDLen);
+
+ public unsafe byte[] PeerId {
+ get {
+ IntPtr length;
+ IntPtr id;
+ var result = SSLGetPeerID (Handle, out id, out length);
+ CheckStatusAndThrow (result);
+ if ((result != SslStatus.Success) || ((int)length == 0))
+ return null;
+ var data = new byte [(int)length];
+ Marshal.Copy (id, data, 0, (int) length);
+ return data;
+ }
+ set {
+ SslStatus result;
+ IntPtr length = (value == null) ? IntPtr.Zero : (IntPtr)value.Length;
+ fixed (byte *p = value) {
+ result = SSLSetPeerID (Handle, p, length);
+ }
+ CheckStatusAndThrow (result);
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetBufferedReadSize (/* SSLContextRef */ IntPtr context, /* size_t* */ out IntPtr bufSize);
+
+ public IntPtr BufferedReadSize {
+ get {
+ IntPtr value;
+ var result = SSLGetBufferedReadSize (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetNumberSupportedCiphers (/* SSLContextRef */ IntPtr context, /* size_t* */ out IntPtr numCiphers);
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetSupportedCiphers (/* SSLContextRef */ IntPtr context, SslCipherSuite *ciphers, /* size_t* */ ref IntPtr numCiphers);
+
+ public unsafe IList<SslCipherSuite> GetSupportedCiphers ()
+ {
+ IntPtr n;
+ var result = SSLGetNumberSupportedCiphers (Handle, out n);
+ CheckStatusAndThrow (result);
+ if ((result != SslStatus.Success) || ((int)n <= 0))
+ return null;
+
+ var ciphers = new SslCipherSuite [(int)n];
+ fixed (SslCipherSuite *p = ciphers) {
+ result = SSLGetSupportedCiphers (Handle, p, ref n);
+ }
+ CheckStatusAndThrow (result);
+ return ciphers;
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetNumberEnabledCiphers (/* SSLContextRef */ IntPtr context, /* size_t* */ out IntPtr numCiphers);
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetEnabledCiphers (/* SSLContextRef */ IntPtr context, SslCipherSuite *ciphers, /* size_t* */ ref IntPtr numCiphers);
+
+ public unsafe IList<SslCipherSuite> GetEnabledCiphers ()
+ {
+ IntPtr n;
+ var result = SSLGetNumberEnabledCiphers (Handle, out n);
+ CheckStatusAndThrow (result);
+ if ((result != SslStatus.Success) || ((int)n <= 0))
+ return null;
+
+ var ciphers = new SslCipherSuite [(int)n];
+ fixed (SslCipherSuite *p = ciphers) {
+ result = SSLGetEnabledCiphers (Handle, p, ref n);
+ }
+ CheckStatusAndThrow (result);
+ return ciphers;
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLSetEnabledCiphers (/* SSLContextRef */ IntPtr context, SslCipherSuite *ciphers, /* size_t */ IntPtr numCiphers);
+
+ public unsafe void SetEnabledCiphers (SslCipherSuite [] ciphers)
+ {
+ if (ciphers == null)
+ throw new ArgumentNullException ("ciphers");
+
+ SslStatus result;
+
+ fixed (SslCipherSuite *p = ciphers)
+ result = SSLSetEnabledCiphers (Handle, p, (IntPtr)ciphers.Length);
+ CheckStatusAndThrow (result);
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetNegotiatedCipher (/* SSLContextRef */ IntPtr context, /* SslCipherSuite* */ out SslCipherSuite cipherSuite);
+
+ public SslCipherSuite NegotiatedCipher {
+ get {
+ SslCipherSuite value;
+ var result = SSLGetNegotiatedCipher (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetPeerDomainNameLength (/* SSLContextRef */ IntPtr context, /* size_t* */ out IntPtr peerNameLen);
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetPeerDomainName (/* SSLContextRef */ IntPtr context, /* char* */ byte[] peerName, /* size_t */ ref IntPtr peerNameLen);
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLSetPeerDomainName (/* SSLContextRef */ IntPtr context, /* char* */ byte[] peerName, /* size_t */ IntPtr peerNameLen);
+
+ public string PeerDomainName {
+ get {
+ IntPtr length;
+ var result = SSLGetPeerDomainNameLength (Handle, out length);
+ CheckStatusAndThrow (result);
+ if (result != SslStatus.Success || (int)length == 0)
+ return String.Empty;
+ var bytes = new byte [(int)length];
+ result = SSLGetPeerDomainName (Handle, bytes, ref length);
+ CheckStatusAndThrow (result);
+
+ int peerDomainLength = (int)length;
+
+ if (result != SslStatus.Success)
+ return string.Empty;
+ if (peerDomainLength > 0 && bytes [peerDomainLength-1] == 0)
+ peerDomainLength = peerDomainLength - 1;
+ return Encoding.UTF8.GetString (bytes, 0, peerDomainLength);
+ }
+ set {
+ SslStatus result;
+ if (value == null) {
+ result = SSLSetPeerDomainName (Handle, null, (IntPtr)0);
+ } else {
+ var bytes = Encoding.UTF8.GetBytes (value);
+ result = SSLSetPeerDomainName (Handle, bytes, (IntPtr)bytes.Length);
+ }
+ CheckStatusAndThrow (result);
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLSetCertificate (/* SSLContextRef */ IntPtr context, /* CFArrayRef */ IntPtr certRefs);
+
+ CFArray Bundle (SecIdentity identity, IEnumerable<SecCertificate> certificates)
+ {
+ if (identity == null)
+ throw new ArgumentNullException ("identity");
+ int i = 0;
+
+ int n = 0;
+ if (certificates != null) {
+ foreach (var obj in certificates)
+ n++;
+ }
+
+ var ptrs = new IntPtr [n + 1];
+ ptrs [0] = identity.Handle;
+ foreach (var certificate in certificates)
+ ptrs [++i] = certificate.Handle;
+ return CFArray.CreateArray (ptrs);
+ }
+
+ public void SetCertificate (SecIdentity identify, IEnumerable<SecCertificate> certificates)
+ {
+ using (var array = Bundle (identify, certificates)) {
+ var result = SSLSetCertificate (Handle, array.Handle);
+ CheckStatusAndThrow (result);
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLGetClientCertificateState (/* SSLContextRef */ IntPtr context, out SslClientCertificateState clientState);
+
+ public SslClientCertificateState ClientCertificateState {
+ get {
+ SslClientCertificateState value;
+ var result = SSLGetClientCertificateState (Handle, out value);
+ CheckStatusAndThrow (result);
+ return value;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLCopyPeerTrust (/* SSLContextRef */ IntPtr context, /* SecTrustRef */ out IntPtr trust);
+
+ public SecTrust GetPeerTrust (bool requireTrust)
+ {
+ IntPtr value;
+ var result = SSLCopyPeerTrust (Handle, out value);
+ if (requireTrust) {
+ CheckStatusAndThrow (result);
+ if (value == IntPtr.Zero)
+ throw new TlsException (AlertDescription.CertificateUnknown);
+ }
+ return (value == IntPtr.Zero) ? null : new SecTrust (value);
+ }
+
+ #endregion
+
+ #region IO Functions
+
+ [DllImport (SecurityLibrary)]
+ extern static /* SSLContextRef */ IntPtr SSLCreateContext (/* CFAllocatorRef */ IntPtr alloc, SslProtocolSide protocolSide, SslConnectionType connectionType);
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetConnection (/* SSLContextRef */ IntPtr context, /* SSLConnectionRef */ IntPtr connection);
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLSetIOFuncs (/* SSLContextRef */ IntPtr context, /* SSLReadFunc */ SslReadFunc readFunc, /* SSLWriteFunc */ SslWriteFunc writeFunc);
+
+ [MonoPInvokeCallback (typeof (SslReadFunc))]
+ static SslStatus NativeReadCallback (IntPtr ptr, IntPtr data, ref IntPtr dataLength)
+ {
+ var handle = GCHandle.FromIntPtr (ptr);
+ if (!handle.IsAllocated)
+ return SslStatus.Internal;
+
+ var context = (AppleTlsContext) handle.Target;
+ if (context.disposed)
+ return SslStatus.ClosedAbort;
+
+ try {
+ return context.NativeReadCallback (data, ref dataLength);
+ } catch (Exception ex) {
+ if (context.lastException == null)
+ context.lastException = ex;
+ return SslStatus.Internal;
+ }
+ }
+
+ [MonoPInvokeCallback (typeof (SslWriteFunc))]
+ static SslStatus NativeWriteCallback (IntPtr ptr, IntPtr data, ref IntPtr dataLength)
+ {
+ var handle = GCHandle.FromIntPtr (ptr);
+ if (!handle.IsAllocated)
+ return SslStatus.Internal;
+
+ var context = (AppleTlsContext) handle.Target;
+ if (context.disposed)
+ return SslStatus.ClosedAbort;
+
+ try {
+ return context.NativeWriteCallback (data, ref dataLength);
+ } catch (Exception ex) {
+ if (context.lastException == null)
+ context.lastException = ex;
+ return SslStatus.Internal;
+ }
+ }
+
+ SslStatus NativeReadCallback (IntPtr data, ref IntPtr dataLength)
+ {
+ if (closed || disposed || Parent == null)
+ return SslStatus.ClosedAbort;
+
+ var len = (int)dataLength;
+ var readBuffer = new byte [len];
+
+ Debug ("NativeReadCallback: {0} {1}", dataLength, len);
+
+ bool wantMore;
+ var ret = Parent.InternalRead (readBuffer, 0, len, out wantMore);
+ dataLength = (IntPtr)ret;
+
+ Debug ("NativeReadCallback #1: {0} - {1} {2}", len, ret, wantMore);
+
+ if (ret < 0)
+ return SslStatus.ClosedAbort;
+
+ Marshal.Copy (readBuffer, 0, data, ret);
+
+ if (ret > 0)
+ return SslStatus.Success;
+ else if (wantMore)
+ return SslStatus.WouldBlock;
+ else if (ret == 0) {
+ closedGraceful = true;
+ return SslStatus.ClosedGraceful;
+ } else {
+ return SslStatus.Success;
+ }
+ }
+
+ SslStatus NativeWriteCallback (IntPtr data, ref IntPtr dataLength)
+ {
+ if (closed || disposed || Parent == null)
+ return SslStatus.ClosedAbort;
+
+ var len = (int)dataLength;
+ var writeBuffer = new byte [len];
+
+ Marshal.Copy (data, writeBuffer, 0, len);
+
+ Debug ("NativeWriteCallback: {0}", len);
+
+ var ok = Parent.InternalWrite (writeBuffer, 0, len);
+
+ Debug ("NativeWriteCallback done: {0} {1}", len, ok);
+
+ return ok ? SslStatus.Success : SslStatus.ClosedAbort;
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLRead (/* SSLContextRef */ IntPtr context, /* const void* */ byte* data, /* size_t */ IntPtr dataLength, /* size_t* */ out IntPtr processed);
+
+ public override unsafe int Read (byte[] buffer, int offset, int count, out bool wantMore)
+ {
+ if (Interlocked.Exchange (ref pendingIO, 1) == 1)
+ throw new InvalidOperationException ();
+
+ Debug ("Read: {0},{1}", offset, count);
+
+ lastException = null;
+
+ try {
+ IntPtr processed;
+ SslStatus status;
+
+ fixed (byte *d = &buffer [offset])
+ status = SSLRead (Handle, d, (IntPtr)count, out processed);
+
+ Debug ("Read done: {0} {1} {2}", status, count, processed);
+
+ if (closedGraceful && (status == SslStatus.ClosedAbort || status == SslStatus.ClosedGraceful)) {
+ /*
+ * This is really ugly, but unfortunately SSLRead() also returns 'SslStatus.ClosedAbort'
+ * when the first inner Read() returns 0. MobileAuthenticatedStream.InnerRead() attempts
+ * to distinguish between a graceful close and abnormal termination of connection.
+ */
+ wantMore = false;
+ return 0;
+ }
+
+ CheckStatusAndThrow (status, SslStatus.WouldBlock, SslStatus.ClosedGraceful);
+ wantMore = status == SslStatus.WouldBlock;
+ return (int)processed;
+ } catch (Exception ex) {
+ Debug ("Read error: {0}", ex);
+ throw;
+ } finally {
+ pendingIO = 0;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern unsafe static /* OSStatus */ SslStatus SSLWrite (/* SSLContextRef */ IntPtr context, /* const void* */ byte* data, /* size_t */ IntPtr dataLength, /* size_t* */ out IntPtr processed);
+
+ public override unsafe int Write (byte[] buffer, int offset, int count, out bool wantMore)
+ {
+ if (Interlocked.Exchange (ref pendingIO, 1) == 1)
+ throw new InvalidOperationException ();
+
+ Debug ("Write: {0},{1}", offset, count);
+
+ lastException = null;
+
+ try {
+ SslStatus status = SslStatus.ClosedAbort;
+ IntPtr processed = (IntPtr)(-1);
+
+ fixed (byte *d = &buffer [offset])
+ status = SSLWrite (Handle, d, (IntPtr)count, out processed);
+
+ Debug ("Write done: {0} {1}", status, processed);
+
+ CheckStatusAndThrow (status, SslStatus.WouldBlock);
+
+ wantMore = status == SslStatus.WouldBlock;
+ return (int)processed;
+ } finally {
+ pendingIO = 0;
+ }
+ }
+
+ [DllImport (SecurityLibrary)]
+ extern static /* OSStatus */ SslStatus SSLClose (/* SSLContextRef */ IntPtr context);
+
+ public override void Close ()
+ {
+ if (Interlocked.Exchange (ref pendingIO, 1) == 1)
+ throw new InvalidOperationException ();
+
+ Debug ("Close");
+
+ lastException = null;
+
+ try {
+ if (closed || disposed)
+ return;
+
+ var status = SSLClose (Handle);
+ Debug ("Close done: {0}", status);
+ CheckStatusAndThrow (status);
+ } finally {
+ closed = true;
+ pendingIO = 0;
+ }
+ }
+
+ #endregion
+
+ protected override void Dispose (bool disposing)
+ {
+ try {
+ if (disposed)
+ return;
+ if (disposing) {
+ disposed = true;
+ if (serverIdentity != null) {
+ serverIdentity.Dispose ();
+ serverIdentity = null;
+ }
+ if (clientIdentity != null) {
+ clientIdentity.Dispose ();
+ clientIdentity = null;
+ }
+ if (remoteCertificate != null) {
+ remoteCertificate.Dispose ();
+ remoteCertificate = null;
+ }
+ }
+ } finally {
+ disposed = true;
+ if (context != IntPtr.Zero) {
+ CFObject.CFRelease (context);
+ context = IntPtr.Zero;
+ }
+ base.Dispose (disposing);
+ }
+ }
+ }
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// AppleTlsProvider.cs
+//
+// Author:
+// Martin Baulig <martin.baulig@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc.
+//
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+
+using MNS = Mono.Net.Security;
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+namespace Mono.AppleTls
+{
+ class AppleTlsProvider : MonoTlsProvider
+ {
+ static readonly Guid id = new Guid ("981af8af-a3a3-419a-9f01-a518e3a17c1c");
+
+ public override string Name {
+ get { return "apple-tls"; }
+ }
+
+ public override Guid ID {
+ get { return id; }
+ }
+
+ public override IMonoSslStream CreateSslStream (
+ Stream innerStream, bool leaveInnerStreamOpen,
+ MonoTlsSettings settings = null)
+ {
+ return new AppleTlsStream (innerStream, leaveInnerStreamOpen, settings, this);
+ }
+
+ public override bool SupportsSslStream {
+ get { return true; }
+ }
+
+ public override bool SupportsMonoExtensions {
+ get { return true; }
+ }
+
+ public override bool SupportsConnectionInfo {
+ get { return true; }
+ }
+
+ public override SslProtocols SupportedProtocols {
+ get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
+ }
+
+ internal override bool ValidateCertificate (
+ ICertificateValidator2 validator, string targetHost, bool serverMode,
+ X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
+ ref MonoSslPolicyErrors errors, ref int status11)
+ {
+ if (wantsChain)
+ chain = MNS.SystemCertificateValidator.CreateX509Chain (certificates);
+ return AppleCertificateHelper.InvokeSystemCertificateValidator (validator, targetHost, serverMode, certificates, ref errors, ref status11);
+ }
+ }
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// AppleTlsStream.cs
+//
+// Author:
+// Martin Baulig <martin.baulig@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc.
+//
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+
+using MNS = Mono.Net.Security;
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+namespace Mono.AppleTls
+{
+ class AppleTlsStream : MNS.MobileAuthenticatedStream
+ {
+ public AppleTlsStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings, MonoTlsProvider provider)
+ : base (innerStream, leaveInnerStreamOpen, settings, provider)
+ {
+ }
+
+ protected override MNS.MobileTlsContext CreateContext (
+ MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
+ SslProtocols enabledProtocols, X509Certificate serverCertificate,
+ X509CertificateCollection clientCertificates, bool askForClientCert)
+ {
+ return new AppleTlsContext (
+ parent, serverMode, targetHost,
+ enabledProtocols, serverCertificate,
+ clientCertificates, askForClientCert);
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// Certificate.cs: Implements the managed SecCertificate wrapper.
+//
+// Authors:
+// Miguel de Icaza
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2010 Novell, Inc
+// Copyright 2012-2013 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+using Mono.Net;
+
+using ObjCRuntime;
+
+namespace Mono.AppleTls {
+
+ partial class SecCertificate : INativeObject, IDisposable {
+ internal IntPtr handle;
+
+ internal SecCertificate (IntPtr handle, bool owns = false)
+ {
+ if (handle == IntPtr.Zero)
+ throw new Exception ("Invalid handle");
+
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary, EntryPoint="SecCertificateGetTypeID")]
+ public extern static IntPtr GetTypeID ();
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static IntPtr SecCertificateCreateWithData (IntPtr allocator, IntPtr cfData);
+
+ public SecCertificate (X509Certificate certificate)
+ {
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+
+ handle = certificate.Impl.GetNativeAppleCertificate ();
+ if (handle != IntPtr.Zero) {
+ CFObject.CFRetain (handle);
+ return;
+ }
+
+ using (CFData cert = CFData.FromData (certificate.GetRawCertData ())) {
+ Initialize (cert);
+ }
+ }
+
+ internal SecCertificate (X509CertificateImpl impl)
+ {
+ handle = impl.GetNativeAppleCertificate ();
+ if (handle != IntPtr.Zero) {
+ CFObject.CFRetain (handle);
+ return;
+ }
+
+ using (CFData cert = CFData.FromData (impl.GetRawCertData ())) {
+ Initialize (cert);
+ }
+ }
+
+ void Initialize (CFData data)
+ {
+ handle = SecCertificateCreateWithData (IntPtr.Zero, data.Handle);
+ if (handle == IntPtr.Zero)
+ throw new ArgumentException ("Not a valid DER-encoded X.509 certificate");
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static IntPtr SecCertificateCopySubjectSummary (IntPtr cert);
+
+ public string SubjectSummary {
+ get {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecCertificate");
+
+ IntPtr subjectSummaryHandle = IntPtr.Zero;
+ try {
+ subjectSummaryHandle = SecCertificateCopySubjectSummary (handle);
+ CFString subjectSummary = CFString.AsString (subjectSummaryHandle);
+ return subjectSummary;
+ }
+ finally {
+ if (subjectSummaryHandle != IntPtr.Zero)
+ CFObject.CFRelease (subjectSummaryHandle);
+ }
+ }
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static /* CFDataRef */ IntPtr SecCertificateCopyData (/* SecCertificateRef */ IntPtr cert);
+
+ public CFData DerData {
+ get {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecCertificate");
+
+ IntPtr data = SecCertificateCopyData (handle);
+ if (data == IntPtr.Zero)
+ throw new ArgumentException ("Not a valid certificate");
+ return new CFData (data, true);
+ }
+ }
+
+ public X509Certificate ToX509Certificate ()
+ {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecCertificate");
+
+ return new X509Certificate (handle);
+ }
+
+ internal static bool Equals (SecCertificate first, SecCertificate second)
+ {
+ /*
+ * This is a little bit expensive, but unfortunately there is no better API to compare two
+ * SecCertificateRef's for equality.
+ */
+ if (first == null)
+ throw new ArgumentNullException ("first");
+ if (second == null)
+ throw new ArgumentNullException ("second");
+ if (first.Handle == second.Handle)
+ return true;
+
+ using (var firstData = first.DerData)
+ using (var secondData = second.DerData) {
+ if (firstData.Handle == secondData.Handle)
+ return true;
+
+ if (firstData.Length != secondData.Length)
+ return false;
+ IntPtr length = (IntPtr)firstData.Length;
+ for (long i = 0; i < (long)length; i++) {
+ if (firstData [i] != secondData [i])
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ ~SecCertificate ()
+ {
+ Dispose (false);
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero){
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+ }
+
+ partial class SecIdentity : INativeObject, IDisposable {
+
+ static readonly CFString ImportExportPassphase;
+ static readonly CFString ImportItemIdentity;
+
+ static SecIdentity ()
+ {
+ var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ ImportExportPassphase = CFObject.GetStringConstant (handle, "kSecImportExportPassphrase");
+ ImportItemIdentity = CFObject.GetStringConstant (handle, "kSecImportItemIdentity");
+ } finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ internal IntPtr handle;
+
+ internal SecIdentity (IntPtr handle, bool owns = false)
+ {
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary, EntryPoint="SecIdentityGetTypeID")]
+ public extern static IntPtr GetTypeID ();
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static /* OSStatus */ SecStatusCode SecIdentityCopyCertificate (/* SecIdentityRef */ IntPtr identityRef, /* SecCertificateRef* */ out IntPtr certificateRef);
+
+ public SecCertificate Certificate {
+ get {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecIdentity");
+ IntPtr cert;
+ SecStatusCode result = SecIdentityCopyCertificate (handle, out cert);
+ if (result != SecStatusCode.Success)
+ throw new InvalidOperationException (result.ToString ());
+ return new SecCertificate (cert, true);
+ }
+ }
+
+ public static SecIdentity Import (byte[] data, string password)
+ {
+ if (data == null)
+ throw new ArgumentNullException ("data");
+ if (string.IsNullOrEmpty (password)) // SecPKCS12Import() doesn't allow empty passwords.
+ throw new ArgumentException ("password");
+ using (var pwstring = CFString.Create (password))
+ using (var options = CFDictionary.FromObjectAndKey (pwstring.Handle, ImportExportPassphase.Handle)) {
+ CFDictionary [] array;
+ SecStatusCode result = SecImportExport.ImportPkcs12 (data, options, out array);
+ if (result != SecStatusCode.Success)
+ throw new InvalidOperationException (result.ToString ());
+
+ return new SecIdentity (array [0].GetValue (ImportItemIdentity.Handle));
+ }
+ }
+
+ public static SecIdentity Import (X509Certificate2 certificate)
+ {
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ if (!certificate.HasPrivateKey)
+ throw new InvalidOperationException ("Need X509Certificate2 with a private key.");
+
+ /*
+ * SecPSK12Import does not allow any empty passwords, so let's generate
+ * a semi-random one here.
+ */
+ var password = Guid.NewGuid ().ToString ();
+ var pkcs12 = certificate.Export (X509ContentType.Pfx, password);
+ return Import (pkcs12, password);
+ }
+
+ ~SecIdentity ()
+ {
+ Dispose (false);
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero){
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+ }
+
+ partial class SecKey : INativeObject, IDisposable {
+ internal IntPtr handle;
+
+ public SecKey (IntPtr handle, bool owns = false)
+ {
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary, EntryPoint="SecKeyGetTypeID")]
+ public extern static IntPtr GetTypeID ();
+
+ ~SecKey ()
+ {
+ Dispose (false);
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero){
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+ }
+}
+#endif
--- /dev/null
+#if MONO_FEATURE_APPLETLS
+// Copyright 2011-2015 Xamarin Inc. All rights reserved.
+
+using ObjCRuntime;
+
+namespace Mono.AppleTls {
+
+ // this is a subset of OSStatus -> SInt32 -> signed int - see CoreFoundation.framework/Headers/CFBase.h
+ // values are defined in Security.framework/Headers/SecBase.h
+ enum SecStatusCode {
+ Success = 0,
+ DuplicateItem = -25299,
+ Param = -50,
+ }
+
+ // typedef uint32_t SecTrustResultType;
+ // values are defined in Security.framework/Headers/SecTrust.h
+ enum SecTrustResult {
+ Invalid,
+ Proceed,
+
+ Confirm,
+ Deny,
+ Unspecified,
+ RecoverableTrustFailure,
+ FatalTrustFailure,
+ ResultOtherError,
+ }
+}
+#endif
--- /dev/null
+using System;
+
+namespace ObjCRuntime {
+
+ internal interface INativeObject {
+ IntPtr Handle {
+ get;
+ }
+ }
+
+ static class NativeObjectHelper {
+
+ // help to avoid the (too common pattern)
+ // var p = x == null ? IntPtr.Zero : x.Handle;
+ static public IntPtr GetHandle (this INativeObject self)
+ {
+ return self == null ? IntPtr.Zero : self.Handle;
+ }
+ }
+
+}
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// ImportExport.cs
+//
+// Authors:
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2011-2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.InteropServices;
+using ObjCRuntime;
+using Mono.Net;
+
+namespace Mono.AppleTls {
+
+ internal partial class SecImportExport {
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static SecStatusCode SecPKCS12Import (IntPtr pkcs12_data, IntPtr options, out IntPtr items);
+
+ static public SecStatusCode ImportPkcs12 (byte[] buffer, CFDictionary options, out CFDictionary[] array)
+ {
+ using (CFData data = CFData.FromData (buffer)) {
+ return ImportPkcs12 (data, options, out array);
+ }
+ }
+
+ static public SecStatusCode ImportPkcs12 (CFData data, CFDictionary options, out CFDictionary [] array)
+ {
+ if (options == null)
+ throw new ArgumentNullException ("options");
+
+ IntPtr handle;
+ SecStatusCode code = SecPKCS12Import (data.Handle, options.Handle, out handle);
+ array = CFArray.ArrayFromHandle <CFDictionary> (handle, h => new CFDictionary (h, false));
+ CFObject.CFRelease (handle);
+ return code;
+ }
+ }
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// Items.cs: Implements the KeyChain query access APIs
+//
+// We use strong types and a helper SecQuery class to simplify the
+// creation of the dictionary used to query the Keychain
+//
+// Authors:
+// Miguel de Icaza
+// Sebastien Pouliot
+//
+// Copyright 2010 Novell, Inc
+// Copyright 2011-2016 Xamarin Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using ObjCRuntime;
+using Mono.Net;
+
+namespace Mono.AppleTls {
+
+ enum SecKind {
+ Identity
+ }
+
+ static class SecKeyChain {
+ static readonly IntPtr MatchLimitAll;
+ static readonly IntPtr MatchLimitOne;
+ static readonly IntPtr MatchLimit;
+
+ static SecKeyChain ()
+ {
+ var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ MatchLimit = CFObject.GetIntPtr (handle, "kSecMatchLimit");
+ MatchLimitAll = CFObject.GetIntPtr (handle, "kSecMatchLimitAll");
+ MatchLimitOne = CFObject.GetIntPtr (handle, "kSecMatchLimitOne");
+ } finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ public static SecIdentity FindIdentity (SecCertificate certificate, bool throwOnError = false)
+ {
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ var identity = FindIdentity (cert => SecCertificate.Equals (certificate, cert));
+ if (!throwOnError || identity != null)
+ return identity;
+
+ throw new InvalidOperationException (string.Format ("Could not find SecIdentity for certificate '{0}' in keychain.", certificate.SubjectSummary));
+ }
+
+ static SecIdentity FindIdentity (Predicate<SecCertificate> filter)
+ {
+ /*
+ * Unfortunately, SecItemCopyMatching() does not allow any search
+ * filters when looking up an identity.
+ *
+ * The following lookup will return all identities from the keychain -
+ * we then need need to find the right one.
+ */
+ using (var record = new SecRecord (SecKind.Identity)) {
+ SecStatusCode status;
+ var result = SecKeyChain.QueryAsReference (record, -1, out status);
+ if (status != SecStatusCode.Success || result == null)
+ return null;
+
+ for (int i = 0; i < result.Length; i++) {
+ var identity = (SecIdentity)result [i];
+ if (filter (identity.Certificate))
+ return identity;
+ }
+ }
+
+ return null;
+ }
+
+ public static INativeObject[] QueryAsReference (SecRecord query, int max, out SecStatusCode result)
+ {
+ if (query == null){
+ result = SecStatusCode.Param;
+ return null;
+ }
+
+ using (var copy = query.queryDict.MutableCopy ()) {
+ copy.SetValue (CFBoolean.True.Handle, SecItem.ReturnRef);
+ SetLimit (copy, max);
+
+ IntPtr ptr;
+ result = SecItem.SecItemCopyMatching (copy.Handle, out ptr);
+ if ((result == SecStatusCode.Success) && (ptr != IntPtr.Zero)) {
+ var array = CFArray.ArrayFromHandle<INativeObject> (ptr, p => {
+ IntPtr cfType = CFType.GetTypeID (p);
+ if (cfType == SecCertificate.GetTypeID ())
+ return new SecCertificate (p, true);
+ else if (cfType == SecKey.GetTypeID ())
+ return new SecKey (p, true);
+ else if (cfType == SecIdentity.GetTypeID ())
+ return new SecIdentity (p, true);
+ else
+ throw new Exception (String.Format ("Unexpected type: 0x{0:x}", cfType));
+ });
+ return array;
+ }
+ return null;
+ }
+ }
+
+ static CFNumber SetLimit (CFMutableDictionary dict, int max)
+ {
+ CFNumber n = null;
+ IntPtr val;
+ if (max == -1)
+ val = MatchLimitAll;
+ else if (max == 1)
+ val = MatchLimitOne;
+ else {
+ n = CFNumber.FromInt32 (max);
+ val = n.Handle;
+ }
+
+ dict.SetValue (val, SecKeyChain.MatchLimit);
+ return n;
+ }
+ }
+
+ class SecRecord : IDisposable {
+
+ static readonly IntPtr SecClassKey;
+ static SecRecord ()
+ {
+ var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ SecClassKey = CFObject.GetIntPtr (handle, "kSecClassKey");
+ } finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ // Fix <= iOS 6 Behaviour - Desk #83099
+ // NSCFDictionary: mutating method sent to immutable object
+ // iOS 6 returns an inmutable NSDictionary handle and when we try to set its values it goes kaboom
+ // By explicitly calling `MutableCopy` we ensure we always have a mutable reference we expect that.
+ CFDictionary _queryDict;
+ internal CFDictionary queryDict
+ {
+ get {
+ return _queryDict;
+ }
+ set {
+ _queryDict = value != null ? value.Copy () : null;
+ }
+ }
+
+ public SecRecord (SecKind secKind)
+ {
+ var kind = SecClass.FromSecKind (secKind);
+ queryDict = CFDictionary.FromObjectAndKey (kind, SecClassKey);
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (queryDict != null){
+ if (disposing){
+ queryDict.Dispose ();
+ queryDict = null;
+ }
+ }
+ }
+
+ ~SecRecord ()
+ {
+ Dispose (false);
+ }
+ }
+
+ partial class SecItem {
+ public static readonly IntPtr ReturnRef;
+
+ static SecItem ()
+ {
+ var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ ReturnRef = CFObject.GetIntPtr (handle, "kSecReturnRef");
+ } finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ internal extern static SecStatusCode SecItemCopyMatching (/* CFDictionaryRef */ IntPtr query, /* CFTypeRef* */ out IntPtr result);
+ }
+
+ static partial class SecClass {
+
+ public static readonly IntPtr Identity;
+
+ static SecClass ()
+ {
+ var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ Identity = CFObject.GetIntPtr (handle, "kSecClassIdentity");
+ } finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ public static IntPtr FromSecKind (SecKind secKind)
+ {
+ switch (secKind){
+ case SecKind.Identity:
+ return Identity;
+ default:
+ throw new ArgumentException ("secKind");
+ }
+ }
+ }
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// Policy.cs: Implements the managed SecPolicy wrapper.
+//
+// Authors:
+// Miguel de Icaza
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2010 Novell, Inc
+// Copyright 2012-2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Runtime.InteropServices;
+using ObjCRuntime;
+using Mono.Net;
+
+namespace Mono.AppleTls {
+ partial class SecPolicy : INativeObject, IDisposable {
+ IntPtr handle;
+
+ internal SecPolicy (IntPtr handle, bool owns = false)
+ {
+ if (handle == IntPtr.Zero)
+ throw new Exception ("Invalid handle");
+
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static IntPtr /* SecPolicyRef */ SecPolicyCreateSSL (bool server, IntPtr /* CFStringRef */ hostname);
+
+ static public SecPolicy CreateSslPolicy (bool server, string hostName)
+ {
+ CFString host = hostName == null ? null : CFString.Create (hostName);
+ IntPtr handle = host == null ? IntPtr.Zero : host.Handle;
+ SecPolicy policy = new SecPolicy (SecPolicyCreateSSL (server, handle), true);
+ if (host != null)
+ host.Dispose ();
+ return policy;
+ }
+
+ ~SecPolicy ()
+ {
+ Dispose (false);
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ public IntPtr Handle {
+ get { return handle; }
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero){
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+ }
+}
+#endif
--- /dev/null
+#if MONO_FEATURE_APPLETLS
+// Copyright 2014 Xamarin Inc. All rights reserved.
+
+namespace Mono.AppleTls {
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslProtocol {
+ Unknown = 0,
+ // Ssl_3_0 = 2,
+ Tls_1_0 = 4,
+ Tls_1_1 = 7,
+ Tls_1_2 = 8,
+ // Dtls_1_0 = 9,
+
+ /* Obsolete on iOS */
+ // Ssl_2_0 = 1,
+ // Ssl_3_0_only = 3,
+ // Tls_1_0_only = 5,
+ // All = 6,
+ }
+
+ // subset of OSStatus (int)
+ enum SslStatus {
+ Success = 0, // errSecSuccess in SecBase.h
+ Protocol = -9800,
+ Negotiation = -9801,
+ FatalAlert = -9802,
+ WouldBlock = -9803,
+ SessionNotFound = -9804,
+ ClosedGraceful = -9805,
+ ClosedAbort = -9806,
+ XCertChainInvalid = -9807,
+ BadCert = -9808,
+ Crypto = -9809,
+ Internal = -9810,
+ ModuleAttach = -9811,
+ UnknownRootCert = -9812,
+ NoRootCert = -9813,
+ CertExpired = -9814,
+ CertNotYetValid = -9815,
+ ClosedNotNotified = -9816,
+ BufferOverflow = -9817,
+ BadCipherSuite = -9818,
+ PeerUnexpectedMsg = -9819,
+ PeerBadRecordMac = -9820,
+ PeerDecryptionFail = -9821,
+ PeerRecordOverflow = -9822,
+ PeerDecompressFail = -9823,
+ PeerHandshakeFail = -9824,
+ PeerBadCert = -9825,
+ PeerUnsupportedCert = -9826,
+ PeerCertRevoked = -9827,
+ PeerCertExpired = -9828,
+ PeerCertUnknown = -9829,
+ IllegalParam = -9830,
+ PeerUnknownCA = -9831,
+ PeerAccessDenied = -9832,
+ PeerDecodeError = -9833,
+ PeerDecryptError = -9834,
+ PeerExportRestriction = -9835,
+ PeerProtocolVersion = -9836,
+ PeerInsufficientSecurity = -9837,
+ PeerInternalError = -9838,
+ PeerUserCancelled = -9839,
+ PeerNoRenegotiation = -9840,
+ PeerAuthCompleted = -9841, // non fatal
+ PeerClientCertRequested = -9842, // non fatal
+ HostNameMismatch = -9843,
+ ConnectionRefused = -9844,
+ DecryptionFail = -9845,
+ BadRecordMac = -9846,
+ RecordOverflow = -9847,
+ BadConfiguration = -9848,
+ UnexpectedRecord = -9849,
+ SSLWeakPeerEphemeralDHKey = -9850,
+ SSLClientHelloReceived = -9851 // non falta
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslSessionOption {
+ BreakOnServerAuth,
+ BreakOnCertRequested,
+ BreakOnClientAuth,
+
+ // FalseStart,
+
+ // SendOneByteRecord,
+
+ // AllowServerIdentityChange = 5,
+
+ // Fallback = 6,
+
+ // BreakOnClientHello = 7,
+
+ // AllowRenegotiation = 8,
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslAuthenticate {
+ // Never,
+ // Always,
+ Try = 2,
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslProtocolSide {
+ Server,
+ Client,
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslConnectionType {
+ Stream,
+ // Datagram
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslSessionState {
+ Invalid = -1,
+ // Idle,
+ // Handshake,
+ // Connected,
+ // Closed,
+ // Aborted
+ }
+
+ // Security.framework/Headers/SecureTransport.h
+ // untyped enum
+ enum SslClientCertificateState {
+ None,
+ Requested,
+ Sent,
+ Rejected
+ }
+
+ // Security.framework/Headers/CipherSuite.h
+ // 32 bits (uint32_t) on OSX, 16 bits (uint16_t) on iOS
+#if XAMMAC || XAMMAC_4_5
+ enum SslCipherSuite : uint {
+#else
+ enum SslCipherSuite : ushort {
+#endif
+ // DO NOT RENAME VALUES - they don't look good but we need them to keep compatibility with our System.dll code
+ // it's how it's defined across most SSL/TLS implementation (from RFC)
+
+ SSL_NULL_WITH_NULL_NULL = 0x0000, // value used before (not after) negotiation
+ TLS_NULL_WITH_NULL_NULL = 0x0000,
+
+ // Not the whole list (too much unneeed metadata) but only what's supported
+ // FIXME needs to be expended with OSX 10.9
+
+ SSL_RSA_WITH_NULL_MD5 = 0x0001,
+ SSL_RSA_WITH_NULL_SHA = 0x0002,
+ SSL_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003, // iOS 5.1 only
+ SSL_RSA_WITH_RC4_128_MD5 = 0x0004,
+ SSL_RSA_WITH_RC4_128_SHA = 0x0005,
+ SSL_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
+ SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
+ SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017, // iOS 5.1 only
+ SSL_DH_anon_WITH_RC4_128_MD5 = 0x0018,
+ SSL_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
+
+ // TLS - identical values to SSL (above)
+
+ TLS_RSA_WITH_NULL_MD5 = 0x0001,
+ TLS_RSA_WITH_NULL_SHA = 0x0002,
+ TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
+ TLS_RSA_WITH_RC4_128_SHA = 0x0005,
+ TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
+ TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
+ TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018,
+ TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
+
+ // TLS specific
+
+ TLS_PSK_WITH_NULL_SHA = 0x002C,
+ TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033,
+ TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034,
+ TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039,
+ TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A,
+ TLS_RSA_WITH_NULL_SHA256 = 0x003B,
+ TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C,
+ TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B,
+ TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C,
+ TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D,
+ TLS_PSK_WITH_RC4_128_SHA = 0x008A,
+ TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B,
+ TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C,
+ TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D,
+
+ TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C, // iOS 9+
+ TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D, // iOS 9+
+ TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E, // iOS 9+
+ TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F, // iOS 9+
+
+ TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6, // iOS 5.1 only
+ TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7, // iOS 5.1 only
+ TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE,
+ TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF,
+ TLS_PSK_WITH_NULL_SHA256 = 0x00B0,
+ TLS_PSK_WITH_NULL_SHA384 = 0x00B1,
+ TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001,
+ TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002,
+ TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003,
+ TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004,
+ TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005,
+ TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006,
+ TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007,
+ TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008,
+ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009,
+ TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A,
+ TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B,
+ TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C,
+ TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D,
+ TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E,
+ TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F,
+ TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010,
+ TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011,
+ TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012,
+ TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013,
+ TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014,
+ TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
+ TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
+ TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025,
+ TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026,
+ TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
+ TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
+ TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029,
+ TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A,
+
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B, // iOS 9+
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C, // iOS 9+
+ TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D, // iOS 9+
+ TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E, // iOS 9+
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F, // iOS 9+
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030, // iOS 9+
+ TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031, // iOS 9+
+ TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032, // iOS 9+
+ }
+}
+#endif
--- /dev/null
+#if MONO_FEATURE_APPLETLS
+//
+// SslConnection
+//
+// Authors:
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2014 Xamarin Inc.
+//
+
+using System;
+
+namespace Mono.AppleTls
+{
+ delegate SslStatus SslReadFunc (IntPtr connection, IntPtr data, /* size_t* */ ref IntPtr dataLength);
+ delegate SslStatus SslWriteFunc (IntPtr connection, IntPtr data, /* size_t* */ ref IntPtr dataLength);
+}
+#endif
--- /dev/null
+#if SECURITY_DEP && MONO_FEATURE_APPLETLS
+//
+// Trust.cs: Implements the managed SecTrust wrapper.
+//
+// Authors:
+// Miguel de Icaza
+// Sebastien Pouliot <sebastien@xamarin.com>
+//
+// Copyright 2010 Novell, Inc
+// Copyright 2012-2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.Cryptography.X509Certificates;
+using ObjCRuntime;
+using Mono.Net;
+
+namespace Mono.AppleTls {
+ partial class SecTrust : INativeObject, IDisposable {
+ IntPtr handle;
+
+ internal SecTrust (IntPtr handle, bool owns = false)
+ {
+ if (handle == IntPtr.Zero)
+ throw new Exception ("Invalid handle");
+
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static SecStatusCode SecTrustCreateWithCertificates (
+ /* CFTypeRef */ IntPtr certOrCertArray,
+ /* CFTypeRef __nullable */ IntPtr policies,
+ /* SecTrustRef *__nonull */ out IntPtr sectrustref);
+
+
+ public SecTrust (X509CertificateCollection certificates, SecPolicy policy)
+ {
+ if (certificates == null)
+ throw new ArgumentNullException ("certificates");
+
+ SecCertificate[] array = new SecCertificate [certificates.Count];
+ int i = 0;
+ foreach (var certificate in certificates)
+ array [i++] = new SecCertificate (certificate);
+ Initialize (array, policy);
+ }
+
+ void Initialize (SecCertificate[] array, SecPolicy policy)
+ {
+ using (var certs = CFArray.CreateArray (array)) {
+ Initialize (certs.Handle, policy);
+ }
+ }
+
+ void Initialize (IntPtr certHandle, SecPolicy policy)
+ {
+ SecStatusCode result = SecTrustCreateWithCertificates (certHandle, policy == null ? IntPtr.Zero : policy.Handle, out handle);
+ if (result != SecStatusCode.Success)
+ throw new ArgumentException (result.ToString ());
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static SecStatusCode /* OSStatus */ SecTrustEvaluate (IntPtr /* SecTrustRef */ trust, out /* SecTrustResultType */ SecTrustResult result);
+
+ public SecTrustResult Evaluate ()
+ {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecTrust");
+
+ SecTrustResult trust;
+ SecStatusCode result = SecTrustEvaluate (handle, out trust);
+ if (result != SecStatusCode.Success)
+ throw new InvalidOperationException (result.ToString ());
+ return trust;
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static IntPtr /* CFIndex */ SecTrustGetCertificateCount (IntPtr /* SecTrustRef */ trust);
+
+ public int Count {
+ get {
+ if (handle == IntPtr.Zero)
+ return 0;
+ return (int) SecTrustGetCertificateCount (handle);
+ }
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static IntPtr /* SecCertificateRef */ SecTrustGetCertificateAtIndex (IntPtr /* SecTrustRef */ trust, IntPtr /* CFIndex */ ix);
+
+ public SecCertificate this [IntPtr index] {
+ get {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecTrust");
+ if (((long)index < 0) || ((long)index >= Count))
+ throw new ArgumentOutOfRangeException ("index");
+
+ return new SecCertificate (SecTrustGetCertificateAtIndex (handle, index));
+ }
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificates (IntPtr /* SecTrustRef */ trust, IntPtr /* CFArrayRef */ anchorCertificates);
+
+ public SecStatusCode SetAnchorCertificates (X509CertificateCollection certificates)
+ {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecTrust");
+ if (certificates == null)
+ return SecTrustSetAnchorCertificates (handle, IntPtr.Zero);
+
+ SecCertificate[] array = new SecCertificate [certificates.Count];
+ int i = 0;
+ foreach (var certificate in certificates)
+ array [i++] = new SecCertificate (certificate);
+ return SetAnchorCertificates (array);
+ }
+
+ public SecStatusCode SetAnchorCertificates (SecCertificate[] array)
+ {
+ if (array == null)
+ return SecTrustSetAnchorCertificates (handle, IntPtr.Zero);
+ using (var certs = CFArray.FromNativeObjects (array)) {
+ return SecTrustSetAnchorCertificates (handle, certs.Handle);
+ }
+ }
+
+ [DllImport (AppleTlsContext.SecurityLibrary)]
+ extern static SecStatusCode /* OSStatus */ SecTrustSetAnchorCertificatesOnly (IntPtr /* SecTrustRef */ trust, bool anchorCertificatesOnly);
+
+ public SecStatusCode SetAnchorCertificatesOnly (bool anchorCertificatesOnly)
+ {
+ if (handle == IntPtr.Zero)
+ throw new ObjectDisposedException ("SecTrust");
+
+ return SecTrustSetAnchorCertificatesOnly (handle, anchorCertificatesOnly);
+ }
+
+ ~SecTrust ()
+ {
+ Dispose (false);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero) {
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ public IntPtr Handle {
+ get { return handle; }
+ }
+ }
+}
+#endif
-// Copyright 2015 Xamarin Inc. All rights reserved.
+//
+// MonoTlsProviderFactory.cs
+//
+// Author:
+// Chris Hamons <chris.hamons@xamarin.com>
+// Martin Baulig <martin.baulig@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#if !ONLY_APPLETLS
+#error Use MonoTlsProviderFactory.cs instead
+#endif
+
#if SECURITY_DEP
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
using MSI = MonoSecurity::Mono.Security.Interface;
+using MX = MonoSecurity::Mono.Security.X509;
#else
using MSI = Mono.Security.Interface;
+using MX = Mono.Security.X509;
#endif
+using System.Security.Cryptography.X509Certificates;
+using Mono.AppleTls;
+
+#endif
+
+using System;
+using System.Net;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
namespace Mono.Net.Security
{
+ /*
+ * Keep in sync with Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs.
+ * Simple implementation that does hard codes only a single provider
+ */
static partial class MonoTlsProviderFactory
{
- static MSI.MonoTlsProvider CreateDefaultProviderImpl ()
+ #region Internal API
+
+ /*
+ * APIs in this section are for consumption within System.dll only - do not access via
+ * reflection or from friend assemblies.
+ *
+ * @IMonoTlsProvider is defined as empty interface outside 'SECURITY_DEP', so we don't need
+ * this conditional here.
+ */
+
+ internal static IMonoTlsProvider GetProviderInternal ()
+ {
+#if SECURITY_DEP
+ return GetTlsProvider ();
+#else
+ throw new NotSupportedException ("TLS Support not available.");
+#endif
+ }
+
+ #endregion
+
+#if SECURITY_DEP
+ static object locker = new object ();
+ static IMonoTlsProvider provider;
+ static IMonoTlsProvider GetTlsProvider ()
{
- MSI.MonoTlsProvider provider = null;
- if (MSI.MonoTlsProviderFactory._PrivateFactoryDelegate != null)
- provider = MSI.MonoTlsProviderFactory._PrivateFactoryDelegate ();
- return provider;
+ lock (locker) {
+ if (provider == null)
+ provider = new Private.MonoTlsProviderWrapper (new AppleTlsProvider ());
+ return provider;
+ }
}
+
+
+ #region Mono.Security visible API
+
+ /*
+ * "Public" section, intended to be consumed via reflection.
+ *
+ * Mono.Security.dll provides a public wrapper around these.
+ */
+
+ internal static MSI.MonoTlsProvider GetProvider ()
+ {
+ return GetTlsProvider ().Provider;
+ }
+
+ internal static bool IsProviderSupported (string name)
+ {
+ return true;
+ }
+
+ internal static MSI.MonoTlsProvider GetProvider (string name)
+ {
+ return GetTlsProvider ().Provider;
+ }
+
+ internal static bool IsInitialized => true;
+
+ internal static void Initialize ()
+ {
+ }
+
+ internal static void Initialize (string provider)
+ {
+ }
+
+ internal static HttpWebRequest CreateHttpsRequest (Uri requestUri, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
+ {
+ lock (locker) {
+ var internalProvider = provider != null ? new Private.MonoTlsProviderWrapper (provider) : null;
+ return new HttpWebRequest (requestUri, internalProvider, settings);
+ }
+ }
+
+ internal static HttpListener CreateHttpListener (X509Certificate certificate, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
+ {
+ lock (locker) {
+ var internalProvider = provider != null ? new Private.MonoTlsProviderWrapper (provider) : null;
+ return new HttpListener (certificate, internalProvider, settings);
+ }
+ }
+ #endregion
+#endif
}
}
-#endif
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+#if !ONLY_APPLETLS // ONLY_APPLETLS uses MonoTlsProviderFactory.Apple.cs instead
+
#if SECURITY_DEP
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
return;
providerRegistration = new Dictionary<string,string> ();
providerRegistration.Add ("legacy", "Mono.Net.Security.LegacyTlsProvider");
- providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider");
+
+ if (Platform.IsMacOS)
+ providerRegistration.Add ("default", "Mono.AppleTls.AppleTlsProvider");
+ else
+ providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider");
+
if (IsBtlsSupported ())
providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider");
+
+ providerRegistration.Add ("apple", "Mono.AppleTls.AppleTlsProvider");
+
X509Helper2.Initialize ();
}
}
}
}
-
+#endif
--- /dev/null
+#if MONOTOUCH
+
+namespace MonoTouch
+{
+ // Exists only not to break existing source code due to broken C# namespace rules
+ // which allow using for empty namespace
+ sealed class Dummy
+ {
+ private Dummy ()
+ {
+
+ }
+ }
+}
+
+#endif
<DebugType>full</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime\src\System\Collections\Generic\ISet.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\OpenFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreLocation.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreName.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X500DistinguishedNameFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509ChainStatusFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509FindType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509IncludeOption.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509KeyUsageFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509NameType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationFlag.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleCertificateHelper.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsContext.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsProvider.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsStream.cs" />\r
+ <Compile Include="Mono.AppleTls\Certificate.cs" />\r
+ <Compile Include="Mono.AppleTls\Enums.cs" />\r
+ <Compile Include="Mono.AppleTls\ImportExport.cs" />\r
+ <Compile Include="Mono.AppleTls\INativeObject.cs" />\r
+ <Compile Include="Mono.AppleTls\Items.cs" />\r
+ <Compile Include="Mono.AppleTls\Policy.cs" />\r
+ <Compile Include="Mono.AppleTls\SecureTransport.cs" />\r
+ <Compile Include="Mono.AppleTls\SslConnection.cs" />\r
+ <Compile Include="Mono.AppleTls\Trust.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
<Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
+ <Compile Include="MonoTouch\Dummy.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Security.Authentication\HashAlgorithmType.cs" />\r
<Compile Include="System.Security.Authentication\InvalidCredentialException.cs" />\r
<Compile Include="System.Security.Authentication\SslProtocols.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\OpenFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\OSX509Certificates.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\PublicKey.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreLocation.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreName.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedName.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedNameFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509BasicConstraintsExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Collection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainImplMono.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainPolicy.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatus.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatusFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509EnhancedKeyUsageExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Extension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionCollection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionEnumerator.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509FindType.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Helper2.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509IncludeOption.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageFlags.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509NameType.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationFlag.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationMode.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Store.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedData.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataCollection.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataEnumerator.cs" />\r
<DebugType>full</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime\src\System\Collections\Generic\ISet.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\OpenFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreLocation.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreName.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X500DistinguishedNameFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509ChainStatusFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509FindType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509IncludeOption.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509KeyUsageFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509NameType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationFlag.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleCertificateHelper.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsContext.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsProvider.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsStream.cs" />\r
+ <Compile Include="Mono.AppleTls\Certificate.cs" />\r
+ <Compile Include="Mono.AppleTls\Enums.cs" />\r
+ <Compile Include="Mono.AppleTls\ImportExport.cs" />\r
+ <Compile Include="Mono.AppleTls\INativeObject.cs" />\r
+ <Compile Include="Mono.AppleTls\Items.cs" />\r
+ <Compile Include="Mono.AppleTls\Policy.cs" />\r
+ <Compile Include="Mono.AppleTls\SecureTransport.cs" />\r
+ <Compile Include="Mono.AppleTls\SslConnection.cs" />\r
+ <Compile Include="Mono.AppleTls\Trust.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
<Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
+ <Compile Include="MonoTouch\Dummy.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Security.Authentication\HashAlgorithmType.cs" />\r
<Compile Include="System.Security.Authentication\InvalidCredentialException.cs" />\r
<Compile Include="System.Security.Authentication\SslProtocols.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\OpenFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\OSX509Certificates.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\PublicKey.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreLocation.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreName.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedName.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedNameFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509BasicConstraintsExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Collection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainImplMono.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainPolicy.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatus.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatusFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509EnhancedKeyUsageExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Extension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionCollection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionEnumerator.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509FindType.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Helper2.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509IncludeOption.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageFlags.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509NameType.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationFlag.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationMode.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Store.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedData.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataCollection.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataEnumerator.cs" />\r
<DebugType>full</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>1699,436</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;CODEDOM;MONO_FEATURE_APPLETLS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime.Extensions\src\System\CodeDom\Compiler\IndentedTextWriter.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Runtime\src\System\Collections\Generic\ISet.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\OpenFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreLocation.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\StoreName.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X500DistinguishedNameFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509ChainStatusFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509FindType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509IncludeOption.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509KeyUsageFlags.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509NameType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationFlag.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509RevocationMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\compiler\GeneratedCodeAttribute.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
<Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleCertificateHelper.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsContext.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsProvider.cs" />\r
+ <Compile Include="Mono.AppleTls\AppleTlsStream.cs" />\r
+ <Compile Include="Mono.AppleTls\Certificate.cs" />\r
+ <Compile Include="Mono.AppleTls\Enums.cs" />\r
+ <Compile Include="Mono.AppleTls\ImportExport.cs" />\r
+ <Compile Include="Mono.AppleTls\INativeObject.cs" />\r
+ <Compile Include="Mono.AppleTls\Items.cs" />\r
+ <Compile Include="Mono.AppleTls\Policy.cs" />\r
+ <Compile Include="Mono.AppleTls\SecureTransport.cs" />\r
+ <Compile Include="Mono.AppleTls\SslConnection.cs" />\r
+ <Compile Include="Mono.AppleTls\Trust.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
<Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
<Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
+ <Compile Include="MonoTouch\Dummy.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Security.Authentication\HashAlgorithmType.cs" />\r
<Compile Include="System.Security.Authentication\InvalidCredentialException.cs" />\r
<Compile Include="System.Security.Authentication\SslProtocols.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\OpenFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\OSX509Certificates.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\PublicKey.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreLocation.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\StoreName.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedName.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X500DistinguishedNameFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509BasicConstraintsExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Collection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainImplMono.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainPolicy.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatus.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainStatusFlags.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509EnhancedKeyUsageExtension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Extension.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionCollection.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509ExtensionEnumerator.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509FindType.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Helper2.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509IncludeOption.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509KeyUsageFlags.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509NameType.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationFlag.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509RevocationMode.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Store.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierExtension.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509SubjectKeyIdentifierHashAlgorithm.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509VerificationFlags.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedData.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataCollection.cs" />\r
<Compile Include="System.Security.Cryptography\AsnEncodedDataEnumerator.cs" />\r
return new ConfigXmlCDataSection (this, data);
}
- public override XmlComment CreateComment (string comment)
+ public override XmlComment CreateComment (string data)
{
- return new ConfigXmlComment (this, comment);
+ return new ConfigXmlComment (this, data);
}
public override XmlElement CreateElement (string prefix, string localName, string namespaceUri)
get { return properties; }
}
- public override bool Equals (object o)
+ public override bool Equals (object settings)
{
- SettingElement e = o as SettingElement;
+ SettingElement e = settings as SettingElement;
if (e == null)
return false;
{
SpecialSetting setting;
- public SpecialSettingAttribute (SpecialSetting setting)
+ public SpecialSettingAttribute (SpecialSetting specialSetting)
{
- this.setting = setting;
+ this.setting = specialSetting;
}
public SpecialSetting SpecialSetting {
return CounterSampleCalculator.ComputeCounterValue (counterSample, nextCounterSample);
}
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- if (!(obj is CounterSample))
+ if (!(o is CounterSample))
return false;
- return Equals ((CounterSample) obj);
+ return Equals ((CounterSample) o);
}
- public bool Equals (CounterSample other)
+ public bool Equals (CounterSample sample)
{
return
- rawValue == other.rawValue &&
- baseValue == other.counterFrequency &&
- counterFrequency == other.counterFrequency &&
- systemFrequency == other.systemFrequency &&
- timeStamp == other.timeStamp &&
- timeStamp100nSec == other.timeStamp100nSec &&
- counterTimeStamp == other.counterTimeStamp &&
- counterType == other.counterType;
+ rawValue == sample.rawValue &&
+ baseValue == sample.counterFrequency &&
+ counterFrequency == sample.counterFrequency &&
+ systemFrequency == sample.systemFrequency &&
+ timeStamp == sample.timeStamp &&
+ timeStamp100nSec == sample.timeStamp100nSec &&
+ counterTimeStamp == sample.counterTimeStamp &&
+ counterType == sample.counterType;
}
- public static bool operator == (CounterSample obj1, CounterSample obj2)
+ public static bool operator == (CounterSample a, CounterSample b)
{
- return obj1.Equals (obj2);
+ return a.Equals (b);
}
- public static bool operator != (CounterSample obj1, CounterSample obj2)
+ public static bool operator != (CounterSample a, CounterSample b)
{
- return !obj1.Equals (obj2);
+ return !a.Equals (b);
}
public override int GetHashCode ()
get { return this; }
}
- public void CopyTo (EventLogEntry[] eventLogEntries, int index)
+ public void CopyTo (EventLogEntry[] entries, int index)
{
- EventLogEntry[] entries = _impl.GetEntries ();
- Array.Copy (entries, 0, eventLogEntries, index, entries.Length);
+ EventLogEntry[] evLogEntries = _impl.GetEntries ();
+ Array.Copy (evLogEntries, 0, entries, index, evLogEntries.Length);
}
public IEnumerator GetEnumerator ()
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, object data)
{
EventLogEntryType type;
- switch (eventType) {
+ switch (severity) {
case TraceEventType.Critical:
case TraceEventType.Error:
type = EventLogEntryType.Error;
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, params object [] data)
{
string s = String.Empty;
arr [i] = data [i] != null ? data [i].ToString () : String.Empty;
s = String.Join (", ", arr);
}
- TraceData (eventCache, source, eventType, id, s);
+ TraceData (eventCache, source, severity, id, s);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string message)
{
- TraceData (eventCache, source, eventType, id, message);
+ TraceData (eventCache, source, severity, id, message);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string format, params object [] args)
{
- TraceEvent (eventCache, source, eventType, id, format != null ? String.Format (format, args) : null);
+ TraceEvent (eventCache, source, severity, id, format != null ? String.Format (format, args) : null);
}
}
}
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string arguments, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
}
}
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginRead (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
ReadMethod r = new ReadMethod (ReadInternal);
- return r.BeginInvoke (buffer, offset, count, cback, state);
+ return r.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginWrite (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanWrite)
throw new InvalidOperationException ("This stream does not support writing");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
WriteMethod w = new WriteMethod (WriteInternal);
- return w.BeginInvoke (buffer, offset, count, cback, state);
+ return w.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override int EndRead(IAsyncResult async_result)
+ public override int EndRead(IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
ReadMethod r = ares.AsyncDelegate as ReadMethod;
if (r == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- return r.EndInvoke (async_result);
+ return r.EndInvoke (asyncResult);
}
- public override void EndWrite (IAsyncResult async_result)
+ public override void EndWrite (IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
WriteMethod w = ares.AsyncDelegate as WriteMethod;
if (w == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- w.EndInvoke (async_result);
+ w.EndInvoke (asyncResult);
return;
}
return encoding.GetString (seen.ToArray ());
}
- public void Write (string str)
+ public void Write (string text)
{
CheckOpen ();
- if (str == null)
- throw new ArgumentNullException ("str");
+ if (text == null)
+ throw new ArgumentNullException ("text");
- byte [] buffer = encoding.GetBytes (str);
+ byte [] buffer = encoding.GetBytes (text);
Write (buffer, 0, buffer.Length);
}
stream.Write (bytes, 0, bytes.Length);
}
- public void WriteLine (string str)
+ public void WriteLine (string text)
{
- Write (str + new_line);
+ Write (text + new_line);
}
void CheckOpen ()
return av;
}
- public static AlternateView CreateAlternateViewFromString (string content, Encoding encoding, string mediaType)
+ public static AlternateView CreateAlternateViewFromString (string content, Encoding contentEncoding, string mediaType)
{
if (content == null)
throw new ArgumentNullException ("content");
- if (encoding == null)
- encoding = Encoding.UTF8;
- MemoryStream ms = new MemoryStream (encoding.GetBytes (content));
+ if (contentEncoding == null)
+ contentEncoding = Encoding.UTF8;
+ MemoryStream ms = new MemoryStream (contentEncoding.GetBytes (content));
ContentType ct = new ContentType ();
ct.MediaType = mediaType;
- ct.CharSet = encoding.HeaderName;
+ ct.CharSet = contentEncoding.HeaderName;
AlternateView av = new AlternateView (ms, ct);
av.TransferEncoding = TransferEncoding.QuotedPrintable;
return av;
#region Methods
- public override bool Equals (object obj)
+ public override bool Equals (object value)
{
- if (obj == null)
+ if (value == null)
return false;
- return (0 == String.Compare (ToString (), obj.ToString (), StringComparison.OrdinalIgnoreCase));
+ return (0 == String.Compare (ToString (), value.ToString (), StringComparison.OrdinalIgnoreCase));
}
public override int GetHashCode ()
}
}
- public void Send (string from, string to, string subject, string body)
+ public void Send (string from, string recipients, string subject, string body)
{
- Send (new MailMessage (from, to, subject, body));
+ Send (new MailMessage (from, recipients, subject, body));
}
public Task SendMailAsync (MailMessage message)
worker.RunWorkerAsync (userToken);
}
- public void SendAsync (string from, string to, string subject, string body, object userToken)
+ public void SendAsync (string from, string recipients, string subject, string body, object userToken)
{
- SendAsync (new MailMessage (from, to, subject, body), userToken);
+ SendAsync (new MailMessage (from, recipients, subject, body), userToken);
}
public void SendAsyncCancel ()
{
}
- protected SmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ protected SmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
try {
- statusCode = (SmtpStatusCode) info.GetValue ("Status", typeof (int));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("Status", typeof (int));
} catch (SerializationException) {
//For compliance with previously serialized version:
- statusCode = (SmtpStatusCode) info.GetValue ("statusCode", typeof (SmtpStatusCode));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("statusCode", typeof (SmtpStatusCode));
}
}
#endregion // Properties
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("Status", statusCode, typeof (int));
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("Status", statusCode, typeof (int));
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
{
}
- protected SmtpFailedRecipientException (SerializationInfo serializationInfo, StreamingContext streamingContext)
- : base (serializationInfo, streamingContext)
+ protected SmtpFailedRecipientException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
{
- if (serializationInfo == null)
- throw new ArgumentNullException ("serializationInfo");
- failedRecipient = serializationInfo.GetString ("failedRecipient");
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ failedRecipient = info.GetString ("failedRecipient");
}
public SmtpFailedRecipientException (SmtpStatusCode statusCode, string failedRecipient) : base (statusCode)
#region Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("innerExceptions", innerExceptions);
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("innerExceptions", innerExceptions);
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
sockares.Complete (acc_socket, total);
});
- public Socket EndAccept (IAsyncResult result)
+ public Socket EndAccept (IAsyncResult asyncResult)
{
int bytes;
byte[] buffer;
- return EndAccept (out buffer, out bytes, result);
+ return EndAccept (out buffer, out bytes, asyncResult);
}
public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
}
});
- public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+ return BeginConnect (Dns.GetHostAddresses (host), port, requestCallback, state);
}
- public IAsyncResult BeginConnect (EndPoint end_point, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("end_point");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
if (is_listening)
throw new InvalidOperationException ();
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
- EndPoint = end_point,
+ EndPoint = remoteEP,
};
// Bug #75154: Connect() should not succeed for .Any addresses.
- if (end_point is IPEndPoint) {
- IPEndPoint ep = (IPEndPoint) end_point;
+ if (remoteEP is IPEndPoint) {
+ IPEndPoint ep = (IPEndPoint) remoteEP;
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
return sockares;
}
- end_point = RemapIPEndPoint (ep);
+ remoteEP = RemapIPEndPoint (ep);
}
int error = 0;
bool blk = is_blocking;
if (blk)
Blocking = false;
- Connect_internal (m_Handle, end_point.Serialize (), out error, false);
+ Connect_internal (m_Handle, remoteEP.Serialize (), out error, false);
if (blk)
Blocking = true;
return sockares;
}
- public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
+ SocketAsyncResult sockares = new SocketAsyncResult (this, requestCallback, state, SocketOperation.Connect) {
Addresses = addresses,
Port = port,
};
}
});
- public void EndConnect (IAsyncResult result)
+ public void EndConnect (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndConnect", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndConnect", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
}
});
- public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.ReceiveFrom) {
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
sockares.Complete (total);
});
- public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
+ public int EndReceiveFrom(IAsyncResult asyncResult, ref EndPoint endPoint)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("remote_end");
+ if (endPoint == null)
+ throw new ArgumentNullException ("endPoint");
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndReceiveFrom", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveFrom", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
sockares.CheckIfThrowDelayedException();
- end_point = sockares.EndPoint;
+ endPoint = sockares.EndPoint;
return sockares.Total;
}
}
});
- public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
sockares.Complete ();
}
- public int EndSendTo (IAsyncResult result)
+ public int EndSendTo (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndSendTo", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndSendTo", "result");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
void QueueIOSelectorJob (SemaphoreSlim sem, IntPtr handle, IOSelectorJob job)
{
- sem.WaitAsync ().ContinueWith (t => {
+ var task = sem.WaitAsync();
+ // fast path without Task<Action> allocation.
+ if (task.IsCompleted) {
if (CleanedUp) {
job.MarkDisposed ();
return;
}
-
IOSelector.Add (handle, job);
- });
+ }
+ else
+ {
+ task.ContinueWith( t => {
+ if (CleanedUp) {
+ job.MarkDisposed ();
+ return;
+ }
+ IOSelector.Add(handle, job);
+ });
+ }
}
void InitSocketAsyncEventArgs (SocketAsyncEventArgs e, AsyncCallback callback, object state, SocketOperation operation)
Socket completedSocket = socket;
SocketOperation completedOperation = operation;
- AsyncCallback callback = AsyncCallback;
- if (callback != null) {
- ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
+ if (this.AsyncCallback != null) {
+ ThreadPool.UnsafeQueueUserWorkItem(state => ((SocketAsyncResult)state).AsyncCallback((SocketAsyncResult)state), this);
}
/* Warning: any field on the current SocketAsyncResult might have changed, as the callback might have
return result.Response;
}
- public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
+ public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext context)
{
- transportContext = null;
+ context = null;
return EndGetRequestStream (asyncResult);
}
}
string content_encoding = webHeaders ["Content-Encoding"];
- if (content_encoding == "gzip" && (data.request.AutomaticDecompression & DecompressionMethods.GZip) != 0)
+ if (content_encoding == "gzip" && (data.request.AutomaticDecompression & DecompressionMethods.GZip) != 0) {
stream = new GZipStream (stream, CompressionMode.Decompress);
- else if (content_encoding == "deflate" && (data.request.AutomaticDecompression & DecompressionMethods.Deflate) != 0)
+ webHeaders.Remove (HttpRequestHeader.ContentEncoding);
+ }
+ else if (content_encoding == "deflate" && (data.request.AutomaticDecompression & DecompressionMethods.Deflate) != 0) {
stream = new DeflateStream (stream, CompressionMode.Decompress);
+ webHeaders.Remove (HttpRequestHeader.ContentEncoding);
+ }
}
[Obsolete ("Serialization is obsoleted for this type", false)]
if (start_host >= length)
throw new ArgumentException ("No host specified.");
- int colon = uri.IndexOf (':', start_host, length - start_host);
- int root;
- if (colon > 0) {
- host = uri.Substring (start_host, colon - start_host);
- root = uri.IndexOf ('/', colon, length - colon);
- port = (ushort) Int32.Parse (uri.Substring (colon + 1, root - colon - 1));
- path = uri.Substring (root);
+ int startPort = uri.IndexOf (':', start_host, length - start_host);
+ if (uri [start_host] == '[') {
+ startPort = uri.IndexOf ("]:") + 1;
+ }
+ if (start_host == startPort)
+ throw new ArgumentException ("No host specified.");
+
+ int root = uri.IndexOf ('/', start_host, length - start_host);
+ if (root == -1)
+ throw new ArgumentException ("No path specified.");
+
+ if (startPort > 0) {
+ host = uri.Substring (start_host, startPort - start_host).Trim ('[', ']');
+ port = UInt16.Parse (uri.Substring (startPort + 1, root - startPort - 1));
} else {
- root = uri.IndexOf ('/', start_host, length - start_host);
- host = uri.Substring (start_host, root - start_host);
+ host = uri.Substring (start_host, root - start_host).Trim ('[', ']');
port = default_port;
- path = uri.Substring (root);
}
+ path = uri.Substring (root);
+
if (path.Length != 1)
path = path.Substring (0, path.Length - 1);
}
if (uri == null)
throw new ArgumentNullException ("uriPrefix");
- if(!uri.StartsWith ("http://") && !uri.StartsWith ("https://"))
+ if (!uri.StartsWith ("http://") && !uri.StartsWith ("https://"))
throw new ArgumentException ("Only 'http' and 'https' schemes are supported.");
int length = uri.Length;
if (start_host >= length)
throw new ArgumentException ("No host specified.");
- int colon = uri.IndexOf (':', start_host, length - start_host);
- if (start_host == colon)
+ int startPort = uri.IndexOf (':', start_host, length - start_host);
+ if (uri [start_host] == '[')
+ startPort = uri.IndexOf ("]:") + 1;
+ if (start_host == startPort)
throw new ArgumentException ("No host specified.");
+ int root = uri.IndexOf ('/', start_host, length - start_host);
+ if (root == -1)
+ throw new ArgumentException ("No path specified.");
- int root;
- if (colon > 0) {
- root = uri.IndexOf ('/', colon, length - colon);
- if (root == -1)
- throw new ArgumentException ("No path specified.");
-
+ if (startPort > 0) {
try {
- int p = Int32.Parse (uri.Substring (colon + 1, root - colon - 1));
+ int p = Int32.Parse (uri.Substring (startPort + 1, root - startPort - 1));
if (p <= 0 || p >= 65536)
throw new Exception ();
} catch {
throw new ArgumentException ("Invalid port.");
}
- } else {
- root = uri.IndexOf ('/', start_host, length - start_host);
- if (root == -1)
- throw new ArgumentException ("No path specified.");
}
if (uri [uri.Length - 1] != '/')
}
}
#endif
-
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
+using ObjCRuntime;
namespace Mono.Net
{
- internal class CFObject : IDisposable
+ internal class CFType {
+ [DllImport (CFObject.CoreFoundationLibrary, EntryPoint="CFGetTypeID")]
+ public static extern IntPtr GetTypeID (IntPtr typeRef);
+ }
+
+ internal class CFObject : IDisposable, INativeObject
{
public const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";
const string SystemLibrary = "/usr/lib/libSystem.dylib";
return dlsym (handle, symbol);
}
+ public static CFString GetStringConstant (IntPtr handle, string symbol)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return null;
+ var actual = Marshal.ReadIntPtr (indirect);
+ if (actual == IntPtr.Zero)
+ return null;
+ return new CFString (actual, false);
+ }
+
+ public static IntPtr GetIntPtr (IntPtr handle, string symbol)
+ {
+ var indirect = dlsym (handle, symbol);
+ if (indirect == IntPtr.Zero)
+ return IntPtr.Zero;
+ return Marshal.ReadIntPtr (indirect);
+ }
+
public static IntPtr GetCFObjectHandle (IntPtr handle, string symbol)
{
var indirect = dlsym (handle, symbol);
public IntPtr Handle { get; private set; }
[DllImport (CoreFoundationLibrary)]
- extern static IntPtr CFRetain (IntPtr handle);
+ internal extern static IntPtr CFRetain (IntPtr handle);
void Retain ()
{
}
[DllImport (CoreFoundationLibrary)]
- extern static void CFRelease (IntPtr handle);
+ internal extern static void CFRelease (IntPtr handle);
void Release ()
{
dlclose (handle);
}
}
+
+ public static CFArray FromNativeObjects (params INativeObject[] values)
+ {
+ return new CFArray (Create (values), true);
+ }
+
+ public static unsafe IntPtr Create (params IntPtr[] values)
+ {
+ if (values == null)
+ throw new ArgumentNullException ("values");
+ fixed (IntPtr* pv = values) {
+ return CFArrayCreate (IntPtr.Zero, (IntPtr) pv, (IntPtr)values.Length, kCFTypeArrayCallbacks);
+ }
+ }
- static unsafe CFArray Create (params IntPtr[] values)
+ internal static unsafe CFArray CreateArray (params IntPtr[] values)
{
if (values == null)
throw new ArgumentNullException ("values");
return new CFArray (handle, false);
}
}
+
+ public static CFArray CreateArray (params INativeObject[] values)
+ {
+ return new CFArray (Create (values), true);
+ }
- public static CFArray Create (params CFObject[] values)
+ public static IntPtr Create (params INativeObject[] values)
{
if (values == null)
throw new ArgumentNullException ("values");
-
IntPtr[] _values = new IntPtr [values.Length];
- for (int i = 0; i < _values.Length; i++)
- _values[i] = values[i].Handle;
-
+ for (int i = 0; i < _values.Length; ++i)
+ _values [i] = values [i].Handle;
return Create (_values);
}
return CFArrayGetValueAtIndex (Handle, (IntPtr) index);
}
}
+
+ static public T [] ArrayFromHandle<T> (IntPtr handle, Func<IntPtr, T> creation) where T : class, INativeObject
+ {
+ if (handle == IntPtr.Zero)
+ return null;
+
+ var c = CFArrayGetCount (handle);
+ T [] ret = new T [(int)c];
+
+ for (uint i = 0; i < (uint)c; i++) {
+ ret [i] = creation (CFArrayGetValueAtIndex (handle, (IntPtr)i));
+ }
+ return ret;
+ }
}
internal class CFNumber : CFObject
return value;
}
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static IntPtr CFNumberCreate (IntPtr allocator, IntPtr theType, IntPtr valuePtr);
+
+ public static CFNumber FromInt32 (int number)
+ {
+ // 9 == kCFNumberIntType == C int
+ return new CFNumber (CFNumberCreate (IntPtr.Zero, (IntPtr)9, (IntPtr)number), true);
+ }
public static implicit operator int (CFNumber number)
{
}
}
+
+ internal class CFData : CFObject
+ {
+ public CFData (IntPtr handle, bool own) : base (handle, own) { }
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static /* CFDataRef */ IntPtr CFDataCreate (/* CFAllocatorRef */ IntPtr allocator, /* UInt8* */ IntPtr bytes, /* CFIndex */ IntPtr length);
+ public unsafe static CFData FromData (byte [] buffer)
+ {
+ fixed (byte* p = buffer)
+ {
+ return FromData ((IntPtr)p, (IntPtr)buffer.Length);
+ }
+ }
+
+ public static CFData FromData (IntPtr buffer, IntPtr length)
+ {
+ return new CFData (CFDataCreate (IntPtr.Zero, buffer, length), true);
+ }
+
+ public IntPtr Length {
+ get { return CFDataGetLength (Handle); }
+ }
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static /* CFIndex */ IntPtr CFDataGetLength (/* CFDataRef */ IntPtr theData);
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static /* UInt8* */ IntPtr CFDataGetBytePtr (/* CFDataRef */ IntPtr theData);
+
+ /*
+ * Exposes a read-only pointer to the underlying storage.
+ */
+ public IntPtr Bytes {
+ get { return CFDataGetBytePtr (Handle); }
+ }
+
+ public byte this [long idx] {
+ get {
+ if (idx < 0 || (ulong) idx > (ulong) Length)
+ throw new ArgumentException ("idx");
+ return Marshal.ReadByte (new IntPtr (Bytes.ToInt64 () + idx));
+ }
+
+ set {
+ throw new NotImplementedException ("NSData arrays can not be modified, use an NSMutableData instead");
+ }
+ }
+
+ }
+
internal class CFDictionary : CFObject
{
+ static readonly IntPtr KeyCallbacks;
+ static readonly IntPtr ValueCallbacks;
+
+ static CFDictionary ()
+ {
+ var handle = dlopen (CoreFoundationLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+
+ try {
+ KeyCallbacks = GetIndirect (handle, "kCFTypeDictionaryKeyCallBacks");
+ ValueCallbacks = GetIndirect (handle, "kCFTypeDictionaryValueCallBacks");
+ } finally {
+ dlclose (handle);
+ }
+ }
+
public CFDictionary (IntPtr handle, bool own) : base (handle, own) { }
+ public static CFDictionary FromObjectAndKey (IntPtr obj, IntPtr key)
+ {
+ return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, new IntPtr[] { key }, new IntPtr [] { obj }, (IntPtr)1, KeyCallbacks, ValueCallbacks), true);
+ }
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static IntPtr CFDictionaryCreate (IntPtr allocator, IntPtr[] keys, IntPtr[] vals, IntPtr len, IntPtr keyCallbacks, IntPtr valCallbacks);
+
[DllImport (CoreFoundationLibrary)]
extern static IntPtr CFDictionaryGetValue (IntPtr handle, IntPtr key);
+ [DllImport (CoreFoundationLibrary)]
+ extern static IntPtr CFDictionaryCreateCopy (IntPtr allocator, IntPtr handle);
+
+ public CFDictionary Copy ()
+ {
+ return new CFDictionary (CFDictionaryCreateCopy (IntPtr.Zero, Handle), true);
+ }
+
+ public CFMutableDictionary MutableCopy ()
+ {
+ return new CFMutableDictionary (CFDictionaryCreateMutableCopy (IntPtr.Zero, IntPtr.Zero, Handle), true);
+ }
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static IntPtr CFDictionaryCreateMutableCopy (IntPtr allocator, IntPtr capacity, IntPtr theDict);
+
public IntPtr GetValue (IntPtr key)
{
return CFDictionaryGetValue (Handle, key);
}
}
}
+
+ internal class CFMutableDictionary : CFDictionary
+ {
+ public CFMutableDictionary (IntPtr handle, bool own) : base (handle, own) { }
+
+ public void SetValue (IntPtr key, IntPtr val)
+ {
+ CFDictionarySetValue (Handle, key, val);
+ }
+
+ [DllImport (CoreFoundationLibrary)]
+ extern static void CFDictionarySetValue (IntPtr handle, IntPtr key, IntPtr val);
+ }
internal class CFUrl : CFObject
{
return new CFWebProxy ();
}
}
+
+ class CFBoolean : INativeObject, IDisposable {
+ IntPtr handle;
+
+ public static readonly CFBoolean True;
+ public static readonly CFBoolean False;
+
+ static CFBoolean ()
+ {
+ var handle = CFObject.dlopen (CFObject.CoreFoundationLibrary, 0);
+ if (handle == IntPtr.Zero)
+ return;
+ try {
+ True = new CFBoolean (CFObject.dlsym (handle, "kCFBooleanTrue"), false);
+ False = new CFBoolean (CFObject.dlsym (handle, "kCFBooleanFalse"), false);
+ }
+ finally {
+ CFObject.dlclose (handle);
+ }
+ }
+
+ internal CFBoolean (IntPtr handle, bool owns)
+ {
+ this.handle = handle;
+ if (!owns)
+ CFObject.CFRetain (handle);
+ }
+
+ ~CFBoolean ()
+ {
+ Dispose (false);
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.SuppressFinalize (this);
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ if (handle != IntPtr.Zero){
+ CFObject.CFRelease (handle);
+ handle = IntPtr.Zero;
+ }
+ }
+
+ public static implicit operator bool (CFBoolean value)
+ {
+ return value.Value;
+ }
+
+ public static explicit operator CFBoolean (bool value)
+ {
+ return FromBoolean (value);
+ }
+
+ public static CFBoolean FromBoolean (bool value)
+ {
+ return value ? True : False;
+ }
+
+ [DllImport (CFObject.CoreFoundationLibrary)]
+ [return: MarshalAs (UnmanagedType.I1)]
+ extern static /* Boolean */ bool CFBooleanGetValue (/* CFBooleanRef */ IntPtr boolean);
+
+ public bool Value {
+ get {return CFBooleanGetValue (handle);}
+ }
+
+ public static bool GetValue (IntPtr boolean)
+ {
+ return CFBooleanGetValue (boolean);
+ }
+ }
+
}
+++ /dev/null
-//
-// OpenFlags.cs - System.Security.Cryptography.X509Certificates.OpenFlags
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- public enum OpenFlags {
- ReadOnly,
- ReadWrite,
- MaxAllowed,
- OpenExistingOnly = 4,
- IncludeArchived = 8
- }
-}
-
+++ /dev/null
-//
-// StoreLocation.cs - System.Security.Cryptography.X509Certificates.StoreLocation
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum StoreLocation {
- CurrentUser = 1,
- LocalMachine = 2
- }
-}
-
+++ /dev/null
-//
-// StoreName.cs - System.Security.Cryptography.X509Certificates.StoreName
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum StoreName {
- AddressBook = 1,
- AuthRoot = 2,
- CertificateAuthority = 3,
- Disallowed = 4,
- My = 5,
- Root = 6,
- TrustedPeople = 7,
- TrustedPublisher = 8
- }
-}
-
+++ /dev/null
-//
-// System.Security.Cryptography.X509Certificates.X500DistinguishedNameFlags
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- public enum X500DistinguishedNameFlags {
- None = 0,
- Reversed = 1,
- UseSemicolons = 16,
- DoNotUsePlusSign = 32,
- DoNotUseQuotes = 64,
- UseCommas = 128,
- UseNewLines = 256,
- UseUTF8Encoding = 4096,
- UseT61Encoding = 8192,
- ForceUTF8Encoding = 16384
- }
-}
-
+++ /dev/null
-//
-// X509ChainStatusFlags.cs - System.Security.Cryptography.X509Certificates.X509ChainStatusFlags
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- public enum X509ChainStatusFlags {
- NoError = 0,
- NotTimeValid = 1,
- NotTimeNested = 2,
- Revoked = 4,
- NotSignatureValid = 8,
- NotValidForUsage = 16,
- UntrustedRoot = 32,
- RevocationStatusUnknown = 64,
- Cyclic = 128,
- InvalidExtension = 256,
- InvalidPolicyConstraints = 512,
- InvalidBasicConstraints = 1024,
- InvalidNameConstraints = 2048,
- HasNotSupportedNameConstraint = 4096,
- HasNotDefinedNameConstraint = 8192,
- HasNotPermittedNameConstraint = 16384,
- HasExcludedNameConstraint = 32768,
- PartialChain = 65536,
- CtlNotTimeValid = 131072,
- CtlNotSignatureValid = 262144,
- CtlNotValidForUsage = 524288,
- OfflineRevocation = 16777216,
- NoIssuanceChainPolicy = 33554432,
- ExplicitDistrust = 67108864,
- HasNotSupportedCriticalExtension = 134217728,
- HasWeakSignature = 1048576,
- }
-}
-
+++ /dev/null
-//
-// X509FindType.cs - System.Security.Cryptography.X509Certificates.X509FindType
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509FindType {
- FindByThumbprint,
- FindBySubjectName,
- FindBySubjectDistinguishedName,
- FindByIssuerName,
- FindByIssuerDistinguishedName,
- FindBySerialNumber,
- FindByTimeValid,
- FindByTimeNotYetValid,
- FindByTimeExpired,
- FindByTemplateName,
- FindByApplicationPolicy,
- FindByCertificatePolicy,
- FindByExtension,
- FindByKeyUsage,
- FindBySubjectKeyIdentifier,
- }
-}
-
+++ /dev/null
-//
-// X509IncludeOption.cs - System.Security.Cryptography.X509IncludeOption
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509IncludeOption {
- None,
- ExcludeRoot,
- EndCertOnly,
- WholeChain
- }
-}
-
+++ /dev/null
-//
-// X509KeyUsageFlags.cs - System.Security.Cryptography.X509Certificates.X509KeyUsageFlags
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if SECURITY_DEP
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- public enum X509KeyUsageFlags {
- None = 0,
- EncipherOnly = 1,
- CrlSign = 2,
- KeyCertSign = 4,
- KeyAgreement = 8,
- DataEncipherment = 16,
- KeyEncipherment = 32,
- NonRepudiation = 64,
- DigitalSignature = 128,
- DecipherOnly = 32768
- }
-}
-
-#endif
+++ /dev/null
-//
-// X509NameType.cs - System.Security.Cryptography.X509NameType
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if SECURITY_DEP
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509NameType {
- SimpleName,
- EmailName,
- UpnName,
- DnsName,
- DnsFromAlternativeName,
- UrlName
- }
-}
-
-#endif
+++ /dev/null
-//
-// X509RevocationFlag.cs - System.Security.Cryptography.X509Certificates.X509RevocationFlag
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509RevocationFlag {
- EndCertificateOnly = 0,
- EntireChain = 1,
- ExcludeRoot = 2
- }
-}
-
+++ /dev/null
-//
-// X509RevocationMode.cs - System.Security.Cryptography.X509Certificates.X509RevocationMode
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509RevocationMode {
- NoCheck,
- Online,
- Offline
- }
-}
-
+++ /dev/null
-//
-// System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierHashAlgorithm
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- public enum X509SubjectKeyIdentifierHashAlgorithm {
- Sha1 = 0,
- ShortSha1 = 1,
- CapiSha1 = 2
- }
-}
-
+++ /dev/null
-//
-// X509VerificationFlags.cs - System.Security.Cryptography.X509Certificates.X509VerificationFlags
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- public enum X509VerificationFlags {
- NoFlag = 0,
- IgnoreNotTimeValid = 1,
- IgnoreCtlNotTimeValid = 2,
- IgnoreNotTimeNested = 4,
- IgnoreInvalidBasicConstraints = 8,
- AllowUnknownCertificateAuthority = 16,
- IgnoreWrongUsage = 32,
- IgnoreInvalidName = 64,
- IgnoreInvalidPolicy = 128,
- IgnoreEndRevocationUnknown = 256,
- IgnoreCtlSignerRevocationUnknown = 512,
- IgnoreCertificateAuthorityRevocationUnknown = 1024,
- IgnoreRootRevocationUnknown = 2048,
- AllFlags = IgnoreNotTimeValid | IgnoreCtlNotTimeValid | IgnoreNotTimeNested |
- IgnoreInvalidBasicConstraints | AllowUnknownCertificateAuthority |
- IgnoreWrongUsage | IgnoreInvalidName | IgnoreInvalidPolicy |
- IgnoreEndRevocationUnknown | IgnoreCtlSignerRevocationUnknown |
- IgnoreCertificateAuthorityRevocationUnknown | IgnoreRootRevocationUnknown
- }
-}
-
_flags = StorePermissionFlags.NoFlags;
}
- public StorePermission (StorePermissionFlags flags)
+ public StorePermission (StorePermissionFlags flag)
{
// reuse validation by the Flags property
- Flags = flags;
+ Flags = flag;
}
return ((_flags & ~dp._flags) == 0);
}
- public override void FromXml (SecurityElement e)
+ public override void FromXml (SecurityElement securityElement)
{
// General validation in CodeAccessPermission
- PermissionHelper.CheckSecurityElement (e, "e", version, version);
+ PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
// Note: we do not (yet) care about the return value
// as we only accept version 1 (min/max values)
- string s = e.Attribute ("Flags");
+ string s = securityElement.Attribute ("Flags");
if (s == null)
_flags = StorePermissionFlags.NoFlags;
else
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
-#if !MOBILE && !MONOMAC
+#if !MOBILE && !MONOMAC && !XAMMAC_4_5
using System.Drawing.Design;
#endif
using NUnit.Framework;
return attr;
return null;
}
-#if !MOBILE && !MONOMAC
+#if !MOBILE && !MONOMAC && !XAMMAC_4_5
class GetEditor_test
{
[Editor (typeof (UIEditor), typeof (UITypeEditor))]
[TestFixture]
public class ToolboxItemAttributeTests
{
-#if !MOBILE && !MONOMAC
+#if !MOBILE && !MONOMAC && !XAMMAC_4_5
[Test]
public void DefaultType ()
{
[Test]
public void TestSettings2_Properties ()
{
+#if XAMMAC_4_5
+ string expected = "MonoTests.System.Configuration.ProviderPoker, xammac_net_4_5_System_test, Version=0.0.0.0";
+#else
string expected = "MonoTests.System.Configuration.ProviderPoker, net_4_x_System_test, Version=0.0.0.0";
+#endif
Assert.AreEqual (expected, new SettingsProviderAttribute (typeof (ProviderPoker)).ProviderTypeName.Substring (0, expected.Length), "#1");
TestSettings2 settings = new TestSettings2 ();
[TestFixture]
public class ProcessTest
{
+ static bool RunningOnUnix {
+ get {
+ int p = (int)Environment.OSVersion.Platform;
+ return ((p == 128) || (p == 4) || (p == 6));
+ }
+ }
+
[Test]
public void GetProcessById_MachineName_Null ()
{
bytesRead = stm.EndRead (ar);
}
- static bool RunningOnUnix {
- get {
- int p = (int)Environment.OSVersion.Platform;
- return ((p == 128) || (p == 4) || (p == 6));
- }
- }
-
public int bytesRead = -1;
[Test]
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
- Assert.AreEqual ("info", ex.ParamName, "#5");
+ Assert.AreEqual ("serializationInfo", ex.ParamName, "#5");
}
}
}
class MySmtpException : SmtpException {
- public MySmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ public MySmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
}
}
}
[Test] //bug https://bugzilla.novell.com/show_bug.cgi?id=457120
+ [Category ("MacNotWorking")] // Works but launches a prompt on 10.12 that will fail if you don't click in a few seconds
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
WebHeaderCollection headers = resp.Headers;
Assert.AreEqual (6, headers.Count, "#1");
Assert.AreEqual ("9", headers ["Content-Length"], "#2");
- Assert.AreEqual ("utf-8", headers ["Content-Encoding"], "#3");
+ Assert.AreEqual ("identity", headers ["Content-Encoding"], "#3");
Assert.AreEqual ("text/xml; charset=UTF-8", headers ["Content-Type"], "#4");
Assert.AreEqual ("Wed, 08 Jan 2003 23:11:55 GMT", headers ["Last-Modified"], "#5");
Assert.AreEqual ("UserID=Miguel,StoreProfile=true", headers ["Set-Cookie"], "#6");
sw.WriteLine ("HTTP/1.0 200 OK");
sw.WriteLine ("Server: Mono/Test");
sw.WriteLine ("Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT");
- sw.WriteLine ("Content-Encoding: " + Encoding.UTF8.WebName);
+ sw.WriteLine ("Content-Encoding: identity");
sw.WriteLine ("Content-Type: text/xml; charset=UTF-8");
sw.WriteLine ("Content-Length: 9");
sw.WriteLine ("Set-Cookie: UserID=Miguel");
return Encoding.UTF8.GetBytes (sw.ToString ());
}
+
+ internal static byte [] GzipResponseHandler (Socket socket)
+ {
+ StringWriter sw = new StringWriter ();
+ sw.NewLine = "\r\n";
+ sw.WriteLine ("HTTP/1.0 200 OK");
+ sw.WriteLine ("Server: Mono/Test");
+ sw.WriteLine ("Content-Encoding: gzip");
+ sw.WriteLine ("Content-Type: text/xml; charset=UTF-8");
+ sw.WriteLine ();
+ sw.Flush ();
+
+ var gzipDummyXml = new byte[] {
+ 0x1f, 0x8b, 0x08, 0x08, 0xb6, 0xb1, 0xd3, 0x58, 0x00, 0x03, 0x74, 0x65, 0x73, 0x74, 0x67, 0x7a,
+ 0x00, 0xb3, 0x49, 0x29, 0xcd, 0xcd, 0xad, 0x54, 0xd0, 0xb7, 0x03, 0x00, 0xed, 0x55, 0x32, 0xec,
+ 0x09, 0x00, 0x00, 0x00 };
+ var header = Encoding.UTF8.GetBytes (sw.ToString ());
+
+ var response = new byte[gzipDummyXml.Length + header.Length];
+ header.CopyTo(response, 0);
+ gzipDummyXml.CopyTo(response, header.Length);
+
+ return response;
+ }
}
[TestFixture]
}
}
}
+
+
+ [Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+ public void AutomaticDecompression ()
+ {
+ IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
+ string url = "http://" + ep.ToString () + "/test/";
+
+ using (SocketResponder responder = new SocketResponder (ep, s => HttpWebResponseTest.GzipResponseHandler (s))) {
+ HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+ req.Method = "GET";
+ req.Timeout = 2000;
+ req.ReadWriteTimeout = 2000;
+ req.KeepAlive = false;
+ req.AutomaticDecompression = DecompressionMethods.GZip;
+
+ using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+ Stream rs = resp.GetResponseStream ();
+ byte [] buffer = new byte [24];
+ try {
+ // read full response
+ Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+ Assert.IsNull (resp.Headers[HttpRequestHeader.ContentEncoding]);
+ } finally {
+ rs.Close ();
+ req.Abort ();
+ }
+ }
+ }
+ }
}
}
}
[Test]
+ [Category ("MacNotWorking")] // SecCertificateCreateWithData does different things on 10.11 vs 10.12 with invalid certificates https://bugzilla.xamarin.com/show_bug.cgi?id=53689
[ExpectedException (typeof (CryptographicException))]
public void Pkcs12_1_WithoutPassword ()
{
}
[Test]
+ [Category ("MacNotWorking")] // SecCertificateCreateWithData does different things on 10.11 vs 10.12 with invalid certificates https://bugzilla.xamarin.com/show_bug.cgi?id=53689
public void Pkcs12_2_Properties ()
{
CheckPkcs12 (new X509Certificate (farscape_nopwd_pfx));
[Test]
[ExpectedException (typeof (CryptographicException))]
+ [Category ("MacNotWorking")] // SecCertificateCreateWithData does different things on 10.11 vs 10.12 with invalid certificates https://bugzilla.xamarin.com/show_bug.cgi?id=53689
public void Pkcs7_Ctor ()
{
new X509Certificate (farscape_pkcs7);
[Test]
[ExpectedException (typeof (CryptographicException))]
+ [Category ("MacNotWorking")] // SecCertificateCreateWithData does different things on 10.11 vs 10.12 with invalid certificates https://bugzilla.xamarin.com/show_bug.cgi?id=53689
public void Pkcs7_Import ()
{
X509Certificate x = new X509Certificate ();
System.Security.Cryptography/AsnEncodedDataCollection.cs
System.Security.Cryptography/AsnEncodedDataEnumerator.cs
-System.Security.Cryptography.X509Certificates/OpenFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/OpenFlags.cs
System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
System.Security.Cryptography.X509Certificates/PublicKey.cs
-System.Security.Cryptography.X509Certificates/StoreLocation.cs
-System.Security.Cryptography.X509Certificates/StoreName.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/StoreLocation.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/StoreName.cs
System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
-System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X500DistinguishedNameFlags.cs
System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtension.cs
System.Security.Cryptography.X509Certificates/X509Certificate2.cs
System.Security.Cryptography.X509Certificates/X509Certificate2Collection.cs
System.Security.Cryptography.X509Certificates/X509ChainImplMono.cs
System.Security.Cryptography.X509Certificates/X509ChainPolicy.cs
System.Security.Cryptography.X509Certificates/X509ChainStatus.cs
-System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ChainStatusFlags.cs
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs
System.Security.Cryptography.X509Certificates/X509Extension.cs
System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs
System.Security.Cryptography.X509Certificates/X509ExtensionEnumerator.cs
-System.Security.Cryptography.X509Certificates/X509FindType.cs
-System.Security.Cryptography.X509Certificates/X509IncludeOption.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509FindType.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509IncludeOption.cs
System.Security.Cryptography.X509Certificates/X509Helper2.cs
System.Security.Cryptography.X509Certificates/X509KeyUsageExtension.cs
-System.Security.Cryptography.X509Certificates/X509KeyUsageFlags.cs
-System.Security.Cryptography.X509Certificates/X509NameType.cs
-System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs
-System.Security.Cryptography.X509Certificates/X509RevocationMode.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509KeyUsageFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509NameType.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509RevocationFlag.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509RevocationMode.cs
System.Security.Cryptography.X509Certificates/X509Store.cs
System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.cs
-System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs
-System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509VerificationFlags.cs
System.Threading/ThreadExceptionEventArgs.cs
System.Threading/ThreadExceptionEventHandler.cs
Mono.Http/NtlmClient.cs
+Mono.AppleTls/AppleCertificateHelper.cs
+Mono.AppleTls/AppleTlsContext.cs
+Mono.AppleTls/AppleTlsProvider.cs
+Mono.AppleTls/AppleTlsStream.cs
+Mono.AppleTls/INativeObject.cs
+Mono.AppleTls/Certificate.cs
+Mono.AppleTls/ImportExport.cs
+Mono.AppleTls/Enums.cs
+Mono.AppleTls/SecureTransport.cs
+Mono.AppleTls/Policy.cs
+Mono.AppleTls/Trust.cs
+Mono.AppleTls/SslConnection.cs
+Mono.AppleTls/Items.cs
+
Mono.Net.Security/AsyncProtocolRequest.cs
Mono.Net.Security/CallbackHelpers.cs
Mono.Net.Security/ChainValidationHelper.cs
Mono.Util/MonoPInvokeCallbackAttribute.cs
+MonoTouch/Dummy.cs
+
ReferenceSources/AutoWebProxyScriptEngine.cs
ReferenceSources/AssertWrapper.cs
ReferenceSources/CAPI.cs
#include net_4_x_System.dll.sources
+Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
namespace System.ComponentModel {
- public delegate void CurrentChangingEventHandler (object sender, CurrentChangingEventArgs args);
+ public delegate void CurrentChangingEventHandler (object sender, CurrentChangingEventArgs e);
}
--- /dev/null
+thisdir = class/Xunit.NetCore.Extensions
+SUBDIRS =
+include ../../build/rules.make
+
+XUNIT_LIBS := xunit.core xunit.abstractions xunit.execution.desktop xunit.assert
+
+LIBRARY = Xunit.NetCore.Extensions.dll
+LIB_REFS = System System.Core System.Runtime.InteropServices.RuntimeInformation Facades/System.Runtime Facades/System.Threading.Tasks
+LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(XUNIT_LIBS))
+
+EXTRA_DISTFILES =
+
+NO_TEST = yes
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+
+include ../../build/library.make
--- /dev/null
+using System;
+using Xunit;
+using Xunit.Sdk;
+
+namespace Microsoft.Xunit.Performance
+{
+ [TraitDiscoverer("Microsoft.Xunit.Performance.BenchmarkDiscoverer", "Xunit.NetCore.Extensions")]
+ [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
+ public class BenchmarkAttribute : Attribute, ITraitAttribute
+ {
+ public long InnerIterationCount { get; set; }
+ }
+}
--- /dev/null
+using System.Collections.Generic;
+using Xunit.Sdk;
+using Xunit.Abstractions;
+
+namespace Xunit.NetCore.Extensions
+{
+ public class BenchmarkDiscoverer : ITraitDiscoverer
+ {
+ public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute)
+ {
+ yield return new KeyValuePair<string, string>("Benchmark", "True");
+ }
+ }
+}
--- /dev/null
+../../../external/buildtools/src/xunit.netcore.extensions/*.cs
+../../../external/buildtools/src/xunit.netcore.extensions/Attributes/*.cs
+../../../external/buildtools/src/xunit.netcore.extensions/Discoverers/*.cs
+
+Microsoft.Xunit.Performance/BenchmarkAttribute.cs
+Microsoft.Xunit.Performance/BenchmarkDiscover.cs
+#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509
using System;
using System.Runtime.InteropServices;
}
}
}
+#endif
LIB_MCS_FLAGS += -d:MONO_FEATURE_CONSOLE
endif
+ifdef MONO_FEATURE_APPLETLS
+LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLETLS
+endif
+
+ifdef ONLY_APPLETLS
+LIB_MCS_FLAGS += -d:ONLY_APPLETLS
+endif
+
+ifdef MONO_FEATURE_APPLE_X509
+LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLE_X509
+endif
+
WARNING_ABOUT_DISABLED_WARNING=1635
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
DEFAULT_REFERENCES =
}
}
+ public override bool IsSZArray {
+ get {
+ // TODO: intrinsic
+ return IsArray && ReferenceEquals (this, GetElementType ().MakeArrayType ());
+ }
+ }
+
internal override bool IsUserType {
get {
return false;
+#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509
using System;
using System.Text;
using System.Runtime.InteropServices;
}
}
}
+#endif
+++ /dev/null
-//
-// System.Security.Cryptography.X509Certificates.X509ContentType.cs
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography.X509Certificates {
-
-// Note: Definitions are useful for 1.0 and 1.1 so we declare them internal
-
- [ComVisible (true)]
- public
- enum X509ContentType {
- Unknown,
- Cert,
- // not supported by Silverlight 2.0 (MOBILE)
- SerializedCert,
- Pfx,
- SerializedStore,
- Pkcs7,
- Authenticode,
- Pkcs12 = Pfx
- }
-}
+#if MONO_FEATURE_APPLETLS || MONO_FEATURE_APPLE_X509
using System;
using System.Runtime.InteropServices;
using MX = Mono.Security.X509;
{
static partial class X509Helper
{
- public static X509CertificateImpl InitFromHandle (IntPtr handle)
+ public static X509CertificateImpl InitFromHandleApple (IntPtr handle)
{
return new X509CertificateImplApple (handle, false);
}
- static X509CertificateImpl Import (byte[] rawData)
+ static X509CertificateImpl ImportApple (byte[] rawData)
{
var handle = CFHelpers.CreateCertificateFromData (rawData);
if (handle != IntPtr.Zero)
}
}
}
+#endif
Interlocked.CompareExchange (ref nativeHelper, helper, null);
}
+#if MONO_FEATURE_APPLETLS
+ static bool ShouldUseAppleTls
+ {
+ get
+ {
+ if (!System.Environment.IsMacOS)
+ return false;
+ // MONO_TLS_PROVIDER values default or apple (not legacy or btls) and must be on MacOS
+ var variable = Environment.GetEnvironmentVariable ("MONO_TLS_PROVIDER");
+ return string.IsNullOrEmpty (variable) || variable == "default" || variable == "apple"; // On Platform.IsMacOS default is AppleTlsProvider
+ }
+ }
+#endif
+
+ public static X509CertificateImpl InitFromHandle (IntPtr handle)
+ {
+#if (MONO_FEATURE_APPLETLS && ONLY_APPLETLS) || MONO_FEATURE_APPLE_X509 // ONLY_APPLETLS should not support any other option
+ return InitFromHandleApple (handle);
+#else
+
+#if MONO_FEATURE_APPLETLS // If we support AppleTls, which is the default, and not overriding to legacy
+ if (ShouldUseAppleTls)
+ return InitFromHandleApple (handle);
+#endif
+#if !MOBILE
+ return InitFromHandleCore (handle);
+#elif !MONOTOUCH && !XAMMAC
+ throw new NotSupportedException ();
+#endif
+#endif
+ }
+
+ static X509CertificateImpl Import (byte[] rawData)
+ {
+#if (MONO_FEATURE_APPLETLS && ONLY_APPLETLS) || MONO_FEATURE_APPLE_X509 // ONLY_APPLETLS should not support any other option
+ return ImportApple (rawData);
+#else
+#if MONO_FEATURE_APPLETLS
+ if (ShouldUseAppleTls)
+ return ImportApple (rawData);
+#endif
+ return ImportCore (rawData);
+#endif
+ }
+
#if !MOBILE
// typedef struct _CERT_CONTEXT {
// DWORD dwCertEncodingType;
// so we don't create any dependencies on Windows DLL in corlib
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
- public static X509CertificateImpl InitFromHandle (IntPtr handle)
+ public static X509CertificateImpl InitFromHandleCore (IntPtr handle)
{
// both Marshal.PtrToStructure and Marshal.Copy use LinkDemand (so they will always success from here)
CertificateContext cc = (CertificateContext) Marshal.PtrToStructure (handle, typeof (CertificateContext));
var x509 = new MX.X509Certificate (data);
return new X509CertificateImplMono (x509);
}
-#elif !MONOTOUCH && !XAMMAC
- public static X509CertificateImpl InitFromHandle (IntPtr handle)
- {
- throw new NotSupportedException ();
- }
#endif
public static X509CertificateImpl InitFromCertificate (X509Certificate cert)
return data;
}
-#if !MONOTOUCH && !XAMMAC
- static X509CertificateImpl Import (byte[] rawData)
+ static X509CertificateImpl ImportCore (byte[] rawData)
{
MX.X509Certificate x509;
try {
return new X509CertificateImplMono (x509);
}
-#endif
public static X509CertificateImpl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
{
+++ /dev/null
-//
-// System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.cs
-//
-// Author:
-// Sebastien Pouliot <sebastien@ximian.com>
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Flags]
- [Serializable]
- [ComVisible (true)]
- public enum X509KeyStorageFlags {
- DefaultKeySet = 0,
- // not supported by Silverlight 2.0 (MOBILE)
- UserKeySet = 1,
- MachineKeySet = 2,
- Exportable = 4,
- UserProtected = 8,
- PersistKeySet = 16
- }
-}
-
{
protected static readonly IntPtr InvalidHandle = (IntPtr) (-1);
+ internal const int MaxWaitHandles = 64;
+
static int WaitMultiple(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext, bool WaitAll)
{
int release_last = -1;
namespace System
{
- [Serializable]
- [ComVisible (true)]
- // FIXME: We are doing way to many double/triple exception checks for the overloaded functions"
- public abstract class Array : ICloneable, ICollection, IList, IEnumerable
- , IStructuralComparable, IStructuralEquatable
+ public abstract partial class Array
{
// Constructor
private Array ()
return false;
}
+ int IList.IndexOf (object value)
+ {
+ if (this.Rank > 1)
+ throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
+
+ int length = this.Length;
+ for (int i = 0; i < length; i++) {
+ if (Object.Equals (this.GetValueImpl (i), value))
+ // array index may not be zero-based.
+ // use lower bound
+ return i + this.GetLowerBound (0);
+ }
+
+ unchecked {
+ // lower bound may be MinValue
+ return this.GetLowerBound (0) - 1;
+ }
+ }
+
internal void InternalArray__ICollection_CopyTo<T> (T[] array, int index)
{
if (array == null)
}
}
- [ComVisible (false)]
- public long LongLength {
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
- get { return Length; }
- }
-
public int Rank {
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
get {
}
}
- // IList interface
- object IList.this [int index] {
- get {
- if (unchecked ((uint) index) >= unchecked ((uint) Length))
- throw new IndexOutOfRangeException ("index");
- if (this.Rank > 1)
- throw new ArgumentException (Locale.GetText ("Only single dimension arrays are supported."));
- return GetValueImpl (index);
- }
- set {
- if (unchecked ((uint) index) >= unchecked ((uint) Length))
- throw new IndexOutOfRangeException ("index");
- if (this.Rank > 1)
- throw new ArgumentException (Locale.GetText ("Only single dimension arrays are supported."));
- SetValueImpl (value, index);
- }
- }
-
- int IList.Add (object value)
- {
- throw new NotSupportedException ();
- }
-
- void IList.Clear ()
- {
- Array.Clear (this, this.GetLowerBound (0), this.Length);
- }
-
- bool IList.Contains (object value)
- {
- if (this.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- int length = this.Length;
- for (int i = 0; i < length; i++) {
- if (Object.Equals (this.GetValueImpl (i), value))
- return true;
- }
- return false;
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- int IList.IndexOf (object value)
- {
- if (this.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- int length = this.Length;
- for (int i = 0; i < length; i++) {
- if (Object.Equals (this.GetValueImpl (i), value))
- // array index may not be zero-based.
- // use lower bound
- return i + this.GetLowerBound (0);
- }
-
- unchecked {
- // lower bound may be MinValue
- return this.GetLowerBound (0) - 1;
- }
- }
-
- void IList.Insert (int index, object value)
- {
- throw new NotSupportedException ();
- }
-
- void IList.Remove (object value)
- {
- throw new NotSupportedException ();
- }
-
- void IList.RemoveAt (int index)
- {
- throw new NotSupportedException ();
- }
-
// InternalCall Methods
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern int GetRank ();
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern int GetLength (int dimension);
- [ComVisible (false)]
- public long GetLongLength (int dimension)
- {
- return GetLength (dimension);
- }
-
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern int GetLowerBound (int dimension);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static Array CreateInstanceImpl (Type elementType, int[] lengths, int[] bounds);
- // Properties
- int ICollection.Count {
- get {
- return Length;
- }
- }
-
- public bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public object SyncRoot {
- get {
- return this;
- }
- }
-
- public bool IsFixedSize {
- get {
- return true;
- }
- }
-
public bool IsReadOnly {
get {
return false;
}
}
- public IEnumerator GetEnumerator ()
- {
- return new SimpleEnumerator (this);
- }
-
- int IStructuralComparable.CompareTo (object other, IComparer comparer)
- {
- if (other == null)
- return 1;
-
- Array arr = other as Array;
- if (arr == null)
- throw new ArgumentException ("Not an array", "other");
-
- int len = GetLength (0);
- if (len != arr.GetLength (0))
- throw new ArgumentException ("Not of the same length", "other");
-
- if (Rank > 1)
- throw new ArgumentException ("Array must be single dimensional");
-
- if (arr.Rank > 1)
- throw new ArgumentException ("Array must be single dimensional", "other");
-
- for (int i = 0; i < len; ++i) {
- object a = GetValue (i);
- object b = arr.GetValue (i);
- int r = comparer.Compare (a, b);
- if (r != 0)
- return r;
- }
- return 0;
- }
-
- bool IStructuralEquatable.Equals (object other, IEqualityComparer comparer)
- {
- Array o = other as Array;
- if (o == null || o.Length != Length)
- return false;
-
- if (Object.ReferenceEquals (other, this))
- return true;
-
- for (int i = 0; i < Length; i++) {
- object this_item = this.GetValue (i);
- object other_item = o.GetValue (i);
- if (!comparer.Equals (this_item, other_item))
- return false;
- }
- return true;
- }
-
-
- int IStructuralEquatable.GetHashCode (IEqualityComparer comparer)
- {
- if (comparer == null)
- throw new ArgumentNullException ("comparer");
-
- int hash = 0;
- for (int i = 0; i < Length; i++)
- hash = ((hash << 7) + hash) ^ comparer.GetHashCode (GetValueImpl (i));
- return hash;
- }
-
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
public int GetUpperBound (int dimension)
{
return GetValue (ind);
}
- [ComVisible (false)]
- public object GetValue (long index)
- {
- if (index < 0 || index > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- return GetValue ((int) index);
- }
-
- [ComVisible (false)]
- public object GetValue (long index1, long index2)
- {
- if (index1 < 0 || index1 > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index1", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- if (index2 < 0 || index2 > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index2", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- return GetValue ((int) index1, (int) index2);
- }
-
- [ComVisible (false)]
- public object GetValue (long index1, long index2, long index3)
- {
- if (index1 < 0 || index1 > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index1", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- if (index2 < 0 || index2 > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index2", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- if (index3 < 0 || index3 > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index3", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- return GetValue ((int) index1, (int) index2, (int) index3);
- }
-
[ComVisible (false)]
public void SetValue (object value, long index)
{
SetValue (value, ind);
}
- internal static Array UnsafeCreateInstance (Type elementType, int length)
- {
- return CreateInstance (elementType, length);
- }
-
internal static Array UnsafeCreateInstance(Type elementType, int[] lengths, int[] lowerBounds)
{
return CreateInstance(elementType, lengths, lowerBounds);
return CreateInstance (elementType, GetIntArray (lengths));
}
- [ComVisible (false)]
- public object GetValue (params long [] indices)
- {
- if (indices == null)
- throw new ArgumentNullException ("indices");
- return GetValue (GetIntArray (indices));
- }
-
[ComVisible (false)]
public void SetValue (object value, params long [] indices)
{
SetValue (value, GetIntArray (indices));
}
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch (Array array, object value)
- {
- return BinarySearch (array, value, null);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch (Array array, object value, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- if (array.Length == 0)
- return -1;
-
- return DoBinarySearch (array, array.GetLowerBound (0), array.GetLength (0), value, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch (Array array, int index, int length, object value)
- {
- return BinarySearch (array, index, length, value, null);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch (Array array, int index, int length, object value, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- if (index < array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException ("index", Locale.GetText (
- "index is less than the lower bound of array."));
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value has to be >= 0."));
- // re-ordered to avoid possible integer overflow
- if (index > array.GetLowerBound (0) + array.GetLength (0) - length)
- throw new ArgumentException (Locale.GetText (
- "index and length do not specify a valid range in array."));
-
- if (array.Length == 0)
- return -1;
-
- return DoBinarySearch (array, index, length, value, comparer);
- }
-
- static int DoBinarySearch (Array array, int index, int length, object value, IComparer comparer)
- {
- // cache this in case we need it
- if (comparer == null)
- comparer = Comparer.Default;
-
- int iMin = index;
- // Comment from Tum (tum@veridicus.com):
- // *Must* start at index + length - 1 to pass rotor test co2460binarysearch_iioi
- int iMax = index + length - 1;
- int iCmp = 0;
- try {
- while (iMin <= iMax) {
- // Be careful with overflow
- // http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html
- int iMid = iMin + ((iMax - iMin) / 2);
- object elt = array.GetValueImpl (iMid);
-
- iCmp = comparer.Compare (elt, value);
-
- if (iCmp == 0)
- return iMid;
- else if (iCmp > 0)
- iMax = iMid - 1;
- else
- iMin = iMid + 1; // compensate for the rounding down
- }
- }
- catch (Exception e) {
- throw new InvalidOperationException (Locale.GetText ("Comparer threw an exception."), e);
- }
-
- return ~iMin;
- }
-
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
public static void Clear (Array array, int index, int length)
{
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void ClearInternal (Array a, int index, int count);
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern object Clone ();
-
[ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
public static void Copy (Array sourceArray, Array destinationArray, int length)
{
throw new ArgumentOutOfRangeException ("length", Locale.GetText (
"Value has to be >= 0."));;
+ if (sourceArray.Rank != destinationArray.Rank)
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+
if (sourceIndex < 0)
throw new ArgumentOutOfRangeException ("sourceIndex", Locale.GetText (
"Value has to be >= 0."));;
throw new ArgumentException (msg, string.Empty);
}
- if (sourceArray.Rank != destinationArray.Rank)
- throw new RankException (Locale.GetText ("Arrays must be of same size."));
-
Type src_type = sourceArray.GetType ().GetElementType ();
Type dst_type = destinationArray.GetType ().GetElementType ();
return source.IsAssignableFrom (target) || target.IsAssignableFrom (source);
}
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Copy (Array sourceArray, long sourceIndex, Array destinationArray,
- long destinationIndex, long length)
+ public static T [] FindAll<T> (T [] array, Predicate <T> match)
{
- if (sourceArray == null)
- throw new ArgumentNullException ("sourceArray");
-
- if (destinationArray == null)
- throw new ArgumentNullException ("destinationArray");
-
- if (sourceIndex < Int32.MinValue || sourceIndex > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("sourceIndex",
- Locale.GetText ("Must be in the Int32 range."));
-
- if (destinationIndex < Int32.MinValue || destinationIndex > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("destinationIndex",
- Locale.GetText ("Must be in the Int32 range."));
-
- if (length < 0 || length > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- Copy (sourceArray, (int) sourceIndex, destinationArray, (int) destinationIndex, (int) length);
- }
+ if (array == null)
+ throw new ArgumentNullException ("array");
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Copy (Array sourceArray, Array destinationArray, long length)
- {
- if (length < 0 || length > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
+ if (match == null)
+ throw new ArgumentNullException ("match");
- Copy (sourceArray, destinationArray, (int) length);
- }
+ int pos = 0;
+ T [] d = new T [array.Length];
+ foreach (T t in array)
+ if (match (t))
+ d [pos++] = t;
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int IndexOf (Array array, object value)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return IndexOf (array, value, 0, array.Length);
+ Resize <T> (ref d, pos);
+ return d;
}
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int IndexOf (Array array, object value, int startIndex)
+ [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+ //
+ // The constrained copy should guarantee that if there is an exception thrown
+ // during the copy, the destination array remains unchanged.
+ // This is related to System.Runtime.Reliability.CER
+ public static void ConstrainedCopy (Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
{
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return IndexOf (array, value, startIndex, array.Length - startIndex);
+ Copy (sourceArray, sourceIndex, destinationArray, destinationIndex, length);
}
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int IndexOf (Array array, object value, int startIndex, int count)
+ object GetValueWithFlattenedIndex_NoErrorCheck (int flattenedIndex)
{
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- // re-ordered to avoid possible integer overflow
- if (count < 0 || startIndex < array.GetLowerBound (0) || startIndex - 1 > array.GetUpperBound (0) - count)
- throw new ArgumentOutOfRangeException ();
-
- int max = startIndex + count;
- for (int i = startIndex; i < max; i++) {
- if (Object.Equals (array.GetValueImpl (i), value))
- return i;
- }
-
- return array.GetLowerBound (0) - 1;
- }
-
- public void Initialize()
- {
- //FIXME: We would like to find a compiler that uses
- // this method. It looks like this method do nothing
- // in C# so no exception is trown by the moment.
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int LastIndexOf (Array array, object value)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Length == 0)
- return array.GetLowerBound (0) - 1;
- return LastIndexOf (array, value, array.Length - 1);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int LastIndexOf (Array array, object value, int startIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return LastIndexOf (array, value, startIndex, startIndex - array.GetLowerBound (0) + 1);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int LastIndexOf (Array array, object value, int startIndex, int count)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- int lb = array.GetLowerBound (0);
- // Empty arrays do not throw ArgumentOutOfRangeException
- if (array.Length == 0)
- return lb - 1;
-
- if (count < 0 || startIndex < lb ||
- startIndex > array.GetUpperBound (0) || startIndex - count + 1 < lb)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = startIndex; i >= startIndex - count + 1; i--) {
- if (Object.Equals (array.GetValueImpl (i), value))
- return i;
- }
-
- return lb - 1;
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Reverse (Array array)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- Reverse (array, array.GetLowerBound (0), array.Length);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Reverse (Array array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- if (index < array.GetLowerBound (0) || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- // re-ordered to avoid possible integer overflow
- if (index > array.GetUpperBound (0) + 1 - length)
- throw new ArgumentException ();
-
- int end = index + length - 1;
- var et = array.GetType ().GetElementType ();
- switch (Type.GetTypeCode (et)) {
- case TypeCode.Boolean:
- while (index < end) {
- bool a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.Byte:
- case TypeCode.SByte:
- while (index < end) {
- byte a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.Int16:
- case TypeCode.UInt16:
- case TypeCode.Char:
- while (index < end) {
- short a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.Int32:
- case TypeCode.UInt32:
- case TypeCode.Single:
- while (index < end) {
- int a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.Int64:
- case TypeCode.UInt64:
- case TypeCode.Double:
- while (index < end) {
- long a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.Decimal:
- while (index < end) {
- decimal a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
-
- case TypeCode.String:
- while (index < end) {
- object a, b;
-
- array.GetGenericValueImpl (index, out a);
- array.GetGenericValueImpl (end, out b);
- array.SetGenericValueImpl (index, ref b);
- array.SetGenericValueImpl (end, ref a);
- ++index;
- --end;
- }
- return;
- default:
- if (array is object[])
- goto case TypeCode.String;
-
- // Very slow fallback
- while (index < end) {
- object val = array.GetValueImpl (index);
- array.SetValueImpl (array.GetValueImpl (end), index);
- array.SetValueImpl (val, end);
- ++index;
- --end;
- }
-
- return;
- }
- }
-
- public static void Reverse<T>(T[] array)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
-
- Reverse (array, 0, array.Length);
- }
-
- public static void Reverse<T>(T[] array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
- if (index < 0 || length < 0)
- throw new ArgumentOutOfRangeException ((index < 0 ? nameof (index) : nameof (length)));
- if (array.Length - index < length)
- throw new ArgumentException ();
-
- int i = index;
- int j = index + length - 1;
- while (i < j) {
- T temp = array [i];
- array [i] = array [j];
- array [j] = temp;
- i++;
- j--;
- }
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array array)
- {
- Sort (array, (IComparer)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array keys, Array items)
- {
- Sort (keys, items, (IComparer)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array array, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- SortImpl (array, null, array.GetLowerBound (0), array.GetLength (0), comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array array, int index, int length)
- {
- Sort (array, index, length, (IComparer)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array keys, Array items, IComparer comparer)
- {
- if (items == null) {
- Sort (keys, comparer);
- return;
- }
-
- if (keys == null)
- throw new ArgumentNullException ("keys");
-
- if (keys.Rank > 1 || items.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- SortImpl (keys, items, keys.GetLowerBound (0), keys.GetLength (0), comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array keys, Array items, int index, int length)
- {
- Sort (keys, items, index, length, (IComparer)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array array, int index, int length, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
-
- if (index < array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException ("index");
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value has to be >= 0."));
-
- if (array.Length - (array.GetLowerBound (0) + index) < length)
- throw new ArgumentException ();
-
- SortImpl (array, null, index, length, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort (Array keys, Array items, int index, int length, IComparer comparer)
- {
- if (items == null) {
- Sort (keys, index, length, comparer);
- return;
- }
-
- if (keys == null)
- throw new ArgumentNullException ("keys");
-
- if (keys.Rank > 1 || items.Rank > 1)
- throw new RankException ();
-
- if (keys.GetLowerBound (0) != items.GetLowerBound (0))
- throw new ArgumentException ();
-
- if (index < keys.GetLowerBound (0))
- throw new ArgumentOutOfRangeException ("index");
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value has to be >= 0."));
-
- if (items.Length - (index + items.GetLowerBound (0)) < length || keys.Length - (index + keys.GetLowerBound (0)) < length)
- throw new ArgumentException ();
-
- SortImpl (keys, items, index, length, comparer);
- }
-
- private static void SortImpl (Array keys, Array items, int index, int length, IComparer comparer)
- {
- if (length <= 1)
- return;
-
- int low = index;
- int high = index + length - 1;
-
-#if !BOOTSTRAP_BASIC
- if (comparer == null && items is object[]) {
- /* Its better to compare typecodes as casts treat long/ulong/long based enums the same */
- switch (Type.GetTypeCode (keys.GetType ().GetElementType ())) {
- case TypeCode.Int32:
- qsort (keys as Int32[], items as object[], low, high);
- return;
- case TypeCode.Int64:
- qsort (keys as Int64[], items as object[], low, high);
- return;
- case TypeCode.Byte:
- qsort (keys as byte[], items as object[], low, high);
- return;
- case TypeCode.Char:
- qsort (keys as char[], items as object[], low, high);
- return;
- case TypeCode.DateTime:
- qsort (keys as DateTime[], items as object[], low, high);
- return;
- case TypeCode.Decimal:
- qsort (keys as decimal[], items as object[], low, high);
- return;
- case TypeCode.Double:
- qsort (keys as double[], items as object[], low, high);
- return;
- case TypeCode.Int16:
- qsort (keys as Int16[], items as object[], low, high);
- return;
- case TypeCode.SByte:
- qsort (keys as SByte[], items as object[], low, high);
- return;
- case TypeCode.Single:
- qsort (keys as Single[], items as object[], low, high);
- return;
- case TypeCode.UInt16:
- qsort (keys as UInt16[], items as object[], low, high);
- return;
- case TypeCode.UInt32:
- qsort (keys as UInt32[], items as object[], low, high);
- return;
- case TypeCode.UInt64:
- qsort (keys as UInt64[], items as object[], low, high);
- return;
- default:
- break;
- }
- }
-#endif
-
- if (comparer == null)
- CheckComparerAvailable (keys, low, high);
-
- try {
- qsort (keys, items, low, high, comparer);
- } catch (Exception e) {
- throw new InvalidOperationException (Locale.GetText ("The comparer threw an exception."), e);
- }
- }
-
- struct QSortStack {
- public int high;
- public int low;
- }
-
- static bool QSortArrange (Array keys, Array items, int lo, ref object v0, int hi, ref object v1, IComparer comparer)
- {
- IComparable cmp;
- object tmp;
-
- if (comparer != null) {
- if (comparer.Compare (v1, v0) < 0) {
- swap (keys, items, lo, hi);
- tmp = v0;
- v0 = v1;
- v1 = tmp;
-
- return true;
- }
- } else if (v0 != null) {
- cmp = v1 as IComparable;
-
- if (v1 == null || cmp.CompareTo (v0) < 0) {
- swap (keys, items, lo, hi);
- tmp = v0;
- v0 = v1;
- v1 = tmp;
-
- return true;
- }
- }
-
- return false;
- }
-
- unsafe static void qsort (Array keys, Array items, int low0, int high0, IComparer comparer)
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- object key, hi, lo;
- IComparable cmp;
- int sp = 1;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- lo = keys.GetValueImpl (k - 1);
- hi = keys.GetValueImpl (k);
- if (comparer != null) {
- if (comparer.Compare (hi, lo) >= 0)
- break;
- } else {
- if (lo == null)
- break;
-
- if (hi != null) {
- cmp = hi as IComparable;
- if (cmp.CompareTo (lo) >= 0)
- break;
- }
- }
-
- swap (keys, items, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // get the 3 keys
- key = keys.GetValueImpl (mid);
- hi = keys.GetValueImpl (high);
- lo = keys.GetValueImpl (low);
-
- // once we re-order the low, mid, and high elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange (keys, items, low, ref lo, mid, ref key, comparer);
- if (QSortArrange (keys, items, mid, ref key, high, ref hi, comparer))
- QSortArrange (keys, items, low, ref lo, mid, ref key, comparer);
-
- cmp = key as IComparable;
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again.
- k = high - 1;
- i = low + 1;
-
- do {
- // Move the walls in
- if (comparer != null) {
- // find the first element with a value >= pivot value
- while (i < k && comparer.Compare (key, keys.GetValueImpl (i)) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && comparer.Compare (key, keys.GetValueImpl (k)) < 0)
- k--;
- } else if (cmp != null) {
- // find the first element with a value >= pivot value
- while (i < k && cmp.CompareTo (keys.GetValueImpl (i)) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && cmp.CompareTo (keys.GetValueImpl (k)) < 0)
- k--;
- } else {
- // This has the effect of moving the null values to the front if comparer is null
- while (i < k && keys.GetValueImpl (i) == null)
- i++;
-
- while (k > i && keys.GetValueImpl (k) != null)
- k--;
- }
-
- if (k <= i)
- break;
-
- swap (keys, items, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- private static void CheckComparerAvailable (Array keys, int low, int high)
- {
- // move null keys to beginning of array,
- // ensure that non-null keys implement IComparable
- for (int i = 0; i < high; i++) {
- object obj = keys.GetValueImpl (i);
- if (obj == null)
- continue;
- if (!(obj is IComparable)) {
- string msg = Locale.GetText ("No IComparable interface found for type '{0}'.");
- throw new InvalidOperationException (String.Format (msg, obj.GetType ()));
- }
- }
- }
-
- private static void swap (Array keys, Array items, int i, int j)
- {
- object tmp = keys.GetValueImpl (i);
- keys.SetValueImpl (keys.GetValueImpl (j), i);
- keys.SetValueImpl (tmp, j);
-
- if (items != null) {
- tmp = items.GetValueImpl (i);
- items.SetValueImpl (items.GetValueImpl (j), i);
- items.SetValueImpl (tmp, j);
- }
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<T> (T [] array)
- {
- Sort<T> (array, (IComparer<T>)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<TKey, TValue> (TKey [] keys, TValue [] items)
- {
- Sort<TKey, TValue> (keys, items, (IComparer<TKey>)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<T> (T [] array, IComparer<T> comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- SortImpl<T> (array, 0, array.Length, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<TKey, TValue> (TKey [] keys, TValue [] items, IComparer<TKey> comparer)
- {
- if (items == null) {
- Sort<TKey> (keys, comparer);
- return;
- }
-
- if (keys == null)
- throw new ArgumentNullException ("keys");
-
- if (keys.Length > items.Length)
- throw new ArgumentException ("Length of keys is larger than length of items.");
-
- SortImpl<TKey, TValue> (keys, items, 0, keys.Length, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<T> (T [] array, int index, int length)
- {
- Sort<T> (array, index, length, (IComparer<T>)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<TKey, TValue> (TKey [] keys, TValue [] items, int index, int length)
- {
- Sort<TKey, TValue> (keys, items, index, length, (IComparer<TKey>)null);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<T> (T [] array, int index, int length, IComparer<T> comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index");
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value has to be >= 0."));
-
- if (index + length > array.Length)
- throw new ArgumentException ();
-
- SortImpl<T> (array, index, length, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.MayCorruptInstance, Cer.MayFail)]
- public static void Sort<TKey, TValue> (TKey [] keys, TValue [] items, int index, int length, IComparer<TKey> comparer)
- {
- if (items == null) {
- Sort<TKey> (keys, index, length, comparer);
- return;
- }
-
- if (keys == null)
- throw new ArgumentNullException ("keys");
-
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index");
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length");
-
- if (items.Length - index < length || keys.Length - index < length)
- throw new ArgumentException ();
-
- SortImpl<TKey, TValue> (keys, items, index, length, comparer);
- }
-
- private static void SortImpl<TKey, TValue> (TKey [] keys, TValue [] items, int index, int length, IComparer<TKey> comparer)
- {
- if (keys.Length <= 1)
- return;
-
- int low = index;
- int high = index + length - 1;
-
- //
- // Check for value types which can be sorted without Compare () method
- //
- if (comparer == null) {
- /* Avoid this when using full-aot to prevent the generation of many unused qsort<K,T> instantiations */
-#if !FULL_AOT_RUNTIME
-#if !BOOTSTRAP_BASIC
- switch (Type.GetTypeCode (typeof (TKey))) {
- case TypeCode.Int32:
- qsort (keys as Int32[], items, low, high);
- return;
- case TypeCode.Int64:
- qsort (keys as Int64[], items, low, high);
- return;
- case TypeCode.Byte:
- qsort (keys as byte[], items, low, high);
- return;
- case TypeCode.Char:
- qsort (keys as char[], items, low, high);
- return;
- case TypeCode.DateTime:
- qsort (keys as DateTime[], items, low, high);
- return;
- case TypeCode.Decimal:
- qsort (keys as decimal[], items, low, high);
- return;
- case TypeCode.Double:
- qsort (keys as double[], items, low, high);
- return;
- case TypeCode.Int16:
- qsort (keys as Int16[], items, low, high);
- return;
- case TypeCode.SByte:
- qsort (keys as SByte[], items, low, high);
- return;
- case TypeCode.Single:
- qsort (keys as Single[], items, low, high);
- return;
- case TypeCode.UInt16:
- qsort (keys as UInt16[], items, low, high);
- return;
- case TypeCode.UInt32:
- qsort (keys as UInt32[], items, low, high);
- return;
- case TypeCode.UInt64:
- qsort (keys as UInt64[], items, low, high);
- return;
- }
-#endif
-#endif
- // Using Comparer<TKey> adds a small overload, but with value types it
- // helps us to not box them.
- if (typeof (IComparable<TKey>).IsAssignableFrom (typeof (TKey)) &&
- typeof (TKey).IsValueType)
- comparer = Comparer<TKey>.Default;
- }
-
- if (comparer == null)
- CheckComparerAvailable<TKey> (keys, low, high);
-
- //try {
- qsort (keys, items, low, high, comparer);
- //} catch (Exception e) {
- //throw new InvalidOperationException (Locale.GetText ("The comparer threw an exception."), e);
- //}
- }
-
- // Specialized version for items==null
- private static void SortImpl<TKey> (TKey [] keys, int index, int length, IComparer<TKey> comparer)
- {
- if (keys.Length <= 1)
- return;
-
- int low = index;
- int high = index + length - 1;
-
- //
- // Check for value types which can be sorted without Compare () method
- //
- if (comparer == null) {
-#if !BOOTSTRAP_BASIC
- switch (Type.GetTypeCode (typeof (TKey))) {
- case TypeCode.Int32:
- qsort (keys as Int32[], low, high);
- return;
- case TypeCode.Int64:
- qsort (keys as Int64[], low, high);
- return;
- case TypeCode.Byte:
- qsort (keys as byte[], low, high);
- return;
- case TypeCode.Char:
- qsort (keys as char[], low, high);
- return;
- case TypeCode.DateTime:
- qsort (keys as DateTime[], low, high);
- return;
- case TypeCode.Decimal:
- qsort (keys as decimal[], low, high);
- return;
- case TypeCode.Double:
- qsort (keys as double[], low, high);
- return;
- case TypeCode.Int16:
- qsort (keys as Int16[], low, high);
- return;
- case TypeCode.SByte:
- qsort (keys as SByte[], low, high);
- return;
- case TypeCode.Single:
- qsort (keys as Single[], low, high);
- return;
- case TypeCode.UInt16:
- qsort (keys as UInt16[], low, high);
- return;
- case TypeCode.UInt32:
- qsort (keys as UInt32[], low, high);
- return;
- case TypeCode.UInt64:
- qsort (keys as UInt64[], low, high);
- return;
- }
-#endif
- // Using Comparer<TKey> adds a small overload, but with value types it
- // helps us to not box them.
- if (typeof (IComparable<TKey>).IsAssignableFrom (typeof (TKey)) &&
- typeof (TKey).IsValueType)
- comparer = Comparer<TKey>.Default;
- }
-
- if (comparer == null)
- CheckComparerAvailable<TKey> (keys, low, high);
-
- //try {
- qsort<TKey> (keys, low, high, comparer);
- //} catch (Exception e) {
- //throw new InvalidOperationException (Locale.GetText ("The comparer threw an exception."), e);
- //}
- }
-
- public static void Sort<T> (T [] array, Comparison<T> comparison)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (comparison == null)
- throw new ArgumentNullException ("comparison");
-
- SortImpl<T> (array, array.Length, comparison);
- }
-
- // used by List<T>.Sort (Comparison <T>)
- internal static void SortImpl<T> (T [] array, int length, Comparison<T> comparison)
- {
- if (length <= 1)
- return;
-
- try {
- int low0 = 0;
- int high0 = length - 1;
- qsort<T> (array, low0, high0, comparison);
- } catch (InvalidOperationException) {
- throw;
- } catch (Exception e) {
- throw new InvalidOperationException (Locale.GetText ("Comparison threw an exception."), e);
- }
- }
-
- static bool QSortArrange<T, U> (T [] keys, U [] items, int lo, int hi) where T : IComparable<T>
- {
- if (keys[lo] != null) {
- if (keys[hi] == null || keys[hi].CompareTo (keys[lo]) < 0) {
- swap (keys, items, lo, hi);
- return true;
- }
- }
-
- return false;
- }
-
- // Specialized version for items==null
- static bool QSortArrange<T> (T [] keys, int lo, int hi) where T : IComparable<T>
- {
- if (keys[lo] != null) {
- if (keys[hi] == null || keys[hi].CompareTo (keys[lo]) < 0) {
- swap (keys, lo, hi);
- return true;
- }
- }
-
- return false;
- }
-
- unsafe static void qsort<T, U> (T[] keys, U[] items, int low0, int high0) where T : IComparable<T>
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- int sp = 1;
- T key;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- // if keys[k] >= keys[k-1], break
- if (keys[k-1] == null)
- break;
-
- if (keys[k] != null && keys[k].CompareTo (keys[k-1]) >= 0)
- break;
-
- swap (keys, items, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // once we re-order the lo, mid, and hi elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange<T, U> (keys, items, low, mid);
- if (QSortArrange<T, U> (keys, items, mid, high))
- QSortArrange<T, U> (keys, items, low, mid);
-
- key = keys[mid];
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again
- k = high - 1;
- i = low + 1;
-
- do {
- if (key != null) {
- // find the first element with a value >= pivot value
- while (i < k && key.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && key.CompareTo (keys[k]) < 0)
- k--;
- } else {
- while (i < k && keys[i] == null)
- i++;
-
- while (k > i && keys[k] != null)
- k--;
- }
-
- if (k <= i)
- break;
-
- swap (keys, items, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- // Specialized version for items==null
- unsafe static void qsort<T> (T[] keys, int low0, int high0) where T : IComparable<T>
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- int sp = 1;
- T key;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- // if keys[k] >= keys[k-1], break
- if (keys[k-1] == null)
- break;
-
- if (keys[k] != null && keys[k].CompareTo (keys[k-1]) >= 0)
- break;
-
- swap (keys, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // once we re-order the lo, mid, and hi elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange<T> (keys, low, mid);
- if (QSortArrange<T> (keys, mid, high))
- QSortArrange<T> (keys, low, mid);
-
- key = keys[mid];
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again
- k = high - 1;
- i = low + 1;
-
- do {
- if (key != null) {
- // find the first element with a value >= pivot value
- while (i < k && key.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k >= i && key.CompareTo (keys[k]) < 0)
- k--;
- } else {
- while (i < k && keys[i] == null)
- i++;
-
- while (k >= i && keys[k] != null)
- k--;
- }
-
- if (k <= i)
- break;
-
- swap (keys, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- static bool QSortArrange<K, V> (K [] keys, V [] items, int lo, int hi, IComparer<K> comparer)
- {
- IComparable<K> gcmp;
- IComparable cmp;
-
- if (comparer != null) {
- if (comparer.Compare (keys[hi], keys[lo]) < 0) {
- swap<K, V> (keys, items, lo, hi);
- return true;
- }
- } else if (keys[lo] != null) {
- if (keys[hi] == null) {
- swap<K, V> (keys, items, lo, hi);
- return true;
- }
-
- gcmp = keys[hi] as IComparable<K>;
- if (gcmp != null) {
- if (gcmp.CompareTo (keys[lo]) < 0) {
- swap<K, V> (keys, items, lo, hi);
- return true;
- }
-
- return false;
- }
-
- cmp = keys[hi] as IComparable;
- if (cmp != null) {
- if (cmp.CompareTo (keys[lo]) < 0) {
- swap<K, V> (keys, items, lo, hi);
- return true;
- }
-
- return false;
- }
- }
-
- return false;
- }
-
- // Specialized version for items==null
- static bool QSortArrange<K> (K [] keys, int lo, int hi, IComparer<K> comparer)
- {
- IComparable<K> gcmp;
- IComparable cmp;
-
- if (comparer != null) {
- if (comparer.Compare (keys[hi], keys[lo]) < 0) {
- swap<K> (keys, lo, hi);
- return true;
- }
- } else if (keys[lo] != null) {
- if (keys[hi] == null) {
- swap<K> (keys, lo, hi);
- return true;
- }
-
- gcmp = keys[hi] as IComparable<K>;
- if (gcmp != null) {
- if (gcmp.CompareTo (keys[lo]) < 0) {
- swap<K> (keys, lo, hi);
- return true;
- }
-
- return false;
- }
-
- cmp = keys[hi] as IComparable;
- if (cmp != null) {
- if (cmp.CompareTo (keys[lo]) < 0) {
- swap<K> (keys, lo, hi);
- return true;
- }
-
- return false;
- }
- }
-
- return false;
- }
-
- unsafe static void qsort<K, V> (K [] keys, V [] items, int low0, int high0, IComparer<K> comparer)
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- IComparable<K> gcmp;
- IComparable cmp;
- int sp = 1;
- K key;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- // if keys[k] >= keys[k-1], break
- if (comparer != null) {
- if (comparer.Compare (keys[k], keys[k-1]) >= 0)
- break;
- } else {
- if (keys[k-1] == null)
- break;
-
- if (keys[k] != null) {
- gcmp = keys[k] as IComparable<K>;
- cmp = keys[k] as IComparable;
- if (gcmp != null) {
- if (gcmp.CompareTo (keys[k-1]) >= 0)
- break;
- } else {
- if (cmp.CompareTo (keys[k-1]) >= 0)
- break;
- }
- }
- }
-
- swap<K, V> (keys, items, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // once we re-order the low, mid, and high elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange<K, V> (keys, items, low, mid, comparer);
- if (QSortArrange<K, V> (keys, items, mid, high, comparer))
- QSortArrange<K, V> (keys, items, low, mid, comparer);
-
- key = keys[mid];
- gcmp = key as IComparable<K>;
- cmp = key as IComparable;
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again.
- k = high - 1;
- i = low + 1;
-
- do {
- // Move the walls in
- if (comparer != null) {
- // find the first element with a value >= pivot value
- while (i < k && comparer.Compare (key, keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && comparer.Compare (key, keys[k]) < 0)
- k--;
- } else {
- if (gcmp != null) {
- // find the first element with a value >= pivot value
- while (i < k && gcmp.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && gcmp.CompareTo (keys[k]) < 0)
- k--;
- } else if (cmp != null) {
- // find the first element with a value >= pivot value
- while (i < k && cmp.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && cmp.CompareTo (keys[k]) < 0)
- k--;
- } else {
- while (i < k && keys[i] == null)
- i++;
-
- while (k > i && keys[k] != null)
- k--;
- }
- }
-
- if (k <= i)
- break;
-
- swap<K, V> (keys, items, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- // Specialized version for items==null
- unsafe static void qsort<K> (K [] keys, int low0, int high0, IComparer<K> comparer)
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- IComparable<K> gcmp;
- IComparable cmp;
- int sp = 1;
- K key;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- // if keys[k] >= keys[k-1], break
- if (comparer != null) {
- if (comparer.Compare (keys[k], keys[k-1]) >= 0)
- break;
- } else {
- if (keys[k-1] == null)
- break;
-
- if (keys[k] != null) {
- gcmp = keys[k] as IComparable<K>;
- cmp = keys[k] as IComparable;
- if (gcmp != null) {
- if (gcmp.CompareTo (keys[k-1]) >= 0)
- break;
- } else {
- if (cmp.CompareTo (keys[k-1]) >= 0)
- break;
- }
- }
- }
-
- swap<K> (keys, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // once we re-order the low, mid, and high elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange<K> (keys, low, mid, comparer);
- if (QSortArrange<K> (keys, mid, high, comparer))
- QSortArrange<K> (keys, low, mid, comparer);
-
- key = keys[mid];
- gcmp = key as IComparable<K>;
- cmp = key as IComparable;
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again.
- k = high - 1;
- i = low + 1;
-
- do {
- // Move the walls in
- if (comparer != null) {
- // find the first element with a value >= pivot value
- while (i < k && comparer.Compare (key, keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && comparer.Compare (key, keys[k]) < 0)
- k--;
- } else {
- if (gcmp != null) {
- // find the first element with a value >= pivot value
- while (i < k && gcmp.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && gcmp.CompareTo (keys[k]) < 0)
- k--;
- } else if (cmp != null) {
- // find the first element with a value >= pivot value
- while (i < k && cmp.CompareTo (keys[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && cmp.CompareTo (keys[k]) < 0)
- k--;
- } else {
- while (i < k && keys[i] == null)
- i++;
-
- while (k > i && keys[k] != null)
- k--;
- }
- }
-
- if (k <= i)
- break;
-
- swap<K> (keys, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- static bool QSortArrange<T> (T [] array, int lo, int hi, Comparison<T> compare)
- {
- if (array[lo] != null) {
- if (array[hi] == null || compare (array[hi], array[lo]) < 0) {
- swap<T> (array, lo, hi);
- return true;
- }
- }
-
- return false;
- }
-
- unsafe static void qsort<T> (T [] array, int low0, int high0, Comparison<T> compare)
- {
- QSortStack* stack = stackalloc QSortStack [32];
- const int QSORT_THRESHOLD = 7;
- int high, low, mid, i, k;
- int sp = 1;
- T key;
-
- // initialize our stack
- stack[0].high = high0;
- stack[0].low = low0;
-
- do {
- // pop the stack
- sp--;
- high = stack[sp].high;
- low = stack[sp].low;
-
- if ((low + QSORT_THRESHOLD) > high) {
- // switch to insertion sort
- for (i = low + 1; i <= high; i++) {
- for (k = i; k > low; k--) {
- if (compare (array[k], array[k-1]) >= 0)
- break;
-
- swap<T> (array, k - 1, k);
- }
- }
-
- continue;
- }
-
- // calculate the middle element
- mid = low + ((high - low) / 2);
-
- // once we re-order the lo, mid, and hi elements to be in
- // ascending order, we'll use mid as our pivot.
- QSortArrange<T> (array, low, mid, compare);
- if (QSortArrange<T> (array, mid, high, compare))
- QSortArrange<T> (array, low, mid, compare);
-
- key = array[mid];
-
- // since we've already guaranteed that lo <= mid and mid <= hi,
- // we can skip comparing them again
- k = high - 1;
- i = low + 1;
-
- do {
- // Move the walls in
- if (key != null) {
- // find the first element with a value >= pivot value
- while (i < k && compare (key, array[i]) > 0)
- i++;
-
- // find the last element with a value <= pivot value
- while (k > i && compare (key, array[k]) < 0)
- k--;
- } else {
- while (i < k && array[i] == null)
- i++;
-
- while (k > i && array[k] != null)
- k--;
- }
-
- if (k <= i)
- break;
-
- swap<T> (array, i, k);
-
- i++;
- k--;
- } while (true);
-
- // push our partitions onto the stack, largest first
- // (to make sure we don't run out of stack space)
- if ((high - k) >= (k - low)) {
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
-
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
- } else {
- if ((k - 1) > low) {
- stack[sp].high = k;
- stack[sp].low = low;
- sp++;
- }
-
- if ((k + 1) < high) {
- stack[sp].high = high;
- stack[sp].low = k;
- sp++;
- }
- }
- } while (sp > 0);
- }
-
- private static void CheckComparerAvailable<K> (K [] keys, int low, int high)
- {
- // move null keys to beginning of array,
- // ensure that non-null keys implement IComparable
- for (int i = low; i < high; i++) {
- K key = keys [i];
- if (key != null) {
- if (!(key is IComparable<K>) && !(key is IComparable)) {
- string msg = Locale.GetText ("No IComparable<T> or IComparable interface found for type '{0}'.");
- throw new InvalidOperationException (String.Format (msg, key.GetType ()));
- }
- }
- }
- }
-
- [MethodImpl ((MethodImplOptions)256)]
- private static void swap<K, V> (K [] keys, V [] items, int i, int j)
- {
- K tmp;
-
- tmp = keys [i];
- keys [i] = keys [j];
- keys [j] = tmp;
-
- if (items != null) {
- V itmp;
- itmp = items [i];
- items [i] = items [j];
- items [j] = itmp;
- }
- }
-
- [MethodImpl ((MethodImplOptions)256)]
- private static void swap<T> (T [] array, int i, int j)
- {
- T tmp = array [i];
- array [i] = array [j];
- array [j] = tmp;
- }
-
- public void CopyTo (Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- // The order of these exception checks may look strange,
- // but that's how the microsoft runtime does it.
- if (this.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
- if (index + this.GetLength (0) > array.GetLowerBound (0) + array.GetLength (0))
- throw new ArgumentException ("Destination array was not long " +
- "enough. Check destIndex and length, and the array's " +
- "lower bounds.");
- if (array.Rank > 1)
- throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index", Locale.GetText (
- "Value has to be >= 0."));
-
- Copy (this, this.GetLowerBound (0), array, index, this.GetLength (0));
- }
-
- [ComVisible (false)]
- public void CopyTo (Array array, long index)
- {
- if (index < 0 || index > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("index", Locale.GetText (
- "Value must be >= 0 and <= Int32.MaxValue."));
-
- CopyTo (array, (int) index);
- }
-
- internal class SimpleEnumerator : IEnumerator, ICloneable
- {
- Array enumeratee;
- int currentpos;
- int length;
-
- public SimpleEnumerator (Array arrayToEnumerate)
- {
- this.enumeratee = arrayToEnumerate;
- this.currentpos = -1;
- this.length = arrayToEnumerate.Length;
- }
-
- public object Current {
- get {
- // Exception messages based on MS implementation
- if (currentpos < 0 )
- throw new InvalidOperationException (Locale.GetText (
- "Enumeration has not started."));
- if (currentpos >= length)
- throw new InvalidOperationException (Locale.GetText (
- "Enumeration has already ended"));
- // Current should not increase the position. So no ++ over here.
- return enumeratee.GetValueImpl (currentpos);
- }
- }
-
- public bool MoveNext()
- {
- //The docs say Current should throw an exception if last
- //call to MoveNext returned false. This means currentpos
- //should be set to length when returning false.
- if (currentpos < length)
- currentpos++;
- if(currentpos < length)
- return true;
- else
- return false;
- }
-
- public void Reset()
- {
- currentpos = -1;
- }
-
- public object Clone ()
- {
- return MemberwiseClone ();
- }
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static void Resize<T> (ref T [] array, int newSize)
- {
- if (newSize < 0)
- throw new ArgumentOutOfRangeException ("newSize");
-
- if (array == null) {
- array = new T [newSize];
- return;
- }
-
- var arr = array;
- int length = arr.Length;
- if (length == newSize)
- return;
-
- T [] a = new T [newSize];
- int tocopy = Math.Min (newSize, length);
-
- if (tocopy < 9) {
- for (int i = 0; i < tocopy; ++i)
- UnsafeStore (a, i, UnsafeLoad (arr, i));
- } else {
- FastCopy (arr, 0, a, 0, tocopy);
- }
- array = a;
- }
-
- public static bool TrueForAll <T> (T [] array, Predicate <T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (match == null)
- throw new ArgumentNullException ("match");
-
- foreach (T t in array)
- if (! match (t))
- return false;
-
- return true;
- }
-
- public static void ForEach<T> (T [] array, Action <T> action)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (action == null)
- throw new ArgumentNullException ("action");
-
- foreach (T t in array)
- action (t);
- }
-
- public static TOutput[] ConvertAll<TInput, TOutput> (TInput [] array, Converter<TInput, TOutput> converter)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (converter == null)
- throw new ArgumentNullException ("converter");
-
- TOutput [] output = new TOutput [array.Length];
- for (int i = 0; i < array.Length; i ++)
- output [i] = converter (array [i]);
-
- return output;
- }
-
- public static int FindLastIndex<T> (T [] array, Predicate <T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- return GetLastIndex (array, 0, array.Length, match);
- }
-
- public static int FindLastIndex<T> (T [] array, int startIndex, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (startIndex < 0 || (uint) startIndex > (uint) array.Length)
- throw new ArgumentOutOfRangeException ("startIndex");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- return GetLastIndex (array, 0, startIndex + 1, match);
- }
-
- public static int FindLastIndex<T> (T [] array, int startIndex, int count, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- if (startIndex < 0 || (uint) startIndex > (uint) array.Length)
- throw new ArgumentOutOfRangeException ("startIndex");
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count");
-
- if (startIndex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ("count must refer to a location within the array");
-
- return GetLastIndex (array, startIndex - count + 1, count, match);
- }
-
- internal static int GetLastIndex<T> (T[] array, int startIndex, int count, Predicate<T> match)
- {
- // unlike FindLastIndex, takes regular params for search range
- for (int i = startIndex + count; i != startIndex;)
- if (match (array [--i]))
- return i;
-
- return -1;
- }
-
- public static int FindIndex<T> (T [] array, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- return GetIndex (array, 0, array.Length, match);
- }
-
- public static int FindIndex<T> (T [] array, int startIndex, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (startIndex < 0 || (uint) startIndex > (uint) array.Length)
- throw new ArgumentOutOfRangeException ("startIndex");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- return GetIndex (array, startIndex, array.Length - startIndex, match);
- }
-
- public static int FindIndex<T> (T [] array, int startIndex, int count, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (startIndex < 0)
- throw new ArgumentOutOfRangeException ("startIndex");
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count");
-
- if ((uint) startIndex + (uint) count > (uint) array.Length)
- throw new ArgumentOutOfRangeException ("index and count exceed length of list");
-
- return GetIndex (array, startIndex, count, match);
- }
-
- internal static int GetIndex<T> (T[] array, int startIndex, int count, Predicate<T> match)
- {
- int end = startIndex + count;
- for (int i = startIndex; i < end; i ++)
- if (match (array [i]))
- return i;
-
- return -1;
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch<T> (T [] array, T value)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return BinarySearch<T> (array, 0, array.Length, value, null);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch<T> (T [] array, T value, IComparer<T> comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return BinarySearch<T> (array, 0, array.Length, value, comparer);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch<T> (T [] array, int index, int length, T value)
- {
- return BinarySearch<T> (array, index, length, value, null);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
- public static int BinarySearch<T> (T [] array, int index, int length, T value, IComparer<T> comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index", Locale.GetText (
- "index is less than the lower bound of array."));
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length", Locale.GetText (
- "Value has to be >= 0."));
- // re-ordered to avoid possible integer overflow
- if (index > array.Length - length)
- throw new ArgumentException (Locale.GetText (
- "index and length do not specify a valid range in array."));
- if (comparer == null)
- comparer = Comparer <T>.Default;
-
- int iMin = index;
- int iMax = index + length - 1;
- int iCmp = 0;
- try {
- while (iMin <= iMax) {
- // Be careful with overflows
- int iMid = iMin + ((iMax - iMin) / 2);
- iCmp = comparer.Compare (array [iMid], value);
-
- if (iCmp == 0)
- return iMid;
-
- if (iCmp > 0)
- iMax = iMid - 1;
- else
- iMin = iMid + 1; // compensate for the rounding down
- }
- } catch (Exception e) {
- throw new InvalidOperationException (Locale.GetText ("Comparer threw an exception."), e);
- }
-
- return ~iMin;
- }
-
- public static int IndexOf<T> (T [] array, T value)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return IndexOf<T> (array, value, 0, array.Length);
- }
-
- public static int IndexOf<T> (T [] array, T value, int startIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return IndexOf<T> (array, value, startIndex, array.Length - startIndex);
- }
-
- public static int IndexOf<T> (T[] array, T value, int startIndex, int count)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- // re-ordered to avoid possible integer overflow
- if (count < 0 || startIndex < array.GetLowerBound (0) || startIndex - 1 > array.GetUpperBound (0) - count)
- throw new ArgumentOutOfRangeException ();
-
- return EqualityComparer<T>.Default.IndexOf (array, value, startIndex, count);
- }
-
- public static int LastIndexOf<T> (T [] array, T value)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Length == 0)
- return -1;
- return LastIndexOf<T> (array, value, array.Length - 1);
- }
-
- public static int LastIndexOf<T> (T [] array, T value, int startIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return LastIndexOf<T> (array, value, startIndex, startIndex + 1);
- }
-
- public static int LastIndexOf<T> (T [] array, T value, int startIndex, int count)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (count < 0 || startIndex < array.GetLowerBound (0) ||
- startIndex > array.GetUpperBound (0) || startIndex - count + 1 < array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException ();
-
- EqualityComparer<T> equalityComparer = EqualityComparer<T>.Default;
- for (int i = startIndex; i >= startIndex - count + 1; i--) {
- if (equalityComparer.Equals (array [i], value))
- return i;
- }
-
- return -1;
- }
-
- public static T [] FindAll<T> (T [] array, Predicate <T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- int pos = 0;
- T [] d = new T [array.Length];
- foreach (T t in array)
- if (match (t))
- d [pos++] = t;
-
- Resize <T> (ref d, pos);
- return d;
- }
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- public static T[] Empty<T>()
- {
- return EmptyArray<T>.Value;
- }
-
- public static bool Exists<T> (T [] array, Predicate <T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- foreach (T t in array)
- if (match (t))
- return true;
- return false;
- }
-
- public static ReadOnlyCollection<T> AsReadOnly<T> (T[] array)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- return new ReadOnlyCollection<T> (array);
- }
-
- public static void Fill<T> (T[] array, T value)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
-
- for (int i = 0; i < array.Length; i++)
- array [i] = value;
- }
-
- public static void Fill<T> (T[] array, T value, int startIndex, int count)
- {
- if (array == null)
- throw new ArgumentNullException (nameof (array));
-
- if (startIndex < 0 || startIndex > array.Length)
- throw new ArgumentOutOfRangeException (nameof (startIndex));
-
- if (count < 0 || startIndex > array.Length - count)
- throw new ArgumentOutOfRangeException (nameof (count));
-
- for (int i = startIndex; i < startIndex + count; i++)
- array [i] = value;
- }
-
- public static T Find<T> (T [] array, Predicate<T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- foreach (T t in array)
- if (match (t))
- return t;
-
- return default (T);
- }
-
- public static T FindLast<T> (T [] array, Predicate <T> match)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (match == null)
- throw new ArgumentNullException ("match");
-
- for (int i = array.Length - 1; i >= 0; i--)
- if (match (array [i]))
- return array [i];
-
- return default (T);
- }
-
- [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
- //
- // The constrained copy should guarantee that if there is an exception thrown
- // during the copy, the destination array remains unchanged.
- // This is related to System.Runtime.Reliability.CER
- public static void ConstrainedCopy (Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
- {
- Copy (sourceArray, sourceIndex, destinationArray, destinationIndex, length);
+ return GetValueImpl (flattenedIndex);
}
#region Unsafe array operations
public static partial class Environment {
/*
- * This is the version number of the corlib-runtime interface. When
- * making changes to this interface (by changing the layout
- * of classes the runtime knows about, changing icall signature or
- * semantics etc), increment this variable. Also increment the
- * pair of this variable in the runtime in metadata/appdomain.c.
- * Changes which are already detected at runtime, like the addition
- * of icalls, do not require an increment.
+ * This is the version number of the corlib-runtime interface.
+ * It is defined in configure.ac.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 164;
+ private const int mono_corlib_version = Consts.MonoCorlibVersion;
#pragma warning restore 169
[ComVisible (true)]
return;
}
}
- if (index == 2) {
- if (zero) {
- offset = lens [0] + lens [1] + 2;
- length = format.Length - offset;
- return;
- }
- if (positive) {
- offset = 0;
- length = lens [0];
- return;
- }
- if (lens [1] > 0) {
- positive = true;
- offset = lens [0] + 1;
- length = lens [1];
+ if (zero) {
+ if (index == 2) {
+ if (format.Length - lastPos == 0) {
+ offset = 0;
+ length = lens [0];
+ } else {
+ offset = lens [0] + lens [1] + 2;
+ length = format.Length - offset;
+ }
return;
}
- else {
+
+ if (lens [2] == 0) {
offset = 0;
length = lens [0];
- return;
- }
- }
- if (index == 3) {
- if (zero) {
+ } else {
offset = lens [0] + lens [1] + 2;
length = lens [2];
- return;
- }
- if (positive) {
- offset = 0;
- length = lens [0];
- return;
- }
- if (lens [1] > 0) {
- positive = true;
- offset = lens [0] + 1;
- length = lens [1];
- return;
- }
- else {
- offset = 0;
- length = lens [0];
- return;
}
- }
- throw new ArgumentException ();
+ return;
+
+ }
+ if (positive) {
+ offset = 0;
+ length = lens [0];
+ return;
+ }
+ if (lens [1] > 0) {
+ positive = true;
+ offset = lens [0] + 1;
+ length = lens [1];
+ return;
+ }
+ offset = 0;
+ length = lens [0];
}
public static CustomInfo Parse (string format, int offset, int length, NumberFormatInfo nfi)
[Test]
public void bugnew2 () // values cannot be written on registry root (hive)
{
- string [] names = Registry.CurrentUser.GetValueNames ();
- Assert.IsNotNull (names, "#1");
- Registry.CurrentUser.SetValue ("name1", "value1");
- Assert.IsNotNull (Registry.CurrentUser.GetValue ("name1"), "#2");
- Assert.AreEqual ("value1", Registry.CurrentUser.GetValue ("name1"), "#3");
- string [] newNames = Registry.CurrentUser.GetValueNames ();
- Assert.IsNotNull (newNames, "#4");
- Assert.AreEqual (names.Length + 1, newNames.Length, "#5");
- Registry.CurrentUser.DeleteValue ("name1");
+ try {
+ string [] names = Registry.CurrentUser.GetValueNames ();
+ Assert.IsNotNull (names, "#1");
+ Registry.CurrentUser.SetValue ("name1", "value1");
+ Assert.IsNotNull (Registry.CurrentUser.GetValue ("name1"), "#2");
+ Assert.AreEqual ("value1", Registry.CurrentUser.GetValue ("name1"), "#3");
+ string [] newNames = Registry.CurrentUser.GetValueNames ();
+ Assert.IsNotNull (newNames, "#4");
+ Assert.AreEqual (names.Length + 1, newNames.Length, "#5");
+ Registry.CurrentUser.DeleteValue ("name1");
+ } finally {
+ Registry.CurrentUser.DeleteValue ("name1", false);
+ Registry.CurrentUser.Flush ();
+ }
}
[Test]
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
+using System.Linq;
using NUnit.Framework;
}
}
+ [Test]
+ public void SortTestTrickyPivot ()
+ {
+ int[] array = new int[] { 1, 3, 5, 2, 6, 6, 6, 6, 6, 6, 6,7 ,4 };
+
+ var list = array.ToList<int>();
+
+ list.Sort(delegate (int x, int y)
+ {
+ return x < y ? -1 : 1;
+ });
+
+ var res = string.Join (",", list);
+ Assert.AreEqual ("1,2,3,4,5,6,6,6,6,6,6,6,7", res);
+ }
+
[Test]
public void ClearTest ()
{
public void Test_Contains_After_Remove ()
{
List<int> list = new List<int> ();
- list.Add (2);
+ list.Add (2);
- list.Remove (2);
+ list.Remove (2);
Assert.AreEqual (false, list.Contains (2), "#0");
}
class GBD_D : GBD_C { public new virtual void f () {} }
class GBD_E : GBD_D { public override void f () {} }
+ class GBD_E2 : GBD_D { }
+ class GBD_F : GBD_E { }
+
+
[Test]
public void GetBaseDefinition ()
{
Assert.AreEqual (typeof (GBD_A), typeof (GBD_C).GetMethod ("f").GetBaseDefinition ().DeclaringType);
+ Assert.AreEqual (typeof (GBD_A), typeof (GBD_C).GetMethod ("f").GetBaseDefinition ().ReflectedType, "#1r");
+
Assert.AreEqual (typeof (GBD_D), typeof (GBD_D).GetMethod ("f").GetBaseDefinition ().DeclaringType);
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_D).GetMethod ("f").GetBaseDefinition ().ReflectedType, "#2r");
+
Assert.AreEqual (typeof (GBD_D), typeof (GBD_E).GetMethod ("f").GetBaseDefinition ().DeclaringType);
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_E).GetMethod ("f").GetBaseDefinition ().ReflectedType, "#3r");
+
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_E2).GetMethod ("f").GetBaseDefinition ().DeclaringType, "#4");
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_E2).GetMethod ("f").GetBaseDefinition ().ReflectedType, "#4r");
+
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_F).GetMethod ("f").GetBaseDefinition ().DeclaringType, "#5");
+ Assert.AreEqual (typeof (GBD_D), typeof (GBD_F).GetMethod ("f").GetBaseDefinition ().ReflectedType, "#5r");
+
}
class GenericBase<T,H> {
File.Delete("temp.b64");
}
-#if !MOBILE
+#if !MOBILE && !MONOMAC
public IntPtr GetHandleEx (byte[] certificate)
{
CertificateContext cc = new CertificateContext ();
}
[Test]
-#if MOBILE
+#if MOBILE || MONOMAC
[Ignore ("This constructor always throw a NotSupportedException under MOBILE and is useless without CryptoAPI (i.e. outside Windows)")]
#endif
public void ConstructorIntPtr ()
{
+ // This test uses a certificate format that only works
+ if (PlatformID.Win32NT != Environment.OSVersion.Platform)
+ return;
+
byte[] cert = { 0x30,0x82,0x01,0xFF,0x30,0x82,0x01,0x6C,0x02,0x05,0x02,0x72,0x00,0x06,0xE8,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,0x05,0x00,0x30,0x5F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x0A,0x13,0x17,0x52,0x53,0x41,0x20,0x44,0x61,0x74,0x61,0x20,0x53,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2E,0x30,0x2C,0x06,0x03,0x55,0x04,0x0B,0x13,0x25,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x53,0x65,0x72,0x76,
0x65,0x72,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,0x36,0x30,0x33,0x31,0x32,0x31,0x38,0x33,0x38,0x34,0x37,0x5A,0x17,0x0D,0x39,0x37,0x30,0x33,0x31,0x32,0x31,0x38,0x33,0x38,0x34,0x36,0x5A,0x30,0x61,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x08,0x13,0x0A,0x43,0x61,0x6C,0x69,0x66,0x6F,0x72,0x6E,0x69,0x61,0x31,0x14,0x30,0x12,0x06,0x03,
0x55,0x04,0x0A,0x13,0x0B,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x65,0x4E,0x65,0x74,0x31,0x27,0x30,0x25,0x06,0x03,0x55,0x04,0x0B,0x13,0x1E,0x53,0x65,0x72,0x76,0x65,0x72,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x70,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x5F,0x00,0x30,0x5C,0x02,0x55,0x2D,0x58,0xE9,0xBF,0xF0,0x31,0xCD,0x79,0x06,0x50,0x5A,0xD5,0x9E,0x0E,0x2C,0xE6,0xC2,0xF7,0xF9,
// Certificate: basic\BADCERT.cer
// - Bad certificate (will throw an exception)
[Test]
+[Category ("MacNotWorking")] // SecCertificateCreateWithData does different things on 10.11 vs 10.12 with invalid certificates https://bugzilla.xamarin.com/show_bug.cgi?id=53689
public void Certificate7 ()
{
// cannot be loaded - will throw an exception
}
[Test]
- public void Check_InvalidOperationException() {
- object[] arr = new object[] {new SomeComparable (), new SomeIncomparable (), new SomeComparable ()};
+ public void Check_NoInvalidOperationException ()
+ {
+ Array arr = new object[] {new SomeComparable (), new SomeIncomparable (), new SomeComparable ()};
- try {
- Array.Sort (arr);
- Assert.Fail ("#1");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr);
- try {
- Array.Sort (arr, (Array)null);
- Assert.Fail ("#2");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, (Array)null);
- try {
- Array.Sort (arr, (IComparer)null);
- Assert.Fail ("#3");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, (IComparer)null);
- try {
- Array.Sort (arr, 0, 3);
- Assert.Fail ("#4");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, 0, 3);
- try {
- Array.Sort (arr, null, null);
- Assert.Fail ("#5");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, null, null);
- try {
- Array.Sort (arr, null, 0, 3);
- Assert.Fail ("#6");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, null, 0, 3);
- try {
- Array.Sort (arr, 0, 3, null);
- Assert.Fail ("#7");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, 0, 3, null);
- try {
- Array.Sort (arr, null, 0, 3, null);
- Assert.Fail ("#8");
- } catch (InvalidOperationException) {}
-
- try {
- Array.Sort<object> (arr);
- Assert.Fail ("#9");
- } catch (InvalidOperationException) {}
+ Array.Sort (arr, null, 0, 3, null);
+ }
+
+ [Test]
+ public void Check_NoInvalidOperationException_Generic ()
+ {
+ object[] arr = new object[] {new SomeComparable (), new SomeIncomparable (), new SomeComparable ()};
+
+ Array.Sort<object> (arr);
- try {
- Array.Sort<object, object> (arr, null);
- Assert.Fail ("#10");
- } catch (InvalidOperationException) {}
+ Array.Sort<object, object> (arr, null);
- try {
- Array.Sort<object> (arr, (IComparer<object>)null);
- Assert.Fail ("#11");
- } catch (InvalidOperationException) {}
+ Array.Sort<object> (arr, (IComparer<object>)null);
- try {
- Array.Sort<object, object> (arr, null, null);
- Assert.Fail ("#12");
- } catch (InvalidOperationException) {}
+ Array.Sort<object, object> (arr, null, null);
- try {
- Array.Sort<object> (arr, 0, 3);
- Assert.Fail ("#13");
- } catch (InvalidOperationException) {}
+ Array.Sort<object> (arr, 0, 3);
- try {
- Array.Sort<object, object> (arr, null, 0, 3);
- Assert.Fail ("#14");
- } catch (InvalidOperationException) {}
+ Array.Sort<object, object> (arr, null, 0, 3);
- try {
- Array.Sort<object> (arr, 0, 3, null);
- Assert.Fail ("#15");
- } catch (InvalidOperationException) {}
+ Array.Sort<object> (arr, 0, 3, null);
- try {
- Array.Sort<object, object> (arr, null, 0, 3, null);
- Assert.Fail ("#16");
- } catch (InvalidOperationException) {}
+ Array.Sort<object, object> (arr, null, 0, 3, null);
}
}
}
int[] myBoundArray = new int[1] { Int32.MinValue };
Array myExtremeArray=Array.CreateInstance ( typeof(String), myLengthArray, myBoundArray );
Assert.AreEqual (Int32.MaxValue, ((IList)myExtremeArray).IndexOf (42), "AD04");
-
}
[Test]
}
}
+ [Test]
+ public void TestSortComparableMixed()
+ {
+ var m = new TestSortComparableMixed_Comparer ();
+ var arr = new object [] { 1, 2, m, 4, 5, 6, 7, 8, 9, 10 };
+
+ Array.Sort (arr);
+
+ var expected = new object [] { m, 1, 2, 4, 5, 6, 7, 8, 9, 10 };
+ Assert.AreEqual (expected, arr);
+ }
+
+ class TestSortComparableMixed_Comparer : IComparable
+ {
+ public int CompareTo (object other)
+ {
+ return -1;
+ }
+ }
+
[Test]
public void TestInitializeEmpty()
{
int hundred = 100;
int neghund = -100;
- Assert.IsTrue ( hundred.ToString ("#;#") == "100", "#TS1");
- Assert.IsTrue ( hundred.ToString ("-#;#") == "-100", "#TS2");
- Assert.IsTrue ( neghund.ToString ("#;#") == "100", "#TS3");
- Assert.IsTrue ( neghund.ToString ("#;-#") == "-100", "#TS3");
+ Assert.AreEqual ("100", hundred.ToString ("#;#"), "#TS1");
+ Assert.AreEqual ("-100", hundred.ToString ("-#;#"), "#TS2");
+ Assert.AreEqual ("100", neghund.ToString ("#;#"), "#TS3");
+ Assert.AreEqual ("-100", neghund.ToString ("#;-#"), "#TS4");
+ Assert.AreEqual ("3", 0.ToString ("3;;"), "#TS5");
+ Assert.AreEqual ("3", 0.ToString ("3;2;"), "#TS6");
+ Assert.AreEqual ("3", 0.ToString ("3;"), "#TS7");
+ Assert.AreEqual ("3", 0.ToString ("3;;;;;;;"), "#TS8");
}
[Test]
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+**
+**
+**
+**
+** Purpose: class to sort arrays
+**
+**
+===========================================================*/
+
+using System;
+using System.Globalization;
+using System.Runtime.CompilerServices;
+using System.Diagnostics;
+using System.Diagnostics.Contracts;
+using System.Runtime.Versioning;
+#if MONO
+using System.Diagnostics.Private;
+#endif
+
+namespace System.Collections.Generic
+{
+ #region ArraySortHelper for single arrays
+
+ internal interface IArraySortHelper<TKey>
+ {
+ void Sort(TKey[] keys, int index, int length, IComparer<TKey> comparer);
+ int BinarySearch(TKey[] keys, int index, int length, TKey value, IComparer<TKey> comparer);
+ }
+
+ internal static class IntrospectiveSortUtilities
+ {
+ // This is the threshold where Introspective sort switches to Insertion sort.
+ // Imperically, 16 seems to speed up most cases without slowing down others, at least for integers.
+ // Large value types may benefit from a smaller number.
+ internal const int IntrosortSizeThreshold = 16;
+
+ internal static int FloorLog2(int n)
+ {
+ int result = 0;
+ while (n >= 1)
+ {
+ result++;
+ n = n / 2;
+ }
+ return result;
+ }
+
+ internal static void ThrowOrIgnoreBadComparer(Object comparer)
+ {
+ throw new ArgumentException(Environment.GetResourceString("Arg_BogusIComparer", comparer));
+ }
+ }
+
+ [TypeDependencyAttribute("System.Collections.Generic.GenericArraySortHelper`1")]
+ internal class ArraySortHelper<T>
+ : IArraySortHelper<T>
+ {
+ private static volatile IArraySortHelper<T> defaultArraySortHelper;
+
+ public static IArraySortHelper<T> Default
+ {
+ get
+ {
+ IArraySortHelper<T> sorter = defaultArraySortHelper;
+ if (sorter == null)
+ sorter = CreateArraySortHelper();
+
+ return sorter;
+ }
+ }
+
+ private static IArraySortHelper<T> CreateArraySortHelper()
+ {
+#if !MONO
+ if (typeof(IComparable<T>).IsAssignableFrom(typeof(T)))
+ {
+ defaultArraySortHelper = (IArraySortHelper<T>)RuntimeTypeHandle.Allocate(typeof(GenericArraySortHelper<string>).TypeHandle.Instantiate(new Type[] { typeof(T) }));
+ }
+ else
+#endif
+ {
+ defaultArraySortHelper = new ArraySortHelper<T>();
+ }
+ return defaultArraySortHelper;
+ }
+
+ #region IArraySortHelper<T> Members
+
+ public void Sort(T[] keys, int index, int length, IComparer<T> comparer)
+ {
+ Debug.Assert(keys != null, "Check the arguments in the caller!");
+ Debug.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
+
+ // Add a try block here to detect IComparers (or their
+ // underlying IComparables, etc) that are bogus.
+ try
+ {
+ if (comparer == null)
+ {
+ comparer = Comparer<T>.Default;
+ }
+
+ IntrospectiveSort(keys, index, length, comparer.Compare);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ public int BinarySearch(T[] array, int index, int length, T value, IComparer<T> comparer)
+ {
+ try
+ {
+ if (comparer == null)
+ {
+ comparer = Comparer<T>.Default;
+ }
+
+ return InternalBinarySearch(array, index, length, value, comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ #endregion
+
+ internal static void Sort(T[] keys, int index, int length, Comparison<T> comparer)
+ {
+ Debug.Assert(keys != null, "Check the arguments in the caller!");
+ Debug.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
+ Debug.Assert(comparer != null, "Check the arguments in the caller!");
+
+ // Add a try block here to detect bogus comparisons
+ try
+ {
+ IntrospectiveSort(keys, index, length, comparer);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ internal static int InternalBinarySearch(T[] array, int index, int length, T value, IComparer<T> comparer)
+ {
+ Contract.Requires(array != null, "Check the arguments in the caller!");
+ Contract.Requires(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
+
+ int lo = index;
+ int hi = index + length - 1;
+ while (lo <= hi)
+ {
+ int i = lo + ((hi - lo) >> 1);
+ int order = comparer.Compare(array[i], value);
+
+ if (order == 0) return i;
+ if (order < 0)
+ {
+ lo = i + 1;
+ }
+ else
+ {
+ hi = i - 1;
+ }
+ }
+
+ return ~lo;
+ }
+
+ private static void SwapIfGreater(T[] keys, Comparison<T> comparer, int a, int b)
+ {
+ if (a != b)
+ {
+ if (comparer(keys[a], keys[b]) > 0)
+ {
+ T key = keys[a];
+ keys[a] = keys[b];
+ keys[b] = key;
+ }
+ }
+ }
+
+ private static void Swap(T[] a, int i, int j)
+ {
+ if (i != j)
+ {
+ T t = a[i];
+ a[i] = a[j];
+ a[j] = t;
+ }
+ }
+
+ internal static void IntrospectiveSort(T[] keys, int left, int length, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(left >= 0);
+ Contract.Requires(length >= 0);
+ Contract.Requires(length <= keys.Length);
+ Contract.Requires(length + left <= keys.Length);
+
+ if (length < 2)
+ return;
+
+ IntroSort(keys, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length), comparer);
+ }
+
+ private static void IntroSort(T[] keys, int lo, int hi, int depthLimit, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi < keys.Length);
+
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreater(keys, comparer, lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreater(keys, comparer, lo, hi - 1);
+ SwapIfGreater(keys, comparer, lo, hi);
+ SwapIfGreater(keys, comparer, hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(keys, lo, hi, comparer);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(keys, lo, hi, comparer);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(keys, lo, hi, comparer);
+ // Note we've already partitioned around the pivot and do not have to move the pivot again.
+ IntroSort(keys, p + 1, hi, depthLimit, comparer);
+ hi = p - 1;
+ }
+ }
+
+ private static int PickPivotAndPartition(T[] keys, int lo, int hi, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+ Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
+
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int middle = lo + ((hi - lo) / 2);
+
+ // Sort lo, mid and hi appropriately, then pick mid as the pivot.
+ SwapIfGreater(keys, comparer, lo, middle); // swap the low with the mid point
+ SwapIfGreater(keys, comparer, lo, hi); // swap the low with the high
+ SwapIfGreater(keys, comparer, middle, hi); // swap the middle with the high
+
+ T pivot = keys[middle];
+ Swap(keys, middle, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ while (comparer(keys[++left], pivot) < 0) ;
+ while (comparer(pivot, keys[--right]) < 0) ;
+
+ if (left >= right)
+ break;
+
+ Swap(keys, left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(keys, left, (hi - 1));
+ return left;
+ }
+
+ private static void Heapsort(T[] keys, int lo, int hi, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(keys, i, n, lo, comparer);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(keys, lo, lo + i - 1);
+ DownHeap(keys, 1, i - 1, lo, comparer);
+ }
+ }
+
+ private static void DownHeap(T[] keys, int i, int n, int lo, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(lo < keys.Length);
+
+ T d = keys[lo + i - 1];
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && comparer(keys[lo + child - 1], keys[lo + child]) < 0)
+ {
+ child++;
+ }
+ if (!(comparer(d, keys[lo + child - 1]) < 0))
+ break;
+ keys[lo + i - 1] = keys[lo + child - 1];
+ i = child;
+ }
+ keys[lo + i - 1] = d;
+ }
+
+ private static void InsertionSort(T[] keys, int lo, int hi, Comparison<T> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi >= lo);
+ Contract.Requires(hi <= keys.Length);
+
+ int i, j;
+ T t;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys[i + 1];
+ while (j >= lo && comparer(t, keys[j]) < 0)
+ {
+ keys[j + 1] = keys[j];
+ j--;
+ }
+ keys[j + 1] = t;
+ }
+ }
+ }
+
+ [Serializable()]
+ internal class GenericArraySortHelper<T>
+ : IArraySortHelper<T>
+ where T : IComparable<T>
+ {
+ // Do not add a constructor to this class because ArraySortHelper<T>.CreateSortHelper will not execute it
+
+ #region IArraySortHelper<T> Members
+
+ public void Sort(T[] keys, int index, int length, IComparer<T> comparer)
+ {
+ Debug.Assert(keys != null, "Check the arguments in the caller!");
+ Debug.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
+
+ try
+ {
+ if (comparer == null || comparer == Comparer<T>.Default)
+ {
+ IntrospectiveSort(keys, index, length);
+ }
+ else
+ {
+ ArraySortHelper<T>.IntrospectiveSort(keys, index, length, comparer.Compare);
+ }
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ public int BinarySearch(T[] array, int index, int length, T value, IComparer<T> comparer)
+ {
+ Debug.Assert(array != null, "Check the arguments in the caller!");
+ Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
+
+ try
+ {
+ if (comparer == null || comparer == Comparer<T>.Default)
+ {
+ return BinarySearch(array, index, length, value);
+ }
+ else
+ {
+ return ArraySortHelper<T>.InternalBinarySearch(array, index, length, value, comparer);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ #endregion
+
+ // This function is called when the user doesn't specify any comparer.
+ // Since T is constrained here, we can call IComparable<T>.CompareTo here.
+ // We can avoid boxing for value type and casting for reference types.
+ private static int BinarySearch(T[] array, int index, int length, T value)
+ {
+ int lo = index;
+ int hi = index + length - 1;
+ while (lo <= hi)
+ {
+ int i = lo + ((hi - lo) >> 1);
+ int order;
+ if (array[i] == null)
+ {
+ order = (value == null) ? 0 : -1;
+ }
+ else
+ {
+ order = array[i].CompareTo(value);
+ }
+
+ if (order == 0)
+ {
+ return i;
+ }
+
+ if (order < 0)
+ {
+ lo = i + 1;
+ }
+ else
+ {
+ hi = i - 1;
+ }
+ }
+
+ return ~lo;
+ }
+
+ private static void SwapIfGreaterWithItems(T[] keys, int a, int b)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(0 <= a && a < keys.Length);
+ Contract.Requires(0 <= b && b < keys.Length);
+
+ if (a != b)
+ {
+ if (keys[a] != null && keys[a].CompareTo(keys[b]) > 0)
+ {
+ T key = keys[a];
+ keys[a] = keys[b];
+ keys[b] = key;
+ }
+ }
+ }
+
+ private static void Swap(T[] a, int i, int j)
+ {
+ if (i != j)
+ {
+ T t = a[i];
+ a[i] = a[j];
+ a[j] = t;
+ }
+ }
+
+ internal static void IntrospectiveSort(T[] keys, int left, int length)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(left >= 0);
+ Contract.Requires(length >= 0);
+ Contract.Requires(length <= keys.Length);
+ Contract.Requires(length + left <= keys.Length);
+
+ if (length < 2)
+ return;
+
+ IntroSort(keys, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
+ }
+
+ private static void IntroSort(T[] keys, int lo, int hi, int depthLimit)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi < keys.Length);
+
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreaterWithItems(keys, lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreaterWithItems(keys, lo, hi - 1);
+ SwapIfGreaterWithItems(keys, lo, hi);
+ SwapIfGreaterWithItems(keys, hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(keys, lo, hi);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(keys, lo, hi);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(keys, lo, hi);
+ // Note we've already partitioned around the pivot and do not have to move the pivot again.
+ IntroSort(keys, p + 1, hi, depthLimit);
+ hi = p - 1;
+ }
+ }
+
+ private static int PickPivotAndPartition(T[] keys, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+ Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
+
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int middle = lo + ((hi - lo) / 2);
+
+ // Sort lo, mid and hi appropriately, then pick mid as the pivot.
+ SwapIfGreaterWithItems(keys, lo, middle); // swap the low with the mid point
+ SwapIfGreaterWithItems(keys, lo, hi); // swap the low with the high
+ SwapIfGreaterWithItems(keys, middle, hi); // swap the middle with the high
+
+ T pivot = keys[middle];
+ Swap(keys, middle, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ if (pivot == null)
+ {
+ while (left < (hi - 1) && keys[++left] == null) ;
+ while (right > lo && keys[--right] != null) ;
+ }
+ else
+ {
+ while (pivot.CompareTo(keys[++left]) > 0) ;
+ while (pivot.CompareTo(keys[--right]) < 0) ;
+ }
+
+ if (left >= right)
+ break;
+
+ Swap(keys, left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(keys, left, (hi - 1));
+ return left;
+ }
+
+ private static void Heapsort(T[] keys, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(keys, i, n, lo);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(keys, lo, lo + i - 1);
+ DownHeap(keys, 1, i - 1, lo);
+ }
+ }
+
+ private static void DownHeap(T[] keys, int i, int n, int lo)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(lo < keys.Length);
+
+ T d = keys[lo + i - 1];
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && (keys[lo + child - 1] == null || keys[lo + child - 1].CompareTo(keys[lo + child]) < 0))
+ {
+ child++;
+ }
+ if (keys[lo + child - 1] == null || keys[lo + child - 1].CompareTo(d) < 0)
+ break;
+ keys[lo + i - 1] = keys[lo + child - 1];
+ i = child;
+ }
+ keys[lo + i - 1] = d;
+ }
+
+ private static void InsertionSort(T[] keys, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi >= lo);
+ Contract.Requires(hi <= keys.Length);
+
+ int i, j;
+ T t;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys[i + 1];
+ while (j >= lo && (t == null || t.CompareTo(keys[j]) < 0))
+ {
+ keys[j + 1] = keys[j];
+ j--;
+ }
+ keys[j + 1] = t;
+ }
+ }
+ }
+
+ #endregion
+
+ #region ArraySortHelper for paired key and value arrays
+
+ internal interface IArraySortHelper<TKey, TValue>
+ {
+ void Sort(TKey[] keys, TValue[] values, int index, int length, IComparer<TKey> comparer);
+ }
+
+ [TypeDependencyAttribute("System.Collections.Generic.GenericArraySortHelper`2")]
+ internal class ArraySortHelper<TKey, TValue>
+ : IArraySortHelper<TKey, TValue>
+ {
+ private static volatile IArraySortHelper<TKey, TValue> defaultArraySortHelper;
+
+ public static IArraySortHelper<TKey, TValue> Default
+ {
+ get
+ {
+ IArraySortHelper<TKey, TValue> sorter = defaultArraySortHelper;
+ if (sorter == null)
+ sorter = CreateArraySortHelper();
+
+ return sorter;
+ }
+ }
+
+ private static IArraySortHelper<TKey, TValue> CreateArraySortHelper()
+ {
+#if !MONO
+ if (typeof(IComparable<TKey>).IsAssignableFrom(typeof(TKey)))
+ {
+ defaultArraySortHelper = (IArraySortHelper<TKey, TValue>)RuntimeTypeHandle.Allocate(typeof(GenericArraySortHelper<string, string>).TypeHandle.Instantiate(new Type[] { typeof(TKey), typeof(TValue) }));
+ }
+ else
+#endif
+ {
+ defaultArraySortHelper = new ArraySortHelper<TKey, TValue>();
+ }
+ return defaultArraySortHelper;
+ }
+
+ public void Sort(TKey[] keys, TValue[] values, int index, int length, IComparer<TKey> comparer)
+ {
+ Debug.Assert(keys != null, "Check the arguments in the caller!"); // Precondition on interface method
+ Debug.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
+
+ // Add a try block here to detect IComparers (or their
+ // underlying IComparables, etc) that are bogus.
+ try
+ {
+ if (comparer == null || comparer == Comparer<TKey>.Default)
+ {
+ comparer = Comparer<TKey>.Default;
+ }
+
+ IntrospectiveSort(keys, values, index, length, comparer);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ private static void SwapIfGreaterWithItems(TKey[] keys, TValue[] values, IComparer<TKey> comparer, int a, int b)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values == null || values.Length >= keys.Length);
+ Contract.Requires(comparer != null);
+ Contract.Requires(0 <= a && a < keys.Length);
+ Contract.Requires(0 <= b && b < keys.Length);
+
+ if (a != b)
+ {
+ if (comparer.Compare(keys[a], keys[b]) > 0)
+ {
+ TKey key = keys[a];
+ keys[a] = keys[b];
+ keys[b] = key;
+ if (values != null)
+ {
+ TValue value = values[a];
+ values[a] = values[b];
+ values[b] = value;
+ }
+ }
+ }
+ }
+
+ private static void Swap(TKey[] keys, TValue[] values, int i, int j)
+ {
+ if (i != j)
+ {
+ TKey k = keys[i];
+ keys[i] = keys[j];
+ keys[j] = k;
+ if (values != null)
+ {
+ TValue v = values[i];
+ values[i] = values[j];
+ values[j] = v;
+ }
+ }
+ }
+
+ internal static void IntrospectiveSort(TKey[] keys, TValue[] values, int left, int length, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(left >= 0);
+ Contract.Requires(length >= 0);
+ Contract.Requires(length <= keys.Length);
+ Contract.Requires(length + left <= keys.Length);
+ Contract.Requires(length + left <= values.Length);
+
+ if (length < 2)
+ return;
+
+ IntroSort(keys, values, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length), comparer);
+ }
+
+ private static void IntroSort(TKey[] keys, TValue[] values, int lo, int hi, int depthLimit, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi < keys.Length);
+
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreaterWithItems(keys, values, comparer, lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreaterWithItems(keys, values, comparer, lo, hi - 1);
+ SwapIfGreaterWithItems(keys, values, comparer, lo, hi);
+ SwapIfGreaterWithItems(keys, values, comparer, hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(keys, values, lo, hi, comparer);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(keys, values, lo, hi, comparer);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(keys, values, lo, hi, comparer);
+ // Note we've already partitioned around the pivot and do not have to move the pivot again.
+ IntroSort(keys, values, p + 1, hi, depthLimit, comparer);
+ hi = p - 1;
+ }
+ }
+
+ private static int PickPivotAndPartition(TKey[] keys, TValue[] values, int lo, int hi, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+ Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
+
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int middle = lo + ((hi - lo) / 2);
+
+ // Sort lo, mid and hi appropriately, then pick mid as the pivot.
+ SwapIfGreaterWithItems(keys, values, comparer, lo, middle); // swap the low with the mid point
+ SwapIfGreaterWithItems(keys, values, comparer, lo, hi); // swap the low with the high
+ SwapIfGreaterWithItems(keys, values, comparer, middle, hi); // swap the middle with the high
+
+ TKey pivot = keys[middle];
+ Swap(keys, values, middle, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ while (comparer.Compare(keys[++left], pivot) < 0) ;
+ while (comparer.Compare(pivot, keys[--right]) < 0) ;
+
+ if (left >= right)
+ break;
+
+ Swap(keys, values, left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(keys, values, left, (hi - 1));
+ return left;
+ }
+
+ private static void Heapsort(TKey[] keys, TValue[] values, int lo, int hi, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(keys, values, i, n, lo, comparer);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(keys, values, lo, lo + i - 1);
+ DownHeap(keys, values, 1, i - 1, lo, comparer);
+ }
+ }
+
+ private static void DownHeap(TKey[] keys, TValue[] values, int i, int n, int lo, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(lo < keys.Length);
+
+ TKey d = keys[lo + i - 1];
+ TValue dValue = (values != null) ? values[lo + i - 1] : default(TValue);
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && comparer.Compare(keys[lo + child - 1], keys[lo + child]) < 0)
+ {
+ child++;
+ }
+ if (!(comparer.Compare(d, keys[lo + child - 1]) < 0))
+ break;
+ keys[lo + i - 1] = keys[lo + child - 1];
+ if (values != null)
+ values[lo + i - 1] = values[lo + child - 1];
+ i = child;
+ }
+ keys[lo + i - 1] = d;
+ if (values != null)
+ values[lo + i - 1] = dValue;
+ }
+
+ private static void InsertionSort(TKey[] keys, TValue[] values, int lo, int hi, IComparer<TKey> comparer)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(comparer != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi >= lo);
+ Contract.Requires(hi <= keys.Length);
+
+ int i, j;
+ TKey t;
+ TValue tValue;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys[i + 1];
+ tValue = (values != null) ? values[i + 1] : default(TValue);
+ while (j >= lo && comparer.Compare(t, keys[j]) < 0)
+ {
+ keys[j + 1] = keys[j];
+ if (values != null)
+ values[j + 1] = values[j];
+ j--;
+ }
+ keys[j + 1] = t;
+ if (values != null)
+ values[j + 1] = tValue;
+ }
+ }
+ }
+
+ internal class GenericArraySortHelper<TKey, TValue>
+ : IArraySortHelper<TKey, TValue>
+ where TKey : IComparable<TKey>
+ {
+ public void Sort(TKey[] keys, TValue[] values, int index, int length, IComparer<TKey> comparer)
+ {
+ Debug.Assert(keys != null, "Check the arguments in the caller!");
+ Debug.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
+
+ // Add a try block here to detect IComparers (or their
+ // underlying IComparables, etc) that are bogus.
+ try
+ {
+ if (comparer == null || comparer == Comparer<TKey>.Default)
+ {
+ IntrospectiveSort(keys, values, index, length);
+ }
+ else
+ {
+ ArraySortHelper<TKey, TValue>.IntrospectiveSort(keys, values, index, length, comparer);
+ }
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e);
+ }
+ }
+
+ private static void SwapIfGreaterWithItems(TKey[] keys, TValue[] values, int a, int b)
+ {
+ if (a != b)
+ {
+ if (keys[a] != null && keys[a].CompareTo(keys[b]) > 0)
+ {
+ TKey key = keys[a];
+ keys[a] = keys[b];
+ keys[b] = key;
+ if (values != null)
+ {
+ TValue value = values[a];
+ values[a] = values[b];
+ values[b] = value;
+ }
+ }
+ }
+ }
+
+ private static void Swap(TKey[] keys, TValue[] values, int i, int j)
+ {
+ if (i != j)
+ {
+ TKey k = keys[i];
+ keys[i] = keys[j];
+ keys[j] = k;
+ if (values != null)
+ {
+ TValue v = values[i];
+ values[i] = values[j];
+ values[j] = v;
+ }
+ }
+ }
+
+ internal static void IntrospectiveSort(TKey[] keys, TValue[] values, int left, int length)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(left >= 0);
+ Contract.Requires(length >= 0);
+ Contract.Requires(length <= keys.Length);
+ Contract.Requires(length + left <= keys.Length);
+ Contract.Requires(length + left <= values.Length);
+
+ if (length < 2)
+ return;
+
+ IntroSort(keys, values, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
+ }
+
+ private static void IntroSort(TKey[] keys, TValue[] values, int lo, int hi, int depthLimit)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi < keys.Length);
+
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreaterWithItems(keys, values, lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreaterWithItems(keys, values, lo, hi - 1);
+ SwapIfGreaterWithItems(keys, values, lo, hi);
+ SwapIfGreaterWithItems(keys, values, hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(keys, values, lo, hi);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(keys, values, lo, hi);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(keys, values, lo, hi);
+ // Note we've already partitioned around the pivot and do not have to move the pivot again.
+ IntroSort(keys, values, p + 1, hi, depthLimit);
+ hi = p - 1;
+ }
+ }
+
+ private static int PickPivotAndPartition(TKey[] keys, TValue[] values, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+ Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi);
+
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int middle = lo + ((hi - lo) / 2);
+
+ // Sort lo, mid and hi appropriately, then pick mid as the pivot.
+ SwapIfGreaterWithItems(keys, values, lo, middle); // swap the low with the mid point
+ SwapIfGreaterWithItems(keys, values, lo, hi); // swap the low with the high
+ SwapIfGreaterWithItems(keys, values, middle, hi); // swap the middle with the high
+
+ TKey pivot = keys[middle];
+ Swap(keys, values, middle, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ if (pivot == null)
+ {
+ while (left < (hi - 1) && keys[++left] == null) ;
+ while (right > lo && keys[--right] != null) ;
+ }
+ else
+ {
+ while (pivot.CompareTo(keys[++left]) > 0) ;
+ while (pivot.CompareTo(keys[--right]) < 0) ;
+ }
+
+ if (left >= right)
+ break;
+
+ Swap(keys, values, left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(keys, values, left, (hi - 1));
+ return left;
+ }
+
+ private static void Heapsort(TKey[] keys, TValue[] values, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi > lo);
+ Contract.Requires(hi < keys.Length);
+
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(keys, values, i, n, lo);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(keys, values, lo, lo + i - 1);
+ DownHeap(keys, values, 1, i - 1, lo);
+ }
+ }
+
+ private static void DownHeap(TKey[] keys, TValue[] values, int i, int n, int lo)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(lo < keys.Length);
+
+ TKey d = keys[lo + i - 1];
+ TValue dValue = (values != null) ? values[lo + i - 1] : default(TValue);
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && (keys[lo + child - 1] == null || keys[lo + child - 1].CompareTo(keys[lo + child]) < 0))
+ {
+ child++;
+ }
+ if (keys[lo + child - 1] == null || keys[lo + child - 1].CompareTo(d) < 0)
+ break;
+ keys[lo + i - 1] = keys[lo + child - 1];
+ if (values != null)
+ values[lo + i - 1] = values[lo + child - 1];
+ i = child;
+ }
+ keys[lo + i - 1] = d;
+ if (values != null)
+ values[lo + i - 1] = dValue;
+ }
+
+ private static void InsertionSort(TKey[] keys, TValue[] values, int lo, int hi)
+ {
+ Contract.Requires(keys != null);
+ Contract.Requires(values != null);
+ Contract.Requires(lo >= 0);
+ Contract.Requires(hi >= lo);
+ Contract.Requires(hi <= keys.Length);
+
+ int i, j;
+ TKey t;
+ TValue tValue;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys[i + 1];
+ tValue = (values != null) ? values[i + 1] : default(TValue);
+ while (j >= lo && (t == null || t.CompareTo(keys[j]) < 0))
+ {
+ keys[j + 1] = keys[j];
+ if (values != null)
+ values[j + 1] = values[j];
+ j--;
+ }
+ keys[j + 1] = t;
+ if (values != null)
+ values[j + 1] = tValue;
+ }
+ }
+ }
+
+ #endregion
+}
--- /dev/null
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System
+{
+ partial class Array
+ {
+ // Private value type used by the Sort methods.
+ private struct SorterObjectArray
+ {
+ private Object[] keys;
+ private Object[] items;
+ private IComparer comparer;
+
+ internal SorterObjectArray(Object[] keys, Object[] items, IComparer comparer)
+ {
+ if (comparer == null) comparer = Comparer.Default;
+ this.keys = keys;
+ this.items = items;
+ this.comparer = comparer;
+ }
+
+ internal void SwapIfGreaterWithItems(int a, int b)
+ {
+ if (a != b)
+ {
+ if (comparer.Compare(keys[a], keys[b]) > 0)
+ {
+ Object temp = keys[a];
+ keys[a] = keys[b];
+ keys[b] = temp;
+ if (items != null)
+ {
+ Object item = items[a];
+ items[a] = items[b];
+ items[b] = item;
+ }
+ }
+ }
+ }
+
+ private void Swap(int i, int j)
+ {
+ Object t = keys[i];
+ keys[i] = keys[j];
+ keys[j] = t;
+
+ if (items != null)
+ {
+ Object item = items[i];
+ items[i] = items[j];
+ items[j] = item;
+ }
+ }
+
+ internal void Sort(int left, int length)
+ {
+ IntrospectiveSort(left, length);
+ }
+
+ private void IntrospectiveSort(int left, int length)
+ {
+ if (length < 2)
+ return;
+
+ try
+ {
+ IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
+ }
+ }
+
+ private void IntroSort(int lo, int hi, int depthLimit)
+ {
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreaterWithItems(lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreaterWithItems(lo, hi - 1);
+ SwapIfGreaterWithItems(lo, hi);
+ SwapIfGreaterWithItems(hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(lo, hi);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(lo, hi);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(lo, hi);
+ IntroSort(p + 1, hi, depthLimit);
+ hi = p - 1;
+ }
+ }
+
+ private int PickPivotAndPartition(int lo, int hi)
+ {
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int mid = lo + (hi - lo) / 2;
+ // Sort lo, mid and hi appropriately, then pick mid as the pivot.
+ SwapIfGreaterWithItems(lo, mid);
+ SwapIfGreaterWithItems(lo, hi);
+ SwapIfGreaterWithItems(mid, hi);
+
+ Object pivot = keys[mid];
+ Swap(mid, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ while (comparer.Compare(keys[++left], pivot) < 0) ;
+ while (comparer.Compare(pivot, keys[--right]) < 0) ;
+
+ if (left >= right)
+ break;
+
+ Swap(left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(left, (hi - 1));
+ return left;
+ }
+
+ private void Heapsort(int lo, int hi)
+ {
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(i, n, lo);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(lo, lo + i - 1);
+
+ DownHeap(1, i - 1, lo);
+ }
+ }
+
+ private void DownHeap(int i, int n, int lo)
+ {
+ Object d = keys[lo + i - 1];
+ Object dt = (items != null) ? items[lo + i - 1] : null;
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && comparer.Compare(keys[lo + child - 1], keys[lo + child]) < 0)
+ {
+ child++;
+ }
+ if (!(comparer.Compare(d, keys[lo + child - 1]) < 0))
+ break;
+ keys[lo + i - 1] = keys[lo + child - 1];
+ if (items != null)
+ items[lo + i - 1] = items[lo + child - 1];
+ i = child;
+ }
+ keys[lo + i - 1] = d;
+ if (items != null)
+ items[lo + i - 1] = dt;
+ }
+
+ private void InsertionSort(int lo, int hi)
+ {
+ int i, j;
+ Object t, ti;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys[i + 1];
+ ti = (items != null) ? items[i + 1] : null;
+ while (j >= lo && comparer.Compare(t, keys[j]) < 0)
+ {
+ keys[j + 1] = keys[j];
+ if (items != null)
+ items[j + 1] = items[j];
+ j--;
+ }
+ keys[j + 1] = t;
+ if (items != null)
+ items[j + 1] = ti;
+ }
+ }
+ }
+
+ // Private value used by the Sort methods for instances of Array.
+ // This is slower than the one for Object[], since we can't use the JIT helpers
+ // to access the elements. We must use GetValue & SetValue.
+ private struct SorterGenericArray
+ {
+ private Array keys;
+ private Array items;
+ private IComparer comparer;
+
+ internal SorterGenericArray(Array keys, Array items, IComparer comparer)
+ {
+ if (comparer == null) comparer = Comparer.Default;
+ this.keys = keys;
+ this.items = items;
+ this.comparer = comparer;
+ }
+
+ internal void SwapIfGreaterWithItems(int a, int b)
+ {
+ if (a != b)
+ {
+ if (comparer.Compare(keys.GetValue(a), keys.GetValue(b)) > 0)
+ {
+ Object key = keys.GetValue(a);
+ keys.SetValue(keys.GetValue(b), a);
+ keys.SetValue(key, b);
+ if (items != null)
+ {
+ Object item = items.GetValue(a);
+ items.SetValue(items.GetValue(b), a);
+ items.SetValue(item, b);
+ }
+ }
+ }
+ }
+
+ private void Swap(int i, int j)
+ {
+ Object t1 = keys.GetValue(i);
+ keys.SetValue(keys.GetValue(j), i);
+ keys.SetValue(t1, j);
+
+ if (items != null)
+ {
+ Object t2 = items.GetValue(i);
+ items.SetValue(items.GetValue(j), i);
+ items.SetValue(t2, j);
+ }
+ }
+
+ internal void Sort(int left, int length)
+ {
+ IntrospectiveSort(left, length);
+ }
+
+ private void IntrospectiveSort(int left, int length)
+ {
+ if (length < 2)
+ return;
+
+ try
+ {
+ IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
+ }
+ catch (IndexOutOfRangeException)
+ {
+ IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(comparer);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
+ }
+ }
+
+ private void IntroSort(int lo, int hi, int depthLimit)
+ {
+ while (hi > lo)
+ {
+ int partitionSize = hi - lo + 1;
+ if (partitionSize <= IntrospectiveSortUtilities.IntrosortSizeThreshold)
+ {
+ if (partitionSize == 1)
+ {
+ return;
+ }
+ if (partitionSize == 2)
+ {
+ SwapIfGreaterWithItems(lo, hi);
+ return;
+ }
+ if (partitionSize == 3)
+ {
+ SwapIfGreaterWithItems(lo, hi - 1);
+ SwapIfGreaterWithItems(lo, hi);
+ SwapIfGreaterWithItems(hi - 1, hi);
+ return;
+ }
+
+ InsertionSort(lo, hi);
+ return;
+ }
+
+ if (depthLimit == 0)
+ {
+ Heapsort(lo, hi);
+ return;
+ }
+ depthLimit--;
+
+ int p = PickPivotAndPartition(lo, hi);
+ IntroSort(p + 1, hi, depthLimit);
+ hi = p - 1;
+ }
+ }
+
+ private int PickPivotAndPartition(int lo, int hi)
+ {
+ // Compute median-of-three. But also partition them, since we've done the comparison.
+ int mid = lo + (hi - lo) / 2;
+
+ SwapIfGreaterWithItems(lo, mid);
+ SwapIfGreaterWithItems(lo, hi);
+ SwapIfGreaterWithItems(mid, hi);
+
+ Object pivot = keys.GetValue(mid);
+ Swap(mid, hi - 1);
+ int left = lo, right = hi - 1; // We already partitioned lo and hi and put the pivot in hi - 1. And we pre-increment & decrement below.
+
+ while (left < right)
+ {
+ while (comparer.Compare(keys.GetValue(++left), pivot) < 0) ;
+ while (comparer.Compare(pivot, keys.GetValue(--right)) < 0) ;
+
+ if (left >= right)
+ break;
+
+ Swap(left, right);
+ }
+
+ // Put pivot in the right location.
+ Swap(left, (hi - 1));
+ return left;
+ }
+
+ private void Heapsort(int lo, int hi)
+ {
+ int n = hi - lo + 1;
+ for (int i = n / 2; i >= 1; i = i - 1)
+ {
+ DownHeap(i, n, lo);
+ }
+ for (int i = n; i > 1; i = i - 1)
+ {
+ Swap(lo, lo + i - 1);
+
+ DownHeap(1, i - 1, lo);
+ }
+ }
+
+ private void DownHeap(int i, int n, int lo)
+ {
+ Object d = keys.GetValue(lo + i - 1);
+ Object dt = (items != null) ? items.GetValue(lo + i - 1) : null;
+ int child;
+ while (i <= n / 2)
+ {
+ child = 2 * i;
+ if (child < n && comparer.Compare(keys.GetValue(lo + child - 1), keys.GetValue(lo + child)) < 0)
+ {
+ child++;
+ }
+
+ if (!(comparer.Compare(d, keys.GetValue(lo + child - 1)) < 0))
+ break;
+
+ keys.SetValue(keys.GetValue(lo + child - 1), lo + i - 1);
+ if (items != null)
+ items.SetValue(items.GetValue(lo + child - 1), lo + i - 1);
+ i = child;
+ }
+ keys.SetValue(d, lo + i - 1);
+ if (items != null)
+ items.SetValue(dt, lo + i - 1);
+ }
+
+ private void InsertionSort(int lo, int hi)
+ {
+ int i, j;
+ Object t, dt;
+ for (i = lo; i < hi; i++)
+ {
+ j = i;
+ t = keys.GetValue(i + 1);
+ dt = (items != null) ? items.GetValue(i + 1) : null;
+
+ while (j >= lo && comparer.Compare(t, keys.GetValue(j)) < 0)
+ {
+ keys.SetValue(keys.GetValue(j), j + 1);
+ if (items != null)
+ items.SetValue(items.GetValue(j), j + 1);
+ j--;
+ }
+
+ keys.SetValue(t, j + 1);
+ if (items != null)
+ items.SetValue(dt, j + 1);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime;
+using System.Threading;
+using System.Collections;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Diagnostics.Contracts;
+#if MONO
+using System.Diagnostics.Private;
+#endif
+
+namespace System
+{
+ public abstract partial class Array : ICollection, IEnumerable, IList, IStructuralComparable, IStructuralEquatable, ICloneable
+ {
+ public static ReadOnlyCollection<T> AsReadOnly<T>(T[] array)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ // T[] implements IList<T>.
+ return new ReadOnlyCollection<T>(array);
+ }
+
+ public static void Resize<T>(ref T[] array, int newSize)
+ {
+ if (newSize < 0)
+ throw new ArgumentOutOfRangeException(nameof(newSize), SR.ArgumentOutOfRange_NeedNonNegNum);
+
+ T[] larray = array;
+ if (larray == null)
+ {
+ array = new T[newSize];
+ return;
+ }
+
+ if (larray.Length != newSize)
+ {
+ T[] newArray = new T[newSize];
+ Copy(larray, 0, newArray, 0, larray.Length > newSize ? newSize : larray.Length);
+ array = newArray;
+ }
+ }
+
+ // Number of elements in the Array.
+ int ICollection.Count
+ { get { return Length; } }
+
+ // Is this Array read-only?
+ bool IList.IsReadOnly
+ { get { return false; } }
+
+ Object IList.this[int index]
+ {
+ get
+ {
+ return GetValue(index);
+ }
+
+ set
+ {
+ SetValue(value, index);
+ }
+ }
+
+ int IList.Add(Object value)
+ {
+ throw new NotSupportedException(SR.NotSupported_FixedSizeCollection);
+ }
+
+ bool IList.Contains(Object value)
+ {
+ return Array.IndexOf(this, value) >= 0;
+ }
+
+ void IList.Clear()
+ {
+ Array.Clear(this, 0, this.Length);
+ }
+
+ void IList.Insert(int index, Object value)
+ {
+ throw new NotSupportedException(SR.NotSupported_FixedSizeCollection);
+ }
+
+ void IList.Remove(Object value)
+ {
+ throw new NotSupportedException(SR.NotSupported_FixedSizeCollection);
+ }
+
+ void IList.RemoveAt(int index)
+ {
+ throw new NotSupportedException(SR.NotSupported_FixedSizeCollection);
+ }
+
+ // CopyTo copies a collection into an Array, starting at a particular
+ // index into the array.
+ //
+ // This method is to support the ICollection interface, and calls
+ // Array.Copy internally. If you aren't using ICollection explicitly,
+ // call Array.Copy to avoid an extra indirection.
+ //
+ public void CopyTo(Array array, int index)
+ {
+ // Note: Array.Copy throws a RankException and we want a consistent ArgumentException for all the IList CopyTo methods.
+ if (array != null && array.Rank != 1)
+ throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
+
+ Array.Copy(this, 0, array, index, Length);
+ }
+
+ // Make a new array which is a deep copy of the original array.
+ //
+ public Object Clone()
+ {
+ return MemberwiseClone();
+ }
+
+ Int32 IStructuralComparable.CompareTo(Object other, IComparer comparer)
+ {
+ if (other == null)
+ {
+ return 1;
+ }
+
+ Array o = other as Array;
+
+ if (o == null || this.Length != o.Length)
+ {
+ throw new ArgumentException(SR.ArgumentException_OtherNotArrayOfCorrectLength, nameof(other));
+ }
+
+ int i = 0;
+ int c = 0;
+
+ while (i < o.Length && c == 0)
+ {
+ object left = GetValue(i);
+ object right = o.GetValue(i);
+
+ c = comparer.Compare(left, right);
+ i++;
+ }
+
+ return c;
+ }
+
+ Boolean IStructuralEquatable.Equals(Object other, IEqualityComparer comparer)
+ {
+ if (other == null)
+ {
+ return false;
+ }
+
+ if (Object.ReferenceEquals(this, other))
+ {
+ return true;
+ }
+
+ Array o = other as Array;
+
+ if (o == null || o.Length != this.Length)
+ {
+ return false;
+ }
+
+ int i = 0;
+ while (i < o.Length)
+ {
+ object left = GetValue(i);
+ object right = o.GetValue(i);
+
+ if (!comparer.Equals(left, right))
+ {
+ return false;
+ }
+ i++;
+ }
+
+ return true;
+ }
+
+ // From System.Web.Util.HashCodeCombiner
+ internal static int CombineHashCodes(int h1, int h2)
+ {
+ return (((h1 << 5) + h1) ^ h2);
+ }
+
+ int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
+ {
+ if (comparer == null)
+ throw new ArgumentNullException(nameof(comparer));
+
+ int ret = 0;
+
+ for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++)
+ {
+ ret = CombineHashCodes(ret, comparer.GetHashCode(GetValue(i)));
+ }
+
+ return ret;
+ }
+
+ // Searches an array for a given element using a binary search algorithm.
+ // Elements of the array are compared to the search value using the
+ // IComparable interface, which must be implemented by all elements
+ // of the array and the given search value. This method assumes that the
+ // array is already sorted according to the IComparable interface;
+ // if this is not the case, the result will be incorrect.
+ //
+ // The method returns the index of the given value in the array. If the
+ // array does not contain the given value, the method returns a negative
+ // integer. The bitwise complement operator (~) can be applied to a
+ // negative result to produce the index of the first element (if any) that
+ // is larger than the given search value.
+ //
+ public static int BinarySearch(Array array, Object value)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ return BinarySearch(array, 0, array.Length, value, null);
+ }
+
+ public static TOutput[] ConvertAll<TInput, TOutput>(TInput[] array, Converter<TInput, TOutput> converter)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ if (converter == null)
+ throw new ArgumentNullException(nameof(converter));
+
+ Contract.Ensures(Contract.Result<TOutput[]>() != null);
+ Contract.Ensures(Contract.Result<TOutput[]>().Length == array.Length);
+ Contract.EndContractBlock();
+
+ TOutput[] newArray = new TOutput[array.Length];
+ for (int i = 0; i < array.Length; i++)
+ {
+ newArray[i] = converter(array[i]);
+ }
+ return newArray;
+ }
+
+ public static void Copy(Array sourceArray, Array destinationArray, long length)
+ {
+ if (length > Int32.MaxValue || length < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+
+ Array.Copy(sourceArray, destinationArray, (int)length);
+ }
+
+ public static void Copy(Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length)
+ {
+ if (sourceIndex > Int32.MaxValue || sourceIndex < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ if (destinationIndex > Int32.MaxValue || destinationIndex < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(destinationIndex), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ if (length > Int32.MaxValue || length < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+
+ Array.Copy(sourceArray, (int)sourceIndex, destinationArray, (int)destinationIndex, (int)length);
+ }
+
+ public void CopyTo(Array array, long index)
+ {
+ if (index > Int32.MaxValue || index < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ Contract.EndContractBlock();
+
+ this.CopyTo(array, (int)index);
+ }
+
+ public static void ForEach<T>(T[] array, Action<T> action)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ if (action == null)
+ throw new ArgumentNullException(nameof(action));
+
+ Contract.EndContractBlock();
+
+ for (int i = 0; i < array.Length; i++)
+ {
+ action(array[i]);
+ }
+ }
+
+ public long LongLength
+ {
+ get
+ {
+ long ret = GetLength(0);
+
+ for (int i = 1; i < Rank; ++i)
+ {
+ ret = ret * GetLength(i);
+ }
+
+ return ret;
+ }
+ }
+
+ public long GetLongLength(int dimension)
+ {
+ // This method does throw an IndexOutOfRangeException for compat if dimension < 0 or >= Rank
+ // by calling GetUpperBound
+ return GetLength(dimension);
+ }
+
+ public Object GetValue(long index)
+ {
+ if (index > Int32.MaxValue || index < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ Contract.EndContractBlock();
+
+ return this.GetValue((int)index);
+ }
+
+ public Object GetValue(long index1, long index2)
+ {
+ if (index1 > Int32.MaxValue || index1 < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index1), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ if (index2 > Int32.MaxValue || index2 < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index2), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ Contract.EndContractBlock();
+
+ return this.GetValue((int)index1, (int)index2);
+ }
+
+ public Object GetValue(long index1, long index2, long index3)
+ {
+ if (index1 > Int32.MaxValue || index1 < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index1), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ if (index2 > Int32.MaxValue || index2 < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index2), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ if (index3 > Int32.MaxValue || index3 < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index3), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ Contract.EndContractBlock();
+
+ return this.GetValue((int)index1, (int)index2, (int)index3);
+ }
+
+ public Object GetValue(params long[] indices)
+ {
+ if (indices == null)
+ throw new ArgumentNullException(nameof(indices));
+ if (Rank != indices.Length)
+ throw new ArgumentException(SR.Arg_RankIndices);
+ Contract.EndContractBlock();
+
+ int[] intIndices = new int[indices.Length];
+
+ for (int i = 0; i < indices.Length; ++i)
+ {
+ long index = indices[i];
+ if (index > Int32.MaxValue || index < Int32.MinValue)
+ throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_HugeArrayNotSupported);
+ intIndices[i] = (int)index;
+ }
+
+ return this.GetValue(intIndices);
+ }
+
+ public void Initialize()
+ {
+ // Project N port note: On the desktop, this api is a nop unless the array element type is a value type with
+ // an explicit nullary constructor. Such a type cannot be expressed in C# so Project N does not support this.
+ // The ILC toolchain fails the build if it encounters such a type.
+ return;
+ }
+
+ public bool IsFixedSize { get { return true; } }
+
+ // Is this Array synchronized (i.e., thread-safe)? If you want a synchronized
+ // collection, you can use SyncRoot as an object to synchronize your
+ // collection with. You could also call GetSynchronized()
+ // to get a synchronized wrapper around the Array.
+ public bool IsSynchronized { get { return false; } }
+
+ // Returns an object appropriate for synchronizing access to this
+ // Array.
+ public Object SyncRoot { get { return this; } }
+
+ // Searches a section of an array for a given element using a binary search
+ // algorithm. Elements of the array are compared to the search value using
+ // the IComparable interface, which must be implemented by all
+ // elements of the array and the given search value. This method assumes
+ // that the array is already sorted according to the IComparable
+ // interface; if this is not the case, the result will be incorrect.
+ //
+ // The method returns the index of the given value in the array. If the
+ // array does not contain the given value, the method returns a negative
+ // integer. The bitwise complement operator (~) can be applied to a
+ // negative result to produce the index of the first element (if any) that
+ // is larger than the given search value.
+ //
+ public static int BinarySearch(Array array, int index, int length, Object value)
+ {
+ return BinarySearch(array, index, length, value, null);
+ }
+
+ // Searches an array for a given element using a binary search algorithm.
+ // Elements of the array are compared to the search value using the given
+ // IComparer interface. If comparer is null, elements of the
+ // array are compared to the search value using the IComparable
+ // interface, which in that case must be implemented by all elements of the
+ // array and the given search value. This method assumes that the array is
+ // already sorted; if this is not the case, the result will be incorrect.
+ //
+ // The method returns the index of the given value in the array. If the
+ // array does not contain the given value, the method returns a negative
+ // integer. The bitwise complement operator (~) can be applied to a
+ // negative result to produce the index of the first element (if any) that
+ // is larger than the given search value.
+ //
+ public static int BinarySearch(Array array, Object value, IComparer comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ return BinarySearch(array, 0, array.Length, value, comparer);
+ }
+
+ // Searches a section of an array for a given element using a binary search
+ // algorithm. Elements of the array are compared to the search value using
+ // the given IComparer interface. If comparer is null,
+ // elements of the array are compared to the search value using the
+ // IComparable interface, which in that case must be implemented by
+ // all elements of the array and the given search value. This method
+ // assumes that the array is already sorted; if this is not the case, the
+ // result will be incorrect.
+ //
+ // The method returns the index of the given value in the array. If the
+ // array does not contain the given value, the method returns a negative
+ // integer. The bitwise complement operator (~) can be applied to a
+ // negative result to produce the index of the first element (if any) that
+ // is larger than the given search value.
+ //
+ public static int BinarySearch(Array array, int index, int length, Object value, IComparer comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ if (index < 0 || length < 0)
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(length)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (array.Length - index < length)
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+ if (array.Rank != 1)
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+
+ if (comparer == null) comparer = LowLevelComparer.Default;
+
+ int lo = index;
+ int hi = index + length - 1;
+ Object[] objArray = array as Object[];
+ if (objArray != null)
+ {
+ while (lo <= hi)
+ {
+ // i might overflow if lo and hi are both large positive numbers.
+ int i = GetMedian(lo, hi);
+
+ int c;
+ try
+ {
+ c = comparer.Compare(objArray[i], value);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
+ }
+ if (c == 0) return i;
+ if (c < 0)
+ {
+ lo = i + 1;
+ }
+ else
+ {
+ hi = i - 1;
+ }
+ }
+ }
+ else
+ {
+ while (lo <= hi)
+ {
+ int i = GetMedian(lo, hi);
+
+ int c;
+ try
+ {
+ c = comparer.Compare(array.GetValue(i), value);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e);
+ }
+ if (c == 0) return i;
+ if (c < 0)
+ {
+ lo = i + 1;
+ }
+ else
+ {
+ hi = i - 1;
+ }
+ }
+ }
+ return ~lo;
+ }
+
+ private static int GetMedian(int low, int hi)
+ {
+ // Note both may be negative, if we are dealing with arrays w/ negative lower bounds.
+ return low + ((hi - low) >> 1);
+ }
+
+ public static int BinarySearch<T>(T[] array, T value)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ return BinarySearch<T>(array, 0, array.Length, value, null);
+ }
+
+ public static int BinarySearch<T>(T[] array, T value, System.Collections.Generic.IComparer<T> comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ return BinarySearch<T>(array, 0, array.Length, value, comparer);
+ }
+
+ public static int BinarySearch<T>(T[] array, int index, int length, T value)
+ {
+ return BinarySearch<T>(array, index, length, value, null);
+ }
+
+ public static int BinarySearch<T>(T[] array, int index, int length, T value, System.Collections.Generic.IComparer<T> comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ if (index < 0 || length < 0)
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(length)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (array.Length - index < length)
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+
+ return ArraySortHelper<T>.BinarySearch(array, index, length, value, comparer);
+ }
+
+ // Returns the index of the first occurrence of a given value in an array.
+ // The array is searched forwards, and the elements of the array are
+ // compared to the given value using the Object.Equals method.
+ //
+ public static int IndexOf(Array array, Object value)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return IndexOf(array, value, 0, array.Length);
+ }
+
+ // Returns the index of the first occurrence of a given value in a range of
+ // an array. The array is searched forwards, starting at index
+ // startIndex and ending at the last element of the array. The
+ // elements of the array are compared to the given value using the
+ // Object.Equals method.
+ //
+ public static int IndexOf(Array array, Object value, int startIndex)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return IndexOf(array, value, startIndex, array.Length - startIndex);
+ }
+
+ // Returns the index of the first occurrence of a given value in a range of
+ // an array. The array is searched forwards, starting at index
+ // startIndex and upto count elements. The
+ // elements of the array are compared to the given value using the
+ // Object.Equals method.
+ //
+ public static int IndexOf(Array array, Object value, int startIndex, int count)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ if (array.Rank != 1)
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+ if (startIndex < 0 || startIndex > array.Length)
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ if (count < 0 || count > array.Length - startIndex)
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+
+ Object[] objArray = array as Object[];
+ int endIndex = startIndex + count;
+ if (objArray != null)
+ {
+ if (value == null)
+ {
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ if (objArray[i] == null) return i;
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ Object obj = objArray[i];
+ if (obj != null && obj.Equals(value)) return i;
+ }
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ Object obj = array.GetValue(i);
+ if (obj == null)
+ {
+ if (value == null) return i;
+ }
+ else
+ {
+ if (obj.Equals(value)) return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /// <summary>
+ /// This version is called from Array<T>.IndexOf and Contains<T>, so it's in every unique array instance due to array interface implementation.
+ /// Do not call into IndexOf<T>(Array array, Object value, int startIndex, int count) for size and space reasons.
+ /// Otherwise there will be two IndexOf methods for each unique array instance, and extra parameter checking which are not needed for the common case.
+ /// </summary>
+ public static int IndexOf<T>(T[] array, T value)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ // See comment above Array.GetComparerForReferenceTypesOnly for details
+ EqualityComparer<T> comparer = GetComparerForReferenceTypesOnly<T>();
+
+ if (comparer != null)
+ {
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (comparer.Equals(array[i], value))
+ return i;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (StructOnlyEquals<T>(array[i], value))
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ public static int IndexOf<T>(T[] array, T value, int startIndex)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return IndexOf(array, value, startIndex, array.Length - startIndex);
+ }
+
+ public static int IndexOf<T>(T[] array, T value, int startIndex, int count)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (startIndex < 0 || startIndex > array.Length)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+
+ if (count < 0 || count > array.Length - startIndex)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+
+ int endIndex = startIndex + count;
+
+ // See comment above Array.GetComparerForReferenceTypesOnly for details
+ EqualityComparer<T> comparer = GetComparerForReferenceTypesOnly<T>();
+
+ if (comparer != null)
+ {
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ if (comparer.Equals(array[i], value))
+ return i;
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ if (StructOnlyEquals<T>(array[i], value))
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ public static int LastIndexOf(Array array, Object value)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ return LastIndexOf(array, value, array.Length - 1, array.Length);
+ }
+
+ // Returns the index of the last occurrence of a given value in a range of
+ // an array. The array is searched backwards, starting at index
+ // startIndex and ending at index 0. The elements of the array are
+ // compared to the given value using the Object.Equals method.
+ //
+ public static int LastIndexOf(Array array, Object value, int startIndex)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ return LastIndexOf(array, value, startIndex, startIndex + 1);
+ }
+
+ // Returns the index of the last occurrence of a given value in a range of
+ // an array. The array is searched backwards, starting at index
+ // startIndex and counting uptocount elements. The elements of
+ // the array are compared to the given value using the Object.Equals
+ // method.
+ //
+ public static int LastIndexOf(Array array, Object value, int startIndex, int count)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ if (array.Length == 0)
+ {
+ return -1;
+ }
+
+ if (startIndex < 0 || startIndex >= array.Length)
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ if (count < 0)
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ if (count > startIndex + 1)
+ throw new ArgumentOutOfRangeException("endIndex", SR.ArgumentOutOfRange_EndIndexStartIndex);
+ if (array.Rank != 1)
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+
+ Object[] objArray = array as Object[];
+ int endIndex = startIndex - count + 1;
+ if (objArray != null)
+ {
+ if (value == null)
+ {
+ for (int i = startIndex; i >= endIndex; i--)
+ {
+ if (objArray[i] == null) return i;
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i >= endIndex; i--)
+ {
+ Object obj = objArray[i];
+ if (obj != null && obj.Equals(value)) return i;
+ }
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i >= endIndex; i--)
+ {
+ Object obj = array.GetValue(i);
+ if (obj == null)
+ {
+ if (value == null) return i;
+ }
+ else
+ {
+ if (obj.Equals(value)) return i;
+ }
+ }
+ }
+ return -1; // Return lb-1 for arrays with negative lower bounds.
+ }
+
+ public static int LastIndexOf<T>(T[] array, T value)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return LastIndexOf(array, value, array.Length - 1, array.Length);
+ }
+
+ public static int LastIndexOf<T>(T[] array, T value, int startIndex)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ // if array is empty and startIndex is 0, we need to pass 0 as count
+ return LastIndexOf(array, value, startIndex, (array.Length == 0) ? 0 : (startIndex + 1));
+ }
+
+ public static int LastIndexOf<T>(T[] array, T value, int startIndex, int count)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (array.Length == 0)
+ {
+ //
+ // Special case for 0 length List
+ // accept -1 and 0 as valid startIndex for compablility reason.
+ //
+ if (startIndex != -1 && startIndex != 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+
+ // only 0 is a valid value for count if array is empty
+ if (count != 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+ return -1;
+ }
+
+ // Make sure we're not out of range
+ if (startIndex < 0 || startIndex >= array.Length)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+
+ // 2nd have of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0.
+ if (count < 0 || startIndex - count + 1 < 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+
+ // See comment above Array.GetComparerForReferenceTypesOnly for details
+ EqualityComparer<T> comparer = GetComparerForReferenceTypesOnly<T>();
+
+ int endIndex = startIndex - count + 1;
+ if (comparer != null)
+ {
+ for (int i = startIndex; i >= endIndex; i--)
+ {
+ if (comparer.Equals(array[i], value))
+ return i;
+ }
+ }
+ else
+ {
+ for (int i = startIndex; i >= endIndex; i--)
+ {
+ if (StructOnlyEquals<T>(array[i], value))
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ // Reverses all elements of the given array. Following a call to this
+ // method, an element previously located at index i will now be
+ // located at index length - i - 1, where length is the
+ // length of the array.
+ //
+ public static void Reverse(Array array)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ Reverse(array, 0, array.Length);
+ }
+
+ // Reverses the elements in a range of an array. Following a call to this
+ // method, an element in the range given by index and count
+ // which was previously located at index i will now be located at
+ // index index + (index + count - i - 1).
+ // Reliability note: This may fail because it may have to box objects.
+ //
+ public static void Reverse(Array array, int index, int length)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ int lowerBound = array.GetLowerBound(0);
+ if (index < lowerBound || length < 0)
+ throw new ArgumentOutOfRangeException((index < lowerBound ? nameof(index) : nameof(length)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (array.Length - (index - lowerBound) < length)
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+ if (array.Rank != 1)
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+
+ int i = index;
+ int j = index + length - 1;
+ Object[] objArray = array as Object[];
+ if (objArray != null)
+ {
+ while (i < j)
+ {
+ Object temp = objArray[i];
+ objArray[i] = objArray[j];
+ objArray[j] = temp;
+ i++;
+ j--;
+ }
+ }
+ else
+ {
+ while (i < j)
+ {
+ Object temp = array.GetValue(i);
+ array.SetValue(array.GetValue(j), i);
+ array.SetValue(temp, j);
+ i++;
+ j--;
+ }
+ }
+ }
+
+ public static void Reverse<T>(T[] array)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ Reverse(array, 0, array.Length);
+ }
+
+ public static void Reverse<T>(T[] array, int index, int length)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ if (index < 0 || length < 0)
+ throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(length)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (array.Length - index < length)
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+
+ int i = index;
+ int j = index + length - 1;
+ while (i < j)
+ {
+ T temp = array[i];
+ array[i] = array[j];
+ array[j] = temp;
+ i++;
+ j--;
+ }
+ }
+
+ // Sorts the elements of an array. The sort compares the elements to each
+ // other using the IComparable interface, which must be implemented
+ // by all elements of the array.
+ //
+ public static void Sort(Array array)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ Sort(array, null, 0, array.Length, null);
+ }
+
+ // Sorts the elements in a section of an array. The sort compares the
+ // elements to each other using the IComparable interface, which
+ // must be implemented by all elements in the given section of the array.
+ //
+ public static void Sort(Array array, int index, int length)
+ {
+ Sort(array, null, index, length, null);
+ }
+
+ // Sorts the elements of an array. The sort compares the elements to each
+ // other using the given IComparer interface. If comparer is
+ // null, the elements are compared to each other using the
+ // IComparable interface, which in that case must be implemented by
+ // all elements of the array.
+ //
+ public static void Sort(Array array, IComparer comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ Sort(array, null, 0, array.Length, comparer);
+ }
+
+ // Sorts the elements in a section of an array. The sort compares the
+ // elements to each other using the given IComparer interface. If
+ // comparer is null, the elements are compared to each other using
+ // the IComparable interface, which in that case must be implemented
+ // by all elements in the given section of the array.
+ //
+ public static void Sort(Array array, int index, int length, IComparer comparer)
+ {
+ Sort(array, null, index, length, comparer);
+ }
+
+ public static void Sort(Array keys, Array items)
+ {
+ if (keys == null)
+ {
+ throw new ArgumentNullException(nameof(keys));
+ }
+
+ Sort(keys, items, keys.GetLowerBound(0), keys.Length, null);
+ }
+
+ public static void Sort(Array keys, Array items, IComparer comparer)
+ {
+ if (keys == null)
+ {
+ throw new ArgumentNullException(nameof(keys));
+ }
+
+ Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer);
+ }
+
+ public static void Sort(Array keys, Array items, int index, int length)
+ {
+ Sort(keys, items, index, length, null);
+ }
+
+ public static void Sort(Array keys, Array items, int index, int length, IComparer comparer)
+ {
+ if (keys == null)
+ throw new ArgumentNullException(nameof(keys));
+ if (keys.Rank != 1 || (items != null && items.Rank != 1))
+ throw new RankException(SR.Rank_MultiDimNotSupported);
+ int keysLowerBound = keys.GetLowerBound(0);
+ if (items != null && keysLowerBound != items.GetLowerBound(0))
+ throw new ArgumentException(SR.Arg_LowerBoundsMustMatch);
+ if (index < keysLowerBound || length < 0)
+ throw new ArgumentOutOfRangeException((length < 0 ? nameof(length) : nameof(index)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length))
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+
+ if (length > 1)
+ {
+#if CORERT
+ IComparer<Object> comparerT = new ComparerAsComparerT(comparer);
+ Object[] objKeys = keys as Object[];
+ Object[] objItems = items as Object[];
+
+ // Unfortunately, on Project N, we don't have the ability to specialize ArraySortHelper<> on demand
+ // for value types. Rather than incur a boxing cost on every compare and every swap (and maintain a separate introsort algorithm
+ // just for this), box them all, sort them as an Object[] array and unbox them back.
+
+ // Check if either of the arrays need to be copied.
+ if (objKeys == null)
+ {
+ objKeys = new Object[index + length];
+ Array.CopyImplValueTypeArrayToReferenceArray(keys, index, objKeys, index, length, reliable: false);
+ }
+ if (objItems == null && items != null)
+ {
+ objItems = new Object[index + length];
+ Array.CopyImplValueTypeArrayToReferenceArray(items, index, objItems, index, length, reliable: false);
+ }
+
+ Sort<Object, Object>(objKeys, objItems, index, length, comparerT);
+
+ // If either array was copied, copy it back into the original
+ if (objKeys != keys)
+ {
+ Array.CopyImplReferenceArrayToValueTypeArray(objKeys, index, keys, index, length, reliable: false);
+ }
+ if (objItems != items)
+ {
+ Array.CopyImplReferenceArrayToValueTypeArray(objItems, index, items, index, length, reliable: false);
+ }
+#else
+ Object[] objKeys = keys as Object[];
+ Object[] objItems = null;
+ if (objKeys != null)
+ objItems = items as Object[];
+ if (objKeys != null && (items == null || objItems != null))
+ {
+ SorterObjectArray sorter = new SorterObjectArray(objKeys, objItems, comparer);
+ sorter.Sort(index, length);
+ }
+ else
+ {
+ SorterGenericArray sorter = new SorterGenericArray(keys, items, comparer);
+ sorter.Sort(index, length);
+ }
+#endif
+ }
+ }
+
+ // Wraps an IComparer inside an IComparer<Object>.
+ private sealed class ComparerAsComparerT : IComparer<Object>
+ {
+ public ComparerAsComparerT(IComparer comparer)
+ {
+ _comparer = (comparer == null) ? LowLevelComparer.Default : comparer;
+ }
+
+ public int Compare(Object x, Object y)
+ {
+ return _comparer.Compare(x, y);
+ }
+
+ private IComparer _comparer;
+ }
+
+ public static void Sort<T>(T[] array)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+
+ Sort<T>(array, 0, array.Length, null);
+ }
+
+ public static void Sort<T>(T[] array, int index, int length)
+ {
+ Sort<T>(array, index, length, null);
+ }
+
+ public static void Sort<T>(T[] array, System.Collections.Generic.IComparer<T> comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ Sort<T>(array, 0, array.Length, comparer);
+ }
+
+ public static void Sort<T>(T[] array, int index, int length, System.Collections.Generic.IComparer<T> comparer)
+ {
+ if (array == null)
+ throw new ArgumentNullException(nameof(array));
+ if (index < 0 || length < 0)
+ throw new ArgumentOutOfRangeException((length < 0 ? nameof(length) : nameof(index)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (array.Length - index < length)
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+
+ if (length > 1)
+ ArraySortHelper<T>.Sort(array, index, length, comparer);
+ }
+
+ public static void Sort<T>(T[] array, Comparison<T> comparison)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (comparison == null)
+ {
+ throw new ArgumentNullException(nameof(comparison));
+ }
+
+ ArraySortHelper<T>.Sort(array, 0, array.Length, comparison);
+ }
+
+ public static void Sort<TKey, TValue>(TKey[] keys, TValue[] items)
+ {
+ if (keys == null)
+ throw new ArgumentNullException(nameof(keys));
+ Contract.EndContractBlock();
+ Sort<TKey, TValue>(keys, items, 0, keys.Length, null);
+ }
+
+ public static void Sort<TKey, TValue>(TKey[] keys, TValue[] items, int index, int length)
+ {
+ Sort<TKey, TValue>(keys, items, index, length, null);
+ }
+
+ public static void Sort<TKey, TValue>(TKey[] keys, TValue[] items, IComparer<TKey> comparer)
+ {
+ if (keys == null)
+ throw new ArgumentNullException(nameof(keys));
+ Contract.EndContractBlock();
+ Sort<TKey, TValue>(keys, items, 0, keys.Length, comparer);
+ }
+
+ public static void Sort<TKey, TValue>(TKey[] keys, TValue[] items, int index, int length, IComparer<TKey> comparer)
+ {
+ if (keys == null)
+ throw new ArgumentNullException(nameof(keys));
+ if (index < 0 || length < 0)
+ throw new ArgumentOutOfRangeException((length < 0 ? nameof(length) : nameof(index)), SR.ArgumentOutOfRange_NeedNonNegNum);
+ if (keys.Length - index < length || (items != null && index > items.Length - length))
+ throw new ArgumentException(SR.Argument_InvalidOffLen);
+ Contract.EndContractBlock();
+
+ if (length > 1)
+ {
+ if (items == null)
+ {
+ Sort<TKey>(keys, index, length, comparer);
+ return;
+ }
+
+ ArraySortHelper<TKey, TValue>.Default.Sort(keys, items, index, length, comparer);
+ }
+ }
+
+ public static T[] Empty<T>()
+ {
+ return EmptyArray<T>.Value;
+ }
+
+ public static bool Exists<T>(T[] array, Predicate<T> match)
+ {
+ return Array.FindIndex(array, match) != -1;
+ }
+
+ public static void Fill<T>(T[] array, T value)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ for (int i = 0; i < array.Length; i++)
+ {
+ array[i] = value;
+ }
+ }
+
+ public static void Fill<T>(T[] array, T value, int startIndex, int count)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (startIndex < 0 || startIndex > array.Length)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+
+ if (count < 0 || startIndex > array.Length - count)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+
+ for (int i = startIndex; i < startIndex + count; i++)
+ {
+ array[i] = value;
+ }
+ }
+
+ public static T Find<T>(T[] array, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (match == null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (match(array[i]))
+ {
+ return array[i];
+ }
+ }
+ return default(T);
+ }
+
+ public static int FindIndex<T>(T[] array, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return FindIndex(array, 0, array.Length, match);
+ }
+
+ public static int FindIndex<T>(T[] array, int startIndex, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return FindIndex(array, startIndex, array.Length - startIndex, match);
+ }
+
+ public static int FindIndex<T>(T[] array, int startIndex, int count, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (startIndex < 0 || startIndex > array.Length)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+
+ if (count < 0 || startIndex > array.Length - count)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+
+ if (match == null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ int endIndex = startIndex + count;
+ for (int i = startIndex; i < endIndex; i++)
+ {
+ if (match(array[i])) return i;
+ }
+ return -1;
+ }
+
+ public static T FindLast<T>(T[] array, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (match == null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ for (int i = array.Length - 1; i >= 0; i--)
+ {
+ if (match(array[i]))
+ {
+ return array[i];
+ }
+ }
+ return default(T);
+ }
+
+ public static int FindLastIndex<T>(T[] array, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return FindLastIndex(array, array.Length - 1, array.Length, match);
+ }
+
+ public static int FindLastIndex<T>(T[] array, int startIndex, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ return FindLastIndex(array, startIndex, startIndex + 1, match);
+ }
+
+ public static int FindLastIndex<T>(T[] array, int startIndex, int count, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (match == null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ if (array.Length == 0)
+ {
+ // Special case for 0 length List
+ if (startIndex != -1)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+ }
+ else
+ {
+ // Make sure we're not out of range
+ if (startIndex < 0 || startIndex >= array.Length)
+ {
+ throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index);
+ }
+ }
+
+ // 2nd have of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0.
+ if (count < 0 || startIndex - count + 1 < 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count);
+ }
+
+ int endIndex = startIndex - count;
+ for (int i = startIndex; i > endIndex; i--)
+ {
+ if (match(array[i]))
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public static bool TrueForAll<T>(T[] array, Predicate<T> match)
+ {
+ if (array == null)
+ {
+ throw new ArgumentNullException(nameof(array));
+ }
+
+ if (match == null)
+ {
+ throw new ArgumentNullException(nameof(match));
+ }
+
+ for (int i = 0; i < array.Length; i++)
+ {
+ if (!match(array[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return new ArrayEnumerator(this);
+ }
+
+ // These functions look odd, as they are part of a complex series of compiler intrinsics
+ // designed to produce very high quality code for equality comparison cases without utilizing
+ // reflection like other platforms. The major complication is that the specification of
+ // IndexOf is that it is supposed to use IEquatable<T> if possible, but that requirement
+ // cannot be expressed in IL directly due to the lack of constraints.
+ // Instead, specialization at call time is used within the compiler.
+ //
+ // General Approach
+ // - Perform fancy redirection for Array.GetComparerForReferenceTypesOnly<T>(). If T is a reference
+ // type or UniversalCanon, have this redirect to EqualityComparer<T>.get_Default, Otherwise, use
+ // the function as is. (will return null in that case)
+ // - Change the contents of the IndexOf functions to have a pair of loops. One for if
+ // GetComparerForReferenceTypesOnly returns null, and one for when it does not.
+ // - If it does not return null, call the EqualityComparer<T> code.
+ // - If it does return null, use a special function StructOnlyEquals<T>().
+ // - Calls to that function result in calls to a pair of helper function in
+ // EqualityComparerHelpers (StructOnlyEqualsIEquatable, or StructOnlyEqualsNullable)
+ // depending on whether or not they are the right function to call.
+ // - The end result is that in optimized builds, we have the same single function compiled size
+ // characteristics that the old EqualsOnlyComparer<T>.Equals function had, but we maintain
+ // correctness as well.
+ private static EqualityComparer<T> GetComparerForReferenceTypesOnly<T>()
+ {
+#if !CORERT
+ return System.Runtime.CompilerServices.RuntimeHelpers.IsReferenceOrContainsReferences<T> () ? EqualityComparer<T>.Default : null;
+#else
+ return EqualityComparer<T>.Default;
+#endif
+ }
+
+ private static bool StructOnlyEquals<T>(T left, T right)
+ {
+ return left.Equals(right);
+ }
+
+ private sealed class ArrayEnumerator : IEnumerator, ICloneable
+ {
+ private Array _array;
+ private int _index;
+ private int _endIndex; // cache array length, since it's a little slow.
+
+ internal ArrayEnumerator(Array array)
+ {
+ _array = array;
+ _index = -1;
+ _endIndex = array.Length;
+ }
+
+ public bool MoveNext()
+ {
+ if (_index < _endIndex)
+ {
+ _index++;
+ return (_index < _endIndex);
+ }
+ return false;
+ }
+
+ public Object Current
+ {
+ get
+ {
+ if (_index < 0) throw new InvalidOperationException(SR.InvalidOperation_EnumNotStarted);
+ if (_index >= _endIndex) throw new InvalidOperationException(SR.InvalidOperation_EnumEnded);
+ return _array.GetValueWithFlattenedIndex_NoErrorCheck(_index);
+ }
+ }
+
+ public void Reset()
+ {
+ _index = -1;
+ }
+
+ public object Clone()
+ {
+ return MemberwiseClone();
+ }
+ }
+ }
+}
\ No newline at end of file
-
namespace System.Diagnostics.Private
{
static partial class Debug
--- /dev/null
+using System;
+using System.Diagnostics;
+
+namespace Internal.Runtime.CompilerServices
+{
+ [Conditional ("ALWAYSREMOVED")]
+ [AttributeUsage(AttributeTargets.All)]
+ class RelocatedTypeAttribute : Attribute
+ {
+ public RelocatedTypeAttribute(String originalAssemblySimpleName)
+ {
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+namespace Internal.Runtime.Augments
+{
+ class RuntimeThread
+ {
+ public static void InitializeThreadPoolThread ()
+ {
+ }
+ }
+}
\ No newline at end of file
<DebugType>full</DebugType>\r
<NoWarn>612,618,1635,1699</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_CONSOLE</DefineConstants>\r
+ <DefineConstants>TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_CONSOLE;MONO_FEATURE_APPLETLS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>612,618,1635,1699</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_CONSOLE</DefineConstants>\r
+ <DefineConstants>INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_CONSOLE;MONO_FEATURE_APPLETLS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\OrderablePartitioner.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\Partitioner.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\PartitionerStatic.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509ContentType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509KeyStorageFlags.cs" />\r
<Compile Include="..\..\..\external\corert\src\Common\src\Interop\Unix\Interop.Libraries.cs" />\r
<Compile Include="..\..\..\external\corert\src\Common\src\Interop\Unix\System.Private.CoreLib.Native\Interop.MemAllocFree.cs" />\r
<Compile Include="..\..\..\external\corert\src\Common\src\Interop\Windows\Interop.Libraries.cs" />\r
<Compile Include="..\..\..\external\corert\src\Common\src\System\Numerics\Hashing\HashHelpers.cs" />\r
<Compile Include="..\..\..\external\corert\src\Runtime.Base\src\System\Runtime\InteropServices\NativeCallableAttribute.cs" />\r
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeThreadPoolIOHandle.cs" />\r
+ <Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs" />\r
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Collections\LowLevelComparer.cs" />\r
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\Collections\ObjectEqualityComparer.cs" />\r
<Compile Include="..\..\..\external\corert\src\System.Private.CoreLib\src\System\IO\Win32Marshal.cs" />\r
<Compile Include="..\referencesource\mscorlib\system\unsafecharbuffer.cs" />\r
<Compile Include="..\referencesource\mscorlib\system\version.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="coreclr\SorterArray.cs" />\r
+ <Compile Include="CoreFoundation\CFHelpers.cs" />\r
<Compile Include="corefx\SR.cs" />\r
<Compile Include="corert\AddrofIntrinsics.cs" />\r
+ <Compile Include="corert\Array.Portable.cs" />\r
<Compile Include="corert\Debug.cs" />\r
<Compile Include="corert\Interop.cs" />\r
<Compile Include="corert\Interop.MemAllocFree.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate20.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImpl.cs" />\r
+ <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImplApple.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImplMono.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509ContentType.cs" />\r
+ <Compile Include="System.Security.Cryptography.X509Certificates\X509Helper.Apple.cs" />\r
<Compile Include="System.Security.Cryptography.X509Certificates\X509Helper.cs" />\r
- <Compile Include="System.Security.Cryptography.X509Certificates\X509KeyStorageFlags.cs" />\r
<Compile Include="System.Security.Cryptography\CryptoAPITransform.cs" />\r
<Compile Include="System.Security.Cryptography\CryptoConfig.common.cs" />\r
<Compile Include="System.Security.Cryptography\CryptoConfig.cs" />\r
System.Security.Cryptography.X509Certificates/X509Certificate20.cs
System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs
System.Security.Cryptography.X509Certificates/X509CertificateImplMono.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509ContentType.cs
System.Security.Cryptography.X509Certificates/X509Helper.cs
-System.Security.Cryptography.X509Certificates/X509ContentType.cs
-System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
+../../../external/corefx/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509KeyStorageFlags.cs
System.Security.Permissions/CodeAccessSecurityAttribute.cs
System.Security.Permissions/EnvironmentPermission.cs
System.Security.Permissions/EnvironmentPermissionAccess.cs
../referencesource/mscorlib/system/collections/generic/comparer.cs
../referencesource/mscorlib/system/collections/generic/debugview.cs
-../referencesource/mscorlib/system/collections/generic/dictionary.cs
../referencesource/mscorlib/system/collections/generic/equalitycomparer.cs
../referencesource/mscorlib/system/collections/generic/icollection.cs
../referencesource/mscorlib/system/collections/generic/icomparer.cs
../referencesource/mscorlib/microsoft/win32/safehandles/safewaithandle.cs
../referencesource/mscorlib/microsoft/win32/safehandles/win32safehandles.cs
+coreclr/SorterArray.cs
+
corert/AddrofIntrinsics.cs
+corert/Array.Portable.cs
corert/Debug.cs
corert/Interop.cs
corert/Interop.MemAllocFree.cs
+corert/RelocatedTypeAttribute.cs
+corert/RuntimeThread.cs
../../../external/corert/src/Common/src/Interop/Unix/Interop.Libraries.cs
../../../external/corert/src/Common/src/Interop/Windows/Interop.Libraries.cs
-../../../external/corert/src/Common/src/Interop/Windows/mincore/Interop.Errors.cs
-../../../external/corert/src/Common/src/Interop/Windows/mincore/Interop.FormatMessage.cs
../../../external/corert/src/Common/src/Interop/Windows/mincore/Interop.MemAllocFree.cs
../../../external/corert/src/Common/src/Interop/Windows/mincore/Interop.ThreadPoolIO.cs
-../../../external/corert/src/Common/src/System/Diagnostics/Debug.cs
-
../../../external/corert/src/Common/src/System/Numerics/Hashing/HashHelpers.cs
../../../external/corert/src/Runtime.Base/src/System/Runtime/InteropServices/NativeCallableAttribute.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Errors.cs
+../../../external/corert/src/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FormatMessage.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/System/TupleExtensions.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/System/IO/Win32Marshal.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/ITuple.cs
+../../../external/corert/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
+
+../../../external/corert/src/System.Private.CoreLib/shared/System/Threading/DeferredDisposableLifetime.cs
+
+
../../../external/corert/src/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Tuple.cs
-../../../external/corert/src/System.Private.CoreLib/src/System/TupleExtensions.cs
../../../external/corert/src/System.Private.CoreLib/src/System/ValueTuple.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Collections/LowLevelComparer.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Collections/ObjectEqualityComparer.cs
-../../../external/corert/src/System.Private.CoreLib/src/System/IO/Win32Marshal.cs
+../../../external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs
+../../../external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/IDictionaryDebugView.cs
+../../../external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs
-../../../external/corert/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/ITuple.cs
-../../../external/corert/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
+../../../external/corert/src/System.Private.CoreLib/src/System/Diagnostics/Debug.cs
-../../../external/corert/src/System.Private.CoreLib/src/System/Threading/DeferredDisposableLifetime.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolBoundHandle.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs
../../../external/corert/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.ExecutionContextCallbackArgs.cs
../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/OrderablePartitioner.cs
../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/Partitioner.cs
../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs
+
+System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
+System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
+CoreFoundation/CFHelpers.cs
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <PropertyGroup>\r
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+ <ProductVersion>9.0.30729</ProductVersion>\r
+ <SchemaVersion>2.0</SchemaVersion>\r
+ <ProjectGuid>{CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}</ProjectGuid>\r
+ <OutputType>Library</OutputType>\r
+ <NoWarn>1699</NoWarn>\r
+ <OutputPath>./../../../class/lib/net_4_x/legacy</OutputPath>\r
+ <IntermediateOutputPath>obj-legacy</IntermediateOutputPath>\r
+ <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
+ <NoStdLib>True</NoStdLib>\r
+ \r
+ <NoConfig>True</NoConfig>\r
+ \r
+ <AppDesignerFolder>Properties</AppDesignerFolder>\r
+ <RootNamespace>\r
+ </RootNamespace>\r
+ <AssemblyName>Mono.Cecil</AssemblyName>\r
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+ <FileAlignment>512</FileAlignment>\r
+ </PropertyGroup>\r
+ <PropertyGroup>\r
+ <SignAssembly>true</SignAssembly>\r
+ </PropertyGroup>\r
+ <PropertyGroup>\r
+ <AssemblyOriginatorKeyFile>../../mono.snk</AssemblyOriginatorKeyFile>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+ <DebugSymbols>true</DebugSymbols>\r
+ <DebugType>full</DebugType>\r
+ <NoWarn>1699</NoWarn>\r
+ <Optimize>false</Optimize>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;NET_3_5</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+ <DebugType>pdbonly</DebugType>\r
+ <NoWarn>1699</NoWarn>\r
+ <Optimize>true</Optimize>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;NET_3_5</DefineConstants>\r
+ <ErrorReport>prompt</ErrorReport>\r
+ <WarningLevel>4</WarningLevel>\r
+ </PropertyGroup>\r
+ <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
+ Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
+ is a problem to compile the Mono mscorlib.dll -->\r
+ <PropertyGroup>\r
+ <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
+ </PropertyGroup>\r
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+ <ItemGroup>\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Code.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\CodeReader.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\CodeWriter.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Document.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\ExceptionHandler.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\ILProcessor.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Instruction.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\MethodBody.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\OpCode.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\OpCodes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\SequencePoint.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Symbols.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\VariableDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\VariableReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\BlobHeap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Buffers.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\CodedIndex.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\ElementType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\GuidHeap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Heap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\MetadataToken.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Row.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\StringHeap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\TableHeap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\TokenType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\UserStringHeap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Utilities.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\BinaryStreamReader.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\BinaryStreamWriter.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ByteBuffer.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ByteBufferEqualityComparer.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\DataDirectory.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\Image.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ImageReader.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ImageWriter.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\Section.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\TextMap.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ArrayType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyFlags.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyHashAlgorithm.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyInfo.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyLinkedResource.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyNameDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyNameReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyReader.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyWriter.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\BaseAssemblyResolver.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\CallSite.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\CustomAttribute.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\DefaultAssemblyResolver.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EmbeddedResource.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ExportedType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FileAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FunctionPointerType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericInstanceMethod.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericInstanceType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericParameter.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericParameterAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IConstantProvider.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ICustomAttributeProvider.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IGenericInstance.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IGenericParameterProvider.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMarshalInfoProvider.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMemberDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMetadataScope.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMetadataTokenProvider.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMethodSignature.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Import.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\LinkedResource.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ManifestResourceAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MarshalInfo.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MemberDefinitionCollection.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MemberReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MetadataResolver.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MetadataSystem.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodCallingConvention.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodImplAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodReturnType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodSemanticsAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodSpecification.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Modifiers.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleKind.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\NativeType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterDefinitionCollection.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PinnedType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PInvokeAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PInvokeInfo.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PointerType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ReferenceType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Resource.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\SecurityDeclaration.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\SentinelType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TargetRuntime.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeAttributes.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeDefinition.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeDefinitionCollection.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeParser.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeReference.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeSpecification.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeSystem.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\VariantType.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Collections.Generic\Collection.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Collections.Generic\ReadOnlyCollection.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Security.Cryptography\CryptoConvert.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Security.Cryptography\CryptoService.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Actions.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Empty.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Funcs.cs" />\r
+ <Compile Include="..\..\..\..\external\cecil-legacy\System.Runtime.CompilerServices\ExtensionAttribute.cs" />\r </ItemGroup>\r
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+ Other similar extension points exist, see Microsoft.Common.targets.\r
+ <Target Name="BeforeBuild">\r
+ </Target>\r
+ <Target Name="AfterBuild">\r
+ </Target>\r
+ -->\r
+ <PropertyGroup>\r
+ <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+
+ </PreBuildEvent>\r
+ <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
+\r
+ </PreBuildEvent>\r
+ <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+
+ </PostBuildEvent>\r
+ <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
+\r
+ </PostBuildEvent>\r
+ </PropertyGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="../../corlib/corlib-net_4_x.csproj">\r
+ <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
+ <Name>corlib-net_4_x</Name>\r
+ </ProjectReference>\r
+ <ProjectReference Include="../../System.Core/System.Core-net_4_x.csproj">\r
+ <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
+ <Name>System.Core-net_4_x</Name>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Folder Include="Properties\" />\r
+ </ItemGroup>\r
+</Project>\r
+
using System.Diagnostics;
using System.Globalization;
- using System.Security.Permissions;
-
+
/// <devdoc>
/// <para>Specifies the editor to use to change a property. This class cannot be inherited.</para>
/// </devdoc>
/// name of the editor.</para>
/// </devdoc>
public EditorAttribute(string typeName, string baseTypeName) {
- string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
+ string temp = typeName.ToUpperInvariant ();
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
this.baseTypeName = baseTypeName;
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.EditorAttribute'/> class.</para>
/// </devdoc>
public EditorAttribute(string typeName, Type baseType) {
- string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
+ string temp = typeName.ToUpperInvariant ();
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
this.baseTypeName = baseType.AssemblyQualifiedName;
using System.Collections;
using System.ComponentModel.Design;
using System.Diagnostics;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// <para>Provides
/// a type converter to convert expandable objects to and from various
/// other representations.</para>
/// </devdoc>
+#if MONO_FEATURE_CAS
[HostProtection(SharedState = true)]
+#endif
public class ExpandableObjectConverter : TypeConverter {
/// <devdoc>
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// <para>The exception that is thrown when using invalid arguments that are enumerators.</para>
/// </devdoc>
+#if MONO_FEATURE_CAS
[HostProtection(SharedState = true)]
+#endif
[Serializable]
public class InvalidEnumArgumentException : ArgumentException {
using System.Collections;
using System.Diagnostics;
using System.Reflection;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// EventArgs for the ResolveNameEventHandler. This event is used
/// by the serialization process to match a name to an object
/// instance.
/// </devdoc>
- [HostProtection(SharedState = true)]
+#if MONO_FEATURE_CAS
+ [HostProtection(SharedState = true)]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")]
+#endif
public sealed class InstanceDescriptor {
private MemberInfo member;
private ICollection arguments;
{
return typeImpl.GetInterfaceMap(interfaceType);
}
+
+#if MONO
+ public override bool IsSZArray { get { return typeImpl.IsSZArray; } }
+#endif
}
}
// private convenience data
private const BindingFlags DefaultLookup = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public;
internal const BindingFlags DeclaredOnlyLookup = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
+
+#if MONO
+ public virtual bool IsSZArray { get { throw new NotImplementedException (); } }
+#endif
}
#if CONTRACTS_FULL
[assembly: InternalsVisibleTo("cs0122-38, PublicKeyToken=<ad60da1470a03d36")]
-class Internal
+class InternalClass
{
}
\ No newline at end of file
-// CS0122: `Internal' is inaccessible due to its protection level
+// CS0122: `InternalClass' is inaccessible due to its protection level
// Line: 9
// Compiler options: -r:CS0122-38-lib.dll
{
public static void Main ()
{
- new Internal ();
+ new InternalClass ();
}
}
\ No newline at end of file
this.spec = spec;
current_type = null;
if (class_partial_parts != null) {
- foreach (var part in class_partial_parts)
+ foreach (var part in class_partial_parts) {
part.spec = spec;
+ part.current_type = null;
+ }
}
}
void About ()
{
output.WriteLine (
- "The Mono C# compiler is Copyright 2001-2011, Novell, Inc.\n\n" +
+ "The Mono C# compiler is Copyright 2001-2011, Novell, Inc. 2011-2016 Xamarin Inc, 2016-2017 Microsoft Corp\n\n" +
"The compiler source code is released under the terms of the \n" +
"MIT X11 or GNU GPL licenses\n\n" +
void Usage ()
{
output.WriteLine (
- "Mono C# compiler, Copyright 2001-2011 Novell, Inc., Copyright 2011-2012 Xamarin, Inc\n" +
+ "Mono C# compiler, Copyright 2001-2011 Novell, Inc., 2011-2016 Xamarin, Inc, 2016-2017 Microsoft Corp\n" +
"mcs [options] source-files\n" +
" --about About the Mono C# compiler\n" +
" -addmodule:M1[,Mn] Adds the module to the generated assembly\n" +
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
<Name>System-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
</ItemGroup>\r
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
<Name>corlib-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
<ProjectReference Include="../../class/System.XML/System.Xml-net_4_x.csproj">\r
if (ca.Count != 1)
break;
+ if (mapping == null)
+ mapping = new Dictionary<string, object> (StringComparer.Ordinal);
+
if (constructor.Parameters[0].ParameterType == constructor.Module.TypeSystem.Boolean) {
- if (mapping == null)
- mapping = new Dictionary<string, object> (StringComparer.Ordinal);
mapping.Add ("Bindable", ca[0].Value);
+ } else if (constructor.Parameters[0].ParameterType.FullName == "System.ComponentModel.BindableSupport") {
+ if ((int)ca[0].Value == 0)
+ mapping.Add ("Bindable", false);
+ else if ((int)ca[0].Value == 1)
+ mapping.Add ("Bindable", true);
+ else
+ throw new NotImplementedException ();
} else {
throw new NotImplementedException ();
}
static string target_host;
static int target_port;
static string agent;
+ static string [] script_args;
+
+ public static string [] ScriptArgs => script_args;
static int Main (string [] args)
{
+ if (!SplitDriverAndScriptArguments (ref args, out script_args))
+ return 1;
+
var cmd = new CommandLineParser (Console.Out);
cmd.UnknownOptionHandler += HandleExtraArguments;
return shell.Run (startup_files);
}
+ static bool SplitDriverAndScriptArguments (ref string [] driver_args, out string [] script_args)
+ {
+ // split command line arguments into two groups:
+ // - anything before '--' or '-s' goes to the mcs driver, which may
+ // call back into the csharp driver for further processing
+ // - anything after '--' or '-s' is made available to the REPL/script
+ // via the 'Args' global, similar to csi.
+ // - if '-s' is used, the argument immediately following it will
+ // also be processed by the mcs driver (e.g. a source file)
+
+ int driver_args_count = 0;
+ int script_args_offset = 0;
+ string script_file = null;
+
+ while (driver_args_count < driver_args.Length && script_args_offset == 0) {
+ switch (driver_args [driver_args_count]) {
+ case "--":
+ script_args_offset = driver_args_count + 1;
+ break;
+ case "-s":
+ if (driver_args_count + 1 >= driver_args.Length) {
+ script_args = null;
+ Console.Error.WriteLine ("usage is: -s SCRIPT_FILE");
+ return false;
+ }
+ driver_args_count++;
+ script_file = driver_args [driver_args_count];
+ script_args_offset = driver_args_count + 1;
+ break;
+ default:
+ driver_args_count++;
+ break;
+ }
+ }
+
+ if (script_args_offset > 0) {
+ int script_args_count = driver_args.Length - script_args_offset;
+ script_args = new string [script_args_count];
+ Array.Copy (driver_args, script_args_offset, script_args, 0, script_args_count);
+ } else
+ script_args = Array.Empty<string> ();
+
+ Array.Resize (ref driver_args, driver_args_count);
+ if (script_file != null)
+ driver_args [driver_args_count - 1] = script_file;
+
+ return true;
+ }
+
static int HandleExtraArguments (string [] args, int pos)
{
switch (args [pos]) {
public static new string help {
get {
return InteractiveBase.help +
- " TabAtStartCompletes - Whether tab will complete even on empty lines\n";
+ " TabAtStartCompletes - Whether tab will complete even on empty lines\n" +
+ " Args - Any command line arguments passed to csharp\n" +
+ " after the '--' (stop processing) argument";
}
}
+
+ public static string [] Args => Driver.ScriptArgs;
}
public class CSharpShell {
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\I18nAssemblies.cs" />\r
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\IXApiVisitor.cs" />\r
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\LinkContext.cs" />\r
+ <Compile Include="..\..\..\external\linker\linker\Mono.Linker\LoadException.cs" />\r
+ <Compile Include="..\..\..\external\linker\linker\Mono.Linker\MarkException.cs" />\r
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\MethodAction.cs" />\r
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\Pipeline.cs" />\r
<Compile Include="..\..\..\external\linker\linker\Mono.Linker\TypePreserve.cs" />\r
<Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
<Name>System.Xml-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
</ItemGroup>\r
../../../external/linker/linker/Mono.Linker/MethodAction.cs
../../../external/linker/linker/Mono.Linker/XApiReader.cs
../../../external/linker/linker/Mono.Linker/IXApiVisitor.cs
+../../../external/linker/linker/Mono.Linker/LoadException.cs
+../../../external/linker/linker/Mono.Linker/MarkException.cs
../../../external/linker/linker/Mono.Linker.Steps/BaseStep.cs
../../../external/linker/linker/Mono.Linker.Steps/LoadReferencesStep.cs
../../../external/linker/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
<Name>corlib-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
<ProjectReference Include="../../class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj">\r
<Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
<Name>System.Core-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
<ProjectReference Include="../../class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_x.csproj">\r
Assembly a = universe.LoadFile (path);
foreach (AssemblyName an in a.GetReferencedAssemblies ()) {
- a = universe.Load (an.FullName);
+ a = LoadAssembly (an.Name);
if (!QueueAssembly (files, a.CodeBase))
return false;
}
CHECK_DIFF = @\
$(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
$(MONO) $(LIB_PATH)/$(PROGRAM) $(MSYM_DIR) $(STACKTRACE_FILE) > $(SYMBOLICATE_RAW_FILE); \
- cat $(SYMBOLICATE_RAW_FILE) | tr '\\' '/' | sed "s/) .* in .*\/mcs\//) in mcs\//" | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
+ cat $(SYMBOLICATE_RAW_FILE) | tr '\\' '/' | sed "s/) .* in .*\/mcs\//) in mcs\//" | sed "s/) .* in .*\/external\//) in external\//" | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
DIFF=$$(diff -up $(SYMBOLICATE_EXPECTED_FILE) $(SYMBOLICATE_RESULT_FILE)); \
if [ ! -z "$$DIFF" ]; then \
echo "Symbolicate tests failed."; \
System.ArgumentNullException: Value cannot be null.
Parameter name: key
- at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) in mcs/class/referencesource/mscorlib/system/throwhelper.cs:80
- at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:299
- at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:228
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:359
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:275
at StackTraceDumper+<>c.<Main>b__0_15 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:54
at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:72
Stacktrace:
- at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) in mcs/class/referencesource/mscorlib/system/throwhelper.cs:80
- at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:299
- at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:228
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) in external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:359
+ at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) in external/corert/src/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs:275
at StackTraceDumper+<>c.<Main>b__0_15 () in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:54
at StackTraceDumper.Catch (System.Action action) in mcs/tools/mono-symbolicate/Test/StackTraceDumper.cs:72
../../../external/cecil/Mono.Cecil.PE/*.cs
../../../external/cecil/Mono.Collections.Generic/*.cs
../../../external/cecil/Mono.Security.Cryptography/*.cs
-../../../external/cecil/System.Security.Cryptography/*.cs
../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs
../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/*.cs
<Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
<Name>corlib-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
- <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
+ <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+ <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
<Name>Mono.Cecil-net_4_x</Name>\r
</ProjectReference>\r
<ProjectReference Include="../../class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_x.csproj">\r
data/Microsoft.VisualBasic.targets \
data/MSBuild/Microsoft.Build.CommonTypes.xsd \
data/MSBuild/Microsoft.Build.Core.xsd \
- data/Portable/Targets/* \
- data/Portable/Frameworks/v5.0/* \
+ data/Portable/Targets/Microsoft.Portable.Core.props \
+ data/Portable/Targets/Microsoft.Portable.Core.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.VisualBasic.targets \
+ "data/Portable/Frameworks/v5.0/.NET Framework 4.6.xml" \
+ "data/Portable/Frameworks/v5.0/ASP.NET Core 1.0.xml" \
+ "data/Portable/Frameworks/v5.0/FrameworkList.xml" \
+ "data/Portable/Frameworks/v5.0/Windows Universal 10.0.xml" \
frameworks/net_2.0.xml \
frameworks/net_3.0.xml \
frameworks/net_3.5.xml \
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/loader.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/w32handle.h>
#include <mono/utils/bsearch.h>
static gboolean
-try_load_from (MonoAssembly **assembly, const gchar *path1, const gchar *path2,
- const gchar *path3, const gchar *path4, gboolean refonly)
+try_load_from (MonoAssembly **assembly,
+ const gchar *path1, const gchar *path2,
+ const gchar *path3, const gchar *path4, gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
gchar *fullpath;
*assembly = NULL;
fullpath = g_build_filename (path1, path2, path3, path4, NULL);
if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, NULL);
g_free (fullpath);
return (*assembly != NULL);
}
static MonoAssembly *
-real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly)
+real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
MonoAssembly *result = NULL;
gchar **path;
/* See test cases in bug #58992 and bug #57710 */
/* 1st try: [culture]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, predicate, user_data))
break;
/* 2nd try: [culture]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, predicate, user_data))
break;
/* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, predicate, user_data))
break;
/* 4th try: [culture]/[name]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, predicate, user_data))
break;
}
gboolean refonly = GPOINTER_TO_UINT (user_data);
if (assemblies_path && assemblies_path [0] != NULL) {
- result = real_load (assemblies_path, aname->culture, aname->name, refonly);
+ result = real_load (assemblies_path, aname->culture, aname->name, refonly, NULL, NULL);
}
return result;
-/*
- * util.c: Assorted utilities for the disassembler
+/**
+ * \file
+ * Assorted utilities for the disassembler
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
#endif
/**
- * map:
- * @code: code to lookup in table
- * @table: table to decode code
+ * \param code code to lookup in table
+ * \param table table to decode code
*
* Warning: returns static buffer.
*/
}
/**
- * flags:
- * @code: bitfield
- * @table: table to decode bitfield
+ * \param code bitfield
+ * \param table table to decode bitfield
*
* Warning: returns static buffer.
*/
-/*
+/**
+ * \file
* Copyright 2014 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <glib.h>
+/*
+ * This file defines macros to compute sizes/alignments/field offsets which depend on
+ * the ABI. It is needed during cross compiling since the generated code needs to
+ * contain offsets which correspond to the ABI of the target, not the host.
+ * It defines the following macros:
+ * - MONO_ABI_SIZEOF(type) for every basic type
+ * - MONO_ABI_ALIGNOF(type) for every basic type
+ * - MONO_STRUCT_OFFSET(struct, field) for various runtime structures
+ * When not cross compiling, these correspond to the host ABI (i.e. sizeof/offsetof).
+ * When cross compiling, these are defined in a generated header file which is
+ * generated by the offsets tool in tools/offsets-tool. The name of the file
+ * is given by the --with-cross-offsets= configure argument.
+ */
+
#define MONO_ABI_ALIGNOF(type) MONO_ALIGN_ ## type
#define MONO_CURRENT_ABI_ALIGNOF_TYPEDEF(type) typedef struct { char c; type x; } Mono_Align_Struct_ ##type;
#define MONO_CURRENT_ABI_ALIGNOF(type) ((int)G_STRUCT_OFFSET(Mono_Align_Struct_ ##type, x))
-/*
+/**
+ * \file
* Appdomain-related icalls.
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * appdomain.c: AppDomain functions
+/**
+ * \file
+ * AppDomain functions
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
#include <mono/metadata/appdomain-icalls.h>
#include <mono/metadata/domain-internals.h>
#include "mono/metadata/metadata-internals.h"
-#include <mono/metadata/assembly.h>
#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/exception-internals.h>
#include <direct.h>
#endif
-/*
- * This is the version number of the corlib-runtime interface. When
- * making changes to this interface (by changing the layout
- * of classes the runtime knows about, changing icall signature or
- * semantics etc), increment this variable. Also increment the
- * pair of this variable in mscorlib in:
- * mcs/class/corlib/System/Environment.cs
- *
- * Changes which are already detected at runtime, like the addition
- * of icalls, do not require an increment.
- */
-#define MONO_CORLIB_VERSION 164
-
typedef struct
{
int runtime_count;
/**
* mono_runtime_init:
- * @domain: domain returned by mono_init ()
+ * \param domain domain returned by \c mono_init
*
* Initialize the core AppDomain: this function will run also some
* IL initialization code, so it needs the execution engine to be fully
* operational.
*
- * AppDomain.SetupInformation is set up in mono_runtime_exec_main, where
- * we know the entry_assembly.
+ * \c AppDomain.SetupInformation is set up in \c mono_runtime_exec_main, where
+ * we know the \c entry_assembly.
*
*/
void
}
/**
- * mono_check_corlib_version
- *
+ * mono_check_corlib_version:
* Checks that the corlib that is loaded matches the version of this runtime.
- *
- * Returns: NULL if the runtime will work with the corlib, or a g_malloc
+ * \returns NULL if the runtime will work with the corlib, or a \c g_malloc
* allocated string with the error otherwise.
*/
const char*
/**
* mono_context_init:
- * @domain: The domain where the System.Runtime.Remoting.Context.Context is initialized
- *
- * Initializes the @domain's default System.Runtime.Remoting's Context.
+ * \param domain The domain where the \c System.Runtime.Remoting.Context.Context is initialized
+ * Initializes the \p domain's default \c System.Runtime.Remoting 's Context.
*/
void
mono_context_init (MonoDomain *domain)
/**
* mono_runtime_cleanup:
- * @domain: unused.
+ * \param domain unused.
*
* Internal routine.
*
static MonoDomainFunc quit_function = NULL;
+/**
+ * mono_install_runtime_cleanup:
+ */
void
mono_install_runtime_cleanup (MonoDomainFunc func)
{
quit_function = func;
}
+/**
+ * mono_runtime_quit:
+ */
void
mono_runtime_quit ()
{
/**
* mono_domain_create_appdomain:
- * @friendly_name: The friendly name of the appdomain to create
- * @configuration_file: The configuration file to initialize the appdomain with
- *
- * Returns a MonoDomain initialized with the appdomain
+ * \param friendly_name The friendly name of the appdomain to create
+ * \param configuration_file The configuration file to initialize the appdomain with
+ * \returns a \c MonoDomain initialized with the appdomain
*/
MonoDomain *
mono_domain_create_appdomain (char *friendly_name, char *configuration_file)
/**
* mono_domain_create_appdomain_checked:
- * @friendly_name: The friendly name of the appdomain to create
- * @configuration_file: The configuration file to initialize the appdomain with
- * @error: Set on error.
+ * \param friendly_name The friendly name of the appdomain to create
+ * \param configuration_file The configuration file to initialize the appdomain with
+ * \param error Set on error.
*
- * Returns a MonoDomain initialized with the appdomain. On failure sets @error and returns NULL.
+ * \returns a MonoDomain initialized with the appdomain. On failure sets \p error and returns NULL.
*/
MonoDomain *
mono_domain_create_appdomain_checked (char *friendly_name, char *configuration_file, MonoError *error)
/**
* mono_domain_set_config:
- * @domain: MonoDomain initialized with the appdomain we want to change
- * @base_dir: new base directory for the appdomain
- * @config_file_name: path to the new configuration for the app domain
+ * \param domain \c MonoDomain initialized with the appdomain we want to change
+ * \param base_dir new base directory for the appdomain
+ * \param config_file_name path to the new configuration for the app domain
*
* Used to set the system configuration for an appdomain
*
/**
* mono_domain_has_type_resolve:
- * @domain: application domains being looked up
+ * \param domain application domain being looked up
*
- * Returns: TRUE if the AppDomain.TypeResolve field has been
- * set.
+ * \returns TRUE if the \c AppDomain.TypeResolve field has been set.
*/
gboolean
mono_domain_has_type_resolve (MonoDomain *domain)
/**
* mono_domain_try_type_resolve:
- * @domain: application domainwhere the name where the type is going to be resolved
- * @name: the name of the type to resolve or NULL.
- * @tb: A System.Reflection.Emit.TypeBuilder, used if name is NULL.
+ * \param domain application domainwhere the name where the type is going to be resolved
+ * \param name the name of the type to resolve or NULL.
+ * \param tb A \c System.Reflection.Emit.TypeBuilder, used if name is NULL.
*
- * This routine invokes the internal System.AppDomain.DoTypeResolve and returns
+ * This routine invokes the internal \c System.AppDomain.DoTypeResolve and returns
* the assembly that matches name.
*
- * If @name is null, the value of ((TypeBuilder)tb).FullName is used instead
+ * If \p name is null, the value of \c ((TypeBuilder)tb).FullName is used instead
*
- * Returns: A MonoReflectionAssembly or NULL if not found
+ * \returns A \c MonoReflectionAssembly or NULL if not found
*/
MonoReflectionAssembly *
mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb)
/**
* mono_domain_owns_vtable_slot:
- *
- * Returns whenever VTABLE_SLOT is inside a vtable which belongs to DOMAIN.
+ * \returns Whether \p vtable_slot is inside a vtable which belongs to \p domain.
*/
gboolean
mono_domain_owns_vtable_slot (MonoDomain *domain, gpointer vtable_slot)
/**
* mono_domain_set:
- * @domain: domain
- * @force: force setting.
+ * \param domain domain
+ * \param force force setting.
*
- * Set the current appdomain to @domain. If @force is set, set it even
+ * Set the current appdomain to \p domain. If \p force is set, set it even
* if it is being unloaded.
*
- * Returns:
- * TRUE on success;
- * FALSE if the domain is unloaded
+ * \returns TRUE on success; FALSE if the domain is unloaded
*/
gboolean
mono_domain_set (MonoDomain *domain, gboolean force)
}
#endif /* DISABLE_SHADOW_COPY */
+/**
+ * mono_domain_from_appdomain:
+ */
MonoDomain *
mono_domain_from_appdomain (MonoAppDomain *appdomain_raw)
{
static gboolean
-try_load_from (MonoAssembly **assembly, const gchar *path1, const gchar *path2,
- const gchar *path3, const gchar *path4,
- gboolean refonly, gboolean is_private)
+try_load_from (MonoAssembly **assembly,
+ const gchar *path1, const gchar *path2,
+ const gchar *path3, const gchar *path4,
+ gboolean refonly, gboolean is_private,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
gchar *fullpath;
gboolean found = FALSE;
found = g_file_test (fullpath, G_FILE_TEST_IS_REGULAR);
if (found)
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, NULL);
g_free (fullpath);
return (*assembly != NULL);
}
static MonoAssembly *
-real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly)
+real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly, MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
MonoAssembly *result = NULL;
gchar **path;
/* See test cases in bug #58992 and bug #57710 */
/* 1st try: [culture]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private, predicate, user_data))
break;
/* 2nd try: [culture]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private, predicate, user_data))
break;
/* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private, predicate, user_data))
break;
/* 4th try: [culture]/[name]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private, predicate, user_data))
break;
}
set_domain_search_path (domain);
if (domain->search_path && domain->search_path [0] != NULL) {
- result = real_load (domain->search_path, aname->culture, aname->name, refonly);
+ if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY)) {
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Domain %s search path is:", domain->friendly_name);
+ for (int i = 0; domain->search_path [i]; i++) {
+ const char *p = domain->search_path[i];
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "\tpath[%d] = '%s'", i, p);
+ }
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "End of domain %s search path.", domain->friendly_name);
+ }
+ result = real_load (domain->search_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
}
if (result == NULL && assemblies_path && assemblies_path [0] != NULL) {
- result = real_load (assemblies_path, aname->culture, aname->name, refonly);
+ result = real_load (assemblies_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
}
return result;
if (!is_ok (error))
goto leave;
- MonoAssembly *ass = mono_assembly_open_a_lot (filename, &status, refOnly, TRUE);
+ MonoAssembly *ass = mono_assembly_open_predicate (filename, refOnly, TRUE, NULL, NULL, &status);
if (!ass) {
if (status == MONO_IMAGE_IMAGE_INVALID)
return newguid;
}
+/**
+ * mono_domain_is_unloading:
+ */
gboolean
mono_domain_is_unloading (MonoDomain *domain)
{
return 1;
}
-/*
+/**
* mono_domain_unload:
- * @domain: The domain to unload
+ * \param domain The domain to unload
*
- * Unloads an appdomain. Follows the process outlined in the comment
- * for mono_domain_try_unload.
+ * Unloads an appdomain. Follows the process outlined in the comment
+ * for \c mono_domain_try_unload.
*/
void
mono_domain_unload (MonoDomain *domain)
return result;
}
-/*
+/**
* mono_domain_unload:
- * @domain: The domain to unload
- * @exc: Exception information
+ * \param domain The domain to unload
+ * \param exc Exception information
*
* Unloads an appdomain. Follows the process outlined in:
* http://blogs.gotdotnet.com/cbrumme
-/*
- * appdomain.h: AppDomain functions
+/**
+ * \file
+ * AppDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
+/**
+ * \file
* Copyright 2015 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_ASSEMBLY_INTERNALS_H__
#define __MONO_METADATA_ASSEMBLY_INTERNALS_H__
+#include <glib.h>
+
#include <mono/metadata/assembly.h>
MONO_API MonoImage* mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error);
MonoAssembly * mono_assembly_open_a_lot (const char *filename, MonoImageOpenStatus *status, gboolean refonly, gboolean load_from_context);
+/* If predicate returns true assembly should be loaded, if false ignore it. */
+typedef gboolean (*MonoAssemblyCandidatePredicate)(MonoAssembly *, gpointer);
+
+MonoAssembly* mono_assembly_open_predicate (const char *filename,
+ gboolean refonly,
+ gboolean load_from_context,
+ MonoAssemblyCandidatePredicate pred,
+ gpointer user_data,
+ MonoImageOpenStatus *status);
+
+MonoAssembly* mono_assembly_load_from_predicate (MonoImage *image, const char *fname,
+ gboolean refonly,
+ MonoAssemblyCandidatePredicate pred,
+ gpointer user_data,
+ MonoImageOpenStatus *status);
+
+/* MonoAssemblyCandidatePredicate that compares the assembly name (name, version,
+ * culture, public key token) of the candidate with the wanted name, if the
+ * wanted name has a public key token (if not present, always return true).
+ * Pass the wanted MonoAssemblyName* as the user_data.
+ */
+gboolean
+mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer wanted_name);
+
#endif /* __MONO_METADATA_ASSEMBLY_INTERNALS_H__ */
-/*
- * assembly.c: Routines for loading assemblies.
+/**
+ * \file
+ * Routines for loading assemblies.
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
/**
* mono_public_tokens_are_equal:
- * @pubt1: first public key token
- * @pubt2: second public key token
+ * \param pubt1 first public key token
+ * \param pubt2 second public key token
*
- * Compare two public key tokens and return #TRUE is they are equal and #FALSE
+ * Compare two public key tokens and return TRUE is they are equal and FALSE
* otherwise.
*/
gboolean
/**
* mono_set_assemblies_path:
- * @path: list of paths that contain directories where Mono will look for assemblies
+ * \param path list of paths that contain directories where Mono will look for assemblies
*
* Use this method to override the standard assembly lookup system and
* override any assemblies coming from the GAC. This is the method
- * that supports the MONO_PATH variable.
+ * that supports the \c MONO_PATH variable.
*
- * Notice that MONO_PATH and this method are really a very bad idea as
+ * Notice that \c MONO_PATH and this method are really a very bad idea as
* it prevents the GAC from working and it prevents the standard
* resolution mechanisms from working. Nonetheless, for some debugging
* situations and bootstrapping setups, this is useful to have.
/**
* mono_assembly_names_equal:
- * @l: first assembly
- * @r: second assembly.
+ * \param l first assembly
+ * \param r second assembly.
*
- * Compares two MonoAssemblyNames and returns whether they are equal.
+ * Compares two \c MonoAssemblyName instances and returns whether they are equal.
*
* This compares the names, the cultures, the release version and their
* public tokens.
*
- * Returns: TRUE if both assembly names are equal.
+ * \returns TRUE if both assembly names are equal.
*/
gboolean
mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r)
}
static MonoAssembly *
-load_in_path (const char *basename, const char** search_path, MonoImageOpenStatus *status, MonoBoolean refonly)
+load_in_path (const char *basename, const char** search_path, MonoImageOpenStatus *status, MonoBoolean refonly, MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
int i;
char *fullpath;
for (i = 0; search_path [i]; ++i) {
fullpath = g_build_filename (search_path [i], basename, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, status);
g_free (fullpath);
if (result)
return result;
/**
* mono_assembly_setrootdir:
- * @root_dir: The pathname of the root directory where we will locate assemblies
+ * \param root_dir The pathname of the root directory where we will locate assemblies
*
* This routine sets the internal default root directory for looking up
* assemblies.
/**
* mono_set_dirs:
- * @assembly_dir: the base directory for assemblies
- * @config_dir: the base directory for configuration files
+ * \param assembly_dir the base directory for assemblies
+ * \param config_dir the base directory for configuration files
*
* This routine is used internally and by developers embedding
* the runtime into their own applications.
return TRUE;
}
+/**
+ * mono_assembly_fill_assembly_name:
+ * \param image Image
+ * \param aname Name
+ * \returns TRUE if successful
+ */
gboolean
mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname)
{
/**
* mono_stringify_assembly_name:
- * @aname: the assembly name.
+ * \param aname the assembly name.
*
- * Convert @aname into its string format. The returned string is dynamically
+ * Convert \p aname into its string format. The returned string is dynamically
* allocated and should be freed by the caller.
*
- * Returns: a newly allocated string with a string representation of
+ * \returns a newly allocated string with a string representation of
* the assembly name.
*/
char*
/**
* mono_assembly_addref:
- * @assemnly: the assembly to reference
+ * \param assembly the assembly to reference
*
* This routine increments the reference count on a MonoAssembly.
* The reference count is reduced every time the method mono_assembly_close() is
dest_aname->minor = vset->minor;
dest_aname->build = vset->build;
dest_aname->revision = vset->revision;
+ if (current_runtime->public_key_token != NULL &&
+ dest_aname->public_key_token [0] != 0 &&
+ !mono_public_tokens_are_equal (dest_aname->public_key_token, (const mono_byte *)current_runtime->public_key_token)) {
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY,
+ "The request for assembly name '%s' with PublicKeyToken=%s was remapped to PublicKeyToken=%s",
+ dest_aname->name,
+ dest_aname->public_key_token,
+ current_runtime->public_key_token);
+ memcpy (dest_aname->public_key_token, current_runtime->public_key_token, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ }
if (vmap->new_assembly_name != NULL) {
dest_aname->name = vmap->new_assembly_name;
mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY,
/**
* mono_assembly_get_assemblyref:
- * @image: pointer to the MonoImage to extract the information from.
- * @index: index to the assembly reference in the image.
- * @aname: pointer to a `MonoAssemblyName` that will hold the returned value.
+ * \param image pointer to the \c MonoImage to extract the information from.
+ * \param index index to the assembly reference in the image.
+ * \param aname pointer to a \c MonoAssemblyName that will hold the returned value.
*
- * Fills out the @aname with the assembly name of the @index assembly reference in @image.
+ * Fills out the \p aname with the assembly name of the \p index assembly reference in \p image.
*/
void
mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname)
}
}
+/**
+ * mono_assembly_load_reference:
+ */
void
mono_assembly_load_reference (MonoImage *image, int index)
{
/**
* mono_assembly_load_references:
- * @image:
- * @status:
- * @deprecated: There is no reason to use this method anymore, it does nothing
+ * \param image
+ * \param status
+ * \deprecated There is no reason to use this method anymore, it does nothing
*
- * This method is now a no-op, it does nothing other than setting the @status to #MONO_IMAGE_OK
+ * This method is now a no-op, it does nothing other than setting the \p status to \c MONO_IMAGE_OK
*/
void
mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
AssemblyLoadHook *assembly_load_hook = NULL;
+/**
+ * mono_assembly_invoke_load_hook:
+ */
void
mono_assembly_invoke_load_hook (MonoAssembly *ass)
{
}
}
+/**
+ * mono_install_assembly_load_hook:
+ */
void
mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, gpointer user_data)
{
return NULL;
}
+/**
+ * mono_assembly_invoke_search_hook:
+ */
MonoAssembly*
mono_assembly_invoke_search_hook (MonoAssemblyName *aname)
{
assembly_search_hook = hook;
}
+/**
+ * mono_install_assembly_search_hook:
+ */
void
mono_install_assembly_search_hook (MonoAssemblySearchFunc func, gpointer user_data)
{
}
}
+/**
+ * mono_install_assembly_refonly_search_hook:
+ */
void
mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, gpointer user_data)
{
mono_install_assembly_search_hook_internal (func, user_data, TRUE, FALSE);
}
+/**
+ * mono_install_assembly_postload_search_hook:
+ */
void
mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, gpointer user_data)
{
return NULL;
}
+/**
+ * mono_install_assembly_preload_hook:
+ */
void
mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, gpointer user_data)
{
assembly_preload_hook = hook;
}
+/**
+ * mono_install_assembly_refonly_preload_hook:
+ */
void
mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func, gpointer user_data)
{
/**
* mono_assembly_open_from_bundle:
- * @filename: Filename requested
- * @status: return status code
+ * \param filename Filename requested
+ * \param status return status code
*
- * This routine tries to open the assembly specified by `filename' from the
+ * This routine tries to open the assembly specified by \p filename from the
* defined bundles, if found, returns the MonoImage for it, if not found
* returns NULL
*/
}
/**
- * mono_assemblies_open_full:
- * @filename: the file to load
- * @status: return status code
- * @refonly: Whether this assembly is being opened in "reflection-only" mode.
-*
- * This loads an assembly from the specified @filename. The @filename allows
- * a local URL (starting with a file:// prefix). If a file prefix is used, the
+ * mono_assembly_open_full:
+ * \param filename the file to load
+ * \param status return status code
+ * \param refonly Whether this assembly is being opened in "reflection-only" mode.
+ *
+ * This loads an assembly from the specified \p filename. The \p filename allows
+ * a local URL (starting with a \c file:// prefix). If a file prefix is used, the
* filename is interpreted as a URL, and the filename is URL-decoded. Otherwise the file
* is treated as a local path.
*
* First, an attempt is made to load the assembly from the bundled executable (for those
- * deployments that have been done with the `mkbundle` tool or for scenarios where the
+ * deployments that have been done with the \c mkbundle tool or for scenarios where the
* assembly has been registered as an embedded assembly). If this is not the case, then
* the assembly is loaded from disk using `api:mono_image_open_full`.
*
* If the pointed assembly does not live in the Global Assembly Cache, a shadow copy of
* the assembly is made.
*
- * If @refonly is set to true, then the assembly is loaded purely for inspection with
- * the `System.Reflection` API.
+ * If \p refonly is set to true, then the assembly is loaded purely for inspection with
+ * the \c System.Reflection API.
*
- * Returns: NULL on error, with the @status set to an error code, or a pointer
+ * \returns NULL on error, with the \p status set to an error code, or a pointer
* to the assembly.
*/
MonoAssembly *
MonoAssembly *
mono_assembly_open_a_lot (const char *filename, MonoImageOpenStatus *status, gboolean refonly, gboolean load_from_context)
{
+ return mono_assembly_open_predicate (filename, refonly, load_from_context, NULL, NULL, status);
+}
+MonoAssembly *
+mono_assembly_open_predicate (const char *filename, gboolean refonly,
+ gboolean load_from_context,
+ MonoAssemblyCandidatePredicate predicate,
+ gpointer user_data,
+ MonoImageOpenStatus *status)
+{
MonoImage *image;
MonoAssembly *ass;
MonoImageOpenStatus def_status;
return image->assembly;
}
- ass = mono_assembly_load_from_full (image, fname, status, refonly);
+ ass = mono_assembly_load_from_predicate (image, fname, refonly, predicate, user_data, status);
if (ass) {
if (!loaded_from_bundle)
/**
* mono_assembly_load_friends:
- * @ass: an assembly
+ * \param ass an assembly
*
* Load the list of friend assemblies that are allowed to access
* the assembly's internal types and members. They are stored as assembly
/**
* mono_assembly_has_reference_assembly_attribute:
- * @assembly: a MonoAssembly
- * @error: set on error.
+ * \param assembly a MonoAssembly
+ * \param error set on error.
*
- * Returns TRUE if @assembly has the System.Runtime.CompilerServices.ReferenceAssemblyAttribute set.
- * On error returns FALSE and sets @error.
+ * \returns TRUE if \p assembly has the \c System.Runtime.CompilerServices.ReferenceAssemblyAttribute set.
+ * On error returns FALSE and sets \p error.
*/
gboolean
mono_assembly_has_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error)
/**
* mono_assembly_open:
- * @filename: Opens the assembly pointed out by this name
- * @status: return status code
+ * \param filename Opens the assembly pointed out by this name
+ * \param status return status code
*
- * This loads an assembly from the specified @filename. The @filename allows
- * a local URL (starting with a file:// prefix). If a file prefix is used, the
+ * This loads an assembly from the specified \p filename. The \p filename allows
+ * a local URL (starting with a \c file:// prefix). If a file prefix is used, the
* filename is interpreted as a URL, and the filename is URL-decoded. Otherwise the file
* is treated as a local path.
*
* First, an attempt is made to load the assembly from the bundled executable (for those
- * deployments that have been done with the `mkbundle` tool or for scenarios where the
+ * deployments that have been done with the \c mkbundle tool or for scenarios where the
* assembly has been registered as an embedded assembly). If this is not the case, then
* the assembly is loaded from disk using `api:mono_image_open_full`.
*
* If the pointed assembly does not live in the Global Assembly Cache, a shadow copy of
* the assembly is made.
*
- * Return: a pointer to the MonoAssembly if @filename contains a valid
+ * \returns a pointer to the \c MonoAssembly if \p filename contains a valid
* assembly or NULL on error. Details about the error are stored in the
- * @status variable.
+ * \p status variable.
*/
MonoAssembly *
mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
{
- return mono_assembly_open_full (filename, status, FALSE);
+ return mono_assembly_open_predicate (filename, FALSE, FALSE, NULL, NULL, status);
}
/**
* mono_assembly_load_from_full:
- * @image: Image to load the assembly from
- * @fname: assembly name to associate with the assembly
- * @status: returns the status condition
- * @refonly: Whether this assembly is being opened in "reflection-only" mode.
+ * \param image Image to load the assembly from
+ * \param fname assembly name to associate with the assembly
+ * \param status returns the status condition
+ * \param refonly Whether this assembly is being opened in "reflection-only" mode.
*
- * If the provided @image has an assembly reference, it will process the given
+ * If the provided \p image has an assembly reference, it will process the given
* image as an assembly with the given name.
*
* Most likely you want to use the `api:mono_assembly_load_full` method instead.
*
- * Returns: A valid pointer to a `MonoAssembly*` on success and the @status will be
- * set to #MONO_IMAGE_OK; or NULL on error.
+ * Returns: A valid pointer to a \c MonoAssembly* on success and the \p status will be
+ * set to \c MONO_IMAGE_OK; or NULL on error.
*
- * If there is an error loading the assembly the @status will indicate the
- * reason with @status being set to `MONO_IMAGE_INVALID` if the
+ * If there is an error loading the assembly the \p status will indicate the
+ * reason with \p status being set to \c MONO_IMAGE_INVALID if the
* image did not contain an assembly reference table.
*/
MonoAssembly *
mono_assembly_load_from_full (MonoImage *image, const char*fname,
MonoImageOpenStatus *status, gboolean refonly)
+{
+ return mono_assembly_load_from_predicate (image, fname, refonly, NULL, NULL, status);
+}
+
+MonoAssembly *
+mono_assembly_load_from_predicate (MonoImage *image, const char *fname,
+ gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate,
+ gpointer user_data,
+ MonoImageOpenStatus *status)
{
MonoAssembly *ass, *ass2;
char *base_dir;
mono_error_cleanup (&refasm_error);
}
+ if (predicate && !predicate (ass, user_data)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate returned FALSE, skipping '%s' (%s)\n", ass->aname.name, image->name);
+ g_free (ass);
+ g_free (base_dir);
+ mono_image_close (image);
+ *status = MONO_IMAGE_IMAGE_INVALID;
+ return NULL;
+ }
+
mono_assemblies_lock ();
if (image->assembly) {
/**
* mono_assembly_load_from:
- * @image: Image to load the assembly from
- * @fname: assembly name to associate with the assembly
- * @status: return status code
+ * \param image Image to load the assembly from
+ * \param fname assembly name to associate with the assembly
+ * \param status return status code
*
- * If the provided @image has an assembly reference, it will process the given
+ * If the provided \p image has an assembly reference, it will process the given
* image as an assembly with the given name.
*
* Most likely you want to use the `api:mono_assembly_load_full` method instead.
*
* This is equivalent to calling `api:mono_assembly_load_from_full` with the
- * @refonly parameter set to FALSE.
- * Returns: A valid pointer to a `MonoAssembly*` on success and the @status will be
- * set to #MONO_IMAGE_OK; or NULL on error.
+ * \p refonly parameter set to FALSE.
+ * \returns A valid pointer to a \c MonoAssembly* on success and then \p status will be
+ * set to \c MONO_IMAGE_OK; or NULL on error.
*
- * If there is an error loading the assembly the @status will indicate the
- * reason with @status being set to `MONO_IMAGE_INVALID` if the
+ * If there is an error loading the assembly the \p status will indicate the
+ * reason with \p status being set to \c MONO_IMAGE_INVALID if the
* image did not contain an assembly reference table.
*/
/**
* mono_assembly_name_free:
- * @aname: assembly name to free
+ * \param aname assembly name to free
*
* Frees the provided assembly name object.
* (it does not frees the object itself, only the name members).
/**
* mono_assembly_name_parse:
- * @name: name to parse
- * @aname: the destination assembly name
+ * \param name name to parse
+ * \param aname the destination assembly name
*
* Parses an assembly qualified type name and assigns the name,
* version, culture and token to the provided assembly name object.
*
- * Returns: TRUE if the name could be parsed.
+ * \returns TRUE if the name could be parsed.
*/
gboolean
mono_assembly_name_parse (const char *name, MonoAssemblyName *aname)
/**
* mono_assembly_name_new:
- * @name: name to parse
+ * \param name name to parse
*
- * Allocate a new MonoAssemblyName and fill its values from the
- * passed @name.
+ * Allocate a new \c MonoAssemblyName and fill its values from the
+ * passed \p name.
*
- * Returns: a newly allocated structure or NULL if there was any failure.
+ * \returns a newly allocated structure or NULL if there was any failure.
*/
MonoAssemblyName*
mono_assembly_name_new (const char *name)
return NULL;
}
+/**
+ * mono_assembly_name_get_name:
+ */
const char*
mono_assembly_name_get_name (MonoAssemblyName *aname)
{
return aname->name;
}
+/**
+ * mono_assembly_name_get_culture:
+ */
const char*
mono_assembly_name_get_culture (MonoAssemblyName *aname)
{
return aname->culture;
}
+/**
+ * mono_assembly_name_get_pubkeytoken:
+ */
mono_byte*
mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname)
{
return NULL;
}
+/**
+ * mono_assembly_name_get_version:
+ */
uint16_t
mono_assembly_name_get_version (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision)
{
if (fullpath == NULL)
return NULL;
else {
- MonoAssembly *res = mono_assembly_open (fullpath, status);
+ MonoAssembly *res = mono_assembly_open_predicate (fullpath, FALSE, FALSE, NULL, NULL, status);
g_free (fullpath);
return res;
}
/**
* mono_assembly_load_with_partial_name:
- * @name: an assembly name that is then parsed by `api:mono_assembly_name_parse`.
- * @status: return status code
+ * \param name an assembly name that is then parsed by `api:mono_assembly_name_parse`.
+ * \param status return status code
*
- * Loads a Mono Assembly from a name. The name is parsed using `api:mono_assembly_name_parse`,
+ * Loads a \c MonoAssembly from a name. The name is parsed using `api:mono_assembly_name_parse`,
* so it might contain a qualified type name, version, culture and token.
*
* This will load the assembly from the file whose name is derived from the assembly name
- * by appending the .dll extension.
+ * by appending the \c .dll extension.
*
* The assembly is loaded from either one of the extra Global Assembly Caches specified
- * by the extra GAC paths (specified by the `MONO_GAC_PREFIX` environment variable) or
+ * by the extra GAC paths (specified by the \c MONO_GAC_PREFIX environment variable) or
* if that fails from the GAC.
*
- * Returns: NULL on failure, or a pointer to a MonoAssembly on success.
+ * \returns NULL on failure, or a pointer to a \c MonoAssembly on success.
*/
MonoAssembly*
mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status)
if (!domain)
return;
+ if (info->has_new_version && mono_assembly_is_problematic_version (info->name, info->new_version.major, info->new_version.minor, info->new_version.build, info->new_version.revision)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Discarding assembly binding to problematic version %s v%d.%d.%d.%d",
+ info->name, info->new_version.major, info->new_version.minor, info->new_version.build, info->new_version.revision);
+ return;
+ }
+
for (tmp = domain->assembly_bindings; tmp; tmp = tmp->next) {
info_tmp = (MonoAssemblyBindingInfo *)tmp->data;
if (strcmp (info->name, info_tmp->name) == 0 && info_versions_equal (info, info_tmp))
/**
* mono_assembly_load_from_gac
*
- * @aname: The assembly name object
+ * \param aname The assembly name object
*/
static MonoAssembly*
mono_assembly_load_from_gac (MonoAssemblyName *aname, gchar *filename, MonoImageOpenStatus *status, MonoBoolean refonly)
paths = extra_gac_paths;
while (!result && *paths) {
fullpath = g_build_path (G_DIR_SEPARATOR_S, *paths, "lib", "mono", "gac", subpath, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
paths++;
}
fullpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (),
"mono", "gac", subpath, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
if (result)
// This unusual directory layout can occur if mono is being built and run out of its own source repo
if (assemblies_path) { // Custom assemblies path set via MONO_PATH or mono_set_assemblies_path
- corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status, FALSE);
+ corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status, FALSE, NULL, NULL);
if (corlib)
goto return_corlib_and_facades;
}
/* Normal case: Load corlib from mono/<version> */
corlib_file = g_build_filename ("mono", runtime->framework_version, "mscorlib.dll", NULL);
if (assemblies_path) { // Custom assemblies path
- corlib = load_in_path (corlib_file, (const char**)assemblies_path, status, FALSE);
+ corlib = load_in_path (corlib_file, (const char**)assemblies_path, status, FALSE, NULL, NULL);
if (corlib) {
g_free (corlib_file);
goto return_corlib_and_facades;
}
}
- corlib = load_in_path (corlib_file, default_path, status, FALSE);
+ corlib = load_in_path (corlib_file, default_path, status, FALSE, NULL, NULL);
g_free (corlib_file);
return_corlib_and_facades:
return candidate;
}
+gboolean
+mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer ud)
+{
+ MonoAssemblyName *wanted_name = (MonoAssemblyName*)ud;
+ MonoAssemblyName *candidate_name = &candidate->aname;
+
+ g_assert (wanted_name != NULL);
+ g_assert (candidate_name != NULL);
+
+ if (mono_trace_is_traced (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY)) {
+ char * s = mono_stringify_assembly_name (wanted_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: wanted = %s\n", s);
+ g_free (s);
+ s = mono_stringify_assembly_name (candidate_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate = %s\n", s);
+ g_free (s);
+ }
+
+ /* No wanted token, bail. */
+ if (0 == wanted_name->public_key_token [0]) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: wanted has no token, returning TRUE\n");
+ return TRUE;
+ }
+
+ if (0 == candidate_name->public_key_token [0]) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate has no token, returning FALSE\n");
+ return FALSE;
+ }
+
+
+ gboolean result = mono_assembly_names_equal (wanted_name, candidate_name);
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate and wanted names %s\n",
+ result ? "match, returning TRUE" : "don't match, returning FALSE");
+ return result;
+
+}
+
MonoAssembly*
mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
int len;
aname = mono_assembly_remap_version (aname, &maped_aname);
-
+
/* Reflection only assemblies don't get assembly binding */
if (!refonly)
aname = mono_assembly_apply_binding (aname, &maped_name_pp);
if (basedir) {
fullpath = g_build_filename (basedir, filename, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
if (result) {
result->in_gac = FALSE;
}
}
- result = load_in_path (filename, default_path, status, refonly);
+ result = load_in_path (filename, default_path, status, refonly, NULL, NULL);
if (result)
result->in_gac = FALSE;
g_free (filename);
/**
* mono_assembly_load_full:
- * @aname: A MonoAssemblyName with the assembly name to load.
- * @basedir: A directory to look up the assembly at.
- * @status: a pointer to a MonoImageOpenStatus to return the status of the load operation
- * @refonly: Whether this assembly is being opened in "reflection-only" mode.
+ * \param aname A MonoAssemblyName with the assembly name to load.
+ * \param basedir A directory to look up the assembly at.
+ * \param status a pointer to a MonoImageOpenStatus to return the status of the load operation
+ * \param refonly Whether this assembly is being opened in "reflection-only" mode.
*
- * Loads the assembly referenced by @aname, if the value of @basedir is not NULL, it
+ * Loads the assembly referenced by \p aname, if the value of \p basedir is not NULL, it
* attempts to load the assembly from that directory before probing the standard locations.
*
- * If the assembly is being opened in reflection-only mode (@refonly set to TRUE) then no
+ * If the assembly is being opened in reflection-only mode (\p refonly set to TRUE) then no
* assembly binding takes place.
*
- * Returns: the assembly referenced by @aname loaded or NULL on error. On error the
- * value pointed by status is updated with an error code.
+ * \returns the assembly referenced by \p aname loaded or NULL on error. On error the
+ * value pointed by \p status is updated with an error code.
*/
MonoAssembly*
mono_assembly_load_full (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, gboolean refonly)
/**
* mono_assembly_load:
- * @aname: A MonoAssemblyName with the assembly name to load.
- * @basedir: A directory to look up the assembly at.
- * @status: a pointer to a MonoImageOpenStatus to return the status of the load operation
+ * \param aname A MonoAssemblyName with the assembly name to load.
+ * \param basedir A directory to look up the assembly at.
+ * \param status a pointer to a MonoImageOpenStatus to return the status of the load operation
*
- * Loads the assembly referenced by @aname, if the value of @basedir is not NULL, it
+ * Loads the assembly referenced by \p aname, if the value of \p basedir is not NULL, it
* attempts to load the assembly from that directory before probing the standard locations.
*
- * Returns: the assembly referenced by @aname loaded or NULL on error. On error the
- * value pointed by status is updated with an error code.
+ * \returns the assembly referenced by \p aname loaded or NULL on error. On error the
+ * value pointed by \p status is updated with an error code.
*/
MonoAssembly*
mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status)
/**
* mono_assembly_loaded_full:
- * @aname: an assembly to look for.
- * @refonly: Whether this assembly is being opened in "reflection-only" mode.
+ * \param aname an assembly to look for.
+ * \param refonly Whether this assembly is being opened in "reflection-only" mode.
*
* This is used to determine if the specified assembly has been loaded
- * Returns: NULL If the given @aname assembly has not been loaded, or a pointer to
- * a `MonoAssembly` that matches the `MonoAssemblyName` specified.
+ * \returns NULL If the given \p aname assembly has not been loaded, or a pointer to
+ * a \c MonoAssembly that matches the \c MonoAssemblyName specified.
*/
MonoAssembly*
mono_assembly_loaded_full (MonoAssemblyName *aname, gboolean refonly)
/**
* mono_assembly_loaded:
- * @aname: an assembly to look for.
+ * \param aname an assembly to look for.
*
* This is used to determine if the specified assembly has been loaded
- * Returns: NULL If the given @aname assembly has not been loaded, or a pointer to
- * a `MonoAssembly` that matches the `MonoAssemblyName` specified.
+ * \returns NULL If the given \p aname assembly has not been loaded, or a pointer to
+ * a \c MonoAssembly that matches the \c MonoAssemblyName specified.
*/
MonoAssembly*
mono_assembly_loaded (MonoAssemblyName *aname)
/**
* mono_assembly_close:
- * @assembly: the assembly to release.
+ * \param assembly the assembly to release.
*
- * This method releases a reference to the @assembly. The assembly is
+ * This method releases a reference to the \p assembly. The assembly is
* only released when all the outstanding references to it are released.
*/
void
mono_assembly_close_finish (assembly);
}
+/**
+ * mono_assembly_load_module:
+ */
MonoImage*
mono_assembly_load_module (MonoAssembly *assembly, guint32 idx)
{
/**
* mono_assembly_foreach:
- * @func: function to invoke for each assembly loaded
- * @user_data: data passed to the callback
+ * \param func function to invoke for each assembly loaded
+ * \param user_data data passed to the callback
*
- * Invokes the provided @func callback for each assembly loaded into
+ * Invokes the provided \p func callback for each assembly loaded into
* the runtime. The first parameter passed to the callback is the
- * `MonoAssembly*`, and the second parameter is the @user_data.
+ * \c MonoAssembly*, and the second parameter is the \p user_data.
*
* This is done for all assemblies loaded in the runtime, not just
* those loaded in the current application domain.
*/
static MonoAssembly *main_assembly=NULL;
+/**
+ * mono_assembly_set_main:
+ */
void
mono_assembly_set_main (MonoAssembly *assembly)
{
/**
* mono_assembly_get_image:
- * @assembly: The assembly to retrieve the image from
+ * \param assembly The assembly to retrieve the image from
*
- * Returns: the MonoImage associated with this assembly.
+ * \returns the \c MonoImage associated with this assembly.
*/
MonoImage*
mono_assembly_get_image (MonoAssembly *assembly)
/**
* mono_assembly_get_name:
- * @assembly: The assembly to retrieve the name from
+ * \param assembly The assembly to retrieve the name from
*
- * The returned name's lifetime is the same as @assembly's.
+ * The returned name's lifetime is the same as \p assembly's.
*
- * Returns: the MonoAssemblyName associated with this assembly.
+ * \returns the \c MonoAssemblyName associated with this assembly.
*/
MonoAssemblyName *
mono_assembly_get_name (MonoAssembly *assembly)
return &assembly->aname;
}
+/**
+ * mono_register_bundled_assemblies:
+ */
void
mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies)
{
+/**
+ * \file
+ */
+
#ifndef _MONONET_METADATA_ASSEMBLY_H_
#define _MONONET_METADATA_ASSEMBLY_H_
MONO_API void mono_assemblies_init (void);
MONO_API void mono_assemblies_cleanup (void);
+MONO_RT_EXTERNAL_ONLY
MONO_API MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
+MONO_RT_EXTERNAL_ONLY
MONO_API MonoAssembly *mono_assembly_open_full (const char *filename,
MonoImageOpenStatus *status,
mono_bool refonly);
-/*
- * attach.c: Support for attaching to the runtime from other processes.
+/**
+ * \file
+ * Support for attaching to the runtime from other processes.
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
#include <netdb.h>
#include <unistd.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
gpointer pa [1];
MonoImageOpenStatus open_status;
- agent_assembly = mono_assembly_open (agent, &open_status);
+ agent_assembly = mono_assembly_open_predicate (agent, FALSE, FALSE, NULL, NULL, &open_status);
if (!agent_assembly) {
fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status));
g_free (agent);
+/**
+ * \file
+ */
+
#ifndef __MONO_ATTACH_H__
#define __MONO_ATTACH_H__
-/*
- * attredefs.h: This file contains the various definitions for constants
+/**
+ * \file
+ * This file contains the various definitions for constants
* found on the metadata tables
*
* Author:
-/*
- * blob.h: Definitions used to pull information out of the Blob
+/**
+ * \file
+ * Definitions used to pull information out of the Blob
*
*/
#ifndef _MONO_METADATA_BLOB_H_
-/*
- * boehm-gc.c: GC implementation using either the installed or included Boehm GC.
+/**
+ * \file
+ * GC implementation using either the installed or included Boehm GC.
*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2011 Novell, Inc (http://www.novell.com)
/**
* mono_gc_collect:
- * @generation: GC generation identifier
+ * \param generation GC generation identifier
*
* Perform a garbage collection for the given generation, higher numbers
* mean usually older objects. Collecting a high-numbered generation
* implies collecting also the lower-numbered generations.
- * The maximum value for @generation can be retrieved with a call to
- * mono_gc_max_generation(), so this function is usually called as:
+ * The maximum value for \p generation can be retrieved with a call to
+ * \c mono_gc_max_generation, so this function is usually called as:
*
- * mono_gc_collect (mono_gc_max_generation ());
+ * <code>mono_gc_collect (mono_gc_max_generation ());</code>
*/
void
mono_gc_collect (int generation)
/**
* mono_gc_get_generation:
- * @object: a managed object
+ * \param object a managed object
*
- * Get the garbage collector's generation that @object belongs to.
+ * Get the garbage collector's generation that \p object belongs to.
* Use this has a hint only.
*
- * Returns: a garbage collector generation number
+ * \returns a garbage collector generation number
*/
int
mono_gc_get_generation (MonoObject *object)
/**
* mono_gc_collection_count:
- * @generation: a GC generation number
+ * \param generation a GC generation number
*
* Get how many times a garbage collection has been performed
- * for the given @generation number.
+ * for the given \p generation number.
*
- * Returns: the number of garbage collections
+ * \returns the number of garbage collections
*/
int
mono_gc_collection_count (int generation)
/**
* mono_gc_add_memory_pressure:
- * @value: amount of bytes
+ * \param value amount of bytes
*
* Adjust the garbage collector's view of how many bytes of memory
* are indirectly referenced by managed objects (for example unmanaged
* memory holding image or other binary data).
* This is a hint only to the garbage collector algorithm.
- * Note that negative amounts of @value will decrease the memory
+ * Note that negative amounts of p value will decrease the memory
* pressure.
*/
void
/**
* mono_gchandle_new:
- * @obj: managed object to get a handle for
- * @pinned: whether the object should be pinned
+ * \param obj managed object to get a handle for
+ * \param pinned whether the object should be pinned
*
* This returns a handle that wraps the object, this is used to keep a
* reference to a managed object from the unmanaged world and preventing the
* object from being disposed.
*
- * If @pinned is false the address of the object can not be obtained, if it is
+ * If \p pinned is false the address of the object can not be obtained, if it is
* true the address of the object can be obtained. This will also pin the
* object so it will not be possible by a moving garbage collector to move the
* object.
*
- * Returns: a handle that can be used to access the object from
+ * \returns a handle that can be used to access the object from
* unmanaged code.
*/
guint32
/**
* mono_gchandle_new_weakref:
- * @obj: managed object to get a handle for
- * @track_resurrection: Determines how long to track the object, if this is set to TRUE, the object is tracked after finalization, if FALSE, the object is only tracked up until the point of finalization.
+ * \param obj managed object to get a handle for
+ * \param track_resurrection Determines how long to track the object, if this is set to TRUE, the object is tracked after finalization, if FALSE, the object is only tracked up until the point of finalization.
*
* This returns a weak handle that wraps the object, this is used to
* keep a reference to a managed object from the unmanaged world.
- * Unlike the mono_gchandle_new the object can be reclaimed by the
+ * Unlike the \c mono_gchandle_new the object can be reclaimed by the
* garbage collector. In this case the value of the GCHandle will be
* set to zero.
*
- * If @track_resurrection is TRUE the object will be tracked through
+ * If \p track_resurrection is TRUE the object will be tracked through
* finalization and if the object is resurrected during the execution
* of the finalizer, then the returned weakref will continue to hold
- * a reference to the object. If @track_resurrection is FALSE, then
+ * a reference to the object. If \p track_resurrection is FALSE, then
* the weak reference's target will become NULL as soon as the object
* is passed on to the finalizer.
*
- * Returns: a handle that can be used to access the object from
+ * \returns a handle that can be used to access the object from
* unmanaged code.
*/
guint32
/**
* mono_gchandle_get_target:
- * @gchandle: a GCHandle's handle.
+ * \param gchandle a GCHandle's handle.
*
- * The handle was previously created by calling `mono_gchandle_new` or
- * `mono_gchandle_new_weakref`.
+ * The handle was previously created by calling \c mono_gchandle_new or
+ * \c mono_gchandle_new_weakref.
*
- * Returns: A pointer to the `MonoObject*` represented by the handle or
+ * \returns A pointer to the \c MonoObject* represented by the handle or
* NULL for a collected object if using a weakref handle.
*/
MonoObject*
/**
* mono_gchandle_is_in_domain:
- * @gchandle: a GCHandle's handle.
- * @domain: An application domain.
+ * \param gchandle a GCHandle's handle.
+ * \param domain An application domain.
*
- * Use this function to determine if the @gchandle points to an
- * object allocated in the specified @domain.
+ * Use this function to determine if the \p gchandle points to an
+ * object allocated in the specified \p domain.
*
- * Returns: TRUE if the object wrapped by the @gchandle belongs to the specific @domain.
+ * \returns TRUE if the object wrapped by the \p gchandle belongs to the specific \p domain.
*/
gboolean
mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain)
/**
* mono_gchandle_free:
- * @gchandle: a GCHandle's handle.
+ * \param gchandle a GCHandle's handle.
*
- * Frees the @gchandle handle. If there are no outstanding
+ * Frees the \p gchandle handle. If there are no outstanding
* references, the garbage collector can reclaim the memory of the
* object wrapped.
*/
/**
* mono_gchandle_free_domain:
- * @domain: domain that is unloading
+ * \param domain domain that is unloading
*
* Function used internally to cleanup any GC handle for objects belonging
* to the specified domain during appdomain unload.
+/**
+ * \file
+ */
#ifndef __MONO_CIL_COFF_H__
#define __MONO_CIL_COFF_H__
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/**
* mono_class_get_flags:
- * @klass: the MonoClass to act on
- *
- * Return the TypeAttributes flags of @klass.
- * See the TYPE_ATTRIBUTE_* definitions on tabledefs.h for the different values.
- *
- * Returns: The type flags
+ * \param klass the MonoClass to act on
+ * \returns the \c TypeAttributes flags of \p klass.
+ * See the \c TYPE_ATTRIBUTE_* definitions in \c tabledefs.h for the different values.
*/
guint32
mono_class_get_flags (MonoClass *klass)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
+/**
+ * \file
* Copyright 2012 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * class.c: Class management for the Mono runtime
+/**
+ * \file
+ * Class management for the Mono runtime
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
/**
* mono_class_from_typeref:
- * @image: a MonoImage
- * @type_token: a TypeRef token
+ * \param image a MonoImage
+ * \param type_token a TypeRef token
*
- * Creates the MonoClass* structure representing the type defined by
- * the typeref token valid inside @image.
- * Returns: The MonoClass* representing the typeref token, NULL ifcould
+ * Creates the \c MonoClass* structure representing the type defined by
+ * the typeref token valid inside \p image.
+ * \returns The \c MonoClass* representing the typeref token, or NULL if it could
* not be loaded.
*/
MonoClass *
/**
* mono_class_from_typeref_checked:
- * @image: a MonoImage
- * @type_token: a TypeRef token
- * @error: error return code, if any.
+ * \param image a MonoImage
+ * \param type_token a TypeRef token
+ * \param error error return code, if any.
*
- * Creates the MonoClass* structure representing the type defined by
- * the typeref token valid inside @image.
+ * Creates the \c MonoClass* structure representing the type defined by
+ * the typeref token valid inside \p image.
*
- * Returns: The MonoClass* representing the typeref token, NULL if it could
- * not be loaded with the @error value filled with the information about the
+ * \returns The \c MonoClass* representing the typeref token, NULL if it could
+ * not be loaded with the \p error value filled with the information about the
* error.
*/
MonoClass *
if (!res && mono_error_ok (error)) {
char *name = mono_class_name_from_token (image, type_token);
char *assembly = mono_assembly_name_from_token (image, type_token);
- mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
+ mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x (from typeref, class/assembly %s, %s)", type_token, name, assembly);
}
return res;
}
/**
* mono_identifier_escape_type_name_chars:
- * @str: a destination string
- * @identifier: an IDENTIFIER in internal form
+ * \param str a destination string
+ * \param identifier an IDENTIFIER in internal form
*
- * Returns: str.
+ * \returns \p str
*
* The displayed form of the identifier is appended to str.
*
/**
* mono_type_get_name_full:
- * @type: a type
- * @format: the format for the return string.
+ * \param type a type
+ * \param format the format for the return string.
*
*
- * Returns: The string representation in a number of formats:
+ * \returns The string representation in a number of formats:
*
- * if format is MONO_TYPE_NAME_FORMAT_REFLECTION, the return string is
- * returned in the formatrequired by System.Reflection, this is the
- * inverse of mono_reflection_parse_type ().
+ * if \p format is \c MONO_TYPE_NAME_FORMAT_REFLECTION, the return string is
+ * returned in the format required by \c System.Reflection, this is the
+ * inverse of mono_reflection_parse_type().
*
- * if format is MONO_TYPE_NAME_FORMAT_IL, it returns a syntax that can
+ * if \p format is \c MONO_TYPE_NAME_FORMAT_IL, it returns a syntax that can
* be used by the IL assembler.
*
- * if format is MONO_TYPE_NAME_FORMAT_FULL_NAME
+ * if \p format is \c MONO_TYPE_NAME_FORMAT_FULL_NAME
*
- * if format is MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
+ * if \p format is \c MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
*/
char*
mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format)
/**
* mono_type_get_full_name:
- * @class: a class
+ * \param class a class
*
- * Returns: The string representation for type as required by System.Reflection.
- * The inverse of mono_reflection_parse_type ().
+ * \returns The string representation for type as required by System.Reflection.
+ * The inverse of mono_reflection_parse_type().
*/
char *
mono_type_get_full_name (MonoClass *klass)
/**
* mono_type_get_name:
- * @type: a type
- *
- * Returns: The string representation for type as it would be represented in IL code.
+ * \param type a type
+ * \returns The string representation for type as it would be represented in IL code.
*/
char*
mono_type_get_name (MonoType *type)
return mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_IL);
}
-/*
+/**
* mono_type_get_underlying_type:
- * @type: a type
- *
- * Returns: The MonoType for the underlying integer type if @type
+ * \param type a type
+ * \returns The \c MonoType for the underlying integer type if \p type
* is an enum and byref is false, otherwise the type itself.
*/
MonoType*
/**
* mono_class_is_open_constructed_type:
- * @type: a type
+ * \param type a type
*
- * Returns: TRUE if type represents a generics open constructed type.
+ * \returns TRUE if type represents a generics open constructed type.
* IOW, not all type parameters required for the instantiation have
* been provided or it's a generic type definition.
*
return inflated;
}
-/*
+/**
* mono_class_inflate_generic_type:
- * @type: a type
- * @context: a generics context
+ * \param type a type
+ * \param context a generics context
+ * \deprecated Please use \c mono_class_inflate_generic_type_checked instead
*
- * If @type is a generic type and @context is not NULL, instantiate it using the
- * generics context @context.
+ * If \p type is a generic type and \p context is not NULL, instantiate it using the
+ * generics context \p context.
*
- * Returns: The instantiated type or a copy of @type. The returned MonoType is allocated
+ * \returns The instantiated type or a copy of \p type. The returned \c MonoType is allocated
* on the heap and is owned by the caller. Returns NULL on error.
- *
- * @deprecated Please use mono_class_inflate_generic_type_checked instead
*/
MonoType*
mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context)
return res;
}
-/*
+/**
* mono_class_inflate_generic_method:
- * @method: a generic method
- * @context: a generics context
+ * \param method a generic method
+ * \param context a generics context
*
- * Instantiate the generic method @method using the generics context @context.
+ * Instantiate the generic method \p method using the generics context \p context.
*
- * Returns: The new instantiated method
+ * \returns The new instantiated method
*/
MonoMethod *
mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context)
/**
* mono_class_inflate_generic_method_full:
*
- * Instantiate method @method with the generic context @context.
+ * Instantiate method \p method with the generic context \p context.
* BEWARE: All non-trivial fields are invalid, including klass, signature, and header.
- * Use mono_method_signature () and mono_method_get_header () to get the correct values.
+ * Use mono_method_signature() and mono_method_get_header() to get the correct values.
*/
MonoMethod*
mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context)
/**
* mono_class_inflate_generic_method_full_checked:
- * Same as mono_class_inflate_generic_method_full but return failure using @error.
+ * Same as mono_class_inflate_generic_method_full but return failure using \p error.
*/
MonoMethod*
mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *klass_hint, MonoGenericContext *context, MonoError *error)
/**
* mono_class_find_enum_basetype:
- * @class: The enum class
+ * \param class The enum class
*
* Determine the basetype of an enum by iterating through its fields. We do this
* in a separate function since it is cheaper than calling mono_class_setup_fields.
/**
* mono_class_setup_basic_field_info:
- * @class: The class to initialize
+ * \param class The class to initialize
*
* Initializes the following fields in MonoClass:
* * klass->fields (only field->parent and field->name)
/**
* mono_class_set_failure_causedby_class:
- * @klass: the class that is failing
- * @caused_by: the class that caused the failure
- * @msg: Why @klass is failing.
+ * \param klass the class that is failing
+ * \param caused_by the class that caused the failure
+ * \param msg Why \p klass is failing.
*
- * If @caused_by has a failure, sets a TypeLoadException failure on
- * @klass with message "@msg, due to: {@caused_by message}".
+ * If \p caused_by has a failure, sets a TypeLoadException failure on
+ * \p klass with message "\p msg, due to: {\p caused_by message}".
*
- * Returns: TRUE if a failiure was set, or FALSE if @caused_by doesn't have a failure.
+ * \returns TRUE if a failiure was set, or FALSE if \p caused_by doesn't have a failure.
*/
static gboolean
mono_class_set_type_load_failure_causedby_class (MonoClass *klass, const MonoClass *caused_by, const gchar* msg)
/**
* mono_class_setup_fields:
- * @klass: The class to initialize
+ * \p klass The class to initialize
*
* Initializes klass->fields, computes class layout and sizes.
* typebuilder_setup_fields () is the corresponding function for dynamic classes.
- * Sets the following fields in @klass:
+ * Sets the following fields in \p klass:
* - all the fields initialized by mono_class_init_sizes ()
* - element_class/cast_class (for enums)
* - field->type/offset for all fields
/**
* mono_get_unique_iid:
- * @class: interface
+ * \param klass interface
*
- * Assign a unique integer ID to the interface represented by @class.
+ * Assign a unique integer ID to the interface represented by \p klass.
* The ID will positive and as small as possible.
* LOCKING: Acquires the classes lock.
- * Returns: The new ID.
+ * \returns The new ID.
*/
static guint32
mono_get_unique_iid (MonoClass *klass)
/**
* mono_class_interface_offset_with_variance:
*
- * Return the interface offset of @itf in @klass. Sets @non_exact_match to TRUE if the match required variance check
- * If @itf is an interface with generic variant arguments, try to find the compatible one.
+ * Return the interface offset of \p itf in \p klass. Sets \p non_exact_match to TRUE if the match required variance check
+ * If \p itf is an interface with generic variant arguments, try to find the compatible one.
*
* Note that this function is responsible for resolving ambiguities. Right now we use whatever ordering interfaces_packed gives us.
*
/**
* mono_compress_bitmap:
- * @dest: destination buffer
- * @bitmap: bitmap buffer
- * @size: size of @bitmap in bytes
+ * \param dest destination buffer
+ * \param bitmap bitmap buffer
+ * \param size size of \p bitmap in bytes
*
* This is a mono internal function.
- * The @bitmap data is compressed into a format that is small but
+ * The \p bitmap data is compressed into a format that is small but
* still searchable in few instructions by the JIT and runtime.
* The compressed data is stored in the buffer pointed to by the
- * @dest array. Passing a #NULL value for @dest allows to just compute
+ * \p dest array. Passing a NULL value for \p dest allows to just compute
* the size of the buffer.
* This compression algorithm assumes the bits set in the bitmap are
* few and far between, like in interface bitmaps.
- * Returns: The size of the compressed bitmap in bytes.
+ * \returns The size of the compressed bitmap in bytes.
*/
int
mono_compress_bitmap (uint8_t *dest, const uint8_t *bitmap, int size)
/**
* mono_class_interface_match:
- * @bitmap: a compressed bitmap buffer
- * @id: the index to check in the bitmap
+ * \param bitmap a compressed bitmap buffer
+ * \param id the index to check in the bitmap
*
* This is a mono internal function.
- * Checks if a bit is set in a compressed interface bitmap. @id must
+ * Checks if a bit is set in a compressed interface bitmap. \p id must
* be already checked for being smaller than the maximum id encoded in the
* bitmap.
*
- * Returns: A non-zero value if bit @id is set in the bitmap @bitmap,
- * #FALSE otherwise.
+ * \returns A non-zero value if bit \p id is set in the bitmap \p bitmap,
+ * FALSE otherwise.
*/
int
mono_class_interface_match (const uint8_t *bitmap, int id)
/**
* mono_method_get_vtable_index:
- * @method: a method
+ * \param method a method
*
* Returns the index into the runtime vtable to access the method or,
* in the case of a virtual generic method, the virtual generic method
/**
* mono_class_init:
- * @klass: the class to initialize
+ * \param klass the class to initialize
*
- * Compute the instance_size, class_size and other infos that cannot be
- * computed at mono_class_get() time. Also compute vtable_size if possible.
- * Returns TRUE on success or FALSE if there was a problem in loading
- * the type (incorrect assemblies, missing assemblies, methods, etc).
- * Initializes the following fields in @klass:
- * - all the fields initialized by mono_class_init_sizes ()
+ * Compute the \c instance_size, \c class_size and other infos that cannot be
+ * computed at \c mono_class_get time. Also compute vtable_size if possible.
+ * Initializes the following fields in \p klass:
+ * - all the fields initialized by \c mono_class_init_sizes
* - has_cctor
* - ghcimpl
* - inited
*
* LOCKING: Acquires the loader lock.
+ *
+ * \returns TRUE on success or FALSE if there was a problem in loading
+ * the type (incorrect assemblies, missing assemblies, methods, etc).
*/
gboolean
mono_class_init (MonoClass *klass)
/**
* mono_class_create_from_typedef:
- * @image: image where the token is valid
- * @type_token: typedef token
- * @error: used to return any error found while creating the type
+ * \param image: image where the token is valid
+ * \param type_token: typedef token
+ * \param error: used to return any error found while creating the type
*
* Create the MonoClass* representing the specified type token.
- * @type_token must be a TypeDef token.
+ * \p type_token must be a TypeDef token.
*
* FIXME: don't return NULL on failure, just the the caller figure it out.
*/
/**
* mono_class_from_generic_parameter:
- * @param: Parameter to find/construct a class for.
- * @arg2: Is ignored.
- * @arg3: Is ignored.
+ * \param param Parameter to find/construct a class for.
+ * \param arg2 Is ignored.
+ * \param arg3 Is ignored.
*/
MonoClass *
mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *arg2 G_GNUC_UNUSED, gboolean arg3 G_GNUC_UNUSED)
return mono_class_from_generic_parameter_internal (param);
}
+/**
+ * mono_ptr_class_get:
+ */
MonoClass *
mono_ptr_class_get (MonoType *type)
{
/**
* mono_class_from_mono_type:
- * @type: describes the type to return
- *
- * This returns a MonoClass for the specified MonoType, the value is never NULL.
+ * \param type describes the type to return
+ * \returns a \c MonoClass for the specified \c MonoType, the value is never NULL.
*/
MonoClass *
mono_class_from_mono_type (MonoType *type)
/**
* mono_type_retrieve_from_typespec
- * @image: context where the image is created
- * @type_spec: typespec token
- * @context: the generic context used to evaluate generic instantiations in
+ * \param image context where the image is created
+ * \param type_spec typespec token
+ * \param context the generic context used to evaluate generic instantiations in
*/
static MonoType *
mono_type_retrieve_from_typespec (MonoImage *image, guint32 type_spec, MonoGenericContext *context, gboolean *did_inflate, MonoError *error)
/**
* mono_class_create_from_typespec
- * @image: context where the image is created
- * @type_spec: typespec token
- * @context: the generic context used to evaluate generic instantiations in
+ * \param image context where the image is created
+ * \param type_spec typespec token
+ * \param context the generic context used to evaluate generic instantiations in
*/
static MonoClass *
mono_class_create_from_typespec (MonoImage *image, guint32 type_spec, MonoGenericContext *context, MonoError *error)
/**
* mono_bounded_array_class_get:
- * @element_class: element class
- * @rank: the dimension of the array class
- * @bounded: whenever the array has non-zero bounds
- *
- * Returns: A class object describing the array with element type @element_type and
- * dimension @rank.
+ * \param element_class element class
+ * \param rank the dimension of the array class
+ * \param bounded whenever the array has non-zero bounds
+ * \returns A class object describing the array with element type \p element_type and
+ * dimension \p rank.
*/
MonoClass *
mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
/**
* mono_array_class_get:
- * @element_class: element class
- * @rank: the dimension of the array class
- *
- * Returns: A class object describing the array with element type @element_type and
- * dimension @rank.
+ * \param element_class element class
+ * \param rank the dimension of the array class
+ * \returns A class object describing the array with element type \p element_type and
+ * dimension \p rank.
*/
MonoClass *
mono_array_class_get (MonoClass *eclass, guint32 rank)
/**
* mono_class_instance_size:
- * @klass: a class
+ * \param klass a class
*
* Use to get the size of a class in bytes.
*
- * Returns: The size of an object instance
+ * \returns The size of an object instance
*/
gint32
mono_class_instance_size (MonoClass *klass)
/**
* mono_class_min_align:
- * @klass: a class
+ * \param klass a class
*
* Use to get the computed minimum alignment requirements for the specified class.
*
/**
* mono_class_value_size:
- * @klass: a class
+ * \param klass a class
*
* This function is used for value types, and return the
* space and the alignment to store that kind of value object.
*
- * Returns: the size of a value of kind @klass
+ * \returns the size of a value of kind \p klass
*/
gint32
mono_class_value_size (MonoClass *klass, guint32 *align)
/**
* mono_class_data_size:
- * @klass: a class
+ * \param klass a class
*
- * Returns: The size of the static class data
+ * \returns The size of the static class data
*/
gint32
mono_class_data_size (MonoClass *klass)
/**
* mono_class_get_field:
- * @class: the class to lookup the field.
- * @field_token: the field token
+ * \param class the class to lookup the field.
+ * \param field_token the field token
*
- * Returns: A MonoClassField representing the type and offset of
+ * \returns A \c MonoClassField representing the type and offset of
* the field, or a NULL value if the field does not belong to this
* class.
*/
/**
* mono_class_get_field_from_name:
- * @klass: the class to lookup the field.
- * @name: the field name
+ * \param klass the class to lookup the field.
+ * \param name the field name
*
- * Search the class @klass and it's parents for a field with the name @name.
+ * Search the class \p klass and its parents for a field with the name \p name.
*
- * Returns: The MonoClassField pointer of the named field or NULL
+ * \returns The \c MonoClassField pointer of the named field or NULL
*/
MonoClassField *
mono_class_get_field_from_name (MonoClass *klass, const char *name)
/**
* mono_class_get_field_from_name_full:
- * @klass: the class to lookup the field.
- * @name: the field name
- * @type: the type of the fields. This optional.
+ * \param klass the class to lookup the field.
+ * \param name the field name
+ * \param type the type of the fields. This optional.
*
- * Search the class @klass and it's parents for a field with the name @name and type @type.
+ * Search the class \p klass and it's parents for a field with the name \p name and type \p type.
*
- * If @klass is an inflated generic type, the type comparison is done with the equivalent field
+ * If \p klass is an inflated generic type, the type comparison is done with the equivalent field
* of its generic type definition.
*
- * Returns: The MonoClassField pointer of the named field or NULL
+ * \returns The MonoClassField pointer of the named field or NULL
*/
MonoClassField *
mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoType *type)
/**
* mono_class_get_field_token:
- * @field: the field we need the token of
+ * \param field the field we need the token of
*
* Get the token of a field. Note that the tokesn is only valid for the image
* the field was loaded from. Don't use this function for fields in dynamic types.
*
- * Returns: The token representing the field in the image it was loaded from.
+ * \returns The token representing the field in the image it was loaded from.
*/
guint32
mono_class_get_field_token (MonoClassField *field)
return (const char *)mono_metadata_blob_heap (klass->image, constant_cols [MONO_CONSTANT_VALUE]);
}
+/**
+ * mono_class_get_event_token:
+ */
guint32
mono_class_get_event_token (MonoEvent *event)
{
/**
* mono_class_get_property_from_name:
- * @klass: a class
- * @name: name of the property to lookup in the specified class
+ * \param klass a class
+ * \param name name of the property to lookup in the specified class
*
* Use this method to lookup a property in a class
- * Returns: the MonoProperty with the given name, or NULL if the property
- * does not exist on the @klass.
+ * \returns the \c MonoProperty with the given name, or NULL if the property
+ * does not exist on the \p klass.
*/
MonoProperty*
mono_class_get_property_from_name (MonoClass *klass, const char *name)
/**
* mono_class_get_property_token:
- * @prop: MonoProperty to query
+ * \param prop MonoProperty to query
*
- * Returns: The ECMA token for the specified property.
+ * \returns The ECMA token for the specified property.
*/
guint32
mono_class_get_property_token (MonoProperty *prop)
return 0;
}
+/**
+ * mono_class_name_from_token:
+ */
char *
mono_class_name_from_token (MonoImage *image, guint32 type_token)
{
/**
* mono_class_get_full:
- * @image: the image where the class resides
- * @type_token: the token for the class
- * @context: the generic context used to evaluate generic instantiations in
- * @deprecated: Functions that expose MonoGenericContext are going away in mono 4.0
- *
- * Returns: The MonoClass that represents @type_token in @image
+ * \param image the image where the class resides
+ * \param type_token the token for the class
+ * \param context the generic context used to evaluate generic instantiations in
+ * \deprecated Functions that expose \c MonoGenericContext are going away in mono 4.0
+ * \returns The \c MonoClass that represents \p type_token in \p image
*/
MonoClass *
mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context)
}
/**
* mono_class_get_checked:
- * @image: the image where the class resides
- * @type_token: the token for the class
- * @error: error object to return any error
+ * \param image the image where the class resides
+ * \param type_token the token for the class
+ * \param error error object to return any error
*
- * Returns: The MonoClass that represents @type_token in @image, or NULL on error.
+ * \returns The MonoClass that represents \p type_token in \p image, or NULL on error.
*/
MonoClass *
mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
if (!klass && mono_error_ok (error)) {
char *name = mono_class_name_from_token (image, type_token);
char *assembly = mono_assembly_name_from_token (image, type_token);
- mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
+ mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x (class/assembly %s, %s)", type_token, name, assembly);
}
return klass;
/**
* mono_type_get_checked:
- * @image: the image where the type resides
- * @type_token: the token for the type
- * @context: the generic context used to evaluate generic instantiations in
- * @error: Error handling context
+ * \param image the image where the type resides
+ * \param type_token the token for the type
+ * \param context the generic context used to evaluate generic instantiations in
+ * \param error Error handling context
*
* This functions exists to fullfill the fact that sometimes it's desirable to have access to the
*
- * Returns: The MonoType that represents @type_token in @image
+ * \returns The MonoType that represents \p type_token in \p image
*/
MonoType *
mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error)
/**
* mono_class_get:
- * @image: image where the class token will be looked up.
- * @type_token: a type token from the image
- *
- * Returns the MonoClass with the given @type_token on the @image
+ * \param image image where the class token will be looked up.
+ * \param type_token a type token from the image
+ * \returns the \c MonoClass with the given \p type_token on the \p image
*/
MonoClass *
mono_class_get (MonoImage *image, guint32 type_token)
}
/*FIXME Only dynamic assemblies should allow this operation.*/
+/**
+ * mono_image_add_to_name_cache:
+ */
void
mono_image_add_to_name_cache (MonoImage *image, const char *nspace,
const char *name, guint32 index)
/**
* mono_class_from_name_case:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
- * @deprecated: use the mono_class_from_name_case_checked variant instead.
+ * \param image The MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
+ * \deprecated use the mono_class_from_name_case_checked variant instead.
*
- * Obtains a MonoClass with a given namespace and a given name which
- * is located in the given MonoImage. The namespace and name
+ * Obtains a \c MonoClass with a given namespace and a given name which
+ * is located in the given \c MonoImage. The namespace and name
* lookups are case insensitive.
*/
MonoClass *
}
/**
- * mono_class_from_name_case:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
- * @error: if
+ * mono_class_from_name_case_checked:
+ * \param image The MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
+ * \param error if
*
* Obtains a MonoClass with a given namespace and a given name which
* is located in the given MonoImage. The namespace and name
* lookups are case insensitive.
*
- * Returns: The MonoClass if the given namespace and name were found, or NULL if it
- * was not found. The @error object will contain information about the problem
+ * \returns The MonoClass if the given namespace and name were found, or NULL if it
+ * was not found. The \p error object will contain information about the problem
* in that case.
*/
MonoClass *
/**
* mono_class_from_name_checked:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
+ * \param image The MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
*
* Obtains a MonoClass with a given namespace and a given name which
* is located in the given MonoImage.
/**
* mono_class_from_name:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
+ * \param image The \c MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
*
- * Obtains a MonoClass with a given namespace and a given name which
- * is located in the given MonoImage.
+ * Obtains a \c MonoClass with a given namespace and a given name which
+ * is located in the given \c MonoImage.
*
* To reference nested classes, use the "/" character as a separator.
- * For example use "Foo/Bar" to reference the class Bar that is nested
- * inside Foo, like this: "class Foo { class Bar {} }".
+ * For example use \c "Foo/Bar" to reference the class \c Bar that is nested
+ * inside \c Foo, like this: "class Foo { class Bar {} }".
*/
MonoClass *
mono_class_from_name (MonoImage *image, const char* name_space, const char *name)
/**
* mono_class_load_from_name:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
+ * \param image The MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
*
* This function works exactly like mono_class_from_name but it will abort if the class is not found.
* This function should be used by the runtime for critical types to which there's no way to recover but crash
/**
* mono_class_try_load_from_name:
- * @image: The MonoImage where the type is looked up in
- * @name_space: the type namespace
- * @name: the type short name.
+ * \param image The MonoImage where the type is looked up in
+ * \param name_space the type namespace
+ * \param name the type short name.
*
* This function tries to load a type, returning the class was found or NULL otherwise.
* This function should be used by the runtime when probing for optional types, those that could have being linked out.
/**
* mono_class_is_subclass_of:
- * @klass: class to probe if it is a subclass of another one
- * @klassc: the class we suspect is the base class
- * @check_interfaces: whether we should perform interface checks
+ * \param klass class to probe if it is a subclass of another one
+ * \param klassc the class we suspect is the base class
+ * \param check_interfaces whether we should perform interface checks
*
- * This method determines whether @klass is a subclass of @klassc.
+ * This method determines whether \p klass is a subclass of \p klassc.
*
- * If the @check_interfaces flag is set, then if @klassc is an interface
- * this method return TRUE if the @klass implements the interface or
- * if @klass is an interface, if one of its base classes is @klass.
+ * If the \p check_interfaces flag is set, then if \p klassc is an interface
+ * this method return TRUE if the \p klass implements the interface or
+ * if \p klass is an interface, if one of its base classes is \p klass.
*
- * If @check_interfaces is false then, then if @klass is not an interface
- * then it returns TRUE if the @klass is a subclass of @klassc.
+ * If \p check_interfaces is false, then if \p klass is not an interface,
+ * it returns TRUE if the \p klass is a subclass of \p klassc.
*
- * if @klass is an interface and @klassc is System.Object, then this function
- * return true.
+ * if \p klass is an interface and \p klassc is \c System.Object, then this function
+ * returns TRUE.
*
*/
gboolean
/**
* mono_class_is_assignable_from:
- * @klass: the class to be assigned to
- * @oklass: the source class
+ * \param klass the class to be assigned to
+ * \param oklass the source class
*
- * Returns: TRUE if an instance of object oklass can be assigned to an
- * instance of object @klass
+ * \returns TRUE if an instance of class \p oklass can be assigned to an
+ * instance of class \p klass
*/
gboolean
mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass)
/**
* mono_class_get_cctor:
- * @klass: A MonoClass pointer
+ * \param klass A MonoClass pointer
*
- * Returns: The static constructor of @klass if it exists, NULL otherwise.
+ * \returns The static constructor of \p klass if it exists, NULL otherwise.
*/
MonoMethod*
mono_class_get_cctor (MonoClass *klass)
/**
* mono_class_get_finalizer:
- * @klass: The MonoClass pointer
+ * \param klass: The MonoClass pointer
*
- * Returns: The finalizer method of @klass if it exists, NULL otherwise.
+ * \returns The finalizer method of \p klass if it exists, NULL otherwise.
*/
MonoMethod*
mono_class_get_finalizer (MonoClass *klass)
/**
* mono_class_needs_cctor_run:
- * @klass: the MonoClass pointer
- * @caller: a MonoMethod describing the caller
+ * \param klass the MonoClass pointer
+ * \param caller a MonoMethod describing the caller
*
* Determines whenever the class has a static constructor and whenever it
* needs to be called when executing CALLER.
/**
* mono_class_array_element_size:
- * @klass:
+ * \param klass
*
- * Returns: The number of bytes an element of type @klass
- * uses when stored into an array.
+ * \returns The number of bytes an element of type \p klass uses when stored into an array.
*/
gint32
mono_class_array_element_size (MonoClass *klass)
/**
* mono_array_element_size:
- * @ac: pointer to a #MonoArrayClass
+ * \param ac pointer to a \c MonoArrayClass
*
- * Returns: The size of single array element.
+ * \returns The size of single array element.
*/
gint32
mono_array_element_size (MonoClass *ac)
return ac->sizes.element_size;
}
+/**
+ * mono_ldtoken:
+ */
gpointer
mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class,
MonoGenericContext *context)
/**
* mono_class_get_image:
*
- * Use this method to get the `MonoImage*` where this class came from.
+ * Use this method to get the \c MonoImage* where this class came from.
*
- * Returns: The image where this class is defined.
+ * \returns The image where this class is defined.
*/
MonoImage*
mono_class_get_image (MonoClass *klass)
/**
* mono_class_get_element_class:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* Use this function to get the element class of an array.
*
- * Returns: The element class of an array.
+ * \returns The element class of an array.
*/
MonoClass*
mono_class_get_element_class (MonoClass *klass)
/**
* mono_class_is_valuetype:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Use this method to determine if the provided `MonoClass*` represents a value type,
+ * Use this method to determine if the provided \c MonoClass* represents a value type,
* or a reference type.
*
- * Returns: TRUE if the MonoClass represents a ValueType, FALSE if it represents a reference type.
+ * \returns TRUE if the \c MonoClass represents a \c ValueType, FALSE if it represents a reference type.
*/
gboolean
mono_class_is_valuetype (MonoClass *klass)
/**
* mono_class_is_enum:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Use this function to determine if the provided `MonoClass*` represents an enumeration.
+ * Use this function to determine if the provided \c MonoClass* represents an enumeration.
*
- * Returns: TRUE if the MonoClass represents an enumeration.
+ * \returns TRUE if the \c MonoClass represents an enumeration.
*/
gboolean
mono_class_is_enum (MonoClass *klass)
/**
* mono_class_enum_basetype:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* Use this function to get the underlying type for an enumeration value.
*
- * Returns: The underlying type representation for an enumeration.
+ * \returns The underlying type representation for an enumeration.
*/
MonoType*
mono_class_enum_basetype (MonoClass *klass)
/**
* mono_class_get_parent
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The parent class for this class.
+ * \returns The parent class for this class.
*/
MonoClass*
mono_class_get_parent (MonoClass *klass)
/**
* mono_class_get_nesting_type:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Use this function to obtain the class that the provided `MonoClass*` is nested on.
+ * Use this function to obtain the class that the provided \c MonoClass* is nested on.
*
* If the return is NULL, this indicates that this class is not nested.
*
- * Returns: The container type where this type is nested or NULL if this type is not a nested type.
+ * \returns The container type where this type is nested or NULL if this type is not a nested type.
*/
MonoClass*
mono_class_get_nesting_type (MonoClass *klass)
/**
* mono_class_get_rank:
- * @klass: the MonoClass to act on
+ * \param klass the MonoClass to act on
*
- * Returns: The rank for the array (the number of dimensions).
+ * \returns The rank for the array (the number of dimensions).
*/
int
mono_class_get_rank (MonoClass *klass)
/**
* mono_class_get_name
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The name of the class.
+ * \returns The name of the class.
*/
const char*
mono_class_get_name (MonoClass *klass)
/**
* mono_class_get_namespace:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The namespace of the class.
+ * \returns The namespace of the class.
*/
const char*
mono_class_get_namespace (MonoClass *klass)
/**
* mono_class_get_type:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * This method returns the internal Type representation for the class.
+ * This method returns the internal \c MonoType representation for the class.
*
- * Returns: The MonoType from the class.
+ * \returns The \c MonoType from the class.
*/
MonoType*
mono_class_get_type (MonoClass *klass)
/**
* mono_class_get_type_token:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This method returns type token for the class.
*
- * Returns: The type token for the class.
+ * \returns The type token for the class.
*/
guint32
mono_class_get_type_token (MonoClass *klass)
/**
* mono_class_get_byref_type:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
*
*/
/**
* mono_class_num_fields:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The number of static and instance fields in the class.
+ * \returns The number of static and instance fields in the class.
*/
int
mono_class_num_fields (MonoClass *klass)
/**
* mono_class_num_methods:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The number of methods in the class.
+ * \returns The number of methods in the class.
*/
int
mono_class_num_methods (MonoClass *klass)
/**
* mono_class_num_properties
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The number of properties in the class.
+ * \returns The number of properties in the class.
*/
int
mono_class_num_properties (MonoClass *klass)
/**
* mono_class_num_events:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: The number of events in the class.
+ * \returns The number of events in the class.
*/
int
mono_class_num_events (MonoClass *klass)
/**
* mono_class_get_fields:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the fields in a class.
*
- * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * You must pass a \c gpointer that points to zero and is treated as an opaque handle to
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @MonoClassField* on each iteration, or NULL when no more fields are available.
+ * \returns a \c MonoClassField* on each iteration, or NULL when no more fields are available.
*/
MonoClassField*
mono_class_get_fields (MonoClass* klass, gpointer *iter)
}
/**
- * mono_class_get_methods
- * @klass: the MonoClass to act on
+ * mono_class_get_methods:
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the fields in a class.
*
- * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * You must pass a \c gpointer that points to zero and is treated as an opaque handle to
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a MonoMethod on each iteration or NULL when no more methods are available.
+ * \returns a \c MonoMethod on each iteration or NULL when no more methods are available.
*/
MonoMethod*
mono_class_get_methods (MonoClass* klass, gpointer *iter)
/**
* mono_class_get_properties:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the properties in a class.
*
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @MonoProperty* on each invocation, or NULL when no more are available.
+ * Returns: a \c MonoProperty* on each invocation, or NULL when no more are available.
*/
MonoProperty*
mono_class_get_properties (MonoClass* klass, gpointer *iter)
/**
* mono_class_get_events:
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the properties in a class.
*
- * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * You must pass a \c gpointer that points to zero and is treated as an opaque handle to
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @MonoEvent* on each invocation, or NULL when no more are available.
+ * \returns a \c MonoEvent* on each invocation, or NULL when no more are available.
*/
MonoEvent*
mono_class_get_events (MonoClass* klass, gpointer *iter)
/**
* mono_class_get_interfaces
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the interfaces implemented by this class.
*
- * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * You must pass a \c gpointer that points to zero and is treated as an opaque handle to
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @Monoclass* on each invocation, or NULL when no more are available.
+ * \returns a \c MonoClass* on each invocation, or NULL when no more are available.
*/
MonoClass*
mono_class_get_interfaces (MonoClass* klass, gpointer *iter)
/**
* mono_class_get_nested_types
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
* This routine is an iterator routine for retrieving the nested types of a class.
- * This works only if @klass is non-generic, or a generic type definition.
+ * This works only if \p klass is non-generic, or a generic type definition.
*
- * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * You must pass a \c gpointer that points to zero and is treated as an opaque handle to
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @Monoclass* on each invocation, or NULL when no more are available.
+ * \returns a \c Monoclass* on each invocation, or NULL when no more are available.
*/
MonoClass*
mono_class_get_nested_types (MonoClass* klass, gpointer *iter)
/**
* mono_class_is_delegate
- * @klass: the MonoClass to act on
+ * \param klass the \c MonoClass to act on
*
- * Returns: TRUE if the MonoClass represents a System.Delegate.
+ * \returns TRUE if the \c MonoClass represents a \c System.Delegate.
*/
mono_bool
mono_class_is_delegate (MonoClass *klass)
/**
* mono_class_implements_interface
- * @klass: The MonoClass to act on
- * @interface: The interface to check if @klass implements.
+ * \param klass The MonoClass to act on
+ * \param interface The interface to check if \p klass implements.
*
- * Returns: TRUE if @klass implements @interface.
+ * \returns TRUE if \p klass implements \p interface.
*/
mono_bool
mono_class_implements_interface (MonoClass* klass, MonoClass* iface)
/**
* mono_field_get_name:
- * @field: the MonoClassField to act on
+ * \param field the \c MonoClassField to act on
*
- * Returns: The name of the field.
+ * \returns The name of the field.
*/
const char*
mono_field_get_name (MonoClassField *field)
/**
* mono_field_get_type:
- * @field: the MonoClassField to act on
- *
- * Returns: MonoType of the field.
+ * \param field the \c MonoClassField to act on
+ * \returns \c MonoType of the field.
*/
MonoType*
mono_field_get_type (MonoClassField *field)
/**
* mono_field_get_type_checked:
- * @field: the MonoClassField to act on
- * @error: used to return any erro found while retrieving @field type
+ * \param field the \c MonoClassField to act on
+ * \param error used to return any error found while retrieving \p field type
*
- * Returns: MonoType of the field.
+ * \returns \c MonoType of the field.
*/
MonoType*
mono_field_get_type_checked (MonoClassField *field, MonoError *error)
/**
* mono_field_get_parent:
- * @field: the MonoClassField to act on
+ * \param field the \c MonoClassField to act on
*
- * Returns: MonoClass where the field was defined.
+ * \returns \c MonoClass where the field was defined.
*/
MonoClass*
mono_field_get_parent (MonoClassField *field)
/**
* mono_field_get_flags;
- * @field: the MonoClassField to act on
+ * \param field the \c MonoClassField to act on
*
* The metadata flags for a field are encoded using the
- * FIELD_ATTRIBUTE_* constants. See the tabledefs.h file for details.
+ * \c FIELD_ATTRIBUTE_* constants. See the \c tabledefs.h file for details.
*
- * Returns: The flags for the field.
+ * \returns The flags for the field.
*/
guint32
mono_field_get_flags (MonoClassField *field)
/**
* mono_field_get_offset:
- * @field: the MonoClassField to act on
+ * \param field the \c MonoClassField to act on
*
- * Returns: The field offset.
+ * \returns The field offset.
*/
guint32
mono_field_get_offset (MonoClassField *field)
/**
* mono_field_get_data:
- * @field: the MonoClassField to act on
+ * \param field the \c MonoClassField to act on
*
- * Returns: A pointer to the metadata constant value or to the field
+ * \returns A pointer to the metadata constant value or to the field
* data if it has an RVA flag.
*/
const char *
/**
* mono_property_get_name:
- * @prop: the MonoProperty to act on
- *
- * Returns: The name of the property
+ * \param prop the \c MonoProperty to act on
+ * \returns The name of the property
*/
const char*
mono_property_get_name (MonoProperty *prop)
/**
* mono_property_get_set_method
- * @prop: the MonoProperty to act on.
- *
- * Returns: The setter method of the property (A MonoMethod)
+ * \param prop the \c MonoProperty to act on.
+ * \returns The setter method of the property, a \c MonoMethod.
*/
MonoMethod*
mono_property_get_set_method (MonoProperty *prop)
/**
* mono_property_get_get_method
- * @prop: the MonoProperty to act on.
- *
- * Returns: The setter method of the property (A MonoMethod)
+ * \param prop the MonoProperty to act on.
+ * \returns The getter method of the property (A \c MonoMethod)
*/
MonoMethod*
mono_property_get_get_method (MonoProperty *prop)
/**
* mono_property_get_parent:
- * @prop: the MonoProperty to act on.
- *
- * Returns: The MonoClass where the property was defined.
+ * \param prop the \c MonoProperty to act on.
+ * \returns The \c MonoClass where the property was defined.
*/
MonoClass*
mono_property_get_parent (MonoProperty *prop)
/**
* mono_property_get_flags:
- * @prop: the MonoProperty to act on.
+ * \param prop the \c MonoProperty to act on.
*
* The metadata flags for a property are encoded using the
- * PROPERTY_ATTRIBUTE_* constants. See the tabledefs.h file for details.
+ * \c PROPERTY_ATTRIBUTE_* constants. See the \c tabledefs.h file for details.
*
- * Returns: The flags for the property.
+ * \returns The flags for the property.
*/
guint32
mono_property_get_flags (MonoProperty *prop)
/**
* mono_event_get_name:
- * @event: the MonoEvent to act on
- *
- * Returns: The name of the event.
+ * \param event the MonoEvent to act on
+ * \returns The name of the event.
*/
const char*
mono_event_get_name (MonoEvent *event)
/**
* mono_event_get_add_method:
- * @event: The MonoEvent to act on.
- *
- * Returns: The @add' method for the event (a MonoMethod).
+ * \param event The \c MonoEvent to act on.
+ * \returns The \c add method for the event, a \c MonoMethod.
*/
MonoMethod*
mono_event_get_add_method (MonoEvent *event)
/**
* mono_event_get_remove_method:
- * @event: The MonoEvent to act on.
- *
- * Returns: The @remove method for the event (a MonoMethod).
+ * \param event The \c MonoEvent to act on.
+ * \returns The \c remove method for the event, a \c MonoMethod.
*/
MonoMethod*
mono_event_get_remove_method (MonoEvent *event)
/**
* mono_event_get_raise_method:
- * @event: The MonoEvent to act on.
- *
- * Returns: The @raise method for the event (a MonoMethod).
+ * \param event The \c MonoEvent to act on.
+ * \returns The \c raise method for the event, a \c MonoMethod.
*/
MonoMethod*
mono_event_get_raise_method (MonoEvent *event)
/**
* mono_event_get_parent:
- * @event: the MonoEvent to act on.
- *
- * Returns: The MonoClass where the event is defined.
+ * \param event the MonoEvent to act on.
+ * \returns The \c MonoClass where the event is defined.
*/
MonoClass*
mono_event_get_parent (MonoEvent *event)
/**
* mono_event_get_flags
- * @event: the MonoEvent to act on.
+ * \param event the \c MonoEvent to act on.
*
* The metadata flags for an event are encoded using the
- * EVENT_* constants. See the tabledefs.h file for details.
+ * \c EVENT_* constants. See the \c tabledefs.h file for details.
*
- * Returns: The flags for the event.
+ * \returns The flags for the event.
*/
guint32
mono_event_get_flags (MonoEvent *event)
/**
* mono_class_get_method_from_name:
- * @klass: where to look for the method
- * @name: name of the method
- * @param_count: number of parameters. -1 for any number.
+ * \param klass where to look for the method
+ * \param name name of the method
+ * \param param_count number of parameters. -1 for any number.
*
- * Obtains a MonoMethod with a given name and number of parameters.
+ * Obtains a \c MonoMethod with a given name and number of parameters.
* It only works if there are no multiple signatures for any given method name.
*/
MonoMethod *
/**
* mono_class_get_method_from_name_flags:
- * @klass: where to look for the method
- * @name_space: name of the method
- * @param_count: number of parameters. -1 for any number.
- * @flags: flags which must be set in the method
+ * \param klass where to look for the method
+ * \param name_space name of the method
+ * \param param_count number of parameters. -1 for any number.
+ * \param flags flags which must be set in the method
*
- * Obtains a MonoMethod with a given name and number of parameters.
+ * Obtains a \c MonoMethod with a given name and number of parameters.
* It only works if there are no multiple signatures for any given method name.
*/
MonoMethod *
/**
* mono_class_set_failure:
- * @klass: class in which the failure was detected
- * @ex_type: the kind of exception/error to be thrown (later)
- * @ex_data: exception data (specific to each type of exception/error)
+ * \param klass class in which the failure was detected
+ * \param ex_type the kind of exception/error to be thrown (later)
+ * \param ex_data exception data (specific to each type of exception/error)
*
* Keep a detected failure informations in the class for later processing.
* Note that only the first failure is kept.
/**
* mono_class_set_type_load_failure:
- * @klass: class in which the failure was detected
- * @fmt: Printf-style error message string.
+ * \param klass class in which the failure was detected
+ * \param fmt \c printf -style error message string.
*
* Collect detected failure informaion in the class for later processing.
- * The error is stored as a MonoErrorBoxed as with mono_error_set_type_load_class ()
+ * The error is stored as a MonoErrorBoxed as with mono_error_set_type_load_class()
* Note that only the first failure is kept.
*
- * Returns FALSE if a failure was already set on the class, or TRUE otherwise.
- *
* LOCKING: Acquires the loader lock.
+ *
+ * \returns FALSE if a failure was already set on the class, or TRUE otherwise.
*/
gboolean
mono_class_set_type_load_failure (MonoClass *klass, const char * fmt, ...)
/**
* mono_class_get_exception_for_failure:
- * @klass: class in which the failure was detected
+ * \param klass class in which the failure was detected
*
- * Return a constructed MonoException than the caller can then throw
+ * \returns a constructed MonoException than the caller can then throw
* using mono_raise_exception - or NULL if no failure is present (or
* doesn't result in an exception).
*/
/**
* mono_method_can_access_field:
- * @method: Method that will attempt to access the field
- * @field: the field to access
+ * \param method Method that will attempt to access the field
+ * \param field the field to access
*
* Used to determine if a method is allowed to access the specified field.
*
- * Returns: TRUE if the given @method is allowed to access the @field while following
+ * \returns TRUE if the given \p method is allowed to access the \p field while following
* the accessibility rules of the CLI.
*/
gboolean
/**
* mono_method_can_access_method:
- * @method: Method that will attempt to access the other method
- * @called: the method that we want to probe for accessibility.
+ * \param method Method that will attempt to access the other method
+ * \param called the method that we want to probe for accessibility.
*
- * Used to determine if the @method is allowed to access the specified @called method.
+ * Used to determine if the \p method is allowed to access the specified \p called method.
*
- * Returns: TRUE if the given @method is allowed to invoke the @called while following
+ * \returns TRUE if the given \p method is allowed to invoke the \p called while following
* the accessibility rules of the CLI.
*/
gboolean
/**
* mono_type_is_valid_enum_basetype:
- * @type: The MonoType to check
- *
- * Returns: TRUE if the type can be used as the basetype of an enum
+ * \param type The MonoType to check
+ * \returns TRUE if the type can be used as the basetype of an enum
*/
gboolean mono_type_is_valid_enum_basetype (MonoType * type) {
switch (type->type) {
/**
* mono_class_is_valid_enum:
- * @klass: An enum class to be validated
+ * \param klass An enum class to be validated
*
* This method verify the required properties an enum should have.
- *
- * Returns: TRUE if the informed enum class is valid
*
* FIXME: TypeBuilder enums are allowed to implement interfaces, but since they cannot have methods, only empty interfaces are possible
* FIXME: enum types are not allowed to have a cctor, but mono_reflection_create_runtime_class sets has_cctor to 1 for all types
* FIXME: TypeBuilder enums can have any kind of static fields, but the spec is very explicit about that (P II 14.3)
+ *
+ * \returns TRUE if the informed enum class is valid
*/
gboolean
mono_class_is_valid_enum (MonoClass *klass)
/**
* mono_class_get_fields_lazy:
- * @klass: the MonoClass to act on
+ * \param klass the MonoClass to act on
*
* This routine is an iterator routine for retrieving the fields in a class.
* Only minimal information about fields are loaded. Accessors must be used
* iterate over all of the elements. When no more values are
* available, the return value is NULL.
*
- * Returns: a @MonoClassField* on each iteration, or NULL when no more fields are available.
+ * \returns a \c MonoClassField* on each iteration, or NULL when no more fields are available.
*/
MonoClassField*
mono_class_get_fields_lazy (MonoClass* klass, gpointer *iter)
/**
* mono_method_get_base_method:
- * @method: a method
- * @definition: if true, get the definition
- * @error: set on failure
+ * \param method a method
+ * \param definition if true, get the definition
+ * \param error set on failure
*
* Given a virtual method associated with a subclass, return the corresponding
- * method from an ancestor. If @definition is FALSE, returns the method in the
- * superclass of the given method. If @definition is TRUE, return the method
+ * method from an ancestor. If \p definition is FALSE, returns the method in the
+ * superclass of the given method. If \p definition is TRUE, return the method
* in the ancestor class where it was first declared. The type arguments will
* be inflated in the ancestor classes. If the method is not associated with a
* class, or isn't virtual, returns the method itself. On failure returns NULL
- * and sets @error.
+ * and sets \p error.
*/
MonoMethod*
mono_method_get_base_method (MonoMethod *method, gboolean definition, MonoError *error)
+/**
+ * \file
+ */
+
#ifndef _MONO_CLI_CLASS_H_
#define _MONO_CLI_CLASS_H_
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * cominterop.c: COM Interop Support
+/**
+ * \file
+ * COM Interop Support
*
*
* (C) 2002 Ximian, Inc. http://www.ximian.com
/**
* mono_cominterop_get_native_wrapper:
- * @method: managed method
- *
- * Returns: the generated method to call
+ * \param method managed method
+ * \returns the generated method to call
*/
MonoMethod *
mono_cominterop_get_native_wrapper (MonoMethod *method)
/**
* mono_cominterop_get_invoke:
- * @method: managed method
- *
- * Returns: the generated method that calls the underlying __ComObject
+ * \param method managed method
+ * \returns the generated method that calls the underlying \c __ComObject
* rather than the proxy object.
*/
MonoMethod *
/**
* mono_marshal_free_ccw:
- * @object: the mono object
- *
- * Returns: whether the object had a CCW
+ * \param object the mono object
+ * \returns whether the object had a CCW
*/
gboolean
mono_marshal_free_ccw (MonoObject* object)
-/*
- * cominterop.h: COM Interop Support
+/**
+ * \file
+ * COM Interop Support
*
*
* (C) 2002 Ximian, Inc. http://www.ximian.com
-/*
- * console-io.h: Console IO internal calls
+/**
+ * \file
+ * Console IO internal calls
*
* Author:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
- * console-null.c: Null driver, does nothing.
+/**
+ * \file
+ * Null driver, does nothing.
*
* Author:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
- * console-io.c: ConsoleDriver internal calls for Unix systems.
+/**
+ * \file
+ * ConsoleDriver internal calls for Unix systems.
*
* Author:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * console-win32-uwp.c: UWP console support for Mono.
+/**
+ * \file
+ * UWP console support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * console-io.c: ConsoleDriver internal calls for Win32
+/**
+ * \file
+ * ConsoleDriver internal calls for Win32
*
* Author:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * coree-windows-uwp.c: UWP coree support for Mono.
+/**
+ * \file
+ * UWP coree support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * coree.c: mscoree.dll functions
+/**
+ * \file
+ * mscoree.dll functions
*
* Author:
* Kornel Pal <http://www.kornelpal.hu/>
#include "cil-coff.h"
#include "metadata-internals.h"
#include "image.h"
-#include "assembly.h"
+#include "assembly-internals.h"
#include "domain-internals.h"
#include "appdomain.h"
#include "object.h"
* probably be delayed until the first call to an exported function.
*/
if (image->tables [MONO_TABLE_ASSEMBLY].rows && ((MonoCLIImageInfo*) image->image_info)->cli_cli_header.ch_vtable_fixups.rva)
- assembly = mono_assembly_open (file_name, NULL);
+ assembly = mono_assembly_open_predicate (file_name, FALSE, FALSE, NULL, NULL, NULL);
g_free (file_name);
break;
ExitProcess (1);
}
- assembly = mono_assembly_open (file_name, NULL);
+ assembly = mono_assembly_open_predicate (file_name, FALSE, FALSE, NULL, NULL, NULL);
mono_close_exe_image ();
if (!assembly) {
g_free (file_name);
-/*
- * coree.h: mscoree.dll functions
+/**
+ * \file
+ * mscoree.dll functions
*
* Author:
* Kornel Pal <http://www.kornelpal.hu/>
{1264, 1328, 1264, 1328, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1795, 1811, 1824, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {2, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1854, 1865, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1, 1264, 1, 1264, 1875, 1494, 0, 1296, 1347, 1311, 55, 1357, 3, 0, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1884, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1888, 1337, 1891, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{2067, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 0, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2069, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
- {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2126, 1337, 2128, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
+ {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 0, 1337, 1339, 1343, 1347, 1311, 55, 1357, 0, 0, 1, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1497, 1505, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2183, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 11, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 1924, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1296, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2201, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2205, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1539, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1795, 1811, 1824, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {2, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1854, 1865, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1, 1264, 1, 1264, 1875, 1494, 0, 1296, 1347, 1311, 55, 1357, 3, 0, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1884, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1888, 1337, 1891, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{2067, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 2263, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2069, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
- {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2126, 1337, 2128, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
- {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2267, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 11, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2190, 1494, 1339, 1296, 1753, 1311, 1769, 1777, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 1924, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1296, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2205, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1539, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2292, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2292, 1337, 1645, 1343, 1662, 1690, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1729, 1736, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1753, 1311, 1769, 1777, 1, 0, 1, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1753, 1311, 1769, 1777, 1, 0, 1, 2, 1, 2, 2, {3, 2}, {3, -1}},
{1264, 1328, 1264, 1328, 2253, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 2294, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2296, 1494, 2303, 1296, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2336, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 2340, 1494, 1339, 1296, 1347, 1311, 55, 1517, 9, 2, 9, 3, 2, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2343, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 2343, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2201, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2347, 1276, 1281, 1296, 1299, 1311, 1320, 1324, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2292, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2562, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2423, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2373, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2357, 1337, 2239, 1343, 1347, 1311, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1726, 1276, 1339, 1296, 1347, 1311, 55, 1324, 9, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2573, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2257, 1494, 2041, 1296, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2340, 1494, 1339, 1296, 1347, 1311, 55, 1517, 9, 2, 9, 3, 2, 2, 2, {3, -1}, {3, -1}},
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_CULTURE_INFO_H_
#define _MONO_METADATA_CULTURE_INFO_H_ 1
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_CUSTOM_ATTRS_INTERNALS_H__
#define __MONO_METADATA_CUSTOM_ATTRS_INTERNALS_H__
-/*
- * custom-attrs.c: Custom attributes.
+/**
+ * \file
+ * Custom attributes.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
return result;
}
+/**
+ * mono_custom_attrs_construct:
+ */
MonoArray*
mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo)
{
}
/**
* mono_custom_attrs_from_index_checked:
- *
- * Returns: NULL if no attributes are found. On error returns NULL and sets @error.
+ * \returns NULL if no attributes are found. On error returns NULL and sets \p error.
*/
MonoCustomAttrInfo*
mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ignore_missing, MonoError *error)
return ainfo;
}
+/**
+ * mono_custom_attrs_from_method:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_method (MonoMethod *method)
{
return mono_custom_attrs_from_index_checked (method->klass->image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_from_class:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_class (MonoClass *klass)
{
return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_from_assembly:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_assembly (MonoAssembly *assembly)
{
return mono_custom_attrs_from_index_checked (image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_from_property:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_property (MonoClass *klass, MonoProperty *property)
{
return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_from_event:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_event (MonoClass *klass, MonoEvent *event)
{
return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_from_field:
+ */
MonoCustomAttrInfo*
mono_custom_attrs_from_field (MonoClass *klass, MonoClassField *field)
{
/**
* mono_custom_attrs_from_param:
- * @method: handle to the method that we want to retrieve custom parameter information from
- * @param: parameter number, where zero represent the return value, and one is the first parameter in the method
+ * \param method handle to the method that we want to retrieve custom parameter information from
+ * \param param parameter number, where zero represent the return value, and one is the first parameter in the method
*
* The result must be released with mono_custom_attrs_free().
*
- * Returns: the custom attribute object for the specified parameter, or NULL if there are none.
+ * \returns the custom attribute object for the specified parameter, or NULL if there are none.
*/
MonoCustomAttrInfo*
mono_custom_attrs_from_param (MonoMethod *method, guint32 param)
/**
* mono_custom_attrs_from_param_checked:
- * @method: handle to the method that we want to retrieve custom parameter information from
- * @param: parameter number, where zero represent the return value, and one is the first parameter in the method
- * @error: set on error
+ * \param method handle to the method that we want to retrieve custom parameter information from
+ * \param param parameter number, where zero represent the return value, and one is the first parameter in the method
+ * \param error set on error
*
* The result must be released with mono_custom_attrs_free().
*
- * Returns: the custom attribute object for the specified parameter, or NULL if there are none. On failure returns NULL and sets @error.
+ * \returns the custom attribute object for the specified parameter, or NULL if there are none. On failure returns NULL and sets \p error.
*/
MonoCustomAttrInfo*
mono_custom_attrs_from_param_checked (MonoMethod *method, guint32 param, MonoError *error)
return mono_custom_attrs_from_index_checked (image, idx, FALSE, error);
}
+/**
+ * mono_custom_attrs_has_attr:
+ */
gboolean
mono_custom_attrs_has_attr (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)
{
return FALSE;
}
+/**
+ * mono_custom_attrs_get_attr:
+ */
MonoObject*
mono_custom_attrs_get_attr (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)
{
return create_custom_attr (ainfo->image, centry->ctor, centry->data, centry->data_size, error);
}
-/*
+/**
* mono_reflection_get_custom_attrs_info:
- * @obj: a reflection object handle
+ * \param obj a reflection object handle
*
- * Return the custom attribute info for attributes defined for the
- * reflection handle @obj. The objects.
+ * \returns the custom attribute info for attributes defined for the
+ * reflection handle \p obj. The objects.
*
* FIXME this function leaks like a sieve for SRE objects.
*/
/**
* mono_reflection_get_custom_attrs_info_checked:
- * @obj: a reflection object handle
- * @error: set on error
+ * \param obj a reflection object handle
+ * \param error set on error
*
- * Return the custom attribute info for attributes defined for the
- * reflection handle @obj. The objects.
- *
- * On failure returns NULL and sets @error.
+ * \returns the custom attribute info for attributes defined for the
+ * reflection handle \p obj. The objects. On failure returns NULL and sets \p error.
*
* FIXME this function leaks like a sieve for SRE objects.
*/
return cinfo;
}
-/*
+/**
* mono_reflection_get_custom_attrs_by_type:
- * @obj: a reflection object handle
- *
- * Return an array with all the custom attributes defined of the
- * reflection handle @obj. If @attr_klass is non-NULL, only custom attributes
+ * \param obj a reflection object handle
+ * \returns an array with all the custom attributes defined of the
+ * reflection handle \p obj. If \p attr_klass is non-NULL, only custom attributes
* of that type are returned. The objects are fully build. Return NULL if a loading error
* occurs.
*/
return result;
}
-/*
+/**
* mono_reflection_get_custom_attrs:
- * @obj: a reflection object handle
- *
- * Return an array with all the custom attributes defined of the
- * reflection handle @obj. The objects are fully build. Return NULL if a loading error
+ * \param obj a reflection object handle
+ * \return an array with all the custom attributes defined of the
+ * reflection handle \p obj. The objects are fully build. Return NULL if a loading error
* occurs.
*/
MonoArray*
return mono_reflection_get_custom_attrs_by_type (obj, NULL, &error);
}
-/*
+/**
* mono_reflection_get_custom_attrs_data:
- * @obj: a reflection obj handle
- *
- * Returns an array of System.Reflection.CustomAttributeData,
+ * \param obj a reflection obj handle
+ * \returns an array of \c System.Reflection.CustomAttributeData,
* which include information about attributes reflected on
* types loaded using the Reflection Only methods
*/
/**
* mono_assembly_metadata_foreach_custom_attr:
- * @assembly: the assembly to iterate over
- * @func: the function to call for each custom attribute
- * @user_data: passed to @func
- *
- * Calls @func for each custom attribute type on the given assembly until @func returns TRUE.
+ * \param assembly the assembly to iterate over
+ * \param func the function to call for each custom attribute
+ * \param user_data passed to \p func
+ * Calls \p func for each custom attribute type on the given assembly until \p func returns TRUE.
* Everything is done using low-level metadata APIs, so it is safe to use during assembly loading.
- *
*/
void
mono_assembly_metadata_foreach_custom_attr (MonoAssembly *assembly, MonoAssemblyMetadataCustomAttrIterFunc func, gpointer user_data)
-/*
- * debug-helpers.c:
+/**
+ * \file
*
* Author:
* Mono Project (http://www.mono-project.com)
g_string_append_c (res, '&');
}
+/**
+ * mono_type_full_name:
+ */
char*
mono_type_full_name (MonoType *type)
{
return g_string_free (str, FALSE);
}
+/**
+ * mono_signature_get_desc:
+ */
char*
mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
{
return result;
}
-static void
-ginst_get_desc (GString *str, MonoGenericInst *ginst)
+void
+mono_ginst_get_desc (GString *str, MonoGenericInst *ginst)
{
int i;
g_string_append (str, "<");
if (context->class_inst)
- ginst_get_desc (str, context->class_inst);
+ mono_ginst_get_desc (str, context->class_inst);
if (context->method_inst) {
if (context->class_inst)
g_string_append (str, "; ");
- ginst_get_desc (str, context->method_inst);
+ mono_ginst_get_desc (str, context->method_inst);
}
g_string_append (str, ">");
/**
* mono_method_desc_new:
- * @name: the method name.
- * @include_namespace: whether the name includes a namespace or not.
+ * \param name the method name.
+ * \param include_namespace whether the name includes a namespace or not.
*
- * Creates a method description for @name, which conforms to the following
+ * Creates a method description for \p name, which conforms to the following
* specification:
*
- * [namespace.]classname:methodname[(args...)]
+ * <code>[namespace.]classname:methodname[(args...)]</code>
*
* in all the loaded assemblies.
*
- * Both classname and methodname can contain '*' which matches anything.
+ * Both classname and methodname can contain <code>*</code> which matches anything.
*
- * Returns: a parsed representation of the method description.
+ * \returns a parsed representation of the method description.
*/
MonoMethodDesc*
mono_method_desc_new (const char *name, gboolean include_namespace)
return result;
}
+/**
+ * mono_method_desc_from_method:
+ */
MonoMethodDesc*
mono_method_desc_from_method (MonoMethod *method)
{
/**
* mono_method_desc_free:
- * @desc: method description to be released
- *
- * Releases the MonoMethodDesc object @desc.
+ * \param desc method description to be released
+ * Releases the \c MonoMethodDesc object \p desc.
*/
void
mono_method_desc_free (MonoMethodDesc *desc)
}
/**
- * mono_method_descr_match:
- * @desc: MonoMethoDescription
- * @method: MonoMethod to test
+ * mono_method_desc_match:
+ * \param desc \c MonoMethoDescription
+ * \param method \c MonoMethod to test
*
- * Determines whether the specified @method matches the provided @desc description.
+ * Determines whether the specified \p method matches the provided \p desc description.
*
* namespace and class are supposed to match already if this function is used.
- * Returns: True if the method matches the description, false otherwise.
+ * \returns TRUE if the method matches the description, FALSE otherwise.
*/
gboolean
mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method)
return match_class (desc, pos, klass->nested_in);
}
+/**
+ * mono_method_desc_full_match:
+ */
gboolean
mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
{
return mono_method_desc_match (desc, method);
}
+/**
+ * mono_method_desc_search_in_class:
+ */
MonoMethod*
mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass)
{
return NULL;
}
+/**
+ * mono_method_desc_search_in_image:
+ */
MonoMethod*
mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
{
NULL /* user data */
};
+/**
+ * mono_disasm_code_one:
+ */
char*
mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar **endp)
{
return result;
}
+/**
+ * mono_disasm_code:
+ */
char*
mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar* end)
{
/**
* mono_field_full_name:
- * @field: field to retrieve information for
- *
- * Returns: the full name for the field, made up of the namespace, type name and the field name.
+ * \param field field to retrieve information for
+ * \returns the full name for the field, made up of the namespace, type name and the field name.
*/
char *
mono_field_full_name (MonoClassField *field)
g_string_append (str, "<");
else
g_string_append (str, "[");
- ginst_get_desc (str, ((MonoMethodInflated*)method)->context.method_inst);
+ mono_ginst_get_desc (str, ((MonoMethodInflated*)method)->context.method_inst);
if (format == MONO_TYPE_NAME_FORMAT_IL)
g_string_append_c (str, '>');
else
g_string_append (str, "<");
else
g_string_append (str, "[");
- ginst_get_desc (str, container->context.method_inst);
+ mono_ginst_get_desc (str, container->context.method_inst);
if (format == MONO_TYPE_NAME_FORMAT_IL)
g_string_append_c (str, '>');
else
return res;
}
+/**
+ * mono_method_full_name:
+ */
char *
mono_method_full_name (MonoMethod *method, gboolean signature)
{
/**
* mono_object_describe:
*
- * Prints to stdout a small description of the object @obj.
+ * Prints to stdout a small description of the object \p obj.
* For use in a debugger.
*/
void
/**
* mono_object_describe_fields:
*
- * Prints to stdout a small description of each field of the object @obj.
+ * Prints to stdout a small description of each field of the object \p obj.
* For use in a debugger.
*/
void
* mono_value_describe_fields:
*
* Prints to stdout a small description of each field of the value type
- * stored at @addr of type @klass.
+ * stored at \p addr of type \p klass.
* For use in a debugger.
*/
void
/**
* mono_class_describe_statics:
*
- * Prints to stdout a small description of each static field of the type @klass
+ * Prints to stdout a small description of each static field of the type \p klass
* in the current application domain.
* For use in a debugger.
*/
/**
* mono_print_method_code
- * @MonoMethod: a pointer to the method
+ * \param method: a pointer to the method
*
* This method is used from a debugger to print the code of the method.
*
+/**
+ * \file
+ */
+
#ifndef __MONO_DEBUG_HELPERS_H__
#define __MONO_DEBUG_HELPERS_H__
-/*
- * debug-mono-ppdb.c: Support for the portable PDB symbol
+/**
+ * \file
+ * Support for the portable PDB symbol
* file format
*
*
/**
* mono_ppdb_lookup_location:
- * @minfo: A `MonoDebugMethodInfo' which can be retrieved by
- * mono_debug_lookup_method().
- * @offset: IL offset within the corresponding method's CIL code.
+ * \param minfo A \c MonoDebugMethodInfo which can be retrieved by mono_debug_lookup_method().
+ * \param offset IL offset within the corresponding method's CIL code.
*
* This function is similar to mono_debug_lookup_location(), but we
* already looked up the method and also already did the
- * `native address -> IL offset' mapping.
+ * native address -> IL offset mapping.
*/
MonoDebugSourceLocation *
mono_ppdb_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
-/*
- * debug-mono-ppdb.c: Support for the portable PDB symbol
- * file format
+/**
+ * \file
+ * Support for the portable PDB symbol file format
*
*
* Author:
-/*
- * debug-mono-symfile.c:
+/**
+ * \file
*
* Support for reading debug info from .mdb files.
*
return TRUE;
}
+/**
+ * mono_debug_open_mono_symbols:
+ */
MonoSymbolFile *
mono_debug_open_mono_symbols (MonoDebugHandle *handle, const uint8_t *raw_contents,
int size, gboolean in_the_debugger)
return symfile;
}
+/**
+ * mono_debug_close_mono_symbol_file:
+ */
void
mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile)
{
mono_debugger_unlock ();
}
+/**
+ * mono_debug_symfile_is_loaded:
+ */
mono_bool
mono_debug_symfile_is_loaded (MonoSymbolFile *symfile)
{
/**
* mono_debug_symfile_lookup_location:
- * @minfo: A `MonoDebugMethodInfo' which can be retrieved by
- * mono_debug_lookup_method().
- * @offset: IL offset within the corresponding method's CIL code.
+ * \param minfo A \c MonoDebugMethodInfo which can be retrieved by \c mono_debug_lookup_method.
+ * \param offset IL offset within the corresponding method's CIL code.
*
- * This function is similar to mono_debug_lookup_location(), but we
+ * This function is similar to \c mono_debug_lookup_location, but we
* already looked up the method and also already did the
- * `native address -> IL offset' mapping.
+ * native address -> IL offset mapping.
*/
MonoDebugSourceLocation *
mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)
stm->first_file = stm->file;
}
-/*
+/**
* mono_debug_symfile_free_location:
*
- * Free a MonoDebugSourceLocation returned by
- * mono_debug_symfile_lookup_location
+ * Free a \c MonoDebugSourceLocation returned by
+ * \c mono_debug_symfile_lookup_location
*/
void
mono_debug_symfile_free_location (MonoDebugSourceLocation *location)
return token - read32(&(me->_token));
}
+/**
+ * mono_debug_symfile_lookup_method:
+ */
MonoDebugMethodInfo *
mono_debug_symfile_lookup_method (MonoDebugHandle *handle, MonoMethod *method)
{
return minfo;
}
-/*
+/**
* mono_debug_symfile_lookup_locals:
*
- * Return information about the local variables of MINFO from the symbol file.
+ * Return information about the local variables of \p minfo from the symbol file.
* Return NULL if no information can be found.
- * The result should be freed using mono_debug_symfile_free_locals ().
+ * The result should be freed using \c mono_debug_symfile_free_locals.
*/
MonoDebugLocalsInfo*
mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo)
-/*
+/**
+ * \file
* This header is only installed for use by the debugger:
* the structures and the API declared here are not supported.
* Copyright 2012 Xamarin Inc (http://www.xamarin.com)
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// Copyright 2015 Xamarin Inc
-//
-// File: decimal.c
-//
-// Ported from C++ to C and adjusted to Mono runtime
-//
-// Pending:
-// DoToCurrency (they look like new methods we do not have)
-//
+/**
+ * \file
+ * Copyright (c) Microsoft. All rights reserved.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ *
+ * Copyright 2015 Xamarin Inc
+ *
+ * File: decimal.c
+ *
+ * Ported from C++ to C and adjusted to Mono runtime
+ *
+ * Pending:
+ * DoToCurrency (they look like new methods we do not have)
+ */
#ifndef DISABLE_DECIMAL
#include "config.h"
#include <stdint.h>
+/**
+ * \file
+ */
+
#ifndef __MONO_DECIMAL_MS_H__
#define __MONO_DECIMAL_MS_H__
-/*
+/**
+ * \file
* Appdomain-related internal data structures and functions.
* Copyright 2012 Xamarin Inc (http://www.xamarin.com)
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
typedef struct {
const char runtime_version [12];
const char framework_version [4];
+ const char *public_key_token;
const AssemblyVersionSet version_sets [5];
} MonoRuntimeInfo;
-/*
- * domain.c: MonoDomain functions
+/**
+ * \file
+ * MonoDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-internals.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/appdomain.h>
/* This is the list of runtime versions supported by this JIT.
*/
static const MonoRuntimeInfo supported_runtimes[] = {
- {"v4.0.30319","4.5", { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
- {"mobile", "2.1", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0}, {4,0,0,0} } },
- {"moonlight", "2.1", { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0}, NOT_AVAIL } },
+ {"v4.0.30319","4.5", NULL, { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
+ {"mobile", "2.1", "7cec85d7bea7798e", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0}, {4,0,0,0} } },
+ {"moonlight", "2.1", NULL, { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0}, NOT_AVAIL } },
};
#undef NOT_AVAIL
/**
* mono_string_equal:
- * @s1: First string to compare
- * @s2: Second string to compare
+ * \param s1 First string to compare
+ * \param s2 Second string to compare
*
- * Compares two `MonoString*` instances ordinally for equality.
+ * Compares two \c MonoString* instances ordinally for equality.
*
- * Returns FALSE if the strings differ.
+ * \returns FALSE if the strings differ.
*/
gboolean
mono_string_equal (MonoString *s1, MonoString *s2)
/**
* mono_string_hash:
- * @s: the string to hash
+ * \param s the string to hash
*
- * Compute the hash for a `MonoString*`
- * Returns the hash for the string.
+ * Compute the hash for a \c MonoString*
+ * \returns the hash for the string.
*/
guint
mono_string_hash (MonoString *s)
* mono_domain_create:
*
* Creates a new application domain, the unmanaged representation
- * of the actual domain. Usually you will want to create the
+ * of the actual domain.
*
* Application domains provide an isolation facilty for assemblies. You
* can load assemblies and execute code in them that will not be visible
- * to other application domains. This is a runtime-based virtualization
+ * to other application domains. This is a runtime-based virtualization
* technology.
*
* It is possible to unload domains, which unloads the assemblies and
* structures, along a dedicated code manager to hold code that is
* associated with the domain.
*
- * Returns: New initialized MonoDomain, with no configuration or assemblies
+ * \returns New initialized \c MonoDomain, with no configuration or assemblies
* loaded into it.
*/
MonoDomain *
/**
* mono_init_from_assembly:
- * @domain_name: name to give to the initial domain
- * @filename: filename to load on startup
+ * \param domain_name name to give to the initial domain
+ * \param filename filename to load on startup
*
* Used by the runtime, users should use mono_jit_init instead.
*
* provided executable. The version is determined by looking at the exe
* configuration file and the version PE field)
*
- * Returns: the initial domain.
+ * \returns the initial domain.
*/
MonoDomain *
mono_init_from_assembly (const char *domain_name, const char *filename)
/**
* mono_init_version:
*
- * Used by the runtime, users should use mono_jit_init instead.
+ * Used by the runtime, users should use \c mono_jit_init instead.
*
- * Creates the initial application domain and initializes the mono_defaults
+ * Creates the initial application domain and initializes the \c mono_defaults
* structure.
*
* This function is guaranteed to not run any IL code.
* The runtime is initialized using the provided rutime version.
*
- * Returns: the initial domain.
+ * \returns the initial domain.
*/
MonoDomain *
mono_init_version (const char *domain_name, const char *version)
/**
* mono_domain_get:
*
- * This method returns the value of the current MonoDomain that this thread
+ * This method returns the value of the current \c MonoDomain that this thread
* and code are running under. To obtain the root domain use
- * mono_get_root_domain() API.
+ * \c mono_get_root_domain API.
*
- * Returns: the current domain
+ * \returns the current domain
*/
MonoDomain *
mono_domain_get ()
/**
* mono_domain_set_internal:
- * @domain: the new domain
+ * \param domain the new domain
*
- * Sets the current domain to @domain.
+ * Sets the current domain to \p domain.
*/
void
mono_domain_set_internal (MonoDomain *domain)
/**
* mono_domain_foreach:
- * @func: function to invoke with the domain data
- * @user_data: user-defined pointer that is passed to the supplied @func fo reach domain
+ * \param func function to invoke with the domain data
+ * \param user_data user-defined pointer that is passed to the supplied \p func fo reach domain
*
* Use this method to safely iterate over all the loaded application
- * domains in the current runtime. The provided @func is invoked with a
- * pointer to the MonoDomain and is given the value of the @user_data
+ * domains in the current runtime. The provided \p func is invoked with a
+ * pointer to the \c MonoDomain and is given the value of the \p user_data
* parameter which can be used to pass state to your called routine.
*/
void
mono_gc_free_fixed (copy);
}
+/* FIXME: maybe we should integrate this with mono_assembly_open? */
/**
* mono_domain_assembly_open:
- * @domain: the application domain
- * @name: file name of the assembly
- *
- * fixme: maybe we should integrate this with mono_assembly_open ??
+ * \param domain the application domain
+ * \param name file name of the assembly
*/
MonoAssembly *
mono_domain_assembly_open (MonoDomain *domain, const char *name)
current = mono_domain_get ();
mono_domain_set (domain, FALSE);
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
mono_domain_set (current, FALSE);
} else {
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
}
return ass;
/**
* mono_domain_free:
- * @domain: the domain to release
- * @force: if true, it allows the root domain to be released (used at shutdown only).
+ * \param domain the domain to release
+ * \param force if TRUE, it allows the root domain to be released (used at shutdown only).
*
* This releases the resources associated with the specific domain.
* This is a low-level function that is invoked by the AppDomain infrastructure
/**
* mono_domain_get_by_id:
- * @domainid: the ID
- *
- * Returns: the domain for a specific domain id.
+ * \param domainid the ID
+ * \returns the domain for a specific domain id.
*/
MonoDomain *
mono_domain_get_by_id (gint32 domainid)
return domain;
}
-/*
+/**
* mono_domain_get_id:
*
* A domain ID is guaranteed to be unique for as long as the domain
* using it is alive. It may be reused later once the domain has been
* unloaded.
*
- * Returns: The unique ID for @domain.
+ * \returns The unique ID for \p domain.
*/
gint32
mono_domain_get_id (MonoDomain *domain)
return domain->domain_id;
}
-/*
+/**
* mono_domain_get_friendly_name:
*
- * The returned string's lifetime is the same as @domain's. Consider
+ * The returned string's lifetime is the same as \p domain's. Consider
* copying it if you need to store it somewhere.
*
- * Returns: The friendly name of @domain. Can be NULL if not yet set.
+ * \returns The friendly name of \p domain. Can be NULL if not yet set.
*/
const char *
mono_domain_get_friendly_name (MonoDomain *domain)
mono_domain_unlock (domain);
}
-
+/**
+ * mono_context_set:
+ */
void
mono_context_set (MonoAppContext * new_context)
{
/**
* mono_context_get_id:
- * @context: the context to operate on.
+ * \param context the context to operate on.
*
* Context IDs are guaranteed to be unique for the duration of a Mono
* process; they are never reused.
*
- * Returns: The unique ID for @context.
+ * \returns The unique ID for \p context.
*/
gint32
mono_context_get_id (MonoAppContext *context)
/**
* mono_context_get_domain_id:
- * @context: the context to operate on.
- *
- * Returns: The ID of the domain that @context was created in.
+ * \param context the context to operate on.
+ * \returns The ID of the domain that \p context was created in.
*/
gint32
mono_context_get_domain_id (MonoAppContext *context)
/**
* mono_get_corlib:
- *
- * Use this function to get the `MonoImage*` for the mscorlib.dll assembly
- *
- * Returns: The MonoImage for mscorlib.dll
+ * Use this function to get the \c MonoImage* for the \c mscorlib.dll assembly
+ * \returns The \c MonoImage for mscorlib.dll
*/
MonoImage*
mono_get_corlib (void)
/**
* mono_get_object_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Object`.
- *
- * Returns: The `MonoClass*` for the `System.Object` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Object .
+ * \returns The \c MonoClass* for the \c System.Object type.
*/
MonoClass*
mono_get_object_class (void)
/**
* mono_get_byte_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Byte`.
- *
- * Returns: The `MonoClass*` for the `System.Byte` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Byte .
+ * \returns The \c MonoClass* for the \c System.Byte type.
*/
MonoClass*
mono_get_byte_class (void)
/**
* mono_get_void_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Void`.
- *
- * Returns: The `MonoClass*` for the `System.Void` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Void .
+ * \returns The \c MonoClass* for the \c System.Void type.
*/
MonoClass*
mono_get_void_class (void)
/**
* mono_get_boolean_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Boolean`.
- *
- * Returns: The `MonoClass*` for the `System.Boolean` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Boolean .
+ * \returns The \c MonoClass* for the \c System.Boolean type.
*/
MonoClass*
mono_get_boolean_class (void)
/**
* mono_get_sbyte_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.SByte`.
- *
- * Returns: The `MonoClass*` for the `System.SByte` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.SByte.
+ * \returns The \c MonoClass* for the \c System.SByte type.
*/
MonoClass*
mono_get_sbyte_class (void)
/**
* mono_get_int16_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int16`.
- *
- * Returns: The `MonoClass*` for the `System.Int16` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int16 .
+ * \returns The \c MonoClass* for the \c System.Int16 type.
*/
MonoClass*
mono_get_int16_class (void)
/**
* mono_get_uint16_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt16`.
- *
- * Returns: The `MonoClass*` for the `System.UInt16` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt16 .
+ * \returns The \c MonoClass* for the \c System.UInt16 type.
*/
MonoClass*
mono_get_uint16_class (void)
/**
* mono_get_int32_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int32`.
- *
- * Returns: The `MonoClass*` for the `System.Int32` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int32 .
+ * \returns The \c MonoClass* for the \c System.Int32 type.
*/
MonoClass*
mono_get_int32_class (void)
/**
* mono_get_uint32_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt32`.
- *
- * Returns: The `MonoClass*` for the `System.UInt32` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt32 .
+ * \returns The \c MonoClass* for the \c System.UInt32 type.
*/
MonoClass*
mono_get_uint32_class (void)
/**
* mono_get_intptr_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.IntPtr`.
- *
- * Returns: The `MonoClass*` for the `System.IntPtr` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.IntPtr .
+ * \returns The \c MonoClass* for the \c System.IntPtr type.
*/
MonoClass*
mono_get_intptr_class (void)
/**
* mono_get_uintptr_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UIntPtr`.
- *
- * Returns: The `MonoClass*` for the `System.UIntPtr` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UIntPtr .
+ * \returns The \c MonoClass* for the \c System.UIntPtr type.
*/
MonoClass*
mono_get_uintptr_class (void)
/**
* mono_get_int64_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int64`.
- *
- * Returns: The `MonoClass*` for the `System.Int64` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int64 .
+ * \returns The \c MonoClass* for the \c System.Int64 type.
*/
MonoClass*
mono_get_int64_class (void)
/**
* mono_get_uint64_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt64`.
- *
- * Returns: The `MonoClass*` for the `System.UInt64` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt64 .
+ * \returns The \c MonoClass* for the \c System.UInt64 type.
*/
MonoClass*
mono_get_uint64_class (void)
/**
* mono_get_single_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Single` (32-bit floating points).
- *
- * Returns: The `MonoClass*` for the `System.Single` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Single (32-bit floating points).
+ * \returns The \c MonoClass* for the \c System.Single type.
*/
MonoClass*
mono_get_single_class (void)
/**
* mono_get_double_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Double` (64-bit floating points).
- *
- * Returns: The `MonoClass*` for the `System.Double` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Double (64-bit floating points).
+ * \returns The \c MonoClass* for the \c System.Double type.
*/
MonoClass*
mono_get_double_class (void)
/**
* mono_get_char_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Char`.
- *
- * Returns: The `MonoClass*` for the `System.Char` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Char .
+ * \returns The \c MonoClass* for the \c System.Char type.
*/
MonoClass*
mono_get_char_class (void)
/**
* mono_get_string_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.String`.
- *
- * Returns: The `MonoClass*` for the `System.String` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.String .
+ * \returns The \c MonoClass* for the \c System.String type.
*/
MonoClass*
mono_get_string_class (void)
/**
* mono_get_enum_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Enum`.
- *
- * Returns: The `MonoClass*` for the `System.Enum` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Enum .
+ * \returns The \c MonoClass* for the \c System.Enum type.
*/
MonoClass*
mono_get_enum_class (void)
/**
* mono_get_array_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Array`.
- *
- * Returns: The `MonoClass*` for the `System.Array` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Array .
+ * \returns The \c MonoClass* for the \c System.Array type.
*/
MonoClass*
mono_get_array_class (void)
/**
* mono_get_thread_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Threading.Thread`.
- *
- * Returns: The `MonoClass*` for the `System.Threading.Thread` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Threading.Thread .
+ * \returns The \c MonoClass* for the \c System.Threading.Thread type.
*/
MonoClass*
mono_get_thread_class (void)
/**
* mono_get_exception_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Exception`.
- *
- * Returns: The `MonoClass*` for the `` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Exception .
+ * \returns The \c MonoClass* for the \c type.
*/
MonoClass*
mono_get_exception_class (void)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * dynamic-image.c: Images created at runtime.
+/**
+ * \file
+ * Images created at runtime.
*
*
* Author:
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * dynamic-stream.c: MonoDynamicStream
+/**
+ * \file
+ * MonoDynamicStream
* Copyright 2016 Microsoft
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * environment.c: System.Environment support internal calls
+/**
+ * \file
+ * System.Environment support internal calls
*
* Authors:
* Dick Porter (dick@ximian.com)
static gint32 exitcode=0;
-gint32 mono_environment_exitcode_get (void)
+/**
+ * mono_environment_exitcode_get:
+ */
+gint32
+mono_environment_exitcode_get (void)
{
return(exitcode);
}
-void mono_environment_exitcode_set (gint32 value)
+/**
+ * mono_environment_exitcode_set:
+ */
+void
+mono_environment_exitcode_set (gint32 value)
{
exitcode=value;
}
-/*
- * environment.h: System.Environment support internal calls
+/**
+ * \file
+ * System.Environment support internal calls
*
* Author:
* Dick Porter (dick@ximian.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_EXCEPTION_INTERNALS_H_
#define _MONO_METADATA_EXCEPTION_INTERNALS_H_
-/*
- * exception.c: Exception handling
+/**
+ * \file
+ * Exception handling
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
/**
* mono_exception_from_name:
- * @image: the Mono image where to look for the class
- * @name_space: the namespace for the class
- * @name: class name
+ * \param image the Mono image where to look for the class
+ * \param name_space the namespace for the class
+ * \param name class name
*
* Creates an exception of the given namespace/name class in the
* current domain.
*
- * Returns: the initialized exception instance.
+ * \returns the initialized exception instance.
*/
MonoException *
mono_exception_from_name (MonoImage *image, const char *name_space,
/**
* mono_exception_from_name_domain:
- * @domain: Domain where the return object will be created.
- * @image: the Mono image where to look for the class
- * @name_space: the namespace for the class
- * @name: class name
+ * \param domain Domain where the return object will be created.
+ * \param image the Mono image where to look for the class
+ * \param name_space the namespace for the class
+ * \param name class name
*
* Creates an exception object of the given namespace/name class on
* the given domain.
*
- * Returns: the initialized exception instance.
+ * \returns the initialized exception instance.
*/
MonoException *
mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
/**
* mono_exception_from_token:
- * @image: the Mono image where to look for the class
- * @token: The type token of the class
+ * \param image the Mono image where to look for the class
+ * \param token The type token of the class
*
- * Creates an exception of the type given by @token.
+ * Creates an exception of the type given by \p token.
*
- * Returns: the initialized exception instance.
+ * \returns the initialized exception instance.
*/
MonoException *
mono_exception_from_token (MonoImage *image, guint32 token)
/**
* mono_exception_from_name_two_strings:
- * @image: the Mono image where to look for the class
- * @name_space: the namespace for the class
- * @name: class name
- * @a1: first string argument to pass
- * @a2: second string argument to pass
+ * \param image the Mono image where to look for the class
+ * \param name_space the namespace for the class
+ * \param name class name
+ * \param a1 first string argument to pass
+ * \param a2 second string argument to pass
*
* Creates an exception from a constructor that takes two string
* arguments.
*
- * Returns: the initialized exception instance.
+ * \returns the initialized exception instance.
*/
MonoException *
mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
/**
* mono_exception_from_name_two_strings_checked:
- * @image: the Mono image where to look for the class
- * @name_space: the namespace for the class
- * @name: class name
- * @a1: first string argument to pass
- * @a2: second string argument to pass
- * @error: set on error
+ * \param image the Mono image where to look for the class
+ * \param name_space the namespace for the class
+ * \param name class name
+ * \param a1 first string argument to pass
+ * \param a2 second string argument to pass
+ * \param error set on error
*
* Creates an exception from a constructor that takes two string
* arguments.
*
- * Returns: the initialized exception instance. On failure returns
- * NULL and sets @error.
+ * \returns the initialized exception instance. On failure returns
+ * NULL and sets \p error.
*/
MonoException *
mono_exception_from_name_two_strings_checked (MonoImage *image, const char *name_space,
/**
* mono_exception_from_name_msg:
- * @image: the Mono image where to look for the class
- * @name_space: the namespace for the class
- * @name: class name
- * @msg: the message to embed inside the exception
+ * \param image the Mono image where to look for the class
+ * \param name_space the namespace for the class
+ * \param name class name
+ * \param msg the message to embed inside the exception
*
* Creates an exception and initializes its message field.
*
- * Returns: the initialized exception instance.
+ * \returns the initialized exception instance.
*/
MonoException *
mono_exception_from_name_msg (MonoImage *image, const char *name_space,
/**
* mono_get_exception_divide_by_zero:
- *
- * Returns: a new instance of the `System.DivideByZeroException`
+ * \returns a new instance of the \c System.DivideByZeroException
*/
MonoException *
mono_get_exception_divide_by_zero ()
/**
* mono_get_exception_security:
- *
- * Returns: a new instance of the `System.Security.SecurityException`
+ * \returns a new instance of the \c System.Security.SecurityException
*/
MonoException *
mono_get_exception_security ()
/**
* mono_get_exception_thread_abort:
- *
- * Returns: a new instance of the `System.Threading.ThreadAbortException`
+ * \returns a new instance of the \c System.Threading.ThreadAbortException
*/
MonoException *
mono_get_exception_thread_abort ()
/**
* mono_get_exception_thread_interrupted:
- *
- * Returns: a new instance of the `System.Threading.ThreadInterruptedException`
+ * \returns a new instance of the \c System.Threading.ThreadInterruptedException
*/
MonoException *
mono_get_exception_thread_interrupted ()
/**
* mono_get_exception_arithmetic:
- *
- * Returns: a new instance of the `System.ArithmeticException`
+ * \returns a new instance of the \c System.ArithmeticException
*/
MonoException *
mono_get_exception_arithmetic ()
/**
* mono_get_exception_overflow:
- *
- * Returns: a new instance of the `System.OverflowException`
+ * \returns a new instance of the \c System.OverflowException
*/
MonoException *
mono_get_exception_overflow ()
/**
* mono_get_exception_null_reference:
- *
- * Returns: a new instance of the `System.NullReferenceException`
+ * \returns a new instance of the \c System.NullReferenceException
*/
MonoException *
mono_get_exception_null_reference ()
/**
* mono_get_exception_execution_engine:
- * @msg: the message to pass to the user
- *
- * Returns: a new instance of the `System.ExecutionEngineException`
+ * \param msg the message to pass to the user
+ * \returns a new instance of the \c System.ExecutionEngineException
*/
MonoException *
mono_get_exception_execution_engine (const char *msg)
/**
* mono_get_exception_serialization:
- * @msg: the message to pass to the user
- *
- * Returns: a new instance of the `System.Runtime.Serialization.SerializationException`
+ * \param msg the message to pass to the user
+ * \returns a new instance of the \c System.Runtime.Serialization.SerializationException
*/
MonoException *
mono_get_exception_serialization (const char *msg)
/**
* mono_get_exception_invalid_cast:
- *
- * Returns: a new instance of the `System.InvalidCastException`
+ * \returns a new instance of the \c System.InvalidCastException
*/
MonoException *
mono_get_exception_invalid_cast ()
/**
* mono_get_exception_invalid_operation:
- * @msg: the message to pass to the user
- *
- * Returns: a new instance of the `System.InvalidOperationException`
+ * \param msg the message to pass to the user
+ * \returns a new instance of the \c System.InvalidOperationException
*/
MonoException *
mono_get_exception_invalid_operation (const char *msg)
/**
* mono_get_exception_index_out_of_range:
- *
- * Returns: a new instance of the `System.IndexOutOfRangeException`
+ * \returns a new instance of the \c System.IndexOutOfRangeException
*/
MonoException *
mono_get_exception_index_out_of_range ()
/**
* mono_get_exception_array_type_mismatch:
- *
- * Returns: a new instance of the `System.ArrayTypeMismatchException`
+ * \returns a new instance of the \c System.ArrayTypeMismatchException
*/
MonoException *
mono_get_exception_array_type_mismatch ()
/**
* mono_get_exception_type_load:
- * @class_name: the name of the class that could not be loaded
- * @assembly_name: the assembly where the class was looked up.
- *
- * Returns: a new instance of the `System.TypeLoadException`
+ * \param class_name the name of the class that could not be loaded
+ * \param assembly_name the assembly where the class was looked up.
+ * \returns a new instance of the \c System.TypeLoadException
*/
MonoException *
mono_get_exception_type_load (MonoString *class_name, char *assembly_name)
/**
* mono_get_exception_not_implemented:
- * @msg: the message to pass to the user
- *
- * Returns: a new instance of the `System.NotImplementedException`
+ * \param msg the message to pass to the user
+ * \returns a new instance of the \c System.NotImplementedException
*/
MonoException *
mono_get_exception_not_implemented (const char *msg)
/**
* mono_get_exception_not_supported:
- * @msg: the message to pass to the user
- *
- * Returns: a new instance of the `System.NotSupportedException`
+ * \param msg the message to pass to the user
+ * \returns a new instance of the \c System.NotSupportedException
*/
MonoException *
mono_get_exception_not_supported (const char *msg)
/**
* mono_get_exception_missing_method:
- * @class_name: the class where the lookup was performed.
- * @member_name: the name of the missing method.
- *
- * Returns: a new instance of the `System.MissingMethodException`
+ * \param class_name the class where the lookup was performed.
+ * \param member_name the name of the missing method.
+ * \returns a new instance of the \c System.MissingMethodException
*/
MonoException *
mono_get_exception_missing_method (const char *class_name, const char *member_name)
/**
* mono_get_exception_missing_field:
- * @class_name: the class where the lookup was performed
- * @member_name: the name of the missing method.
- *
- * Returns: a new instance of the `System.MissingFieldException`
+ * \param class_name the class where the lookup was performed
+ * \param member_name the name of the missing method.
+ * \returns a new instance of the \c System.MissingFieldException
*/
MonoException *
mono_get_exception_missing_field (const char *class_name, const char *member_name)
/**
* mono_get_exception_argument_null:
- * @arg: the name of the argument that is null
- *
- * Returns: a new instance of the `System.ArgumentNullException`
+ * \param arg the name of the argument that is null
+ * \returns a new instance of the \c System.ArgumentNullException
*/
MonoException*
mono_get_exception_argument_null (const char *arg)
/**
* mono_get_exception_argument:
- * @arg: the name of the invalid argument.
- *
- * Returns: a new instance of the `System.ArgumentException`
+ * \param arg the name of the invalid argument.
+ * \returns a new instance of the \c System.ArgumentException
*/
MonoException *
mono_get_exception_argument (const char *arg, const char *msg)
/**
* mono_get_exception_argument_out_of_range:
- * @arg: the name of the out of range argument.
- *
- * Returns: a new instance of the `System.ArgumentOutOfRangeException`
+ * \param arg the name of the out of range argument.
+ * \returns a new instance of the \c System.ArgumentOutOfRangeException
*/
MonoException *
mono_get_exception_argument_out_of_range (const char *arg)
/**
* mono_get_exception_thread_state:
- * @msg: the message to present to the user
- *
- * Returns: a new instance of the `System.Threading.ThreadStateException`
+ * \param msg the message to present to the user
+ * \returns a new instance of the \c System.Threading.ThreadStateException
*/
MonoException *
mono_get_exception_thread_state (const char *msg)
/**
* mono_get_exception_io:
- * @msg: the message to present to the user
- *
- * Returns: a new instance of the `System.IO.IOException`
+ * \param msg the message to present to the user
+ * \returns a new instance of the \c System.IO.IOException
*/
MonoException *
mono_get_exception_io (const char *msg)
/**
* mono_get_exception_file_not_found:
- * @fname: the name of the file not found.
- *
- * Returns: a new instance of the `System.IO.FileNotFoundException`
+ * \param fname the name of the file not found.
+ * \returns a new instance of the \c System.IO.FileNotFoundException
*/
MonoException *
mono_get_exception_file_not_found (MonoString *fname)
/**
* mono_get_exception_file_not_found2:
- * @msg: an informative message for the user.
- * @fname: the name of the file not found.
- *
- * Returns: a new instance of the `System.IO.FileNotFoundException`
+ * \param msg an informative message for the user.
+ * \param fname the name of the file not found.
+ * \returns a new instance of the \c System.IO.FileNotFoundException
*/
MonoException *
mono_get_exception_file_not_found2 (const char *msg, MonoString *fname)
/**
* mono_get_exception_type_initialization:
- * @type_name: the name of the type that failed to initialize.
- * @inner: the inner exception.
- *
- * Returns: a new instance of the `System.TypeInitializationException`
+ * \param type_name the name of the type that failed to initialize.
+ * \param inner the inner exception.
+ * \returns a new instance of the \c System.TypeInitializationException
*/
MonoException *
mono_get_exception_type_initialization (const gchar *type_name, MonoException *inner)
/**
* mono_get_exception_synchronization_lock:
- * @inner: the inner exception.
- *
- * Returns: a new instance of the `System.SynchronizationLockException`
+ * \param inner the inner exception.
+ * \returns a new instance of the \c System.SynchronizationLockException
*/
MonoException *
mono_get_exception_synchronization_lock (const char *msg)
/**
* mono_get_exception_cannot_unload_appdomain:
- * @inner: the inner exception.
- *
- * Returns: a new instance of the `System.CannotUnloadAppDomainException`
+ * \param inner the inner exception.
+ * \returns a new instance of the \c System.CannotUnloadAppDomainException
*/
MonoException *
mono_get_exception_cannot_unload_appdomain (const char *msg)
/**
* mono_get_exception_appdomain_unloaded
- *
- * Returns: a new instance of the `System.AppDomainUnloadedException`
+ * \returns a new instance of the \c System.AppDomainUnloadedException
*/
MonoException *
mono_get_exception_appdomain_unloaded (void)
/**
* mono_get_exception_bad_image_format:
- * @msg: an informative message for the user.
- *
- * Returns: a new instance of the `System.BadImageFormatException`
+ * \param msg an informative message for the user.
+ * \returns a new instance of the \c System.BadImageFormatException
*/
MonoException *
mono_get_exception_bad_image_format (const char *msg)
/**
* mono_get_exception_bad_image_format2:
- * @msg: an informative message for the user.
- * @fname: The full name of the file with the invalid image.
- *
- * Returns: a new instance of the `System.BadImageFormatException`
+ * \param msg an informative message for the user.
+ * \param fname The full name of the file with the invalid image.
+ * \returns a new instance of the \c System.BadImageFormatException
*/
MonoException *
mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname)
/**
* mono_get_exception_stack_overflow:
- *
- * Returns: a new instance of the `System.StackOverflowException`
+ * \returns a new instance of the \c System.StackOverflowException
*/
MonoException *
mono_get_exception_stack_overflow (void)
/**
* mono_get_exception_out_of_memory:
- *
- * Returns: a new instance of the `System.OutOfMemoryException`
+ * \returns a new instance of the \c System.OutOfMemoryException
*/
MonoException *
mono_get_exception_out_of_memory (void)
/**
* mono_get_exception_field_access:
- *
- * Returns: a new instance of the `System.FieldAccessException`
+ * \returns a new instance of the \c System.FieldAccessException
*/
MonoException *
mono_get_exception_field_access (void)
/**
* mono_get_exception_field_access2:
- * @msg: an informative message for the user.
- *
- * Returns: a new instance of the `System.FieldAccessException`
+ * \param msg an informative message for the user.
+ * \returns a new instance of the \c System.FieldAccessException
*/
MonoException *
mono_get_exception_field_access_msg (const char *msg)
/**
* mono_get_exception_method_access:
- *
- * Returns: a new instance of the `System.MethodAccessException`
+ * \returns a new instance of the \c System.MethodAccessException
*/
MonoException *
mono_get_exception_method_access (void)
/**
* mono_get_exception_method_access2:
- * @msg: an informative message for the user.
- *
- * Returns: a new instance of the `System.MethodAccessException`
+ * \param msg an informative message for the user.
+ * \returns a new instance of the \c System.MethodAccessException
*/
MonoException *
mono_get_exception_method_access_msg (const char *msg)
/**
* mono_get_exception_reflection_type_load:
- * @types: an array of types that were defined in the moduled loaded.
- * @exceptions: an array of exceptions that were thrown during the type loading.
- *
- * Returns: a new instance of the `System.Reflection.ReflectionTypeLoadException`
+ * \param types an array of types that were defined in the moduled loaded.
+ * \param exceptions an array of exceptions that were thrown during the type loading.
+ * \returns a new instance of the \c System.Reflection.ReflectionTypeLoadException
*/
MonoException *
mono_get_exception_reflection_type_load (MonoArray *types_raw, MonoArray *exceptions_raw)
return exc;
}
+/**
+ * mono_get_exception_runtime_wrapped:
+ */
MonoException *
mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
{
/**
* mono_error_raise_exception:
- * @target_error: the exception to raise
+ * \param target_error the exception to raise
*
- * Raises the exception of @target_error.
- * Does nothing if @target_error has a success error code.
+ * Raises the exception of \p target_error.
+ * Does nothing if \p target_error has a success error code.
* Aborts in case of a double fault. This happens when it can't recover from an error caused by trying
* to construct the first exception object.
- * The error object @target_error is cleaned up.
+ * The error object \p target_error is cleaned up.
*/
void
mono_error_raise_exception (MonoError *target_error)
/**
* mono_error_set_pending_exception:
- * @error: The error
- *
- *
- * If @error is set, convert it to an exception and set the pending exception for the current icall.
- * Returns TRUE if @error was set, or FALSE otherwise, so that you can write:
+ * \param error The error
+ * If \p error is set, convert it to an exception and set the pending exception for the current icall.
+ * \returns TRUE if \p error was set, or FALSE otherwise, so that you can write:
* if (mono_error_set_pending_exception (error)) {
* { ... cleanup code ... }
* return;
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_EXCEPTION_H_
#define _MONO_METADATA_EXCEPTION_H_
-/*
- * file-mmap-posix.c: File mmap internal calls
+/**
+ * \file
+ * File mmap internal calls
*
* Author:
* Rodrigo Kumpera
-/*
- * file-mmap-windows.c: MemoryMappedFile internal calls for Windows
+/**
+ * \file
+ * MemoryMappedFile internal calls for Windows
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * file-mmap.h: Managed mmap wrappers.
+/**
+ * \file
+ * Managed mmap wrappers.
*
* Authors:
* Rodrigo Kumpera
-/*
- * filewatcher.c: File System Watcher internal calls
+/**
+ * \file
+ * File System Watcher internal calls
*
* Authors:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
- * filewatcher.h: File System Watcher internal calls
+/**
+ * \file
+ * File System Watcher internal calls
*
* Authors:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
-/*
- * metadata/gc-internals.h: Internal GC interface
+/**
+ * \file
+ * Internal GC interface
*
* Author: Paolo Molaro <lupus@ximian.com>
*
-/*
- * gc-stats.c: GC statistics.
+/**
+ * \file
+ * GC statistics.
*
* Copyright (C) 2015 Xamarin Inc
*
-/*
- * metadata/gc.c: GC icalls.
+/**
+ * \file
+ * GC icalls.
*
* Author: Paolo Molaro <lupus@ximian.com>
*
/**
* mono_object_register_finalizer:
- * @obj: object to register
+ * \param obj object to register
*
- * Records that object @obj has a finalizer, this will call the
+ * Records that object \p obj has a finalizer, this will call the
* Finalize method when the garbage collector disposes the object.
*
*/
/**
* mono_domain_finalize:
- * @domain: the domain to finalize
- * @timeout: msects to wait for the finalization to complete, -1 to wait indefinitely
+ * \param domain the domain to finalize
+ * \param timeout msecs to wait for the finalization to complete, \c -1 to wait indefinitely
*
- * Request finalization of all finalizable objects inside @domain. Wait
- * @timeout msecs for the finalization to complete.
+ * Request finalization of all finalizable objects inside \p domain. Wait
+ * \p timeout msecs for the finalization to complete.
*
- * Returns: TRUE if succeeded, FALSE if there was a timeout
+ * \returns TRUE if succeeded, FALSE if there was a timeout
*/
-
gboolean
mono_domain_finalize (MonoDomain *domain, guint32 timeout)
{
/**
* mono_gc_is_finalizer_thread:
- * @thread: the thread to test.
+ * \param thread the thread to test.
*
* In Mono objects are finalized asynchronously on a separate thread.
- * This routine tests whether the @thread argument represents the
+ * This routine tests whether the \p thread argument represents the
* finalization thread.
*
- * Returns: TRUE if @thread is the finalization thread.
+ * \returns TRUE if \p thread is the finalization thread.
*/
gboolean
mono_gc_is_finalizer_thread (MonoThread *thread)
}
/**
* mono_gc_reference_queue_new:
- * @callback callback used when processing collected entries.
+ * \param callback callback used when processing collected entries.
*
* Create a new reference queue used to process collected objects.
* A reference queue let you add a pair of (managed object, user data)
- * using the mono_gc_reference_queue_add method.
+ * using the \c mono_gc_reference_queue_add method.
*
- * Once the managed object is collected @callback will be called
+ * Once the managed object is collected \p callback will be called
* in the finalizer thread with 'user data' as argument.
*
* The callback is called from the finalizer thread without any locks held.
- * When a AppDomain is unloaded, all callbacks for objects belonging to it
+ * When an AppDomain is unloaded, all callbacks for objects belonging to it
* will be invoked.
*
- * @returns the new queue.
+ * \returns the new queue.
*/
MonoReferenceQueue*
mono_gc_reference_queue_new (mono_reference_queue_callback callback)
/**
* mono_gc_reference_queue_add:
- * @queue the queue to add the reference to.
- * @obj the object to be watched for collection
- * @user_data parameter to be passed to the queue callback
+ * \param queue the queue to add the reference to.
+ * \param obj the object to be watched for collection
+ * \param user_data parameter to be passed to the queue callback
*
- * Queue an object to be watched for collection, when the @obj is
- * collected, the callback that was registered for the @queue will
- * be invoked with @user_data as argument.
+ * Queue an object to be watched for collection, when the \p obj is
+ * collected, the callback that was registered for the \p queue will
+ * be invoked with \p user_data as argument.
*
- * @returns false if the queue is scheduled to be freed.
+ * \returns FALSE if the queue is scheduled to be freed.
*/
gboolean
mono_gc_reference_queue_add (MonoReferenceQueue *queue, MonoObject *obj, void *user_data)
/**
* mono_gc_reference_queue_free:
- * @queue the queue that should be freed.
+ * \param queue the queue that should be freed.
*
- * This operation signals that @queue should be freed. This operation is deferred
+ * This operation signals that \p queue should be freed. This operation is deferred
* as it happens on the finalizer thread.
*
* After this call, no further objects can be queued. It's the responsibility of the
-/*
- * handle.c: Handle to object in native code
+/**
+ * \file
+ * Handle to object in native code
*
* Authors:
* - Ludovic Henry <ludovic@xamarin.com>
-/*
- * handle.h: Handle to object in native code
+/**
+ * \file
+ * Handle to object in native code
*
* Authors:
* - Ludovic Henry <ludovic@xamarin.com>
-/*
+/**
+ * \file
* This file contains the default set of the mono internal calls.
* Each type that has internal call methods must be declared here
* with the ICALL_TYPE macro as follows:
ICALL_TYPE(ARRAY, "System.Array", ARRAY_1)
ICALL(ARRAY_1, "ClearInternal", ves_icall_System_Array_ClearInternal)
-ICALL(ARRAY_2, "Clone", ves_icall_System_Array_Clone)
ICALL(ARRAY_3, "CreateInstanceImpl", ves_icall_System_Array_CreateInstanceImpl)
ICALL(ARRAY_14, "CreateInstanceImpl64", ves_icall_System_Array_CreateInstanceImpl64)
ICALL(ARRAY_4, "FastCopy", ves_icall_System_Array_FastCopy)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * icall-windows-uwp.c: UWP icall support for Mono.
+/**
+ * \file
+ * UWP icall support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * icall-windows.c: Windows icall support.
+/**
+ * \file
+ * Windows icall support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * icall.c:
+/**
+ * \file
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
mono_gc_bzero_atomic (mono_array_addr_with_size_fast (arr, sz, idx), length * sz);
}
-ICALL_EXPORT MonoArray*
-ves_icall_System_Array_Clone (MonoArray *arr)
-{
- MonoError error;
- MonoArray *result = mono_array_clone_checked (arr, &error);
- mono_error_set_pending_exception (&error);
- return result;
-}
ICALL_EXPORT gboolean
ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* dest, int dest_idx, int length)
ves_icall_Remoting_RealProxy_InternalGetProxyType (MonoTransparentProxy *tp)
{
MonoError error;
+ g_assert (tp != NULL && mono_object_class (tp) == mono_defaults.transparent_proxy_class);
+ g_assert (tp->remote_class != NULL && tp->remote_class->proxy_class != NULL);
MonoReflectionType *ret = mono_type_get_object_checked (mono_object_domain (tp), &tp->remote_class->proxy_class->byval_arg, &error);
mono_error_set_pending_exception (&error);
MonoMethod *base = mono_method_get_base_method (method, definition, error);
return_val_if_nok (error, MONO_HANDLE_CAST (MonoReflectionMethod, NULL_HANDLE));
- if (base == method)
- return m;
- else
- return mono_method_get_object_handle (mono_domain_get (), base, NULL, error);
+ if (base == method) {
+ /* we want to short-circuit and return 'm' here. But we should
+ return the same method object that
+ mono_method_get_object_handle, below would return. Since
+ that call takes NULL for the reftype argument, it will take
+ base->klass as the reflected type for the MonoMethod. So we
+ need to check that m also has base->klass as the reflected
+ type. */
+ MonoReflectionTypeHandle orig_reftype = MONO_HANDLE_NEW_GET (MonoReflectionType, m, reftype);
+ MonoClass *orig_klass = mono_class_from_mono_type (MONO_HANDLE_GETVAL (orig_reftype, type));
+ if (base->klass == orig_klass)
+ return m;
+ }
+ return mono_method_get_object_handle (mono_domain_get (), base, NULL, error);
}
ICALL_EXPORT MonoStringHandle
/**
* mono_add_internal_call:
- * @name: method specification to surface to the managed world
- * @method: pointer to a C method to invoke when the method is called
+ * \param name method specification to surface to the managed world
+ * \param method pointer to a C method to invoke when the method is called
*
- * This method surfaces the C function pointed by @method as a method
+ * This method surfaces the C function pointed by \p method as a method
* that has been surfaced in managed code with the method specified in
- * @name as an internal call.
+ * \p name as an internal call.
*
* Internal calls are surfaced to all app domains loaded and they are
* accessibly by a type with the specified name.
*
* For example, the following are all valid declarations:
*
- * "MyApp.Services.ScriptService:Accelerate"
- * "MyApp.Services.ScriptService:Slowdown(int,bool)"
+ * \c MyApp.Services.ScriptService:Accelerate
+ *
+ * \c MyApp.Services.ScriptService:Slowdown(int,bool)
*
* You use method parameters in cases where there might be more than
* one surface method to managed code. That way you can register different
* internal calls for different method overloads.
*
* The internal calls are invoked with no marshalling. This means that .NET
- * types like System.String are exposed as `MonoString *` parameters. This is
+ * types like \c System.String are exposed as \c MonoString* parameters. This is
* different than the way that strings are surfaced in P/Invoke.
*
* For more information on how the parameters are marshalled, see the
/**
* mono_lookup_internal_call_full:
- * @method: the method to look up
- * @uses_handles: out argument if method needs handles around managed objects.
- *
- * Returns a pointer to the icall code for the given method. If
- * uses_handles is not NULL, it will be set to TRUE if the method
+ * \param method the method to look up
+ * \param uses_handles out argument if method needs handles around managed objects.
+ * \returns a pointer to the icall code for the given method. If
+ * \p uses_handles is not NULL, it will be set to TRUE if the method
* needs managed objects wrapped using the infrastructure in handle.h
*
* If the method is not found, warns and returns NULL.
#endif
}
+/**
+ * mono_lookup_internal_call:
+ */
gpointer
mono_lookup_internal_call (MonoMethod *method)
{
-/*
+/**
+ * \file
* Copyright 2015 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * image.c: Routines for manipulating an image stored in an
+/**
+ * \file
+ * Routines for manipulating an image stored in an
* extended PE/COFF file.
*
* Authors:
}
/**
- * mono_images_rva_map:
- * @image: a MonoImage
- * @addr: relative virtual address (RVA)
+ * mono_image_rva_map:
+ * \param image a \c MonoImage
+ * \param addr relative virtual address (RVA)
*
* This is a low-level routine used by the runtime to map relative
* virtual address (RVA) into their location in memory.
*
- * Returns: the address in memory for the given RVA, or NULL if the
+ * \returns the address in memory for the given RVA, or NULL if the
* RVA is not valid for this image.
*/
char *
/**
* mono_image_ensure_section_idx:
- * @image: The image we are operating on
- * @section: section number that we will load/map into memory
+ * \param image The image we are operating on
+ * \param section section number that we will load/map into memory
*
* This routine makes sure that we have an in-memory copy of
- * an image section (.text, .rsrc, .data).
+ * an image section (<code>.text</code>, <code>.rsrc</code>, <code>.data</code>).
*
- * Returns: TRUE on success
+ * \returns TRUE on success
*/
int
mono_image_ensure_section_idx (MonoImage *image, int section)
/**
* mono_image_ensure_section:
- * @image: The image we are operating on
- * @section: section name that we will load/map into memory
+ * \param image The image we are operating on
+ * \param section section name that we will load/map into memory
*
* This routine makes sure that we have an in-memory copy of
* an image section (.text, .rsrc, .data).
*
- * Returns: TRUE on success
+ * \returns TRUE on success
*/
int
mono_image_ensure_section (MonoImage *image, const char *section)
}
i = ((MonoImageLoader*)image->loader)->load_tables (image);
- g_assert (image->heap_guid.data);
if (!image->metadata_only) {
+ g_assert (image->heap_guid.data);
g_assert (image->heap_guid.size >= 16);
image->guid = mono_guid_to_string ((guint8*)image->heap_guid.data);
return image->modules [idx - 1];
}
+/**
+ * mono_image_load_module:
+ */
MonoImage*
mono_image_load_module (MonoImage *image, int idx)
{
return (gpointer*)&klass->next_class_cache;
}
+/**
+ * mono_image_init:
+ */
void
mono_image_init (MonoImage *image)
{
The ignored_assemblies list is generated using tools/nuget-hash-extractor and feeding the problematic nugets to it.
-Right now the list of nugets are the ones that provide the assemblies in $ignored_assemblies_names.
+Right now the list of nugets are the ones that provide the assemblies in $ignored_assemblies_file_names.
This is to be removed once a proper fix is shipped through nuget.
const char guid [40];
} IgnoredAssembly;
-const char *ignored_assemblies_names[] = {
+typedef struct {
+ int assembly_name;
+ guint16 major, minor, build, revision;
+} IgnoredAssemblyVersion;
+
+const char *ignored_assemblies_file_names[] = {
"System.Runtime.InteropServices.RuntimeInformation.dll",
"System.Globalization.Extensions.dll",
"System.IO.Compression.dll",
IGNORED_ASSEMBLY (0x75B4B041, SYS_VALUE_TUPLE, "F81A4140-A898-4E2B-B6E9-55CE78C273EC", "4.3.0 netstandard1.0"),
};
+
+const char *ignored_assemblies_names[] = {
+ "System.Runtime.InteropServices.RuntimeInformation",
+ "System.Globalization.Extensions",
+ "System.IO.Compression",
+ "System.Net.Http",
+ "System.Text.Encoding.CodePages",
+ "System.Reflection.DispatchProxy",
+ "System.ValueTuple"
+};
+
+#define IGNORED_ASM_VER(NAME, MAJOR, MINOR, BUILD, REVISION) { .assembly_name = NAME, .major = MAJOR, .minor = MINOR, .build = BUILD, .revision = REVISION }
+
+static const IgnoredAssemblyVersion ignored_assembly_versions [] = {
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 0, 0),
+ IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 2, 0),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 0),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 1),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_VALUE_TUPLE, 4, 0, 1, 0),
+};
+
+gboolean
+mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 minor, guint16 build, guint16 revision)
+{
+ for (int i = 0; i < G_N_ELEMENTS (ignored_assembly_versions); ++i) {
+ if (ignored_assembly_versions [i].major != major ||
+ ignored_assembly_versions [i].minor != minor ||
+ ignored_assembly_versions [i].build != build ||
+ ignored_assembly_versions [i].revision != revision)
+ continue;
+ if (!strcmp (ignored_assemblies_names [ignored_assembly_versions [i].assembly_name], name))
+ return TRUE;
+ }
+ return FALSE;
+}
+
/*
Equivalent C# code:
static void Main () {
// Either sort by hash and bseach or use SoA and make the linear search more cache efficient.
for (int i = 0; i < G_N_ELEMENTS (ignored_assemblies); ++i) {
if (ignored_assemblies [i].hash == h && !strcmp (image->guid, ignored_assemblies [i].guid)) {
- const char *needle = ignored_assemblies_names [ignored_assemblies [i].assembly_name];
+ const char *needle = ignored_assemblies_file_names [ignored_assemblies [i].assembly_name];
size_t needle_len = strlen (needle);
size_t asm_len = strlen (image->name);
if (asm_len > needle_len && !g_ascii_strcasecmp (image->name + (asm_len - needle_len), needle))
}
/**
- * mono_image_loaded:
- * @name: path or assembly name of the image to load
- * @refonly: Check with respect to reflection-only loads?
+ * mono_image_loaded_full:
+ * \param name path or assembly name of the image to load
+ * \param refonly Check with respect to reflection-only loads?
*
* This routine verifies that the given image is loaded.
* It checks either reflection-only loads only, or normal loads only, as specified by parameter.
*
- * Returns: the loaded MonoImage, or NULL on failure.
+ * \returns the loaded \c MonoImage, or NULL on failure.
*/
MonoImage *
mono_image_loaded_full (const char *name, gboolean refonly)
/**
* mono_image_loaded:
- * @name: path or assembly name of the image to load
- *
+ * \param name path or assembly name of the image to load
* This routine verifies that the given image is loaded. Reflection-only loads do not count.
- *
- * Returns: the loaded MonoImage, or NULL on failure.
+ * \returns the loaded \c MonoImage, or NULL on failure.
*/
MonoImage *
mono_image_loaded (const char *name)
data->res = image;
}
+/**
+ * mono_image_loaded_by_guid_full:
+ */
MonoImage *
mono_image_loaded_by_guid_full (const char *guid, gboolean refonly)
{
return data.res;
}
+/**
+ * mono_image_loaded_by_guid:
+ */
MonoImage *
mono_image_loaded_by_guid (const char *guid)
{
return register_image (image);
}
+/**
+ * mono_image_open_from_data_with_name:
+ */
MonoImage *
mono_image_open_from_data_with_name (char *data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus *status, gboolean refonly, const char *name)
{
return mono_image_open_from_data_internal (data, data_len, need_copy, status, refonly, FALSE, name);
}
+/**
+ * mono_image_open_from_data_full:
+ */
MonoImage *
mono_image_open_from_data_full (char *data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus *status, gboolean refonly)
{
return mono_image_open_from_data_with_name (data, data_len, need_copy, status, refonly, NULL);
}
+/**
+ * mono_image_open_from_data:
+ */
MonoImage *
mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus *status)
{
}
#endif
+/**
+ * mono_image_open_full:
+ */
MonoImage *
mono_image_open_full (const char *fname, MonoImageOpenStatus *status, gboolean refonly)
{
/**
* mono_image_open:
- * @fname: filename that points to the module we want to open
- * @status: An error condition is returned in this field
- *
- * Returns: An open image of type %MonoImage or NULL on error.
+ * \param fname filename that points to the module we want to open
+ * \param status An error condition is returned in this field
+ * \returns An open image of type \c MonoImage or NULL on error.
* The caller holds a temporary reference to the returned image which should be cleared
- * when no longer needed by calling mono_image_close ().
- * if NULL, then check the value of @status for details on the error
+ * when no longer needed by calling \c mono_image_close.
+ * if NULL, then check the value of \p status for details on the error
*/
MonoImage *
mono_image_open (const char *fname, MonoImageOpenStatus *status)
/**
* mono_pe_file_open:
- * @fname: filename that points to the module we want to open
- * @status: An error condition is returned in this field
- *
- * Returns: An open image of type %MonoImage or NULL on error. if
- * NULL, then check the value of @status for details on the error.
- * This variant for mono_image_open DOES NOT SET UP CLI METADATA.
- * It's just a PE file loader, used for FileVersionInfo. It also does
+ * \param fname filename that points to the module we want to open
+ * \param status An error condition is returned in this field
+ * \returns An open image of type \c MonoImage or NULL on error. if
+ * NULL, then check the value of \p status for details on the error.
+ * This variant for \c mono_image_open DOES NOT SET UP CLI METADATA.
+ * It's just a PE file loader, used for \c FileVersionInfo. It also does
* not use the image cache.
*/
MonoImage *
/**
* mono_image_open_raw
- * @fname: filename that points to the module we want to open
- * @status: An error condition is returned in this field
- *
- * Returns an image without loading neither pe or cli data.
- *
+ * \param fname filename that points to the module we want to open
+ * \param status An error condition is returned in this field
+ * \returns an image without loading neither pe or cli data.
* Use mono_image_load_pe_data and mono_image_load_cli_data to load them.
*/
MonoImage *
return do_mono_image_open (fname, status, TRUE, TRUE, FALSE, TRUE, FALSE);
}
+/**
+ * mono_image_fixup_vtable:
+ */
void
mono_image_fixup_vtable (MonoImage *image)
{
/**
* mono_image_addref:
- * @image: The image file we wish to add a reference to
- *
- * Increases the reference count of an image.
+ * \param image The image file we wish to add a reference to
+ * Increases the reference count of an image.
*/
void
mono_image_addref (MonoImage *image)
/**
* mono_image_close:
- * @image: The image file we wish to close
- *
+ * \param image The image file we wish to close
* Closes an image file, deallocates all memory consumed and
* unmaps all possible sections of the file
*/
/**
* mono_image_strerror:
- * @status: an code indicating the result from a recent operation
- *
- * Returns: a string describing the error
+ * \param status an code indicating the result from a recent operation
+ * \returns a string describing the error
*/
const char *
mono_image_strerror (MonoImageOpenStatus status)
/**
* mono_image_lookup_resource:
- * @image: the image to look up the resource in
- * @res_id: A MONO_PE_RESOURCE_ID_ that represents the resource ID to lookup.
- * @lang_id: The language id.
- * @name: the resource name to lookup.
- *
- * Returns: NULL if not found, otherwise a pointer to the in-memory representation
- * of the given resource. The caller should free it using g_free () when no longer
+ * \param image the image to look up the resource in
+ * \param res_id A \c MONO_PE_RESOURCE_ID_ that represents the resource ID to lookup.
+ * \param lang_id The language id.
+ * \param name the resource name to lookup.
+ * \returns NULL if not found, otherwise a pointer to the in-memory representation
+ * of the given resource. The caller should free it using \c g_free when no longer
* needed.
*/
gpointer
/**
* mono_image_get_entry_point:
- * @image: the image where the entry point will be looked up.
- *
+ * \param image the image where the entry point will be looked up.
* Use this routine to determine the metadata token for method that
* has been flagged as the entry point.
- *
- * Returns: the token for the entry point method in the image
+ * \returns the token for the entry point method in the image
*/
guint32
mono_image_get_entry_point (MonoImage *image)
/**
* mono_image_get_resource:
- * @image: the image where the resource will be looked up.
- * @offset: The offset to add to the resource
- * @size: a pointer to an int where the size of the resource will be stored
+ * \param image the image where the resource will be looked up.
+ * \param offset The offset to add to the resource
+ * \param size a pointer to an int where the size of the resource will be stored
*
* This is a low-level routine that fetches a resource from the
- * metadata that starts at a given @offset. The @size parameter is
+ * metadata that starts at a given \p offset. The \p size parameter is
* filled with the data field as encoded in the metadata.
*
- * Returns: the pointer to the resource whose offset is @offset.
+ * \returns the pointer to the resource whose offset is \p offset.
*/
const char*
mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size)
return res;
}
+/**
+ * mono_image_load_file_for_image:
+ */
MonoImage*
mono_image_load_file_for_image (MonoImage *image, int fileidx)
{
/**
* mono_image_get_strong_name:
- * @image: a MonoImage
- * @size: a guint32 pointer, or NULL.
+ * \param image a MonoImage
+ * \param size a \c guint32 pointer, or NULL.
*
- * If the image has a strong name, and @size is not NULL, the value
+ * If the image has a strong name, and \p size is not NULL, the value
* pointed to by size will have the size of the strong name.
*
- * Returns: NULL if the image does not have a strong name, or a
+ * \returns NULL if the image does not have a strong name, or a
* pointer to the public key.
*/
const char*
/**
* mono_image_strong_name_position:
- * @image: a MonoImage
- * @size: a guint32 pointer, or NULL.
+ * \param image a \c MonoImage
+ * \param size a \c guint32 pointer, or NULL.
*
- * If the image has a strong name, and @size is not NULL, the value
+ * If the image has a strong name, and \p size is not NULL, the value
* pointed to by size will have the size of the strong name.
*
- * Returns: the position within the image file where the strong name
+ * \returns the position within the image file where the strong name
* is stored.
*/
guint32
/**
* mono_image_get_public_key:
- * @image: a MonoImage
- * @size: a guint32 pointer, or NULL.
+ * \param image a \c MonoImage
+ * \param size a \c guint32 pointer, or NULL.
*
- * This is used to obtain the public key in the @image.
+ * This is used to obtain the public key in the \p image.
*
- * If the image has a public key, and @size is not NULL, the value
+ * If the image has a public key, and \p size is not NULL, the value
* pointed to by size will have the size of the public key.
*
- * Returns: NULL if the image does not have a public key, or a pointer
+ * \returns NULL if the image does not have a public key, or a pointer
* to the public key.
*/
const char*
/**
* mono_image_get_name:
- * @name: a MonoImage
- *
- * Returns: the name of the assembly.
+ * \param name a \c MonoImage
+ * \returns the name of the assembly.
*/
const char*
mono_image_get_name (MonoImage *image)
/**
* mono_image_get_filename:
- * @image: a MonoImage
- *
- * Used to get the filename that hold the actual MonoImage
- *
- * Returns: the filename.
+ * \param image a \c MonoImage
+ * Used to get the filename that hold the actual \c MonoImage
+ * \returns the filename.
*/
const char*
mono_image_get_filename (MonoImage *image)
return image->name;
}
+/**
+ * mono_image_get_guid:
+ */
const char*
mono_image_get_guid (MonoImage *image)
{
return image->guid;
}
+/**
+ * mono_image_get_table_info:
+ */
const MonoTableInfo*
mono_image_get_table_info (MonoImage *image, int table_id)
{
return &image->tables [table_id];
}
+/**
+ * mono_image_get_table_rows:
+ */
int
mono_image_get_table_rows (MonoImage *image, int table_id)
{
return image->tables [table_id].rows;
}
+/**
+ * mono_table_info_get_rows:
+ */
int
mono_table_info_get_rows (const MonoTableInfo *table)
{
/**
* mono_image_get_assembly:
- * @image: the MonoImage.
- *
+ * \param image the \c MonoImage .
* Use this routine to get the assembly that owns this image.
- *
- * Returns: the assembly that holds this image.
+ * \returns the assembly that holds this image.
*/
MonoAssembly*
mono_image_get_assembly (MonoImage *image)
/**
* mono_image_is_dynamic:
- * @image: the MonoImage
+ * \param image the \c MonoImage
*
* Determines if the given image was created dynamically through the
- * System.Reflection.Emit API
- *
- * Returns: TRUE if the image was created dynamically, FALSE if not.
+ * \c System.Reflection.Emit API
+ * \returns TRUE if the image was created dynamically, FALSE if not.
*/
gboolean
mono_image_is_dynamic (MonoImage *image)
/**
* mono_image_has_authenticode_entry:
- * @image: the MonoImage
- *
+ * \param image the \c MonoImage
* Use this routine to determine if the image has a Authenticode
* Certificate Table.
- *
- * Returns: TRUE if the image contains an authenticode entry in the PE
+ * \returns TRUE if the image contains an authenticode entry in the PE
* directory.
*/
gboolean
/**
* mono_image_property_lookup:
- *
- * Lookup a property on @image. Used to store very rare fields of MonoClass and MonoMethod.
+ * Lookup a property on \p image . Used to store very rare fields of \c MonoClass and \c MonoMethod .
*
* LOCKING: Takes the image lock
*/
/**
* mono_image_property_insert:
- *
- * Insert a new property @property with value @value on @subject in @image. Used to store very rare fields of MonoClass and MonoMethod.
+ * Insert a new property \p property with value \p value on \p subject in \p
+ * image. Used to store very rare fields of \c MonoClass and \c MonoMethod.
*
* LOCKING: Takes the image lock
*/
/**
* mono_image_property_remove:
- *
- * Remove all properties associated with @subject in @image. Used to store very rare fields of MonoClass and MonoMethod.
+ * Remove all properties associated with \p subject in \p image. Used to store very rare fields of \c MonoClass and \c MonoMethod .
*
* LOCKING: Takes the image lock
*/
+/**
+ * \file
+ */
+
#ifndef _MONONET_METADATA_IMAGE_H_
#define _MONONET_METADATA_IMAGE_H_
-/*
- * jit-info.c: MonoJitInfo functionality
+/**
+ * \file
+ * MonoJitInfo functionality
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_jit_info_table_find:
- * @domain: Domain that you want to look up
- * @addr: Points to an address with JITed code.
+ * \param domain Domain that you want to look up
+ * \param addr Points to an address with JITed code.
*
- * Use this function to obtain a `MonoJitInfo*` object that can be used to get
- * some statistics. You should provide both the @domain on which you will be
- * performing the probe, and an address. Since application domains can share code
+ * Use this function to obtain a \c MonoJitInfo* object that can be used to get
+ * some statistics. You should provide both the \p domain on which you will be
+ * performing the probe, and an address. Since application domains can share code
* the same address can be in use by multiple domains at once.
*
* This does not return any results for trampolines.
*
- * Returns: NULL if the address does not belong to JITed code (it might be native
- * code or a trampoline) or a valid pointer to a `MonoJitInfo*`.
+ * \returns NULL if the address does not belong to JITed code (it might be native
+ * code or a trampoline) or a valid pointer to a \c MonoJitInfo* .
*/
MonoJitInfo*
mono_jit_info_table_find (MonoDomain *domain, char *addr)
/**
* mono_jit_info_get_code_start:
- * @ji: the JIT information handle
+ * \param ji the JIT information handle
*
* Use this function to get the starting address for the method described by
- * the @ji object. You can use this plus the `mono_jit_info_get_code_size`
+ * the \p ji object. You can use this plus the \c mono_jit_info_get_code_size
* to determine the start and end of the native code.
*
- * Returns: Starting address with the native code.
+ * \returns Starting address with the native code.
*/
gpointer
mono_jit_info_get_code_start (MonoJitInfo* ji)
/**
* mono_jit_info_get_code_size:
- * @ji: the JIT information handle
+ * \param ji the JIT information handle
*
* Use this function to get the code size for the method described by
- * the @ji object. You can use this plus the `mono_jit_info_get_code_start`
+ * the \p ji object. You can use this plus the \c mono_jit_info_get_code_start
* to determine the start and end of the native code.
*
- * Returns: Starting address with the native code.
+ * \returns Starting address with the native code.
*/
int
mono_jit_info_get_code_size (MonoJitInfo* ji)
/**
* mono_jit_info_get_method:
- * @ji: the JIT information handle
+ * \param ji the JIT information handle
*
- * Use this function to get the `MonoMethod *` that backs
- * the @ji object.
+ * Use this function to get the \c MonoMethod* that backs
+ * the \p ji object.
*
- * Returns: The MonoMethod that represents the code tracked
- * by @ji.
+ * \returns The \c MonoMethod that represents the code tracked
+ * by \p ji.
*/
MonoMethod*
mono_jit_info_get_method (MonoJitInfo* ji)
-/*
- * loader.c: Image Loader
+/**
+ * \file
+ * Image Loader
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
return field;
}
-/*
+/**
* mono_field_from_token:
- * @deprecated use the _checked variant
+ * \deprecated use the \c _checked variant
* Notes: runtime code MUST not use this function
-*/
+ */
MonoClassField*
mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, MonoGenericContext *context)
{
return NULL;
}
-/*
+/**
* mono_inflate_generic_signature:
*
- * Inflate SIG with CONTEXT, and return a canonical copy. On error, set ERROR, and return NULL.
+ * Inflate \p sig with \p context, and return a canonical copy. On error, set \p error, and return NULL.
*/
MonoMethodSignature*
mono_inflate_generic_signature (MonoMethodSignature *sig, MonoGenericContext *context, MonoError *error)
return NULL;
}
-/*
- * token is the method_ref/def/spec token used in a call IL instruction.
- * @deprecated use the _checked variant
+/**
+ * mono_method_get_signature_full:
+ * \p token is the method ref/def/spec token used in a \c call IL instruction.
+ * \deprecated use the \c _checked variant
* Notes: runtime code MUST not use this function
*/
MonoMethodSignature*
return sig;
}
-/*
- * token is the method_ref/def/spec token used in a call IL instruction.
- * @deprecated use the _checked variant
+/**
+ * mono_method_get_signature:
+ * \p token is the method_ref/def/spec token used in a call IL instruction.
+ * \deprecated use the \c _checked variant
* Notes: runtime code MUST not use this function
*/
MonoMethodSignature*
/**
* mono_dllmap_insert:
- * @assembly: if NULL, this is a global mapping, otherwise the remapping of the dynamic library will only apply to the specified assembly
- * @dll: The name of the external library, as it would be found in the DllImport declaration. If prefixed with 'i:' the matching of the library name is done without case sensitivity
- * @func: if not null, the mapping will only applied to the named function (the value of EntryPoint)
- * @tdll: The name of the library to map the specified @dll if it matches.
- * @tfunc: The name of the function that replaces the invocation. If NULL, it is replaced with a copy of @func.
+ * \param assembly if NULL, this is a global mapping, otherwise the remapping of the dynamic library will only apply to the specified assembly
+ * \param dll The name of the external library, as it would be found in the \c DllImport declaration. If prefixed with <code>i:</code> the matching of the library name is done without case sensitivity
+ * \param func if not null, the mapping will only applied to the named function (the value of <code>EntryPoint</code>)
+ * \param tdll The name of the library to map the specified \p dll if it matches.
+ * \param tfunc The name of the function that replaces the invocation. If NULL, it is replaced with a copy of \p func.
*
* LOCKING: Acquires the loader lock.
*
- * This function is used to programatically add DllImport remapping in either
+ * This function is used to programatically add \c DllImport remapping in either
* a specific assembly, or as a global remapping. This is done by remapping
- * references in a DllImport attribute from the @dll library name into the @tdll
- * name. If the @dll name contains the prefix "i:", the comparison of the
+ * references in a \c DllImport attribute from the \p dll library name into the \p tdll
+ * name. If the \p dll name contains the prefix <code>i:</code>, the comparison of the
* library name is done without case sensitivity.
*
- * If you pass @func, this is the name of the EntryPoint in a DllImport if specified
- * or the name of the function as determined by DllImport. If you pass @func, you
- * must also pass @tfunc which is the name of the target function to invoke on a match.
+ * If you pass \p func, this is the name of the \c EntryPoint in a \c DllImport if specified
+ * or the name of the function as determined by \c DllImport. If you pass \p func, you
+ * must also pass \p tfunc which is the name of the target function to invoke on a match.
*
* Example:
- * mono_dllmap_insert (NULL, "i:libdemo.dll", NULL, relocated_demo_path, NULL);
*
- * The above will remap DllImport statments for "libdemo.dll" and "LIBDEMO.DLL" to
- * the contents of relocated_demo_path for all assemblies in the Mono process.
+ * <code>mono_dllmap_insert (NULL, "i:libdemo.dll", NULL, relocated_demo_path, NULL);</code>
+ *
+ * The above will remap \c DllImport statements for \c libdemo.dll and \c LIBDEMO.DLL to
+ * the contents of \c relocated_demo_path for all assemblies in the Mono process.
*
* NOTE: This can be called before the runtime is initialized, for example from
- * mono_config_parse ().
+ * \c mono_config_parse.
*/
void
mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc)
return g_path_is_absolute (path);
}
+/**
+ * mono_lookup_pinvoke_call:
+ */
gpointer
mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg)
{
return result;
}
+/**
+ * mono_get_method:
+ */
MonoMethod *
mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
{
return result;
}
+/**
+ * mono_get_method_full:
+ */
MonoMethod *
mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
MonoGenericContext *context)
/**
* mono_get_method_constrained:
- *
- * This is used when JITing the `constrained.' opcode.
- *
- * This returns two values: the contrained method, which has been inflated
- * as the function return value; And the original CIL-stream method as
- * declared in cil_method. The later is used for verification.
+ * This is used when JITing the <code>constrained.</code> opcode.
+ * \returns The contrained method, which has been inflated
+ * as the function return value; and the original CIL-stream method as
+ * declared in \p cil_method. The latter is used for verification.
*/
MonoMethod *
mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class,
return get_method_constrained (image, *cil_method, constrained_class, context, error);
}
+/**
+ * mono_free_method:
+ */
void
mono_free_method (MonoMethod *method)
{
}
}
+/**
+ * mono_method_get_param_names:
+ */
void
mono_method_get_param_names (MonoMethod *method, const char **names)
{
}
}
+/**
+ * mono_method_get_param_token:
+ */
guint32
mono_method_get_param_token (MonoMethod *method, int index)
{
return 0;
}
+/**
+ * mono_method_get_marshal_info:
+ */
void
mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs)
{
}
}
+/**
+ * mono_method_has_marshal_info:
+ */
gboolean
mono_method_has_marshal_info (MonoMethod *method)
{
mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (stack_walk_adapter, NULL, MONO_UNWIND_LOOKUP_ALL, &ud);
}
+/**
+ * mono_stack_walk_no_il:
+ */
void
mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data)
{
}
-/*
+/**
* mono_stack_walk_async_safe:
- *
- * Async safe version callable from signal handlers.
+ * Async safe version callable from signal handlers.
*/
void
mono_stack_walk_async_safe (MonoStackWalkAsyncSafe func, void *initial_sig_context, void *user_data)
return managed;
}
+/**
+ * mono_method_get_last_managed:
+ */
MonoMethod*
mono_method_get_last_managed (void)
{
/**
* mono_loader_lock:
*
- * See docs/thread-safety.txt for the locking strategy.
+ * See \c docs/thread-safety.txt for the locking strategy.
*/
void
mono_loader_lock (void)
}
}
+/**
+ * mono_loader_unlock:
+ */
void
mono_loader_unlock (void)
{
}
/**
- * mono_method_signature:
+ * mono_method_signature_checked:
*
* Return the signature of the method M. On failure, returns NULL, and ERR is set.
*/
/**
* mono_method_signature:
- *
- * Return the signature of the method M. On failure, returns NULL.
+ * \returns the signature of the method \p m. On failure, returns NULL.
*/
MonoMethodSignature*
mono_method_signature (MonoMethod *m)
return sig;
}
+/**
+ * mono_method_get_name:
+ */
const char*
mono_method_get_name (MonoMethod *method)
{
return method->name;
}
+/**
+ * mono_method_get_class:
+ */
MonoClass*
mono_method_get_class (MonoMethod *method)
{
return method->klass;
}
+/**
+ * mono_method_get_token:
+ */
guint32
mono_method_get_token (MonoMethod *method)
{
return mono_metadata_parse_mh_full (img, container, (const char *)loc, error);
}
+/**
+ * mono_method_get_header:
+ */
MonoMethodHeader*
mono_method_get_header (MonoMethod *method)
{
}
+/**
+ * mono_method_get_flags:
+ */
guint32
mono_method_get_flags (MonoMethod *method, guint32 *iflags)
{
return method->flags;
}
-/*
- * Find the method index in the metadata methodDef table.
+/**
+ * mono_method_get_index:
+ * Find the method index in the metadata \c MethodDef table.
*/
guint32
mono_method_get_index (MonoMethod *method)
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_LOADER_H_
#define _MONO_METADATA_LOADER_H_ 1
-/*
- * locales.c: Culture-sensitive handling
+/**
+ * \file
+ * Culture-sensitive handling
*
* Authors:
* Dick Porter (dick@ximian.com)
-/*
- * locales.h: Culture-sensitive handling
+/**
+ * \file
+ * Culture-sensitive handling
*
* Authors:
* Dick Porter (dick@ximian.com)
-/*
- * lock-tracer.c: Runtime simple lock tracer
+/**
+ * \file
+ * Runtime simple lock tracer
*
* Authors:
* Rodrigo Kumpera (rkumpera@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_LOCK_TRACER_H__
#define __MONO_METADATA_LOCK_TRACER_H__
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * marshal-windows-uwp.c: UWP marshal support for Mono.
+/**
+ * \file
+ * UWP marshal support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * marshal-windows.c: Windows marshal support.
+/**
+ * \file
+ * Windows marshal support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * marshal.c: Routines for marshaling complex types in P/Invoke methods.
+/**
+ * \file
+ * Routines for marshaling complex types in P/Invoke methods.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
/**
* mono_string_builder_to_utf8:
- * @sb: the string builder
+ * \param sb the string builder
*
- * Converts to utf8 the contents of the MonoStringBuilder.
+ * Converts to utf8 the contents of the \c MonoStringBuilder .
*
- * Returns: a utf8 string with the contents of the StringBuilder.
+ * \returns a utf8 string with the contents of the \c StringBuilder .
*
* The return value must be released with mono_marshal_free.
*
/**
* mono_string_builder_to_utf16:
- * @sb: the string builder
+ * \param sb the string builder
*
- * Converts to utf16 the contents of the MonoStringBuilder.
+ * Converts to utf16 the contents of the \c MonoStringBuilder .
*
- * Returns: a utf16 string with the contents of the StringBuilder.
+ * Returns: a utf16 string with the contents of the \c StringBuilder .
*
* The return value must be released with mono_marshal_free.
*
/**
* mono_string_to_byvalstr:
- * @dst: Where to store the null-terminated utf8 decoded string.
- * @src: the MonoString to copy.
- * @size: the maximum number of bytes to copy.
+ * \param dst Where to store the null-terminated utf8 decoded string.
+ * \param src the \c MonoString to copy.
+ * \param size the maximum number of bytes to copy.
*
- * Copies the MonoString pointed to by @src as a utf8 string
- * into @dst, it copies at most @size bytes into the destination.
+ * Copies the \c MonoString pointed to by \p src as a utf8 string
+ * into \p dst, it copies at most \p size bytes into the destination.
*/
void
mono_string_to_byvalstr (gpointer dst, MonoString *src, int size)
/**
* mono_string_to_byvalwstr:
- * @dst: Where to store the null-terminated utf16 decoded string.
- * @src: the MonoString to copy.
- * @size: the maximum number of wide characters to copy (each consumes 2 bytes)
+ * \param dst Where to store the null-terminated utf16 decoded string.
+ * \param src the \c MonoString to copy.
+ * \param size the maximum number of wide characters to copy (each consumes 2 bytes)
*
- * Copies the MonoString pointed to by @src as a utf16 string into
- * @dst, it copies at most @size bytes into the destination (including
+ * Copies the \c MonoString pointed to by \p src as a utf16 string into
+ * \p dst, it copies at most \p size bytes into the destination (including
* a terminating 16-bit zero terminator).
*/
void
return mono_mb_create_and_cache_full (cache, key, mb, sig, max_stack, NULL, NULL);
}
+/**
+ * mono_marshal_method_from_wrapper:
+ */
MonoMethod *
mono_marshal_method_from_wrapper (MonoMethod *wrapper)
{
return res;
}
+/**
+ * mono_marshal_get_delegate_begin_invoke:
+ */
MonoMethod *
mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
{
#endif /* DISABLE_JIT */
+/**
+ * mono_marshal_get_delegate_end_invoke:
+ */
MonoMethod *
mono_marshal_get_delegate_end_invoke (MonoMethod *method)
{
return res;
}
-/*
- * the returned method invokes all methods in a multicast delegate.
+/**
+ * mono_marshal_get_delegate_invoke:
+ * The returned method invokes all methods in a multicast delegate.
*/
MonoMethod *
mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del)
}
#endif
-/*
- * generates IL code for the runtime invoke function
- * MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method)
+/**
+ * mono_marshal_get_runtime_invoke:
+ * Generates IL code for the runtime invoke function:
*
- * we also catch exceptions if exc != null
- * If VIRTUAL is TRUE, then METHOD is invoked virtually on THIS. This is useful since
- * it means that the compiled code for METHOD does not have to be looked up
+ * <code>MonoObject *runtime_invoke (MonoObject *this_obj, void **params, MonoObject **exc, void* method)</code>
+ *
+ * We also catch exceptions if \p exc is not NULL.
+ * If \p virtual is TRUE, then \p method is invoked virtually on \p this. This is useful since
+ * it means that the compiled code for \p method does not have to be looked up
* before calling the runtime invoke wrapper. In this case, the wrapper ignores
- * its METHOD argument.
+ * its \p method argument.
*/
MonoMethod *
mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
MonoMethodSignature *csig;
MonoExceptionClause *clause;
MonoMethodBuilder *mb;
- int pos, posna;
+ int pos;
char *name;
WrapperInfo *info;
mono_mb_emit_byte (mb, CEE_LDNULL);
mono_mb_emit_stloc (mb, 0);
- /* Check for the abort exception */
- mono_mb_emit_ldloc (mb, 1);
- mono_mb_emit_op (mb, CEE_ISINST, mono_defaults.threadabortexception_class);
- posna = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S);
-
- /* Delay the abort exception */
- mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort);
-
- mono_mb_patch_short_branch (mb, posna);
mono_mb_emit_branch (mb, CEE_LEAVE);
clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset;
}
#endif
-/*
- * generates IL code for the icall wrapper (the generated method
- * calls the unmanaged code in func)
+/**
+ * mono_marshal_get_icall_wrapper:
+ * Generates IL code for the icall wrapper. The generated method
+ * calls the unmanaged code in \p func.
*/
MonoMethod *
mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gconstpointer func, gboolean check_exceptions)
#ifndef DISABLE_JIT
/**
* mono_marshal_emit_native_wrapper:
- * @image: the image to use for looking up custom marshallers
- * @sig: The signature of the native function
- * @piinfo: Marshalling information
- * @mspecs: Marshalling information
- * @aot: whenever the created method will be compiled by the AOT compiler
- * @method: if non-NULL, the pinvoke method to call
- * @check_exceptions: Whenever to check for pending exceptions after the native call
- * @func_param: the function to call is passed as a boxed IntPtr as the first parameter
+ * \param image the image to use for looking up custom marshallers
+ * \param sig The signature of the native function
+ * \param piinfo Marshalling information
+ * \param mspecs Marshalling information
+ * \param aot whenever the created method will be compiled by the AOT compiler
+ * \param method if non-NULL, the pinvoke method to call
+ * \param check_exceptions Whenever to check for pending exceptions after the native call
+ * \param func_param the function to call is passed as a boxed IntPtr as the first parameter
*
- * generates IL code for the pinvoke wrapper, the generated code calls @func.
+ * generates IL code for the pinvoke wrapper, the generated code calls \p func .
*/
void
mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSignature *sig, MonoMethodPInvoke *piinfo, MonoMarshalSpec **mspecs, gpointer func, gboolean aot, gboolean check_exceptions, gboolean func_param)
/**
* mono_marshal_get_native_wrapper:
- * @method: The MonoMethod to wrap.
- * @check_exceptions: Whenever to check for pending exceptions
+ * \param method The \c MonoMethod to wrap.
+ * \param check_exceptions Whenever to check for pending exceptions
*
- * generates IL code for the pinvoke wrapper (the generated method
- * calls the unmanaged code in piinfo->addr)
+ * Generates IL code for the pinvoke wrapper. The generated method
+ * calls the unmanaged code in \c piinfo->addr.
*/
MonoMethod *
mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions, gboolean aot)
/**
* mono_marshal_get_native_func_wrapper:
- * @image: The image to use for memory allocation and for looking up custom marshallers.
- * @sig: The signature of the function
- * @func: The native function to wrap
+ * \param image The image to use for memory allocation and for looking up custom marshallers.
+ * \param sig The signature of the function
+ * \param func The native function to wrap
*
- * Returns a wrapper method around native functions, similar to the pinvoke
+ * \returns a wrapper method around native functions, similar to the pinvoke
* wrapper.
*/
MonoMethod *
}
}
-/*
- * generates IL code to call managed methods from unmanaged code
- * If target_handle==0, the wrapper info will be a WrapperInfo structure.
+/**
+ * mono_marshal_get_managed_wrapper:
+ * Generates IL code to call managed methods from unmanaged code
+ * If \p target_handle is \c 0, the wrapper info will be a \c WrapperInfo structure.
*/
MonoMethod *
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle, MonoError *error)
#endif /* DISABLE_JIT */
-/*
- * This does the equivalent of mono_object_castclass_with_cache.
+/**
+ * mono_marshal_get_castclass_with_cache:
+ * This does the equivalent of \c mono_object_castclass_with_cache.
*/
MonoMethod *
mono_marshal_get_castclass_with_cache (void)
return isinst;
}
-/*
- * This does the equivalent of mono_object_isinst_with_cache.
+/**
+ * mono_marshal_get_isinst_with_cache:
+ * This does the equivalent of \c mono_object_isinst_with_cache.
*/
MonoMethod *
mono_marshal_get_isinst_with_cache (void)
/**
* mono_marshal_get_struct_to_ptr:
- * @klass:
+ * \param klass \c MonoClass
*
- * generates IL code for StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld)
+ * Generates IL code for <code>StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld)</code>
*/
MonoMethod *
mono_marshal_get_struct_to_ptr (MonoClass *klass)
/**
* mono_marshal_get_ptr_to_struct:
- * @klass:
- *
- * generates IL code for PtrToStructure (IntPtr src, object structure)
+ * \param klass \c MonoClass
+ * Generates IL code for <code>PtrToStructure (IntPtr src, object structure)</code>
*/
MonoMethod *
mono_marshal_get_ptr_to_struct (MonoClass *klass)
return res;
}
-/*
- * generates IL code for the synchronized wrapper: the generated method
- * calls METHOD while locking 'this' or the parent type.
+/**
+ * mono_marshal_get_synchronized_wrapper:
+ * Generates IL code for the synchronized wrapper: the generated method
+ * calls \p method while locking \c this or the parent type.
*/
MonoMethod *
mono_marshal_get_synchronized_wrapper (MonoMethod *method)
}
-/*
- * the returned method calls 'method' unboxing the this argument
+/**
+ * mono_marshal_get_unbox_wrapper:
+ * The returned method calls \p method unboxing the \c this argument.
*/
MonoMethod *
mono_marshal_get_unbox_wrapper (MonoMethod *method)
return res;
}
+/**
+ * mono_marshal_get_stelemref:
+ */
MonoMethod*
mono_marshal_get_stelemref (void)
{
/**
* mono_marshal_get_array_address:
- * @rank: rank of the array type
- * @elem_size: size in bytes of an element of an array.
+ * \param rank rank of the array type
+ * \param elem_size size in bytes of an element of an array.
*
* Returns a MonoMethod that implements the code to get the address
- * of an element in a multi-dimenasional array of @rank dimensions.
+ * of an element in a multi-dimenasional array of \p rank dimensions.
* The returned method takes an array as the first argument and then
- * @rank indexes for the @rank dimensions.
+ * \p rank indexes for the \p rank dimensions.
* If ELEM_SIZE is 0, read the array size from the array object.
*/
MonoMethod*
}
#endif
+/**
+ * mono_marshal_alloc:
+ */
void*
mono_marshal_alloc (gulong size, MonoError *error)
{
}
#endif
+/**
+ * mono_marshal_free:
+ */
void
mono_marshal_free (gpointer ptr)
{
mono_marshal_free_co_task_mem (ptr);
}
+/**
+ * mono_marshal_free_array:
+ */
void
mono_marshal_free_array (gpointer *ptr, int size)
{
* mono_marshal_set_last_error:
*
* This function is invoked to set the last error value from a P/Invoke call
- * which has SetLastError set.
+ * which has \c SetLastError set.
*/
void
mono_marshal_set_last_error (void)
/**
* mono_marshal_load_type_info:
*
- * Initialize klass::marshal_info using information from metadata. This function can
+ * Initialize \c klass::marshal_info using information from metadata. This function can
* recursively call itself, and the caller is responsible to avoid that by calling
- * mono_marshal_is_loading_type_info () beforehand.
+ * \c mono_marshal_is_loading_type_info beforehand.
*
* LOCKING: Acquires the loader lock.
*/
/**
* mono_class_native_size:
- * @klass: a class
- *
- * Returns: the native size of an object instance (when marshaled
+ * \param klass a class
+ * \returns the native size of an object instance (when marshaled
* to unmanaged code)
*/
gint32
return 0;
}
+/**
+ * mono_marshal_type_size:
+ */
gint32
mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align,
gboolean as_field, gboolean unicode)
return 0;
}
-/* This is a JIT icall, it sets the pending exception and return NULL on error */
+/**
+ * mono_marshal_asany:
+ * This is a JIT icall, it sets the pending exception and returns NULL on error.
+ */
gpointer
mono_marshal_asany (MonoObject *o, MonoMarshalNative string_encoding, int param_attrs)
{
return NULL;
}
-/* This is a JIT icall, it sets the pending exception */
+/**
+ * mono_marshal_free_asany:
+ * This is a JIT icall, it sets the pending exception
+ */
void
mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_encoding, int param_attrs)
{
-
-/*
- * marshal.h: Routines for marshaling complex types in P/Invoke methods.
+/**
+ * \file
+ * Routines for marshaling complex types in P/Invoke methods.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_MEMPOOL_INTERNALS_H_
#define _MONO_MEMPOOL_INTERNALS_H_
-/*
- * mempool.c: efficient memory allocation
+/**
+ * \file
+ * efficient memory allocation
*
* MonoMemPool is for fast allocation of memory. We free
* all memory when the pool is destroyed.
/**
* mono_mempool_new_size:
- * @initial_size: the amount of memory to initially reserve for the memory pool.
- *
- * Returns: a new memory pool with a specific initial memory reservation.
+ * \param initial_size the amount of memory to initially reserve for the memory pool.
+ * \returns a new memory pool with a specific initial memory reservation.
*/
MonoMemPool *
mono_mempool_new_size (int initial_size)
/**
* mono_mempool_destroy:
- * @pool: the memory pool to destroy
+ * \param pool the memory pool to destroy
*
* Free all memory associated with this pool.
*/
/**
* mono_mempool_invalidate:
- * @pool: the memory pool to invalidate
+ * \param pool the memory pool to invalidate
*
* Fill the memory associated with this pool to 0x2a (42). Useful for debugging.
*/
/**
* mono_mempool_stats:
- * @pool: the momory pool we need stats for
+ * \param pool the memory pool we need stats for
*
* Print a few stats about the mempool:
* - Total memory allocated (malloced) by mem pool
#endif
/**
- * mono_mempool_alloc:
+ * get_next_size:
* @pool: the memory pool to use
* @size: size of the memory entity we are trying to allocate
*
/**
* mono_mempool_alloc:
- * @pool: the memory pool to use
- * @size: size of the memory block
+ * \param pool the memory pool to use
+ * \param size size of the memory block
*
- * Allocates a new block of memory in @pool.
+ * Allocates a new block of memory in \p pool .
*
- * Returns: the address of a newly allocated memory block.
+ * \returns the address of a newly allocated memory block.
*/
gpointer
mono_mempool_alloc (MonoMemPool *pool, guint size)
/**
* mono_mempool_alloc0:
*
- * same as mono_mempool_alloc, but fills memory with zero.
+ * same as \c mono_mempool_alloc, but fills memory with zero.
*/
gpointer
mono_mempool_alloc0 (MonoMemPool *pool, guint size)
/**
* mono_mempool_contains_addr:
*
- * Determines whenever ADDR is inside the memory used by the mempool.
+ * Determines whether \p addr is inside the memory used by the mempool.
*/
gboolean
mono_mempool_contains_addr (MonoMemPool *pool,
+/**
+ * \file
+ */
+
#ifndef _MONO_MEMPOOL_H_
#define _MONO_MEMPOOL_H_
+/**
+ * \file
+ */
+
#include <stdio.h>
#include "config.h"
void
mono_metadata_cross_helpers_run (void);
+/*
+ * mono_metadata_cross_helpers_run:
+ *
+ * Check that the offsets given by object-offsets.h match the offsets
+ * on the host. This only checks the metadata offsets.
+ */
void
mono_metadata_cross_helpers_run (void)
{
+/**
+ * \file
+ */
#ifndef __MONO_METADATA_INTERNALS_H__
#define __MONO_METADATA_INTERNALS_H__
void
mono_loader_register_module (const char *name, MonoDl *module);
+gboolean
+mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 minor, guint16 build, guint16 revision);
+
+void
+mono_ginst_get_desc (GString *str, MonoGenericInst *ginst);
+
#endif /* __MONO_METADATA_INTERNALS_H__ */
-/*
- * metadata-verify.c: Metadata verfication support
+/**
+ * \file
+ * Metadata verfication support
*
* Author:
* Mono Project (http://www.mono-project.com)
-/*
- * metadata.c: Routines for accessing the metadata
+/**
+ * \file
+ * Routines for accessing the metadata
*
* Authors:
* Miguel de Icaza (miguel@ximian.com)
/**
* mono_meta_table_name:
- * @table: table index
+ * \param table table index
*
* Returns the name of the given ECMA metadata logical format table
* as described in ECMA 335, Partition II, Section 22.
*
- * Returns: the name for the @table index
+ * \returns the name for the \p table index
*/
const char *
mono_meta_table_name (int table)
}
/* Reference: Partition II - 23.2.6 */
-/*
+/**
* mono_metadata_compute_size:
- * @meta: metadata context
- * @tableindex: metadata table number
- * @result_bitfield: pointer to guint32 where to store additional info
+ * \param meta metadata context
+ * \param tableindex metadata table number
+ * \param result_bitfield pointer to \c guint32 where to store additional info
*
- * mono_metadata_compute_size() computes the lenght in bytes of a single
+ * \c mono_metadata_compute_size computes the length in bytes of a single
* row in a metadata table. The size of each column is encoded in the
- * @result_bitfield return value along with the number of columns in the table.
- * the resulting bitfield should be handed to the mono_metadata_table_size()
- * and mono_metadata_table_count() macros.
+ * \p result_bitfield return value along with the number of columns in the table.
+ * the resulting bitfield should be handed to the \c mono_metadata_table_size
+ * and \c mono_metadata_table_count macros.
* This is a Mono runtime internal only function.
*/
int
/**
* mono_metadata_compute_table_bases:
- * @meta: metadata context to compute table values
+ * \param meta metadata context to compute table values
*
* Computes the table bases for the metadata structure.
* This is an internal function used by the image loader code.
/**
* mono_metadata_locate:
- * @meta: metadata context
- * @table: table code.
- * @idx: index of element to retrieve from @table.
+ * \param meta metadata context
+ * \param table table code.
+ * \param idx index of element to retrieve from \p table.
*
- * Returns: a pointer to the @idx element in the metadata table
- * whose code is @table.
+ * \returns a pointer to the \p idx element in the metadata table
+ * whose code is \p table.
*/
const char *
mono_metadata_locate (MonoImage *meta, int table, int idx)
/**
* mono_metadata_locate_token:
- * @meta: metadata context
- * @token: metadata token
+ * \param meta metadata context
+ * \param token metadata token
*
- * Returns: a pointer to the data in the metadata represented by the
- * token #token.
+ * \returns a pointer to the data in the metadata represented by the
+ * token \p token .
*/
const char *
mono_metadata_locate_token (MonoImage *meta, guint32 token)
/**
* mono_metadata_string_heap:
- * @meta: metadata context
- * @index: index into the string heap.
- *
- * Returns: an in-memory pointer to the @index in the string heap.
+ * \param meta metadata context
+ * \param index index into the string heap.
+ * \returns an in-memory pointer to the \p index in the string heap.
*/
const char *
mono_metadata_string_heap (MonoImage *meta, guint32 index)
/**
* mono_metadata_user_string:
- * @meta: metadata context
- * @index: index into the user string heap.
- *
- * Returns: an in-memory pointer to the @index in the user string heap ("#US").
+ * \param meta metadata context
+ * \param index index into the user string heap.
+ * \returns an in-memory pointer to the \p index in the user string heap (<code>#US</code>).
*/
const char *
mono_metadata_user_string (MonoImage *meta, guint32 index)
/**
* mono_metadata_blob_heap:
- * @meta: metadata context
- * @index: index into the blob.
- *
- * Returns: an in-memory pointer to the @index in the Blob heap.
+ * \param meta metadata context
+ * \param index index into the blob.
+ * \returns an in-memory pointer to the \p index in the Blob heap.
*/
const char *
mono_metadata_blob_heap (MonoImage *meta, guint32 index)
/**
* mono_metadata_guid_heap:
- * @meta: metadata context
- * @index: index into the guid heap.
- *
- * Returns: an in-memory pointer to the @index in the guid heap.
+ * \param meta metadata context
+ * \param index index into the guid heap.
+ * \returns an in-memory pointer to the \p index in the guid heap.
*/
const char *
mono_metadata_guid_heap (MonoImage *meta, guint32 index)
/**
* mono_metadata_decode_row:
- * @t: table to extract information from.
- * @idx: index in table.
- * @res: array of @res_size cols to store the results in
+ * \param t table to extract information from.
+ * \param idx index in table.
+ * \param res array of \p res_size cols to store the results in
*
- * This decompresses the metadata element @idx in table @t
- * into the guint32 @res array that has res_size elements
+ * This decompresses the metadata element \p idx in table \p t
+ * into the \c guint32 \p res array that has \p res_size elements
*/
void
mono_metadata_decode_row (const MonoTableInfo *t, int idx, guint32 *res, int res_size)
/**
* mono_metadata_decode_row_col:
- * @t: table to extract information from.
- * @idx: index for row in table.
- * @col: column in the row.
+ * \param t table to extract information from.
+ * \param idx index for row in table.
+ * \param col column in the row.
*
- * This function returns the value of column @col from the @idx
- * row in the table @t.
+ * This function returns the value of column \p col from the \p idx
+ * row in the table \p t .
*/
guint32
mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col)
/**
* mono_metadata_decode_blob_size:
- * @ptr: pointer to a blob object
- * @rptr: the new position of the pointer
+ * \param ptr pointer to a blob object
+ * \param rptr the new position of the pointer
*
* This decodes a compressed size as described by 23.1.4 (a blob or user string object)
*
- * Returns: the size of the blob object
+ * \returns the size of the blob object
*/
guint32
mono_metadata_decode_blob_size (const char *xptr, const char **rptr)
/**
* mono_metadata_decode_value:
- * @ptr: pointer to decode from
- * @rptr: the new position of the pointer
+ * \param ptr pointer to decode from
+ * \param rptr the new position of the pointer
*
* This routine decompresses 32-bit values as specified in the "Blob and
* Signature" section (23.2)
*
- * Returns: the decoded value
+ * \returns the decoded value
*/
guint32
mono_metadata_decode_value (const char *_ptr, const char **rptr)
/**
* mono_metadata_decode_signed_value:
- * @ptr: pointer to decode from
- * @rptr: the new position of the pointer
+ * \param ptr pointer to decode from
+ * \param rptr the new position of the pointer
*
* This routine decompresses 32-bit signed values
* (not specified in the spec)
*
- * Returns: the decoded value
+ * \returns the decoded value
*/
gint32
mono_metadata_decode_signed_value (const char *ptr, const char **rptr)
return ival - 0x20000000;
}
-/*
- * Translates the given 1-based index into the Method, Field, Event, or Param tables
- * using the *Ptr tables in uncompressed metadata, if they are available.
+/**
+ * mono_metadata_translate_token_index:
+ * Translates the given 1-based index into the \c Method, \c Field, \c Event, or \c Param tables
+ * using the \c *Ptr tables in uncompressed metadata, if they are available.
*
* FIXME: The caller is not forced to call this function, which is error-prone, since
* forgetting to call it would only show up as a bug on uncompressed metadata.
/**
* mono_metadata_decode_table_row:
*
- * Same as mono_metadata_decode_row, but takes an IMAGE+TABLE ID pair, and takes
+ * Same as \c mono_metadata_decode_row, but takes an \p image + \p table ID pair, and takes
* uncompressed metadata into account, so it should be used to access the
- * Method, Field, Param and Event tables when the access is made from metadata, i.e.
- * IDX is retrieved from a metadata table, like MONO_TYPEDEF_FIELD_LIST.
+ * \c Method, \c Field, \c Param and \c Event tables when the access is made from metadata, i.e.
+ * \p idx is retrieved from a metadata table, like \c MONO_TYPEDEF_FIELD_LIST.
*/
void
mono_metadata_decode_table_row (MonoImage *image, int table, int idx, guint32 *res, int res_size)
/**
* mono_metadata_decode_table_row_col:
*
- * Same as mono_metadata_decode_row_col, but takes an IMAGE+TABLE ID pair, and takes
+ * Same as \c mono_metadata_decode_row_col, but takes an \p image + \p table ID pair, and takes
* uncompressed metadata into account, so it should be used to access the
- * Method, Field, Param and Event tables.
+ * \c Method, \c Field, \c Param and \c Event tables.
*/
guint32 mono_metadata_decode_table_row_col (MonoImage *image, int table, int idx, guint col)
{
return mono_metadata_decode_row_col (&image->tables [table], idx, col);
}
-/*
+/**
* mono_metadata_parse_typedef_or_ref:
- * @m: a metadata context.
- * @ptr: a pointer to an encoded TypedefOrRef in @m
- * @rptr: pointer updated to match the end of the decoded stream
- *
- * Returns: a token valid in the @m metadata decoded from
+ * \param m a metadata context.
+ * \param ptr a pointer to an encoded TypedefOrRef in \p m
+ * \param rptr pointer updated to match the end of the decoded stream
+ * \returns a token valid in the \p m metadata decoded from
* the compressed representation.
*/
guint32
return mono_metadata_token_from_dor (token);
}
-/*
+/**
* mono_metadata_parse_custom_mod:
- * @m: a metadata context.
- * @dest: storage where the info about the custom modifier is stored (may be NULL)
- * @ptr: a pointer to (possibly) the start of a custom modifier list
- * @rptr: pointer updated to match the end of the decoded stream
+ * \param m a metadata context.
+ * \param dest storage where the info about the custom modifier is stored (may be NULL)
+ * \param ptr a pointer to (possibly) the start of a custom modifier list
+ * \param rptr pointer updated to match the end of the decoded stream
*
- * Checks if @ptr points to a type custom modifier compressed representation.
+ * Checks if \p ptr points to a type custom modifier compressed representation.
*
- * Returns: #TRUE if a custom modifier was found, #FALSE if not.
+ * \returns TRUE if a custom modifier was found, FALSE if not.
*/
int
mono_metadata_parse_custom_mod (MonoImage *m, MonoCustomMod *dest, const char *ptr, const char **rptr)
return array;
}
+/**
+ * mono_metadata_parse_array:
+ */
MonoArrayType *
mono_metadata_parse_array (MonoImage *m, const char *ptr, const char **rptr)
{
return ret;
}
-/*
+/**
* mono_metadata_free_array:
- * @array: array description
+ * \param array array description
*
- * Frees the array description returned from mono_metadata_parse_array().
+ * Frees the array description returned from \c mono_metadata_parse_array.
*/
void
mono_metadata_free_array (MonoArrayType *array)
/**
* mono_metadata_parse_type:
- * @m: metadata context
- * @mode: king of type that may be found at @ptr
- * @opt_attrs: optional attributes to store in the returned type
- * @ptr: pointer to the type representation
- * @rptr: pointer updated to match the end of the decoded stream
- * @transient: whenever to allocate the result from the heap or from a mempool
+ * \param m metadata context
+ * \param mode kind of type that may be found at \p ptr
+ * \param opt_attrs optional attributes to store in the returned type
+ * \param ptr pointer to the type representation
+ * \param rptr pointer updated to match the end of the decoded stream
+ * \param transient whenever to allocate the result from the heap or from a mempool
*
- * Decode a compressed type description found at @ptr in @m.
- * @mode can be one of MONO_PARSE_MOD_TYPE, MONO_PARSE_PARAM, MONO_PARSE_RET,
- * MONO_PARSE_FIELD, MONO_PARSE_LOCAL, MONO_PARSE_TYPE.
+ * Decode a compressed type description found at \p ptr in \p m .
+ * \p mode can be one of \c MONO_PARSE_MOD_TYPE, \c MONO_PARSE_PARAM, \c MONO_PARSE_RET,
+ * \c MONO_PARSE_FIELD, \c MONO_PARSE_LOCAL, \c MONO_PARSE_TYPE.
* This function can be used to decode type descriptions in method signatures,
* field signatures, locals signatures etc.
*
- * To parse a generic type, `generic_container' points to the current class'es
- * (the `generic_container' field in the MonoClass) or the current generic method's
- * (stored in image->property_hash) generic container.
- * When we encounter any MONO_TYPE_VAR or MONO_TYPE_MVAR's, they're looked up in
- * this MonoGenericContainer.
+ * To parse a generic type, \c generic_container points to the current class'es
+ * (the \c generic_container field in the <code>MonoClass</code>) or the current generic method's
+ * (stored in <code>image->property_hash</code>) generic container.
+ * When we encounter a \c MONO_TYPE_VAR or \c MONO_TYPE_MVAR, it's looked up in
+ * this \c MonoGenericContainer.
*
* LOCKING: Acquires the loader lock.
*
- * Returns: a #MonoType structure representing the decoded type.
+ * \returns a \c MonoType structure representing the decoded type.
*/
static MonoType*
mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container,
}
-/*
+/**
* mono_metadata_parse_signature:
- * @image: metadata context
- * @token: metadata token
+ * \param image metadata context
+ * \param token metadata token
*
- * Decode a method signature stored in the STANDALONESIG table
+ * Decode a method signature stored in the \c StandAloneSig table
*
- * Returns: a MonoMethodSignature describing the signature.
+ * \returns a \c MonoMethodSignature describing the signature.
*/
MonoMethodSignature*
mono_metadata_parse_signature (MonoImage *image, guint32 token)
return mono_metadata_parse_method_signature_full (image, NULL, 0, ptr, NULL, error);
}
-/*
+/**
* mono_metadata_signature_alloc:
- * @image: metadata context
- * @nparmas: number of parameters in the signature
+ * \param image metadata context
+ * \param nparams number of parameters in the signature
*
- * Allocate a MonoMethodSignature structure with the specified number of params.
+ * Allocate a \c MonoMethodSignature structure with the specified number of params.
* The return type and the params types need to be filled later.
* This is a Mono runtime internal function.
*
* LOCKING: Assumes the loader lock is held.
*
- * Returns: the new MonoMethodSignature structure.
+ * \returns the new \c MonoMethodSignature structure.
*/
MonoMethodSignature*
mono_metadata_signature_alloc (MonoImage *m, guint32 nparams)
return mono_metadata_signature_dup_internal (NULL, mp, sig);
}
-/*
+/**
* mono_metadata_signature_dup:
- * @sig: method signature
+ * \param sig method signature
*
- * Duplicate an existing MonoMethodSignature so it can be modified.
+ * Duplicate an existing \c MonoMethodSignature so it can be modified.
* This is a Mono runtime internal function.
*
- * Returns: the new MonoMethodSignature structure.
+ * \returns the new \c MonoMethodSignature structure.
*/
MonoMethodSignature*
mono_metadata_signature_dup (MonoMethodSignature *sig)
return method;
}
-/*
+/**
* mono_metadata_parse_method_signature:
- * @m: metadata context
- * @def: the MethodDef index or 0 for Ref signatures.
- * @ptr: pointer to the signature metadata representation
- * @rptr: pointer updated to match the end of the decoded stream
+ * \param m metadata context
+ * \param def the \c MethodDef index or 0 for \c Ref signatures.
+ * \param ptr pointer to the signature metadata representation
+ * \param rptr pointer updated to match the end of the decoded stream
*
- * Decode a method signature stored at @ptr.
+ * Decode a method signature stored at \p ptr.
* This is a Mono runtime internal function.
*
* LOCKING: Assumes the loader lock is held.
*
- * Returns: a MonoMethodSignature describing the signature.
+ * \returns a \c MonoMethodSignature describing the signature.
*/
MonoMethodSignature *
mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, const char **rptr)
return ret;
}
-/*
+/**
* mono_metadata_free_method_signature:
- * @sig: signature to destroy
+ * \param sig signature to destroy
*
- * Free the memory allocated in the signature @sig.
+ * Free the memory allocated in the signature \p sig.
* This method needs to be robust and work also on partially-built
* signatures, so it does extra checks.
*/
/**
* mono_metadata_get_canonical_generic_inst:
- * @candidate: an arbitrary generic instantiation
+ * \param candidate an arbitrary generic instantiation
*
- * Returns the canonical generic instantiation that represents the given
+ * \returns the canonical generic instantiation that represents the given
* candidate by identifying the image set for the candidate instantiation and
* finding the instance in the image set or adding a copy of the given instance
* to the image set.
return TRUE;
}
-/*
+/**
* mono_metadata_free_type:
- * @type: type to free
+ * \param type type to free
*
- * Free the memory allocated for type @type which is allocated on the heap.
+ * Free the memory allocated for type \p type which is allocated on the heap.
*/
void
mono_metadata_free_type (MonoType *type)
}
-/*
+/**
* mono_metadata_parse_mh:
- * @generic_context: generics context
- * @ptr: pointer to the method header.
+ * \param generic_context generics context
+ * \param ptr pointer to the method header.
*
- * Decode the method header at @ptr, including pointer to the IL code,
+ * Decode the method header at \p ptr, including pointer to the IL code,
* info about local variables and optional exception tables.
*
- * Returns: a transient MonoMethodHeader allocated from the heap.
+ * \returns a transient \c MonoMethodHeader allocated from the heap.
*/
MonoMethodHeader *
mono_metadata_parse_mh (MonoImage *m, const char *ptr)
return header;
}
-/*
+/**
* mono_metadata_free_mh:
- * @mh: a method header
+ * \param mh a method header
*
* Free the memory allocated for the method header.
*/
}
}
-/*
+/**
* mono_method_header_get_code:
- * @header: a MonoMethodHeader pointer
- * @code_size: memory location for returning the code size
- * @max_stack: memory location for returning the max stack
+ * \param header a \c MonoMethodHeader pointer
+ * \param code_size memory location for returning the code size
+ * \param max_stack memory location for returning the max stack
*
* Method header accessor to retreive info about the IL code properties:
* a pointer to the IL code itself, the size of the code and the max number
* of stack slots used by the code.
*
- * Returns: pointer to the IL code represented by the method header.
+ * \returns pointer to the IL code represented by the method header.
*/
const unsigned char*
mono_method_header_get_code (MonoMethodHeader *header, guint32* code_size, guint32* max_stack)
return header->code;
}
-/*
+/**
* mono_method_header_get_locals:
- * @header: a MonoMethodHeader pointer
- * @num_locals: memory location for returning the number of local variables
- * @init_locals: memory location for returning the init_locals flag
+ * \param header a \c MonoMethodHeader pointer
+ * \param num_locals memory location for returning the number of local variables
+ * \param init_locals memory location for returning the init_locals flag
*
* Method header accessor to retreive info about the local variables:
* an array of local types, the number of locals and whether the locals
* are supposed to be initialized to 0 on method entry
*
- * Returns: pointer to an array of types of the local variables
+ * \returns pointer to an array of types of the local variables
*/
MonoType**
mono_method_header_get_locals (MonoMethodHeader *header, guint32* num_locals, gboolean *init_locals)
return header->num_clauses;
}
-/*
+/**
* mono_method_header_get_clauses:
- * @header: a MonoMethodHeader pointer
- * @method: MonoMethod the header belongs to
- * @iter: pointer to a iterator
- * @clause: pointer to a MonoExceptionClause structure which will be filled with the info
+ * \param header a \c MonoMethodHeader pointer
+ * \param method \c MonoMethod the header belongs to
+ * \param iter pointer to a iterator
+ * \param clause pointer to a \c MonoExceptionClause structure which will be filled with the info
*
- * Get the info about the exception clauses in the method. Set *iter to NULL to
+ * Get the info about the exception clauses in the method. Set \c *iter to NULL to
* initiate the iteration, then call the method repeatedly until it returns FALSE.
* At each iteration, the structure pointed to by clause if filled with the
* exception clause information.
*
- * Returns: TRUE if clause was filled with info, FALSE if there are no more exception
+ * \returns TRUE if clause was filled with info, FALSE if there are no more exception
* clauses.
*/
int
/**
* mono_metadata_parse_field_type:
- * @m: metadata context to extract information from
- * @ptr: pointer to the field signature
- * @rptr: pointer updated to match the end of the decoded stream
+ * \param m metadata context to extract information from
+ * \param ptr pointer to the field signature
+ * \param rptr pointer updated to match the end of the decoded stream
*
* Parses the field signature, and returns the type information for it.
*
- * Returns: The MonoType that was extracted from @ptr.
+ * \returns The \c MonoType that was extracted from \p ptr .
*/
MonoType *
mono_metadata_parse_field_type (MonoImage *m, short field_flags, const char *ptr, const char **rptr)
/**
* mono_metadata_parse_param:
- * @m: metadata context to extract information from
- * @ptr: pointer to the param signature
- * @rptr: pointer updated to match the end of the decoded stream
+ * \param m metadata context to extract information from
+ * \param ptr pointer to the param signature
+ * \param rptr pointer updated to match the end of the decoded stream
*
* Parses the param signature, and returns the type information for it.
*
- * Returns: The MonoType that was extracted from @ptr.
+ * \returns The \c MonoType that was extracted from \p ptr .
*/
MonoType *
mono_metadata_parse_param (MonoImage *m, const char *ptr, const char **rptr)
return type;
}
-/*
+/**
* mono_metadata_token_from_dor:
- * @dor_token: A TypeDefOrRef coded index
+ * \param dor_token A \c TypeDefOrRef coded index
*
- * dor_token is a TypeDefOrRef coded index: it contains either
- * a TypeDef, TypeRef or TypeSpec in the lower bits, and the upper
+ * \p dor_token is a \c TypeDefOrRef coded index: it contains either
+ * a \c TypeDef, \c TypeRef or \c TypeSpec in the lower bits, and the upper
* bits contain an index into the table.
*
- * Returns: an expanded token
+ * \returns an expanded token
*/
guint32
mono_metadata_token_from_dor (guint32 dor_index)
/**
* mono_metadata_typedef_from_field:
- * @meta: metadata context
- * @index: FieldDef token
+ * \param meta metadata context
+ * \param index FieldDef token
*
- * Returns: the 1-based index into the TypeDef table of the type that
- * declared the field described by @index, or 0 if not found.
+ * \returns the 1-based index into the \c TypeDef table of the type that
+ * declared the field described by \p index, or 0 if not found.
*/
guint32
mono_metadata_typedef_from_field (MonoImage *meta, guint32 index)
return loc.result + 1;
}
-/*
+/**
* mono_metadata_typedef_from_method:
- * @meta: metadata context
- * @index: MethodDef token
- *
- * Returns: the 1-based index into the TypeDef table of the type that
- * declared the method described by @index. 0 if not found.
+ * \param meta metadata context
+ * \param index \c MethodDef token
+ * \returns the 1-based index into the \c TypeDef table of the type that
+ * declared the method described by \p index. 0 if not found.
*/
guint32
mono_metadata_typedef_from_method (MonoImage *meta, guint32 index)
return TRUE;
}
-/*
- * @meta: metadata context
- * @index: typedef token
- * @count: Out parameter used to store the number of interfaces
+/**
+ * mono_metadata_interfaces_from_typedef:
+ * \param meta metadata context
+ * \param index typedef token
+ * \param count Out parameter used to store the number of interfaces
*
- * The array of interfaces that the @index typedef token implements is returned in
- * @interfaces. The number of elements in the array is returned in @count. The returned
- * array is g_malloc'd and the caller must free it.
+ * The array of interfaces that the \p index typedef token implements is returned in
+ * \p interfaces. The number of elements in the array is returned in \p count. The returned
+ * array is allocated with \c g_malloc and the caller must free it.
*
* LOCKING: Acquires the loader lock .
*
- * Returns: the interface array on success, NULL on failure.
+ * \returns the interface array on success, NULL on failure.
*/
-
MonoClass**
mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 index, guint *count)
{
return NULL;
}
-/*
+/**
* mono_metadata_nested_in_typedef:
- * @meta: metadata context
- * @index: typedef token
- *
- * Returns: the 1-based index into the TypeDef table of the type
- * where the type described by @index is nested.
- * Returns 0 if @index describes a non-nested type.
+ * \param meta metadata context
+ * \param index typedef token
+ * \returns the 1-based index into the TypeDef table of the type
+ * where the type described by \p index is nested.
+ * Returns 0 if \p index describes a non-nested type.
*/
guint32
mono_metadata_nested_in_typedef (MonoImage *meta, guint32 index)
return mono_metadata_decode_row_col (tdef, loc.result, MONO_NESTED_CLASS_ENCLOSING) | MONO_TOKEN_TYPE_DEF;
}
-/*
+/**
* mono_metadata_nesting_typedef:
- * @meta: metadata context
- * @index: typedef token
- *
- * Returns: the 1-based index into the TypeDef table of the first type
- * that is nested inside the type described by @index. The search starts at
- * @start_index. returns 0 if no such type is found.
+ * \param meta metadata context
+ * \param index typedef token
+ * \returns the 1-based index into the \c TypeDef table of the first type
+ * that is nested inside the type described by \p index. The search starts at
+ * \p start_index. Returns 0 if no such type is found.
*/
guint32
mono_metadata_nesting_typedef (MonoImage *meta, guint32 index, guint32 start_index)
return start;
}
-/*
+/**
* mono_metadata_packing_from_typedef:
- * @meta: metadata context
- * @index: token representing a type
- *
- * Returns: the info stored in the ClassLAyout table for the given typedef token
- * into the @packing and @size pointers.
+ * \param meta metadata context
+ * \param index token representing a type
+ * \returns the info stored in the \c ClassLayout table for the given typedef token
+ * into the \p packing and \p size pointers.
* Returns 0 if the info is not found.
*/
guint32
return loc.result + 1;
}
-/*
+/**
* mono_metadata_custom_attrs_from_index:
- * @meta: metadata context
- * @index: token representing the parent
- *
- * Returns: the 1-based index into the CustomAttribute table of the first
- * attribute which belongs to the metadata object described by @index.
+ * \param meta metadata context
+ * \param index token representing the parent
+ * \returns: the 1-based index into the \c CustomAttribute table of the first
+ * attribute which belongs to the metadata object described by \p index.
* Returns 0 if no such attribute is found.
*/
guint32
return loc.result + 1;
}
-/*
+/**
* mono_metadata_declsec_from_index:
- * @meta: metadata context
- * @index: token representing the parent
- *
- * Returns: the 0-based index into the DeclarativeSecurity table of the first
- * attribute which belongs to the metadata object described by @index.
- * Returns -1 if no such attribute is found.
+ * \param meta metadata context
+ * \param index token representing the parent
+ * \returns the 0-based index into the \c DeclarativeSecurity table of the first
+ * attribute which belongs to the metadata object described by \p index.
+ * Returns \c -1 if no such attribute is found.
*/
guint32
mono_metadata_declsec_from_index (MonoImage *meta, guint32 index)
}
}
-/*
+/**
* mono_type_size:
- * @t: the type to return the size of
- *
- * Returns: the number of bytes required to hold an instance of this
+ * \param t the type to return the size of
+ * \returns The number of bytes required to hold an instance of this
* type in memory
*/
int
return 0;
}
-/*
+/**
* mono_type_stack_size:
- * @t: the type to return the size it uses on the stack
- *
- * Returns: the number of bytes required to hold an instance of this
+ * \param t the type to return the size it uses on the stack
+ * \returns The number of bytes required to hold an instance of this
* type on the runtime stack
*/
int
return type->data.generic_class->container_class->valuetype;
}
+/**
+ * mono_metadata_generic_class_is_valuetype:
+ */
gboolean
mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass)
{
return hash;
}
-/*
+/**
* mono_metadata_type_hash:
- * @t1: a type
- *
- * Computes an hash value for @t1 to be used in GHashTable.
+ * \param t1 a type
+ * Computes a hash value for \p t1 to be used in \c GHashTable.
* The returned hash is guaranteed to be the same across executions.
*/
guint
return FALSE;
}
+/**
+ * mono_metadata_type_equal:
+ */
gboolean
mono_metadata_type_equal (MonoType *t1, MonoType *t2)
{
/**
* mono_metadata_type_equal_full:
- * @t1: a type
- * @t2: another type
- * @signature_only: if signature only comparison should be made
+ * \param t1 a type
+ * \param t2 another type
+ * \param signature_only if signature only comparison should be made
*
- * Determine if @t1 and @t2 are signature compatible if @signature_only is #TRUE, otherwise
+ * Determine if \p t1 and \p t2 are signature compatible if \p signature_only is TRUE, otherwise
* behaves the same way as mono_metadata_type_equal.
* The function mono_metadata_type_equal(a, b) is just a shortcut for mono_metadata_type_equal_full(a, b, FALSE).
- * Returns: #TRUE if @t1 and @t2 are equal taking @signature_only into account.
+ * \returns TRUE if \p t1 and \p t2 are equal taking \p signature_only into account.
*/
gboolean
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only)
/**
* mono_metadata_signature_equal:
- * @sig1: a signature
- * @sig2: another signature
+ * \param sig1 a signature
+ * \param sig2 another signature
*
- * Determine if @sig1 and @sig2 represent the same signature, with the
+ * Determine if \p sig1 and \p sig2 represent the same signature, with the
* same number of arguments and the same types.
- * Returns: #TRUE if @sig1 and @sig2 are equal.
+ * \returns TRUE if \p sig1 and \p sig2 are equal.
*/
gboolean
mono_metadata_signature_equal (MonoMethodSignature *sig1, MonoMethodSignature *sig2)
/**
* mono_metadata_type_dup:
- * @image: image to alloc memory from
- * @original: type to duplicate
- *
- * Returns: copy of type allocated from the image's mempool (or from the heap, if @image is null).
+ * \param image image to alloc memory from
+ * \param original type to duplicate
+ * \returns copy of type allocated from the image's mempool (or from the heap, if \p image is null).
*/
MonoType *
mono_metadata_type_dup (MonoImage *image, const MonoType *o)
return r;
}
+/**
+ * mono_signature_hash:
+ */
guint
mono_signature_hash (MonoMethodSignature *sig)
{
*endbuf = p;
}
-/*
+/**
* mono_metadata_field_info:
- * @meta: the Image the field is defined in
- * @index: the index in the field table representing the field
- * @offset: a pointer to an integer where to store the offset that
- * may have been specified for the field in a FieldLayout table
- * @rva: a pointer to the RVA of the field data in the image that
- * may have been defined in a FieldRVA table
- * @marshal_spec: a pointer to the marshal spec that may have been
- * defined for the field in a FieldMarshal table.
- *
- * Gather info for field @index that may have been defined in the FieldLayout,
- * FieldRVA and FieldMarshal tables.
- * Either of offset, rva and marshal_spec can be NULL if you're not interested
+ * \param meta the Image the field is defined in
+ * \param index the index in the field table representing the field
+ * \param offset a pointer to an integer where to store the offset that may have been specified for the field in a FieldLayout table
+ * \param rva a pointer to the RVA of the field data in the image that may have been defined in a \c FieldRVA table
+ * \param marshal_spec a pointer to the marshal spec that may have been defined for the field in a \c FieldMarshal table.
+ *
+ * Gather info for field \p index that may have been defined in the \c FieldLayout,
+ * \c FieldRVA and \c FieldMarshal tables.
+ * Either of \p offset, \p rva and \p marshal_spec can be NULL if you're not interested
* in the data.
*/
void
}
-/*
+/**
* mono_metadata_get_constant_index:
- * @meta: the Image the field is defined in
- * @index: the token that may have a row defined in the constants table
- * @hint: possible position for the row
+ * \param meta the Image the field is defined in
+ * \param index the token that may have a row defined in the constants table
+ * \param hint possible position for the row
*
- * @token must be a FieldDef, ParamDef or PropertyDef token.
+ * \p token must be a \c FieldDef, \c ParamDef or \c PropertyDef token.
*
- * Returns: the index into the Constants table or 0 if not found.
+ * \returns the index into the \c Constants table or 0 if not found.
*/
guint32
mono_metadata_get_constant_index (MonoImage *meta, guint32 token, guint32 hint)
return 0;
}
-/*
+/**
* mono_metadata_events_from_typedef:
- * @meta: metadata context
- * @index: 0-based index (in the TypeDef table) describing a type
- *
- * Returns: the 0-based index in the Event table for the events in the
+ * \param meta metadata context
+ * \param index 0-based index (in the \c TypeDef table) describing a type
+ * \returns the 0-based index in the \c Event table for the events in the
* type. The last event that belongs to the type (plus 1) is stored
- * in the @end_idx pointer.
+ * in the \p end_idx pointer.
*/
guint32
mono_metadata_events_from_typedef (MonoImage *meta, guint32 index, guint *end_idx)
return start - 1;
}
-/*
+/**
* mono_metadata_methods_from_event:
- * @meta: metadata context
- * @index: 0-based index (in the Event table) describing a event
- *
- * Returns: the 0-based index in the MethodDef table for the methods in the
+ * \param meta metadata context
+ * \param index 0-based index (in the \c Event table) describing a event
+ * \returns the 0-based index in the \c MethodDef table for the methods in the
* event. The last method that belongs to the event (plus 1) is stored
- * in the @end_idx pointer.
+ * in the \p end_idx pointer.
*/
guint32
mono_metadata_methods_from_event (MonoImage *meta, guint32 index, guint *end_idx)
return start;
}
-/*
+/**
* mono_metadata_properties_from_typedef:
- * @meta: metadata context
- * @index: 0-based index (in the TypeDef table) describing a type
- *
- * Returns: the 0-based index in the Property table for the properties in the
+ * \param meta metadata context
+ * \param index 0-based index (in the \c TypeDef table) describing a type
+ * \returns the 0-based index in the \c Property table for the properties in the
* type. The last property that belongs to the type (plus 1) is stored
- * in the @end_idx pointer.
+ * in the \p end_idx pointer.
*/
guint32
mono_metadata_properties_from_typedef (MonoImage *meta, guint32 index, guint *end_idx)
return start - 1;
}
-/*
+/**
* mono_metadata_methods_from_property:
- * @meta: metadata context
- * @index: 0-based index (in the PropertyDef table) describing a property
- *
- * Returns: the 0-based index in the MethodDef table for the methods in the
+ * \param meta metadata context
+ * \param index 0-based index (in the \c PropertyDef table) describing a property
+ * \returns the 0-based index in the \c MethodDef table for the methods in the
* property. The last method that belongs to the property (plus 1) is stored
- * in the @end_idx pointer.
+ * in the \p end_idx pointer.
*/
guint32
mono_metadata_methods_from_property (MonoImage *meta, guint32 index, guint *end_idx)
return start;
}
+/**
+ * mono_metadata_implmap_from_method:
+ */
guint32
mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx)
{
}
/**
- * @image: context where the image is created
- * @type_spec: typespec token
- * @deprecated use mono_type_create_from_typespec_checked that has proper error handling
+ * mono_type_create_from_typespec:
+ * \param image context where the image is created
+ * \param type_spec typespec token
+ * \deprecated use \c mono_type_create_from_typespec_checked that has proper error handling
*
- * Creates a MonoType representing the TypeSpec indexed by the @type_spec
+ * Creates a \c MonoType representing the \c TypeSpec indexed by the \p type_spec
* token.
*/
MonoType *
return res;
}
+/**
+ * mono_metadata_parse_marshal_spec:
+ */
MonoMarshalSpec *
mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr)
{
return res;
}
+/**
+ * mono_metadata_free_marshal_spec:
+ */
void
mono_metadata_free_marshal_spec (MonoMarshalSpec *spec)
{
/**
* mono_type_to_unmanaged:
- *
- * Returns: A MonoMarshalNative enumeration value (MONO_NATIVE_) value
+ * The value pointed to by \p conv will contain the kind of marshalling required for this
+ * particular type one of the \c MONO_MARSHAL_CONV_ enumeration values.
+ * \returns A \c MonoMarshalNative enumeration value (<code>MONO_NATIVE_</code>) value
* describing the underlying native reprensetation of the type.
- *
- * In addition the value pointed by
- * "conv" will contain the kind of marshalling required for this
- * particular type one of the MONO_MARSHAL_CONV_ enumeration values.
*/
guint32
mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field,
return MONO_NATIVE_MAX;
}
+/**
+ * mono_metadata_get_marshal_info:
+ */
const char*
mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field)
{
/**
* mono_type_is_byref:
- * @type: the MonoType operated on
- *
- * Returns: #TRUE if @type represents a type passed by reference,
- * #FALSE otherwise.
+ * \param type the \c MonoType operated on
+ * \returns TRUE if \p type represents a type passed by reference,
+ * FALSE otherwise.
*/
gboolean
mono_type_is_byref (MonoType *type)
/**
* mono_type_get_type:
- * @type: the MonoType operated on
- *
- * Returns: the IL type value for @type. This is one of the MonoTypeEnum
- * enum members like MONO_TYPE_I4 or MONO_TYPE_STRING.
+ * \param type the \c MonoType operated on
+ * \returns the IL type value for \p type. This is one of the \c MonoTypeEnum
+ * enum members like \c MONO_TYPE_I4 or \c MONO_TYPE_STRING.
*/
int
mono_type_get_type (MonoType *type)
/**
* mono_type_get_signature:
- * @type: the MonoType operated on
- *
- * It is only valid to call this function if @type is a MONO_TYPE_FNPTR.
- *
- * Returns: the MonoMethodSignature pointer that describes the signature
- * of the function pointer @type represents.
+ * \param type the \c MonoType operated on
+ * It is only valid to call this function if \p type is a \c MONO_TYPE_FNPTR .
+ * \returns the \c MonoMethodSignature pointer that describes the signature
+ * of the function pointer \p type represents.
*/
MonoMethodSignature*
mono_type_get_signature (MonoType *type)
/**
* mono_type_get_class:
- * @type: the MonoType operated on
- *
- * It is only valid to call this function if @type is a MONO_TYPE_CLASS or a
- * MONO_TYPE_VALUETYPE. For more general functionality, use mono_class_from_mono_type (),
- * instead
- *
- * Returns: the MonoClass pointer that describes the class that @type represents.
+ * \param type the \c MonoType operated on
+ * It is only valid to call this function if \p type is a \c MONO_TYPE_CLASS or a
+ * \c MONO_TYPE_VALUETYPE . For more general functionality, use \c mono_class_from_mono_type,
+ * instead.
+ * \returns the \c MonoClass pointer that describes the class that \p type represents.
*/
MonoClass*
mono_type_get_class (MonoType *type)
/**
* mono_type_get_array_type:
- * @type: the MonoType operated on
- *
- * It is only valid to call this function if @type is a MONO_TYPE_ARRAY.
- *
- * Returns: a MonoArrayType struct describing the array type that @type
+ * \param type the \c MonoType operated on
+ * It is only valid to call this function if \p type is a \c MONO_TYPE_ARRAY .
+ * \returns a \c MonoArrayType struct describing the array type that \p type
* represents. The info includes details such as rank, array element type
* and the sizes and bounds of multidimensional arrays.
*/
/**
* mono_type_get_ptr_type:
- * @type: the MonoType operated on
- *
- * It is only valid to call this function if @type is a MONO_TYPE_PTR.
- * instead
- *
- * Returns: the MonoType pointer that describes the type that @type
+ * \pararm type the \c MonoType operated on
+ * It is only valid to call this function if \p type is a \c MONO_TYPE_PTR .
+ * \returns the \c MonoType pointer that describes the type that \p type
* represents a pointer to.
*/
MonoType*
return type->data.type;
}
+/**
+ * mono_type_get_modifiers:
+ */
MonoClass*
mono_type_get_modifiers (MonoType *type, gboolean *is_required, gpointer *iter)
{
/**
* mono_type_is_struct:
- * @type: the MonoType operated on
- *
- * Returns: #TRUE is @type is a struct, that is a ValueType but not en enum
- * or a basic type like System.Int32. #FALSE otherwise.
+ * \param type the \c MonoType operated on
+ * \returns TRUE if \p type is a struct, that is a \c ValueType but not an enum
+ * or a basic type like \c System.Int32 . FALSE otherwise.
*/
mono_bool
mono_type_is_struct (MonoType *type)
/**
* mono_type_is_void:
- * @type: the MonoType operated on
- *
- * Returns: #TRUE is @type is System.Void. #FALSE otherwise.
+ * \param type the \c MonoType operated on
+ * \returns TRUE if \p type is \c System.Void . FALSE otherwise.
*/
mono_bool
mono_type_is_void (MonoType *type)
/**
* mono_type_is_pointer:
- * @type: the MonoType operated on
- *
- * Returns: #TRUE is @type is a managed or unmanaged pointer type. #FALSE otherwise.
+ * \param type the \c MonoType operated on
+ * \returns TRUE if \p type is a managed or unmanaged pointer type. FALSE otherwise.
*/
mono_bool
mono_type_is_pointer (MonoType *type)
/**
* mono_type_is_reference:
- * @type: the MonoType operated on
- *
- * Returns: #TRUE is @type represents an object reference . #FALSE otherwise.
+ * \param type the \c MonoType operated on
+ * \returns TRUE if \p type represents an object reference. FALSE otherwise.
*/
mono_bool
mono_type_is_reference (MonoType *type)
/**
* mono_signature_get_return_type:
- * @sig: the method signature inspected
- *
- * Returns: the return type of the method signature @sig
+ * \param sig the method signature inspected
+ * \returns the return type of the method signature \p sig
*/
MonoType*
mono_signature_get_return_type (MonoMethodSignature *sig)
/**
* mono_signature_get_params:
- * @sig: the method signature inspected
- * #iter: pointer to an iterator
- *
- * Iterates over the parameters for the method signature @sig.
- * A void* pointer must be initualized to #NULL to start the iteration
- * and it's address is passed to this function repeteadly until it returns
- * #NULL.
- *
- * Returns: the next parameter type of the method signature @sig,
- * #NULL when finished.
+ * \param sig the method signature inspected
+ * \param iter pointer to an iterator
+ * Iterates over the parameters for the method signature \p sig.
+ * A \c void* pointer must be initialized to NULL to start the iteration
+ * and its address is passed to this function repeteadly until it returns
+ * NULL.
+ * \returns the next parameter type of the method signature \p sig,
+ * NULL when finished.
*/
MonoType*
mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter)
/**
* mono_signature_get_param_count:
- * @sig: the method signature inspected
- *
- * Returns: the number of parameters in the method signature @sig.
+ * \param sig the method signature inspected
+ * \returns the number of parameters in the method signature \p sig.
*/
guint32
mono_signature_get_param_count (MonoMethodSignature *sig)
/**
* mono_signature_get_call_conv:
- * @sig: the method signature inspected
- *
- * Returns: the call convention of the method signature @sig.
+ * \param sig the method signature inspected
+ * \returns the call convention of the method signature \p sig.
*/
guint32
mono_signature_get_call_conv (MonoMethodSignature *sig)
/**
* mono_signature_vararg_start:
- * @sig: the method signature inspected
- *
- * Returns: the number of the first vararg parameter in the
- * method signature @sig. -1 if this is not a vararg signature.
+ * \param sig the method signature inspected
+ * \returns the number of the first vararg parameter in the
+ * method signature \param sig. \c -1 if this is not a vararg signature.
*/
int
mono_signature_vararg_start (MonoMethodSignature *sig)
/**
* mono_signature_is_instance:
- * @sig: the method signature inspected
- *
- * Returns: #TRUE if this the method signature @sig has an implicit
- * first instance argument. #FALSE otherwise.
+ * \param sig the method signature inspected
+ * \returns TRUE if this the method signature \p sig has an implicit
+ * first instance argument. FALSE otherwise.
*/
gboolean
mono_signature_is_instance (MonoMethodSignature *sig)
/**
* mono_signature_param_is_out
- * @sig: the method signature inspected
- * @param_num: the 0-based index of the inspected parameter
- *
- * Returns: #TRUE if the parameter is an out parameter, #FALSE
+ * \param sig the method signature inspected
+ * \param param_num the 0-based index of the inspected parameter
+ * \returns TRUE if the parameter is an out parameter, FALSE
* otherwise.
*/
mono_bool
/**
* mono_signature_explicit_this:
- * @sig: the method signature inspected
- *
- * Returns: #TRUE if this the method signature @sig has an explicit
- * instance argument. #FALSE otherwise.
+ * \param sig the method signature inspected
+ * \returns TRUE if this the method signature \p sig has an explicit
+ * instance argument. FALSE otherwise.
*/
gboolean
mono_signature_explicit_this (MonoMethodSignature *sig)
+/**
+ * \file
+ */
#ifndef __MONO_METADATA_H__
#define __MONO_METADATA_H__
-/*
- * method-builder.c: Functions for creating IL methods at runtime.
+/**
+ * \file
+ * Functions for creating IL methods at runtime.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
return mb;
}
+/**
+ * mono_mb_new:
+ */
MonoMethodBuilder *
mono_mb_new (MonoClass *klass, const char *name, MonoWrapperType type)
{
return mb;
}
+/**
+ * mono_mb_free:
+ */
void
mono_mb_free (MonoMethodBuilder *mb)
{
/**
* mono_mb_create_method:
- *
- * Create a MonoMethod from this method builder.
- * Returns: the newly created method.
- *
+ * Create a \c MonoMethod from this method builder.
+ * \returns the newly created method.
*/
MonoMethod *
mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack)
return method;
}
+/**
+ * mono_mb_add_data:
+ */
guint32
mono_mb_add_data (MonoMethodBuilder *mb, gpointer data)
{
#ifndef DISABLE_JIT
+/**
+ * mono_mb_add_local:
+ */
int
mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type)
{
return res;
}
+/**
+ * mono_mb_patch_addr:
+ */
void
mono_mb_patch_addr (MonoMethodBuilder *mb, int pos, int value)
{
mb->code [pos + 3] = (value >> 24) & 0xff;
}
+/**
+ * mono_mb_patch_addr_s:
+ */
void
mono_mb_patch_addr_s (MonoMethodBuilder *mb, int pos, gint8 value)
{
*((gint8 *)(&mb->code [pos])) = value;
}
+/**
+ * mono_mb_emit_byte:
+ */
void
mono_mb_emit_byte (MonoMethodBuilder *mb, guint8 op)
{
mb->code [mb->pos++] = op;
}
+/**
+ * mono_mb_emit_ldflda:
+ */
void
mono_mb_emit_ldflda (MonoMethodBuilder *mb, gint32 offset)
{
}
}
+/**
+ * mono_mb_emit_i4:
+ */
void
mono_mb_emit_i4 (MonoMethodBuilder *mb, gint32 data)
{
mb->pos += 8;
}
+/**
+ * mono_mb_emit_i2:
+ */
void
mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 data)
{
mono_mb_emit_i4 (mb, mono_mb_add_data (mb, data));
}
+/**
+ * mono_mb_emit_ldstr:
+ */
void
mono_mb_emit_ldstr (MonoMethodBuilder *mb, char *str)
{
mono_mb_emit_op (mb, CEE_LDSTR, str);
}
+/**
+ * mono_mb_emit_ldarg:
+ */
void
mono_mb_emit_ldarg (MonoMethodBuilder *mb, guint argnum)
{
}
}
+/**
+ * mono_mb_emit_ldarg_addr:
+ */
void
mono_mb_emit_ldarg_addr (MonoMethodBuilder *mb, guint argnum)
{
}
}
+/**
+ * mono_mb_emit_ldloc_addr:
+ */
void
mono_mb_emit_ldloc_addr (MonoMethodBuilder *mb, guint locnum)
{
}
}
+/**
+ * mono_mb_emit_ldloc:
+ */
void
mono_mb_emit_ldloc (MonoMethodBuilder *mb, guint num)
{
}
}
+/**
+ * mono_mb_emit_stloc:
+ */
void
mono_mb_emit_stloc (MonoMethodBuilder *mb, guint num)
{
}
}
+/**
+ * mono_mb_emit_icon:
+ */
void
mono_mb_emit_icon (MonoMethodBuilder *mb, gint32 value)
{
return mb->pos;
}
+/**
+ * mono_mb_emit_branch:
+ */
guint32
mono_mb_emit_branch (MonoMethodBuilder *mb, guint8 op)
{
mono_mb_emit_op (mb, CEE_CALLI, sig);
}
+/**
+ * mono_mb_emit_managed_call:
+ */
void
mono_mb_emit_managed_call (MonoMethodBuilder *mb, MonoMethod *method, MonoMethodSignature *opt_sig)
{
mono_mb_emit_op (mb, CEE_CALL, method);
}
+/**
+ * mono_mb_emit_native_call:
+ */
void
mono_mb_emit_native_call (MonoMethodBuilder *mb, MonoMethodSignature *sig, gpointer func)
{
mono_mb_emit_byte (mb, CEE_THROW);
}
+/**
+ * mono_mb_emit_exception:
+ */
void
mono_mb_emit_exception (MonoMethodBuilder *mb, const char *exc_name, const char *msg)
{
mono_mb_emit_exception_full (mb, "System", exc_name, msg);
}
+/**
+ * mono_mb_emit_add_to_local:
+ */
void
mono_mb_emit_add_to_local (MonoMethodBuilder *mb, guint16 local, gint32 incr)
{
-/*
- * method-builder.h: Functions for creating IL methods at runtime.
+/**
+ * \file
+ * Functions for creating IL methods at runtime.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * monitor.c: Monitor locking functions
+/**
+ * \file
+ * Monitor locking functions
*
* Author:
* Dick Porter (dick@ximian.com)
/**
* mono_locks_dump:
- * @include_untaken:
- *
+ * \param include_untaken Whether to list unheld inflated locks.
* Print a report on stdout of the managed locks currently held by
- * threads. If @include_untaken is specified, list also inflated locks
+ * threads. If \p include_untaken is specified, list also inflated locks
* which are unheld.
* This is supposed to be used in debuggers like gdb.
*/
return TRUE;
}
+/**
+ * mono_monitor_enter:
+ */
gboolean
mono_monitor_enter (MonoObject *obj)
{
return mono_monitor_try_enter_internal (obj, 0, FALSE) == 1;
}
+/**
+ * mono_monitor_try_enter:
+ */
gboolean
mono_monitor_try_enter (MonoObject *obj, guint32 ms)
{
return mono_monitor_try_enter_internal (obj, ms, FALSE) == 1;
}
+/**
+ * mono_monitor_exit:
+ */
void
mono_monitor_exit (MonoObject *obj)
{
*lockTaken = res == 1;
}
+/**
+ * mono_monitor_enter_v4:
+ */
void
mono_monitor_enter_v4 (MonoObject *obj, char *lock_taken)
{
-/*
- * monitor.h: Monitor locking functions
+/**
+ * \file
+ * Monitor locking functions
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
- * mono-basic-block.c: Routines for parsing basic blocks from the IL stream
+/**
+ * \file
+ * Routines for parsing basic blocks from the IL stream
*
* Authors:
* Rodrigo Kumpera (rkumpera@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_BASIC_BLOCK_H__
#define __MONO_METADATA_BASIC_BLOCK_H__
-/*
- * mono-config-dirs.c:
+/**
+ * \file
*
* Copyright 2015 Xamarin Inc (http://www.xamarin.com)
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
+/**
+ * \file
+ */
+
#ifndef __MONO_CONFIG_INTERNAL_H__
#define __MONO_CONFIG_INTERNAL_H__
-/*
- * mono-config.c
+/**
+ * \file
*
* Runtime and assembly configuration file support routines.
*
g_hash_table_insert (config_handlers, (gpointer) aot_cache_handler.element_name, (gpointer) &aot_cache_handler);
}
+/**
+ * mono_config_cleanup:
+ */
void
mono_config_cleanup (void)
{
/**
* mono_config_parse_memory:
- * @buffer: a pointer to an string XML representation of the configuration
- *
+ * \param buffer a pointer to an string XML representation of the configuration
* Parses the configuration from a buffer
*/
void
static const char *bundled_machine_config = NULL;
+/**
+ * mono_register_config_for_assembly:
+ */
void
mono_register_config_for_assembly (const char* assembly_name, const char* config_xml)
{
bundled_configs = bconfig;
}
+/**
+ * mono_config_string_for_assembly_file:
+ */
const char *
mono_config_string_for_assembly_file (const char *filename)
{
return NULL;
}
+/**
+ * mono_config_for_assembly:
+ */
void
mono_config_for_assembly (MonoImage *assembly)
{
/**
* mono_config_parse:
- * @filename: the filename to load the configuration variables from.
- *
+ * \param filename the filename to load the configuration variables from.
* Pass a NULL filename to parse the default config files
- * (or the file in the MONO_CONFIG env var).
+ * (or the file in the \c MONO_CONFIG env var).
*/
void
mono_config_parse (const char *filename) {
#endif
}
-/* Invoked during startup */
+/**
+ * mono_set_config_dir:
+ * Invoked during startup
+ */
void
mono_set_config_dir (const char *dir)
{
mono_cfg_dir = mono_cfg_dir_allocated = g_strdup (dir);
}
+/**
+ * mono_get_config_dir:
+ */
const char*
mono_get_config_dir (void)
{
return mono_cfg_dir;
}
+/**
+ * mono_register_machine_config:
+ */
void
mono_register_machine_config (const char *config_xml)
{
bundled_machine_config = config_xml;
}
+/**
+ * mono_get_machine_config:
+ */
const char *
mono_get_machine_config (void)
{
static mono_bool mono_server_mode = FALSE;
+/**
+ * mono_config_set_server_mode:
+ */
void
mono_config_set_server_mode (mono_bool server_mode)
{
mono_server_mode = server_mode;
}
+/**
+ * mono_config_is_server_mode:
+ */
mono_bool
mono_config_is_server_mode (void)
{
-/*
- * mono-config.h
+/**
+ * \file
*
* Author: Paolo Molaro (lupus@ximian.com)
*
-/*
- * mono-debug.c:
+/**
+ * \file
*
* Author:
* Mono Project (http://www.mono-project.com)
}
}
+/**
+ * mono_debug_domain_create:
+ */
void
mono_debug_domain_create (MonoDomain *domain)
{
return (MonoDebugHandle *)g_hash_table_lookup (mono_debug_handles, image);
}
+/**
+ * mono_debug_close_image:
+ */
void
mono_debug_close_image (MonoImage *image)
{
/**
* mono_debug_lookup_method:
*
- * Lookup symbol file information for the method @method. The returned
- * `MonoDebugMethodInfo' is a private structure, but it can be passed to
- * mono_debug_symfile_lookup_location().
+ * Lookup symbol file information for the method \p method. The returned
+ * \c MonoDebugMethodInfo is a private structure, but it can be passed to
+ * \c mono_debug_symfile_lookup_location.
*/
MonoDebugMethodInfo *
mono_debug_lookup_method (MonoMethod *method)
*rptr = ptr;
}
+/**
+ * mono_debug_add_method:
+ */
MonoDebugMethodAddress *
mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain)
{
mono_debugger_unlock ();
}
+/**
+ * mono_debug_add_delegate_trampoline:
+ */
void
mono_debug_add_delegate_trampoline (gpointer code, int size)
{
/**
* mono_debug_il_offset_from_address:
*
- * Compute the IL offset corresponding to NATIVE_OFFSET inside the native
- * code of METHOD in DOMAIN.
+ * Compute the IL offset corresponding to \p native_offset inside the native
+ * code of \p method in \p domain.
*/
gint32
mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, guint32 native_offset)
/**
* mono_debug_lookup_source_location:
- * @address: Native offset within the @method's machine code.
- *
+ * \param address Native offset within the \p method's machine code.
* Lookup the source code corresponding to the machine instruction located at
- * native offset @address within @method.
- *
- * The returned `MonoDebugSourceLocation' contains both file / line number
+ * native offset \p address within \p method.
+ * The returned \c MonoDebugSourceLocation contains both file / line number
* information and the corresponding IL offset. It must be freed by
- * mono_debug_free_source_location().
+ * \c mono_debug_free_source_location.
*/
MonoDebugSourceLocation *
mono_debug_lookup_source_location (MonoMethod *method, guint32 address, MonoDomain *domain)
/**
* mono_debug_free_source_location:
- * @location: A `MonoDebugSourceLocation'.
- *
- * Frees the @location.
+ * \param location A \c MonoDebugSourceLocation
+ * Frees the \p location.
*/
void
mono_debug_free_source_location (MonoDebugSourceLocation *location)
/**
* mono_debug_print_stack_frame:
- * @native_offset: Native offset within the @method's machine code.
- *
- * Conventient wrapper around mono_debug_lookup_source_location() which can be
+ * \param native_offset Native offset within the \p method's machine code.
+ * Conventient wrapper around \c mono_debug_lookup_source_location which can be
* used if you only want to use the location to print a stack frame.
*/
gchar *
static BundledSymfile *bundled_symfiles = NULL;
+/**
+ * mono_register_symfile_for_assembly:
+ */
void
mono_register_symfile_for_assembly (const char *assembly_name, const mono_byte *raw_contents, int size)
{
-/*
+/**
+ * \file
* This header is only installed for use by the debugger:
* the structures and the API declared here are not supported.
*/
-/*
- * mono-endian.c:
+/**
+ * \file
*
* Author:
* Mono Project (http://www.mono-project.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_ENDIAN_H_
#define _MONO_METADATA_ENDIAN_H_ 1
-/*
- * mono-gc.h: GC related public interface
+/**
+ * \file
+ * GC related public interface
*
*/
#ifndef __METADATA_MONO_GC_H__
-/*
- * ghashtable.c: Hashtable implementation
+/**
+ * \file
+ * Hashtable implementation
*
* Author:
* Miguel de Icaza (miguel@novell.com)
mg_free (old_values);
}
+/**
+ * mono_g_hash_table_size:
+ */
guint
mono_g_hash_table_size (MonoGHashTable *hash)
{
return hash->in_use;
}
+/**
+ * mono_g_hash_table_lookup:
+ */
gpointer
mono_g_hash_table_lookup (MonoGHashTable *hash, gconstpointer key)
{
return NULL;
}
+/**
+ * mono_g_hash_table_lookup_extended:
+ */
gboolean
mono_g_hash_table_lookup_extended (MonoGHashTable *hash, gconstpointer key, gpointer *orig_key, gpointer *value)
{
return FALSE;
}
+/**
+ * mono_g_hash_table_foreach:
+ */
void
mono_g_hash_table_foreach (MonoGHashTable *hash, GHFunc func, gpointer user_data)
{
return NULL;
}
+/**
+ * mono_g_hash_table_remove:
+ */
gboolean
mono_g_hash_table_remove (MonoGHashTable *hash, gconstpointer key)
{
return TRUE;
}
+/**
+ * mono_g_hash_table_foreach_remove:
+ */
guint
mono_g_hash_table_foreach_remove (MonoGHashTable *hash, GHRFunc func, gpointer user_data)
{
return count;
}
+/**
+ * mono_g_hash_table_destroy:
+ */
void
mono_g_hash_table_destroy (MonoGHashTable *hash)
{
}
}
+/**
+ * mono_g_hash_table_insert:
+ */
void
mono_g_hash_table_insert (MonoGHashTable *h, gpointer k, gpointer v)
{
mono_g_hash_table_insert_replace (h, k, v, FALSE);
}
+/**
+ * mono_g_hash_table_replace:
+ */
void
mono_g_hash_table_replace(MonoGHashTable *h, gpointer k, gpointer v)
{
-/*
- * mono-hash.c: GC-aware hashtable, based on Eglib's Hashtable
+/**
+ * \file
+ * GC-aware hashtable, based on Eglib's Hashtable
*
* Authors:
* Paolo Molaro (lupus@xamarin.com)
-/*
- * mono-mlist.c: Managed object list implementation
+/**
+ * \file
+ * Managed object list implementation
*
* Author:
* Paolo Molaro (lupus@ximian.com)
/**
* mono_mlist_alloc:
- * @data: object to use as data
- *
- * Allocates a new managed list node with @data as the contents.
+ * \param data object to use as data
+ * Allocates a new managed list node with \p data as the contents.
* A managed list node also represents a singly-linked list.
* Managed lists are garbage collected, so there is no free routine
* and the user is required to keep references to the managed list
/**
* mono_mlist_alloc_checked:
- * @data: object to use as data
- * @error: set on error
- *
- * Allocates a new managed list node with @data as the contents. A
+ * \param data object to use as data
+ * \param error set on error
+ * Allocates a new managed list node with \p data as the contents. A
* managed list node also represents a singly-linked list. Managed
* lists are garbage collected, so there is no free routine and the
* user is required to keep references to the managed list to prevent
* it from being garbage collected. On failure returns NULL and sets
- * @error.
+ * \p error.
*/
MonoMList*
mono_mlist_alloc_checked (MonoObject *data, MonoError *error)
/**
* mono_mlist_get_data:
- * @list: the managed list node
- *
- * Get the object stored in the list node @list.
+ * \param list the managed list node
+ * Get the object stored in the list node \p list.
*/
MonoObject*
mono_mlist_get_data (MonoMList* list)
/**
* mono_mlist_set_data:
- * @list: the managed list node
- *
- * Set the object content in the list node @list.
+ * \param list the managed list node
+ * Set the object content in the list node \p list.
*/
void
mono_mlist_set_data (MonoMList* list, MonoObject *data)
/**
* mono_mlist_set_next:
- * @list: a managed list node
- * @next: list node that will be next for the @list node.
- *
- * Set next node for @list to @next.
+ * \param list a managed list node
+ * \param next list node that will be next for the \p list node.
+ * Set next node for \p list to \p next.
*/
MonoMList *
mono_mlist_set_next (MonoMList* list, MonoMList *next)
/**
* mono_mlist_length:
- * @list: the managed list
- *
- * Get the number of items in the list @list.
+ * \param list the managed list
+ * Get the number of items in the list \p list.
* Since managed lists are singly-linked, this operation takes O(n) time.
*/
int
/**
* mono_mlist_next:
- * @list: the managed list node
- *
- * Returns the next managed list node starting from @list.
+ * \param list the managed list node
+ * Returns the next managed list node starting from \p list.
*/
MonoMList*
mono_mlist_next (MonoMList* list)
/**
* mono_mlist_last:
- * @list: the managed list node
- *
- * Returns the last managed list node in list @list.
+ * \param list the managed list node
+ * Returns the last managed list node in list \p list.
* Since managed lists are singly-linked, this operation takes O(n) time.
*/
MonoMList*
/**
* mono_mlist_prepend:
- * @list: the managed list
- * @data: the object to add to the list
- *
- * Allocate a new list node with @data as content and prepend it
- * to the list @list. @list can be NULL.
+ * \param list the managed list
+ * \param data the object to add to the list
+ * Allocate a new list node with \p data as content and prepend it
+ * to the list \p list. \p list can be NULL.
*/
MonoMList*
mono_mlist_prepend (MonoMList* list, MonoObject *data)
/**
* mono_mlist_prepend_checked:
- * @list: the managed list
- * @data: the object to add to the list
- * @error: set on error
- *
- * Allocate a new list node with @data as content and prepend it to
- * the list @list. @list can be NULL. On failure returns NULL and sets
- * @error.
+ * \param list the managed list
+ * \param data the object to add to the list
+ * \param error set on error
+ * Allocate a new list node with \p data as content and prepend it to
+ * the list \p list. \p list can be NULL. On failure returns NULL and sets
+ * \p error.
*/
MonoMList*
mono_mlist_prepend_checked (MonoMList* list, MonoObject *data, MonoError *error)
/**
* mono_mlist_append:
- * @list: the managed list
- * @data: the object to add to the list
- *
- * Allocate a new list node with @data as content and append it
- * to the list @list. @list can be NULL.
+ * \param list the managed list
+ * \param data the object to add to the list
+ * Allocate a new list node with \p data as content and append it
+ * to the list \p list. \p list can be NULL.
* Since managed lists are singly-linked, this operation takes O(n) time.
*/
MonoMList*
/**
* mono_mlist_append_checked:
- * @list: the managed list
- * @data: the object to add to the list
- * @error: set on error
- *
- * Allocate a new list node with @data as content and append it
- * to the list @list. @list can be NULL.
+ * \param list the managed list
+ * \param data the object to add to the list
+ * \param error set on error
+ * Allocate a new list node with \p data as content and append it
+ * to the list \p list. \p list can be NULL.
* Since managed lists are singly-linked, this operation takes O(n) time.
- * On failure returns NULL and sets @error.
+ * On failure returns NULL and sets \p error.
*/
MonoMList*
mono_mlist_append_checked (MonoMList* list, MonoObject *data, MonoError *error)
/**
* mono_mlist_remove_item:
- * @list: the managed list
- * @data: the object to remove from the list
- *
- * Remove the list node @item from the managed list @list.
+ * \param list the managed list
+ * \param data the object to remove from the list
+ * Remove the list node \p item from the managed list \p list.
* Since managed lists are singly-linked, this operation can take O(n) time.
*/
MonoMList*
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_MONO_MLIST_H__
#define __MONO_METADATA_MONO_MLIST_H__
-/*
+/**
+ * \file
* Define the system and runtime performance counters.
* Each category is defined with the macro:
* PERFCTR_CAT(catid, name, help, type, instances, first_counter_id)
-/*
- * mono-perfcounters.c
+/**
+ * \file
*
* Performance counters support.
*
+/**
+ * \file
+ */
+
#ifndef __MONO_PERFCOUNTERS_H__
#define __MONO_PERFCOUNTERS_H__
-/*
- * mono-ptr-array.h: GC aware equivalente of g_ptr_array
+/**
+ * \file
+ * GC aware equivalente of g_ptr_array
*
* Author:
* Rodrigo Kumpera <rkumpera@novell.com>
-/*
- * mono-route.c: Read the network routing tables using sysctl(3) calls
- * Required for Unix-like systems that don't have Linux's /proc/net/route
+/**
+ * \file
+ * Read the network routing tables using sysctl(3) calls
+ * Required for Unix-like systems that don't have Linux's /proc/net/route
*
* Author:
* Ben Woods (woodsb02@gmail.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_ROUTE_H__
#define __MONO_ROUTE_H__
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * mono-security-windows-uwp.c: UWP security support for Mono.
+/**
+ * \file
+ * UWP security support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-security-windows.c: Windows security support.
+/**
+ * \file
+ * Windows security support.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * security.c: Security internal calls
+/**
+ * \file
+ * Security internal calls
*
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
#include <config.h>
#endif
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/image.h>
#include <mono/metadata/exception.h>
if (system_security_assembly == NULL) {
system_security_assembly = mono_image_loaded ("System.Security");
if (!system_security_assembly) {
- MonoAssembly *sa = mono_assembly_open ("System.Security.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("System.Security.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa)
g_assert_not_reached ();
system_security_assembly = mono_assembly_get_image (sa);
+/**
+ * \file
+ */
+
#if defined(__native_client__)
#include "nacl-stub.h"
-/*
- * null-gc.c: GC implementation using malloc: will leak everything, just for testing.
+/**
+ * \file
+ * GC implementation using malloc: will leak everything, just for testing.
*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2011 Novell, Inc (http://www.novell.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_NUMBER_FORMATTER_H_
#define _MONO_METADATA_NUMBER_FORMATTER_H_ 1
-/*
- * number-ms.c: System.Double, System.Single and System.Number runtime support
+/**
+ * \file
+ * System.Double, System.Single and System.Number runtime support
*
* Author:
* Ludovic Henry (ludovic@xamarin.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_NUMBER_MS_H__
#define __MONO_NUMBER_MS_H__
+/**
+ * \file
+ */
+
#ifndef __MONO_OBJECT_INTERNALS_H__
#define __MONO_OBJECT_INTERNALS_H__
-/*
+
+/**
+\file
This is a parameterized header. It's supposed/ok to be included multiple times.
Input defines: (those to be defined by the includer file)
Optional:
USE_CROSS_COMPILE_OFFSETS - if defined, force the cross compiler offsets to be used, otherwise
they will only be used if MONO_CROSS_COMPILE is defined
+DISABLE_METADATA_OFFSETS - Disable the definition of offsets for structures defined in metadata/.
+DISABLE_JIT_OFFSETS - Disable the definition of offsets for structures defined in mini/.
+
+The last two are needed because metadata shouldn't include JIT offsets since the structures
+are not defined, while the JIT shouldn't include metadata offsets, since some of them
+are GC specific, and the JIT needs to remain GC agnostic.
Output defines:
DECL_SIZE(double)
DECL_SIZE(gpointer)
+// Offsets for structures defined in metadata/
#ifndef DISABLE_METADATA_OFFSETS
-//object offsets
DECL_OFFSET(MonoObject, vtable)
DECL_OFFSET(MonoObject, synchronisation)
#endif //DISABLE METADATA OFFSETS
+// Offsets for structures defined in mini/
#ifndef DISABLE_JIT_OFFSETS
DECL_OFFSET(MonoLMF, previous_lmf)
-/*
- * object.c: Object creation for the Mono runtime
+/**
+ * \file
+ * Object creation for the Mono runtime
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
/**
* mono_runtime_object_init:
- * @this_obj: the object to initialize
- *
+ * \param this_obj the object to initialize
* This function calls the zero-argument constructor (which must
* exist) for the given object.
*/
/**
* mono_runtime_object_init_checked:
- * @this_obj: the object to initialize
- * @error: set on error.
- *
+ * \param this_obj the object to initialize
+ * \param error set on error.
* This function calls the zero-argument constructor (which must
* exist) for the given object and returns TRUE on success, or FALSE
- * on error and sets @error.
+ * on error and sets \p error.
*/
gboolean
mono_runtime_object_init_checked (MonoObject *this_obj, MonoError *error)
/**
* mono_thread_set_main:
- * @thread: thread to set as the main thread
- *
- * This function can be used to instruct the runtime to treat @thread
- * as the main thread, ie, the thread that would normally execute the Main()
- * method. This basically means that at the end of @thread, the runtime will
+ * \param thread thread to set as the main thread
+ * This function can be used to instruct the runtime to treat \p thread
+ * as the main thread, ie, the thread that would normally execute the \c Main
+ * method. This basically means that at the end of \p thread, the runtime will
* wait for the existing foreground threads to quit and other such details.
*/
void
main_thread = thread;
}
+/**
+ * mono_thread_get_main:
+ */
MonoThread*
mono_thread_get_main (void)
{
return ex;
}
-/*
+/**
* mono_runtime_class_init:
- * @vtable: vtable that needs to be initialized
- *
- * This routine calls the class constructor for @vtable.
+ * \param vtable vtable that needs to be initialized
+ * This routine calls the class constructor for \p vtable.
*/
void
mono_runtime_class_init (MonoVTable *vtable)
/**
* mono_runtime_class_init_full:
- * @vtable that neeeds to be initialized
- * @error set on error
- *
- * returns TRUE if class constructor .cctor has been initialized successfully, or FALSE otherwise and sets @error.
- *
+ * \param vtable that neeeds to be initialized
+ * \param error set on error
+ * \returns TRUE if class constructor \c .cctor has been initialized successfully, or FALSE otherwise and sets \p error.
*/
gboolean
mono_runtime_class_init_full (MonoVTable *vtable, MonoError *error)
MonoNativeThreadId tid;
int do_initialization = 0;
MonoDomain *last_domain = NULL;
- MonoException * pending_tae = NULL;
+ gboolean pending_tae = FALSE;
error_init (error);
mono_threads_begin_abort_protected_block ();
mono_runtime_try_invoke (method, NULL, NULL, (MonoObject**) &exc, error);
- gboolean got_pending_interrupt = mono_threads_end_abort_protected_block ();
+ mono_threads_end_abort_protected_block ();
//exception extracted, error will be set to the right value later
if (exc == NULL && !mono_error_ok (error))//invoking failed but exc was not set
mono_coop_cond_broadcast (&lock->cond);
mono_type_init_unlock (lock);
- //This can happen if the cctor self-aborts
- if (exc && mono_object_class (exc) == mono_defaults.threadabortexception_class)
- pending_tae = exc;
-
- //TAEs are blocked around .cctors, they must escape as soon as no cctor is left to run.
- if (!pending_tae && got_pending_interrupt)
- pending_tae = mono_thread_try_resume_interruption ();
+ /*
+ * This can happen if the cctor self-aborts. We need to reactivate tae
+ * (next interruption checkpoint will throw it) and make sure we won't
+ * throw tie for the type.
+ */
+ if (exc && mono_object_class (exc) == mono_defaults.threadabortexception_class) {
+ pending_tae = TRUE;
+ mono_thread_resume_interruption (FALSE);
+ }
} else {
/* this just blocks until the initializing thread is done */
mono_type_init_lock (lock);
vtable->initialized = 1;
mono_type_initialization_unlock ();
- //TAE wins over TIE
- if (pending_tae)
- mono_error_set_exception_instance (error, pending_tae);
- else if (vtable->init_failed) {
+ /* If vtable init fails because of TAE, we don't throw TIE, only the TAE */
+ if (vtable->init_failed && !pending_tae) {
/* Either we were the initializing thread or we waited for the initialization */
mono_error_set_exception_instance (error, get_type_init_exception_for_vtable (vtable));
return FALSE;
/**
* mono_compile_method:
- * @method: The method to compile.
- *
+ * \param method The method to compile.
* This JIT-compiles the method, and returns the pointer to the native code
* produced.
*/
}
/**
- * mono_compile_method:
- * @method: The method to compile.
- * @error: set on error.
- *
+ * mono_compile_method_checked:
+ * \param method The method to compile.
+ * \param error set on error.
* This JIT-compiles the method, and returns the pointer to the native code
- * produced. On failure returns NULL and sets @error.
+ * produced. On failure returns NULL and sets \p error.
*/
gpointer
mono_compile_method_checked (MonoMethod *method, MonoError *error)
/**
* mono_runtime_free_method:
- * @domain; domain where the method is hosted
- * @method: method to release
- *
+ * \param domain domain where the method is hosted
+ * \param method method to release
* This routine is invoked to free the resources associated with
* a method that has been JIT compiled. This is used to discard
* methods that were used only temporarily (for example, used in marshalling)
- *
*/
void
mono_runtime_free_method (MonoDomain *domain, MonoMethod *method)
/**
* mono_vtable_build_imt_slot:
- * @vtable: virtual object table struct
- * @imt_slot: slot in the IMT table
- *
- * Fill the given @imt_slot in the IMT table of @vtable with
+ * \param vtable virtual object table struct
+ * \param imt_slot slot in the IMT table
+ * Fill the given \p imt_slot in the IMT table of \p vtable with
* a trampoline or a trampoline for the case of collisions.
* This is part of the internal mono API.
- *
* LOCKING: Take the domain lock.
*/
void
/**
* mono_method_alloc_generic_virtual_trampoline:
- * @domain: a domain
- * @size: size in bytes
- *
- * Allocs size bytes to be used for the code of a generic virtual
+ * \param domain a domain
+ * \param size size in bytes
+ * Allocs \p size bytes to be used for the code of a generic virtual
* trampoline. It's either allocated from the domain's code manager or
* reused from a previously invalidated piece.
- *
* LOCKING: The domain lock must be held.
*/
gpointer
}
/**
- * mono_method_add_generic_virtual_invocation:
- * @domain: a domain
- * @vtable_slot: pointer to the vtable slot
- * @method: the inflated generic virtual method
- * @code: the method's code
+ * \param domain a domain
+ * \param vtable_slot pointer to the vtable slot
+ * \param method the inflated generic virtual method
+ * \param code the method's code
*
* Registers a call via unmanaged code to a generic virtual method
* instantiation or variant interface method. If the number of calls reaches a threshold
/**
* mono_class_vtable:
- * @domain: the application domain
- * @class: the class to initialize
- *
+ * \param domain the application domain
+ * \param class the class to initialize
* VTables are domain specific because we create domain specific code, and
* they contain the domain specific static class data.
- * On failure, NULL is returned, and class->exception_type is set.
+ * On failure, NULL is returned, and \c class->exception_type is set.
*/
MonoVTable *
mono_class_vtable (MonoDomain *domain, MonoClass *klass)
/**
* mono_class_vtable_full:
- * @domain: the application domain
- * @class: the class to initialize
- * @error set on failure.
- *
+ * \param domain the application domain
+ * \param class the class to initialize
+ * \param error set on failure.
* VTables are domain specific because we create domain specific code, and
* they contain the domain specific static class data.
*/
/**
* mono_class_try_get_vtable:
- * @domain: the application domain
- * @class: the class to initialize
- *
- * This function tries to get the associated vtable from @class if
+ * \param domain the application domain
+ * \param class the class to initialize
+ * This function tries to get the associated vtable from \p class if
* it was already created.
*/
MonoVTable *
#ifndef DISABLE_REMOTING
/**
* mono_class_proxy_vtable:
- * @domain: the application domain
- * @remove_class: the remote class
- * @error: set on error
- *
+ * \param domain the application domain
+ * \param remove_class the remote class
+ * \param error set on error
* Creates a vtable for transparent proxies. It is basically
- * a copy of the real vtable of the class wrapped in @remote_class,
+ * a copy of the real vtable of the class wrapped in \p remote_class,
* but all function pointers invoke the remoting functions, and
- * vtable->klass points to the transparent proxy class, and not to @class.
+ * \c vtable->klass points to the transparent proxy class, and not to \p class.
*
- * On failure returns NULL and sets @error
+ * On failure returns NULL and sets \p error
*/
static MonoVTable *
mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, MonoRemotingTarget target_type, MonoError *error)
/**
* mono_class_field_is_special_static:
- *
- * Returns whether @field is a thread/context static field.
+ * \returns whether \p field is a thread/context static field.
*/
gboolean
mono_class_field_is_special_static (MonoClassField *field)
/**
* mono_class_field_get_special_static_type:
- * @field: The MonoClassField describing the field.
- *
- * Returns: SPECIAL_STATIC_THREAD if the field is thread static, SPECIAL_STATIC_CONTEXT if it is context static,
- * SPECIAL_STATIC_NONE otherwise.
+ * \param field The \c MonoClassField describing the field.
+ * \returns \c SPECIAL_STATIC_THREAD if the field is thread static, \c SPECIAL_STATIC_CONTEXT if it is context static,
+ * \c SPECIAL_STATIC_NONE otherwise.
*/
guint32
mono_class_field_get_special_static_type (MonoClassField *field)
/**
* mono_class_has_special_static_fields:
- *
- * Returns whenever @klass has any thread/context static fields.
+ * \returns whether \p klass has any thread/context static fields.
*/
gboolean
mono_class_has_special_static_fields (MonoClass *klass)
/**
* mono_remote_class:
- * @domain: the application domain
- * @class_name: name of the remote class
- * @error: set on error
- *
- * Creates and initializes a MonoRemoteClass object for a remote type.
- *
- * On failure returns NULL and sets @error
+ * \param domain the application domain
+ * \param class_name name of the remote class
+ * \param error set on error
+ * Creates and initializes a \c MonoRemoteClass object for a remote type.
+ * On failure returns NULL and sets \p error
*/
MonoRemoteClass*
mono_remote_class (MonoDomain *domain, MonoStringHandle class_name, MonoClass *proxy_class, MonoError *error)
/**
* mono_upgrade_remote_class:
- * @domain: the application domain
- * @tproxy: the proxy whose remote class has to be upgraded.
- * @klass: class to which the remote class can be casted.
- * @error: set on error
- *
+ * \param domain the application domain
+ * \param tproxy the proxy whose remote class has to be upgraded.
+ * \param klass class to which the remote class can be casted.
+ * \param error set on error
* Updates the vtable of the remote class by adding the necessary method slots
* and interface offsets so it can be safely casted to klass. klass can be a
- * class or an interface. On success returns TRUE, on failure returns FALSE and sets @error.
+ * class or an interface. On success returns TRUE, on failure returns FALSE and sets \p error.
*/
gboolean
mono_upgrade_remote_class (MonoDomain *domain, MonoObjectHandle proxy_object, MonoClass *klass, MonoError *error)
/**
* mono_object_get_virtual_method:
- * @obj: object to operate on.
- * @method: method
- *
- * Retrieves the MonoMethod that would be called on obj if obj is passed as
- * the instance of a callvirt of method.
+ * \param obj object to operate on.
+ * \param method method
+ * Retrieves the \c MonoMethod that would be called on \p obj if \p obj is passed as
+ * the instance of a callvirt of \p method.
*/
MonoMethod*
mono_object_get_virtual_method (MonoObject *obj_raw, MonoMethod *method)
}
/**
- * mono_object_get_virtual_method:
- * @obj: object to operate on.
- * @method: method
- *
- * Retrieves the MonoMethod that would be called on obj if obj is passed as
- * the instance of a callvirt of method.
+ * mono_object_handle_get_virtual_method:
+ * \param obj object to operate on.
+ * \param method method
+ * Retrieves the \c MonoMethod that would be called on \p obj if \p obj is passed as
+ * the instance of a callvirt of \p method.
*/
MonoMethod*
mono_object_handle_get_virtual_method (MonoObjectHandle obj, MonoMethod *method, MonoError *error)
/**
* mono_runtime_invoke:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @exc: exception information.
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param exc exception information.
+ * Invokes the method represented by \p method on the object \p obj.
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
* The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
+ * same convention: \c MonoObject* pointers for object instances and
* pointers to the value type otherwise.
*
* From unmanaged code you'll usually use the
- * mono_runtime_invoke() variant.
+ * \c mono_runtime_invoke variant.
*
* Note that this function doesn't handle virtual methods for
* you, it will exec the exact method you pass: we still need to
* of a virtual method (there are examples of this in the code,
* though).
*
- * You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
+ * You can pass NULL as the \p exc argument if you don't want to
+ * catch exceptions, otherwise, \c *exc will be set to the exception
* thrown, if any. if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*
* If the method returns a value type, it is boxed in an object
* reference.
/**
* mono_runtime_try_invoke:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @exc: exception information.
- * @error: set on error
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param exc exception information.
+ * \param error set on error
+ * Invokes the method represented by \p method on the object \p obj.
+ *
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
* The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
+ * same convention: \c MonoObject* pointers for object instances and
* pointers to the value type otherwise.
*
* From unmanaged code you'll usually use the
* of a virtual method (there are examples of this in the code,
* though).
*
- * For this function, you must not pass NULL as the exc argument if
+ * For this function, you must not pass NULL as the \p exc argument if
* you don't want to catch exceptions, use
* mono_runtime_invoke_checked(). If an exception is thrown, you
- * can't use the MonoObject* result from the function.
+ * can't use the \c MonoObject* result from the function.
*
- * If this method cannot be invoked, @error will be set and @exc and
+ * If this method cannot be invoked, \p error will be set and \p exc and
* the return value must not be used.
*
* If the method returns a value type, it is boxed in an object
/**
* mono_runtime_invoke_checked:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @error: set on error
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param error set on error
+ * Invokes the method represented by \p method on the object \p obj.
+ *
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
- * The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
+ * The \p params array contains the arguments to the method with the
+ * same convention: \c MonoObject* pointers for object instances and
* pointers to the value type otherwise.
*
* From unmanaged code you'll usually use the
* of a virtual method (there are examples of this in the code,
* though).
*
- * If an exception is thrown, you can't use the MonoObject* result
+ * If an exception is thrown, you can't use the \c MonoObject* result
* from the function.
*
- * If this method cannot be invoked, @error will be set. If the
+ * If this method cannot be invoked, \p error will be set. If the
* method throws an exception (and we're in coop mode) the exception
- * will be set in @error.
+ * will be set in \p error.
*
* If the method returns a value type, it is boxed in an object
* reference.
/**
* mono_method_get_unmanaged_thunk:
- * @method: method to generate a thunk for.
+ * \param method method to generate a thunk for.
*
- * Returns an unmanaged->managed thunk that can be used to call
+ * Returns an \c unmanaged->managed thunk that can be used to call
* a managed method directly from C.
*
* The thunk's C signature closely matches the managed signature:
*
- * C#: public bool Equals (object obj);
- * C: typedef MonoBoolean (*Equals)(MonoObject*,
- * MonoObject*, MonoException**);
+ * C#: <code>public bool Equals (object obj);</code>
*
- * The 1st ("this") parameter must not be used with static methods:
+ * C: <code>typedef MonoBoolean (*Equals)(MonoObject*, MonoObject*, MonoException**);</code>
*
- * C#: public static bool ReferenceEquals (object a, object b);
- * C: typedef MonoBoolean (*ReferenceEquals)(MonoObject*, MonoObject*,
- * MonoException**);
+ * The 1st (<code>this</code>) parameter must not be used with static methods:
*
- * The last argument must be a non-null pointer of a MonoException* pointer.
- * It has "out" semantics. After invoking the thunk, *ex will be NULL if no
+ * C#: <code>public static bool ReferenceEquals (object a, object b);</code>
+ *
+ * C: <code>typedef MonoBoolean (*ReferenceEquals)(MonoObject*, MonoObject*, MonoException**);</code>
+ *
+ * The last argument must be a non-null \c MonoException* pointer.
+ * It has "out" semantics. After invoking the thunk, \c *ex will be NULL if no
* exception has been thrown in managed code. Otherwise it will point
- * to the MonoException* caught by the thunk. In this case, the result of
+ * to the \c MonoException* caught by the thunk. In this case, the result of
* the thunk is undefined:
*
+ * <pre>
* MonoMethod *method = ... // MonoMethod* of System.Object.Equals
+ *
* MonoException *ex = NULL;
+ *
* Equals func = mono_method_get_unmanaged_thunk (method);
+ *
* MonoBoolean res = func (thisObj, objToCompare, &ex);
+ *
* if (ex) {
+ *
* // handle exception
+ *
* }
+ * </pre>
*
* The calling convention of the thunk matches the platform's default
* convention. This means that under Windows, C declarations must
- * contain the __stdcall attribute:
+ * contain the \c __stdcall attribute:
*
- * C: typedef MonoBoolean (__stdcall *Equals)(MonoObject*,
- * MonoObject*, MonoException**);
+ * C: <code>typedef MonoBoolean (__stdcall *Equals)(MonoObject*, MonoObject*, MonoException**);</code>
*
* LIMITATIONS
*
* Value type arguments and return values are treated as they were objects:
*
- * C#: public static Rectangle Intersect (Rectangle a, Rectangle b);
- * C: typedef MonoObject* (*Intersect)(MonoObject*, MonoObject*, MonoException**);
+ * C#: <code>public static Rectangle Intersect (Rectangle a, Rectangle b);</code>
+ * C: <code>typedef MonoObject* (*Intersect)(MonoObject*, MonoObject*, MonoException**);</code>
*
* Arguments must be properly boxed upon trunk's invocation, while return
* values must be unboxed.
/**
* mono_field_set_value:
- * @obj: Instance object
- * @field: MonoClassField describing the field to set
- * @value: The value to be set
+ * \param obj Instance object
+ * \param field \c MonoClassField describing the field to set
+ * \param value The value to be set
*
- * Sets the value of the field described by @field in the object instance @obj
- * to the value passed in @value. This method should only be used for instance
- * fields. For static fields, use mono_field_static_set_value.
+ * Sets the value of the field described by \p field in the object instance \p obj
+ * to the value passed in \p value. This method should only be used for instance
+ * fields. For static fields, use \c mono_field_static_set_value.
*
- * The value must be on the native format of the field type.
+ * The value must be in the native format of the field type.
*/
void
mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value)
/**
* mono_field_static_set_value:
- * @field: MonoClassField describing the field to set
- * @value: The value to be set
- *
- * Sets the value of the static field described by @field
- * to the value passed in @value.
- *
- * The value must be on the native format of the field type.
+ * \param field \c MonoClassField describing the field to set
+ * \param value The value to be set
+ * Sets the value of the static field described by \p field
+ * to the value passed in \p value.
+ * The value must be in the native format of the field type.
*/
void
mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value)
/**
* mono_field_get_value:
- * @obj: Object instance
- * @field: MonoClassField describing the field to fetch information from
- * @value: pointer to the location where the value will be stored
- *
- * Use this routine to get the value of the field @field in the object
+ * \param obj Object instance
+ * \param field \c MonoClassField describing the field to fetch information from
+ * \param value pointer to the location where the value will be stored
+ * Use this routine to get the value of the field \p field in the object
* passed.
*
* The pointer provided by value must be of the field type, for reference
- * types this is a MonoObject*, for value types its the actual pointer to
+ * types this is a \c MonoObject*, for value types its the actual pointer to
* the value type.
*
* For example:
- * int i;
- * mono_field_get_value (obj, int_field, &i);
+ *
+ * <pre>
+ * int i;
+ *
+ * mono_field_get_value (obj, int_field, &i);
+ * </pre>
*/
void
mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value)
/**
* mono_field_get_value_object:
- * @domain: domain where the object will be created (if boxing)
- * @field: MonoClassField describing the field to fetch information from
- * @obj: The object instance for the field.
- *
- * Returns: a new MonoObject with the value from the given field. If the
+ * \param domain domain where the object will be created (if boxing)
+ * \param field \c MonoClassField describing the field to fetch information from
+ * \param obj The object instance for the field.
+ * \returns a new \c MonoObject with the value from the given field. If the
* field represents a value type, the value is boxed.
- *
*/
MonoObject *
mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj)
/**
* mono_field_get_value_object_checked:
- * @domain: domain where the object will be created (if boxing)
- * @field: MonoClassField describing the field to fetch information from
- * @obj: The object instance for the field.
- * @error: Set on error.
- *
- * Returns: a new MonoObject with the value from the given field. If the
- * field represents a value type, the value is boxed. On error returns NULL and sets @error.
- *
+ * \param domain domain where the object will be created (if boxing)
+ * \param field \c MonoClassField describing the field to fetch information from
+ * \param obj The object instance for the field.
+ * \param error Set on error.
+ * \returns a new \c MonoObject with the value from the given field. If the
+ * field represents a value type, the value is boxed. On error returns NULL and sets \p error.
*/
MonoObject *
mono_field_get_value_object_checked (MonoDomain *domain, MonoClassField *field, MonoObject *obj, MonoError *error)
/**
* mono_field_static_get_value:
- * @vt: vtable to the object
- * @field: MonoClassField describing the field to fetch information from
- * @value: where the value is returned
- *
- * Use this routine to get the value of the static field @field value.
+ * \param vt vtable to the object
+ * \param field \c MonoClassField describing the field to fetch information from
+ * \param value where the value is returned
+ * Use this routine to get the value of the static field \p field value.
*
* The pointer provided by value must be of the field type, for reference
- * types this is a MonoObject*, for value types its the actual pointer to
+ * types this is a \c MonoObject*, for value types its the actual pointer to
* the value type.
*
* For example:
+ *
+ * <pre>
* int i;
+ *
* mono_field_static_get_value (vt, int_field, &i);
+ * </pre>
*/
void
mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value)
/**
* mono_field_static_get_value_checked:
- * @vt: vtable to the object
- * @field: MonoClassField describing the field to fetch information from
- * @value: where the value is returned
- * @error: set on error
- *
- * Use this routine to get the value of the static field @field value.
+ * \param vt vtable to the object
+ * \param field \c MonoClassField describing the field to fetch information from
+ * \param value where the value is returned
+ * \param error set on error
+ * Use this routine to get the value of the static field \p field value.
*
* The pointer provided by value must be of the field type, for reference
- * types this is a MonoObject*, for value types its the actual pointer to
+ * types this is a \c MonoObject*, for value types its the actual pointer to
* the value type.
*
* For example:
* mono_field_static_get_value_checked (vt, int_field, &i, error);
* if (!is_ok (error)) { ... }
*
- * On failure sets @error.
+ * On failure sets \p error.
*/
void
mono_field_static_get_value_checked (MonoVTable *vt, MonoClassField *field, void *value, MonoError *error)
/**
* mono_property_set_value:
- * @prop: MonoProperty to set
- * @obj: instance object on which to act
- * @params: parameters to pass to the propery
- * @exc: optional exception
- *
+ * \param prop MonoProperty to set
+ * \param obj instance object on which to act
+ * \param params parameters to pass to the propery
+ * \param exc optional exception
* Invokes the property's set method with the given arguments on the
* object instance obj (or NULL for static properties).
*
* You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
+ * catch exceptions, otherwise, \c *exc will be set to the exception
* thrown, if any. if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*/
void
mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc)
/**
* mono_property_set_value_checked:
- * @prop: MonoProperty to set
- * @obj: instance object on which to act
- * @params: parameters to pass to the propery
- * @error: set on error
- *
+ * \param prop \c MonoProperty to set
+ * \param obj instance object on which to act
+ * \param params parameters to pass to the propery
+ * \param error set on error
* Invokes the property's set method with the given arguments on the
- * object instance obj (or NULL for static properties).
- *
- * Returns: TRUE on success. On failure returns FALSE and sets @error.
- * If an exception is thrown, it will be caught and returned via @error.
+ * object instance \p obj (or NULL for static properties).
+ * \returns TRUE on success. On failure returns FALSE and sets \p error.
+ * If an exception is thrown, it will be caught and returned via \p error.
*/
gboolean
mono_property_set_value_checked (MonoProperty *prop, void *obj, void **params, MonoError *error)
/**
* mono_property_get_value:
- * @prop: MonoProperty to fetch
- * @obj: instance object on which to act
- * @params: parameters to pass to the propery
- * @exc: optional exception
- *
- * Invokes the property's get method with the given arguments on the
- * object instance obj (or NULL for static properties).
+ * \param prop \c MonoProperty to fetch
+ * \param obj instance object on which to act
+ * \param params parameters to pass to the propery
+ * \param exc optional exception
+ * Invokes the property's \c get method with the given arguments on the
+ * object instance \p obj (or NULL for static properties).
*
- * You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
+ * You can pass NULL as the \p exc argument if you don't want to
+ * catch exceptions, otherwise, \c *exc will be set to the exception
* thrown, if any. if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*
- * Returns: the value from invoking the get method on the property.
+ * \returns the value from invoking the \c get method on the property.
*/
MonoObject*
mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc)
/**
* mono_property_get_value_checked:
- * @prop: MonoProperty to fetch
- * @obj: instance object on which to act
- * @params: parameters to pass to the propery
- * @error: set on error
- *
- * Invokes the property's get method with the given arguments on the
+ * \param prop \c MonoProperty to fetch
+ * \param obj instance object on which to act
+ * \param params parameters to pass to the propery
+ * \param error set on error
+ * Invokes the property's \c get method with the given arguments on the
* object instance obj (or NULL for static properties).
*
* If an exception is thrown, you can't use the
- * MonoObject* result from the function. The exception will be propagated via @error.
+ * \c MonoObject* result from the function. The exception will be propagated via \p error.
*
- * Returns: the value from invoking the get method on the property. On
- * failure returns NULL and sets @error.
+ * \returns the value from invoking the get method on the property. On
+ * failure returns NULL and sets \p error.
*/
MonoObject*
mono_property_get_value_checked (MonoProperty *prop, void *obj, void **params, MonoError *error)
/**
* mono_nullable_box:
- * @buf: The buffer representing the data to be boxed
- * @klass: the type to box it as.
- * @error: set on oerr
+ * \param buf The buffer representing the data to be boxed
+ * \param klass the type to box it as.
+ * \param error set on error
*
- * Creates a boxed vtype or NULL from the Nullable structure pointed to by
- * @buf. On failure returns NULL and sets @error
+ * Creates a boxed vtype or NULL from the \c Nullable structure pointed to by
+ * \p buf. On failure returns NULL and sets \p error.
*/
MonoObject*
mono_nullable_box (guint8 *buf, MonoClass *klass, MonoError *error)
/**
* mono_get_delegate_invoke:
- * @klass: The delegate class
- *
- * Returns: the MonoMethod for the "Invoke" method in the delegate klass or NULL if @klass is a broken delegate type
+ * \param klass The delegate class
+ * \returns the \c MonoMethod for the \c Invoke method in the delegate class or NULL if \p klass is a broken delegate type
*/
MonoMethod *
mono_get_delegate_invoke (MonoClass *klass)
/**
* mono_get_delegate_begin_invoke:
- * @klass: The delegate class
- *
- * Returns: the MonoMethod for the "BeginInvoke" method in the delegate klass or NULL if @klass is a broken delegate type
+ * \param klass The delegate class
+ * \returns the \c MonoMethod for the \c BeginInvoke method in the delegate class or NULL if \p klass is a broken delegate type
*/
MonoMethod *
mono_get_delegate_begin_invoke (MonoClass *klass)
/**
* mono_get_delegate_end_invoke:
- * @klass: The delegate class
- *
- * Returns: the MonoMethod for the "EndInvoke" method in the delegate klass or NULL if @klass is a broken delegate type
+ * \param klass The delegate class
+ * \returns the \c MonoMethod for the \c EndInvoke method in the delegate class or NULL if \p klass is a broken delegate type
*/
MonoMethod *
mono_get_delegate_end_invoke (MonoClass *klass)
/**
* mono_runtime_delegate_invoke:
- * @delegate: pointer to a delegate object.
- * @params: parameters for the delegate.
- * @exc: Pointer to the exception result.
+ * \param delegate pointer to a delegate object.
+ * \param params parameters for the delegate.
+ * \param exc Pointer to the exception result.
*
- * Invokes the delegate method @delegate with the parameters provided.
+ * Invokes the delegate method \p delegate with the parameters provided.
*
- * You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
+ * You can pass NULL as the \p exc argument if you don't want to
+ * catch exceptions, otherwise, \c *exc will be set to the exception
* thrown, if any. if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*/
MonoObject*
mono_runtime_delegate_invoke (MonoObject *delegate, void **params, MonoObject **exc)
/**
* mono_runtime_delegate_try_invoke:
- * @delegate: pointer to a delegate object.
- * @params: parameters for the delegate.
- * @exc: Pointer to the exception result.
- * @error: set on error
- *
- * Invokes the delegate method @delegate with the parameters provided.
- *
- * You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
- * thrown, if any. On failure to execute, @error will be set.
+ * \param delegate pointer to a delegate object.
+ * \param params parameters for the delegate.
+ * \param exc Pointer to the exception result.
+ * \param error set on error
+ * Invokes the delegate method \p delegate with the parameters provided.
+ *
+ * You can pass NULL as the \p exc argument if you don't want to
+ * catch exceptions, otherwise, \c *exc will be set to the exception
+ * thrown, if any. On failure to execute, \p error will be set.
* if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*/
MonoObject*
mono_runtime_delegate_try_invoke (MonoObject *delegate, void **params, MonoObject **exc, MonoError *error)
/**
* mono_runtime_delegate_invoke_checked:
- * @delegate: pointer to a delegate object.
- * @params: parameters for the delegate.
- * @error: set on error
- *
- * Invokes the delegate method @delegate with the parameters provided.
- *
- * On failure @error will be set and you can't use the MonoObject*
+ * \param delegate pointer to a delegate object.
+ * \param params parameters for the delegate.
+ * \param error set on error
+ * Invokes the delegate method \p delegate with the parameters provided.
+ * On failure \p error will be set and you can't use the \c MonoObject*
* result from the function.
*/
MonoObject*
/**
* mono_runtime_get_main_args:
- *
- * Returns: a MonoArray with the arguments passed to the main program
+ * \returns A \c MonoArray with the arguments passed to the main program
*/
MonoArray*
mono_runtime_get_main_args (void)
}
/**
- * mono_runtime_get_main_args:
- * @error: set on error
- *
- * Returns: a MonoArray with the arguments passed to the main
- * program. On failure returns NULL and sets @error.
+ * mono_runtime_get_main_args_checked:
+ * \param error set on error
+ * \returns a \c MonoArray with the arguments passed to the main
+ * program. On failure returns NULL and sets \p error.
*/
MonoArray*
mono_runtime_get_main_args_checked (MonoError *error)
/**
* mono_runtime_set_main_args:
- * @argc: number of arguments from the command line
- * @argv: array of strings from the command line
- *
+ * \param argc number of arguments from the command line
+ * \param argv array of strings from the command line
* Set the command line arguments from an embedding application that doesn't otherwise call
- * mono_runtime_run_main ().
+ * \c mono_runtime_run_main.
*/
int
mono_runtime_set_main_args (int argc, char* argv[])
/**
* mono_runtime_run_main:
- * @method: the method to start the application with (usually Main)
- * @argc: number of arguments from the command line
- * @argv: array of strings from the command line
- * @exc: excetption results
- *
- * Execute a standard Main() method (argc/argv contains the
+ * \param method the method to start the application with (usually <code>Main</code>)
+ * \param argc number of arguments from the command line
+ * \param argv array of strings from the command line
+ * \param exc excetption results
+ * Execute a standard \c Main method (\p argc / \p argv contains the
* executable name). This method also sets the command line argument value
- * needed by System.Environment.
- *
- *
+ * needed by \c System.Environment.
*/
int
mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
/**
* mono_runtime_run_main_checked:
- * @method: the method to start the application with (usually Main)
- * @argc: number of arguments from the command line
- * @argv: array of strings from the command line
- * @error: set on error
+ * \param method the method to start the application with (usually \c Main)
+ * \param argc number of arguments from the command line
+ * \param argv array of strings from the command line
+ * \param error set on error
*
- * Execute a standard Main() method (argc/argv contains the
+ * Execute a standard \c Main method (\p argc / \p argv contains the
* executable name). This method also sets the command line argument value
- * needed by System.Environment. On failure sets @error.
- *
- *
+ * needed by \c System.Environment. On failure sets \p error.
*/
int
mono_runtime_run_main_checked (MonoMethod *method, int argc, char* argv[],
/**
* mono_runtime_try_run_main:
- * @method: the method to start the application with (usually Main)
- * @argc: number of arguments from the command line
- * @argv: array of strings from the command line
- * @exc: set if Main throws an exception
- * @error: set if Main can't be executed
- *
- * Execute a standard Main() method (argc/argv contains the executable
+ * \param method the method to start the application with (usually \c Main)
+ * \param argc number of arguments from the command line
+ * \param argv array of strings from the command line
+ * \param exc set if \c Main throws an exception
+ * \param error set if \c Main can't be executed
+ * Execute a standard \c Main method (\p argc / \p argv contains the executable
* name). This method also sets the command line argument value needed
- * by System.Environment. On failure sets @error if Main can't be
- * executed or @exc if it threw and exception.
- *
- *
+ * by \c System.Environment. On failure sets \p error if Main can't be
+ * executed or \p exc if it threw an exception.
*/
int
mono_runtime_try_run_main (MonoMethod *method, int argc, char* argv[],
/**
* mono_object_xdomain_representation
- * @obj: an object
- * @target_domain: a domain
- * @error: set on error.
- *
- * Creates a representation of obj in the domain target_domain. This
- * is either a copy of obj arrived through via serialization and
+ * \param obj an object
+ * \param target_domain a domain
+ * \param error set on error.
+ * Creates a representation of obj in the domain \p target_domain. This
+ * is either a copy of \p obj arrived through via serialization and
* deserialization or a proxy, depending on whether the object is
- * serializable or marshal by ref. obj must not be in target_domain.
- *
- * If the object cannot be represented in target_domain, NULL is
- * returned and @error is set appropriately.
+ * serializable or marshal by ref. \p obj must not be in \p target_domain.
+ * If the object cannot be represented in \p target_domain, NULL is
+ * returned and \p error is set appropriately.
*/
MonoObject*
mono_object_xdomain_representation (MonoObject *obj, MonoDomain *target_domain, MonoError *error)
/**
* mono_runtime_unhandled_exception_policy_set:
- * @policy: the new policy
- *
+ * \param policy the new policy
* This is a VM internal routine.
- *
* Sets the runtime policy for handling unhandled exceptions.
*/
void
/**
* mono_unhandled_exception:
- * @exc: exception thrown
- *
+ * \param exc exception thrown
* This is a VM internal routine.
*
* We call this function when we detect an unhandled exception
* in the default domain.
*
- * It invokes the * UnhandledException event in AppDomain or prints
+ * It invokes the \c UnhandledException event in \c AppDomain or prints
* a warning to the console
*/
void
/**
* mono_runtime_exec_managed_code:
- * @domain: Application domain
- * @main_func: function to invoke from the execution thread
- * @main_args: parameter to the main_func
- *
+ * \param domain Application domain
+ * \param main_func function to invoke from the execution thread
+ * \param main_args parameter to the main_func
* Launch a new thread to execute a function
*
- * main_func is called back from the thread with main_args as the
- * parameter. The callback function is expected to start Main()
+ * \p main_func is called back from the thread with main_args as the
+ * parameter. The callback function is expected to start \c Main
* eventually. This function then waits for all managed threads to
* finish.
- * It is not necesseray anymore to execute managed code in a subthread,
+ * It is not necessary anymore to execute managed code in a subthread,
* so this function should not be used anymore by default: just
- * execute the code and then call mono_thread_manage ().
+ * execute the code and then call mono_thread_manage().
*/
void
mono_runtime_exec_managed_code (MonoDomain *domain,
*has_byref_nullables = TRUE;
} else {
/* MS seems to create the objects if a null is passed in */
+ gboolean was_null = FALSE;
if (!mono_array_get (params, MonoObject*, i)) {
MonoObject *o = mono_object_new_checked (mono_domain_get (), mono_class_from_mono_type (t_orig), error);
return_val_if_nok (error, NULL);
mono_array_setref (params, i, o);
+ was_null = TRUE;
}
if (t->byref) {
}
result = mono_object_unbox (mono_array_get (params, MonoObject*, i));
+ if (!t->byref && was_null)
+ mono_array_setref (params, i, NULL);
}
break;
case MONO_TYPE_STRING:
}
/**
* mono_runtime_invoke_array:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @exc: exception information.
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param exc exception information.
+ * Invokes the method represented by \p method on the object \p obj.
+ *
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
- * The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
- * pointers to the value type otherwise. The _invoke_array
- * variant takes a C# object[] as the params argument (MonoArray
- * *params): in this case the value types are boxed inside the
+ * The \p params array contains the arguments to the method with the
+ * same convention: \c MonoObject* pointers for object instances and
+ * pointers to the value type otherwise. The \c _invoke_array
+ * variant takes a C# \c object[] as the params argument (\c MonoArray*):
+ * in this case the value types are boxed inside the
* respective reference representation.
*
* From unmanaged code you'll usually use the
* of a virtual method (there are examples of this in the code,
* though).
*
- * You can pass NULL as the exc argument if you don't want to
- * catch exceptions, otherwise, *exc will be set to the exception
+ * You can pass NULL as the \p exc argument if you don't want to
+ * catch exceptions, otherwise, \c *exc will be set to the exception
* thrown, if any. if an exception is thrown, you can't use the
- * MonoObject* result from the function.
+ * \c MonoObject* result from the function.
*
* If the method returns a value type, it is boxed in an object
* reference.
/**
* mono_runtime_invoke_array_checked:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @error: set on failure.
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param error set on failure.
+ * Invokes the method represented by \p method on the object \p obj.
+ *
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
- * The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
- * pointers to the value type otherwise. The _invoke_array
- * variant takes a C# object[] as the params argument (MonoArray
- * *params): in this case the value types are boxed inside the
+ * The \p params array contains the arguments to the method with the
+ * same convention: \c MonoObject* pointers for object instances and
+ * pointers to the value type otherwise. The \c _invoke_array
+ * variant takes a C# \c object[] as the \p params argument (\c MonoArray*):
+ * in this case the value types are boxed inside the
* respective reference representation.
*
* From unmanaged code you'll usually use the
* of a virtual method (there are examples of this in the code,
* though).
*
- * On failure or exception, @error will be set. In that case, you
- * can't use the MonoObject* result from the function.
+ * On failure or exception, \p error will be set. In that case, you
+ * can't use the \c MonoObject* result from the function.
*
* If the method returns a value type, it is boxed in an object
* reference.
/**
* mono_runtime_try_invoke_array:
- * @method: method to invoke
- * @obJ: object instance
- * @params: arguments to the method
- * @exc: exception information.
- * @error: set on failure.
- *
- * Invokes the method represented by @method on the object @obj.
- *
- * obj is the 'this' pointer, it should be NULL for static
- * methods, a MonoObject* for object instances and a pointer to
+ * \param method method to invoke
+ * \param obj object instance
+ * \param params arguments to the method
+ * \param exc exception information.
+ * \param error set on failure.
+ * Invokes the method represented by \p method on the object \p obj.
+ *
+ * \p obj is the \c this pointer, it should be NULL for static
+ * methods, a \c MonoObject* for object instances and a pointer to
* the value type for value types.
*
- * The params array contains the arguments to the method with the
- * same convention: MonoObject* pointers for object instances and
- * pointers to the value type otherwise. The _invoke_array
- * variant takes a C# object[] as the params argument (MonoArray
- * *params): in this case the value types are boxed inside the
+ * The \p params array contains the arguments to the method with the
+ * same convention: \c MonoObject* pointers for object instances and
+ * pointers to the value type otherwise. The \c _invoke_array
+ * variant takes a C# \c object[] as the params argument (\c MonoArray*):
+ * in this case the value types are boxed inside the
* respective reference representation.
*
* From unmanaged code you'll usually use the
* of a virtual method (there are examples of this in the code,
* though).
*
- * You can pass NULL as the exc argument if you don't want to catch
- * exceptions, otherwise, *exc will be set to the exception thrown, if
- * any. On other failures, @error will be set. If an exception is
- * thrown or there's an error, you can't use the MonoObject* result
+ * You can pass NULL as the \p exc argument if you don't want to catch
+ * exceptions, otherwise, \c *exc will be set to the exception thrown, if
+ * any. On other failures, \p error will be set. If an exception is
+ * thrown or there's an error, you can't use the \c MonoObject* result
* from the function.
*
* If the method returns a value type, it is boxed in an object
/**
* mono_object_new:
- * @klass: the class of the object that we want to create
- *
- * Returns: a newly created object whose definition is
- * looked up using @klass. This will not invoke any constructors,
+ * \param klass the class of the object that we want to create
+ * \returns a newly created object whose definition is
+ * looked up using \p klass. This will not invoke any constructors,
* so the consumer of this routine has to invoke any constructors on
* its own to initialize the object.
*
/**
* mono_object_new_checked:
- * @klass: the class of the object that we want to create
- * @error: set on error
- *
- * Returns: a newly created object whose definition is
- * looked up using @klass. This will not invoke any constructors,
+ * \param klass the class of the object that we want to create
+ * \param error set on error
+ * \returns a newly created object whose definition is
+ * looked up using \p klass. This will not invoke any constructors,
* so the consumer of this routine has to invoke any constructors on
* its own to initialize the object.
*
- * It returns NULL on failure and sets @error.
+ * It returns NULL on failure and sets \p error.
*/
MonoObject *
mono_object_new_checked (MonoDomain *domain, MonoClass *klass, MonoError *error)
/**
* mono_object_new_specific:
- * @vtable: the vtable of the object that we want to create
- *
- * Returns: A newly created object with class and domain specified
- * by @vtable
+ * \param vtable the vtable of the object that we want to create
+ * \returns A newly created object with class and domain specified
+ * by \p vtable
*/
MonoObject *
mono_object_new_specific (MonoVTable *vtable)
/**
* mono_object_new_alloc_specific:
- * @vtable: virtual table for the object.
- *
- * This function allocates a new `MonoObject` with the type derived
- * from the @vtable information. If the class of this object has a
+ * \param vtable virtual table for the object.
+ * This function allocates a new \c MonoObject with the type derived
+ * from the \p vtable information. If the class of this object has a
* finalizer, then the object will be tracked for finalization.
*
* This method might raise an exception on errors. Use the
- * `mono_object_new_fast_checked` method if you want to manually raise
+ * \c mono_object_new_fast_checked method if you want to manually raise
* the exception.
*
- * Returns: the allocated object.
+ * \returns the allocated object.
*/
MonoObject *
mono_object_new_alloc_specific (MonoVTable *vtable)
/**
* mono_object_new_alloc_specific_checked:
- * @vtable: virtual table for the object.
- * @error: holds the error return value.
+ * \param vtable virtual table for the object.
+ * \param error holds the error return value.
*
- * This function allocates a new `MonoObject` with the type derived
- * from the @vtable information. If the class of this object has a
+ * This function allocates a new \c MonoObject with the type derived
+ * from the \p vtable information. If the class of this object has a
* finalizer, then the object will be tracked for finalization.
*
- * If there is not enough memory, the @error parameter will be set
+ * If there is not enough memory, the \p error parameter will be set
* and will contain a user-visible message with the amount of bytes
* that were requested.
*
- * Returns: the allocated object, or NULL if there is not enough memory
- *
+ * \returns the allocated object, or NULL if there is not enough memory
*/
MonoObject *
mono_object_new_alloc_specific_checked (MonoVTable *vtable, MonoError *error)
/**
* mono_object_new_fast:
- * @vtable: virtual table for the object.
+ * \param vtable virtual table for the object.
*
- * This function allocates a new `MonoObject` with the type derived
- * from the @vtable information. The returned object is not tracked
+ * This function allocates a new \c MonoObject with the type derived
+ * from the \p vtable information. The returned object is not tracked
* for finalization. If your object implements a finalizer, you should
- * use `mono_object_new_alloc_specific` instead.
+ * use \c mono_object_new_alloc_specific instead.
*
* This method might raise an exception on errors. Use the
- * `mono_object_new_fast_checked` method if you want to manually raise
+ * \c mono_object_new_fast_checked method if you want to manually raise
* the exception.
*
- * Returns: the allocated object.
+ * \returns the allocated object.
*/
MonoObject*
mono_object_new_fast (MonoVTable *vtable)
/**
* mono_object_new_fast_checked:
- * @vtable: virtual table for the object.
- * @error: holds the error return value.
+ * \param vtable virtual table for the object.
+ * \param error holds the error return value.
*
- * This function allocates a new `MonoObject` with the type derived
- * from the @vtable information. The returned object is not tracked
+ * This function allocates a new \c MonoObject with the type derived
+ * from the \p vtable information. The returned object is not tracked
* for finalization. If your object implements a finalizer, you should
- * use `mono_object_new_alloc_specific_checked` instead.
+ * use \c mono_object_new_alloc_specific_checked instead.
*
- * If there is not enough memory, the @error parameter will be set
+ * If there is not enough memory, the \p error parameter will be set
* and will contain a user-visible message with the amount of bytes
* that were requested.
*
- * Returns: the allocated object, or NULL if there is not enough memory
- *
+ * \returns the allocated object, or NULL if there is not enough memory
*/
MonoObject*
mono_object_new_fast_checked (MonoVTable *vtable, MonoError *error)
/**
* mono_class_get_allocation_ftn:
- * @vtable: vtable
- * @for_box: the object will be used for boxing
- * @pass_size_in_words:
- *
- * Return the allocation function appropriate for the given class.
+ * \param vtable vtable
+ * \param for_box the object will be used for boxing
+ * \param pass_size_in_words Unused
+ * \returns the allocation function appropriate for the given class.
*/
-
void*
mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *pass_size_in_words)
{
/**
* mono_object_new_from_token:
- * @image: Context where the type_token is hosted
- * @token: a token of the type that we want to create
- *
- * Returns: A newly created object whose definition is
- * looked up using @token in the @image image
+ * \param image Context where the type_token is hosted
+ * \param token a token of the type that we want to create
+ * \returns A newly created object whose definition is
+ * looked up using \p token in the \p image image
*/
MonoObject *
mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token)
/**
* mono_object_clone:
- * @obj: the object to clone
- *
- * Returns: A newly created object who is a shallow copy of @obj
+ * \param obj the object to clone
+ * \returns A newly created object who is a shallow copy of \p obj
*/
MonoObject *
mono_object_clone (MonoObject *obj)
/**
* mono_array_full_copy:
- * @src: source array to copy
- * @dest: destination array
- *
+ * \param src source array to copy
+ * \param dest destination array
* Copies the content of one array to another with exactly the same type and size.
*/
void
/**
* mono_array_clone_in_domain:
- * @domain: the domain in which the array will be cloned into
- * @array: the array to clone
- * @error: set on error
- *
+ * \param domain the domain in which the array will be cloned into
+ * \param array the array to clone
+ * \param error set on error
* This routine returns a copy of the array that is hosted on the
- * specified MonoDomain. On failure returns NULL and sets @error.
+ * specified \c MonoDomain. On failure returns NULL and sets \p error.
*/
MonoArrayHandle
mono_array_clone_in_domain (MonoDomain *domain, MonoArrayHandle array_handle, MonoError *error)
/**
* mono_array_clone:
- * @array: the array to clone
- *
- * Returns: A newly created array who is a shallow copy of @array
+ * \param array the array to clone
+ * \returns A newly created array who is a shallow copy of \p array
*/
MonoArray*
mono_array_clone (MonoArray *array)
/**
* mono_array_clone_checked:
- * @array: the array to clone
- * @error: set on error
- *
- * Returns: A newly created array who is a shallow copy of @array. On
- * failure returns NULL and sets @error.
+ * \param array the array to clone
+ * \param error set on error
+ * \returns A newly created array who is a shallow copy of \p array. On
+ * failure returns NULL and sets \p error.
*/
MonoArray*
mono_array_clone_checked (MonoArray *array_raw, MonoError *error)
/**
* mono_array_new_full:
- * @domain: domain where the object is created
- * @array_class: array class
- * @lengths: lengths for each dimension in the array
- * @lower_bounds: lower bounds for each dimension in the array (may be NULL)
- *
- * This routine creates a new array objects with the given dimensions,
+ * \param domain domain where the object is created
+ * \param array_class array class
+ * \param lengths lengths for each dimension in the array
+ * \param lower_bounds lower bounds for each dimension in the array (may be NULL)
+ * This routine creates a new array object with the given dimensions,
* lower bounds and type.
*/
MonoArray*
/**
* mono_array_new:
- * @domain: domain where the object is created
- * @eclass: element class
- * @n: number of array elements
- *
- * This routine creates a new szarray with @n elements of type @eclass.
+ * \param domain domain where the object is created
+ * \param eclass element class
+ * \param n number of array elements
+ * This routine creates a new szarray with \p n elements of type \p eclass.
*/
MonoArray *
mono_array_new (MonoDomain *domain, MonoClass *eclass, uintptr_t n)
/**
* mono_array_new_checked:
- * @domain: domain where the object is created
- * @eclass: element class
- * @n: number of array elements
- * @error: set on error
- *
- * This routine creates a new szarray with @n elements of type @eclass.
- * On failure returns NULL and sets @error.
+ * \param domain domain where the object is created
+ * \param eclass element class
+ * \param n number of array elements
+ * \param error set on error
+ * This routine creates a new szarray with \p n elements of type \p eclass.
+ * On failure returns NULL and sets \p error.
*/
MonoArray *
mono_array_new_checked (MonoDomain *domain, MonoClass *eclass, uintptr_t n, MonoError *error)
/**
* mono_array_new_specific:
- * @vtable: a vtable in the appropriate domain for an initialized class
- * @n: number of array elements
- *
- * This routine is a fast alternative to mono_array_new() for code which
+ * \param vtable a vtable in the appropriate domain for an initialized class
+ * \param n number of array elements
+ * This routine is a fast alternative to \c mono_array_new for code which
* can be sure about the domain it operates in.
*/
MonoArray *
/**
* mono_string_new_utf16:
- * @text: a pointer to an utf16 string
- * @len: the length of the string
- *
- * Returns: A newly created string object which contains @text.
+ * \param text a pointer to an utf16 string
+ * \param len the length of the string
+ * \returns A newly created string object which contains \p text.
*/
MonoString *
mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len)
/**
* mono_string_new_utf16_checked:
- * @text: a pointer to an utf16 string
- * @len: the length of the string
- * @error: written on error.
- *
- * Returns: A newly created string object which contains @text.
- * On error, returns NULL and sets @error.
+ * \param text a pointer to an utf16 string
+ * \param len the length of the string
+ * \param error written on error.
+ * \returns A newly created string object which contains \p text.
+ * On error, returns NULL and sets \p error.
*/
MonoString *
mono_string_new_utf16_checked (MonoDomain *domain, const guint16 *text, gint32 len, MonoError *error)
/**
* mono_string_new_utf16_handle:
- * @text: a pointer to an utf16 string
- * @len: the length of the string
- * @error: written on error.
- *
- * Returns: A newly created string object which contains @text.
- * On error, returns NULL and sets @error.
+ * \param text a pointer to an utf16 string
+ * \param len the length of the string
+ * \param error written on error.
+ * \returns A newly created string object which contains \p text.
+ * On error, returns NULL and sets \p error.
*/
MonoStringHandle
mono_string_new_utf16_handle (MonoDomain *domain, const guint16 *text, gint32 len, MonoError *error)
}
/**
- * mono_string_new_utf32:
- * @text: a pointer to an utf32 string
- * @len: the length of the string
- * @error: set on failure.
- *
- * Returns: A newly created string object which contains @text. On failure returns NULL and sets @error.
+ * mono_string_new_utf32_checked:
+ * \param text a pointer to an utf32 string
+ * \param len the length of the string
+ * \param error set on failure.
+ * \returns A newly created string object which contains \p text. On failure returns NULL and sets \p error.
*/
static MonoString *
mono_string_new_utf32_checked (MonoDomain *domain, const mono_unichar4 *text, gint32 len, MonoError *error)
/**
* mono_string_new_utf32:
- * @text: a pointer to an utf32 string
- * @len: the length of the string
- *
- * Returns: A newly created string object which contains @text.
+ * \param text a pointer to a UTF-32 string
+ * \param len the length of the string
+ * \returns A newly created string object which contains \p text.
*/
MonoString *
mono_string_new_utf32 (MonoDomain *domain, const mono_unichar4 *text, gint32 len)
/**
* mono_string_new_size:
- * @text: a pointer to an utf16 string
- * @len: the length of the string
- *
- * Returns: A newly created string object of @len
+ * \param text a pointer to a UTF-16 string
+ * \param len the length of the string
+ * \returns A newly created string object of \p len
*/
MonoString *
mono_string_new_size (MonoDomain *domain, gint32 len)
/**
* mono_string_new_len:
- * @text: a pointer to an utf8 string
- * @length: number of bytes in @text to consider
- *
- * Returns: A newly created string object which contains @text.
+ * \param text a pointer to an utf8 string
+ * \param length number of bytes in \p text to consider
+ * \returns A newly created string object which contains \p text.
*/
MonoString*
mono_string_new_len (MonoDomain *domain, const char *text, guint length)
/**
* mono_string_new_len_checked:
- * @text: a pointer to an utf8 string
- * @length: number of bytes in @text to consider
- * @error: set on error
- *
- * Returns: A newly created string object which contains @text. On
- * failure returns NULL and sets @error.
+ * \param text a pointer to an utf8 string
+ * \param length number of bytes in \p text to consider
+ * \param error set on error
+ * \returns A newly created string object which contains \p text. On
+ * failure returns NULL and sets \p error.
*/
MonoString*
mono_string_new_len_checked (MonoDomain *domain, const char *text, guint length, MonoError *error)
/**
* mono_string_new:
- * @text: a pointer to an utf8 string
- *
- * Returns: A newly created string object which contains @text.
- *
+ * \param text a pointer to a UTF-8 string
+ * \deprecated Use \c mono_string_new_checked in new code.
* This function asserts if it cannot allocate a new string.
- *
- * @deprecated Use mono_string_new_checked in new code.
+ * \returns A newly created string object which contains \p text.
*/
MonoString*
mono_string_new (MonoDomain *domain, const char *text)
/**
* mono_string_new_checked:
- * @text: a pointer to an utf8 string
- * @merror: set on error
- *
- * Returns: A newly created string object which contains @text.
- * On error returns NULL and sets @merror.
+ * \param text a pointer to an utf8 string
+ * \param merror set on error
+ * \returns A newly created string object which contains \p text.
+ * On error returns NULL and sets \p merror.
*/
MonoString*
mono_string_new_checked (MonoDomain *domain, const char *text, MonoError *error)
/**
* mono_string_new_wrapper:
- * @text: pointer to utf8 characters.
- *
- * Helper function to create a string object from @text in the current domain.
+ * \param text pointer to UTF-8 characters.
+ * Helper function to create a string object from \p text in the current domain.
*/
MonoString*
mono_string_new_wrapper (const char *text)
/**
* mono_value_box:
- * @class: the class of the value
- * @value: a pointer to the unboxed data
- *
- * Returns: A newly created object which contains @value.
+ * \param class the class of the value
+ * \param value a pointer to the unboxed data
+ * \returns A newly created object which contains \p value.
*/
MonoObject *
mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer value)
/**
* mono_value_box_checked:
- * @domain: the domain of the new object
- * @class: the class of the value
- * @value: a pointer to the unboxed data
- * @error: set on error
- *
- * Returns: A newly created object which contains @value. On failure
- * returns NULL and sets @error.
+ * \param domain the domain of the new object
+ * \param class the class of the value
+ * \param value a pointer to the unboxed data
+ * \param error set on error
+ * \returns A newly created object which contains \p value. On failure
+ * returns NULL and sets \p error.
*/
MonoObject *
mono_value_box_checked (MonoDomain *domain, MonoClass *klass, gpointer value, MonoError *error)
/**
* mono_value_copy:
- * @dest: destination pointer
- * @src: source pointer
- * @klass: a valuetype class
- *
- * Copy a valuetype from @src to @dest. This function must be used
- * when @klass contains references fields.
+ * \param dest destination pointer
+ * \param src source pointer
+ * \param klass a valuetype class
+ * Copy a valuetype from \p src to \p dest. This function must be used
+ * when \p klass contains reference fields.
*/
void
mono_value_copy (gpointer dest, gpointer src, MonoClass *klass)
/**
* mono_value_copy_array:
- * @dest: destination array
- * @dest_idx: index in the @dest array
- * @src: source pointer
- * @count: number of items
- *
- * Copy @count valuetype items from @src to the array @dest at index @dest_idx.
- * This function must be used when @klass contains references fields.
+ * \param dest destination array
+ * \param dest_idx index in the \p dest array
+ * \param src source pointer
+ * \param count number of items
+ * Copy \p count valuetype items from \p src to the array \p dest at index \p dest_idx.
+ * This function must be used when \p klass contains references fields.
* Overlap is handled.
*/
void
/**
* mono_object_get_domain:
- * @obj: object to query
- *
- * Returns: the MonoDomain where the object is hosted
+ * \param obj object to query
+ * \returns the \c MonoDomain where the object is hosted
*/
MonoDomain*
mono_object_get_domain (MonoObject *obj)
/**
* mono_object_get_class:
- * @obj: object to query
- *
- * Use this function to obtain the `MonoClass*` for a given `MonoObject`.
- *
- * Returns: the MonoClass of the object.
+ * \param obj object to query
+ * Use this function to obtain the \c MonoClass* for a given \c MonoObject.
+ * \returns the \c MonoClass of the object.
*/
MonoClass*
mono_object_get_class (MonoObject *obj)
}
/**
* mono_object_get_size:
- * @o: object to query
- *
- * Returns: the size, in bytes, of @o
+ * \param o object to query
+ * \returns the size, in bytes, of \p o
*/
guint
mono_object_get_size (MonoObject* o)
/**
* mono_object_unbox:
- * @obj: object to unbox
- *
- * Returns: a pointer to the start of the valuetype boxed in this
+ * \param obj object to unbox
+ * \returns a pointer to the start of the valuetype boxed in this
* object.
*
* This method will assert if the object passed is not a valuetype.
/**
* mono_object_isinst:
- * @obj: an object
- * @klass: a pointer to a class
- *
- * Returns: @obj if @obj is derived from @klass or NULL otherwise.
+ * \param obj an object
+ * \param klass a pointer to a class
+ * \returns \p obj if \p obj is derived from \p klass or NULL otherwise.
*/
MonoObject *
mono_object_isinst (MonoObject *obj_raw, MonoClass *klass)
/**
* mono_object_isinst_checked:
- * @obj: an object
- * @klass: a pointer to a class
- * @error: set on error
- *
- * Returns: @obj if @obj is derived from @klass or NULL if it isn't.
- * On failure returns NULL and sets @error.
+ * \param obj an object
+ * \param klass a pointer to a class
+ * \param error set on error
+ * \returns \p obj if \p obj is derived from \p klass or NULL if it isn't.
+ * On failure returns NULL and sets \p error.
*/
MonoObject *
mono_object_isinst_checked (MonoObject *obj_raw, MonoClass *klass, MonoError *error)
/**
* mono_object_handle_isinst:
- * @obj: an object
- * @klass: a pointer to a class
- * @error: set on error
- *
- * Returns: @obj if @obj is derived from @klass or NULL if it isn't.
- * On failure returns NULL and sets @error.
+ * \param obj an object
+ * \param klass a pointer to a class
+ * \param error set on error
+ * \returns \p obj if \p obj is derived from \p klass or NULL if it isn't.
+ * On failure returns NULL and sets \p error.
*/
MonoObjectHandle
mono_object_handle_isinst (MonoObjectHandle obj, MonoClass *klass, MonoError *error)
return result;
}
+/**
+ * mono_object_isinst_mbyref:
+ */
MonoObject *
mono_object_isinst_mbyref (MonoObject *obj_raw, MonoClass *klass)
{
pa [0] = MONO_HANDLE_RAW (reftype);
pa [1] = MONO_HANDLE_RAW (obj);
- MonoObject *res = mono_runtime_invoke_checked (im, rp, pa, error);
+ MonoObject *res = mono_runtime_invoke_checked (im, MONO_HANDLE_RAW (rp), pa, error);
if (!is_ok (error))
goto leave;
/**
* mono_object_castclass_mbyref:
- * @obj: an object
- * @klass: a pointer to a class
- *
- * Returns: @obj if @obj is derived from @klass, returns NULL otherwise.
+ * \param obj an object
+ * \param klass a pointer to a class
+ * \returns \p obj if \p obj is derived from \p klass, returns NULL otherwise.
*/
MonoObject *
mono_object_castclass_mbyref (MonoObject *obj_raw, MonoClass *klass)
/**
* mono_string_is_interned:
- * @o: String to probe
- *
- * Returns whether the string has been interned.
+ * \param o String to probe
+ * \returns Whether the string has been interned.
*/
MonoString*
mono_string_is_interned (MonoString *o)
/**
* mono_string_intern:
- * @o: String to intern
- *
+ * \param o String to intern
* Interns the string passed.
- * Returns: The interned string.
+ * \returns The interned string.
*/
MonoString*
mono_string_intern (MonoString *str)
/**
* mono_string_intern_checked:
- * @o: String to intern
- * @error: set on error.
- *
+ * \param o String to intern
+ * \param error set on error.
* Interns the string passed.
- * Returns: The interned string. On failure returns NULL and sets @error
+ * \returns The interned string. On failure returns NULL and sets \p error
*/
MonoString*
mono_string_intern_checked (MonoString *str, MonoError *error)
/**
* mono_ldstr:
- * @domain: the domain where the string will be used.
- * @image: a metadata context
- * @idx: index into the user string table.
- *
- * Implementation for the ldstr opcode.
- * Returns: a loaded string from the @image/@idx combination.
+ * \param domain the domain where the string will be used.
+ * \param image a metadata context
+ * \param idx index into the user string table.
+ * Implementation for the \c ldstr opcode.
+ * \returns a loaded string from the \p image / \p idx combination.
*/
MonoString*
mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx)
/**
* mono_ldstr_checked:
- * @domain: the domain where the string will be used.
- * @image: a metadata context
- * @idx: index into the user string table.
- * @error: set on error.
- *
- * Implementation for the ldstr opcode.
- * Returns: a loaded string from the @image/@idx combination.
- * On failure returns NULL and sets @error.
+ * \param domain the domain where the string will be used.
+ * \param image a metadata context
+ * \param idx index into the user string table.
+ * \param error set on error.
+ * Implementation for the \c ldstr opcode.
+ * \returns A loaded string from the \p image / \p idx combination.
+ * On failure returns NULL and sets \p error.
*/
MonoString*
mono_ldstr_checked (MonoDomain *domain, MonoImage *image, guint32 idx, MonoError *error)
/**
* mono_ldstr_metadata_sig
- * @domain: the domain for the string
- * @sig: the signature of a metadata string
- * @error: set on error
- *
- * Returns: a MonoString for a string stored in the metadata. On
- * failure returns NULL and sets @error.
+ * \param domain the domain for the string
+ * \param sig the signature of a metadata string
+ * \param error set on error
+ * \returns a \c MonoString for a string stored in the metadata. On
+ * failure returns NULL and sets \p error.
*/
static MonoString*
mono_ldstr_metadata_sig (MonoDomain *domain, const char* sig, MonoError *error)
/**
* mono_string_to_utf8:
- * @s: a System.String
- *
- * Returns the UTF8 representation for @s.
- * The resulting buffer needs to be freed with mono_free().
- *
- * @deprecated Use mono_string_to_utf8_checked to avoid having an exception arbritraly raised.
+ * \param s a \c System.String
+ * \deprecated Use \c mono_string_to_utf8_checked to avoid having an exception arbitrarily raised.
+ * \returns the UTF-8 representation for \p s.
+ * The resulting buffer needs to be freed with \c mono_free().
*/
char *
mono_string_to_utf8 (MonoString *s)
/**
* mono_string_to_utf8_checked:
- * @s: a System.String
- * @error: a MonoError.
- *
- * Converts a MonoString to its UTF8 representation. May fail; check
- * @error to determine whether the conversion was successful.
- * The resulting buffer should be freed with mono_free().
+ * \param s a \c System.String
+ * \param error a \c MonoError.
+ * Converts a \c MonoString to its UTF-8 representation. May fail; check
+ * \p error to determine whether the conversion was successful.
+ * The resulting buffer should be freed with \c mono_free().
*/
char *
mono_string_to_utf8_checked (MonoString *s, MonoError *error)
/**
* mono_string_to_utf8_ignore:
- * @s: a MonoString
- *
- * Converts a MonoString to its UTF8 representation. Will ignore
+ * \param s a MonoString
+ * Converts a \c MonoString to its UTF-8 representation. Will ignore
* invalid surrogate pairs.
- * The resulting buffer should be freed with mono_free().
- *
+ * The resulting buffer should be freed with \c mono_free().
*/
char *
mono_string_to_utf8_ignore (MonoString *s)
/**
* mono_string_to_utf8_image_ignore:
- * @s: a System.String
- *
- * Same as mono_string_to_utf8_ignore, but allocate the string from the image mempool.
+ * \param s a \c System.String
+ * Same as \c mono_string_to_utf8_ignore, but allocate the string from the image mempool.
*/
char *
mono_string_to_utf8_image_ignore (MonoImage *image, MonoString *s)
/**
* mono_string_to_utf8_mp_ignore:
- * @s: a System.String
- *
- * Same as mono_string_to_utf8_ignore, but allocate the string from a mempool.
+ * \param s a \c System.String
+ * Same as \c mono_string_to_utf8_ignore, but allocate the string from a mempool.
*/
char *
mono_string_to_utf8_mp_ignore (MonoMemPool *mp, MonoString *s)
/**
* mono_string_to_utf16:
- * @s: a MonoString
- *
- * Return an null-terminated array of the utf-16 chars
- * contained in @s. The result must be freed with g_free().
+ * \param s a \c MonoString
+ * \returns a null-terminated array of the UTF-16 chars
+ * contained in \p s. The result must be freed with \c g_free().
* This is a temporary helper until our string implementation
- * is reworked to always include the null terminating char.
+ * is reworked to always include the null-terminating char.
*/
mono_unichar2*
mono_string_to_utf16 (MonoString *s)
/**
* mono_string_to_utf32:
- * @s: a MonoString
- *
- * Return an null-terminated array of the UTF-32 (UCS-4) chars
- * contained in @s. The result must be freed with g_free().
+ * \param s a \c MonoString
+ * \returns a null-terminated array of the UTF-32 (UCS-4) chars
+ * contained in \p s. The result must be freed with \c g_free().
*/
mono_unichar4*
mono_string_to_utf32 (MonoString *s)
/**
* mono_string_from_utf16:
- * @data: the UTF16 string (LPWSTR) to convert
- *
- * Converts a NULL terminated UTF16 string (LPWSTR) to a MonoString.
- *
- * Returns: a MonoString.
+ * \param data the UTF-16 string (LPWSTR) to convert
+ * Converts a NULL-terminated UTF-16 string (LPWSTR) to a \c MonoString.
+ * \returns a \c MonoString.
*/
MonoString *
mono_string_from_utf16 (gunichar2 *data)
/**
* mono_string_from_utf16_checked:
- * @data: the UTF16 string (LPWSTR) to convert
- * @error: set on error
- *
- * Converts a NULL terminated UTF16 string (LPWSTR) to a MonoString.
- *
- * Returns: a MonoString. On failure sets @error and returns NULL.
+ * \param data the UTF-16 string (LPWSTR) to convert
+ * \param error set on error
+ * Converts a NULL-terminated UTF-16 string (LPWSTR) to a \c MonoString.
+ * \returns a \c MonoString. On failure sets \p error and returns NULL.
*/
MonoString *
mono_string_from_utf16_checked (gunichar2 *data, MonoError *error)
/**
* mono_string_from_utf32:
- * @data: the UTF32 string (LPWSTR) to convert
- *
- * Converts a UTF32 (UCS-4)to a MonoString.
- *
- * Returns: a MonoString.
+ * \param data the UTF-32 string (LPWSTR) to convert
+ * Converts a UTF-32 (UCS-4) string to a \c MonoString.
+ * \returns a \c MonoString.
*/
MonoString *
mono_string_from_utf32 (mono_unichar4 *data)
/**
* mono_string_from_utf32_checked:
- * @data: the UTF32 string (LPWSTR) to convert
- * @error: set on error
- *
- * Converts a UTF32 (UCS-4)to a MonoString.
- *
- * Returns: a MonoString. On failure returns NULL and sets @error.
+ * \param data the UTF-32 string (LPWSTR) to convert
+ * \param error set on error
+ * Converts a UTF-32 (UCS-4) string to a \c MonoString.
+ * \returns a \c MonoString. On failure returns NULL and sets \p error.
*/
MonoString *
mono_string_from_utf32_checked (mono_unichar4 *data, MonoError *error)
/**
* mono_string_to_utf8_image:
- * @s: a System.String
- *
- * Same as mono_string_to_utf8, but allocate the string from the image mempool.
+ * \param s a \c System.String
+ * Same as \c mono_string_to_utf8, but allocate the string from the image mempool.
*/
char *
mono_string_to_utf8_image (MonoImage *image, MonoStringHandle s, MonoError *error)
/**
* mono_string_to_utf8_mp:
- * @s: a System.String
- *
- * Same as mono_string_to_utf8, but allocate the string from a mempool.
+ * \param s a \c System.String
+ * Same as \c mono_string_to_utf8, but allocate the string from a mempool.
*/
char *
mono_string_to_utf8_mp (MonoMemPool *mp, MonoString *s, MonoError *error)
/**
* mono_raise_exception:
- * @ex: exception object
- *
- * Signal the runtime that the exception @ex has been raised in unmanaged code.
+ * \param ex exception object
+ * Signal the runtime that the exception \p ex has been raised in unmanaged code.
*/
void
mono_raise_exception (MonoException *ex)
/**
* mono_wait_handle_new:
- * @domain: Domain where the object will be created
- * @handle: Handle for the wait handle
- * @error: set on error.
- *
- * Returns: A new MonoWaitHandle created in the given domain for the
- * given handle. On failure returns NULL and sets @rror.
+ * \param domain Domain where the object will be created
+ * \param handle Handle for the wait handle
+ * \param error set on error.
+ * \returns A new \c MonoWaitHandle created in the given domain for the
+ * given handle. On failure returns NULL and sets \p error.
*/
MonoWaitHandle *
mono_wait_handle_new (MonoDomain *domain, HANDLE handle, MonoError *error)
}
/**
* mono_async_result_new:
- * @domain:domain where the object will be created.
- * @handle: wait handle.
- * @state: state to pass to AsyncResult
- * @data: C closure data.
- * @error: set on error.
- *
- * Creates a new MonoAsyncResult (AsyncResult C# class) in the given domain.
- * If the handle is not null, the handle is initialized to a MonOWaitHandle.
- * On failure returns NULL and sets @error.
- *
+ * \param domain domain where the object will be created.
+ * \param handle wait handle.
+ * \param state state to pass to AsyncResult
+ * \param data C closure data.
+ * \param error set on error.
+ * Creates a new MonoAsyncResult (\c AsyncResult C# class) in the given domain.
+ * If the handle is not null, the handle is initialized to a \c MonoWaitHandle.
+ * On failure returns NULL and sets \p error.
*/
MonoAsyncResult *
mono_async_result_new (MonoDomain *domain, HANDLE handle, MonoObject *state, gpointer data, MonoObject *object_data, MonoError *error)
#ifndef DISABLE_REMOTING
/**
* mono_remoting_invoke:
- * @real_proxy: pointer to a RealProxy object
- * @msg: The MonoMethodMessage to execute
- * @exc: used to store exceptions
- * @out_args: used to store output arguments
- *
- * This is used to call RealProxy::Invoke(). RealProxy::Invoke() returns an
- * IMessage interface and it is not trivial to extract results from there. So
- * we call an helper method PrivateInvoke instead of calling
- * RealProxy::Invoke() directly.
- *
- * Returns: the result object.
+ * \param real_proxy pointer to a \c RealProxy object
+ * \param msg The \c MonoMethodMessage to execute
+ * \param exc used to store exceptions
+ * \param out_args used to store output arguments
+ * This is used to call \c RealProxy::Invoke(). \c RealProxy::Invoke() returns an
+ * \c IMessage interface and it is not trivial to extract results from there. So
+ * we call an helper method \c PrivateInvoke instead of calling
+ * \c RealProxy::Invoke() directly.
+ * \returns the result object.
*/
MonoObject *
mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg, MonoObject **exc, MonoArray **out_args, MonoError *error)
/**
* mono_object_to_string:
- * @obj: The object
- * @exc: Any exception thrown by ToString (). May be NULL.
- *
- * Returns: the result of calling ToString () on an object.
+ * \param obj The object
+ * \param exc Any exception thrown by \c ToString. May be NULL.
+ * \returns the result of calling \c ToString on an object.
*/
MonoString *
mono_object_to_string (MonoObject *obj, MonoObject **exc)
/**
* mono_object_to_string_checked:
- * @obj: The object
- * @error: Set on error.
- *
- * Returns: the result of calling ToString () on an object. If the
- * method cannot be invoked or if it raises an exception, sets @error
+ * \param obj The object
+ * \param error Set on error.
+ * \returns the result of calling \c ToString() on an object. If the
+ * method cannot be invoked or if it raises an exception, sets \p error
* and returns NULL.
*/
MonoString *
/**
* mono_object_try_to_string:
- * @obj: The object
- * @exc: Any exception thrown by ToString (). Must not be NULL.
- * @error: Set if method cannot be invoked.
- *
- * Returns: the result of calling ToString () on an object. If the
- * method cannot be invoked sets @error, if it raises an exception sets @exc,
+ * \param obj The object
+ * \param exc Any exception thrown by \c ToString(). Must not be NULL.
+ * \param error Set if method cannot be invoked.
+ * \returns the result of calling \c ToString() on an object. If the
+ * method cannot be invoked sets \p error, if it raises an exception sets \p exc,
* and returns NULL.
*/
MonoString *
/**
* mono_print_unhandled_exception:
- * @exc: The exception
- *
+ * \param exc The exception
* Prints the unhandled exception.
*/
void
/**
* mono_delegate_ctor_with_method:
- * @this: pointer to an uninitialized delegate object
- * @target: target object
- * @addr: pointer to native code
- * @method: method
- * @error: set on error.
- *
+ * \param this pointer to an uninitialized delegate object
+ * \param target target object
+ * \param addr pointer to native code
+ * \param method method
+ * \param error set on error.
* Initialize a delegate and sets a specific method, not the one
- * associated with addr. This is useful when sharing generic code.
- * In that case addr will most probably not be associated with the
+ * associated with \p addr. This is useful when sharing generic code.
+ * In that case \p addr will most probably not be associated with the
* correct instantiation of the method.
- * On failure returns FALSE and sets @error.
+ * On failure returns FALSE and sets \p error.
*/
gboolean
mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoMethod *method, MonoError *error)
/**
* mono_delegate_ctor:
- * @this: pointer to an uninitialized delegate object
- * @target: target object
- * @addr: pointer to native code
- * @error: set on error.
- *
+ * \param this pointer to an uninitialized delegate object
+ * \param target target object
+ * \param addr pointer to native code
+ * \param error set on error.
* This is used to initialize a delegate.
- * On failure returns FALSE and sets @error.
+ * On failure returns FALSE and sets \p error.
*/
gboolean
mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoError *error)
/**
* mono_method_call_message_new:
- * @method: method to encapsulate
- * @params: parameters to the method
- * @invoke: optional, delegate invoke.
- * @cb: async callback delegate.
- * @state: state passed to the async callback.
- * @error: set on error.
- *
- * Translates arguments pointers into a MonoMethodMessage.
- * On failure returns NULL and sets @error.
+ * \param method method to encapsulate
+ * \param params parameters to the method
+ * \param invoke optional, delegate invoke.
+ * \param cb async callback delegate.
+ * \param state state passed to the async callback.
+ * \param error set on error.
+ * Translates arguments pointers into a \c MonoMethodMessage.
+ * On failure returns NULL and sets \p error.
*/
MonoMethodMessage *
mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *invoke,
/**
* mono_load_remote_field:
- * @this: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @res: a storage to store the result
- *
+ * \param this pointer to an object
+ * \param klass klass of the object containing \p field
+ * \param field the field to load
+ * \param res a storage to store the result
* This method is called by the runtime on attempts to load fields of
- * transparent proxy objects. @this points to such TP, @klass is the class of
- * the object containing @field. @res is a storage location which can be
+ * transparent proxy objects. \p this points to such TP, \p klass is the class of
+ * the object containing \p field. \p res is a storage location which can be
* used to store the result.
- *
- * Returns: an address pointing to the value of field.
+ * \returns an address pointing to the value of field.
*/
gpointer
mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res)
/**
* mono_load_remote_field_checked:
- * @this: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @res: a storage to store the result
- * @error: set on error
- *
+ * \param this pointer to an object
+ * \param klass klass of the object containing \p field
+ * \param field the field to load
+ * \param res a storage to store the result
+ * \param error set on error
* This method is called by the runtime on attempts to load fields of
- * transparent proxy objects. @this points to such TP, @klass is the class of
- * the object containing @field. @res is a storage location which can be
+ * transparent proxy objects. \p this points to such TP, \p klass is the class of
+ * the object containing \p field. \p res is a storage location which can be
* used to store the result.
- *
- * Returns: an address pointing to the value of field. On failure returns NULL and sets @error.
+ * \returns an address pointing to the value of field. On failure returns NULL and sets \p error.
*/
gpointer
mono_load_remote_field_checked (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res, MonoError *error)
/**
* mono_load_remote_field_new:
- * @this:
- * @klass:
- * @field:
- *
+ * \param this
+ * \param klass
+ * \param field
* Missing documentation.
*/
MonoObject *
/**
* mono_load_remote_field_new_checked:
- * @this: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @error: set on error.
- *
+ * \param this pointer to an object
+ * \param klass klass of the object containing \p field
+ * \param field the field to load
+ * \param error set on error.
* This method is called by the runtime on attempts to load fields of
- * transparent proxy objects. @this points to such TP, @klass is the class of
- * the object containing @field.
- *
- * Returns: a freshly allocated object containing the value of the field. On failure returns NULL and sets @error.
+ * transparent proxy objects. \p this points to such TP, \p klass is the class of
+ * the object containing \p field.
+ * \returns a freshly allocated object containing the value of the field. On failure returns NULL and sets \p error.
*/
MonoObject *
mono_load_remote_field_new_checked (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoError *error)
/**
* mono_store_remote_field:
- * @this_obj: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @val: the value/object to store
- *
+ * \param this_obj pointer to an object
+ * \param klass klass of the object containing \p field
+ * \param field the field to load
+ * \param val the value/object to store
* This method is called by the runtime on attempts to store fields of
- * transparent proxy objects. @this_obj points to such TP, @klass is the class of
- * the object containing @field. @val is the new value to store in @field.
+ * transparent proxy objects. \p this_obj points to such TP, \p klass is the class of
+ * the object containing \p field. \p val is the new value to store in \p field.
*/
void
mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val)
/**
* mono_store_remote_field_checked:
- * @this_obj: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @val: the value/object to store
- * @error: set on error
- *
+ * \param this_obj pointer to an object
+ * \param klass klass of the object containing \p field
+ * \param field the field to load
+ * \param val the value/object to store
+ * \param error set on error
* This method is called by the runtime on attempts to store fields of
- * transparent proxy objects. @this_obj points to such TP, @klass is the class of
- * the object containing @field. @val is the new value to store in @field.
- *
- * Returns: on success returns TRUE, on failure returns FALSE and sets @error.
+ * transparent proxy objects. \p this_obj points to such TP, \p klass is the class of
+ * the object containing \p field. \p val is the new value to store in \p field.
+ * \returns on success returns TRUE, on failure returns FALSE and sets \p error.
*/
gboolean
mono_store_remote_field_checked (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val, MonoError *error)
/**
* mono_store_remote_field_new:
- * @this_obj:
- * @klass:
- * @field:
- * @arg:
- *
+ * \param this_obj
+ * \param klass
+ * \param field
+ * \param arg
* Missing documentation
*/
void
/**
* mono_store_remote_field_new_checked:
- * @this_obj:
- * @klass:
- * @field:
- * @arg:
- * @error:
- *
+ * \param this_obj
+ * \param klass
+ * \param field
+ * \param arg
+ * \param error
* Missing documentation
*/
gboolean
}
#endif
-/*
+/**
* mono_create_ftnptr:
*
- * Given a function address, create a function descriptor for it.
+ * Given a function address, create a function descriptor for it.
* This is only needed on some platforms.
*/
gpointer
/**
* mono_string_chars:
- * @s: a MonoString
- *
- * Returns a pointer to the UCS16 characters stored in the MonoString
+ * \param s a \c MonoString
+ * \returns a pointer to the UTF-16 characters stored in the \c MonoString
*/
gunichar2 *
mono_string_chars (MonoString *s)
/**
* mono_string_length:
- * @s: MonoString
- *
- * Returns the lenght in characters of the string
+ * \param s MonoString
+ * \returns the length in characters of the string
*/
int
mono_string_length (MonoString *s)
/**
* mono_string_handle_length:
- * @s: MonoString
- *
- * Returns the lenght in characters of the string
+ * \param s \c MonoString
+ * \returns the length in characters of the string
*/
int
mono_string_handle_length (MonoStringHandle s)
/**
* mono_array_length:
- * @array: a MonoArray*
- *
- * Returns the total number of elements in the array. This works for
+ * \param array a \c MonoArray*
+ * \returns the total number of elements in the array. This works for
* both vectors and multidimensional arrays.
*/
uintptr_t
/**
* mono_array_addr_with_size:
- * @array: a MonoArray*
- * @size: size of the array elements
- * @idx: index into the array
- *
- * Use this function to obtain the address for the @idx item on the
- * @array containing elements of size @size.
+ * \param array a \c MonoArray*
+ * \param size size of the array elements
+ * \param idx index into the array
+ * Use this function to obtain the address for the \p idx item on the
+ * \p array containing elements of size \p size.
*
* This method performs no bounds checking or type checking.
- *
- * Returns the address of the @idx element in the array.
+ * \returns the address of the \p idx element in the array.
*/
char*
mono_array_addr_with_size (MonoArray *array, int size, uintptr_t idx)
/**
* mono_array_set:
- * @array: array to alter
- * @element_type: A C type name, this macro will use the sizeof(type) to determine the element size
- * @index: index into the array
- * @value: value to set
- *
- * Value Type version: This sets the @index's element of the @array
- * with elements of size sizeof(type) to the provided @value.
+ * \param array array to alter
+ * \param element_type A C type name, this macro will use the sizeof(type) to determine the element size
+ * \param index index into the array
+ * \param value value to set
+ * Value Type version: This sets the \p index's element of the \p array
+ * with elements of size sizeof(type) to the provided \p value.
*
* This macro does not attempt to perform type checking or bounds checking.
*
- * Use this to set value types in a `MonoArray`.
+ * Use this to set value types in a \c MonoArray.
*/
void mono_array_set(MonoArray *array, Type element_type, uintptr_t index, Value value)
{
/**
* mono_array_setref:
- * @array: array to alter
- * @index: index into the array
- * @value: value to set
- *
- * Reference Type version: This sets the @index's element of the
- * @array with elements of size sizeof(type) to the provided @value.
+ * \param array array to alter
+ * \param index index into the array
+ * \param value value to set
+ * Reference Type version. This sets the \p index's element of the
+ * \p array with elements of size sizeof(type) to the provided \p value.
*
* This macro does not attempt to perform type checking or bounds checking.
*
- * Use this to reference types in a `MonoArray`.
+ * Use this to reference types in a \c MonoArray.
*/
void mono_array_setref(MonoArray *array, uintptr_t index, MonoObject *object)
{
/**
* mono_array_get:
- * @array: array on which to operate on
- * @element_type: C element type (example: MonoString *, int, MonoObject *)
- * @index: index into the array
+ * \param array array on which to operate on
+ * \param element_type C element type (example: \c MonoString*, \c int, \c MonoObject*)
+ * \param index index into the array
*
- * Use this macro to retrieve the @index element of an @array and
+ * Use this macro to retrieve the \p index element of an \p array and
* extract the value assuming that the elements of the array match
* the provided type value.
*
* This method can be used with both arrays holding value types and
- * reference types. For reference types, the @type parameter should
- * be a `MonoObject*` or any subclass of it, like `MonoString*`.
+ * reference types. For reference types, the \p type parameter should
+ * be a \c MonoObject* or any subclass of it, like \c MonoString*.
*
* This macro does not attempt to perform type checking or bounds checking.
*
- * Returns: The element at the @index position in the @array.
+ * \returns The element at the \p index position in the \p array.
*/
Type mono_array_get (MonoArray *array, Type element_type, uintptr_t index)
{
+/**
+ * \file
+ */
+
#ifndef _MONO_CLI_OBJECT_H_
#define _MONO_CLI_OBJECT_H_
-/*
- * opcodes.c: CIL instruction information
+/**
+ * \file
+ * CIL instruction information
*
* Author:
* Paolo Molaro (lupus@ximian.com)
#undef OPDEF
};
+/**
+ * mono_opcode_name:
+ */
const char*
mono_opcode_name (int opcode)
{
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_OPCODES_H__
#define __MONO_METADATA_OPCODES_H__
+/**
+ * \file
+ */
#ifndef __MONO_PROFILER_PRIVATE_H__
#define __MONO_PROFILER_PRIVATE_H__
-/*
- * profiler.c: Profiler interface for Mono
+/**
+ * \file
+ * Profiler interface for Mono
*
* Author:
* Paolo Molaro (lupus@ximian.com)
/**
* mono_profiler_install:
- * @prof: a MonoProfiler structure pointer, or a pointer to a derived structure.
- * @callback: the function to invoke at shutdown
- *
- * Use mono_profiler_install to activate profiling in the Mono runtime.
+ * \param prof a \c MonoProfiler structure pointer, or a pointer to a derived structure.
+ * \param callback the function to invoke at shutdown
+ * Use \c mono_profiler_install to activate profiling in the Mono runtime.
* Typically developers of new profilers will create a new structure whose
- * first field is a MonoProfiler and put any extra information that they need
+ * first field is a \c MonoProfiler and put any extra information that they need
* to access from the various profiling callbacks there.
- *
*/
void
mono_profiler_install (MonoProfiler *prof, MonoProfileFunc callback)
/**
* mono_profiler_set_events:
- * @events: an ORed set of values made up of MONO_PROFILER_ flags
- *
- * The events descriped in the @events argument is a set of flags
+ * \param events an ORed set of values made up of \c MONO_PROFILER_ flags
+ * The events described in the \p events argument is a set of flags
* that represent which profiling events must be triggered. For
* example if you have registered a set of methods for tracking
- * JIT compilation start and end with mono_profiler_install_jit_compile,
- * you will want to pass the MONO_PROFILE_JIT_COMPILATION flag to
+ * JIT compilation start and end with \c mono_profiler_install_jit_compile,
+ * you will want to pass the \c MONO_PROFILE_JIT_COMPILATION flag to
* this routine.
*
- * You can call mono_profile_set_events more than once and you can
+ * You can call \c mono_profile_set_events more than once and you can
* do this at runtime to modify which methods are invoked.
*/
void
/**
* mono_profiler_install_enter_leave:
- * @enter: the routine to be called on each method entry
- * @fleave: the routine to be called each time a method returns
+ * \param enter the routine to be called on each method entry
+ * \param fleave the routine to be called each time a method returns
*
* Use this routine to install routines that will be called everytime
* a method enters and leaves. The routines will receive as an argument
- * the MonoMethod representing the method that is entering or leaving.
+ * the \c MonoMethod representing the method that is entering or leaving.
*/
void
mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc fleave)
/**
* mono_profiler_install_jit_compile:
- * @start: the routine to be called when the JIT process starts.
- * @end: the routine to be called when the JIT process ends.
+ * \param start the routine to be called when the JIT process starts.
+ * \param end the routine to be called when the JIT process ends.
*
* Use this routine to install routines that will be called when JIT
* compilation of a method starts and completes.
prof_list->method_end_invoke = end;
}
+/**
+ * mono_profiler_install_thread:
+ */
void
mono_profiler_install_thread (MonoProfileThreadFunc start, MonoProfileThreadFunc end)
{
prof_list->thread_name = thread_name_cb;
}
+/**
+ * mono_profiler_install_transition:
+ */
void
mono_profiler_install_transition (MonoProfileMethodResult callback)
{
prof_list->man_unman_transition = callback;
}
+/**
+ * mono_profiler_install_allocation:
+ */
void
mono_profiler_install_allocation (MonoProfileAllocFunc callback)
{
/**
* mono_profiler_set_statistical_mode:
- * @mode the sampling mode used.
- * @sample_frequency_is_us the sampling frequency in microseconds.
+ * \param mode the sampling mode used.
+ * \param sample_frequency_is_us the sampling frequency in microseconds.
*
* Set the sampling parameters for the profiler. Sampling mode affects the effective sampling rate as in samples/s you'll witness.
* The default sampling mode is process mode, which only reports samples when there's activity in the process.
sampling_frequency = sampling_frequency_hz;
}
+/**
+ * mono_profiler_install_statistical:
+ */
void
mono_profiler_install_statistical (MonoProfileStatFunc callback)
{
prof_list->exception_clause_cb = clause_callback;
}
+/**
+ * mono_profiler_install_coverage_filter:
+ */
void
mono_profiler_install_coverage_filter (MonoProfileCoverageFilterFunc callback)
{
prof_list->coverage_filter_cb = callback;
}
+/**
+ * mono_profiler_install_appdomain:
+ */
void
mono_profiler_install_appdomain (MonoProfileAppDomainFunc start_load, MonoProfileAppDomainResult end_load,
MonoProfileAppDomainFunc start_unload, MonoProfileAppDomainFunc end_unload)
prof_list->context_unload = unload;
}
+/**
+ * mono_profiler_install_assembly:
+ */
void
mono_profiler_install_assembly (MonoProfileAssemblyFunc start_load, MonoProfileAssemblyResult end_load,
MonoProfileAssemblyFunc start_unload, MonoProfileAssemblyFunc end_unload)
prof_list->assembly_end_unload = end_unload;
}
+/**
+ * mono_profiler_install_module:
+ */
void
mono_profiler_install_module (MonoProfileModuleFunc start_load, MonoProfileModuleResult end_load,
MonoProfileModuleFunc start_unload, MonoProfileModuleFunc end_unload)
prof_list->module_end_unload = end_unload;
}
+/**
+ * mono_profiler_install_class:
+ */
void
mono_profiler_install_class (MonoProfileClassFunc start_load, MonoProfileClassResult end_load,
MonoProfileClassFunc start_unload, MonoProfileClassFunc end_unload)
prof_list->class_end_unload = end_unload;
}
+/**
+ * mono_profiler_method_enter:
+ */
void
mono_profiler_method_enter (MonoMethod *method)
{
}
}
+/**
+ * mono_profiler_method_leave:
+ */
void
mono_profiler_method_leave (MonoMethod *method)
{
}
}
+/**
+ * mono_profiler_method_jit:
+ */
void
mono_profiler_method_jit (MonoMethod *method)
{
}
}
+/**
+ * mono_profiler_method_end_jit:
+ */
void
mono_profiler_method_end_jit (MonoMethod *method, MonoJitInfo* jinfo, int result)
{
}
}
+/**
+ * mono_profiler_code_transition:
+ */
void
mono_profiler_code_transition (MonoMethod *method, int result)
{
}
}
+/**
+ * mono_profiler_allocation:
+ */
void
mono_profiler_allocation (MonoObject *obj)
{
}
}
+/**
+ * mono_profiler_stat_hit:
+ */
void
mono_profiler_stat_hit (guchar *ip, void *context)
{
}
}
+/**
+ * mono_profiler_thread_start:
+ */
void
mono_profiler_thread_start (gsize tid)
{
}
}
+/**
+ * mono_profiler_thread_end:
+ */
void
mono_profiler_thread_end (gsize tid)
{
}
}
+/**
+ * mono_profiler_assembly_event:
+ */
void
mono_profiler_assembly_event (MonoAssembly *assembly, int code)
{
}
}
+/**
+ * mono_profiler_assembly_loaded:
+ */
void
mono_profiler_assembly_loaded (MonoAssembly *assembly, int result)
{
}
}
+/**
+ * mono_profiler_module_event:
+ */
void
mono_profiler_module_event (MonoImage *module, int code)
{
}
}
+/**
+ * mono_profiler_module_loaded:
+ */
void
mono_profiler_module_loaded (MonoImage *module, int result)
{
}
}
+/**
+ * mono_profiler_class_event:
+ */
void
mono_profiler_class_event (MonoClass *klass, int code)
{
}
}
+/**
+ * mono_profiler_class_loaded:
+ */
void
mono_profiler_class_loaded (MonoClass *klass, int result)
{
}
}
+/**
+ * mono_profiler_appdomain_event:
+ */
void
mono_profiler_appdomain_event (MonoDomain *domain, int code)
{
}
}
+/**
+ * mono_profiler_appdomain_loaded:
+ */
void
mono_profiler_appdomain_loaded (MonoDomain *domain, int result)
{
prof->context_unload (prof->profiler, context);
}
+/**
+ * mono_profiler_shutdown:
+ */
void
mono_profiler_shutdown (void)
{
mono_profiler_set_events ((MonoProfileFlags)0);
}
+/**
+ * mono_profiler_gc_heap_resize:
+ */
void
mono_profiler_gc_heap_resize (gint64 new_size)
{
}
}
+/**
+ * mono_profiler_gc_event:
+ */
void
mono_profiler_gc_event (MonoGCEvent event, int generation)
{
}
}
+/**
+ * mono_profiler_install_gc:
+ */
void
mono_profiler_install_gc (MonoProfileGCFunc callback, MonoProfileGCResizeFunc heap_resize_callback)
{
/**
* mono_profiler_install_gc_moves:
- * @callback: callback function
+ * \param callback callback function
*
- * Install the @callback function that the GC will call when moving objects.
+ * Install the \p callback function that the GC will call when moving objects.
* The callback receives an array of pointers and the number of elements
* in the array. Every even element in the array is the original object location
* and the following odd element is the new location of the object in memory.
/**
* mono_profiler_install_gc_roots:
- * @handle_callback: callback function
- * @roots_callback: callback function
+ * \param handle_callback callback function
+ * \param roots_callback callback function
*
- * Install the @handle_callback function that the GC will call when GC
+ * Install the \p handle_callback function that the GC will call when GC
* handles are created or destroyed.
- * The callback receives an operation, which is either #MONO_PROFILER_GC_HANDLE_CREATED
- * or #MONO_PROFILER_GC_HANDLE_DESTROYED, the handle type, the handle value and the
+ * The callback receives an operation, which is either \c MONO_PROFILER_GC_HANDLE_CREATED
+ * or \c MONO_PROFILER_GC_HANDLE_DESTROYED, the handle type, the handle value and the
* object pointer, if present.
- * Install the @roots_callback function that the GC will call when tracing
+ * Install the \p roots_callback function that the GC will call when tracing
* the roots for a collection.
* The callback receives the number of elements and three arrays: an array
* of objects, an array of root types and flags and an array of extra info.
/**
* mono_profiler_coverage_get:
- * @prof: The profiler handle, installed with mono_profiler_install
- * @method: the method to gather information from.
- * @func: A routine that will be called back with the results
+ * \param prof The profiler handle, installed with mono_profiler_install
+ * \param method the method to gather information from.
+ * \param func A routine that will be called back with the results
*
- * If the MONO_PROFILER_INS_COVERAGE flag was active during JIT compilation
- * it is posisble to obtain coverage information about a give method.
+ * If the \c MONO_PROFILER_INS_COVERAGE flag was active during JIT compilation
+ * it is possible to obtain coverage information about a give method.
*
- * The function @func will be invoked repeatedly with instances of the
- * MonoProfileCoverageEntry structure.
+ * The function \p func will be invoked repeatedly with instances of the
+ * \c MonoProfileCoverageEntry structure.
*/
void
mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileCoverageFunc func)
/**
* mono_profiler_load:
- * @desc: arguments to configure the profiler
+ * \param desc arguments to configure the profiler
*
* Invoke this method to initialize the profiler. This will drive the
* loading of the internal ("default") or any external profilers.
+/**
+ * \file
+ */
+
#ifndef __MONO_PROFILER_H__
#define __MONO_PROFILER_H__
-
-/*
- * property-bag.c: Linearizable property bag.
+/**
+ * \file
+ * Linearizable property bag.
*
* Authors:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * property-bag.h: Linearizable property bag.
+/**
+ * \file
+ * Linearizable property bag.
*
* Authors:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * rand.c: System.Security.Cryptography.RNGCryptoServiceProvider support
+/**
+ * \file
+ * System.Security.Cryptography.RNGCryptoServiceProvider support
*
* Authors:
* Mark Crichton (crichton@gimp.org)
-/*
- * rand.h: System.Security.Cryptography.RNGCryptoServiceProvider support
+/**
+ * \file
+ * System.Security.Cryptography.RNGCryptoServiceProvider support
*
* Author:
* Mark Crichton (crichton@gimp.org)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
+/**
+ * \file
* Copyright 2014 Xamarin Inc
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * reflection.c: System.Type icalls and related reflection queries.
+/**
+ * \file
+ * System.Type icalls and related reflection queries.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
}
+/**
+ * mono_custom_attrs_free:
+ */
void
mono_custom_attrs_free (MonoCustomAttrInfo *ainfo)
{
}
-/*
+/**
* mono_assembly_get_object:
- * @domain: an app domain
- * @assembly: an assembly
- *
- * Return an System.Reflection.Assembly object representing the MonoAssembly @assembly.
+ * \param domain an app domain
+ * \param assembly an assembly
+ * \returns a \c System.Reflection.Assembly object representing the \c MonoAssembly \p assembly.
*/
MonoReflectionAssembly*
mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly)
return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionAssemblyHandle, assembly, NULL, assembly_object_construct, NULL);
}
+/**
+ * mono_module_get_object:
+ */
MonoReflectionModule*
mono_module_get_object (MonoDomain *domain, MonoImage *image)
{
return CHECK_OR_CONSTRUCT_HANDLE (MonoReflectionModuleHandle, image, NULL, module_object_construct, NULL);
}
+/**
+ * mono_module_file_get_object:
+ */
MonoReflectionModule*
mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_index)
{
return type;
}
-/*
+
+/**
* mono_type_get_object:
- * @domain: an app domain
- * @type: a type
- *
- * Return an System.MonoType object representing the type @type.
+ * \param domain an app domain
+ * \param type a type
+ * \returns A \c System.MonoType object representing the type \p type.
*/
MonoReflectionType*
mono_type_get_object (MonoDomain *domain, MonoType *type)
return MONO_HANDLE_NEW (MonoReflectionType, mono_type_get_object_checked (domain, type, error));
}
-/*
+/**
* mono_method_get_object:
- * @domain: an app domain
- * @method: a method
- * @refclass: the reflected type (can be NULL)
- *
- * Return an System.Reflection.MonoMethod object representing the method @method.
+ * \param domain an app domain
+ * \param method a method
+ * \param refclass the reflected type (can be NULL)
+ * \returns A \c System.Reflection.MonoMethod object representing the method \p method.
*/
MonoReflectionMethod*
mono_method_get_object (MonoDomain *domain, MonoMethod *method, MonoClass *refclass)
}
}
-/*
+/**
* mono_field_get_object:
- * @domain: an app domain
- * @klass: a type
- * @field: a field
- *
- * Return an System.Reflection.MonoField object representing the field @field
- * in class @klass.
+ * \param domain an app domain
+ * \param klass a type
+ * \param field a field
+ * \returns A \c System.Reflection.MonoField object representing the field \p field
+ * in class \p klass.
*/
MonoReflectionField*
mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *field)
/**
* mono_property_get_object_handle:
- * @domain: an app domain
- * @klass: a type
- * @property: a property
- * @error: set on error
+ * \param domain an app domain
+ * \param klass a type
+ * \param property a property
+ * \param error set on error
*
- * Return an System.Reflection.MonoProperty object representing the property @property
- * in class @klass. On error returns NULL and sets @error.
+ * \returns A \c System.Reflection.MonoProperty object representing the property \p property
+ * in class \p klass. On error returns NULL and sets \p error.
*/
MonoReflectionPropertyHandle
mono_property_get_object_handle (MonoDomain *domain, MonoClass *klass, MonoProperty *property, MonoError *error)
/**
* mono_property_get_object:
- * @domain: an app domain
- * @klass: a type
- * @property: a property
- * @error: set on error
- *
- * Return an System.Reflection.MonoProperty object representing the property @property
- * in class @klass. On error returns NULL and sets @error.
+ * \param domain an app domain
+ * \param klass a type
+ * \param property a property
+ * \param error set on error
+ * \returns a \c System.Reflection.MonoProperty object representing the property \p property
+ * in class \p klass. On error returns NULL and sets \p error.
*/
MonoReflectionProperty*
mono_property_get_object_checked (MonoDomain *domain, MonoClass *klass, MonoProperty *property, MonoError *error)
HANDLE_FUNCTION_RETURN_OBJ (res);
}
-/*
+/**
* mono_event_get_object:
- * @domain: an app domain
- * @klass: a type
- * @event: a event
- *
- * Return an System.Reflection.MonoEvent object representing the event @event
- * in class @klass.
+ * \param domain an app domain
+ * \param klass a type
+ * \param event a event
+ * \returns A \c System.Reflection.MonoEvent object representing the event \p event
+ * in class \p klass.
*/
MonoReflectionEvent*
mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event)
/**
* mono_event_get_object_handle:
- * @domain: an app domain
- * @klass: a type
- * @event: a event
- * @error: set on error
- *
- * Return an System.Reflection.MonoEvent object representing the event @event
- * in class @klass. On failure sets @error and returns NULL
+ * \param domain an app domain
+ * \param klass a type
+ * \param event a event
+ * \param error set on error
+ * \returns a \c System.Reflection.MonoEvent object representing the event \p event
+ * in class \p klass. On failure sets \p error and returns NULL
*/
MonoReflectionEventHandle
mono_event_get_object_handle (MonoDomain *domain, MonoClass *klass, MonoEvent *event, MonoError *error)
/**
* mono_get_reflection_missing_object:
- * @domain: Domain where the object lives
+ * \param domain Domain where the object lives
*
- * Returns the System.Reflection.Missing.Value singleton object
- * (of type System.Reflection.Missing).
+ * \returns the \c System.Reflection.Missing.Value singleton object
+ * (of type \c System.Reflection.Missing).
*
- * Used as the value for ParameterInfo.DefaultValue when Optional
+ * Used as the value for \c ParameterInfo.DefaultValue when Optional
* is present
*/
static MonoObjectHandle
return MONO_HANDLE_NEW (MonoArray, NULL_HANDLE);
}
+/**
+ * mono_param_get_objects:
+ */
MonoArray*
mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
{
HANDLE_FUNCTION_RETURN_VAL (is_ok (error));
}
-/*
+/**
* mono_method_body_get_object:
- * @domain: an app domain
- * @method: a method
- *
- * Return an System.Reflection.MethodBody object representing the method @method.
+ * \param domain an app domain
+ * \param method a method
+ * \return A \c System.Reflection.MethodBody object representing the method \p method.
*/
MonoReflectionMethodBody*
mono_method_body_get_object (MonoDomain *domain, MonoMethod *method)
/**
* mono_method_body_get_object_handle:
- * @domain: an app domain
- * @method: a method
- * @error: set on error
- *
- * Return an System.Reflection.MethodBody object representing the
- * method @method. On failure, returns NULL and sets @error.
+ * \param domain an app domain
+ * \param method a method
+ * \param error set on error
+ * \returns a \c System.Reflection.MethodBody object representing the
+ * method \p method. On failure, returns NULL and sets \p error.
*/
MonoReflectionMethodBodyHandle
mono_method_body_get_object_handle (MonoDomain *domain, MonoMethod *method, MonoError *error)
/**
* mono_get_dbnull_object:
- * @domain: Domain where the object lives
- *
- * Returns the System.DBNull.Value singleton object
- *
- * Used as the value for ParameterInfo.DefaultValue
+ * \param domain Domain where the object lives
+ * Used as the value for \c ParameterInfo.DefaultValue
+ * \returns the \c System.DBNull.Value singleton object
*/
MonoObject *
mono_get_dbnull_object (MonoDomain *domain)
/**
* mono_identifier_unescape_type_name_chars:
- * @identifier: the display name of a mono type
+ * \param identifier the display name of a mono type
*
- * Returns:
- * The name in internal form, that is without escaping backslashes.
+ * \returns The name in internal form, that is without escaping backslashes.
*
- * The string is modified in place!
+ * The string is modified in place!
*/
char*
mono_identifier_unescape_type_name_chars(char* identifier)
/**
* mono_identifier_unescape_info:
*
- * @info: a parsed display form of an (optionally assembly qualified) full type name.
- *
- * Returns: nothing.
+ * \param info a parsed display form of an (optionally assembly qualified) full type name.
*
* Destructively updates the info by unescaping the identifiers that
* comprise the type namespace, name, nested types (if any) and
g_list_foreach(info->nested, &unescape_each_nested_name, NULL);
}
+/**
+ * mono_reflection_parse_type:
+ */
int
mono_reflection_parse_type (char *name, MonoTypeNameParse *info)
{
return &klass->byval_arg;
}
-/*
+/**
* mono_reflection_get_type:
- * @image: a metadata context
- * @info: type description structure
- * @ignorecase: flag for case-insensitive string compares
- * @type_resolve: whenever type resolve was already tried
+ * \param image a metadata context
+ * \param info type description structure
+ * \param ignorecase flag for case-insensitive string compares
+ * \param type_resolve whenever type resolve was already tried
*
- * Build a MonoType from the type description in @info.
+ * Build a MonoType from the type description in \p info.
*
*/
-
MonoType*
mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve) {
MonoError error;
/**
* mono_reflection_get_type_checked:
- * @rootimage: the image of the currently active managed caller
- * @image: a metadata context
- * @info: type description structure
- * @ignorecase: flag for case-insensitive string compares
- * @type_resolve: whenever type resolve was already tried
- * @error: set on error.
- *
- * Build a MonoType from the type description in @info. On failure returns NULL and sets @error.
- *
+ * \param rootimage the image of the currently active managed caller
+ * \param image a metadata context
+ * \param info type description structure
+ * \param ignorecase flag for case-insensitive string compares
+ * \param type_resolve whenever type resolve was already tried
+ * \param error set on error.
+ * Build a \c MonoType from the type description in \p info. On failure returns NULL and sets \p error.
*/
MonoType*
mono_reflection_get_type_checked (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error) {
return type;
}
+/**
+ * mono_reflection_free_type_info:
+ */
void
mono_reflection_free_type_info (MonoTypeNameParse *info)
{
}
}
-/*
+/**
* mono_reflection_type_from_name:
- * @name: type name.
- * @image: a metadata context (can be NULL).
+ * \param name type name.
+ * \param image a metadata context (can be NULL).
*
- * Retrieves a MonoType from its @name. If the name is not fully qualified,
- * it defaults to get the type from @image or, if @image is NULL or loading
+ * Retrieves a \c MonoType from its \p name. If the name is not fully qualified,
+ * it defaults to get the type from \p image or, if \p image is NULL or loading
* from it fails, uses corlib.
*
*/
/**
* mono_reflection_type_from_name_checked:
- * @name: type name.
- * @image: a metadata context (can be NULL).
- * @error: set on errror.
- *
- * Retrieves a MonoType from its @name. If the name is not fully qualified,
- * it defaults to get the type from @image or, if @image is NULL or loading
- * from it fails, uses corlib. On failure returns NULL and sets @error.
- *
+ * \param name type name.
+ * \param image a metadata context (can be NULL).
+ * \param error set on errror.
+ * Retrieves a MonoType from its \p name. If the name is not fully qualified,
+ * it defaults to get the type from \p image or, if \p image is NULL or loading
+ * from it fails, uses corlib. On failure returns NULL and sets \p error.
*/
MonoType*
mono_reflection_type_from_name_checked (char *name, MonoImage *image, MonoError *error)
return type;
}
-/*
+/**
* mono_reflection_get_token:
- *
- * Return the metadata token of OBJ which should be an object
+ * \returns the metadata token of \p obj which should be an object
* representing a metadata element.
*/
guint32
/**
* mono_reflection_get_token_checked:
- * @obj: the object
- * @error: set on error
- *
- * Return the metadata token of @obj which should be an object
- * representing a metadata element. On failure sets @error.
+ * \param obj the object
+ * \param error set on error
+ * \returns the metadata token of \p obj which should be an object
+ * representing a metadata element. On failure sets \p error.
*/
guint32
mono_reflection_get_token_checked (MonoObjectHandle obj, MonoError *error)
/**
* mono_reflection_bind_generic_parameters:
- * @type: a managed type object (which should be some kind of generic (instance? definition?))
- * @type_args: the number of type arguments to bind
- * @types: array of type arguments
- * @error: set on error
- *
+ * \param type a managed type object (which should be some kind of generic (instance? definition?))
+ * \param type_args the number of type arguments to bind
+ * \param types array of type arguments
+ * \param error set on error
* Given a managed type object for a generic type instance, binds each of its arguments to the specified types.
- * Returns the MonoType* for the resulting type instantiation. On failure returns NULL and sets @error.
+ * \returns the \c MonoType* for the resulting type instantiation. On failure returns NULL and sets \p error.
*/
MonoType*
mono_reflection_bind_generic_parameters (MonoReflectionTypeHandle reftype, int type_argc, MonoType **types, MonoError *error)
return result;
}
-/*
+/**
+ * mono_declsec_flags_from_method:
+ * \param method The method for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified method.
- *
- * @method: The method for which we want the declarative security flags.
- * Return the declarative security flags for the method (only).
- *
- * Note: To keep MonoMethod size down we do not cache the declarative security flags
- * (except for the stack modifiers which are kept in the MonoJitInfo structure)
+ * To keep \c MonoMethod size down we do not cache the declarative security flags
+ * (except for the stack modifiers which are kept in the MonoJitInfo structure)
+ * \returns the declarative security flags for the method (only).
*/
guint32
mono_declsec_flags_from_method (MonoMethod *method)
return 0;
}
-/*
+/**
+ * mono_declsec_flags_from_class:
+ * \param klass The class for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified class.
- *
- * @klass: The class for which we want the declarative security flags.
- * Return the declarative security flags for the class.
- *
- * Note: We cache the flags inside the MonoClass structure as this will get
- * called very often (at least for each method).
+ * We cache the flags inside the \c MonoClass structure as this will get
+ * called very often (at least for each method).
+ * \returns the declarative security flags for the class.
*/
guint32
mono_declsec_flags_from_class (MonoClass *klass)
return 0;
}
-/*
+/**
+ * mono_declsec_flags_from_assembly:
+ * \param assembly The assembly for which we want the declarative security flags.
* Get the security actions (in the form of flags) associated with the specified assembly.
- *
- * @assembly: The assembly for which we want the declarative security flags.
- * Return the declarative security flags for the assembly.
+ * \returns the declarative security flags for the assembly.
*/
guint32
mono_declsec_flags_from_assembly (MonoAssembly *assembly)
return fill_actions_from_index (method->klass->image, idx, demands, id_std, id_noncas, id_choice);
}
-/*
+/**
+ * mono_declsec_get_demands:
* Collect all actions (that requires to generate code in mini) assigned for
* the specified method.
- * Note: Don't use the content of actions if the function return FALSE.
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_demands (MonoMethod *method, MonoDeclSecurityActions* demands)
}
-/*
- * Collect all Link actions: LinkDemand, NonCasLinkDemand and LinkDemandChoice (2.0).
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_linkdemands:
+ * Collect all Link actions: \c LinkDemand, \c NonCasLinkDemand and \c LinkDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_linkdemands (MonoMethod *method, MonoDeclSecurityActions* klass, MonoDeclSecurityActions *cmethod)
return result;
}
-/*
- * Collect all Inherit actions: InheritanceDemand, NonCasInheritanceDemand and InheritanceDemandChoice (2.0).
- *
- * @klass The inherited class - this is the class that provides the security check (attributes)
- * @demans
- * return TRUE if inheritance demands (any kind) are present, FALSE otherwise.
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_inheritdemands_class:
+ * \param klass The inherited class - this is the class that provides the security check (attributes)
+ * \param demands
+ * Collect all Inherit actions - \c InheritanceDemand, \c NonCasInheritanceDemand and \c InheritanceDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
+ * \returns TRUE if inheritance demands (any kind) are present, FALSE otherwise.
*/
MonoBoolean
mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions* demands)
return result;
}
-/*
- * Collect all Inherit actions: InheritanceDemand, NonCasInheritanceDemand and InheritanceDemandChoice (2.0).
- *
- * Note: Don't use the content of actions if the function return FALSE.
+/**
+ * mono_declsec_get_inheritdemands_method:
+ * Collect all Inherit actions: \c InheritanceDemand, \c NonCasInheritanceDemand and \c InheritanceDemandChoice (2.0).
+ * Don't use the content of actions if the function return FALSE.
*/
MonoBoolean
mono_declsec_get_inheritdemands_method (MonoMethod *method, MonoDeclSecurityActions* demands)
return FALSE;
}
+/**
+ * mono_declsec_get_class_action:
+ */
MonoBoolean
mono_declsec_get_class_action (MonoClass *klass, guint32 action, MonoDeclSecurityEntry *entry)
{
return FALSE;
}
+/**
+ * mono_declsec_get_assembly_action:
+ */
MonoBoolean
mono_declsec_get_assembly_action (MonoAssembly *assembly, guint32 action, MonoDeclSecurityEntry *entry)
{
/**
* mono_reflection_type_get_type:
- * @reftype: the System.Type object
- *
- * Returns the MonoType* associated with the C# System.Type object @reftype.
+ * \param reftype the \c System.Type object
+ * \returns the \c MonoType* associated with the C# \c System.Type object \p reftype.
*/
MonoType*
mono_reflection_type_get_type (MonoReflectionType *reftype)
/**
* mono_reflection_assembly_get_assembly:
- * @refassembly: the System.Reflection.Assembly object
- *
- * Returns the MonoAssembly* associated with the C# System.Reflection.Assembly object @refassembly.
+ * \param refassembly the \c System.Reflection.Assembly object
+ * \returns the \c MonoAssembly* associated with the C# \c System.Reflection.Assembly object \p refassembly.
*/
MonoAssembly*
mono_reflection_assembly_get_assembly (MonoReflectionAssembly *refassembly)
/**
* mono_class_from_mono_type_handle:
- * @reftype: the System.Type handle
- *
- * Returns the MonoClass* corresponding to the given type.
+ * \param reftype the \c System.Type handle
+ * \returns the \c MonoClass* corresponding to the given type.
*/
MonoClass*
mono_class_from_mono_type_handle (MonoReflectionTypeHandle reftype)
+/**
+ * \file
+ */
+
#ifndef __METADATA_REFLECTION_H__
#define __METADATA_REFLECTION_H__
-/*
- * remoting.c: Remoting support
+/**
+ * \file
+ * Remoting support
*
* Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
}
+/**
+ * mono_marshal_get_remoting_invoke:
+ */
MonoMethod *
mono_marshal_get_remoting_invoke (MonoMethod *method)
{
return res;
}
-/* mono_marshal_get_xappdomain_invoke ()
+/**
+ * mono_marshal_get_xappdomain_invoke:
* Generates a fast remoting wrapper for cross app domain calls.
*/
MonoMethod *
return res;
}
+/**
+ * mono_marshal_get_remoting_invoke_for_target:
+ */
MonoMethod *
mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type)
{
return compiled_ptr;
}
+/**
+ * mono_marshal_get_remoting_invoke_with_check:
+ */
MonoMethod *
mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
{
return res;
}
-/*
+/**
* mono_marshal_get_ldfld_wrapper:
- * @type: the type of the field
+ * \param type the type of the field
*
* This method generates a function which can be use to load a field with type
- * @type from an object. The generated function has the following signature:
- * <@type> ldfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset)
+ * \p type from an object. The generated function has the following signature:
+ *
+ * <code><i>type</i> ldfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset)</code>
*/
MonoMethod *
mono_marshal_get_ldfld_wrapper (MonoType *type)
}
-/*
+/**
* mono_marshal_get_stfld_wrapper:
- * @type: the type of the field
+ * \param type the type of the field
*
* This method generates a function which can be use to store a field with type
- * @type. The generated function has the following signature:
- * void stfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset, <@type> val)
+ * \p type. The generated function has the following signature:
+ *
+ * <code>void stfld_wrapper (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, int offset, <i>type</i> val)</code>
*/
MonoMethod *
mono_marshal_get_stfld_wrapper (MonoType *type)
return res;
}
+/**
+ * mono_marshal_get_proxy_cancast:
+ */
MonoMethod *
mono_marshal_get_proxy_cancast (MonoClass *klass)
{
/**
* mono_marshal_xdomain_copy_value_handle:
- * @val: The value to copy.
- * @error: set on failure.
- *
- * Makes a copy of @val suitable for the current domain.
- * On failure returns NULL and sets @error.
+ * \param val The value to copy.
+ * \param error set on failure.
+ * Makes a copy of \p val suitable for the current domain.
+ * On failure returns NULL and sets \p error.
*/
MonoObjectHandle
mono_marshal_xdomain_copy_value_handle (MonoObjectHandle val, MonoError *error)
-/*
- * remoting.h: Remoting support
+/**
+ * \file
+ * Remoting support
*
* (C) 2014 Xamarin, Inc. http://www.xamarin.com
*
+/**
+ * \file
+ */
#ifndef __MONO_METADATA_ROW_INDEXES_H__
#define __MONO_METADATA_ROW_INDEXES_H__
-/*
- * runtime.c: Runtime functions
+/**
+ * \file
+ * Runtime functions
*
* Authors:
* Jonathan Pryor
/**
* mono_runtime_set_shutting_down:
+ * \deprecated This function can break the shutdown sequence.
*
- * Invoked by System.Environment.Exit to flag that the runtime
+ * Invoked by \c System.Environment.Exit to flag that the runtime
* is shutting down.
- *
- * Deprecated. This function can break the shutdown sequence.
*/
void
mono_runtime_set_shutting_down (void)
/**
* mono_runtime_is_shutting_down:
- *
- * Returns whether the runtime has been flagged for shutdown.
- *
- * This is consumed by the P:System.Environment.HasShutdownStarted
- * property.
- *
+ * This is consumed by the \c P:System.Environment.HasShutdownStarted property.
+ * \returns whether the runtime has been flagged for shutdown.
*/
gboolean
mono_runtime_is_shutting_down (void)
return NULL;
return mono_guid_to_string ((guint8*) aotid);
-}
\ No newline at end of file
+}
-/*
- * runtime.h: Runtime functions
+/**
+ * \file
+ * Runtime functions
*
* Author:
* Jonathan Pryor
-/*
- * security-core-clr.c: CoreCLR security
+/**
+ * \file
+ * CoreCLR security
*
* Authors:
* Mark Probst <mark.probst@gmail.com>
/**
* mono_security_core_clr_set_options:
- * @options: the new options for the coreclr system to use
+ * \param options the new options for the coreclr system to use
*
* By default, the CoreCLRs security model forbids execution trough reflection of methods not visible from the calling code.
* Even if the method being called is not in a platform assembly. For non moonlight CoreCLR users this restriction does not
* make a lot of sense, since the author could have just changed the non platform assembly to allow the method to be called.
* This function allows specific relaxations from the default behaviour to be set.
*
- * Use MONO_SECURITY_CORE_CLR_OPTIONS_DEFAULT for the default coreclr coreclr behaviour as used in Moonlight.
+ * Use \c MONO_SECURITY_CORE_CLR_OPTIONS_DEFAULT for the default coreclr coreclr behaviour as used in Moonlight.
*
- * Use MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_REFLECTION to allow transparent code to execute methods and access
+ * Use \c MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_REFLECTION to allow transparent code to execute methods and access
* fields that are not in platformcode, even if those methods and fields are private or otherwise not visible to the calling code.
*
- * Use MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_DELEGATE to allow delegates to be created that point at methods that are not in
+ * Use \c MONO_SECURITY_CORE_CLR_OPTIONS_RELAX_DELEGATE to allow delegates to be created that point at methods that are not in
* platformcode even if those methods and fields are private or otherwise not visible to the calling code.
*
*/
-/*
- * security-core-clr.h: CoreCLR security
+/**
+ * \file
+ * CoreCLR security
*
* Author:
* Mark Probst <mark.probst@gmail.com>
-/*
- * security-manager.c: Security Manager (Unmanaged side)
+/**
+ * \file
+ * Security Manager (Unmanaged side)
*
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
-/*
- * security-manager.h: Security Manager
+/**
+ * \file
+ * Security Manager
*
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
-/*
- * security.c: Security internal calls
+/**
+ * \file
+ * Security internal calls
*
* Author:
* Sebastien Pouliot <sebastien@ximian.com>
-/*
- * seq-points-data.c: Sequence Points functions
+/**
+ * \file
+ * Sequence Points functions
*
* Authors:
* Marcos Henrich (marcos.henrich@xamarin.com)
-/*
+/**
+ * \file
* Copyright 2015 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * sgen-bridge-internals.h: The cross-GC bridge.
+/**
+ * \file
+ * The cross-GC bridge.
*
* Copyright (C) 2015 Xamarin Inc
*
-/*
- * sgen-bridge.c: Simple generational GC.
+/**
+ * \file
+ * Simple generational GC.
*
* Copyright 2011 Novell, Inc (http://www.novell.com)
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
volatile gboolean bridge_processing_in_progress = FALSE;
// FIXME: The current usage pattern for this function is unsafe. Bridge processing could start immediately after unlock
+/**
+ * mono_gc_wait_for_bridge_processing:
+ */
void
mono_gc_wait_for_bridge_processing (void)
{
sgen_gc_unlock ();
}
+/**
+ * mono_gc_register_bridge_callbacks:
+ */
void
mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks)
{
-/*
+/**
+ * \file
* Copyright 2011 Novell, Inc.
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * sgen-client-mono.h: Mono's client definitions for SGen.
+/**
+ * \file
+ * Mono's client definitions for SGen.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
+/**
+ * \file
* Copyright 2016 Xamarin, Inc.
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * sgen-mono.c: SGen features specific to Mono.
+/**
+ * \file
+ * SGen features specific to Mono.
*
* Copyright (C) 2014 Xamarin Inc
*
/**
* mono_gc_wbarrier_object_copy:
*
- * Write barrier to call when obj is the result of a clone or copy of an object.
+ * Write barrier to call when \p obj is the result of a clone or copy of an object.
*/
void
mono_gc_wbarrier_object_copy (MonoObject* obj, MonoObject *src)
sgen_get_remset ()->wbarrier_object_copy (obj, src);
}
+/**
+ * mono_gc_wbarrier_set_arrayref:
+ */
void
mono_gc_wbarrier_set_arrayref (MonoArray *arr, gpointer slot_ptr, MonoObject* value)
{
sgen_get_remset ()->wbarrier_set_field ((GCObject*)arr, slot_ptr, value);
}
+/**
+ * mono_gc_wbarrier_set_field:
+ */
void
mono_gc_wbarrier_set_field (MonoObject *obj, gpointer field_ptr, MonoObject* value)
{
mono_gc_run_finalize (obj, NULL);
}
+/**
+ * mono_gc_invoke_finalizers:
+ */
int
mono_gc_invoke_finalizers (void)
{
return sgen_gc_invoke_finalizers ();
}
+/**
+ * mono_gc_pending_finalizers:
+ */
MonoBoolean
mono_gc_pending_finalizers (void)
{
/**
* mono_gc_finalizers_for_domain:
- * @domain: the unloading appdomain
- * @out_array: output array
- * @out_size: size of output array
- *
- * Enqueue for finalization all objects that belong to the unloading appdomain @domain
- * @suspend is used for early termination of the enqueuing process.
+ * \param domain the unloading appdomain
+ * \param out_array output array
+ * \param out_size size of output array
+ * Enqueue for finalization all objects that belong to the unloading appdomain \p domain.
+ * \p suspend is used for early termination of the enqueuing process.
*/
void
mono_gc_finalize_domain (MonoDomain *domain)
return obj;
}
+/**
+ * mono_gc_alloc_fixed:
+ */
void*
mono_gc_alloc_fixed (size_t size, MonoGCDescriptor descr, MonoGCRootSource source, const char *msg)
{
return res;
}
+/**
+ * mono_gc_free_fixed:
+ */
void
mono_gc_free_fixed (void* addr)
{
/**
* mono_gc_walk_heap:
- * @flags: flags for future use
- * @callback: a function pointer called for each object in the heap
- * @data: a user data pointer that is passed to callback
- *
- * This function can be used to iterate over all the live objects in the heap:
- * for each object, @callback is invoked, providing info about the object's
+ * \param flags flags for future use
+ * \param callback a function pointer called for each object in the heap
+ * \param data a user data pointer that is passed to callback
+ * This function can be used to iterate over all the live objects in the heap;
+ * for each object, \p callback is invoked, providing info about the object's
* location in memory, its class, its size and the objects it references.
- * For each referenced object it's offset from the object address is
+ * For each referenced object its offset from the object address is
* reported in the offsets array.
* The object references may be buffered, so the callback may be invoked
* multiple times for the same object: in all but the first call, the size
* argument will be zero.
- * Note that this function can be only called in the #MONO_GC_EVENT_PRE_START_WORLD
+ * Note that this function can be only called in the \c MONO_GC_EVENT_PRE_START_WORLD
* profiler event handler.
- *
- * Returns: a non-zero value if the GC doesn't support heap walking
+ * \returns a non-zero value if the GC doesn't support heap walking
*/
int
mono_gc_walk_heap (int flags, MonoGCReferences callback, void *data)
mono_thread_detach_internal (mono_thread_internal_current ());
}
+/**
+ * mono_gc_register_thread:
+ */
gboolean
mono_gc_register_thread (void *baseptr)
{
return mono_thread_info_attach (baseptr) != NULL;
}
+/**
+ * mono_gc_is_gc_thread:
+ */
gboolean
mono_gc_is_gc_thread (void)
{
/**
* mono_gchandle_is_in_domain:
- * @gchandle: a GCHandle's handle.
- * @domain: An application domain.
- *
- * Returns: TRUE if the object wrapped by the @gchandle belongs to the specific @domain.
+ * \param gchandle a GCHandle's handle.
+ * \param domain An application domain.
+ * \returns TRUE if the object wrapped by the \p gchandle belongs to the specific \p domain.
*/
gboolean
mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain)
/**
* mono_gchandle_free_domain:
- * @unloading: domain that is unloading
+ * \param unloading domain that is unloading
*
* Function used internally to cleanup any GC handle for objects belonging
* to the specified domain during appdomain unload.
static gboolean gc_inited;
+/**
+ * mono_gc_base_init:
+ */
void
mono_gc_base_init (void)
{
-/*
- * sgen-bridge.c: Simple generational GC.
+/**
+ * \file
+ * Simple generational GC.
*
* Copyright 2011 Novell, Inc (http://www.novell.com)
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
-/*
- * sgen-bridge.c: Simple generational GC.
+/**
+ * \file
+ * Simple generational GC.
*
* Copyright 2011 Novell, Inc (http://www.novell.com)
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
-/*
- * sgen-stw.c: Stop the world functionality
+/**
+ * \file
+ * Stop the world functionality
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * sgen-tarjan-bridge.c: Tarjan-based bridge implementation.
+/**
+ * \file
+ * Tarjan-based bridge implementation.
*
* Copyright 2011 Novell, Inc (http://www.novell.com)
* Copyright 2014 Xamarin Inc (http://www.xamarin.com)
-/*
- * sgen-toggleref.c: toggleref support for sgen
+/**
+ * \file
+ * toggleref support for sgen
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
/**
* mono_gc_toggleref_register_callback:
- * @callback callback used to determine the new state of the given object.
+ * \param callback callback used to determine the new state of the given object.
*
- * The callback must decide the status of a given object. It must return one of the values in the MONO_TOGGLE_REF_ enum.
+ * The callback must decide the status of a given object. It must return one of the values in the \c MONO_TOGGLE_REF_ enum.
* This function is called with the world running but with the GC locked. This means that you can do everything that doesn't
* require GC interaction. This includes, but not limited to, allocating objects, (de)registering for finalization, manipulating
- *gchandles, storing to reference fields or interacting with other threads that might perform such operations.
+ * gchandles, storing to reference fields or interacting with other threads that might perform such operations.
*/
void
mono_gc_toggleref_register_callback (MonoToggleRefStatus (*proccess_toggleref) (MonoObject *obj))
-/*
- *
- * sgen-toggleref.h: toggleref support for sgen
+/**
+ * \file
+ * toggleref support for sgen
*
* Copyright 2011 Xamarin, Inc.
*
-/*
- * sre-encode.c: Routines for encoding SRE builders into a
- * MonoDynamicImage and generating tokens.
+/**
+ * \file
+ * Routines for encoding SRE builders into a
+ * MonoDynamicImage and generating tokens.
*
*
* Author:
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * sre-save.c: Routine for saving an image to a file.
+/**
+ * \file
+ * Routine for saving an image to a file.
*
*
* Author:
-/*
- * sre.c: Routines for creating an image at runtime
- * and related System.Reflection.Emit icalls
+/**
+ * \file
+ * Routines for creating an image at runtime
+ * and related System.Reflection.Emit icalls
*
*
* Author:
/**
* mono_reflection_get_custom_attrs_blob:
- * @ctor: custom attribute constructor
- * @ctorArgs: arguments o the constructor
- * @properties:
- * @propValues:
- * @fields:
- * @fieldValues:
- *
+ * \param ctor custom attribute constructor
+ * \param ctorArgs arguments o the constructor
+ * \param properties
+ * \param propValues
+ * \param fields
+ * \param fieldValues
* Creates the blob of data that needs to be saved in the metadata and that represents
- * the custom attributed described by @ctor, @ctorArgs etc.
- * Returns: a Byte array representing the blob of data.
+ * the custom attributed described by \p ctor, \p ctorArgs etc.
+ * \returns a \c Byte array representing the blob of data.
*/
MonoArray*
mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues)
/**
* mono_reflection_get_custom_attrs_blob_checked:
- * @ctor: custom attribute constructor
- * @ctorArgs: arguments o the constructor
- * @properties:
- * @propValues:
- * @fields:
- * @fieldValues:
- * @error: set on error
- *
+ * \param ctor custom attribute constructor
+ * \param ctorArgs arguments o the constructor
+ * \param properties
+ * \param propValues
+ * \param fields
+ * \param fieldValues
+ * \param error set on error
* Creates the blob of data that needs to be saved in the metadata and that represents
- * the custom attributed described by @ctor, @ctorArgs etc.
- * Returns: a Byte array representing the blob of data. On failure returns NULL and sets @error.
+ * the custom attributed described by \p ctor, \p ctorArgs etc.
+ * \returns a \c Byte array representing the blob of data. On failure returns NULL and sets \p error.
*/
MonoArray*
mono_reflection_get_custom_attrs_blob_checked (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues, MonoError *error)
-/*
- * string-icalls.c: String internal calls for the corlib
+/**
+ * \file
+ * String internal calls for the corlib
*
* Author:
* Patrik Torstensson (patrik.torstensson@labs2.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_CLI_STRING_ICALLS_H_
#define _MONO_CLI_STRING_ICALLS_H_
-/*
- * sysmath.c: these are based on bob smith's csharp routines
+/**
+ * \file
+ * these are based on bob smith's csharp routines
*
* Author:
* Mono Project (http://www.mono-project.com)
-/*
- * math.h
+/**
+ * \file
*
* Author:
* Dan Lewis (dihlewis@yahoo.co.uk)
-/*
- * tabledefs.h: This file contains the various definitions for constants
+/**
+ * \file
+ * This file contains the various definitions for constants
* found on the metadata tables
*
* Author:
+/**
+ * \file
+ */
#if defined(HAVE_EPOLL)
+/**
+ * \file
+ */
#if defined(HAVE_KQUEUE)
+/**
+ * \file
+ */
#include "utils/mono-poll.h"
-/*
- * threadpool-io.c: Microsoft IO threadpool runtime support
+/**
+ * \file
+ * Microsoft IO threadpool runtime support
*
* Author:
* Ludovic Henry (ludovic.henry@xamarin.com)
MonoError error;
MonoGHashTable *states;
- io_selector_running = TRUE;
-
if (mono_runtime_is_shutting_down ()) {
io_selector_running = FALSE;
return 0;
mono_g_hash_table_destroy (states);
+ mono_coop_mutex_lock (&threadpool_io->updates_lock);
+
io_selector_running = FALSE;
+ mono_coop_cond_broadcast (&threadpool_io->updates_cond);
+
+ mono_coop_mutex_unlock (&threadpool_io->updates_lock);
return 0;
}
if (!threadpool_io->backend.init (threadpool_io->wakeup_pipes [0]))
g_error ("initialize: backend->init () failed");
+ mono_coop_mutex_lock (&threadpool_io->updates_lock);
+
+ io_selector_running = TRUE;
+
MonoError error;
if (!mono_thread_create_internal (mono_get_root_domain (), selector_thread, NULL, MONO_THREAD_CREATE_FLAGS_THREADPOOL | MONO_THREAD_CREATE_FLAGS_SMALL_STACK, &error))
g_error ("initialize: mono_thread_create_internal () failed due to %s", mono_error_get_message (&error));
+
+ mono_coop_mutex_unlock (&threadpool_io->updates_lock);
}
static void
mono_coop_mutex_lock (&threadpool_io->updates_lock);
+ if (!io_selector_running) {
+ mono_coop_mutex_unlock (&threadpool_io->updates_lock);
+ return;
+ }
+
update = update_get_new ();
update->type = UPDATE_ADD;
update->data.add.fd = GPOINTER_TO_INT (handle);
mono_coop_mutex_lock (&threadpool_io->updates_lock);
+ if (!io_selector_running) {
+ mono_coop_mutex_unlock (&threadpool_io->updates_lock);
+ return;
+ }
+
update = update_get_new ();
update->type = UPDATE_REMOVE_SOCKET;
update->data.add.fd = fd;
mono_coop_mutex_lock (&threadpool_io->updates_lock);
+ if (!io_selector_running) {
+ mono_coop_mutex_unlock (&threadpool_io->updates_lock);
+ return;
+ }
+
update = update_get_new ();
update->type = UPDATE_REMOVE_DOMAIN;
update->data.remove_domain.domain = domain;
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_THREADPOOL_IO_H_
#define _MONO_METADATA_THREADPOOL_IO_H_
-/*
- * threadpool-worker.c: native threadpool worker
+/**
+ * \file
+ * native threadpool worker
*
* Author:
* Ludovic Henry (ludovic.henry@xamarin.com)
gdouble accumulated_sample_duration;
} ThreadPoolHillClimbing;
-typedef struct {
- MonoThreadPoolWorkerCallback callback;
- gpointer data;
-} ThreadPoolWorkItem;
-
typedef union {
struct {
gint16 max_working; /* determined by heuristic */
typedef struct {
MonoRefCount ref;
+ MonoThreadPoolWorkerCallback callback;
+
ThreadPoolWorkerCounter counters;
MonoCoopMutex parked_threads_lock;
gint32 parked_threads_count;
MonoCoopCond parked_threads_cond;
- ThreadPoolWorkItem *work_items; // ThreadPoolWorkItem []
- gint32 work_items_count;
- gint32 work_items_size;
- MonoCoopMutex work_items_lock;
+ volatile gint32 work_items_count;
guint32 worker_creation_current_second;
guint32 worker_creation_current_count;
mono_coop_mutex_destroy (&worker.parked_threads_lock);
mono_coop_cond_destroy (&worker.parked_threads_cond);
- mono_coop_mutex_destroy (&worker.work_items_lock);
-
mono_coop_mutex_destroy (&worker.worker_creation_lock);
mono_coop_mutex_destroy (&worker.heuristic_lock);
}
void
-mono_threadpool_worker_init (void)
+mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback)
{
ThreadPoolHillClimbing *hc;
const char *threads_per_cpu_env;
mono_refcount_init (&worker, destroy);
+ worker.callback = callback;
+
mono_coop_mutex_init (&worker.parked_threads_lock);
worker.parked_threads_count = 0;
mono_coop_cond_init (&worker.parked_threads_cond);
- /* worker.work_items_size is inited to 0 */
- mono_coop_mutex_init (&worker.work_items_lock);
-
worker.worker_creation_current_second = -1;
mono_coop_mutex_init (&worker.worker_creation_lock);
}
static void
-work_item_lock (void)
-{
- mono_coop_mutex_lock (&worker.work_items_lock);
-}
-
-static void
-work_item_unlock (void)
+work_item_push (void)
{
- mono_coop_mutex_unlock (&worker.work_items_lock);
-}
-
-static void
-work_item_push (MonoThreadPoolWorkerCallback callback, gpointer data)
-{
- ThreadPoolWorkItem work_item;
-
- g_assert (callback);
-
- work_item.callback = callback;
- work_item.data = data;
+ gint32 old, new;
- work_item_lock ();
-
- g_assert (worker.work_items_count <= worker.work_items_size);
-
- if (G_UNLIKELY (worker.work_items_count == worker.work_items_size)) {
- worker.work_items_size += 64;
- worker.work_items = g_renew (ThreadPoolWorkItem, worker.work_items, worker.work_items_size);
- }
-
- g_assert (worker.work_items);
-
- worker.work_items [worker.work_items_count ++] = work_item;
-
- // printf ("[push] worker.work_items = %p, worker.work_items_count = %d, worker.work_items_size = %d\n",
- // worker.work_items, worker.work_items_count, worker.work_items_size);
+ do {
+ old = InterlockedRead (&worker.work_items_count);
+ g_assert (old >= 0);
- work_item_unlock ();
+ new = old + 1;
+ } while (InterlockedCompareExchange (&worker.work_items_count, new, old) != old);
}
static gboolean
-work_item_try_pop (ThreadPoolWorkItem *work_item)
+work_item_try_pop (void)
{
- g_assert (work_item);
-
- work_item_lock ();
-
- // printf ("[pop] worker.work_items = %p, worker.work_items_count = %d, worker.work_items_size = %d\n",
- // worker.work_items, worker.work_items_count, worker.work_items_size);
+ gint32 old, new;
- if (worker.work_items_count == 0) {
- work_item_unlock ();
- return FALSE;
- }
-
- *work_item = worker.work_items [-- worker.work_items_count];
+ do {
+ old = InterlockedRead (&worker.work_items_count);
+ g_assert (old >= 0);
- if (G_UNLIKELY (worker.work_items_count >= 64 * 3 && worker.work_items_count < worker.work_items_size / 2)) {
- worker.work_items_size -= 64;
- worker.work_items = g_renew (ThreadPoolWorkItem, worker.work_items, worker.work_items_size);
- }
+ if (old == 0)
+ return FALSE;
- work_item_unlock ();
+ new = old - 1;
+ } while (InterlockedCompareExchange (&worker.work_items_count, new, old) != old);
return TRUE;
}
static gint32
work_item_count (void)
{
- gint32 count;
-
- work_item_lock ();
- count = worker.work_items_count;
- work_item_unlock ();
-
- return count;
+ return InterlockedRead (&worker.work_items_count);
}
static void worker_request (void);
void
-mono_threadpool_worker_enqueue (MonoThreadPoolWorkerCallback callback, gpointer data)
+mono_threadpool_worker_request (void)
{
if (!mono_refcount_tryinc (&worker))
return;
- work_item_push (callback, data);
+ work_item_push ();
worker_request ();
g_assert (thread);
while (!mono_runtime_is_shutting_down ()) {
- ThreadPoolWorkItem work_item;
-
if (mono_thread_interruption_checkpoint ())
continue;
- if (!work_item_try_pop (&work_item)) {
+ if (!work_item_try_pop ()) {
gboolean timeout;
timeout = worker_park ();
continue;
}
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker executing %p (%p)",
- mono_native_thread_id_get (), work_item.callback, work_item.data);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker executing",
+ mono_native_thread_id_get ());
- work_item.callback (work_item.data);
+ worker.callback ();
}
COUNTER_ATOMIC (counter, {
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_THREADPOOL_WORKER_H
#define _MONO_METADATA_THREADPOOL_WORKER_H
#include <glib.h>
-typedef void (*MonoThreadPoolWorkerCallback)(gpointer);
+typedef void (*MonoThreadPoolWorkerCallback)(void);
void
-mono_threadpool_worker_init (void);
+mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback);
void
mono_threadpool_worker_cleanup (void);
void
-mono_threadpool_worker_enqueue (MonoThreadPoolWorkerCallback callback, gpointer data);
+mono_threadpool_worker_request (void);
gboolean
mono_threadpool_worker_notify_completed (void);
-/*
- * threadpool.c: Microsoft threadpool runtime support
+/**
+ * \file
+ * Microsoft threadpool runtime support
*
* Author:
* Ludovic Henry (ludovic.henry@xamarin.com)
mono_coop_mutex_destroy (&threadpool.domains_lock);
}
+static void
+worker_callback (void);
+
static void
initialize (void)
{
threadpool.limit_io_min = mono_cpu_count ();
threadpool.limit_io_max = CLAMP (threadpool.limit_io_min * 100, MIN (threadpool.limit_io_min, 200), MAX (threadpool.limit_io_min, 200));
- mono_threadpool_worker_init ();
+ mono_threadpool_worker_init (worker_callback);
}
static void
}
static void
-worker_callback (gpointer unused)
+worker_callback (void)
{
MonoError error;
ThreadPoolDomain *tpdomain, *previous_tpdomain;
counter._.starting ++;
});
- mono_threadpool_worker_enqueue (worker_callback, NULL);
+ mono_threadpool_worker_request ();
mono_refcount_dec (&threadpool);
return TRUE;
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_THREADPOOL_H_
#define _MONO_METADATA_THREADPOOL_H_
-/*
- * threads-types.h: Generic thread typedef support (includes
- * system-specific files)
+/**
+ * \file
+ * Generic thread typedef support (includes system-specific files)
*
* Author:
* Dick Porter (dick@ximian.com)
void* mono_get_special_static_data (uint32_t offset);
gpointer mono_get_special_static_data_for_thread (MonoInternalThread *thread, guint32 offset);
-MonoException* mono_thread_resume_interruption (void);
+MonoException* mono_thread_resume_interruption (gboolean exec);
void mono_threads_perform_thread_dump (void);
gboolean
void mono_threads_begin_abort_protected_block (void);
gboolean mono_threads_end_abort_protected_block (void);
-MonoException* mono_thread_try_resume_interruption (void);
gboolean
mono_thread_internal_current_is_attached (void);
-/*
- * threads.c: Thread support internal calls
+/**
+ * \file
+ * Thread support internal calls
*
* Author:
* Dick Porter (dick@ximian.com)
return InterlockedIncrement (&managed_thread_id_counter);
}
+/*
+ * We separate interruptions/exceptions into either sync (they can be processed anytime,
+ * normally as soon as they are set, and are set by the same thread) and async (they can't
+ * be processed inside abort protected blocks and are normally set by other threads). We
+ * can have both a pending sync and async interruption. In this case, the sync exception is
+ * processed first. Since we clean sync flag first, mono_thread_execute_interruption must
+ * also handle all sync type exceptions before the async type exceptions.
+ */
enum {
- INTERRUPT_REQUESTED_BIT = 0x1,
- INTERRUPT_REQUEST_DEFERRED_BIT = 0x2,
+ INTERRUPT_SYNC_REQUESTED_BIT = 0x1,
+ INTERRUPT_ASYNC_REQUESTED_BIT = 0x2,
+ INTERRUPT_REQUESTED_MASK = 0x3,
ABORT_PROT_BLOCK_SHIFT = 2,
ABORT_PROT_BLOCK_BITS = 8,
ABORT_PROT_BLOCK_MASK = (((1 << ABORT_PROT_BLOCK_BITS) - 1) << ABORT_PROT_BLOCK_SHIFT)
return (state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT;
}
-static void
-verify_thread_state (gsize state)
-{
- //can't have both INTERRUPT_REQUESTED_BIT and INTERRUPT_REQUEST_DEFERRED_BIT set at the same time
- g_assert ((state & (INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT)) != (INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT));
-
- //XXX This would be nice to be true, but can happen due to self-aborts (and possibly set-pending-exception)
- //if prot_count > 0, INTERRUPT_REQUESTED_BIT must never be set
- // int prot_count = (state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT;
- // g_assert (!(prot_count > 0 && (state & INTERRUPT_REQUESTED_BIT)));
-}
-
void
mono_threads_begin_abort_protected_block (void)
{
MonoInternalThread *thread = mono_thread_internal_current ();
gsize old_state, new_state;
+ int new_val;
do {
old_state = thread->thread_state;
- verify_thread_state (old_state);
-
- int new_val = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT) + 1;
-
- new_state = 0;
- if (old_state & (INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT)) {
- if (old_state & INTERRUPT_REQUESTED_BIT)
- printf ("begin prot happy as it demoted interrupt to deferred interrupt\n");
- new_state |= INTERRUPT_REQUEST_DEFERRED_BIT;
- }
+ new_val = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT) + 1;
//bounds check abort_prot_count
g_assert (new_val > 0);
g_assert (new_val < (1 << ABORT_PROT_BLOCK_BITS));
- new_state |= new_val << ABORT_PROT_BLOCK_SHIFT;
+ new_state = old_state + (1 << ABORT_PROT_BLOCK_SHIFT);
} while (InterlockedCompareExchangePointer ((volatile gpointer)&thread->thread_state, (gpointer)new_state, (gpointer)old_state) != (gpointer)old_state);
+
+ /* Defer async request since we won't be able to process until exiting the block */
+ if (new_val == 1 && (new_state & INTERRUPT_ASYNC_REQUESTED_BIT)) {
+ InterlockedDecrement (&thread_interruption_requested);
+ THREADS_INTERRUPT_DEBUG ("[%d] begin abort protected block old_state %ld new_state %ld, defer tir %d\n", thread->small_id, old_state, new_state, thread_interruption_requested);
+ if (thread_interruption_requested < 0)
+ g_warning ("bad thread_interruption_requested state");
+ } else {
+ THREADS_INTERRUPT_DEBUG ("[%d] begin abort protected block old_state %ld new_state %ld, tir %d\n", thread->small_id, old_state, new_state, thread_interruption_requested);
+ }
}
-gboolean
-mono_threads_end_abort_protected_block (void)
+static gboolean
+mono_thread_state_has_interruption (gsize state)
{
- MonoInternalThread *thread = mono_thread_internal_current ();
- gsize old_state, new_state;
- do {
- old_state = thread->thread_state;
- verify_thread_state (old_state);
-
- int new_val = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT) - 1;
- new_state = 0;
-
- if ((old_state & INTERRUPT_REQUEST_DEFERRED_BIT) && new_val == 0) {
- printf ("end abort on alert, promoted deferred to pront interrupt\n");
- new_state |= INTERRUPT_REQUESTED_BIT;
- }
+ /* pending exception, self abort */
+ if (state & INTERRUPT_SYNC_REQUESTED_BIT)
+ return TRUE;
- //bounds check abort_prot_count
- g_assert (new_val >= 0);
- g_assert (new_val < (1 << ABORT_PROT_BLOCK_BITS));
- new_state |= new_val << ABORT_PROT_BLOCK_SHIFT;
+ /* abort, interruption, suspend */
+ if ((state & INTERRUPT_ASYNC_REQUESTED_BIT) && !(state & ABORT_PROT_BLOCK_MASK))
+ return TRUE;
- } while (InterlockedCompareExchangePointer ((volatile gpointer)&thread->thread_state, (gpointer)new_state, (gpointer)old_state) != (gpointer)old_state);
- return (new_state & INTERRUPT_REQUESTED_BIT) == INTERRUPT_REQUESTED_BIT;
+ return FALSE;
}
-
-//Don't use this function, use inc/dec below
-static void
-mono_thread_abort_prot_block_count_add (MonoInternalThread *thread, int val)
+gboolean
+mono_threads_end_abort_protected_block (void)
{
+ MonoInternalThread *thread = mono_thread_internal_current ();
gsize old_state, new_state;
+ int new_val;
do {
old_state = thread->thread_state;
- verify_thread_state (old_state);
- int new_val = val + ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT);
//bounds check abort_prot_count
+ new_val = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT) - 1;
g_assert (new_val >= 0);
g_assert (new_val < (1 << ABORT_PROT_BLOCK_BITS));
- new_state = (old_state & ~ABORT_PROT_BLOCK_MASK) | (new_val << ABORT_PROT_BLOCK_SHIFT);
+ new_state = old_state - (1 << ABORT_PROT_BLOCK_SHIFT);
} while (InterlockedCompareExchangePointer ((volatile gpointer)&thread->thread_state, (gpointer)new_state, (gpointer)old_state) != (gpointer)old_state);
-}
-static void
-mono_thread_inc_abort_prot_block_count (MonoInternalThread *thread)
-{
- mono_thread_abort_prot_block_count_add (thread, 1);
-}
+ if (new_val == 0 && (new_state & INTERRUPT_ASYNC_REQUESTED_BIT)) {
+ InterlockedIncrement (&thread_interruption_requested);
+ THREADS_INTERRUPT_DEBUG ("[%d] end abort protected block old_state %ld new_state %ld, restore tir %d\n", thread->small_id, old_state, new_state, thread_interruption_requested);
+ } else {
+ THREADS_INTERRUPT_DEBUG ("[%d] end abort protected block old_state %ld new_state %ld, tir %d\n", thread->small_id, old_state, new_state, thread_interruption_requested);
+ }
-static void
-mono_thread_dec_abort_prot_block_count (MonoInternalThread *thread)
-{
- mono_thread_abort_prot_block_count_add (thread, -1);
+ return mono_thread_state_has_interruption (new_state);
}
static gboolean
mono_thread_get_interruption_requested (MonoInternalThread *thread)
{
gsize state = thread->thread_state;
- return (state & INTERRUPT_REQUESTED_BIT) == INTERRUPT_REQUESTED_BIT;
+
+ return mono_thread_state_has_interruption (state);
}
-/* Returns TRUE is there was a state change */
+/*
+ * Returns TRUE is there was a state change
+ * We clear a single interruption request, sync has priority.
+ */
static gboolean
mono_thread_clear_interruption_requested (MonoInternalThread *thread)
{
gsize old_state, new_state;
do {
old_state = thread->thread_state;
- verify_thread_state (old_state);
- //Already cleared
- if (!(old_state & (INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT)))
+ // no interruption to process
+ if (!(old_state & INTERRUPT_SYNC_REQUESTED_BIT) &&
+ (!(old_state & INTERRUPT_ASYNC_REQUESTED_BIT) || (old_state & ABORT_PROT_BLOCK_MASK)))
return FALSE;
- new_state = old_state & ~(INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT);
+
+ if (old_state & INTERRUPT_SYNC_REQUESTED_BIT)
+ new_state = old_state & ~INTERRUPT_SYNC_REQUESTED_BIT;
+ else
+ new_state = old_state & ~INTERRUPT_ASYNC_REQUESTED_BIT;
} while (InterlockedCompareExchangePointer ((volatile gpointer)&thread->thread_state, (gpointer)new_state, (gpointer)old_state) != (gpointer)old_state);
+
+ InterlockedDecrement (&thread_interruption_requested);
+ THREADS_INTERRUPT_DEBUG ("[%d] clear interruption old_state %ld new_state %ld, tir %d\n", thread->small_id, old_state, new_state, thread_interruption_requested);
+ if (thread_interruption_requested < 0)
+ g_warning ("bad thread_interruption_requested state");
return TRUE;
}
-/* Returns TRUE is there was a state change */
+/* Returns TRUE is there was a state change and the interruption can be processed */
static gboolean
mono_thread_set_interruption_requested (MonoInternalThread *thread)
{
//always force when the current thread is doing it to itself.
- gboolean force_interrupt = thread == mono_thread_internal_current ();
+ gboolean sync = thread == mono_thread_internal_current ();
gsize old_state, new_state;
do {
old_state = thread->thread_state;
- verify_thread_state (old_state);
- int prot_count = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT);
//Already set
- if (old_state & (INTERRUPT_REQUESTED_BIT | INTERRUPT_REQUEST_DEFERRED_BIT))
+ if ((sync && (old_state & INTERRUPT_SYNC_REQUESTED_BIT)) ||
+ (!sync && (old_state & INTERRUPT_ASYNC_REQUESTED_BIT)))
return FALSE;
- //If there's an outstanding prot block, we queue it
- if (prot_count && !force_interrupt) {
- printf ("set interrupt unhappy, as it's only putting a deferred req %d\n", force_interrupt);
- new_state = old_state | INTERRUPT_REQUEST_DEFERRED_BIT;
- } else
- new_state = old_state | INTERRUPT_REQUESTED_BIT;
+ if (sync)
+ new_state = old_state | INTERRUPT_SYNC_REQUESTED_BIT;
+ else
+ new_state = old_state | INTERRUPT_ASYNC_REQUESTED_BIT;
} while (InterlockedCompareExchangePointer ((volatile gpointer)&thread->thread_state, (gpointer)new_state, (gpointer)old_state) != (gpointer)old_state);
- return (new_state & INTERRUPT_REQUESTED_BIT) == INTERRUPT_REQUESTED_BIT;
+ if (sync || !(new_state & ABORT_PROT_BLOCK_MASK)) {
+ InterlockedIncrement (&thread_interruption_requested);
+ THREADS_INTERRUPT_DEBUG ("[%d] set interruption on [%d] old_state %ld new_state %ld, tir %d\n", mono_thread_internal_current ()->small_id, thread->small_id, old_state, new_state, thread_interruption_requested);
+ } else {
+ THREADS_INTERRUPT_DEBUG ("[%d] set interruption on [%d] old_state %ld new_state %ld, tir deferred %d\n", mono_thread_internal_current ()->small_id, thread->small_id, old_state, new_state, thread_interruption_requested);
+ }
+
+ return sync || !(new_state & ABORT_PROT_BLOCK_MASK);
}
static inline MonoNativeThreadId
return ret;
}
-void mono_thread_new_init (intptr_t tid, gpointer stack_start, gpointer func)
+/**
+ * mono_thread_new_init:
+ */
+void
+mono_thread_new_init (intptr_t tid, gpointer stack_start, gpointer func)
{
if (mono_thread_start_cb) {
mono_thread_start_cb (tid, stack_start, func);
}
}
-void mono_threads_set_default_stacksize (guint32 stacksize)
+/**
+ * mono_threads_set_default_stacksize:
+ */
+void
+mono_threads_set_default_stacksize (guint32 stacksize)
{
default_stacksize = stacksize;
}
-guint32 mono_threads_get_default_stacksize (void)
+/**
+ * mono_threads_get_default_stacksize:
+ */
+guint32
+mono_threads_get_default_stacksize (void)
{
return default_stacksize;
}
return internal;
}
+/**
+ * mono_thread_create:
+ */
void
mono_thread_create (MonoDomain *domain, gpointer func, gpointer arg)
{
return (NULL != mono_thread_create_internal (domain, func, arg, MONO_THREAD_CREATE_FLAGS_NONE, error));
}
+/**
+ * mono_thread_attach:
+ */
MonoThread *
mono_thread_attach (MonoDomain *domain)
{
Leaving the counter unbalanced will cause a performance degradation since all threads
will now keep checking their local flags all the time.
*/
- if (mono_thread_clear_interruption_requested (thread))
- InterlockedDecrement (&thread_interruption_requested);
+ mono_thread_clear_interruption_requested (thread);
mono_threads_lock ();
*/
}
+/**
+ * mono_thread_detach:
+ */
void
mono_thread_detach (MonoThread *thread)
{
mono_thread_detach_internal (thread->internal_thread);
}
-/*
+/**
* mono_thread_detach_if_exiting:
*
- * Detach the current thread from the runtime if it is exiting, i.e. it is running pthread dtors.
+ * Detach the current thread from the runtime if it is exiting, i.e. it is running pthread dtors.
* This should be used at the end of embedding code which calls into managed code, and which
- * can be called from pthread dtors, like dealloc: implementations in objective-c.
+ * can be called from pthread dtors, like <code>dealloc:</code> implementations in Objective-C.
*/
mono_bool
mono_thread_detach_if_exiting (void)
return TRUE;
}
+/**
+ * mono_thread_exit:
+ */
void
mono_thread_exit (void)
{
return res;
}
-/*
+/**
* mono_thread_get_name_utf8:
- *
- * Return the name of the thread in UTF-8.
+ * \returns the name of the thread in UTF-8.
* Return NULL if the thread has no name.
* The returned memory is owned by the caller.
*/
return tname;
}
-/*
+/**
* mono_thread_get_managed_id:
- *
- * Return the Thread.ManagedThreadId value of `thread`.
- * Returns -1 if `thread` is NULL.
+ * \returns the \c Thread.ManagedThreadId value of \p thread.
+ * Returns \c -1 if \p thread is NULL.
*/
int32_t
mono_thread_get_managed_id (MonoThread *thread)
return result;
}
+/**
+ * mono_thread_current:
+ */
MonoThread *
mono_thread_current (void)
{
/**
* mono_thread_current_check_pending_interrupt:
- *
* Checks if there's a interruption request and set the pending exception if so.
- *
- * @returns true if a pending exception was set
+ * \returns true if a pending exception was set
*/
gboolean
mono_thread_current_check_pending_interrupt (void)
/**
* mono_thread_internal_abort:
- *
- * Request thread @thread to be aborted.
- *
- * @thread MUST NOT be the current thread.
+ * Request thread \p thread to be aborted.
+ * \p thread MUST NOT be the current thread.
*/
void
mono_thread_internal_abort (MonoInternalThread *thread)
return found;
}
+/**
+ * mono_thread_stop:
+ */
void
mono_thread_stop (MonoThread *thread)
{
mono_thread_attach_cb = attach_cb;
}
-void mono_thread_cleanup (void)
+/**
+ * mono_thread_cleanup:
+ */
+void
+mono_thread_cleanup (void)
{
#if !defined(RUN_IN_SUBTHREAD) && !defined(HOST_WIN32)
/* The main thread must abandon any held mutexes (particularly
mono_thread_cleanup_fn = func;
}
+/**
+ * mono_thread_set_manage_callback:
+ */
void
mono_thread_set_manage_callback (MonoThread *thread, MonoThreadManageCallback func)
{
}
}
-void mono_thread_manage (void)
+/**
+ * mono_thread_manage:
+ */
+void
+mono_thread_manage (void)
{
struct wait_data wait_data;
struct wait_data *wait = &wait_data;
#ifdef HOST_WIN32
WaitForSingleObjectEx (GetCurrentThread(), 0, TRUE);
#endif
- InterlockedDecrement (&thread_interruption_requested);
-
/* Clear the interrupted flag of the thread so it can wait again */
mono_thread_info_clear_self_interrupt ();
}
if (!mono_thread_set_interruption_requested (thread))
return NULL;
- InterlockedIncrement (&thread_interruption_requested);
if (!running_managed || is_running_protected_wrapper ()) {
/* Can't stop while in unmanaged code. Increase the global interruption
/*This function should be called by a thread after it has exited all of
* its handle blocks at interruption time.*/
MonoException*
-mono_thread_resume_interruption (void)
+mono_thread_resume_interruption (gboolean exec)
{
MonoInternalThread *thread = mono_thread_internal_current ();
gboolean still_aborting;
/*This can happen if the protected block called Thread::ResetAbort*/
if (!still_aborting)
- return FALSE;
+ return NULL;
if (!mono_thread_set_interruption_requested (thread))
return NULL;
- InterlockedIncrement (&thread_interruption_requested);
mono_thread_info_self_interrupt ();
- return mono_thread_execute_interruption ();
+ if (exec)
+ return mono_thread_execute_interruption ();
+ else
+ return NULL;
}
gboolean mono_thread_interruption_requested ()
/**
* mono_thread_test_and_set_state:
- *
- * Test if current state of @thread include @test. If it does not, OR @set into the state.
- *
- * Returns TRUE is @set was OR'd in.
+ * Test if current state of \p thread include \p test. If it does not, OR \p set into the state.
+ * \returns TRUE if \p set was OR'd in.
*/
gboolean
mono_thread_test_and_set_state (MonoInternalThread *thread, MonoThreadState test, MonoThreadState set)
if (!mono_thread_set_interruption_requested (thread))
return MonoResumeThread;
- InterlockedIncrement (&thread_interruption_requested);
-
ji = mono_thread_info_get_last_managed (info);
protected_wrapper = ji && !ji->is_trampoline && !ji->async && mono_threads_is_critical_method (mono_jit_info_get_method (ji));
running_managed = mono_jit_info_match (ji, MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx));
return KeepSuspended;
}
} else {
- if (mono_thread_set_interruption_requested (thread))
- InterlockedIncrement (&thread_interruption_requested);
+ mono_thread_set_interruption_requested (thread);
if (data->interrupt)
data->interrupt_token = mono_thread_info_prepare_interrupt ((MonoThreadInfo *)thread->thread_info);
mono_thread_info_safe_suspend_and_run (thread_get_tid (thread), FALSE, suspend_for_shutdown_critical, NULL);
}
-/*
+/**
* mono_thread_is_foreign:
- * @thread: the thread to query
+ * \param thread the thread to query
*
* This function allows one to determine if a thread was created by the mono runtime and has
- * a well defined lifecycle or it's a foreigh one, created by the native environment.
+ * a well defined lifecycle or it's a foreign one, created by the native environment.
*
- * Returns: TRUE if @thread was not created by the runtime.
+ * \returns TRUE if \p thread was not created by the runtime.
*/
mono_bool
mono_thread_is_foreign (MonoThread *thread)
}
}
-MonoException*
-mono_thread_try_resume_interruption (void)
-{
- MonoInternalThread *thread;
-
- thread = mono_thread_internal_current ();
- if (!mono_get_eh_callbacks ()->mono_above_abort_threshold ())
- return NULL;
- if (mono_thread_get_abort_prot_block_count (thread) > 0 || mono_get_eh_callbacks ()->mono_current_thread_has_handle_block_guard ())
- return NULL;
-
- return mono_thread_resume_interruption ();
-}
-
#if 0
/* Returns TRUE if the current thread is ready to be interrupted. */
gboolean
-/*
- * threads.h: Threading API
+/**
+ * \file
+ * Threading API
*
* Author:
* Dick Porter (dick@ximian.com)
+/**
+ * \file
+ */
+
#ifndef _MONO_METADATA_TOKENTYPE_H_
#define _MONO_METADATA_TOKENTYPE_H_
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_VERIFY_INTERNAL_H__
#define __MONO_METADATA_VERIFY_INTERNAL_H__
-/*
- * verify.c:
+/**
+ * \file
*
* Author:
* Mono Project (http://www.mono-project.com)
/**
* mono_generic_param_is_constraint_compatible:
*
- * Returns: TRUE if @candidate is constraint compatible with @target.
+ * \returns TRUE if \p candidate is constraint compatible with \p target.
*
- * This means that @candidate constraints are a super set of @target constaints
+ * This means that \p candidate constraints are a super set of \p target constaints
*/
static gboolean
mono_generic_param_is_constraint_compatible (VerifyContext *ctx, MonoGenericParam *target, MonoGenericParam *candidate, MonoClass *candidate_param_class, MonoGenericContext *context)
}
//////////////////////////////////////////////////////////////////
+
+/**
+ * mono_free_verify_list:
+ */
void
mono_free_verify_list (GSList *list)
{
/*
* FIXME: need to distinguish between valid and verifiable.
* Need to keep track of types on the stack.
+ */
+
+/**
+ * mono_method_verify:
* Verify types for opcodes.
*/
GSList*
/**
* mono_verifier_is_enabled_for_method:
- * @method: the method to probe
- *
- * Returns TRUE if @method needs to be verified.
- *
+ * \param method the method to probe
+ * \returns TRUE if \p method needs to be verified.
*/
gboolean
mono_verifier_is_enabled_for_method (MonoMethod *method)
/**
* mono_verifier_is_enabled_for_class:
- * @klass: The `MonoClass` to probe
- *
- * Returns TRUE if @klass need to be verified.
- *
+ * \param klass The \c MonoClass to probe
+ * \returns TRUE if \p klass need to be verified.
*/
gboolean
mono_verifier_is_enabled_for_class (MonoClass *klass)
+/**
+ * \file
+ */
+
#ifndef __MONO_METADATA_VERIFY_H__
#define __MONO_METADATA_VERIFY_H__
+/**
+ * \file
+ */
#include "w32error.h"
+/**
+ * \file
+ */
#include <windows.h>
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32ERROR_H_
#define _MONO_METADATA_W32ERROR_H_
-/*
- * w32event-unix.c: Runtime support for managed Event on Unix
+/**
+ * \file
+ * Runtime support for managed Event on Unix
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
-/*
- * w32event-win32.c: Runtime support for managed Event on Win32
+/**
+ * \file
+ * Runtime support for managed Event on Win32
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32EVENT_H_
#define _MONO_METADATA_W32EVENT_H_
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/* $OpenBSD: glob.c,v 1.26 2005/11/28 17:50:12 deraadt Exp $ */
-/*
+/**
+ * \file
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
/* $OpenBSD: glob.h,v 1.10 2005/12/13 00:35:22 millert Exp $ */
/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */
-/*
+/**
+ * \file
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
+/**
+ * \file
+ */
#include <config.h>
#include <glib.h>
get_errno_from_g_file_error (gint error)
{
switch (error) {
-#ifdef EACCESS
+#ifdef EACCES
case G_FILE_ERROR_ACCES: return EACCES;
#endif
#ifdef ENAMETOOLONG
#ifdef EINTR
case G_FILE_ERROR_INTR: return EINTR;
#endif
-#ifdef EWIO
+#ifdef EIO
case G_FILE_ERROR_IO: return EIO;
#endif
#ifdef EPERM
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * w32file-win32-uwp.c: UWP w32file support for Mono.
+/**
+ * \file
+ * UWP w32file support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * w32file-win32.c: Windows File IO internal calls.
+/**
+ * \file
+ * Windows File IO internal calls.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * w32file.c: File IO internal calls
+/**
+ * \file
+ * File IO internal calls
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
- * w32file.h: File IO internal calls
+/**
+ * \file
+ * File IO internal calls
*
* Authors:
* Dick Porter (dick@ximian.com)
-/*
- * w32handle-namespace.c: namespace for w32handles
+/**
+ * \file
+ * namespace for w32handles
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32HANDLE_NAMESPACE_H_
#define _MONO_METADATA_W32HANDLE_NAMESPACE_H_
gpointer
mono_w32handle_namespace_search_handle (MonoW32HandleType type, gchar *name);
-#endif /* _MONO_METADATA_W32HANDLE_NAMESPACE_H_ */
\ No newline at end of file
+#endif /* _MONO_METADATA_W32HANDLE_NAMESPACE_H_ */
-/*
- * w32handle.c: Generic and internal operations on handles
+/**
+ * \file
+ * Generic and internal operations on handles
*
* Author:
* Dick Porter (dick@ximian.com)
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32HANDLE_H_
#define _MONO_METADATA_W32HANDLE_H_
-/*
- * w32mutex-unix.c: Runtime support for managed Mutex on Unix
+/**
+ * \file
+ * Runtime support for managed Mutex on Unix
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
-/*
- * w32mutex-win32.c: Runtime support for managed Mutex on Win32
+/**
+ * \file
+ * Runtime support for managed Mutex on Win32
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32MUTEX_H_
#define _MONO_METADATA_W32MUTEX_H_
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32PROCESS_INTERNALS_H_
#define _MONO_METADATA_W32PROCESS_INTERNALS_H_
+/**
+ * \file
+ */
#include "w32process.h"
#include "w32process-unix-internals.h"
+/**
+ * \file
+ */
#include "w32process.h"
#include "w32process-unix-internals.h"
+/**
+ * \file
+ */
#include "w32process.h"
#include "w32process-unix-internals.h"
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
#define _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
+/**
+ * \file
+ */
#include "w32process.h"
#include "w32process-unix-internals.h"
-/*
- * process.c: System.Diagnostics.Process support
+/**
+ * \file
+ * System.Diagnostics.Process support
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
+/**
+ * \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * process-windows-uwp.c: UWP process support for Mono.
+/**
+ * \file
+ * UWP process support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * process.c: System.Diagnostics.Process support
+/**
+ * \file
+ * System.Diagnostics.Process support
*
* Author:
* Dick Porter (dick@ximian.com)
+/**
+ * \file
+ */
#include <glib.h>
-/*
- * w32process.h: System.Diagnostics.Process support
+/**
+ * \file
+ * System.Diagnostics.Process support
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
- * w32semaphore-unix.c: Runtime support for managed Semaphore on Unix
+/**
+ * \file
+ * Runtime support for managed Semaphore on Unix
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
-/*
- * w32semaphore-win32.c: Runtime support for managed Semaphore on Win32
+/**
+ * \file
+ * Runtime support for managed Semaphore on Win32
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
*error = GetLastError ();
return sem;
-}
\ No newline at end of file
+}
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_W32SEMAPHORE_H_
#define _MONO_METADATA_W32SEMAPHORE_H_
-/*
-* w32socket-internals.h
-*
-* Copyright 2016 Microsoft
-* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-*/
+/**
+ * \file
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
#ifndef __MONO_METADATA_W32SOCKET_INTERNALS_H__
#define __MONO_METADATA_W32SOCKET_INTERNALS_H__
-/*
- * w32socket-unix.c: Unix specific socket code.
+/**
+ * \file
+ * Unix specific socket code.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * w32socket-win32.c: Windows specific socket code.
+/**
+ * \file
+ * Windows specific socket code.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * socket-io.c: Socket IO internal calls
+/**
+ * \file
+ * Socket IO internal calls
*
* Authors:
* Dick Porter (dick@ximian.com)
#include <mono/metadata/object.h>
#include <mono/metadata/exception.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/w32file.h>
#include <mono/metadata/threads.h>
socket_assembly = mono_image_loaded ("System");
if (!socket_assembly) {
- MonoAssembly *sa = mono_assembly_open ("System.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("System.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa) {
g_assert_not_reached ();
if (mono_posix_image == NULL) {
mono_posix_image = mono_image_loaded ("Mono.Posix");
if (!mono_posix_image) {
- MonoAssembly *sa = mono_assembly_open ("Mono.Posix.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("Mono.Posix.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa) {
*werror = WSAENOPROTOOPT;
return;
-/*
- * w32socket.h: System.Net.Sockets.Socket support
+/**
+ * \file
+ * System.Net.Sockets.Socket support
*
* Author:
* Dick Porter (dick@ximian.com)
-/* NOTE NOTE NOTE
+/**
+ * \file
+ * NOTE NOTE NOTE
* No additional wrapper types should be added.
* If a new wrapper is asolutely necessary, an existing one needs
* to be removed first (with all the change that implies).
-/*
- * abcremoval.c: Array bounds check removal
+/**
+ * \file
+ * Array bounds check removal
*
* Author:
* Massimiliano Mantione (massi@ximian.com)
/**
* mono_perform_abc_removal:
- * @cfg: Control Flow Graph
+ * \param cfg Control Flow Graph
*
* Performs the ABC removal from a cfg in SSA form.
* It does the following:
-/*
- * abcremoval.h: Array bounds check removal
+/**
+ * \file
+ * Array bounds check removal
*
* Author:
* Massimiliano Mantione (massi@ximian.com)
-/*
- * alias-analysis.c: Implement simple alias analysis for local variables.
+/**
+ * \file
+ * Implement simple alias analysis for local variables.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * aot-compiler.c: mono Ahead of Time compiler
+/**
+ * \file
+ * mono Ahead of Time compiler
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
opts->write_symbols = TRUE;
} else if (str_begins_with (arg, "no-write-symbols")) {
opts->write_symbols = FALSE;
+ // Intentionally undocumented -- one-off experiment
} else if (str_begins_with (arg, "metadata-only")) {
opts->metadata_only = TRUE;
} else if (str_begins_with (arg, "bind-to-runtime-version")) {
opts->nodebug = TRUE;
} else if (str_begins_with (arg, "dwarfdebug")) {
opts->dwarf_debug = TRUE;
+ // Intentionally undocumented -- No one remembers what this does. It appears to be ARM-only
} else if (str_begins_with (arg, "nopagetrampolines")) {
opts->use_trampolines_page = FALSE;
} else if (str_begins_with (arg, "ntrampolines=")) {
opts->ld_flags = g_strdup (arg + strlen ("ld-flags="));
} else if (str_begins_with (arg, "soft-debug")) {
opts->soft_debug = TRUE;
+ // Intentionally undocumented x2-- deprecated
} else if (str_begins_with (arg, "gen-seq-points-file=")) {
fprintf (stderr, "Mono Warning: aot option gen-seq-points-file= is deprecated.\n");
} else if (str_begins_with (arg, "gen-seq-points-file")) {
opts->print_skipped_methods = TRUE;
} else if (str_begins_with (arg, "stats")) {
opts->stats = TRUE;
+ // Intentionally undocumented-- has no known function other than to debug the compiler
} else if (str_begins_with (arg, "no-instances")) {
opts->no_instances = TRUE;
+ // Intentionally undocumented x4-- Used for internal debugging of compiler
} else if (str_begins_with (arg, "log-generics")) {
opts->log_generics = TRUE;
} else if (str_begins_with (arg, "log-instances=")) {
} else if (str_begins_with (arg, "info")) {
printf ("AOT target setup: %s.\n", AOT_TARGET_STR);
exit (0);
+ // Intentionally undocumented: Used for precise stack maps, which are not available yet
} else if (str_begins_with (arg, "gc-maps")) {
mini_gc_enable_gc_maps_for_aot ();
+ // Intentionally undocumented: Used for internal debugging
} else if (str_begins_with (arg, "dump")) {
opts->dump_json = TRUE;
} else if (str_begins_with (arg, "llvmonly")) {
opts->verbose = TRUE;
} else if (str_begins_with (arg, "help") || str_begins_with (arg, "?")) {
printf ("Supported options for --aot:\n");
- printf (" outfile=\n");
- printf (" llvm-outfile=\n");
- printf (" llvm-path=\n");
- printf (" temp-path=\n");
- printf (" save-temps\n");
- printf (" keep-temps\n");
- printf (" write-symbols\n");
- printf (" metadata-only\n");
+ printf (" asmonly\n");
printf (" bind-to-runtime-version\n");
+ printf (" bitcode\n");
+ printf (" data-outfile=\n");
+ printf (" direct-icalls\n");
+ printf (" direct-pinvoke\n");
+ printf (" dwarfdebug\n");
printf (" full\n");
- printf (" threads=\n");
- printf (" static\n");
- printf (" asmonly\n");
- printf (" asmwriter\n");
+ printf (" hybrid\n");
+ printf (" info\n");
+ printf (" keep-temps\n");
+ printf (" llvm\n");
+ printf (" llvmonly\n");
+ printf (" llvm-outfile=\n");
+ printf (" llvm-path=\n");
+ printf (" msym-dir=\n");
+ printf (" mtriple\n");
+ printf (" nimt-trampolines=\n");
printf (" nodebug\n");
- printf (" dwarfdebug\n");
- printf (" ntrampolines=\n");
+ printf (" no-direct-calls\n");
+ printf (" no-write-symbols\n");
printf (" nrgctx-trampolines=\n");
- printf (" nimt-trampolines=\n");
+ printf (" nrgctx-fetch-trampolines=\n");
printf (" ngsharedvt-trampolines=\n");
- printf (" tool-prefix=\n");
+ printf (" ntrampolines=\n");
+ printf (" outfile=\n");
+ printf (" profile=\n");
+ printf (" profile-only\n");
+ printf (" print-skipped-methods\n");
printf (" readonly-value=\n");
+ printf (" save-temps\n");
printf (" soft-debug\n");
- printf (" msym-dir=\n");
- printf (" gc-maps\n");
- printf (" print-skipped\n");
- printf (" no-instances\n");
+ printf (" static\n");
printf (" stats\n");
- printf (" dump\n");
- printf (" info\n");
+ printf (" temp-path=\n");
+ printf (" tool-prefix=\n");
+ printf (" threads=\n");
+ printf (" write-symbols\n");
printf (" verbose\n");
printf (" help/?\n");
exit (0);
return TRUE;
}
-/*
- * mono_aot_get_mangled_method_name:
- *
- * Return a unique mangled name for METHOD, or NULL.
- */
-char*
-mono_aot_get_mangled_method_name (MonoMethod *method)
+static void
+append_mangled_wrapper_type (GString *s, guint32 wrapper_type)
{
- WrapperInfo *info;
- GString *s;
- gboolean supported;
+ const char *label;
- // FIXME: Add more cases
- if (method->wrapper_type != MONO_WRAPPER_UNKNOWN)
- return NULL;
- info = mono_marshal_get_wrapper_info (method);
- if (!(info && (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG || info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG)))
- return NULL;
+ switch (wrapper_type) {
+ case MONO_WRAPPER_REMOTING_INVOKE:
+ label = "remoting_invoke";
+ break;
+ case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK:
+ label = "remoting_invoke_check";
+ break;
+ case MONO_WRAPPER_XDOMAIN_INVOKE:
+ label = "remoting_invoke_xdomain";
+ break;
+ case MONO_WRAPPER_PROXY_ISINST:
+ label = "proxy_isinst";
+ break;
+ case MONO_WRAPPER_LDFLD:
+ label = "ldfld";
+ break;
+ case MONO_WRAPPER_LDFLDA:
+ label = "ldflda";
+ break;
+ case MONO_WRAPPER_STFLD:
+ label = "stfld";
+ break;
+ case MONO_WRAPPER_ALLOC:
+ label = "alloc";
+ break;
+ case MONO_WRAPPER_WRITE_BARRIER:
+ label = "write_barrier";
+ break;
+ case MONO_WRAPPER_STELEMREF:
+ label = "stelemref";
+ break;
+ case MONO_WRAPPER_UNKNOWN:
+ label = "unknown";
+ break;
+ case MONO_WRAPPER_MANAGED_TO_NATIVE:
+ label = "man2native";
+ break;
+ case MONO_WRAPPER_SYNCHRONIZED:
+ label = "synch";
+ break;
+ case MONO_WRAPPER_MANAGED_TO_MANAGED:
+ label = "man2man";
+ break;
+ case MONO_WRAPPER_CASTCLASS:
+ label = "castclass";
+ break;
+ case MONO_WRAPPER_RUNTIME_INVOKE:
+ label = "run_invoke";
+ break;
+ case MONO_WRAPPER_DELEGATE_INVOKE:
+ label = "del_inv";
+ break;
+ case MONO_WRAPPER_DELEGATE_BEGIN_INVOKE:
+ label = "del_beg_inv";
+ break;
+ case MONO_WRAPPER_DELEGATE_END_INVOKE:
+ label = "del_end_inv";
+ break;
+ case MONO_WRAPPER_NATIVE_TO_MANAGED:
+ label = "native2man";
+ break;
+ default:
+ g_assert_not_reached ();
+ }
- s = g_string_new ("");
+ g_string_append_printf (s, "%s_", label);
+}
- g_string_append_printf (s, "aot_method_w_");
+static void
+append_mangled_wrapper_subtype (GString *s, WrapperSubtype subtype)
+{
+ const char *label;
- switch (info->subtype) {
+ switch (subtype)
+ {
+ case WRAPPER_SUBTYPE_NONE:
+ return;
+ case WRAPPER_SUBTYPE_ELEMENT_ADDR:
+ label = "elem_addr";
+ break;
+ case WRAPPER_SUBTYPE_STRING_CTOR:
+ label = "str_ctor";
+ break;
+ case WRAPPER_SUBTYPE_VIRTUAL_STELEMREF:
+ label = "virt_stelem";
+ break;
+ case WRAPPER_SUBTYPE_FAST_MONITOR_ENTER:
+ label = "fast_mon_enter";
+ break;
+ case WRAPPER_SUBTYPE_FAST_MONITOR_ENTER_V4:
+ label = "fast_mon_enter_4";
+ break;
+ case WRAPPER_SUBTYPE_FAST_MONITOR_EXIT:
+ label = "fast_monitor_exit";
+ break;
+ case WRAPPER_SUBTYPE_PTR_TO_STRUCTURE:
+ label = "ptr2struct";
+ break;
+ case WRAPPER_SUBTYPE_STRUCTURE_TO_PTR:
+ label = "struct2ptr";
+ break;
+ case WRAPPER_SUBTYPE_CASTCLASS_WITH_CACHE:
+ label = "castclass_w_cache";
+ break;
+ case WRAPPER_SUBTYPE_ISINST_WITH_CACHE:
+ label = "isinst_w_cache";
+ break;
+ case WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL:
+ label = "run_inv_norm";
+ break;
+ case WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC:
+ label = "run_inv_dyn";
+ break;
+ case WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT:
+ label = "run_inv_dir";
+ break;
+ case WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL:
+ label = "run_inv_vir";
+ break;
+ case WRAPPER_SUBTYPE_ICALL_WRAPPER:
+ label = "icall";
+ break;
+ case WRAPPER_SUBTYPE_NATIVE_FUNC_AOT:
+ label = "native_func_aot";
+ break;
+ case WRAPPER_SUBTYPE_PINVOKE:
+ label = "pinvoke";
+ break;
+ case WRAPPER_SUBTYPE_SYNCHRONIZED_INNER:
+ label = "synch_inner";
+ break;
+ case WRAPPER_SUBTYPE_GSHAREDVT_IN:
+ label = "gshared_in";
+ break;
+ case WRAPPER_SUBTYPE_GSHAREDVT_OUT:
+ label = "gshared_out";
+ break;
+ case WRAPPER_SUBTYPE_ARRAY_ACCESSOR:
+ label = "array_acc";
+ break;
+ case WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER:
+ label = "generic_arry_help";
+ break;
+ case WRAPPER_SUBTYPE_DELEGATE_INVOKE_VIRTUAL:
+ label = "del_inv_virt";
+ break;
+ case WRAPPER_SUBTYPE_DELEGATE_INVOKE_BOUND:
+ label = "del_inv_bound";
+ break;
case WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG:
- g_string_append_printf (s, "gsharedvt_in_");
+ label = "gsharedvt_in_sig";
break;
case WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG:
- g_string_append_printf (s, "gsharedvt_out_");
+ label = "gsharedvt_out_sig";
break;
default:
g_assert_not_reached ();
+ }
+
+ g_string_append_printf (s, "%s_", label);
+}
+
+static char *
+sanitize_mangled_string (const char *input)
+{
+ GString *s = g_string_new ("");
+
+ for (int i=0; input [i] != '\0'; i++) {
+ char c = input [i];
+ switch (c) {
+ case '.':
+ g_string_append (s, "_dot_");
+ break;
+ case ' ':
+ g_string_append (s, "_");
+ break;
+ case '`':
+ g_string_append (s, "_bt_");
+ break;
+ case '<':
+ g_string_append (s, "_le_");
+ break;
+ case '>':
+ g_string_append (s, "_gt_");
+ break;
+ case '/':
+ g_string_append (s, "_sl_");
+ break;
+ case '[':
+ g_string_append (s, "_lbrack_");
+ break;
+ case ']':
+ g_string_append (s, "_rbrack_");
+ break;
+ case '(':
+ g_string_append (s, "_lparen_");
+ break;
+ case '-':
+ g_string_append (s, "_dash_");
+ break;
+ case ')':
+ g_string_append (s, "_rparen_");
+ break;
+ case ',':
+ g_string_append (s, "_comma_");
+ break;
+ default:
+ g_string_append_c (s, c);
+ }
+ }
+
+ return g_string_free (s, FALSE);
+}
+
+static gboolean
+append_mangled_klass (GString *s, MonoClass *klass)
+{
+ char *klass_desc = mono_class_full_name (klass);
+ g_string_append_printf (s, "_%s_%s_", klass->name_space, klass_desc);
+ g_free (klass_desc);
+
+ // Success
+ return TRUE;
+}
+
+static gboolean
+append_mangled_method (GString *s, MonoMethod *method);
+
+static gboolean
+append_mangled_wrapper (GString *s, MonoMethod *method)
+{
+ gboolean success = TRUE;
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+ g_string_append_printf (s, "wrapper_");
+
+ append_mangled_wrapper_type (s, method->wrapper_type);
+
+ switch (method->wrapper_type) {
+ case MONO_WRAPPER_REMOTING_INVOKE:
+ case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK:
+ case MONO_WRAPPER_XDOMAIN_INVOKE: {
+ MonoMethod *m = mono_marshal_method_from_wrapper (method);
+ g_assert (m);
+ success = success && append_mangled_method (s, m);
+ break;
+ }
+ case MONO_WRAPPER_PROXY_ISINST:
+ case MONO_WRAPPER_LDFLD:
+ case MONO_WRAPPER_LDFLDA:
+ case MONO_WRAPPER_STFLD: {
+ g_assert (info);
+ success = success && append_mangled_klass (s, info->d.proxy.klass);
+ break;
+ }
+ case MONO_WRAPPER_ALLOC: {
+ /* The GC name is saved once in MonoAotFileInfo */
+ g_assert (info->d.alloc.alloc_type != -1);
+ g_string_append_printf (s, "%d_", info->d.alloc.alloc_type);
+ // SlowAlloc, etc
+ g_string_append_printf (s, "%s_", method->name);
+ break;
+ }
+ case MONO_WRAPPER_WRITE_BARRIER: {
break;
}
+ case MONO_WRAPPER_STELEMREF: {
+ append_mangled_wrapper_subtype (s, info->subtype);
+ if (info->subtype == WRAPPER_SUBTYPE_VIRTUAL_STELEMREF)
+ g_string_append_printf (s, "%d", info->d.virtual_stelemref.kind);
+ break;
+ }
+ case MONO_WRAPPER_UNKNOWN: {
+ append_mangled_wrapper_subtype (s, info->subtype);
+ if (info->subtype == WRAPPER_SUBTYPE_PTR_TO_STRUCTURE ||
+ info->subtype == WRAPPER_SUBTYPE_STRUCTURE_TO_PTR)
+ success = success && append_mangled_klass (s, method->klass);
+ else if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER)
+ success = success && append_mangled_method (s, info->d.synchronized_inner.method);
+ else if (info->subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR)
+ success = success && append_mangled_method (s, info->d.array_accessor.method);
+ else if (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN_SIG)
+ append_mangled_signature (s, info->d.gsharedvt.sig);
+ else if (info->subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT_SIG)
+ append_mangled_signature (s, info->d.gsharedvt.sig);
+ break;
+ }
+ case MONO_WRAPPER_MANAGED_TO_NATIVE: {
+ append_mangled_wrapper_subtype (s, info->subtype);
+ if (info->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER) {
+ g_string_append_printf (s, "%s", method->name);
+ } else if (info->subtype == WRAPPER_SUBTYPE_NATIVE_FUNC_AOT) {
+ success = success && append_mangled_method (s, info->d.managed_to_native.method);
+ } else {
+ g_assert (info->subtype == WRAPPER_SUBTYPE_NONE || info->subtype == WRAPPER_SUBTYPE_PINVOKE);
+ success = success && append_mangled_method (s, info->d.managed_to_native.method);
+ }
+ break;
+ }
+ case MONO_WRAPPER_SYNCHRONIZED: {
+ MonoMethod *m;
+
+ m = mono_marshal_method_from_wrapper (method);
+ g_assert (m);
+ g_assert (m != method);
+ success = success && append_mangled_method (s, m);
+ break;
+ }
+ case MONO_WRAPPER_MANAGED_TO_MANAGED: {
+ append_mangled_wrapper_subtype (s, info->subtype);
- supported = append_mangled_signature (s, info->d.gsharedvt.sig);
- if (!supported) {
+ if (info->subtype == WRAPPER_SUBTYPE_ELEMENT_ADDR) {
+ g_string_append_printf (s, "%d_", info->d.element_addr.rank);
+ g_string_append_printf (s, "%d_", info->d.element_addr.elem_size);
+ } else if (info->subtype == WRAPPER_SUBTYPE_STRING_CTOR) {
+ success = success && append_mangled_method (s, info->d.string_ctor.method);
+ } else {
+ g_assert_not_reached ();
+ }
+ break;
+ }
+ case MONO_WRAPPER_CASTCLASS: {
+ append_mangled_wrapper_subtype (s, info->subtype);
+ break;
+ }
+ case MONO_WRAPPER_RUNTIME_INVOKE: {
+ append_mangled_wrapper_subtype (s, info->subtype);
+ if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT || info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL)
+ success = success && append_mangled_method (s, info->d.runtime_invoke.method);
+ else if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL)
+ success = success && append_mangled_signature (s, info->d.runtime_invoke.sig);
+ break;
+ }
+ case MONO_WRAPPER_DELEGATE_INVOKE:
+ case MONO_WRAPPER_DELEGATE_BEGIN_INVOKE:
+ case MONO_WRAPPER_DELEGATE_END_INVOKE: {
+ if (method->is_inflated) {
+ /* These wrappers are identified by their class */
+ g_string_append_printf (s, "i_");
+ success = success && append_mangled_klass (s, method->klass);
+ } else {
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+ g_string_append_printf (s, "u_");
+ if (method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE)
+ append_mangled_wrapper_subtype (s, info->subtype);
+ g_string_append_printf (s, "u_sigstart");
+ }
+ break;
+ }
+ case MONO_WRAPPER_NATIVE_TO_MANAGED: {
+ g_assert (info);
+ success = success && append_mangled_method (s, info->d.native_to_managed.method);
+ success = success && append_mangled_klass (s, method->klass);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+ return success && append_mangled_signature (s, mono_method_signature (method));
+}
+
+static void
+append_mangled_context (GString *str, MonoGenericContext *context)
+{
+ GString *res = g_string_new ("");
+
+ g_string_append_printf (res, "gens_");
+ g_string_append (res, "00");
+
+ gboolean good = context->class_inst && context->class_inst->type_argc > 0;
+ good = good || (context->method_inst && context->method_inst->type_argc > 0);
+ g_assert (good);
+
+ if (context->class_inst)
+ mono_ginst_get_desc (res, context->class_inst);
+ if (context->method_inst) {
+ if (context->class_inst)
+ g_string_append (res, "11");
+ mono_ginst_get_desc (res, context->method_inst);
+ }
+ g_string_append_printf (str, "gens_%s", res->str);
+}
+
+static gboolean
+append_mangled_method (GString *s, MonoMethod *method)
+{
+ if (method->wrapper_type)
+ return append_mangled_wrapper (s, method);
+
+ g_string_append_printf (s, "%s_", method->klass->image->assembly->aname.name);
+
+ if (method->is_inflated) {
+ g_string_append_printf (s, "inflated_");
+ MonoMethodInflated *imethod = (MonoMethodInflated*) method;
+ g_assert (imethod->context.class_inst != NULL || imethod->context.method_inst != NULL);
+
+ append_mangled_context (s, &imethod->context);
+ g_string_append_printf (s, "_declared_by_");
+ append_mangled_method (s, imethod->declaring);
+ } else if (method->is_generic) {
+ g_string_append_printf (s, "generic_");
+ append_mangled_klass (s, method->klass);
+ g_string_append_printf (s, "_%s_", method->name);
+
+ MonoGenericContainer *container = mono_method_get_generic_container (method);
+ g_string_append_printf (s, "_%s");
+ append_mangled_context (s, &container->context);
+
+ return append_mangled_signature (s, mono_method_signature (method));
+ } else {
+ g_string_append_printf (s, "_");
+ append_mangled_klass (s, method->klass);
+ g_string_append_printf (s, "_%s_", method->name);
+ if (!append_mangled_signature (s, mono_method_signature (method))) {
+ g_string_free (s, TRUE);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/*
+ * mono_aot_get_mangled_method_name:
+ *
+ * Return a unique mangled name for METHOD, or NULL.
+ */
+char*
+mono_aot_get_mangled_method_name (MonoMethod *method)
+{
+ GString *s = g_string_new ("aot_");
+ if (!append_mangled_method (s, method)) {
g_string_free (s, TRUE);
return NULL;
+ } else {
+ char *out = g_string_free (s, FALSE);
+ // Scrub method and class names
+ char *cleaned = sanitize_mangled_string (out);
+ g_free (out);
+ return cleaned;
}
-
- return g_string_free (s, FALSE);
}
gboolean
+/**
+ * \file
+ */
+
#ifndef __MONO_AOT_COMPILER_H__
#define __MONO_AOT_COMPILER_H__
-/*
- * aot-runtime.c: mono Ahead of Time compiler
+/**
+ * \file
+ * mono Ahead of Time compiler
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
/*
* Register the plt region as a single trampoline so we can unwind from this code
*/
- mono_tramp_info_register (
+ mono_aot_tramp_info_register (
mono_tramp_info_create (
NULL,
amodule->plt,
gpointer code;
code = mono_aot_get_trampoline_full (name, &out_tinfo);
- mono_tramp_info_register (out_tinfo, NULL);
+ mono_aot_tramp_info_register (out_tinfo, NULL);
return code;
}
/* Register the generic part at the beggining of the trampoline page */
gen_info = mono_tramp_info_create (NULL, (guint8*)taddr, amodule->info.tramp_page_code_offsets [tramp_type], NULL, NULL);
read_page_trampoline_uwinfo (gen_info, tramp_type, TRUE);
- mono_tramp_info_register (gen_info, NULL);
+ mono_aot_tramp_info_register (gen_info, NULL);
/*
* FIXME
* Registering each specific trampoline produces a lot of
/* Register the rest of the page as a single trampoline */
sp_info = mono_tramp_info_create (NULL, code, page->trampolines_end - code, NULL, NULL);
read_page_trampoline_uwinfo (sp_info, tramp_type, FALSE);
- mono_tramp_info_register (sp_info, NULL);
+ mono_aot_tramp_info_register (sp_info, NULL);
}
return code;
}
}
tinfo->code_size = *(guint32*)symbol_addr;
- mono_tramp_info_register (tinfo, NULL);
+ mono_aot_tramp_info_register (tinfo, NULL);
/* The caller expects an ftnptr */
return mono_create_ftnptr (mono_domain_get (), code);
+/**
+ * \file
+ */
+
#include "mini.h"
/* Dummy versions of some arch specific functions to avoid ifdefs at call sites */
-/*
- * branch-opts.c: Branch optimizations support
+/**
+ * \file
+ * Branch optimizations support
*
* Authors:
* Patrik Torstensson (Patrik.Torstesson at gmail.com)
-/*
+/**
+ * \file
* Copyright (C) 2016 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
+/**
+ * \file
* Copyright (C) 2016 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * cfold.c: Constant folding support
+/**
+ * \file
+ * Constant folding support
*
* Author:
* Paolo Molaro (lupus@ximian.com)
prefetch_membase: src1:b len:4
-expand_i1: dest:x src1:y len:17 clob:1
expand_i2: dest:x src1:i len:15
expand_i4: dest:x src1:i len:9
expand_r4: dest:x src1:f len:20
-/*
- * debug-mini.c: Mini-specific debugging stuff.
+/**
+ * \file
+ * Mini-specific debugging stuff.
*
* Author:
* Martin Baulig (martin@ximian.com)
* mono_debug_print_locals:
*
* Prints to stdout the information about the local variables in
- * a method (if @only_arguments is false) or about the arguments.
+ * a method (if \p only_arguments is false) or about the arguments.
* The information includes the storage info (where the variable
* lives, in a register or in memory).
* The method is found by looking up what method has been emitted at
- * the instruction address @ip.
+ * the instruction address \p ip.
* This is for use inside a debugger.
*/
void
-/*
- * debugger-agent.c: Soft Debugger back-end module
+/**
+ * \file
+ * Soft Debugger back-end module
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_DEBUGGER_AGENT_H__
#define __MONO_DEBUGGER_AGENT_H__
-/*
- * decompose.c: Functions to decompose complex IR instructions into simpler ones.
+/**
+ * \file
+ * Functions to decompose complex IR instructions into simpler ones.
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * dominators.c: Dominator computation on the control flow graph
+/**
+ * \file
+ * Dominator computation on the control flow graph
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
- * driver.c: The new mono JIT compiler.
+/**
+ * \file
+ * The new mono JIT compiler.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
#include <unistd.h>
#endif
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/class.h>
exit (1);
}
+/**
+ * mono_parse_default_optimizations:
+ */
int
mono_parse_default_optimizations (const char* p)
{
total_run = total = 0;
for (i = 0; i < count; ++i) {
- ass = mono_assembly_open (images [i], NULL);
+ ass = mono_assembly_open_predicate (images [i], FALSE, FALSE, NULL, NULL, NULL);
if (!ass) {
g_warning ("failed to load assembly: %s", images [i]);
continue;
/**
* mono_jit_exec:
- * @assembly: reference to an assembly
- * @argc: argument count
- * @argv: argument vector
- *
+ * \param assembly reference to an assembly
+ * \param argc argument count
+ * \param argv argument vector
* Start execution of a program.
*/
int
args = NULL;
}
- agent_assembly = mono_assembly_open (agent, &open_status);
+ agent_assembly = mono_assembly_open_predicate (agent, FALSE, FALSE, NULL, NULL, &open_status);
if (!agent_assembly) {
fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status));
g_free (agent);
static gboolean enable_debugging;
-/*
+/**
* mono_jit_parse_options:
*
- * Process the command line options in ARGV as done by the runtime executable.
- * This should be called before mono_jit_init ().
+ * Process the command line options in \p argv as done by the runtime executable.
+ * This should be called before \c mono_jit_init.
*/
void
mono_jit_parse_options (int argc, char * argv[])
/**
* mono_main:
- * @argc: number of arguments in the argv array
- * @argv: array of strings containing the startup arguments
- *
+ * \param argc number of arguments in the argv array
+ * \param argv array of strings containing the startup arguments
* Launches the Mono JIT engine and parses all the command line options
* in the same way that the mono command line VM would.
*/
jit_info_table_test (domain);
#endif
- assembly = mono_assembly_open (aname, &open_status);
+ assembly = mono_assembly_open_predicate (aname, FALSE, FALSE, NULL, NULL, &open_status);
if (!assembly) {
fprintf (stderr, "Cannot open assembly '%s': %s.\n", aname, mono_image_strerror (open_status));
mini_cleanup (domain);
return 0;
}
+/**
+ * mono_jit_init:
+ */
MonoDomain *
mono_jit_init (const char *file)
{
/**
* mono_jit_init_version:
- * @domain_name: the name of the root domain
- * @runtime_version: the version of the runtime to load
+ * \param domain_name the name of the root domain
+ * \param runtime_version the version of the runtime to load
*
* Use this version when you want to force a particular runtime
* version to be used. By default Mono will pick the runtime that is
- * referenced by the initial assembly (specified in @file), this
+ * referenced by the initial assembly (specified in \p file), this
* routine allows programmers to specify the actual runtime to be used
* as the initial runtime is inherited by all future assemblies loaded
* (since Mono does not support having more than one mscorlib runtime
* loaded at once).
*
- * The @runtime_version can be one of these strings: "v4.0.30319" for
+ * The \p runtime_version can be one of these strings: "v4.0.30319" for
* desktop, "mobile" for mobile or "moonlight" for Silverlight compat.
* If an unrecognized string is input, the vm will default to desktop.
*
- * Returns: the MonoDomain representing the domain where the assembly
+ * \returns the \c MonoDomain representing the domain where the assembly
* was loaded.
*/
MonoDomain *
return mini_init (domain_name, runtime_version);
}
+/**
+ * mono_jit_cleanup:
+ */
void
mono_jit_cleanup (MonoDomain *domain)
{
mono_aot_only = val;
}
+/**
+ * mono_jit_set_aot_mode:
+ */
void
mono_jit_set_aot_mode (MonoAotMode mode)
{
/**
* mono_jit_set_trace_options:
- * @options: string representing the trace options
- *
+ * \param options string representing the trace options
* Set the options of the tracing engine. This function can be called before initializing
* the mono runtime. See the --trace mono(1) manpage for the options format.
*
- * Returns: #TRUE if the options where parsed and set correctly, #FALSE otherwise.
+ * \returns TRUE if the options were parsed and set correctly, FALSE otherwise.
*/
gboolean
mono_jit_set_trace_options (const char* options)
/**
* mono_set_signal_chaining:
*
- * Enable/disable signal chaining. This should be called before mono_jit_init ().
+ * Enable/disable signal chaining. This should be called before \c mono_jit_init.
* If signal chaining is enabled, the runtime saves the original signal handlers before
* installing its own handlers, and calls the original ones in the following cases:
- * - a SIGSEGV/SIGABRT signal received while executing native (i.e. not JITted) code.
- * - SIGPROF
- * - SIGFPE
- * - SIGQUIT
- * - SIGUSR2
+ * - a \c SIGSEGV / \c SIGABRT signal received while executing native (i.e. not JITted) code.
+ * - \c SIGPROF
+ * - \c SIGFPE
+ * - \c SIGQUIT
+ * - \c SIGUSR2
* Signal chaining only works on POSIX platforms.
*/
void
/**
* mono_parse_options_from:
- * @options: string containing strings
- * @ref_argc: pointer to the argc variable that might be updated
- * @ref_argv: pointer to the argv string vector variable that might be updated
+ * \param options string containing strings
+ * \param ref_argc pointer to the \c argc variable that might be updated
+ * \param ref_argv pointer to the \c argv string vector variable that might be updated
*
- * This function parses the contents of the `MONO_ENV_OPTIONS`
+ * This function parses the contents of the \c MONO_ENV_OPTIONS
* environment variable as if they were parsed by a command shell
* splitting the contents by spaces into different elements of the
- * @argv vector. This method supports quoting with both the " and '
+ * \p argv vector. This method supports quoting with both the " and '
* characters. Inside quoting, spaces and tabs are significant,
* otherwise, they are considered argument separators.
*
* inside quotes. If the quotes are not balanced, this method
*
* If the environment variable is empty, no changes are made
- * to the values pointed by @ref_argc and @ref_argv.
+ * to the values pointed by \p ref_argc and \p ref_argv.
*
- * Otherwise the @ref_argv is modified to point to a new array that contains
+ * Otherwise the \p ref_argv is modified to point to a new array that contains
* all the previous elements contained in the vector, plus the values parsed.
- * The @argc is updated to match the new number of parameters.
+ * The \p argc is updated to match the new number of parameters.
*
- * Returns: The value NULL is returned on success, otherwise a g_strdup allocated
- * string is returned (this is an alias to malloc under normal circumstances) that
+ * \returns The value NULL is returned on success, otherwise a \c g_strdup allocated
+ * string is returned (this is an alias to \c malloc under normal circumstances) that
* contains the error message that happened during parsing.
*/
char *
/**
* mono_parse_env_options:
- * @ref_argc: pointer to the argc variable that might be updated
- * @ref_argv: pointer to the argv string vector variable that might be updated
+ * \param ref_argc pointer to the \c argc variable that might be updated
+ * \param ref_argv pointer to the \c argv string vector variable that might be updated
*
- * This function parses the contents of the `MONO_ENV_OPTIONS`
+ * This function parses the contents of the \c MONO_ENV_OPTIONS
* environment variable as if they were parsed by a command shell
* splitting the contents by spaces into different elements of the
- * @argv vector. This method supports quoting with both the " and '
+ * \p argv vector. This method supports quoting with both the " and '
* characters. Inside quoting, spaces and tabs are significant,
* otherwise, they are considered argument separators.
*
* inside quotes. If the quotes are not balanced, this method
*
* If the environment variable is empty, no changes are made
- * to the values pointed by @ref_argc and @ref_argv.
+ * to the values pointed by \p ref_argc and \p ref_argv.
*
- * Otherwise the @ref_argv is modified to point to a new array that contains
+ * Otherwise the \p ref_argv is modified to point to a new array that contains
* all the previous elements contained in the vector, plus the values parsed.
- * The @argc is updated to match the new number of parameters.
+ * The \p argc is updated to match the new number of parameters.
*
* If there is an error parsing, this method will terminate the process by
* calling exit(1).
-/*
- * dwarfwriter.c: Creation of DWARF debug information
+/**
+ * \file
+ * Creation of DWARF debug information
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * dwarfwriter.h: Creation of DWARF debug information
+/**
+ * \file
+ * Creation of DWARF debug information
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * exceptions-amd64.c: exception support for AMD64
+/**
+ * \file
+ * exception support for AMD64
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_arch_get_throw_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* exceptions. The returned function has the following
* signature: void (*func) (MonoException *exc);
- *
*/
gpointer
mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot)
/**
* mono_arch_handle_exception:
- *
- * @ctx: saved processor state
- * @obj: the exception object
+ * \param ctx saved processor state
+ * \param obj the exception object
*/
gboolean
mono_arch_handle_exception (void *sigctx, gpointer obj)
-/*
- * exceptions-arm.c: exception support for ARM
+/**
+ * \file
+ * exception support for ARM
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
- * Here, offset is the offset which needs to be substracted from the caller IP
+ * Here, \c offset is the offset which needs to be substracted from the caller IP
* to get the IP of the throw. Passing the offset has the advantage that it
* needs no relocations in the caller.
* On ARM, the ip is passed instead of an offset.
-/*
- * exceptions-arm64.c: exception support for ARM64
+/**
+ * \file
+ * exception support for ARM64
*
* Copyright 2013 Xamarin Inc
*
-/*
- * exceptions-ia64.c: exception support for IA64
+/**
+ * \file
+ * exception support for IA64
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
/**
* mono_arch_get_throw_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* exceptions. The returned function has the following
* signature: void (*func) (MonoException *exc);
- *
*/
gpointer
mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot)
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token_index, guint32 offset);
* Here, offset is the offset which needs to be substracted from the caller IP
/**
* mono_arch_handle_exception:
- *
- * @ctx: saved processor state
- * @obj: the exception object
+ * \param ctx saved processor state
+ * \param obj the exception object
*/
gboolean
mono_arch_handle_exception (void *sigctx, gpointer obj)
-/*
- * exceptions-mips.c: exception support for MIPS
+/**
+ * \file
+ * exception support for MIPS
*
* Authors:
* Mark Mason (mason@broadcom.com)
/**
* mono_arch_get_rethrow_exception:
- *
- * Returns a function pointer which can be used to rethrow
+ * \returns a function pointer which can be used to rethrow
* exceptions. The returned function has the following
* signature: void (*func) (MonoException *exc);
- *
*/
gpointer
mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot)
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
* On MIPS, the offset argument is missing.
-/*
- * exceptions-ppc.c: exception support for PowerPC
+/**
+ * \file
+ * exception support for PowerPC
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_arch_get_rethrow_exception:
- *
- * Returns a function pointer which can be used to rethrow
+ * \returns a function pointer which can be used to rethrow
* exceptions. The returned function has the following
* signature: void (*func) (MonoException *exc);
- *
*/
gpointer
mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot)
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
* On PPC, we pass the ip instead of the offset
-/*------------------------------------------------------------------*/
-/* */
-/* Name - exceptions-s390.c */
-/* */
-/* Function - Exception support for S/390. */
-/* */
-/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
-/* */
-/* Date - January, 2004 */
-/* */
-/* Derivation - From exceptions-x86 & exceptions-ppc */
-/* Paolo Molaro (lupus@ximian.com) */
-/* Dietmar Maurer (dietmar@ximian.com) */
-/* */
-/* Copyright - 2001 Ximian, Inc. */
-/* Licensed under the MIT license. See LICENSE file in the project root for full license information. */
-/* */
-/*------------------------------------------------------------------*/
+/**
+ * \file
+ *
+ * Function - Exception support for S/390.
+ *
+ * Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *
+ * Date - January, 2004
+ *
+ * Derivation - From exceptions-x86 & exceptions-ppc
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * Copyright - 2001 Ximian, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ *
+ */
/*------------------------------------------------------------------*/
/* D e f i n e s */
-/*
- * exceptions-sparc.c: exception support for sparc
+/**
+ * \file
+ * exception support for sparc
*
* Authors:
* Mark Crichton (crichton@gimp.org)
/**
* mono_arch_get_throw_exception:
- *
- * Returns a function pointer which can be used to raise exceptions.
+ * \returns a function pointer which can be used to raise exceptions.
* The returned function has the following
* signature: void (*func) (MonoException *exc);
*/
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
* Here, offset is the offset which needs to be substracted from the caller IP
-/*
- * exceptions-x86.c: exception support for x86
+/**
+ * \file
+ * exception support for x86
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_arch_get_throw_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* exceptions. The returned function has the following
* signature: void (*func) (MonoException *exc);
* For example to raise an arithmetic exception you can use:
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
* Here, offset is the offset which needs to be substracted from the caller IP
-/*
- * genmdesc: Generates the machine description
+/**
+ * \file
+ * Generates the machine description
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
-/*
- * graph.c: Helper routines to graph various internal states of the code generator
+/**
+ * \file
+ * Helper routines to graph various internal states of the code generator
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
- * helpers.c: Assorted routines
+/**
+ * \file
+ * Assorted routines
*
* (C) 2003 Ximian, Inc.
*/
}
/**
- * mono_disassemble_code:
- * @cfg: compilation context
- * @code: a pointer to the code
- * @size: the code size in bytes
+ * \param cfg compilation context
+ * \param code a pointer to the code
+ * \param size the code size in bytes
*
* Disassemble to code to stdout.
*/
-/*
- * image-writer.c: Creation of object files or assembly files using the same interface.
+/**
+ * \file
+ * Creation of object files or assembly files using the same interface.
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
- * image-writer.h: Creation of object files or assembly files using the same interface.
+/**
+ * \file
+ * Creation of object files or assembly files using the same interface.
*
* Author:
* Dietmar Maurer (dietmar@ximian.com);
+/**
+ * \file
+ */
+
/* we need some special math function */
#ifndef _ISOC99_SOURCE
#define _ISOC99_SOURCE
-/*
+/**
+ * \file
* PLEASE NOTE: This is a research prototype.
*
*
/* trim excessive headers */
#include <mono/metadata/image.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/tabledefs.h>
case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_ARRAY:
+ case MONO_TYPE_ARRAY: {
+ gpointer *p = (gpointer *) data;
+ mono_gc_wbarrier_generic_store (p, val->data.p);
+ return;
+ }
case MONO_TYPE_PTR: {
- gpointer *p = (gpointer*)data;
+ gpointer *p = (gpointer *) data;
*p = val->data.p;
return;
}
return;
frame = frame->parent;
}
-
- g_assert (0);
}
static MonoPIFunc mono_interp_enter_icall_trampoline = NULL;
if (margs->flen > 0)
margs->fargs = g_malloc0 (sizeof (double) * margs->flen);
- if (margs->ilen > 8)
+ if (margs->ilen > 12)
g_error ("build_args_from_sig: TODO, allocate gregs: %d\n", margs->ilen);
if (margs->flen > 3)
void
mono_interp_init_delegate (MonoDelegate *del)
{
- if (!del->method)
- del->method = ((RuntimeMethod *) del->method_ptr)->method;
+ if (del->method)
+ return;
+ /* shouldn't need a write barrier because we don't write a MonoObject into the field */
+ del->method = ((RuntimeMethod *) del->method_ptr)->method;
}
/*
mono_class_init (method->klass);
+ if (method->klass == mono_defaults.array_class) {
+ if (!strcmp (method->name, "UnsafeMov")) {
+ /* TODO: layout checks */
+ MonoType *mt = mono_method_signature (method)->ret;
+ stackval_from_data (mt, frame->retval, (char *) frame->stack_args, FALSE);
+ return;
+ }
+ }
+
isinst_obj = mono_object_isinst_checked (obj, mono_defaults.array_class, &error);
mono_error_cleanup (&error); /* FIXME: don't swallow the error */
if (obj && isinst_obj) {
break;
case MONO_TYPE_VALUETYPE:
retval = mono_object_new_checked (context->domain, klass, error);
- ret = ((char*)retval) + sizeof (MonoObject);
+ ret = mono_object_unbox (retval);
if (!sig->ret->data.klass->enumtype)
result.data.vt = ret;
+ else
+ result.data.vt = alloca (mono_class_instance_size (klass));
+ break;
+ case MONO_TYPE_GENERICINST:
+ if (!MONO_TYPE_IS_REFERENCE (sig->ret)) {
+ retval = mono_object_new_checked (context->domain, klass, error);
+ ret = mono_object_unbox (retval);
+ if (!sig->ret->data.klass->enumtype)
+ result.data.vt = ret;
+ else
+ result.data.vt = alloca (mono_class_instance_size (klass));
+ } else {
+ isobject = 1;
+ }
+ break;
+
+ case MONO_TYPE_PTR:
+ retval = mono_object_new_checked (context->domain, mono_defaults.int_class, error);
+ ret = mono_object_unbox (retval);
break;
default:
retval = mono_object_new_checked (context->domain, klass, error);
- ret = ((char*)retval) + sizeof (MonoObject);
+ ret = mono_object_unbox (retval);
break;
}
case MONO_TYPE_I8:
args [a_index].data.l = *(gint64*)params [i];
break;
+ case MONO_TYPE_R4:
+ args [a_index].data.f = *(gfloat *) params [i];
+ break;
+ case MONO_TYPE_R8:
+ args [a_index].data.f = *(gdouble *) params [i];
+ break;
case MONO_TYPE_VALUETYPE:
if (sig->params [i]->data.klass->enumtype) {
type = mono_class_enum_basetype (sig->params [i]->data.klass)->type;
}
break;
case MONO_TYPE_STRING:
+ case MONO_TYPE_PTR:
case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
#define MINT_IN_DEFAULT default:
#endif
-/*
- * Defining this causes register allocation errors in some versions of gcc:
- * error: unable to find a register to spill in class `SIREG'
- */
-/* #define MINT_USE_DEDICATED_IP_REG */
-
static void
ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
{
MonoInvocation child_frame;
GSList *finally_ips = NULL;
const unsigned short *endfinally_ip = NULL;
-#if defined(__GNUC__) && defined (i386) && defined (MINT_USE_DEDICATED_IP_REG)
- register const unsigned short *ip asm ("%esi");
-#else
- register const unsigned short *ip;
-#endif
+ const unsigned short *ip = NULL;
register stackval *sp;
RuntimeMethod *rtm;
#if DEBUG_INTERP
MINT_IN_CASE(MINT_STIND_REF)
++ip;
sp -= 2;
- * (gpointer *) sp->data.p = sp[1].data.p;
+ mono_gc_wbarrier_generic_store (sp->data.p, sp [1].data.p);
MINT_IN_BREAK;
MINT_IN_CASE(MINT_STIND_I1)
++ip;
MINT_IN_CASE(MINT_CPOBJ) {
c = rtm->data_items[* (guint16 *)(ip + 1)];
g_assert (c->byval_arg.type == MONO_TYPE_VALUETYPE);
+ /* if this assertion fails, we need to add a write barrier */
+ g_assert (!MONO_TYPE_IS_REFERENCE (&c->byval_arg));
stackval_from_data (&c->byval_arg, &sp [-2], sp [-1].data.p, FALSE);
ip += 2;
sp -= 2;
MINT_IN_CASE(MINT_STFLD_I8) STFLD(l, gint64); MINT_IN_BREAK;
MINT_IN_CASE(MINT_STFLD_R4) STFLD(f, float); MINT_IN_BREAK;
MINT_IN_CASE(MINT_STFLD_R8) STFLD(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_O) STFLD(p, gpointer); MINT_IN_BREAK;
MINT_IN_CASE(MINT_STFLD_P) STFLD(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_O)
+ o = sp [-2].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ sp -= 2;
+ mono_gc_wbarrier_set_field (o, (char *) o + * (guint16 *)(ip + 1), sp [1].data.p);
+ ip += 2;
+ MINT_IN_BREAK;
MINT_IN_CASE(MINT_STFLD_VT)
o = sp [-2].data.p;
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_STOBJ) {
- int size;
c = rtm->data_items[* (guint16 *)(ip + 1)];
ip += 2;
- size = mono_class_value_size (c, NULL);
- memcpy(sp [-2].data.p, &sp [-1].data, size);
+
+ g_assert (!c->byval_arg.byref);
+ if (MONO_TYPE_IS_REFERENCE (&c->byval_arg))
+ mono_gc_wbarrier_generic_store (sp [-2].data.p, sp [-1].data.p);
+ else
+ stackval_from_data (&c->byval_arg, sp [-2].data.p, (char *) &sp [-1].data.p, FALSE);
sp -= 2;
MINT_IN_BREAK;
}
}
MINT_IN_CASE(MINT_STRLEN)
++ip;
- sp [-1].data.i = mono_string_length ((MonoString*)sp [-1].data.p);
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ sp [-1].data.i = mono_string_length ((MonoString*) o);
MINT_IN_BREAK;
MINT_IN_CASE(MINT_ARRAY_RANK)
o = sp [-1].data.p;
mono_error_cleanup (&error); /* FIXME: don't swallow the error */
if (sp [2].data.p && !isinst_obj)
THROW_EX (mono_get_exception_array_type_mismatch (), ip);
- mono_array_set ((MonoArray *)o, gpointer, aindex, sp [2].data.p);
+ mono_array_setref ((MonoArray *) o, aindex, sp [2].data.p);
break;
}
case MINT_STELEM_VT: {
goto handle_finally;
}
die_on_ex:
- ex_obj = (MonoObject*)frame->ex;
+ ex_obj = (MonoObject *) frame->ex;
mono_unhandled_exception (ex_obj);
- exit (1);
+ MonoJitTlsData *jit_tls = (MonoJitTlsData *) mono_tls_get_jit_tls ();
+ jit_tls->abort_func (ex_obj);
+ g_assert_not_reached ();
}
handle_finally:
{
total_run = total = 0;
for (i = 0; i < count; ++i) {
- MonoAssembly *ass = mono_assembly_open (images [i], NULL);
+ MonoAssembly *ass = mono_assembly_open_predicate (images [i], FALSE, FALSE, NULL, NULL, NULL);
if (!ass) {
g_warning ("failed to load assembly: %s", images [i]);
continue;
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_INTERPRETER_H__
#define __MONO_MINI_INTERPRETER_H__
#include <mono/mini/mini.h>
-/*
+/**
+ * \file
* Utilities for handling interpreter VM instructions
*
* Authors:
+/**
+ * \file
+ */
+
#ifndef __INTERPRETER_MINTOPS_H
#define __INTERPRETER_MINTOPS_H
-/*
+/**
+ * \file
* transform CIL into different opcodes for more
* efficient interpretation
*
else
size = mono_class_value_size (klass, NULL);
ADD_CODE(td, MINT_STARG_VT);
- ADD_CODE(td, n);
+ ADD_CODE(td, td->rtm->arg_offsets [n]);
WRITE32(td, &size);
if (td->sp [-1].type == STACK_TYPE_VT)
POP_VT(td, size);
} else if (*name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
nm = mono_marshal_get_delegate_end_invoke (method);
}
- }
+ }
if (nm == NULL) {
runtime_method->code = g_malloc(sizeof(short));
runtime_method->code[0] = MINT_CALLRUN;
method = nm;
header = mono_method_get_header (nm);
mono_os_mutex_unlock(&calc_section);
+ } else if (method->klass == mono_defaults.array_class) {
+ if (!strcmp (method->name, "UnsafeMov")) {
+ mono_os_mutex_lock (&calc_section);
+ if (!runtime_method->transformed) {
+ runtime_method->code = g_malloc (sizeof (short));
+ runtime_method->code[0] = MINT_CALLRUN;
+ runtime_method->stack_size = sizeof (stackval); /* for tracing */
+ runtime_method->alloca_size = runtime_method->stack_size;
+ runtime_method->transformed = TRUE;
+ }
+ mono_os_mutex_unlock(&calc_section);
+ mono_profiler_method_end_jit (method, NULL, MONO_PROFILE_OK);
+ return NULL;
+ } else if (!strcmp (method->name, "UnsafeStore)")) {
+ g_error ("TODO");
+ } else if (!strcmp (method->name, "UnsafeLoad)")) {
+ g_error ("TODO");
+ }
}
g_assert ((signature->param_count + signature->hasthis) < 1000);
g_assert (header->max_stack < 10000);
-/*
- * ir-emit.h: IR Creation/Emission Macros
+/**
+ * \file
+ * IR Creation/Emission Macros
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * jit-icalls.c: internal calls used by the JIT
+/**
+ * \file
+ * internal calls used by the JIT
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_JIT_ICALLS_H__
#define __MONO_JIT_ICALLS_H__
-/*
+/**
+ * \file
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
-/*
- * liveness.c: liveness analysis
+/**
+ * \file
+ * liveness analysis
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
- * liveness.c: liveness analysis
+/**
+ * \file
+ * liveness analysis
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
-/*
- * lldb.c: Mono support for LLDB.
+/**
+ * \file
+ * Mono support for LLDB.
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_XDEBUG_LLDB_H__
#define __MONO_XDEBUG_LLDB_H__
-/*
- * llvm-jit.h: LLVM backend
+/**
+ * \file
+ * LLVM backend
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * llvm-runtime.h: Runtime support for llvm generated code
+/**
+ * \file
+ * Runtime support for llvm generated code
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * local-propagation.c: Local constant, copy and tree propagation.
+/**
+ * \file
+ * Local constant, copy and tree propagation.
*
* To make some sense of the tree mover, read mono/docs/tree-mover.txt
*
-/*
- * main.c: The main entry point for the mono executable
+/**
+ * \file
+ * The main entry point for the mono executable
*
* The main entry point does a few things:
*
-/*
- * method-to-ir.c: Convert CIL to the JIT internal representation
+/**
+ * \file
+ * Convert CIL to the JIT internal representation
*
* Author:
* Paolo Molaro (lupus@ximian.com)
if (!cfg->lmf_ir)
return;
- if (cfg->lmf_ir_mono_lmf) {
- MonoInst *lmf_vara_ins, *lmf_ins;
- /* Load current lmf */
- lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF);
- g_assert (lmf_ins);
- EMIT_NEW_VARLOADA (cfg, lmf_vara_ins, cfg->lmf_var, NULL);
- /* Save previous_lmf */
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_vara_ins->dreg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), lmf_ins->dreg);
- /* Set new LMF */
- mono_create_tls_set (cfg, lmf_vara_ins, TLS_KEY_LMF);
- } else {
- int lmf_reg, prev_lmf_reg;
- /*
- * Store lmf_addr in a variable, so it can be allocated to a global register.
- */
- if (!cfg->lmf_addr_var)
- cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ int lmf_reg, prev_lmf_reg;
+ /*
+ * Store lmf_addr in a variable, so it can be allocated to a global register.
+ */
+ if (!cfg->lmf_addr_var)
+ cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
#ifdef HOST_WIN32
- ins = mono_create_tls_get (cfg, TLS_KEY_JIT_TLS);
- g_assert (ins);
- int jit_tls_dreg = ins->dreg;
+ ins = mono_create_tls_get (cfg, TLS_KEY_JIT_TLS);
+ g_assert (ins);
+ int jit_tls_dreg = ins->dreg;
- lmf_reg = alloc_preg (cfg);
- EMIT_NEW_BIALU_IMM (cfg, lmf_ins, OP_PADD_IMM, lmf_reg, jit_tls_dreg, MONO_STRUCT_OFFSET (MonoJitTlsData, lmf));
+ lmf_reg = alloc_preg (cfg);
+ EMIT_NEW_BIALU_IMM (cfg, lmf_ins, OP_PADD_IMM, lmf_reg, jit_tls_dreg, MONO_STRUCT_OFFSET (MonoJitTlsData, lmf));
#else
- lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF_ADDR);
- g_assert (lmf_ins);
+ lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF_ADDR);
+ g_assert (lmf_ins);
#endif
- lmf_ins->dreg = cfg->lmf_addr_var->dreg;
+ lmf_ins->dreg = cfg->lmf_addr_var->dreg;
- EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
- lmf_reg = ins->dreg;
+ EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
+ lmf_reg = ins->dreg;
- prev_lmf_reg = alloc_preg (cfg);
- /* Save previous_lmf */
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, cfg->lmf_addr_var->dreg, 0);
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), prev_lmf_reg);
- /* Set new lmf */
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, cfg->lmf_addr_var->dreg, 0, lmf_reg);
- }
+ prev_lmf_reg = alloc_preg (cfg);
+ /* Save previous_lmf */
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, cfg->lmf_addr_var->dreg, 0);
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), prev_lmf_reg);
+ /* Set new lmf */
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, cfg->lmf_addr_var->dreg, 0, lmf_reg);
}
/*
EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
lmf_reg = ins->dreg;
- if (cfg->lmf_ir_mono_lmf) {
- /* Load previous_lmf */
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, alloc_preg (cfg), lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
- /* Set new LMF */
- mono_create_tls_set (cfg, ins, TLS_KEY_LMF);
- } else {
- int prev_lmf_reg;
- /*
- * Emit IR to pop the LMF:
- * *(lmf->lmf_addr) = lmf->prev_lmf
- */
- /* This could be called before emit_push_lmf () */
- if (!cfg->lmf_addr_var)
- cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
- lmf_addr_reg = cfg->lmf_addr_var->dreg;
+ int prev_lmf_reg;
+ /*
+ * Emit IR to pop the LMF:
+ * *(lmf->lmf_addr) = lmf->prev_lmf
+ */
+ /* This could be called before emit_push_lmf () */
+ if (!cfg->lmf_addr_var)
+ cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ lmf_addr_reg = cfg->lmf_addr_var->dreg;
- prev_lmf_reg = alloc_preg (cfg);
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_addr_reg, 0, prev_lmf_reg);
- }
+ prev_lmf_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_addr_reg, 0, prev_lmf_reg);
}
static void
static gboolean
direct_icalls_enabled (MonoCompile *cfg)
{
+ return FALSE;
+
/* LLVM on amd64 can't handle calls to non-32 bit addresses */
#ifdef TARGET_AMD64
if (cfg->compile_llvm && !cfg->llvm_only)
/**
* mono_set_break_policy:
- * policy_callback: the new callback function
+ * \param policy_callback the new callback function
*
* Allow embedders to decide wherther to actually obey breakpoint instructions
- * (both break IL instructions and Debugger.Break () method calls), for example
+ * (both break IL instructions and \c Debugger.Break method calls), for example
* to not allow an app to be aborted by a perfectly valid IL opcode when executing
* untrusted or semi-trusted code.
*
- * @policy_callback will be called every time a break point instruction needs to
- * be inserted with the method argument being the method that calls Debugger.Break()
- * or has the IL break instruction. The callback should return #MONO_BREAK_POLICY_NEVER
+ * \p policy_callback will be called every time a break point instruction needs to
+ * be inserted with the method argument being the method that calls \c Debugger.Break
+ * or has the IL \c break instruction. The callback should return \c MONO_BREAK_POLICY_NEVER
* if it wants the breakpoint to not be effective in the given method.
- * #MONO_BREAK_POLICY_ALWAYS is the default.
+ * \c MONO_BREAK_POLICY_ALWAYS is the default.
*/
void
mono_set_break_policy (MonoBreakPolicyFunc policy_callback)
return NULL;
if (strcmp (cmethod->name, "InitializeArray") || strcmp (cmethod->klass->name, "RuntimeHelpers") || cmethod->klass->image != mono_defaults.corlib)
return NULL;
- switch (mono_type_get_underlying_type (&klass->byval_arg)->type) {
- case MONO_TYPE_BOOLEAN:
+ switch (mini_get_underlying_type (&klass->byval_arg)->type) {
case MONO_TYPE_I1:
case MONO_TYPE_U1:
size = 1; break;
/* we need to swap on big endian, so punt. Should we handle R4 and R8 as well? */
#if TARGET_BYTE_ORDER == G_LITTLE_ENDIAN
- case MONO_TYPE_CHAR:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
size = 2; break;
-/*
- * mini-amd64-gsharedvt.c: libcorkscrew-based native unwinder
+/**
+ * \file
+ * libcorkscrew-based native unwinder
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
} else {
MonoType *ret = sig->ret;
- // Unwrap enums
- if (ret->type == MONO_TYPE_VALUETYPE)
- ret = mini_type_get_underlying_type (ret);
-
+ ret = mini_type_get_underlying_type (ret);
switch (ret->type) {
case MONO_TYPE_I1:
info->ret_marshal = GSHAREDVT_RET_I1;
break;
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_U1:
info->ret_marshal = GSHAREDVT_RET_U1;
break;
case MONO_TYPE_I2:
info->ret_marshal = GSHAREDVT_RET_I2;
break;
- case MONO_TYPE_CHAR:
case MONO_TYPE_U2:
info->ret_marshal = GSHAREDVT_RET_U2;
break;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
case MONO_TYPE_U8:
case MONO_TYPE_I8:
info->ret_marshal = GSHAREDVT_RET_I8;
-/*
- * mini-exceptions-native-unwinder.c: libcorkscrew-based native unwinder
+/**
+ * \file
+ * libcorkscrew-based native unwinder
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
#define DEBUG_AMD64_GSHAREDVT_PRINT(...)
#endif
-#endif /* MINI_AMD64_GSHAREDVT_H */
\ No newline at end of file
+#endif /* MINI_AMD64_GSHAREDVT_H */
-/*
- * mini-amd64.c: AMD64 backend for the Mono code generator
+/**
+ * \file
+ * AMD64 backend for the Mono code generator
*
* Based on mini-x86.c.
*
case MONO_TYPE_U4:
case MONO_TYPE_I:
case MONO_TYPE_U:
- case MONO_TYPE_STRING:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_ARRAY:
case MONO_TYPE_I8:
case MONO_TYPE_U8:
class2 = ARG_CLASS_INTEGER;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
cinfo->ret.storage = ArgInIReg;
cinfo->ret.reg = AMD64_RAX;
break;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
add_general (&gr, &stack_size, ainfo);
break;
case MONO_TYPE_GENERICINST:
/**
* mono_arch_compute_omit_fp:
- *
- * Determine whenever the frame pointer can be eliminated.
+ * Determine whether the frame pointer can be eliminated.
*/
static void
mono_arch_compute_omit_fp (MonoCompile *cfg)
if (cfg->method->save_lmf) {
cfg->lmf_ir = TRUE;
-#if !defined(TARGET_WIN32)
- if (!optimize_for_xen)
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
}
}
switch (t->type) {
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_PTR:
case MONO_TYPE_I:
case MONO_TYPE_VOID:
*(gpointer*)ret = NULL;
break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_I:
case MONO_TYPE_U:
}
/*
- * mono_amd64_emit_tls_get:
- * @code: buffer to store code to
- * @dreg: hard register where to place the result
- * @tls_offset: offset info
+ * \param code buffer to store code to
+ * \param dreg hard register where to place the result
+ * \param tls_offset offset info
+ * \return a pointer to the end of the stored code
*
- * mono_amd64_emit_tls_get emits in @code the native code that puts in
+ * mono_amd64_emit_tls_get emits in \p code the native code that puts in
* the dreg register the item in the thread local storage identified
* by tls_offset.
- *
- * Returns: a pointer to the end of the stored code
*/
static guint8*
mono_amd64_emit_tls_get (guint8* code, int dreg, int tls_offset)
}
/**
- * mono_breakpoint_clean_code:
+ * \return TRUE if no sw breakpoint was present.
*
- * Copy @size bytes from @code - @offset to the buffer @buf. If the debugger inserted software
+ * Copy \p size bytes from \p code - \p offset to the buffer \p buf. If the debugger inserted software
* breakpoints in the original code, they are removed in the copy.
- *
- * Returns TRUE if no sw breakpoint was present.
*/
gboolean
mono_breakpoint_clean_code (guint8 *method_start, guint8 *code, int offset, guint8 *buf, int size)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_AMD64_H__
#define __MONO_MINI_AMD64_H__
// instead of RtlInstallFunctionTableCallback. This gives us the benefit to
// include all needed unwind upon registration.
typedef DWORD (NTAPI* RtlAddGrowableFunctionTablePtr)(
- _Out_ PVOID * DynamicTable,
- _In_reads_(MaximumEntryCount) PRUNTIME_FUNCTION FunctionTable,
- _In_ DWORD EntryCount,
- _In_ DWORD MaximumEntryCount,
- _In_ ULONG_PTR RangeBase,
- _In_ ULONG_PTR RangeEnd);
+ PVOID * DynamicTable,
+ PRUNTIME_FUNCTION FunctionTable,
+ DWORD EntryCount,
+ DWORD MaximumEntryCount,
+ ULONG_PTR RangeBase,
+ ULONG_PTR RangeEnd);
typedef VOID (NTAPI* RtlGrowFunctionTablePtr)(
- _Inout_ PVOID DynamicTable,
- _In_ DWORD NewEntryCount);
+ PVOID DynamicTable,
+ DWORD NewEntryCount);
typedef VOID (NTAPI* RtlDeleteGrowableFunctionTablePtr)(
- _In_ PVOID DynamicTable);
+ PVOID DynamicTable);
#endif /* HOST_WIN32 */
#define MONO_ARCH_EMULATE_CONV_R8_UN 1
#define MONO_ARCH_EMULATE_FREM 1
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
-
-#ifndef HOST_WIN32
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
#define MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES 1
#define MONO_ARCH_IMT_REG AMD64_R10
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_ARCH_H__
#define __MONO_MINI_ARCH_H__
-/*
- * mini-arm-gsharedvt.c: gsharedvt support code for arm
+/**
+ * \file
+ * gsharedvt support code for arm
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * mini-arm.c: ARM backend for the Mono code generator
+/**
+ * \file
+ * ARM backend for the Mono code generator
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
case MONO_TYPE_FNPTR:
return TRUE;
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
return TRUE;
case MONO_TYPE_GENERICINST:
if (!mono_type_generic_inst_is_valuetype (t))
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
cinfo->ret.storage = RegTypeGeneral;
cinfo->ret.reg = ARMREG_R0;
break;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
cinfo->args [n].size = sizeof (gpointer);
add_general (&gr, &stack_size, ainfo, TRUE);
break;
/**
* mono_arch_compute_omit_fp:
- *
- * Determine whenever the frame pointer can be eliminated.
+ * Determine whether the frame pointer can be eliminated.
*/
static void
mono_arch_compute_omit_fp (MonoCompile *cfg)
}
switch (t->type) {
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_PTR:
case MONO_TYPE_I:
case MONO_TYPE_VOID:
*(gpointer*)ret = NULL;
break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_I:
case MONO_TYPE_U:
-/*
+/**
+ * \file
* Copyright 2011 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * mini-arm64-gsharedvt.c: gsharedvt support code for arm64
+/**
+ * \file
+ * gsharedvt support code for arm64
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
if (!gsharedvt_in || sig->ret->byref) {
info->ret_marshal = GSHAREDVT_RET_I8;
} else {
- switch (sig->ret->type) {
+ MonoType *rtype = mini_get_underlying_type (sig->ret);
+
+ switch (rtype->type) {
case MONO_TYPE_I1:
info->ret_marshal = GSHAREDVT_RET_I1;
break;
case MONO_TYPE_U1:
- case MONO_TYPE_BOOLEAN:
info->ret_marshal = GSHAREDVT_RET_U1;
break;
case MONO_TYPE_I2:
info->ret_marshal = GSHAREDVT_RET_I2;
break;
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
info->ret_marshal = GSHAREDVT_RET_U2;
break;
case MONO_TYPE_I4:
+/**
+ * \file
+ */
+
#ifndef __MINI_ARM64_GSHAREDVT_H__
#define __MINI_ARM64_GSHAREDVT_H__
-/*
- * mini-arm64.c: ARM64 backend for the Mono code generator
+/**
+ * \file
+ * ARM64 backend for the Mono code generator
*
* Copyright 2013 Xamarin, Inc (http://www.xamarin.com)
*
case MONO_TYPE_I1:
add_general (cinfo, ainfo, 1, TRUE);
break;
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_U1:
add_general (cinfo, ainfo, 1, FALSE);
break;
add_general (cinfo, ainfo, 2, TRUE);
break;
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
add_general (cinfo, ainfo, 2, FALSE);
break;
case MONO_TYPE_I4:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
case MONO_TYPE_U8:
case MONO_TYPE_I8:
add_general (cinfo, ainfo, 8, FALSE);
/* Special case arguments smaller than 1 machine word */
switch (t->type) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_U1:
*(guint8*)stack_arg = *(guint8*)arg;
break;
*(gint8*)stack_arg = *(gint8*)arg;
break;
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
*(guint16*)stack_arg = *(guint16*)arg;
break;
case MONO_TYPE_I2:
}
switch (t->type) {
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_PTR:
case MONO_TYPE_I:
case MONO_TYPE_U8:
p->regs [slot] = (mgreg_t)*arg;
break;
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_U1:
p->regs [slot] = *(guint8*)arg;
break;
p->regs [slot] = *(gint16*)arg;
break;
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
p->regs [slot] = *(guint16*)arg;
break;
case MONO_TYPE_I4:
case MONO_TYPE_VOID:
*(gpointer*)ret = NULL;
break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
case MONO_TYPE_I:
case MONO_TYPE_U:
*(gint8*)ret = res;
break;
case MONO_TYPE_U1:
- case MONO_TYPE_BOOLEAN:
*(guint8*)ret = res;
break;
case MONO_TYPE_I2:
*(gint16*)ret = res;
break;
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
*(guint16*)ret = res;
break;
case MONO_TYPE_I4:
if (cfg->method->save_lmf) {
cfg->create_lmf_var = TRUE;
cfg->lmf_ir = TRUE;
-#ifdef HAVE_GET_TLS_ADDR
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
}
-/*
- * mini-arm64.h
+/**
+ * \file
*
* Copyright 2013 Xamarin Inc
*
#define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
#define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
#define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1
-#ifndef MONO_CROSS_COMPILE
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_HAVE_OP_GET_EX_OBJ 1
#define MONO_ARCH_HAVE_OBJC_GET_SELECTOR 1
#define MONO_ARCH_HAVE_SDB_TRAMPOLINES 1
-/*
- * mini-codegen.c: Arch independent code generation functionality
+/**
+ * \file
+ * Arch independent code generation functionality
*
* (C) 2003 Ximian, Inc.
*/
+/**
+ * \file
+ */
+
#include "config.h"
#include <stdio.h>
#endif
}
+/*
+ * mono_cross_helpers_run:
+ *
+ * Check that the offsets given by object-offsets.h match the offsets
+ * on the host.
+ */
void
mono_cross_helpers_run (void)
{
#if defined (HAS_CROSS_COMPILER_OFFSETS) && !defined (MONO_CROSS_COMPILE)
mono_metadata_cross_helpers_run ();
+ /* The metadata offsets are already checked above */
#define DISABLE_METADATA_OFFSETS
#define USE_CROSS_COMPILE_OFFSETS
#define DECL_OFFSET(struct,field) this_should_not_happen_for_cross_fields
-/*
- * mini-darwin.c: Darwin/MacOS support for Mono.
+/**
+ * \file
+ * Darwin/MacOS support for Mono.
*
* Authors:
* Mono Team (mono-list@lists.ximian.com)
-/*
- * mini-exceptions.c: generic exception support
+/**
+ * \file
+ * generic exception support
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_exception_walk_native_trace:
- * @ex: The exception object whose frames should be walked
- * @func: callback to call for each stack frame
- * @user_data: data passed to the callback
- *
+ * \param ex The exception object whose frames should be walked
+ * \param func callback to call for each stack frame
+ * \param user_data data passed to the callback
* This function walks the stacktrace of an exception. For
* each frame the callback function is called with the relevant info.
* The walk ends when no more stack frames are found or when the callback
}
/**
* mono_walk_stack_with_ctx:
- *
- * Unwind the current thread starting at @start_ctx.
- *
- * If @start_ctx is null, we capture the current context.
+ * Unwind the current thread starting at \p start_ctx.
+ * If \p start_ctx is null, we capture the current context.
*/
void
mono_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data)
/**
* mono_walk_stack_with_state:
- *
- * Unwind a thread described by @state.
+ * Unwind a thread described by \p state.
*
* State must be valid (state->valid == TRUE).
*
* If you are using this function to unwind another thread, make sure it is suspended.
*
- * If @state is null, we capture the current context.
+ * If \p state is null, we capture the current context.
*/
void
mono_walk_stack_with_state (MonoJitStackWalk func, MonoThreadUnwindState *state, MonoUnwindOptions unwind_options, void *user_data)
/**
* mono_walk_stack_full:
- * @func: callback to call for each stack frame
- * @domain: starting appdomain, can be NULL to use the current domain
- * @unwind_options: what extra information the unwinder should gather
- * @start_ctx: starting state of the stack walk, can be NULL.
- * @thread: the thread whose stack to walk, can be NULL to use the current thread
- * @lmf: the LMF of @thread, can be NULL to use the LMF of the current thread
- * @user_data: data passed to the callback
- *
+ * \param func callback to call for each stack frame
+ * \param domain starting appdomain, can be NULL to use the current domain
+ * \param unwind_options what extra information the unwinder should gather
+ * \param start_ctx starting state of the stack walk, can be NULL.
+ * \param thread the thread whose stack to walk, can be NULL to use the current thread
+ * \param lmf the LMF of \p thread, can be NULL to use the LMF of the current thread
+ * \param user_data data passed to the callback
* This function walks the stack of a thread, starting from the state
- * represented by start_ctx. For each frame the callback
+ * represented by \p start_ctx. For each frame the callback
* function is called with the relevant info. The walk ends when no more
* managed stack frames are found or when the callback returns a TRUE value.
*/
/**
* mono_handle_exception_internal:
- * @ctx: saved processor state
- * @obj: the exception object
- * @resume: whenever to resume unwinding based on the state in MonoJitTlsData.
+ * \param ctx saved processor state
+ * \param obj the exception object
+ * \param resume whenever to resume unwinding based on the state in \c MonoJitTlsData.
*/
static gboolean
mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resume, MonoJitInfo **out_ji)
if (is_outside) {
jit_tls->handler_block_return_address = NULL;
jit_tls->handler_block = NULL;
- mono_thread_resume_interruption (); /*We ignore the exception here, it will be raised later*/
+ mono_thread_resume_interruption (TRUE); /*We ignore the exception here, it will be raised later*/
}
}
/**
* mono_debugger_run_finally:
- * @start_ctx: saved processor state
- *
- * This method is called by the Mono Debugger to call all `finally' clauses of the
- * current stack frame. It's used when the user issues a `return' command to make
+ * \param start_ctx saved processor state
+ * This method is called by the Mono Debugger to call all \c finally clauses of the
+ * current stack frame. It's used when the user issues a \c return command to make
* the current stack frame return. After returning from this method, the debugger
* unwinds the stack one frame and gives control back to the user.
- *
* NOTE: This method is only used when running inside the Mono Debugger.
*/
void
/**
* mono_handle_exception:
- * @ctx: saved processor state
- * @obj: the exception object
+ * \param ctx saved processor state
+ * \param obj the exception object
*/
gboolean
mono_handle_exception (MonoContext *ctx, MonoObject *obj)
mono_runtime_stdout_fflush ();
}
-/*
+/**
* mono_print_thread_dump:
*
- * Print information about the current thread to stdout.
- * SIGCTX can be NULL, allowing this to be called from gdb.
+ * Print information about the current thread to stdout.
+ * \p sigctx can be NULL, allowing this to be called from gdb.
*/
void
mono_print_thread_dump (void *sigctx)
-/*
- * mini-gc.c: GC interface for the mono JIT
+/**
+ * \file
+ * GC interface for the mono JIT
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_GC_H__
#define __MONO_MINI_GC_H__
-/*
- * mini-generic-sharing.c: Support functions for generic sharing.
+/**
+ * \file
+ * Support functions for generic sharing.
*
* Author:
* Mark Probst (mark.probst@gmail.com)
return type;
else if (!type->byref && (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR)) {
MonoType *constraint = type->data.generic_param->gshared_constraint;
- /* The gparam serial encodes the type this gparam can represent */
+ /* The gparam constraint encodes the type this gparam can represent */
if (!constraint) {
return &mono_defaults.object_class->byval_arg;
} else {
/*
* mini_type_get_underlying_type:
*
- * Return the underlying type of TYPE, taking into account enums, byref, bool, char and generic
+ * Return the underlying type of TYPE, taking into account enums, byref, bool, char, ref types and generic
* sharing.
*/
MonoType*
case MONO_TYPE_CHAR:
return &mono_defaults.uint16_class->byval_arg;
case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
return &mono_defaults.object_class->byval_arg;
default:
return type;
-/*
- * mini-ia64.c: IA64 backend for the Mono code generator
+/**
+ * \file
+ * IA64 backend for the Mono code generator
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
{
ret_type = mini_get_underlying_type (sig->ret);
switch (ret_type->type) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
case MONO_TYPE_U1:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
cinfo->ret.storage = ArgInIReg;
cinfo->ret.reg = IA64_R8;
break;
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_IA64_H__
#define __MONO_MINI_IA64_H__
-/*
- * mini-llvm-cpp.h: LLVM backend
+/**
+ * \file
+ * LLVM backend
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
+/**
+ * \file
* Handle the differences between the llvm backend beeing embedded
* or loaded at runtime.
*/
-/*
- * mini-llvm.c: llvm "Backend" for the mono JIT
+/**
+ * \file
+ * llvm "Backend" for the mono JIT
*
* Copyright 2009-2011 Novell Inc (http://www.novell.com)
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
return LLVMInt16Type ();
case MONO_TYPE_U4:
return LLVMInt32Type ();
- case MONO_TYPE_BOOLEAN:
- return LLVMInt8Type ();
case MONO_TYPE_I8:
case MONO_TYPE_U8:
return LLVMInt64Type ();
- case MONO_TYPE_CHAR:
- return LLVMInt16Type ();
case MONO_TYPE_R4:
return LLVMFloatType ();
case MONO_TYPE_R8:
case MONO_TYPE_U:
return IntPtrType ();
case MONO_TYPE_OBJECT:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_STRING:
case MONO_TYPE_PTR:
return ObjRefType ();
case MONO_TYPE_VAR:
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_LLVM_H__
#define __MONO_MINI_LLVM_H__
-/*
- * mini-mips.c: MIPS backend for the Mono code generator
+/**
+ * \file
+ * MIPS backend for the Mono code generator
*
* Authors:
* Mark Mason (mason@broadcom.com)
DEBUG(printf("param %d: ", i));
simpletype = mini_get_underlying_type (sig->params [i]);
switch (simpletype->type) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
case MONO_TYPE_U1:
DEBUG(printf("1 byte\n"));
add_int32_arg (cinfo, &cinfo->args[n]);
n++;
break;
- case MONO_TYPE_CHAR:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
DEBUG(printf("2 bytes\n"));
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
cinfo->args [n].size = sizeof (gpointer);
add_int32_arg (cinfo, &cinfo->args[n]);
n++;
{
simpletype = mini_get_underlying_type (sig->ret);
switch (simpletype->type) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
case MONO_TYPE_U1:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
cinfo->ret.reg = mips_v0;
break;
case MONO_TYPE_U8:
/**
* mono_arch_compute_omit_fp:
- *
- * Determine whenever the frame pointer can be eliminated.
+ * Determine whether the frame pointer can be eliminated.
*/
static void
mono_arch_compute_omit_fp (MonoCompile *cfg)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_MIPS_H__
#define __MONO_MINI_MIPS_H__
-/*
- * magic-types.c: intrinsics for variable sized int/floats
+/**
+ * \file
+ * intrinsics for variable sized int/floats
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
+/**
+ * \file
* Copyright 2003 Ximian, Inc
* Copyright 2003-2011 Novell Inc
* Copyright 2011 Xamarin Inc
-/*
- * mini-posix.c: POSIX signal handling support for Mono.
+/**
+ * \file
+ * POSIX signal handling support for Mono.
*
* Authors:
* Mono Team (mono-list@lists.ximian.com)
-/*
- * mini-ppc.c: PowerPC backend for the Mono code generator
+/**
+ * \file
+ * PowerPC backend for the Mono code generator
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_PPC_H__
#define __MONO_MINI_PPC_H__
-
-/*
- * mini-runtime.c: Runtime code for the JIT
+/**
+ * \file
+ * Runtime code for the JIT
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
/**
* mono_pmip:
- * @ip: an instruction pointer address
+ * \param ip an instruction pointer address
*
* This method is used from a debugger to get the name of the
- * method at address @ip. This routine is typically invoked from
+ * method at address \p ip. This routine is typically invoked from
* a debugger like this:
*
* (gdb) print mono_pmip ($pc)
*
- * Returns: the name of the method at address @ip.
+ * \returns the name of the method at address \p ip.
*/
G_GNUC_UNUSED char *
mono_pmip (void *ip)
}
/**
- * mono_print_method_from_ip
- * @ip: an instruction pointer address
+ * mono_print_method_from_ip:
+ * \param ip an instruction pointer address
*
* This method is used from a debugger to get the name of the
- * method at address @ip.
+ * method at address \p ip.
*
- * This prints the name of the method at address @ip in the standard
- * output. Unlike mono_pmip which returns a string, this routine
+ * This prints the name of the method at address \p ip in the standard
+ * output. Unlike \c mono_pmip which returns a string, this routine
* prints the value on the standard output.
*/
-#ifdef __GNUC__
-/* Prevent the linker from optimizing this away in embedding setups to help debugging */
- __attribute__ ((__used__))
-#endif
-void
+MONO_ATTR_USED void
mono_print_method_from_ip (void *ip)
{
MonoJitInfo *ji;
* INFO can be NULL.
* Frees INFO.
*/
-void
-mono_tramp_info_register (MonoTrampInfo *info, MonoDomain *domain)
+static void
+mono_tramp_info_register_internal (MonoTrampInfo *info, MonoDomain *domain, gboolean aot)
{
MonoTrampInfo *copy;
mono_lldb_save_trampoline_info (info);
#ifdef MONO_ARCH_HAVE_UNWIND_TABLE
- mono_arch_unwindinfo_install_tramp_unwind_info (info->unwind_ops, info->code, info->code_size);
+ if (!aot)
+ mono_arch_unwindinfo_install_tramp_unwind_info (info->unwind_ops, info->code, info->code_size);
#endif
/* Only register trampolines that have unwind infos */
mono_tramp_info_free (info);
}
+void
+mono_tramp_info_register (MonoTrampInfo *info, MonoDomain *domain)
+{
+ mono_tramp_info_register_internal (info, domain, FALSE);
+}
+
+void
+mono_aot_tramp_info_register (MonoTrampInfo *info, MonoDomain *domain)
+{
+ mono_tramp_info_register_internal (info, domain, TRUE);
+}
+
static void
mono_tramp_info_cleanup (void)
{
MonoLMF *
mono_get_lmf (void)
{
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- return (MonoLMF *)mono_tls_get_lmf ();
-#else
MonoJitTlsData *jit_tls;
if ((jit_tls = mono_tls_get_jit_tls ()))
* (the thread object allocation can trigger a collection).
*/
return NULL;
-#endif
}
MonoLMF **
void
mono_set_lmf (MonoLMF *lmf)
{
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- mono_tls_set_lmf (lmf);
-#else
(*mono_get_lmf_addr ()) = lmf;
-#endif
}
MonoJitTlsData*
/**
* mono_thread_abort:
- * @obj: exception object
- *
- * abort the thread, print exception information and stack trace
+ * \param obj exception object
+ * Abort the thread, print exception information and stack trace
*/
static void
mono_thread_abort (MonoObject *obj)
jit_tls->first_lmf = lmf;
- /*
- * We can have 2 configurations for accessing lmf.
- * We can use only the tls_lmf_addr variable, which will store the address of
- * jit_tls->lmf, or, if we have MONO_ARCH_ENABLE_MONO_LMF_VAR enabled, we can
- * use both tls_lmf_addr and tls_lmf variables (in this case we need to have
- * means of getting the address of a tls variable; this can be done always
- * when using __thread or, on osx, even when using pthread)
- */
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- /* jit_tls->lmf is unused */
- mono_tls_set_lmf (lmf);
- mono_set_lmf_addr (mono_tls_get_tls_addr (TLS_KEY_LMF));
-#else
mono_set_lmf_addr (&jit_tls->lmf);
jit_tls->lmf = lmf;
-#endif
#ifdef MONO_ARCH_HAVE_TLS_INIT
mono_arch_tls_init ();
/**
* mono_jit_runtime_invoke:
- * @method: the method to invoke
- * @obj: this pointer
- * @params: array of parameter values.
- * @exc: Set to the exception raised in the managed method. If NULL, error is thrown instead.
- * If coop is enabled, this argument is ignored - all exceptoins are caught and propagated
- * through @error
- * @error: error or caught exception object
+ * \param method: the method to invoke
+ * \param obj: this pointer
+ * \param params: array of parameter values.
+ * \param exc: Set to the exception raised in the managed method.
+ * \param error: error or caught exception object
+ * If \p exc is NULL, \p error is thrown instead.
+ * If coop is enabled, \p exc argument is ignored -
+ * all exceptions are caught and propagated through \p error
*/
static MonoObject*
mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
#ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
- register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", TRUE);
+ register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", FALSE);
register_opcode_emulation (OP_LDIV, "__emul_ldiv", "long long long", mono_lldiv, "mono_lldiv", FALSE);
register_opcode_emulation (OP_LDIV_UN, "__emul_ldiv_un", "long long long", mono_lldiv_un, "mono_lldiv_un", FALSE);
register_opcode_emulation (OP_LREM, "__emul_lrem", "long long long", mono_llrem, "mono_llrem", FALSE);
register_icall_no_wrapper (mono_tls_get_thread, "mono_tls_get_thread", "ptr");
register_icall_no_wrapper (mono_tls_get_jit_tls, "mono_tls_get_jit_tls", "ptr");
register_icall_no_wrapper (mono_tls_get_domain, "mono_tls_get_domain", "ptr");
- register_icall_no_wrapper (mono_tls_get_lmf, "mono_tls_get_lmf", "ptr");
register_icall_no_wrapper (mono_tls_get_sgen_thread_info, "mono_tls_get_sgen_thread_info", "ptr");
register_icall_no_wrapper (mono_tls_get_lmf_addr, "mono_tls_get_lmf_addr", "ptr");
register_icall_no_wrapper (mono_tls_set_thread, "mono_tls_set_thread", "void ptr");
register_icall_no_wrapper (mono_tls_set_jit_tls, "mono_tls_set_jit_tls", "void ptr");
register_icall_no_wrapper (mono_tls_set_domain, "mono_tls_set_domain", "void ptr");
- register_icall_no_wrapper (mono_tls_set_lmf, "mono_tls_set_lmf", "void ptr");
register_icall_no_wrapper (mono_tls_set_sgen_thread_info, "mono_tls_set_sgen_thread_info", "void ptr");
register_icall_no_wrapper (mono_tls_set_lmf_addr, "mono_tls_set_lmf_addr", "void ptr");
}
/**
* mono_get_runtime_build_info:
- *
- * Return the runtime version + build date in string format.
* The returned string is owned by the caller. The returned string
- * format is "VERSION (FULL_VERSION BUILD_DATE)" and build date is optional.
+ * format is <code>VERSION (FULL_VERSION BUILD_DATE)</code> and build date is optional.
+ * \returns the runtime version + build date in string format.
*/
char*
mono_get_runtime_build_info (void)
-/*------------------------------------------------------------------*/
-/* */
-/* Name - mini-s390.c */
-/* */
-/* Function - S/390 backend for the Mono code generator. */
-/* */
-/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
-/* */
-/* Date - January, 2004 */
-/* */
-/* Derivation - From mini-x86 & mini-ppc by - */
-/* Paolo Molaro (lupus@ximian.com) */
-/* Dietmar Maurer (dietmar@ximian.com) */
-/* */
-/*------------------------------------------------------------------*/
+/**
+ * \file
+ * Function - S/390 backend for the Mono code generator.
+ *
+ * Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *
+ * Date - January, 2004
+ *
+ * Derivation - From mini-x86 & mini-ppc by -
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ */
/*------------------------------------------------------------------*/
/* D e f i n e s */
simpleType = ret_type->type;
enum_retvalue:
switch (simpleType) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
case MONO_TYPE_U1:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_I:
case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_STRING:
cinfo->ret.reg = s390_r2;
sz->code_size += 4;
break;
simpleType = ptype->type;
cinfo->args[nParm].type = simpleType;
switch (simpleType) {
- case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
case MONO_TYPE_U1:
cinfo->args[nParm].size = sizeof(char);
break;
case MONO_TYPE_I2:
case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
cinfo->args[nParm].size = sizeof(short);
add_general (&gr, sz, cinfo->args+nParm);
nParm++;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
cinfo->args[nParm].size = sizeof(gpointer);
add_general (&gr, sz, cinfo->args+nParm);
nParm++;
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_S390X_H__
#define __MONO_MINI_S390X_H__
#define MONO_ARCH_NEED_DIV_CHECK 1
#define MONO_ARCH_SIGNAL_STACK_SIZE 256*1024
#define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
#define MONO_ARCH_IMT_REG s390_r9
#define MONO_ARCH_VTABLE_REG S390_FIRST_ARG_REG
#define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
-/*
- * mini-sparc.c: Sparc backend for the Mono code generator
+/**
+ * \file
+ * Sparc backend for the Mono code generator
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_SPARC_H__
#define __MONO_MINI_SPARC_H__
-/*
+/**
+ * \file
* (C) 2003 Ximian, Inc.
* (C) 2003-2011 Novell, Inc.
* Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
/**
* mono_create_static_rgctx_trampoline:
- * @m: the mono method to create a trampoline for
- * @addr: the address to jump to (where the compiled code for M lives)
+ * \param m the mono method to create a trampoline for
+ * \param addr the address to jump to (where the compiled code for M lives)
*
* Creates a static rgctx trampoline for M which branches to ADDR which should
* point to the compiled code of M.
*
* On PPC addr should be an ftnptr and the return value is an ftnptr too.
*
- * Returns the generated static rgctx trampoline.
+ * \returns the generated static rgctx trampoline.
*/
gpointer
mono_create_static_rgctx_trampoline (MonoMethod *m, gpointer addr)
if (mono_aot_only)
res = mono_aot_get_static_rgctx_trampoline (ctx, addr);
else
- res = mono_arch_get_static_rgctx_trampoline (m, (MonoMethodRuntimeGenericContext *)ctx, addr);
+ res = mono_arch_get_static_rgctx_trampoline (ctx, addr);
mono_domain_lock (domain);
/* Duplicates inserted while we didn't hold the lock are OK */
if (!resume_ip) /*this should not happen, but we should avoid crashing */
exc = mono_get_exception_execution_engine ("Invalid internal state, resuming abort after handler block but no resume ip found");
else
- exc = mono_thread_resume_interruption ();
+ exc = mono_thread_resume_interruption (TRUE);
if (exc) {
mono_handle_exception (&ctx, (MonoObject *)exc);
-/*
- * mini-unwind.h: Stack Unwinding Interface
+/**
+ * \file
+ * Stack Unwinding Interface
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * mini-windows-dllmain.c: DllMain entry point.
+/**
+ * \file
+ * DllMain entry point.
*
* (C) 2002-2003 Ximian, Inc.
* (C) 2003-2006 Novell, Inc.
-/*
- * mini-windows-uwp.c: UWP profiler stat support for Mono.
+/**
+ * \file
+ * UWP profiler stat support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mini-posix.c: POSIX signal handling support for Mono.
+/**
+ * \file
+ * POSIX signal handling support for Mono.
*
* Authors:
* Mono Team (mono-list@lists.ximian.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_WINDOWS_H__
#define __MONO_MINI_WINDOWS_H__
-/*
- * mini-x86-gsharedvt.c: gsharedvt support code for x86
+/**
+ * \file
+ * gsharedvt support code for x86
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * mini-x86.c: x86 backend for the Mono code generator
+/**
+ * \file
+ * x86 backend for the Mono code generator
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
cinfo->ret.storage = ArgInIReg;
cinfo->ret.reg = X86_EAX;
break;
case MONO_TYPE_U:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
add_general (&gr, param_regs, &stack_size, ainfo);
break;
case MONO_TYPE_GENERICINST:
* have locals larger than 8 bytes we need to make sure that
* they have the appropriate offset.
*/
- if (MONO_ARCH_FRAME_ALIGNMENT > 8 && locals_stack_align > 8)
- offset += MONO_ARCH_FRAME_ALIGNMENT - sizeof (gpointer) * 2;
+ if (MONO_ARCH_FRAME_ALIGNMENT > 8 && locals_stack_align > 8) {
+ int extra_size = MONO_ARCH_FRAME_ALIGNMENT - sizeof (gpointer) * 2;
+ offset += extra_size;
+ locals_stack_size += extra_size;
+ }
for (i = cfg->locals_start; i < cfg->num_varinfo; i++) {
if (offsets [i] != -1) {
MonoInst *inst = cfg->varinfo [i];
if (cfg->method->save_lmf) {
cfg->create_lmf_var = TRUE;
cfg->lmf_ir = TRUE;
-#ifndef HOST_WIN32
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
cfg->arch_eh_jit_info = 1;
}
}
+#define NEW_INS(cfg,ins,dest,op) do { \
+ MONO_INST_NEW ((cfg), (dest), (op)); \
+ (dest)->cil_code = (ins)->cil_code; \
+ mono_bblock_insert_before_ins (bb, ins, (dest)); \
+ } while (0)
+
/*
* mono_arch_lowering_pass:
*
break;
mono_decompose_op_imm (cfg, bb, ins);
break;
+#ifdef MONO_ARCH_SIMD_INTRINSICS
+ case OP_EXPAND_I1: {
+ MonoInst *temp;
+ int temp_reg1 = mono_alloc_ireg (cfg);
+ int temp_reg2 = mono_alloc_ireg (cfg);
+ int original_reg = ins->sreg1;
+
+ NEW_INS (cfg, ins, temp, OP_ICONV_TO_U1);
+ temp->sreg1 = original_reg;
+ temp->dreg = temp_reg1;
+
+ NEW_INS (cfg, ins, temp, OP_SHL_IMM);
+ temp->sreg1 = temp_reg1;
+ temp->dreg = temp_reg2;
+ temp->inst_imm = 8;
+
+ NEW_INS (cfg, ins, temp, OP_IOR);
+ temp->sreg1 = temp->dreg = temp_reg2;
+ temp->sreg2 = temp_reg1;
+
+ ins->opcode = OP_EXPAND_I2;
+ ins->sreg1 = temp_reg2;
+ }
+ break;
+#endif
default:
break;
}
}
break;
- case OP_EXPAND_I1:
- /*FIXME this causes a partial register stall, maybe it would not be that bad to use shift + mask + or*/
- /*The +4 is to get a mov ?h, ?l over the same reg.*/
- x86_mov_reg_reg (code, ins->dreg + 4, ins->dreg, 1);
- x86_sse_alu_pd_reg_reg_imm (code, X86_SSE_PINSRW, ins->dreg, ins->sreg1, 0);
- x86_sse_alu_pd_reg_reg_imm (code, X86_SSE_PINSRW, ins->dreg, ins->sreg1, 1);
- x86_sse_shift_reg_imm (code, X86_SSE_PSHUFD, ins->dreg, ins->dreg, 0);
- break;
case OP_EXPAND_I2:
x86_sse_alu_pd_reg_reg_imm (code, X86_SSE_PINSRW, ins->dreg, ins->sreg1, 0);
x86_sse_alu_pd_reg_reg_imm (code, X86_SSE_PINSRW, ins->dreg, ins->sreg1, 1);
/* check if we need to restore protection of the stack after a stack overflow */
if (!cfg->compile_aot && mono_arch_have_fast_tls () && mono_tls_get_tls_offset (TLS_KEY_JIT_TLS) != -1) {
code = mono_x86_emit_tls_get (code, X86_ECX, mono_tls_get_tls_offset (TLS_KEY_JIT_TLS));
- } else {
- gpointer func = mono_tls_get_tls_getter (TLS_KEY_JIT_TLS, TRUE);
- /* FIXME use tls only from IR level */
- x86_xchg_reg_reg (code, X86_EAX, X86_ECX, 4);
- code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD, func);
- x86_xchg_reg_reg (code, X86_EAX, X86_ECX, 4);
- }
- /* we load the value in a separate instruction: this mechanism may be
- * used later as a safer way to do thread interruption
- */
- x86_mov_reg_membase (code, X86_ECX, X86_ECX, MONO_STRUCT_OFFSET (MonoJitTlsData, restore_stack_prot), 4);
- x86_alu_reg_imm (code, X86_CMP, X86_ECX, 0);
- patch = code;
- x86_branch8 (code, X86_CC_Z, 0, FALSE);
- /* note that the call trampoline will preserve eax/edx */
- x86_call_reg (code, X86_ECX);
- x86_patch (patch, code);
+ /* we load the value in a separate instruction: this mechanism may be
+ * used later as a safer way to do thread interruption
+ */
+ x86_mov_reg_membase (code, X86_ECX, X86_ECX, MONO_STRUCT_OFFSET (MonoJitTlsData, restore_stack_prot), 4);
+ x86_alu_reg_imm (code, X86_CMP, X86_ECX, 0);
+ patch = code;
+ x86_branch8 (code, X86_CC_Z, 0, FALSE);
+ /* note that the call trampoline will preserve eax/edx */
+ x86_call_reg (code, X86_ECX);
+ x86_patch (patch, code);
+ }
/* restore caller saved regs */
if (cfg->used_int_regs & (1 << X86_EBX)) {
}
/**
- * mono_breakpoint_clean_code:
+ * \return TRUE if no sw breakpoint was present.
*
- * Copy @size bytes from @code - @offset to the buffer @buf. If the debugger inserted software
+ * Copy \p size bytes from \p code - \p offset to the buffer \p buf. If the debugger inserted software
* breakpoints in the original code, they are removed in the copy.
- *
- * Returns TRUE if no sw breakpoint was present.
*/
gboolean
mono_breakpoint_clean_code (guint8 *method_start, guint8 *code, int offset, guint8 *buf, int size)
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_X86_H__
#define __MONO_MINI_X86_H__
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
#define MONO_ARCH_NEED_GOT_VAR 1
-#ifndef HOST_WIN32
-/* X86 uses jit_tls->lmf (See emit_push_lmf ()) */
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_IMT_REG X86_EDX
#define MONO_ARCH_VTABLE_REG X86_EDX
#define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
-/*
- * mini.c: The new Mono code generator.
+/**
+ * \file
+ * The new Mono code generator.
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
* mini_get_underlying_type:
*
* Return the type the JIT will use during compilation.
- * Handles: byref, enums, native types, generic sharing.
+ * Handles: byref, enums, native types, bool/char, ref types, generic sharing.
* For gsharedvt types, it will return the original VAR/MVAR.
*/
MonoType*
-/*
+/**
+ * \file
* Copyright 2002-2003 Ximian Inc
* Copyright 2003-2011 Novell Inc
* Copyright 2011 Xamarin Inc
typedef struct {
gpointer end_of_stack;
guint32 stack_size;
- /* !defined(HAVE_KW_THREAD) || !defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) */
MonoLMF *lmf;
MonoLMF *first_lmf;
gpointer restore_stack_prot;
* Whenever to use the mono_lmf TLS variable instead of indirection through the
* mono_lmf_addr TLS variable.
*/
- guint lmf_ir_mono_lmf : 1;
guint gen_write_barriers : 1;
guint init_ref_vars : 1;
guint extend_live_ranges : 1;
int val);
MonoTrampInfo* mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops);
void mono_tramp_info_free (MonoTrampInfo *info);
+void mono_aot_tramp_info_register (MonoTrampInfo *info, MonoDomain *domain);
void mono_tramp_info_register (MonoTrampInfo *info, MonoDomain *domain);
int mini_exception_id_by_name (const char *name);
gboolean mini_type_is_hfa (MonoType *t, int *out_nfields, int *out_esize) MONO_LLVM_INTERNAL;
void mono_arch_save_unwind_info (MonoCompile *cfg);
void mono_arch_register_lowlevel_calls (void);
gpointer mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr);
-gpointer mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr);
+gpointer mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr);
gpointer mono_arch_get_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *method, int vt_offset);
gpointer mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr);
void mono_arch_patch_callsite (guint8 *method_start, guint8 *code, guint8 *addr);
+/**
+ * \file
+ */
+
#if defined(__native_client__) && defined(__x86_64__)
typedef guint64 regmask_t;
#else
-/*
- * seq-points.c: Sequence Points functions
+/**
+ * \file
+ * Sequence Points functions
*
* Authors:
* Marcos Henrich (marcos.henrich@xamarin.com)
-/*
+/**
+ * \file
* Copyright 2014 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
-/*
- * simd-instrisics.c: simd support for intrinsics
+/**
+ * \file
+ * simd support for intrinsics
*
* Author:
* Rodrigo Kumpera (rkumpera@novell.com)
#include "ir-emit.h"
#include "mono/utils/bsearch.h"
#include <mono/metadata/abi-details.h>
+#include <mono/metadata/reflection-internals.h>
/*
General notes on SIMD intrinsics
return -1;
}
+static int
+type_to_pxor_op (MonoType *t)
+{
+ /*
+ * These opcodes have the same semantics, but using the
+ * correctly typed version is better for performance.
+ */
+ switch (t->type) {
+ case MONO_TYPE_R4:
+ return OP_XORPS;
+ case MONO_TYPE_R8:
+ return OP_XORPD;
+ default:
+ return OP_PXOR;
+ }
+}
+
+static int
+type_to_pand_op (MonoType *t)
+{
+ switch (t->type) {
+ case MONO_TYPE_R4:
+ return OP_ANDPS;
+ case MONO_TYPE_R8:
+ return OP_ANDPD;
+ default:
+ return OP_PAND;
+ }
+}
+
+static int
+type_to_por_op (MonoType *t)
+{
+ switch (t->type) {
+ case MONO_TYPE_R4:
+ return OP_ORPS;
+ case MONO_TYPE_R8:
+ return OP_ORPD;
+ default:
+ return OP_POR;
+ }
+}
+
+static int
+type_to_pmin_op (MonoType *t)
+{
+ switch (t->type) {
+ case MONO_TYPE_R4:
+ return OP_MINPS;
+ case MONO_TYPE_R8:
+ return OP_MINPD;
+ case MONO_TYPE_I1:
+ return OP_PMINB;
+ case MONO_TYPE_U1:
+ return OP_PMINB_UN;
+ case MONO_TYPE_I2:
+ return OP_PMINW;
+ case MONO_TYPE_U2:
+ return OP_PMINW_UN;
+ case MONO_TYPE_I4:
+ return OP_PMIND;
+ case MONO_TYPE_U4:
+ return OP_PMIND_UN;
+ default:
+ return -1;
+ }
+}
+
+static int
+type_to_pmax_op (MonoType *t)
+{
+ switch (t->type) {
+ case MONO_TYPE_R4:
+ return OP_MAXPS;
+ case MONO_TYPE_R8:
+ return OP_MAXPD;
+ case MONO_TYPE_I1:
+ return OP_PMAXB;
+ case MONO_TYPE_U1:
+ return OP_PMAXB_UN;
+ case MONO_TYPE_I2:
+ return OP_PMAXW;
+ case MONO_TYPE_U2:
+ return OP_PMAXW_UN;
+ case MONO_TYPE_I4:
+ return OP_PMAXD;
+ case MONO_TYPE_U4:
+ return OP_PMAXD_UN;
+ default:
+ return -1;
+ }
+}
+
static int
get_simd_vreg_or_expanded_scalar (MonoCompile *cfg, MonoClass *klass, MonoType *param_type, MonoInst *src)
{
return NULL;
}
+static void
+assert_handled (MonoCompile *cfg, MonoMethod *method)
+{
+ MonoCustomAttrInfo *cattr;
+ MonoError error;
+
+ if (cfg->verbose_level > 1) {
+ cattr = mono_custom_attrs_from_method_checked (method, &error);
+
+ if (cattr) {
+ gboolean has_attr = FALSE;
+ for (int i = 0; i < cattr->num_attrs; ++i)
+ if (cattr->attrs [i].ctor && (!strcmp (cattr->attrs [i].ctor->klass->name, "JitIntrinsicAttribute")))
+ has_attr = TRUE;
+ if (has_attr) {
+ printf ("SIMD intrinsic unhandled: %s\n", mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL));
+ fflush (stdout);
+ //g_assert_not_reached ();
+ }
+ mono_custom_attrs_free (cattr);
+ }
+ }
+}
+
// The entries should be ordered by name
// System.Numerics.Vector2/Vector3/Vector4
static const SimdIntrinsic vector2_intrinsics[] = {
*/
intrins = (const SimdIntrinsic*)mono_binary_search (cmethod->name, vector2_intrinsics, sizeof (vector2_intrinsics) / sizeof (SimdIntrinsic), sizeof (SimdIntrinsic), &simd_intrinsic_compare_by_name);
if (!intrins) {
- //printf ("%s\n", mono_method_full_name (cmethod, 1));
+ assert_handled (cfg, cmethod);
return NULL;
}
break;
}
+ assert_handled (cfg, cmethod);
+
if (cfg->verbose_level > 1) {
char *name = mono_method_full_name (cmethod, TRUE);
printf (" SIMD method %s not handled.\n", name);
return NULL;
}
+/* These should be ordered by name */
static const SimdIntrinsic vector_t_intrinsics[] = {
{ SN_ctor },
{ SN_Abs },
{ SN_GreaterThanOrEqual },
{ SN_LessThan },
{ SN_LessThanOrEqual },
+ { SN_Max },
+ { SN_Min },
{ SN_get_AllOnes, OP_XONES },
{ SN_get_Count },
{ SN_get_Item },
{ SN_get_Zero, OP_XZERO },
{ SN_op_Addition },
+ { SN_op_BitwiseAnd },
+ { SN_op_BitwiseOr },
{ SN_op_Division },
+ { SN_op_ExclusiveOr },
{ SN_op_Explicit },
{ SN_op_Multiply },
{ SN_op_Subtraction }
intrins = (const SimdIntrinsic*)mono_binary_search (cmethod->name, vector_t_intrinsics, sizeof (vector_t_intrinsics) / sizeof (SimdIntrinsic), sizeof (SimdIntrinsic), &simd_intrinsic_compare_by_name);
if (!intrins) {
- //printf ("%s\n", mono_method_full_name (cmethod, 1));
+ assert_handled (cfg, cmethod);
return NULL;
}
case SN_Equals:
if (fsig->param_count == 1 && fsig->ret->type == MONO_TYPE_BOOLEAN && mono_metadata_type_equal (fsig->params [0], type))
return simd_intrinsic_emit_equality_op (cfg, cmethod, args, type_to_comp_op (etype), SIMD_COMP_EQ);
- if (fsig->param_count == 2 && fsig->ret->type == MONO_TYPE_BOOLEAN && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type))
+ if (fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, type) && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type))
return simd_intrinsic_emit_binary_op (cfg, type_to_comp_op (etype), 0, cmethod->klass, fsig->params [0], fsig->params [1], args [0], args [1]);
break;
case SN_GreaterThan:
case SN_GreaterThanOrEqual:
- case SN_LessThan: {
+ case SN_LessThan:
+ case SN_LessThanOrEqual: {
MonoInst *cmp1, *cmp2;
int eq_op, gt_op;
case SN_op_Addition:
case SN_op_Subtraction:
case SN_op_Multiply:
- case SN_op_Division: {
+ case SN_op_Division:
+ case SN_op_ExclusiveOr:
+ case SN_op_BitwiseAnd:
+ case SN_op_BitwiseOr:
+ case SN_Max:
+ case SN_Min: {
if (!(fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, fsig->params [0]) && mono_metadata_type_equal (fsig->params [0], fsig->params [1])))
break;
int op = 0;
case SN_op_Division:
op = type_to_pdiv_op (etype);
break;
+ case SN_op_ExclusiveOr:
+ op = type_to_pxor_op (etype);
+ break;
+ case SN_op_BitwiseAnd:
+ op = type_to_pand_op (etype);
+ break;
+ case SN_op_BitwiseOr:
+ op = type_to_por_op (etype);
+ break;
+ case SN_Min:
+ op = type_to_pmin_op (etype);
+ break;
+ case SN_Max:
+ op = type_to_pmax_op (etype);
+ break;
default:
g_assert_not_reached ();
}
break;
}
+ assert_handled (cfg, cmethod);
+
if (cfg->verbose_level > 1) {
char *name = mono_method_full_name (cmethod, TRUE);
printf (" SIMD method %s not handled.\n", name);
-/*
- * ssa.c: Static single assign form support for the JIT compiler.
+/**
+ * \file
+ * Static single assign form support for the JIT compiler.
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
/**
* mono_ssa_rename_vars:
- *
- * Implement renaming of SSA variables. Also compute def-use information in parallel.
- * @stack_history points to an area of memory which can be used for storing changes
+ * Implement renaming of SSA variables. Also compute def-use information in parallel.
+ * \p stack_history points to an area of memory which can be used for storing changes
* made to the stack, so they can be reverted later.
*/
static void
+/**
+ * \file
+ */
+
#ifndef __MONO_SUPPORT_S390X_H__
#define __MONO_SUPPORT_S390X_H__
+/**
+ * \file
+ */
#include "config.h"
#include "tasklets.h"
+/**
+ * \file
+ */
+
#ifndef __MONO_TASKLETS_H__
#define __MONO_TASKLETS_H__
-/*
- * trace.c: Tracing facilities for the Mono Runtime.
+/**
+ * \file
+ * Tracing facilities for the Mono Runtime.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_TRACE_H__
#define __MONO_TRACE_H__
#include <glib.h>
-/*
- * tramp-amd64-gsharedvt.c: libcorkscrew-based native unwinder
+/**
+ * \file
+ * libcorkscrew-based native unwinder
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * tramp-amd64.c: JIT trampoline code for amd64
+/**
+ * \file
+ * JIT trampoline code for amd64
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/*
* mono_arch_get_static_rgctx_trampoline:
*
- * Create a trampoline which sets RGCTX_REG to MRGCTX, then jumps to ADDR.
+ * Create a trampoline which sets RGCTX_REG to ARG, then jumps to ADDR.
*/
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start;
GSList *unwind_ops;
unwind_ops = mono_arch_get_cie_program ();
- amd64_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, mrgctx);
+ amd64_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, arg);
amd64_jump_code (code, addr);
g_assert ((code - start) < buf_len);
g_assert_checked (mono_arch_unwindinfo_validate_size (unwind_ops, MONO_TRAMPOLINE_UNWINDINFO_SIZE(0)));
mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
{
#ifdef ENABLE_INTERPRETER
- const int gregs_num = 8;
+ const int gregs_num = 12;
const int fregs_num = 3;
guint8 *start = NULL, *code, *label_gexits [gregs_num], *label_fexits [fregs_num], *label_leave_tramp [3], *label_is_float_ret;
MonoJumpInfo *ji = NULL;
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
g_assert_not_reached ();
return NULL;
-/*
- * tramp-arm-gsharedvt.c: gsharedvt support code for arm
+/**
+ * \file
+ * gsharedvt support code for arm
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * tramp-arm.c: JIT trampoline code for ARM
+/**
+ * \file
+ * JIT trampoline code for ARM
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
*(guint8**)jump_entry = addr;
}
+gpointer
+mono_arm_handler_block_trampoline_helper (gpointer *ptr)
+{
+ MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
+ return jit_tls->handler_block_return_address;
+}
+
#ifndef DISABLE_JIT
#define arm_is_imm12(v) ((int)(v) > -4096 && (int)(v) < 4096)
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start;
GSList *unwind_ops;
ARM_LDR_IMM (code, MONO_ARCH_RGCTX_REG, ARMREG_PC, 0);
ARM_LDR_IMM (code, ARMREG_PC, ARMREG_PC, 0);
- *(guint32*)code = (guint32)mrgctx;
+ *(guint32*)code = (guint32)arg;
code += 4;
*(guint32*)code = (guint32)addr;
code += 4;
return buf;
}
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr)
-{
- MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
- return jit_tls->handler_block_return_address;
-}
-
gpointer
mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
{
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
g_assert_not_reached ();
return NULL;
-/*
- * tramp-arm64-gsharedvt.c: gsharedvt support code for arm64
+/**
+ * \file
+ * gsharedvt support code for arm64
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * tramp-arm64.c: JIT trampoline code for ARM64
+/**
+ * \file
+ * JIT trampoline code for ARM64
*
* Copyright 2013 Xamarin Inc
*
return ((guint32*)plt_entry) [4];
}
+gpointer
+mono_arm_handler_block_trampoline_helper (gpointer *ptr)
+{
+ MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
+ return jit_tls->handler_block_return_address;
+}
+
#ifndef DISABLE_JIT
guchar*
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start;
guint32 buf_len = 32;
MonoDomain *domain = mono_domain_get ();
start = code = mono_domain_code_reserve (domain, buf_len);
- code = mono_arm_emit_imm64 (code, MONO_ARCH_RGCTX_REG, (guint64)mrgctx);
+ code = mono_arm_emit_imm64 (code, MONO_ARCH_RGCTX_REG, (guint64)arg);
code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)addr);
arm_brx (code, ARMREG_IP0);
return buf;
}
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr)
-{
- MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
- return jit_tls->handler_block_return_address;
-}
-
gpointer
mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
{
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
g_assert_not_reached ();
return NULL;
-/*
- * tramp-ia64.c: JIT trampoline code for ia64
+/**
+ * \file
+ * JIT trampoline code for ia64
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * tramp-mips.c: JIT trampoline code for MIPS
+/**
+ * \file
+ * JIT trampoline code for MIPS
*
* Authors:
* Mark Mason (mason@broadcom.com)
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start;
int buf_len;
start = code = mono_domain_code_reserve (domain, buf_len);
- mips_load (code, MONO_ARCH_RGCTX_REG, mrgctx);
+ mips_load (code, MONO_ARCH_RGCTX_REG, arg);
mips_load (code, mips_at, addr);
mips_jr (code, mips_at);
mips_nop (code);
-/*
- * tramp-ppc.c: JIT trampoline code for PowerPC
+/**
+ * \file
+ * JIT trampoline code for PowerPC
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
/*
* mono_arch_get_static_rgctx_trampoline:
*
- * Create a trampoline which sets RGCTX_REG to MRGCTX, then jumps to ADDR.
+ * Create a trampoline which sets RGCTX_REG to ARG, then jumps to ADDR.
*/
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start, *p;
guint8 imm_buf [128];
/* Compute size of code needed to emit mrgctx */
p = imm_buf;
- ppc_load_ptr (p, MONO_ARCH_RGCTX_REG, mrgctx);
+ ppc_load_ptr (p, MONO_ARCH_RGCTX_REG, arg);
imm_size = p - imm_buf;
mono_domain_lock (domain);
-/*------------------------------------------------------------------*/
-/* */
-/* Name - tramp-s390x.c */
-/* */
-/* Function - JIT trampoline code for S/390. */
-/* */
-/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
-/* */
-/* Date - January, 2004 */
-/* */
-/* Derivation - From exceptions-x86 & exceptions-ppc */
-/* Paolo Molaro (lupus@ximian.com) */
-/* Dietmar Maurer (dietmar@ximian.com) */
-/* */
-/* Copyright - 2001 Ximian, Inc. */
-/* Licensed under the MIT license. See LICENSE file in the project root for full license information.*/
-/*------------------------------------------------------------------*/
+/**
+ * \file
+ * Function - JIT trampoline code for S/390.
+ *
+ * Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ *
+ * Date - January, 2004
+ *
+ * Derivation - From exceptions-x86 & exceptions-ppc
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * Copyright - 2001 Ximian, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ *
+ */
/*------------------------------------------------------------------*/
/* D e f i n e s */
/* */
/* Name - mono_arch_get_static_rgctx_trampoline */
/* */
-/* Function - Create a trampoline which sets RGCTX_REG to MRGCTX*/
+/* Function - Create a trampoline which sets RGCTX_REG to ARG */
/* then jumps to ADDR. */
/* */
/*------------------------------------------------------------------*/
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m,
- MonoMethodRuntimeGenericContext *mrgctx,
- gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg,
+ gpointer addr)
{
guint8 *code, *start;
gint32 displace;
int buf_len;
- char trampName[128];
MonoDomain *domain = mono_domain_get ();
start = code = mono_domain_code_reserve (domain, buf_len);
- S390_SET (code, MONO_ARCH_RGCTX_REG, mrgctx);
+ S390_SET (code, MONO_ARCH_RGCTX_REG, arg);
displace = ((uintptr_t) addr - (uintptr_t) code) / 2;
s390_jg (code, displace);
g_assert ((code - start) < buf_len);
mono_arch_flush_icache (start, code - start);
mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
- snprintf(trampName, sizeof(trampName), "%s_rgctx_trampoline", m->name);
-
- mono_tramp_info_register (mono_tramp_info_create (trampName, start, code - start, NULL, NULL), domain);
+ mono_tramp_info_register (mono_tramp_info_create (NULL, start, code - start, NULL, NULL), domain);
return(start);
}
-/*
- * tramp-sparc.c: JIT trampoline code for Sparc
+/**
+ * \file
+ * JIT trampoline code for Sparc
*
* Authors:
* Mark Crichton (crichton@gimp.org)
-/*
- * tramp-x86-gsharedvt.c: gsharedvt support code for x86
+/**
+ * \file
+ * gsharedvt support code for x86
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * tramp-x86.c: JIT trampoline code for x86
+/**
+ * \file
+ * JIT trampoline code for x86
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
}
gpointer
-mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+mono_arch_get_static_rgctx_trampoline (gpointer arg, gpointer addr)
{
guint8 *code, *start;
int buf_len;
unwind_ops = mono_arch_get_cie_program ();
- x86_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, mrgctx);
+ x86_mov_reg_imm (code, MONO_ARCH_RGCTX_REG, arg);
x86_jump_code (code, addr);
g_assert ((code - start) <= buf_len);
+/**
+ * \file
+ */
+
#include <config.h>
#include <mono/utils/mono-compiler.h>
-/*
- * unwind.c: Stack Unwinding Interface
+/**
+ * \file
+ * Stack Unwinding Interface
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * xdebug.c: Support for emitting gdb debug info for JITted code.
+/**
+ * \file
+ * Support for emitting gdb debug info for JITted code.
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
void
mono_profiler_startup (const char *desc);
-/* the entry point */
+/**
+ * mono_profiler_startup:
+ * the entry point
+ */
void
mono_profiler_startup (const char *desc)
{
-/*
- * gc-internal-agnostic.h: Mono-agnostic GC interface.
+/**
+ * \file
+ * Mono-agnostic GC interface.
*
* Copyright (C) 2015 Xamarin Inc
*
-/*
- * sgen-alloc.c: Object allocation routines + managed allocators
+/**
+ * \file
+ * Object allocation routines + managed allocators
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * sgen-archdep.h: Architecture dependent parts of SGen.
+/**
+ * \file
+ * Architecture dependent parts of SGen.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-array-list.c: A pointer array list that doesn't require reallocs
+/**
+ * \file
+ * A pointer array list that doesn't require reallocs
*
* Copyright (C) 2016 Xamarin Inc
*
-/*
- * sgen-array-list.h: A pointer array that doesn't use reallocs.
+/**
+ * \file
+ * A pointer array that doesn't use reallocs.
*
* Copyright (C) 2016 Xamarin Inc
*
-/*
- * sgen-cardtable.c: Card table implementation for sgen
+/**
+ * \file
+ * Card table implementation for sgen
*
* Author:
* Rodrigo Kumpera (rkumpera@novell.com)
-/*
+/**
+ * \file
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
*
-/*
- * sgen-client.h: SGen client interface.
+/**
+ * \file
+ * SGen client interface.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
- * sgen-conf.h: Tunable parameters and debugging switches.
+/**
+ * \file
+ * Tunable parameters and debugging switches.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-copy-object.h: This is where objects are copied.
+/**
+ * \file
+ * This is where objects are copied.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-debug.c: Collector debugging
+/**
+ * \file
+ * Collector debugging
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * sgen-descriptor.c: GC descriptors describe object layout.
+/**
+ * \file
+ * GC descriptors describe object layout.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
}
}
+/**
+ * mono_gc_make_descr_from_bitmap:
+ */
SgenDescriptor
mono_gc_make_descr_from_bitmap (gsize *bitmap, int numbits)
{
-/*
- * sgen-descriptor.h: GC descriptors describe object layout.
-
+/**
+ * \file
+ * GC descriptors describe object layout.
+ *
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
-/*
- * sgen-fin-weak-hash.c: Finalizers and weak links.
+/**
+ * \file
+ * Finalizers and weak links.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * sgen-gc.c: Simple generational GC.
+/**
+ * \file
+ * Simple generational GC.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
* the conservative scan, otherwise by the remembered set scan.
*/
+/**
+ * mono_gc_wbarrier_arrayref_copy:
+ */
void
mono_gc_wbarrier_arrayref_copy (gpointer dest_ptr, gpointer src_ptr, int count)
{
remset.wbarrier_arrayref_copy (dest_ptr, src_ptr, count);
}
+/**
+ * mono_gc_wbarrier_generic_nostore:
+ */
void
mono_gc_wbarrier_generic_nostore (gpointer ptr)
{
remset.wbarrier_generic_nostore (ptr);
}
+/**
+ * mono_gc_wbarrier_generic_store:
+ */
void
mono_gc_wbarrier_generic_store (gpointer ptr, GCObject* value)
{
sgen_dummy_use (value);
}
-/* Same as mono_gc_wbarrier_generic_store () but performs the store
+/**
+ * mono_gc_wbarrier_generic_store_atomic:
+ * Same as \c mono_gc_wbarrier_generic_store but performs the store
* as an atomic operation with release semantics.
*/
void
-/*
- * sgen-gc.c: Simple generational GC.
+/**
+ * \file
+ * Simple generational GC.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-gchandles.c: SGen GC handles.
+/**
+ * \file
+ * SGen GC handles.
*
* Copyright (C) 2015 Xamarin Inc
*
/**
* mono_gchandle_new:
- * @obj: managed object to get a handle for
- * @pinned: whether the object should be pinned
- *
+ * \param obj managed object to get a handle for
+ * \param pinned whether the object should be pinned
* This returns a handle that wraps the object, this is used to keep a
* reference to a managed object from the unmanaged world and preventing the
* object from being disposed.
*
- * If @pinned is false the address of the object can not be obtained, if it is
+ * If \p pinned is false the address of the object can not be obtained, if it is
* true the address of the object can be obtained. This will also pin the
* object so it will not be possible by a moving garbage collector to move the
* object.
*
- * Returns: a handle that can be used to access the object from
- * unmanaged code.
+ * \returns a handle that can be used to access the object from unmanaged code.
*/
guint32
mono_gchandle_new (GCObject *obj, gboolean pinned)
/**
* mono_gchandle_new_weakref:
- * @obj: managed object to get a handle for
- * @track_resurrection: Determines how long to track the object, if this is set to TRUE, the object is tracked after finalization, if FALSE, the object is only tracked up until the point of finalization.
+ * \param obj managed object to get a handle for
+ * \param track_resurrection Determines how long to track the object, if this is set to TRUE, the object is tracked after finalization, if FALSE, the object is only tracked up until the point of finalization.
*
* This returns a weak handle that wraps the object, this is used to
* keep a reference to a managed object from the unmanaged world.
- * Unlike the mono_gchandle_new the object can be reclaimed by the
+ * Unlike the \c mono_gchandle_new the object can be reclaimed by the
* garbage collector. In this case the value of the GCHandle will be
* set to zero.
*
- * If @track_resurrection is TRUE the object will be tracked through
+ * If \p track_resurrection is TRUE the object will be tracked through
* finalization and if the object is resurrected during the execution
* of the finalizer, then the returned weakref will continue to hold
- * a reference to the object. If @track_resurrection is FALSE, then
+ * a reference to the object. If \p track_resurrection is FALSE, then
* the weak reference's target will become NULL as soon as the object
* is passed on to the finalizer.
*
- * Returns: a handle that can be used to access the object from
+ * \returns a handle that can be used to access the object from
* unmanaged code.
*/
guint32
/**
* mono_gchandle_get_target:
- * @gchandle: a GCHandle's handle.
+ * \param gchandle a GCHandle's handle.
*
- * The handle was previously created by calling `mono_gchandle_new` or
- * `mono_gchandle_new_weakref`.
+ * The handle was previously created by calling \c mono_gchandle_new or
+ * \c mono_gchandle_new_weakref.
*
- * Returns a pointer to the `MonoObject*` represented by the handle or
+ * \returns a pointer to the \c MonoObject* represented by the handle or
* NULL for a collected object if using a weakref handle.
*/
GCObject*
/**
* mono_gchandle_free:
- * @gchandle: a GCHandle's handle.
+ * \param gchandle a GCHandle's handle.
*
- * Frees the @gchandle handle. If there are no outstanding
+ * Frees the \p gchandle handle. If there are no outstanding
* references, the garbage collector can reclaim the memory of the
* object wrapped.
*/
-/*
- * sgen-gray.c: Gray queue management.
+/**
+ * \file
+ * Gray queue management.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-gray.h: Gray queue management.
+/**
+ * \file
+ * Gray queue management.
*
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
* Copyright (C) 2012 Xamarin Inc
-/*
- * sgen-hash-table.c
+/**
+ * \file
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
+/**
+ * \file
+ */
+
#ifndef __MONO_SGENHASHTABLE_H__
#define __MONO_SGENHASHTABLE_H__
-/*
- * sgen-internal.c: Internal lock-free memory allocator.
+/**
+ * \file
+ * Internal lock-free memory allocator.
*
* Copyright (C) 2012 Xamarin Inc
*
-/*
+/**
+ * \file
* Copyright Xamarin Inc (http://www.xamarin.com)
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
+/**
+ * \file
* Copyright Xamarin Inc (http://www.xamarin.com)
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * sgen-los.c: Large objects space.
+/**
+ * \file
+ * Large objects space.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * sgen-major-copy-object.h: Object copying in the major collectors.
+/**
+ * \file
+ * Object copying in the major collectors.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-marksweep-drain-gray-stack.h: The copy/mark and gray stack
- * draining functions of the M&S major collector.
+/**
+ * \file
+ * The copy/mark and gray stack draining functions of the M&S major collector.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
- * sgen-marksweep.c: The Mark & Sweep major collector.
+/**
+ * \file
+ * The Mark & Sweep major collector.
*
* Author:
* Mark Probst <mark.probst@gmail.com>
-/*
- * sgen-memory-governor.c: When to schedule collections based on
- * memory usage.
+/**
+ * \file
+ * When to schedule collections based on memory usage.
*
* Author:
* Rodrigo Kumpera (rkumpera@novell.com)
-/*
+/**
+ * \file
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
*
-/*
- * sgen-minor-copy-object.h: Copy functions for nursery collections.
+/**
+ * \file
+ * Copy functions for nursery collections.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-minor-scan-object.h: Object scanning in the nursery collectors.
+/**
+ * \file
+ * Object scanning in the nursery collectors.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-nursery-allocator.c: Nursery allocation code.
+/**
+ * \file
+ * Nursery allocation code.
*
* Copyright 2009-2010 Novell, Inc.
* 2011 Rodrigo Kumpera
-/*
+/**
+ * \file
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
-/*
- * sgen-pinning.c: The pin queue.
+/**
+ * \file
+ * The pin queue.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-pinning.h: All about pinning objects.
+/**
+ * \file
+ * All about pinning objects.
*
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
* Copyright (C) 2012 Xamarin Inc
-/*
- * sgen-pointer-queue.c: A pointer queue that can be sorted.
+/**
+ * \file
+ * A pointer queue that can be sorted.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
- * sgen-pointer-queue.h: A pointer queue that can be sorted.
+/**
+ * \file
+ * A pointer queue that can be sorted.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
+/**
+ * \file
* All binary protocol entries are defined here. To keep compatibility with past binary
* protocol files, new protocol entries need to be defined at the end of the file so that
* the sequential numbering is preserved. We also can't change the types or numbers of
-/*
- * sgen-protocol.c: Binary protocol of internal activity, to aid
- * debugging.
+/**
+ * \file
+ * Binary protocol of internal activity, to aid debugging.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-protocol.h: Binary protocol of internal activity, to aid
- * debugging.
+/**
+ * \file
+ * Binary protocol of internal activity, to aid debugging.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-qsort.c: Quicksort.
+/**
+ * \file
+ * Quicksort.
*
* Copyright (C) 2013 Xamarin Inc
*
-/*
- * sgen-qsort.h: Fast inline sorting
+/**
+ * \file
+ * Fast inline sorting
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
- * sgen-scan-object.h: Generic object scan.
+/**
+ * \file
+ * Generic object scan.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-simple-nursery.c: Simple always promote nursery.
+/**
+ * \file
+ * Simple always promote nursery.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-splliy-nursery.c: 3-space based nursery collector.
+/**
+ * \file
+ * 3-space based nursery collector.
*
* Author:
* Rodrigo Kumpera Kumpera <kumpera@gmail.com>
-/*
- * sgen-tagged-pointer.h: Macros for tagging and untagging pointers.
+/**
+ * \file
+ * Macros for tagging and untagging pointers.
*
* Copyright (C) 2014 Xamarin Inc
*
-/*
- * sgen-thread-pool.c: Threadpool for all concurrent GC work.
+/**
+ * \file
+ * Threadpool for all concurrent GC work.
*
* Copyright (C) 2015 Xamarin Inc
*
-/*
- * sgen-thread-pool.h: Threadpool for all concurrent GC work.
+/**
+ * \file
+ * Threadpool for all concurrent GC work.
*
* Copyright (C) 2015 Xamarin Inc
*
-/*
- * sgen-workers.c: Worker threads for parallel and concurrent GC.
+/**
+ * \file
+ * Worker threads for parallel and concurrent GC.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
-/*
- * sgen-workers.c: Worker threads for parallel and concurrent GC.
+/**
+ * \file
+ * Worker threads for parallel and concurrent GC.
*
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
* Copyright (C) 2012 Xamarin Inc
-SUBDIRS = assemblyresolve gc-descriptors
+SUBDIRS = assemblyresolve gc-descriptors . testing_gac
if FULL_AOT_TESTS
FEATUREFUL_RUNTIME_TEST =
endif
check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-multi-netmodule test-cattr-type-load test-reflection-load-with-context test_platform \
- test-console-output test-messages test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress test-pedump rm-empty-logs
+ test-console-output test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress test-pedump rm-empty-logs runtest-gac-loading
check-full: test-sgen check-local
check-parallel: compile-tests check-full
thread6.cs \
appdomain-threadpool-unload.cs \
process-unref-race.cs \
- bug-46661.cs
+ bug-46661.cs \
+ w32message.cs
TEST_CS_SRC_DIST= \
$(BASE_TEST_CS_SRC) \
if AMD64
# #651684
PLATFORM_DISABLED_TESTS = finally_guard.exe
+
+if HOST_WIN32
+PLATFORM_DISABLED_TESTS += w32message.exe
+endif
+
endif
if IA64
if HOST_WIN32
PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
- bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe
+ bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe w32message.exe
endif
endif
threadpool-exceptions5.exe \
threadpool-exceptions6.exe
+PLATFORM_DISABLED_TESTS+= w32message.exe
+
# Tests that rely on AppDomain.Unload
PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
appdomain-exit.exe \
async-exc-compilation.exe \
async-with-cb-throws.exe \
async_read.exe \
- bug-10127.exe \
bug-18026.exe \
- bug-27147.exe \
bug-2907.exe \
bug-323114.exe \
bug-327438.2.exe \
bug-335131.2.exe \
- bug-349190.2.exe \
bug-415577.exe \
bug-461867.exe \
bug-461941.exe \
bug-46661.exe \
bug-47295.exe \
bug-48015.exe \
- bug-508538.exe \
bug-544446.exe \
bug-685908.exe \
- bug-70561.exe \
- bug-78549.exe \
bug-80307.exe \
bug-80392.2.exe \
bug-81673.exe \
- bug-81691.exe \
bug-82022.exe \
bug445361.exe \
- bug469742.2.exe \
call_missing_class.exe \
call_missing_method.exe \
calliGenericTest.exe \
- cattr-field.exe \
- classinit3.exe \
cominterop.exe \
constant-division.exe \
context-static.exe \
delegate-delegate-exit.exe \
delegate-exit.exe \
delegate-with-null-target.exe \
- delegate.exe \
delegate1.exe \
delegate3.exe \
delegate5.exe \
- delegate7.exe \
delegate8.exe \
delegate9.exe \
dynamic-method-access.2.exe \
dynamic-method-finalize.2.exe \
dynamic-method-resurrection.exe \
dynamic-method-stack-traces.exe \
- enum.exe \
even-odd.exe \
exception18.exe \
field-access.exe \
finally_block_ending_in_dead_bb.exe \
- gc-altstack.exe \
- gchandles.exe \
generic-marshalbyref.2.exe \
generic-mkrefany.2.exe \
generic-refanyval.2.exe \
handleref.exe \
invalid-token.exe \
invalid_generic_instantiation.exe \
- invoke-string-ctors.exe \
- invoke.exe \
ldfld_missing_class.exe \
ldfld_missing_field.exe \
ldftn-access.exe \
- loader.exe \
+ main-returns-background-change.exe \
marshal-valuetypes.exe \
marshal.exe \
marshal2.exe \
marshal8.exe \
marshal9.exe \
marshalbool.exe \
- main-returns-background-change.exe \
method-access.exe \
- modules.exe \
- monitor-abort.exe \
- monitor-wait-abort.exe \
monitor.exe \
- namedmutex-destroy-race.exe \
nullable_boxing.2.exe \
pinvoke-2.2.exe \
pinvoke-utf8.exe \
pinvoke.exe \
pinvoke11.exe \
- pinvoke17.exe \
pinvoke2.exe \
pinvoke3.exe \
pinvoke_ppcc.exe \
pinvoke_ppcf.exe \
pinvoke_ppci.exe \
pinvoke_ppcs.exe \
- priority.exe \
process-unref-race.exe \
- reference-loader.exe \
reload-at-bb-end.exe \
remoting1.exe \
remoting2.exe \
remoting3.exe \
remoting4.exe \
remoting5.exe \
- runtime-invoke.exe \
- runtime-invoke.gen.exe \
safehandle.2.exe \
- shared-generic-synchronized.2.exe \
- sleep.exe \
stackframes-async.2.exe \
static-constructor.exe \
test-inline-call-stack.exe \
- test-tls.exe \
test-type-ctor.exe \
- thread-exit.exe \
thread6.exe \
threadpool-exceptions1.exe \
threadpool-exceptions2.exe \
typeload-unaligned.exe \
unload-appdomain-on-shutdown.exe \
vararg.exe \
- vararg.exe \
vararg2.exe \
vt-sync-method.exe \
winx64structs.exe \
@if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -v $(OK_G_SYMBOLS) | grep 't g_'; then exit 1; else exit 0; fi; fi
endif
-#
-# Tests that the internals in mono/io-layer/messages.c are ok by triggering the
-# code that checks that the table is properly sorted
-#
-if NACL_CODEGEN
-test-messages:
-else
-if HOST_WIN32
-test-messages:
-else
-test-messages: w32message.exe
- > test_messages.zero
- $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe > w32message.allout 2>&1 && cmp test_messages.zero w32message.allout
-endif
-endif
-
test-env-options:
MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
# Precompile the test assemblies in parallel
compile-tests:
- $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
+ $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS) compile-gac-loading
if FULL_AOT_TESTS
$(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
endif
bug-17537-helper.exe: bug-17537-helper.cs
$(MCS) -out:$@ $(srcdir)/bug-17537-helper.cs
chmod -x $@
+if FULL_AOT_TESTS
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
+if HYBRID_AOT_TESTS
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
bug-17537.exe: bug-17537.cs bug-17537-helper.exe
- $(MCS) -r:System.dll -out:$@ $(srcdir)/bug-17537.cs
+ $(MCS) -r:$(CLASS)/System.dll -out:$@ $(srcdir)/bug-17537.cs
EXTRA_DIST += coreclr-security.cs
$(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
bug-3903.exe: bug-3903.cs
- $(MCS_NO_LIB) $(srcdir)/bug-3903.cs -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
+ $(MCS_NO_LIB) $(srcdir)/bug-3903.cs -nostdlib -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/mscorlib.dll -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
gshared: test-generic-sharing
test-pedump: test-runner.exe
$(with_mono_path) $(mono_build_root)/tools/pedump/pedump --verify error test-runner.exe
+.PHONY: test-gac-loading
+
+runtest-gac-loading: test-runner.exe
+ $(MAKE) -C testing_gac runtest
+
+compile-gac-loading:
+ $(MAKE) -C testing_gac compile-tests
+
PROCESS_STRESS_TESTS= \
process-stress-1.exe \
process-stress-2.exe \
--- /dev/null
+using System;
+using System.Threading;
+
+public class Critical {
+ static Critical ()
+ {
+ Program.mre1.Set ();
+ Program.mre2.WaitOne ();
+ try {
+ throw new Exception ();
+ } catch (Exception) {
+ Console.WriteLine ("Catched exception in cctor");
+ Program.catched_exception = true;
+ }
+ }
+}
+
+
+public class Program {
+ public static ManualResetEvent mre1 = new ManualResetEvent (false);
+ public static ManualResetEvent mre2 = new ManualResetEvent (false);
+
+ public static bool catched_exception, catched_abort;
+
+ public static int Main (string[] args)
+ {
+ Thread thread = new Thread (DoStuff);
+ thread.Start ();
+
+ mre1.WaitOne ();
+ thread.Abort ();
+ mre2.Set ();
+
+ thread.Join ();
+
+ if (!catched_exception)
+ Environment.Exit (1);
+ if (!catched_abort)
+ Environment.Exit (2);
+
+ Console.WriteLine ("done, all things good");
+ return 0;
+ }
+
+ public static void DoStuff ()
+ {
+ try {
+ new Critical ();
+ } catch (ThreadAbortException) {
+ Console.WriteLine ("Catched thread abort");
+ Program.catched_abort = true;
+ }
+ }
+}
static void Test3 ()
{
Console.WriteLine ("Test 3:");
+ bool catched_abort = false;
Driver.mre1.Reset ();
Driver.mre2.Reset ();
Environment.Exit (7);
} catch (ThreadAbortException e) {
Console.WriteLine ("TEST 3: aborted {0}", e);
+ catched_abort = true;
}
});
thread.Join ();
+ // Did we catch the abort
+ if (!catched_abort)
+ Environment.Exit (8);
+
//is StaticConstructor2 viable?
try {
IsStaticConstructor3Viable ();
Console.WriteLine ("StaticConstructor3 is viable");
/* A regular exception escaping the .cctor makes the type not usable */
- Environment.Exit (8);
+ Environment.Exit (9);
} catch (TypeInitializationException e) {
Console.WriteLine ("StaticConstructor3 not viable");
}
new StaticConstructor4 ();
Console.WriteLine ("IsStaticConstructor4Viable: Did it get to the end? {0} Did it catch an exception {1} and end of the finally block {2}", StaticConstructor4.gotToEnd, StaticConstructor4.caughtException, got_to_the_end_of_the_finally);
if (!StaticConstructor4.gotToEnd) /* the TAE must not land during a .cctor */
- Environment.Exit (9);
- if (StaticConstructor4.caughtException)
Environment.Exit (10);
+ if (StaticConstructor4.caughtException)
+ Environment.Exit (11);
}
static void Test4 ()
if (!got_to_the_end_of_the_finally) {
Console.WriteLine ("Did not get to the end of test 4 cctor");
- Environment.Exit (11);
+ Environment.Exit (12);
}
//is StaticConstructor4viable?
Console.WriteLine ("StaticConstructor4 is viable"); /* a TAE doesn't make a type unusable */
} catch (TypeInitializationException e) {
Console.WriteLine ("StaticConstructor4 not viable");
- Environment.Exit (12);
+ Environment.Exit (13);
+ }
+ }
+
+
+ class StaticConstructor5 {
+ public static bool catched_exception = false;
+ static StaticConstructor5 ()
+ {
+ Driver.mre1.Set ();
+ Driver.mre2.WaitOne ();
+ try {
+ throw new Exception ();
+ } catch (Exception) {
+ Console.WriteLine ("Catched exception in cctor");
+ catched_exception = true;
+ }
}
}
+ static void Test5 ()
+ {
+ bool catched_abort = false;
+ Driver.mre1.Reset ();
+ Driver.mre2.Reset ();
+ Thread thread = new Thread (() => {
+ try {
+ new StaticConstructor5 ();
+ } catch (ThreadAbortException) {
+ Console.WriteLine ("Catched thread abort");
+ catched_abort = true;
+ }
+ });
+ thread.Start ();
+
+ Driver.mre1.WaitOne ();
+ thread.Abort ();
+ Driver.mre2.Set ();
+ thread.Join ();
+
+ if (!StaticConstructor5.catched_exception)
+ Environment.Exit (14);
+ if (!catched_abort)
+ Environment.Exit (15);
+ }
public static int Main ()
{
Test2 ();
Test3 ();
Test4 ();
+ Test5 ();
Console.WriteLine ("done, all things good");
return 0;
}
-}
\ No newline at end of file
+}
static void ProbeCorlib ()
{
- Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
- Type bad = System.Type.GetType("System.Nullable`1[[System.IO.MemoryMappedFiles.MemoryMappedFile, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]");
+ Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
+#if MOBILE
+ string pubKeyToken = "7cec85d7bea7798e";
+#else
+ string pubKeyToken = "b77a5c561934e089";
+#endif
+ string t = String.Format ("System.Nullable`1[[System.IO.MemoryMappedFiles.MemoryMappedFile, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken={0}]]", pubKeyToken);
+ Type bad = System.Type.GetType(t);
if (good.Assembly.FullName.Split (',') [0] != "mscorlib")
throw new Exception ("Wrong assembly name");
return 0;
}
+ private static void method_invoke_no_modify_by_value_arg_helper (int dummy)
+ {
+ }
+
+ public static int test_0_method_invoke_no_modify_by_value_arg ()
+ {
+ var args = new object[] { null };
+ var method = typeof (Tests).GetMethod ("method_invoke_no_modify_by_value_arg_helper", BindingFlags.NonPublic | BindingFlags.Static);
+ method.Invoke (null, args);
+ if (args[0] == null)
+ return 0;
+ else
+ return 1;
+ }
}
const string TEST_TIME_FORMAT = "mm\\:ss\\.fff";
const string ENV_TIMEOUT = "TEST_DRIVER_TIMEOUT_SEC";
const string MONO_PATH = "MONO_PATH";
+ const string MONO_GAC_PREFIX = "MONO_GAC_PREFIX";
class ProcessData {
public string test;
string config = null;
string mono_path = null;
string runtime_args = null;
+ string mono_gac_prefix = null;
var opt_sets = new List<string> ();
string aot_run_flags = null;
}
mono_path = args [i + 1].Substring(0, args [i + 1].Length);
+ i += 2;
+ } else if (args [i] == "--mono-gac-prefix") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --mono-gac-prefix command line option.");
+ return 1;
+ }
+ mono_gac_prefix = args[i + 1];
i += 2;
} else if (args [i] == "--aot-run-flags") {
if (i + 1 >= args.Length) {
ProcessStartInfo job = new ProcessStartInfo (runtime, aot_args);
job.UseShellExecute = false;
job.EnvironmentVariables[ENV_TIMEOUT] = timeout.ToString();
- job.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_path != null)
+ job.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_gac_prefix != null)
+ job.EnvironmentVariables[MONO_GAC_PREFIX] = mono_gac_prefix;
Process compiler = new Process ();
compiler.StartInfo = job;
info.EnvironmentVariables["MONO_CONFIG"] = config;
if (mono_path != null)
info.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_gac_prefix != null)
+ info.EnvironmentVariables[MONO_GAC_PREFIX] = mono_gac_prefix;
Process p = new Process ();
p.StartInfo = info;
--- /dev/null
+testkey.snk binary
\ No newline at end of file
--- /dev/null
+/Makefile
+/Makefile.in
+/lib/mono/
--- /dev/null
+
+### buildtree stuff
+
+CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
+
+if FULL_AOT_TESTS
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP
+endif
+
+if HYBRID_AOT_TESTS
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY
+endif
+
+### test runner stuff
+
+if HOST_WIN32
+PLATFORM_PATH_SEPARATOR=;
+else
+PLATFORM_PATH_SEPARATOR=:
+endif
+
+RUNTIME= $(top_builddir)/runtime/mono-wrapper
+TEST_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME)
+TOOLS_RUNTIME= MONO_PATH=$(mcs_topdir)/class/lib/build $(RUNTIME)
+
+TEST_RUNNER = ../test-runner.exe --runtime $(RUNTIME)
+
+if HOST_WIN32
+TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),mono)
+else
+TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
+endif
+
+TEST_RUNNER_ARGS += $(if $(V), --verbose,)
+
+if FULL_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+endif
+
+if HYBRID_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+endif
+
+### tools
+
+GACUTIL= $(mcs_topdir)/class/lib/build/gacutil.exe
+SN= $(mcs_topdir)/class/lib/build/sn.exe
+
+MCS= $(TOOLS_RUNTIME) $(CSC) -noconfig -nologo -debug:portable -target:library $(PROFILE_MCS_FLAGS)
+
+### testcase stuff
+
+BASE_MONO_PATH=$(CLASS)
+
+V1_SRC= v1/gactestlib.cs
+V2_SRC= v2/gactestlib.cs
+APP_V1_SRC = v1/app.cs v1/app-refl-load.cs
+
+APP_SIGNED_V1_EXE = app-v1.exe app-refl-load-v1.exe
+
+UNSIGNED_V1_DLL= unsigned_v1/gactestlib.dll
+UNSIGNED_V2_DLL= unsigned_v2/gactestlib.dll
+
+SIGNED_V1_DLL= signed_v1/gactestlib.dll
+SIGNED_V2_DLL= signed_v2/gactestlib.dll
+
+GACTESTLIB_SRCS= $(V1_SRC) $(V2_SRC)
+GACTESTLIB_DLLS= $(SIGNED_V1_DLL) $(SIGNED_V2_DLL) $(UNSIGNED_V1_DLL) $(UNSIGNED_V2_DLL)
+
+if FULL_AOT_TESTS
+GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+endif
+
+if HYBRID_AOT_TESTS
+GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+endif
+
+
+SIGNING_KEY= testkey.snk
+
+# prefix for the testing gac. gacutil will add lib/mono/gac directories
+GACDIR=.
+
+SIGN= -delaysign -keyfile:$(SIGNING_KEY)
+
+
+### autotools stuff
+
+EXTRA_DIST= README $(SIGNING_KEY) $(GACTESTLIB_SRCS)
+
+### Test cases
+
+# MONO_GAC_PREFIX tests
+if FULL_AOT_TESTS
+GAC_TESTS=
+else
+if HYBRID_AOT_TESTS
+GAC_TESTS=
+else
+GAC_TESTS= test-signed-v1-app-gac
+endif
+endif
+
+# MONO_PATH tests
+MP_TESTS= test-signed-v1-app-mp-unsigned-v1 \
+ test-signed-v1-app-mp-signed-v1 \
+ test-signed-v1-app-mp-unsigned-v2-signed-v1 \
+ test-signed-v1-app-mp-signed-v2-signed-v1
+
+###
+
+.PHONY: runtest compile-tests prereqs
+
+runtest: $(MP_TESTS) $(GAC_TESTS)
+
+compile-tests: prereqs $(APP_SIGNED_V1_EXE) $(APP_SIGNED_V1_AOT)
+
+prereqs: $(GACTESTLIB_DLLS) $(GACTESTLIB_DLLS_AOT) gacinstall
+
+$(UNSIGNED_V1_DLL): $(V1_SRC)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $<
+
+$(UNSIGNED_V2_DLL): $(V2_SRC)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $<
+
+$(SIGNED_V1_DLL): $(V1_SRC) $(SIGNING_KEY)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)
+
+$(SIGNED_V2_DLL): $(V2_SRC) $(SIGNING_KEY)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)
+
+%-v1.exe: v1/%.cs $(SIGNED_V1_DLL)
+ $(MCS) -target:exe -out:$@ -r:$(SIGNED_V1_DLL) $<
+
+%.exe$(PLATFORM_AOT_SUFFIX): %.exe
+ $(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<
+
+%.dll$(PLATFORM_AOT_SUFFIX): %.dll
+ $(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<
+
+test-signed-v1-app-mp-unsigned-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" --expected-exit-code 1 $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-gac: $(APP_SIGNED_V1_EXE) gacinstall prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-gac-prefix $(GACDIR) $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-unsigned-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-signed-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+.PHONY: gacinstall
+
+gacinstall: $(SIGNED_V1_DLL) $(GACTESTLIB_DLLS_AOT)
+ $(TOOLS_RUNTIME) $(GACUTIL) -i $< -gacdir $(GACDIR)
+
+mostlyclean-local: clean-gac-subdir clean-gactestlib-dll
+ -rm -f TestResult-*.xml
+
+.PHONY: clean-gac-subdir clean-gactestlib-dll
+
+clean-gac-subdir:
+ -rm -rf $(GACDIR)/lib/mono/gac/
+
+clean-gactestlib-dll:
+ -rm -f $(GACTESTLIB_DLLS)
+ -rm -f $(GACTESTLIB_DLLS_AOT)
+ -rm -f $(APP_SIGNED_V1_EXE) $(APP_SIGNED_V1_AOT)
--- /dev/null
+This directory is used by some tests in <root>/mono/tests that require a GAC (set via MONO_GAC_PREFIX).
+
+The gac will be in this directory, under lib/mono/gac/
+
+
+
+When clean, this directory should have no files other than this README and Makefile
\ No newline at end of file
--- /dev/null
+using System;
+using System.Reflection;
+
+public class App {
+ const string assemblyName = "gactestlib";
+ const string assemblyVersion = "1.0.0.0";
+ const string assemblyPublicKeyToken = "537eab56aa911cb7"; /* see testkey.snk */
+ public static int Main (string[] args)
+ {
+ TestAssemblyLoad ();
+
+ TestReflectionOnlyLoad ();
+
+ return 0;
+ }
+
+ public static void TestAssemblyLoad ()
+ {
+ var expectedVersion = new Version (assemblyVersion);
+
+ var s = String.Format ("{0}, Version={1}, Culture=\"\", PublicKeyToken={2}",
+ assemblyName, assemblyVersion, assemblyPublicKeyToken);
+ var n = new AssemblyName (s);
+ var a = AppDomain.CurrentDomain.Load (n);
+
+ if (a == null)
+ Environment.Exit (1);
+ if (a.GetName ().Version != expectedVersion)
+ Environment.Exit (2);
+ }
+
+ public static void TestReflectionOnlyLoad ()
+ {
+ var expectedVersion = new Version (assemblyVersion);
+
+ var s = String.Format ("{0}, Version={1}, Culture=\"\", PublicKeyToken={2}",
+ assemblyName, assemblyVersion, assemblyPublicKeyToken);
+ var a = Assembly.ReflectionOnlyLoad (s);
+
+ if (a == null)
+ Environment.Exit (3);
+ if (a.GetName ().Version != expectedVersion)
+ Environment.Exit (4);
+ }
+}
--- /dev/null
+using System;
+
+public class App {
+ public static void Main () {
+ X.N1 ();
+ X.N2 ();
+ }
+}
--- /dev/null
+
+[assembly: System.Reflection.AssemblyVersion ("1.0.0.0")]
+
+public class X
+{
+ public static void N1 ()
+ {
+
+ }
+
+ public static void N2 ()
+ {
+ }
+
+}
--- /dev/null
+
+[assembly: System.Reflection.AssemblyVersion ("1.1.0.0")]
+
+public class X
+{
+ public static void N1 ()
+ {
+
+ }
+
+ // In the "v2" version, let's make this method missing.
+ // public static void N2 ()
+ // {
+ // }
+}
// This test merely creates a Win32Exception that triggers the
// code in mono/io-layer/message.c that validates that the
// error table is propertly sorted
-//
-// If there is output on stderr, we have an error
-//
using System;
using System.ComponentModel;
return new Win32Exception (c).Message;
}
- static void check (int c, string s)
+ static bool check (int c, string s)
{
- if (msg (c) != s)
- Console.WriteLine ("For {0} expected {1} got {2}", c, s, msg (c));
+ if (msg (c) != s) {
+ Console.Error.WriteLine ("For {0} expected {1} got {2}", c, s, msg (c));
+ return false;
+ }
+ return true;
}
- static void Main ()
+ static int Main ()
{
//
// All this test does is instantiate two Win32Exceptions
Exception a = new Win32Exception (99999);
a = new Win32Exception (9805);
- check (2, "Cannot find the specified file");
+ if (!check (2, "Cannot find the specified file"))
+ return 1;
+
+ return 0;
}
-}
\ No newline at end of file
+}
-/*
- * atomic.c: Workarounds for atomic operations for platforms that dont have
- * really atomic asm functions in atomic.h
+/**
+ * \file
+ * Workarounds for atomic operations for platforms that dont have
+ * really atomic asm functions in atomic.h
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
- * atomic.h: Atomic operations
+/**
+ * \file
+ * Atomic operations
*
* Author:
* Dick Porter (dick@ximian.com)
-/*
+/**
+ * \file
* bsearch () implementation. Needed because some broken platforms
* have implementations that have unreasonable, non-standard
* requirements (e.g. "key must not be null"). Taken from NetBSD
+/**
+ * \file
+ */
+
#ifndef __MONO_BSEARCH_H__
#define __MONO_BSEARCH_H__
-/*
- * checked-build.c: Expensive asserts used when mono is built with --with-checked-build=yes
+/**
+ * \file
+ * Expensive asserts used when mono is built with --with-checked-build=yes
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * checked-build.h: Expensive asserts used when mono is built with --with-checked-build=yes
+/**
+ * \file
+ * Expensive asserts used when mono is built with --with-checked-build=yes
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * dtrace.h: DTrace probes
+/* *
+ * \file
+ * DTrace probes
*
* Authors:
* Andreas Faerber <andreas.faerber@web.de>
-/*
+/**
+ * \file
* Copyright 2004-2011 Novell, Inc (http://www.novell.com)
* Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * hazard-pointer.c: Hazard pointer related code.
+/**
+ * \file
+ * Hazard pointer related code.
*
* (C) Copyright 2011 Novell, Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
/**
* mono_thread_hazardous_try_free:
- * @p: the pointer to free
- * @free_func: the function that can free the pointer
+ * \param p the pointer to free
+ * \param free_func the function that can free the pointer
*
- * If @p is not a hazardous pointer it will be immediately freed by calling @free_func.
+ * If \p p is not a hazardous pointer it will be immediately freed by calling \p free_func.
* Otherwise it will be queued for later.
*
- * Use this function if @free_func can ALWAYS be called in the context where this function is being called.
+ * Use this function if \p free_func can ALWAYS be called in the context where this function is being called.
*
* This function doesn't pump the free queue so try to accommodate a call at an appropriate time.
* See mono_thread_hazardous_try_free_some for when it's appropriate.
*
- * Return: TRUE if @p was free or FALSE if it was queued.
+ * \returns TRUE if \p p was free or FALSE if it was queued.
*/
gboolean
mono_thread_hazardous_try_free (gpointer p, MonoHazardousFreeFunc free_func)
/**
* mono_thread_hazardous_queue_free:
- * @p: the pointer to free
- * @free_func: the function that can free the pointer
- *
- * Queue @p to be freed later. @p will be freed once the hazard free queue is pumped.
+ * \param p the pointer to free
+ * \param free_func the function that can free the pointer
+ * Queue \p p to be freed later. \p p will be freed once the hazard free queue is pumped.
*
* This function doesn't pump the free queue so try to accommodate a call at an appropriate time.
- * See mono_thread_hazardous_try_free_some for when it's appropriate.
- *
+ * See \c mono_thread_hazardous_try_free_some for when it's appropriate.
*/
void
mono_thread_hazardous_queue_free (gpointer p, MonoHazardousFreeFunc free_func)
-/*
- * hazard-pointer.h: Hazard pointer related code.
+/**
+ * \file
+ * Hazard pointer related code.
*
* (C) Copyright 2011 Novell, Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * json.c: JSON writer
+/**
+ * \file
+ * JSON writer
*
* Author:
* Joao Matos (joao.matos@xamarin.com)
-/*
- * json.h: JSON writer
+/**
+ * \file
+ * JSON writer
*
* Author:
* Joao Matos (joao.matos@xamarin.com)
+/**
+ * \file
+ */
+
#ifndef __LINUX_MAGIC_H
#define __LINUX_MAGIC_H
-/*
- * lock-free-alloc.c: Lock free allocator.
+/**
+ * \file
+ * Lock free allocator.
*
* (C) Copyright 2011 Novell, Inc
*
-/*
- * lock-free-alloc.h: Lock free allocator.
+/**
+ * \file
+ * Lock free allocator.
*
* (C) Copyright 2011 Novell, Inc
*
-/*
- * lock-free-array-queue.c: A lock-free somewhat-queue that doesn't
+/**
+ * \file
+ * A lock-free somewhat-queue that doesn't
* require hazard pointers.
*
* (C) Copyright 2011 Xamarin Inc.
-/*
- * lock-free-array-queue.h: A lock-free somewhat-queue that doesn't
+/**
+ * \file
+ * A lock-free somewhat-queue that doesn't
* require hazard pointers.
*
* (C) Copyright 2011 Xamarin Inc.
-/*
- * lock-free-queue.c: Lock free queue.
+/**
+ * \file
+ * Lock free queue.
*
* (C) Copyright 2011 Novell, Inc
*
-/*
- * lock-free-queue.h: Lock free queue.
+/**
+ * \file
+ * Lock free queue.
*
* (C) Copyright 2011 Novell, Inc
*
-/*
- * mach-support-x86.c: mach support for x86
+/**
+ * \file
+ * mach support for x86
*
* Authors:
* Geoff Norton (gnorton@novell.com)
-/*
- * mach-support-arm.c: mach support for ARM
+/**
+ * \file
+ * mach support for ARM
*
* Authors:
* Geoff Norton (gnorton@novell.com)
-/*
- * mach-support-arm.c: mach support for ARM
+/**
+ * \file
+ * mach support for ARM
*
* Authors:
* Geoff Norton (gnorton@novell.com)
-/*
- * mach-support-unknown.c: mach support for cross compilers (IOW, none)
+/**
+ * \file
+ * mach support for cross compilers (IOW, none)
*
* Authors:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mach-support-x86.c: mach support for x86
+/**
+ * \file
+ * mach support for x86
*
* Authors:
* Geoff Norton (gnorton@novell.com)
-/*
- * mach-support-x86.c: mach support for x86
+/**
+ * \file
+ * mach support for x86
*
* Authors:
* Geoff Norton (gnorton@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_MACH_SUPPORT_H__
#define __MONO_MACH_SUPPORT_H__
-/*
- * memfuncs.c: Our own bzero/memmove.
+/**
+ * \file
+ * Our own bzero/memmove.
*
* Copyright (C) 2013-2015 Xamarin Inc
*
/**
* mono_gc_bzero_aligned:
- * @dest: address to start to clear
- * @size: size of the region to clear
+ * \param dest address to start to clear
+ * \param size size of the region to clear
*
- * Zero @size bytes starting at @dest.
- * The address of @dest MUST be aligned to word boundaries
+ * Zero \p size bytes starting at \p dest.
+ * The address of \p dest MUST be aligned to word boundaries
*
* FIXME borrow faster code from some BSD libc or bionic
*/
/**
* mono_gc_bzero_atomic:
- * @dest: address to start to clear
- * @size: size of the region to clear
+ * \param dest address to start to clear
+ * \param size size of the region to clear
*
- * Zero @size bytes starting at @dest.
+ * Zero \p size bytes starting at \p dest.
*
- * Use this to zero memory without word tearing when dest is aligned.
+ * Use this to zero memory without word tearing when \p dest is aligned.
*/
void
mono_gc_bzero_atomic (void *dest, size_t size)
/**
* mono_gc_memmove_aligned:
- * @dest: destination of the move
- * @src: source
- * @size: size of the block to move
+ * \param dest destination of the move
+ * \param src source
+ * \param size size of the block to move
*
- * Move @size bytes from @src to @dest.
+ * Move \p size bytes from \p src to \p dest.
*
* Use this to copy memory without word tearing when both pointers are aligned
- */void
+ */
+void
mono_gc_memmove_aligned (void *dest, const void *src, size_t size)
{
g_assert (unaligned_bytes (dest) == 0);
/**
* mono_gc_memmove_atomic:
- * @dest: destination of the move
- * @src: source
- * @size: size of the block to move
+ * \param dest destination of the move
+ * \param src source
+ * \param size size of the block to move
*
- * Move @size bytes from @src to @dest.
+ * Move \p size bytes from \p src to \p dest.
*
* Use this to copy memory without word tearing when both pointers are aligned
*/
-/*
- * memfuncs.h: Our own bzero/memmove.
+/**
+ * \file
+ * Our own bzero/memmove.
*
* Copyright (C) 2015 Xamarin Inc
*
+/**
+ * \file
+ */
+
#include "config.h"
#ifdef HAVE_UNISTD_H
/**
* mono_code_manager_destroy:
- * @cman: a code manager
- *
- * Free all the memory associated with the code manager @cman.
+ * \param cman a code manager
+ * Free all the memory associated with the code manager \p cman.
*/
void
mono_code_manager_destroy (MonoCodeManager *cman)
/**
* mono_code_manager_invalidate:
- * @cman: a code manager
- *
+ * \param cman a code manager
* Fill all the memory with an invalid native code value
* so that any attempt to execute code allocated in the code
- * manager @cman will fail. This is used for debugging purposes.
+ * manager \p cman will fail. This is used for debugging purposes.
*/
void
mono_code_manager_invalidate (MonoCodeManager *cman)
/**
* mono_code_manager_set_read_only:
- * @cman: a code manager
- *
+ * \param cman a code manager
* Make the code manager read only, so further allocation requests cause an assert.
*/
void
/**
* mono_code_manager_foreach:
- * @cman: a code manager
- * @func: a callback function pointer
- * @user_data: additional data to pass to @func
- *
- * Invokes the callback @func for each different chunk of memory allocated
- * in the code manager @cman.
+ * \param cman a code manager
+ * \param func a callback function pointer
+ * \param user_data additional data to pass to \p func
+ * Invokes the callback \p func for each different chunk of memory allocated
+ * in the code manager \p cman.
*/
void
mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data)
}
/**
- * mono_code_manager_reserve:
- * @cman: a code manager
- * @size: size of memory to allocate
- * @alignment: power of two alignment value
- *
- * Allocates at least @size bytes of memory inside the code manager @cman.
- *
- * Returns: the pointer to the allocated memory or #NULL on failure
+ * mono_code_manager_reserve_align:
+ * \param cman a code manager
+ * \param size size of memory to allocate
+ * \param alignment power of two alignment value
+ * Allocates at least \p size bytes of memory inside the code manager \p cman.
+ * \returns the pointer to the allocated memory or NULL on failure
*/
void*
mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment)
/**
* mono_code_manager_reserve:
- * @cman: a code manager
- * @size: size of memory to allocate
- *
- * Allocates at least @size bytes of memory inside the code manager @cman.
- *
- * Returns: the pointer to the allocated memory or #NULL on failure
+ * \param cman a code manager
+ * \param size size of memory to allocate
+ * Allocates at least \p size bytes of memory inside the code manager \p cman.
+ * \returns the pointer to the allocated memory or NULL on failure
*/
void*
mono_code_manager_reserve (MonoCodeManager *cman, int size)
/**
* mono_code_manager_commit:
- * @cman: a code manager
- * @data: the pointer returned by mono_code_manager_reserve ()
- * @size: the size requested in the call to mono_code_manager_reserve ()
- * @newsize: the new size to reserve
- *
+ * \param cman a code manager
+ * \param data the pointer returned by mono_code_manager_reserve ()
+ * \param size the size requested in the call to mono_code_manager_reserve ()
+ * \param newsize the new size to reserve
* If we reserved too much room for a method and we didn't allocate
* already from the code manager, we can get back the excess allocation
* for later use in the code manager.
/**
* mono_code_manager_size:
- * @cman: a code manager
- * @used_size: pointer to an integer for the result
- *
+ * \param cman a code manager
+ * \param used_size pointer to an integer for the result
* This function can be used to get statistics about a code manager:
- * the integer pointed to by @used_size will contain how much
- * memory is actually used inside the code managed @cman.
- *
- * Returns: the amount of memory allocated in @cman
+ * the integer pointed to by \p used_size will contain how much
+ * memory is actually used inside the code managed \p cman.
+ * \returns the amount of memory allocated in \p cman
*/
int
mono_code_manager_size (MonoCodeManager *cman, int *used_size)
+/**
+ * \file
+ */
+
#ifndef __MONO_CODEMAN_H__
#define __MONO_CODEMAN_H__
+/**
+ * \file
+ */
+
#ifndef __UTILS_MONO_COMPILER_H__
#define __UTILS_MONO_COMPILER_H__
-/*
-* mono-complex.h: C99 Complex math cross-platform support code
+/**
+ * \file
+* C99 Complex math cross-platform support code
*
* Author:
* Joao Matos (joao.matos@xamarin.com)
-/*
- * mono-conc-hashtable.h: A mostly concurrent hashtable
+/**
+ * \file
+ * A mostly concurrent hashtable
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
/**
* mono_conc_hashtable_remove:
- *
* Remove a value from the hashtable. Requires external locking
- *
- * @Returns the old value if key is already present or null
+ * \returns the old value if \p key is already present or NULL
*/
gpointer
mono_conc_hashtable_remove (MonoConcurrentHashTable *hash_table, gpointer key)
}
/**
* mono_conc_hashtable_insert:
- *
* Insert a value into the hashtable. Requires external locking.
- * @Returns the old value if key is already present or null
+ * \returns the old value if \p key is already present or NULL
*/
gpointer
mono_conc_hashtable_insert (MonoConcurrentHashTable *hash_table, gpointer key, gpointer value)
/**
* mono_conc_hashtable_foreach:
- *
- * Calls @func for each value in the hashtable. Requires external locking.
+ * Calls \p func for each value in the hashtable. Requires external locking.
*/
void
mono_conc_hashtable_foreach (MonoConcurrentHashTable *hash_table, GHFunc func, gpointer userdata)
-/*
- * mono-conc-hashtable.h: A mostly concurrent hashtable
+/**
+ * \file
+ * A mostly concurrent hashtable
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-context.c: plat independent machine state definitions
+/**
+ * \file
+ * plat independent machine state definitions
*
*
* Copyright (c) 2011 Novell, Inc (http://www.novell.com)
mctx->esi = UCONTEXT_REG_ESI (ctx);
mctx->edi = UCONTEXT_REG_EDI (ctx);
mctx->eip = UCONTEXT_REG_EIP (ctx);
+#ifdef UCONTEXT_REG_XMM
+ mctx->fregs [0] = UCONTEXT_REG_XMM0 (ctx);
+ mctx->fregs [1] = UCONTEXT_REG_XMM1 (ctx);
+ mctx->fregs [2] = UCONTEXT_REG_XMM2 (ctx);
+ mctx->fregs [3] = UCONTEXT_REG_XMM3 (ctx);
+ mctx->fregs [4] = UCONTEXT_REG_XMM4 (ctx);
+ mctx->fregs [5] = UCONTEXT_REG_XMM5 (ctx);
+ mctx->fregs [6] = UCONTEXT_REG_XMM6 (ctx);
+ mctx->fregs [7] = UCONTEXT_REG_XMM7 (ctx);
+#endif
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
UCONTEXT_REG_ESI (ctx) = mctx->esi;
UCONTEXT_REG_EDI (ctx) = mctx->edi;
UCONTEXT_REG_EIP (ctx) = mctx->eip;
+#ifdef UCONTEXT_REG_XMM
+ UCONTEXT_REG_XMM0 (ctx) = mctx->fregs [0];
+ UCONTEXT_REG_XMM1 (ctx) = mctx->fregs [1];
+ UCONTEXT_REG_XMM2 (ctx) = mctx->fregs [2];
+ UCONTEXT_REG_XMM3 (ctx) = mctx->fregs [3];
+ UCONTEXT_REG_XMM4 (ctx) = mctx->fregs [4];
+ UCONTEXT_REG_XMM5 (ctx) = mctx->fregs [5];
+ UCONTEXT_REG_XMM6 (ctx) = mctx->fregs [6];
+ UCONTEXT_REG_XMM7 (ctx) = mctx->fregs [7];
+#endif
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
-/*
- * mono-context.h: plat independent machine state definitions
+/**
+ * \file
+ * plat independent machine state definitions
*
*
* Copyright (c) 2011 Novell, Inc (http://www.novell.com)
[xmm4] MONO_CONTEXT_OFFSET (fregs, X86_XMM4, MonoContextSimdReg), \
[xmm5] MONO_CONTEXT_OFFSET (fregs, X86_XMM5, MonoContextSimdReg), \
[xmm6] MONO_CONTEXT_OFFSET (fregs, X86_XMM6, MonoContextSimdReg), \
- [xmm7] MONO_CONTEXT_OFFSET (fregs, X86_XMM7, MonoContextSimdReg), \
+ [xmm7] MONO_CONTEXT_OFFSET (fregs, X86_XMM7, MonoContextSimdReg)); \
} while (0)
#else
#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx)
+/**
+ * \file
+ */
#ifndef __MONO_COOP_MUTEX_H__
#define __MONO_COOP_MUTEX_H__
+/**
+ * \file
+ */
#ifndef __MONO_COOP_SEMAPHORE_H__
#define __MONO_COOP_SEMAPHORE_H__
-/*
+/**
+ * \file
* Copyright 2006-2010 Novell
* Copyright 2011 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
/**
* mono_counter_get_variance:
- * @counter: counter to get the variance
+ * \param counter counter to get the variance
*
* Variance specifies how the counter value is expected to behave between any two samplings.
*
- * Returns: the monotonicity of the counter.
+ * \returns the monotonicity of the counter.
*/
int
mono_counter_get_variance (MonoCounter *counter)
/**
* mono_counter_get_unit:
- * @counter: counter to get the unit
+ * \param counter counter to get the unit
*
* The unit gives a high level view of the unit that the counter is measuring.
*
- * Returns: the unit of the counter.
+ * \returns the unit of the counter.
*/
int
mono_counter_get_unit (MonoCounter *counter)
/**
* mono_counter_get_section:
- * @counter: counter to get the section
- *
+ * \param counter counter to get the section
* Sections are the unit of organization between all counters.
- *
- * Returns: the section of the counter.
+ * \returns the section of the counter.
*/
int
/**
* mono_counter_get_type:
- * @counter: counter to get the type
- *
- * Returns the type used to strong the value of the counter.
- *
- * Returns:the type of the counter.
+ * \param counter counter to get the type
+ * \returns the type used to store the value of the counter.
*/
int
mono_counter_get_type (MonoCounter *counter)
/**
* mono_counter_get_name:
- * @counter: counter to get the name
- *
- * Returns the counter name. The string should not be freed.
- *
- * Returns the name of the counter.
+ * \param counter counter to get the name
+ * \returns the counter name. The string should not be freed.
*/
const char*
/**
* mono_counter_get_size:
- * @counter: counter to get the max size of the counter
- *
- * Use the returned size to create the buffer used with mono_counters_sample
- *
- * Returns: the max size of the counter data.
+ * \param counter counter to get the max size of the counter
+ * Use the returned size to create the buffer used with \c mono_counters_sample
+ * \returns the max size of the counter data.
*/
size_t
mono_counter_get_size (MonoCounter *counter)
/**
* mono_counters_enable:
- * @section_mask: a mask listing the sections that will be displayed
- *
+ * \param sectionmask a mask listing the sections that will be displayed
* This is used to track which counters will be displayed.
*/
void
/**
* mono_counters_register:
- * @name: The name for this counters.
- * @type: One of the possible MONO_COUNTER types, or MONO_COUNTER_CALLBACK for a function pointer.
- * @addr: The address to register.
+ * \param name The name for this counters.
+ * \param type One of the possible \c MONO_COUNTER types, or \c MONO_COUNTER_CALLBACK for a function pointer.
+ * \param addr The address to register.
*
- * Register addr as the address of a counter of type type.
- * Note that @name must be a valid string at all times until
- * mono_counters_dump () is called.
+ * Register \p addr as the address of a counter of type type.
+ * Note that \p name must be a valid string at all times until
+ * \c mono_counters_dump() is called.
*
* This function should not be used with counter types that require an explicit size such as string
* as the counter size will be set to zero making them effectively useless.
*
- *
- * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
+ * It may be a function pointer if \c MONO_COUNTER_CALLBACK is specified:
* the function should return the value and take no arguments.
*/
void
/**
* mono_counters_register_with_size:
- * @name: The name for this counters.
- * @type: One of the possible MONO_COUNTER types, or MONO_COUNTER_CALLBACK for a function pointer.
- * @addr: The address to register.
- * @size: Max size of the counter data.
+ * \param name The name for this counters.
+ * \param type One of the possible MONO_COUNTER types, or MONO_COUNTER_CALLBACK for a function pointer.
+ * \param addr The address to register.
+ * \param size Max size of the counter data.
*
- * Register addr as the address of a counter of type @type.
- * Note that @name must be a valid string at all times until
- * mono_counters_dump () is called.
+ * Register \p addr as the address of a counter of type \p type.
+ * Note that \p name must be a valid string at all times until
+ * \c mono_counters_dump() is called.
*
- * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
+ * It may be a function pointer if \c MONO_COUNTER_CALLBACK is specified:
* the function should return the value and take no arguments.
*
- * The value of @size is ignored for types with fixed size such as int and long.
+ * The value of \p size is ignored for types with fixed size such as int and long.
*
- * Use @size for types that can have dynamic size such as string.
+ * Use \p size for types that can have dynamic size such as string.
*
- * If @size is negative, it's silently converted to zero.
+ * If \p size is negative, it's silently converted to zero.
*/
void
mono_counters_register_with_size (const char *name, int type, void *addr, int size)
/**
* mono_counters_on_register
- * @callback : function to callback when a counter is registered
- *
+ * \param callback function to callback when a counter is registered
* Add a callback that is going to be called when a counter is registered
*/
void
/**
* mono_counters_foreach:
- * @cb: The callback that will be called for each counter.
- * @user_data: Value passed as second argument of the callback.
- *
- * Iterate over all counters and call @cb for each one of them. Stop iterating if
+ * \param cb The callback that will be called for each counter.
+ * \param user_data Value passed as second argument of the callback.
+ * Iterate over all counters and call \p cb for each one of them. Stop iterating if
* the callback returns FALSE.
- *
*/
void
mono_counters_foreach (CountersEnumCallback cb, gpointer user_data)
/**
* mono_counters_dump:
- * @section_mask: The sections to dump counters for
- * @outfile: a FILE to dump the results to
- *
+ * \param section_mask The sections to dump counters for
+ * \param outfile a FILE to dump the results to
* Displays the counts of all the enabled counters registered.
* To filter by variance, you can OR one or more variance with the specific section you want.
- * Use MONO_COUNTER_SECTION_MASK to dump all categories of a specific variance.
+ * Use \c MONO_COUNTER_SECTION_MASK to dump all categories of a specific variance.
*/
void
mono_counters_dump (int section_mask, FILE *outfile)
/**
* mono_runtime_resource_check_limit:
- * @resource_type: one of the #MonoResourceType enum values
- * @value: the current value of the resource usage
- *
+ * \param resource_type one of the \c MonoResourceType enum values
+ * \param value the current value of the resource usage
* Check if a runtime resource limit has been reached. This function
* is intended to be used by the runtime only.
*/
/**
* mono_runtime_resource_limit:
- * @resource_type: one of the #MonoResourceType enum values
- * @soft_limit: the soft limit value
- * @hard_limit: the hard limit value
- *
+ * \param resource_type one of the \c MonoResourceType enum values
+ * \param soft_limit the soft limit value
+ * \param hard_limit the hard limit value
* This function sets the soft and hard limit for runtime resources. When the limit
* is reached, a user-specified callback is called. The callback runs in a restricted
* environment, in which the world coult be stopped, so it can't take locks, perform
* allocations etc. The callback may be called multiple times once a limit has been reached
* if action is not taken to decrease the resource use.
- *
- * Returns: 0 on error or a positive integer otherwise.
+ * \returns 0 on error or a positive integer otherwise.
*/
int
mono_runtime_resource_limit (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit)
/**
* mono_runtime_resource_set_callback:
- * @callback: a function pointer
- *
+ * \param callback a function pointer
* Set the callback to be invoked when a resource limit is reached.
* The callback will receive the resource type, the resource amount in resource-specific
* units and a flag indicating whether the soft or hard limit was reached.
+/**
+ * \file
+ */
+
#ifndef __MONO_COUNTERS_H__
#define __MONO_COUNTERS_H__
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
+/**
+ * \file
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
-/*
- * mono-dl.c: Interface to the dynamic linker
+/**
+ * \file
+ * Interface to the dynamic linker
*
* Author:
* Mono Team (http://www.mono-project.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_DL_FALLBACK_H__
#define __MONO_UTILS_DL_FALLBACK_H__
-/*
- * mono-dl.c: Interface to the dynamic linker
+/**
+ * \file
+ * Interface to the dynamic linker
*
* Author:
* Mono Team (http://www.mono-project.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_DL_WINDOWS_H__
#define __MONO_UTILS_DL_WINDOWS_H__
-/*
- * mono-dl-windows-uwp.c: UWP dl support for Mono.
+/**
+ * \file
+ * UWP dl support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-dl.c: Interface to the dynamic linker
+/**
+ * \file
+ * Interface to the dynamic linker
*
* Author:
* Mono Team (http://www.mono-project.com)
-/*
- * mono-dl.c: Interface to the dynamic linker
+/**
+ * \file
+ * Interface to the dynamic linker
*
* Author:
* Mono Team (http://www.mono-project.com)
/**
* mono_dl_open:
- * @name: name of file containing shared module
- * @flags: flags
- * @error_msg: pointer for error message on failure
+ * \param name name of file containing shared module
+ * \param flags flags
+ * \param error_msg pointer for error message on failure
*
- * Load the given file @name as a shared library or dynamically loadable
- * module. @name can be NULL to indicate loading the currently executing
+ * Load the given file \p name as a shared library or dynamically loadable
+ * module. \p name can be NULL to indicate loading the currently executing
* binary image.
- * @flags can have the MONO_DL_LOCAL bit set to avoid exporting symbols
- * from the module to the shared namespace. The MONO_DL_LAZY bit can be set
+ * \p flags can have the \c MONO_DL_LOCAL bit set to avoid exporting symbols
+ * from the module to the shared namespace. The \c MONO_DL_LAZY bit can be set
* to lazily load the symbols instead of resolving everithing at load time.
- * @error_msg points to a string where an error message will be stored in
- * case of failure. The error must be released with g_free.
- *
- * Returns: a MonoDl pointer on success, NULL on failure.
+ * \p error_msg points to a string where an error message will be stored in
+ * case of failure. The error must be released with \c g_free.
+ * \returns a \c MonoDl pointer on success, NULL on failure.
*/
MonoDl*
mono_dl_open (const char *name, int flags, char **error_msg)
/**
* mono_dl_symbol:
- * @module: a MonoDl pointer
- * @name: symbol name
- * @symbol: pointer for the result value
- *
- * Load the address of symbol @name from the given @module.
- * The address is stored in the pointer pointed to by @symbol.
- *
- * Returns: NULL on success, an error message on failure
+ * \param module a MonoDl pointer
+ * \param name symbol name
+ * \param symbol pointer for the result value
+ * Load the address of symbol \p name from the given \p module.
+ * The address is stored in the pointer pointed to by \p symbol.
+ * \returns NULL on success, an error message on failure
*/
char*
mono_dl_symbol (MonoDl *module, const char *name, void **symbol)
/**
* mono_dl_close:
- * @module: a MonoDl pointer
- *
+ * \param module a \c MonoDl pointer
* Unload the given module and free the module memory.
- *
- * Returns: 0 on success.
+ * \returns \c 0 on success.
*/
void
mono_dl_close (MonoDl *module)
/**
* mono_dl_build_path:
- * @directory: optional directory
- * @name: base name of the library
- * @iter: iterator token
- *
+ * \param directory optional directory
+ * \param name base name of the library
+ * \param iter iterator token
* Given a directory name and the base name of a library, iterate
* over the possible file names of the library, taking into account
* the possible different suffixes and prefixes on the host platform.
*
* The returned file name must be freed by the caller.
- * @iter must point to a NULL pointer the first time the function is called
+ * \p iter must point to a NULL pointer the first time the function is called
* and then passed unchanged to the following calls.
- * Returns: the filename or NULL at the end of the iteration
+ * \returns the filename or NULL at the end of the iteration
*/
char*
mono_dl_build_path (const char *directory, const char *name, void **iter)
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_DL_H__
#define __MONO_UTILS_DL_H__
-/*
- * mono-embed.c: Example code APIs to register a libraries using
+/**
+ * \file
+ * Example code APIs to register a libraries using
* mono_dl_fallback_register. Real implementations should instead
* use a binary search for implementing the dl_mapping_open and
* dl_mapping_symbol methods here.
/**
* mono_dl_register_library:
-u * @name: Library name, this is the name used by the DllImport as the external library name
- * @mappings: the mappings to register for P/Invoke.
+ * \param name Library name, this is the name used by the DllImport as the external library name
+ * \param mappings the mappings to register for P/Invoke.
*
* The mappings registered using this function are used as fallbacks if the dynamic linker
* fails, or if the platform doesn't have a dynamic linker.
*
- * Mappings is a pointer to the first element of an array of
- * MonoDlMapping values. The list must be terminated with both
- * the name and addr fields set to NULL.
+ * \p mappings is a pointer to the first element of an array of
+ * \c MonoDlMapping values. The list must be terminated with both
+ * the \c name and \c addr fields set to NULL.
*
* This is typically used like this:
* MonoDlMapping sample_library_mappings [] = {
+/**
+ * \file
+ */
+
#ifndef __MONO_EMBED_H__
#define __MONO_EMBED_H__
+/**
+ * \file
+ */
+
#ifndef __MONO_ERROR_INTERNALS_H__
#define __MONO_ERROR_INTERNALS_H__
-/*
- * mono-error.c: Error handling code
+/**
+ * \file
+ * Error handling code
*
* Authors:
* Rodrigo Kumpera (rkumpera@novell.com)
/**
* mono_error_init:
- * @error: Pointer to MonoError struct to initialize
- *
- * Any function which takes a MonoError for purposes of reporting an error
- * is required to call either this or mono_error_init_flags on entry.
+ * \param error Pointer to \c MonoError struct to initialize
+ * Any function which takes a \c MonoError for purposes of reporting an error
+ * is required to call either this or \c mono_error_init_flags on entry.
*/
void
mono_error_init (MonoError *error)
/**
* mono_error_box:
- * @ierror: The input error that will be boxed.
- * @image: The mempool of this image will hold the boxed error.
- *
- * Creates a new boxed error in the given mempool from MonoError.
- * It does not alter ierror, so you still have to clean it up with
- * mono_error_cleanup or mono_error_convert_to_exception or another such function.
- *
- * Returns the boxed error, or NULL if the mempool could not allocate.
+ * \param ierror The input error that will be boxed.
+ * \param image The mempool of this image will hold the boxed error.
+ * Creates a new boxed error in the given mempool from \c MonoError.
+ * It does not alter \p ierror, so you still have to clean it up with
+ * \c mono_error_cleanup or \c mono_error_convert_to_exception or another such function.
+ * \returns the boxed error, or NULL if the mempool could not allocate.
*/
MonoErrorBoxed*
mono_error_box (const MonoError *ierror, MonoImage *image)
/**
* mono_error_set_from_boxed:
- * @oerror: The error that will be set to the contents of the box.
- * @box: A mempool-allocated error.
- *
+ * \param oerror The error that will be set to the contents of the box.
+ * \param box A mempool-allocated error.
* Sets the error condition in the oerror from the contents of the
* given boxed error. Does not alter the boxed error, so it can be
- * used in a future call to mono_error_set_from_boxed as needed. The
- * oerror should've been previously initialized with mono_error_init,
+ * used in a future call to \c mono_error_set_from_boxed as needed. The
+ * \p oerror should've been previously initialized with \c mono_error_init,
* as usual.
- *
- * Returns TRUE on success or FALSE on failure.
+ * \returns TRUE on success or FALSE on failure.
*/
gboolean
mono_error_set_from_boxed (MonoError *oerror, const MonoErrorBoxed *box)
+/**
+ * \file
+ */
+
#ifndef __MONO_ERROR_H__
#define __MONO_ERROR_H__
-/*
- * mono-filemap.c: Unix/Windows implementation for filemap.
+/**
+ * \file
+ * Unix/Windows implementation for filemap.
*
* Author:
* Paolo Molaro (lupus@ximian.com)
-/*
- * mono-hwcap-arm.c: ARM hardware feature detection
+/**
+ * \file
+ * ARM hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-arm64.c: ARM64 hardware feature detection
+/**
+ * \file
+ * ARM64 hardware feature detection
*
* Copyright 2013 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-hwcap-cross.c: No-op hardware feature detection
+/**
+ * \file
+ * No-op hardware feature detection
*
* Author:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-ia64.c: Itanium hardware feature detection
+/**
+ * \file
+ * Itanium hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-mips.c: MIPS hardware feature detection
+/**
+ * \file
+ * MIPS hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-ppc.c: PowerPC hardware feature detection
+/**
+ * \file
+ * PowerPC hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-s390x.c: S/390x hardware feature detection
+/**
+ * \file
+ * S/390x hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap-sparc.c: SPARC hardware feature detection
+/**
+ * \file
+ * SPARC hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_HWCAP_SPARC_H__
#define __MONO_UTILS_HWCAP_SPARC_H__
+/**
+ * \file
+ */
+
#include "config.h"
#if defined (TARGET_ARM)
-/*
- * mono-hwcap-x86.c: x86 hardware feature detection
+/**
+ * \file
+ * x86 hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
-/*
- * mono-hwcap.c: Hardware feature detection
+/**
+ * \file
+ * Hardware feature detection
*
* Authors:
* Alex Rønne Petersen (alexrp@xamarin.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_HWCAP_H__
#define __MONO_UTILS_HWCAP_H__
-/*
- * mono-internal-hash.c: A hash table which uses the values themselves as nodes.
+/**
+ * \file
+ * A hash table which uses the values themselves as nodes.
*
* Author:
* Mark Probst (mark.probst@gmail.com)
-/*
- * mono-internal-hash.h: A hash table which uses the values themselves as nodes.
+/**
+ * \file
+ * A hash table which uses the values themselves as nodes.
*
* Author:
* Mark Probst (mark.probst@gmail.com)
+/**
+ * \file
+ */
+
#include "config.h"
#include <string.h>
+/**
+ * \file
+ */
+
#ifndef __MONO_IO_PORTABILITY_H
#define __MONO_IO_PORTABILITY_H
-/*
- * mono-lazy-init.h: Lazy initialization and cleanup utilities
+/**
+ * \file
+ * Lazy initialization and cleanup utilities
*
* Authors: Ludovic Henry <ludovic@xamarin.com>
*
-/*
- * mono-split-ordered-list.c: A lock-free split ordered list.
+/**
+ * \file
+ * A lock-free split ordered list.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-linked-list-set.h: A lock-free split ordered list.
+/**
+ * \file
+ * A lock-free split ordered list.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-log-android.c: Android-specific interface to the logger
+/**
+ * \file
+ * Android-specific interface to the logger
*
* This module contains the Android logcat logger interface
*
#include "mono-logger-internals.h"
/**
- * mono_log_open_logcat
- *
- * Open access to Android logcat (no-op)
- *
- * @path - Not used
- * @userData - Not used
+ * mono_log_open_logcat:
+ * \param path Unused
+ * \param userData Unused
+ * Open access to Android logcat (no-op)
*/
void
mono_log_open_logcat (const char *path, void *userData)
}
/**
- * mono_log_write_logcat
- *
- * Write data to Android logcat.
- *
- * @domain - Identifier string
- * @level - Logging level flags
- * @format - Printf format string
- * @vargs - Variable argument list
+ * mono_log_write_logcat:
+ * \param domain Identifier string
+ * \param level Logging level flags
+ * \param format \c printf format string
+ * \param vargs Variable argument list
+ * Write data to Android logcat.
*/
void
mono_log_write_logcat (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message)
-/*
- * mono-log-common.c: Platform-independent interface to the logger
+/**
+ * \file
+ * Platform-independent interface to the logger
*
* This module contains the POSIX syslog logger interface
*
}
/**
- * mono_log_open_logfile
- *
- * Open the logfile. If the path is not specified default to stdout. If the
- * open fails issue a warning and use stdout as the log file destination.
- *
- * @path - Path for log file
- * @userData - Not used
+ * mono_log_open_logfile:
+ * \param path Path for log file
+ * \param userData Not used
+ * Open the logfile. If the path is not specified default to stdout. If the
+ * open fails issue a warning and use stdout as the log file destination.
*/
void
mono_log_open_logfile(const char *path, void *userData)
}
/**
- * mono_log_write_logfile
- *
- * Write data to the log file.
- *
- * @domain - Identifier string
- * @level - Logging level flags
- * @format - Printf format string
- * @vargs - Variable argument list
+ * mono_log_write_logfile:
+ * \param domain Identifier string
+ * \param level Logging level flags
+ * \param format \c printf format string
+ * \param vargs Variable argument list
+ * Write data to the log file.
*/
void
mono_log_write_logfile (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message)
}
/**
- * mono_log_close_logfile
- *
- * Close the log file
+ * mono_log_close_logfile:
+ * Close the log file
*/
void
mono_log_close_logfile()
-/*
- * mono-log-darwin.c: Darwin-specific interface to the logger
+/**
+ * \file
+ * Darwin-specific interface to the logger
*
*/
#include <config.h>
-/*
- * mono-log-posix.c: POSIX interface to the logger
+/**
+ * \file
+ * POSIX interface to the logger
*
* This module contains the POSIX syslog logger routines
*
}
/**
- * mono_log_open_logfile
- *
- * Open the syslog interface specifying that we want our PID recorded
- * and that we're using the LOG_USER facility.
- *
- * @ident - Identifier: ignored
- * @userData - Not used
+ * mono_log_open_syslog:
+ * \param ident Identifier: ignored
+ * \param userData Not used
+ * Open the syslog interface specifying that we want our PID recorded
+ * and that we're using the \c LOG_USER facility.
*/
void
mono_log_open_syslog(const char *ident, void *userData)
}
/**
- * mono_log_write_syslog
- *
- * Write data to the log file.
- *
- * @domain - Identifier string
- * @level - Logging level flags
- * @format - Printf format string
- * @vargs - Variable argument list
+ * mono_log_write_syslog:
+ * \param domain Identifier string
+ * \param level Logging level flags
+ * \param format \c printf format string
+ * \param vargs Variable argument list
+ * Write data to the log file.
*/
void
mono_log_write_syslog(const char *domain, GLogLevelFlags level, mono_bool hdr, const char *message)
}
/**
- * mono_log_close_logfile
- *
- * Close the log file
+ * mono_log_close_syslog:
+ * Close the log file
*/
void
mono_log_close_syslog()
-/*
- * mono-log-windows.c: Simplistic simulation of a syslog logger for Windows
+/**
+ * \file
+ * Simplistic simulation of a syslog logger for Windows
*
* This module contains the Windows syslog logger interface
*
}
/**
- * mono_log_open_syslog
- *
- * Open the syslog file. If the open fails issue a warning and
- * use stdout as the log file destination.
- *
- * @ident - Identifier: ignored
- * @userData - Not used
+ * mono_log_open_syslog:
+ * \param ident Identifier: ignored
+ * \param userData Not used
+ * Open the syslog file. If the open fails issue a warning and
+ * use stdout as the log file destination.
*/
void
mono_log_open_syslog(const char *ident, void *userData)
/**
* mono_log_write_syslog
- *
- * Write data to the syslog file.
- *
- * @domain - Identifier string
- * @level - Logging level flags
- * @format - Printf format string
- * @vargs - Variable argument list
+ * \param domain Identifier string
+ * \param level Logging level flags
+ * \param format \c printf format string
+ * \param vargs Variable argument list
+ * Write data to the syslog file.
*/
void
mono_log_write_syslog(const char *domain, GLogLevelFlags level, mono_bool hdr, const char *message)
+/**
+ * \file
+ */
+
#ifndef __MONO_LOGGER_INTERNAL_H__
#define __MONO_LOGGER_INTERNAL_H__
+/**
+ * \file
+ */
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
}
/**
- * mono_tracev:
- *
- * @level: Verbose level of the specified message
- * @mask: Type of the specified message
- *
+ * mono_tracev_inner:
+ * \param level Verbose level of the specified message
+ * \param mask Type of the specified message
* Traces a new message, depending on the current logging level
* and trace mask.
*/
/**
* mono_trace_set_level:
- *
- * @level: Verbose level to set
- *
+ * \param level Verbose level to set
* Sets the current logging level. Every subsequent call to
- * mono_trace will check the visibility of a message against this
+ * \c mono_trace will check the visibility of a message against this
* value.
*/
void
/**
* mono_trace_set_mask:
- *
- * @mask: Mask of visible message types.
- *
+ * \param mask Mask of visible message types.
* Sets the current logging level. Every subsequent call to
- * mono_trace will check the visibility of a message against this
+ * \c mono_trace will check the visibility of a message against this
* value.
*/
void
/**
* mono_trace_set_logdest:
- *
- * @dest: Destination for logging
- *
+ * \param dest Destination for logging
* Sets the current logging destination. This can be a file or, if supported,
* syslog.
*/
/**
* mono_trace_set_logheader:
- *
- * @head: Whether we want pid/date/time header on log messages
- *
+ * \param head Whether we want pid/date/time header on log messages
* Sets the current logging header option.
*/
void
/**
* mono_trace_push:
- *
- * @level: Verbose level to set
- * @mask: Mask of visible message types.
- *
- * Saves the current values of level and mask then calls mono_trace_set
+ * \param level Verbose level to set
+ * \param mask Mask of visible message types.
+ * Saves the current values of level and mask then calls \c mono_trace_set
* with the specified new values.
*/
void
/**
* mono_trace_set_log_handler_internal:
- *
- * @callback The callback that will replace the default logging handler
- * @user_data Argument passed to @callback
- *
+ * \param callback The callback that will replace the default logging handler
+ * \param user_data Argument passed to \p callback
* The log handler replaces the default runtime logger. All logging requests with be routed to it.
* If the fatal argument in the callback is true, the callback must abort the current process. The runtime expects that
* execution will not resume after a fatal error.
/**
* mono_trace_set_print_handler:
- *
- * @callback The callback that will replace the default runtime behavior for stdout output.
- *
+ * \param callback The callback that will replace the default runtime behavior for stdout output.
* The print handler replaces the default runtime stdout output handler. This is used by free form output done by the runtime.
- *
*/
void
mono_trace_set_print_handler (MonoPrintCallback callback)
/**
* mono_trace_set_printerr_handler:
- *
- * @callback The callback that will replace the default runtime behavior for stderr output.
- *
+ * \param callback The callback that will replace the default runtime behavior for stderr output.
* The print handler replaces the default runtime stderr output handler. This is used by free form output done by the runtime.
- *
*/
void
mono_trace_set_printerr_handler (MonoPrintCallback callback)
+/**
+ * \file
+ */
+
#ifndef __MONO_LOGGER_H__
#define __MONO_LOGGER_H__
-/*
- * mono-machine.h: machine definitions
+/**
+ * \file
+ * machine definitions
*
* Authors:
* Rodrigo Kumpera (kumpera@gmail.com)
+/**
+ * \file
+ */
#include "mono-math.h"
#ifndef HAVE_SIGNBIT
+/**
+ * mono_signbit_float:
+ */
int
mono_signbit_float (float x)
{
return u.i < 0;
}
+/**
+ * mono_signbit_double:
+ */
int
mono_signbit_double (double x)
{
+/**
+ * \file
+ */
#ifndef __MONO_SIGNBIT_H__
#define __MONO_SIGNBIT_H__
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
+/**
+ * \file
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
#if HAVE_COMMONCRYPTO_COMMONDIGEST_H
+/**
+ * mono_md5_init:
+ */
void
mono_md5_init (MonoMD5Context *ctx)
{
CC_MD5_Init (ctx);
}
+/**
+ * mono_md5_update:
+ */
void
mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len)
{
CC_MD5_Update (ctx, buf, len);
}
+/**
+ * mono_md5_final:
+ */
void
mono_md5_final (MonoMD5Context *ctx, guchar digest[16])
{
/**
- * mono_md5_get_digest: get the md5 hash of a buffer
- * @buffer: byte buffer
- * @buffer_size: buffer size (in bytes)
- * @digest: 16 bytes buffer receiving the hash code.
+ * mono_md5_get_digest:
+ * \param buffer byte buffer
+ * \param buffer_size buffer size (in bytes)
+ * \param digest 16-byte buffer receiving the hash code.
*
- * Get the md5 hash of a buffer. The result is put in
- * the 16 bytes buffer @digest .
- **/
+ * Get the MD5 hash of a buffer. The result is put in
+ * the 16-byte buffer \p digest.
+ */
void
mono_md5_get_digest (const guchar *buffer, gint buffer_size, guchar digest[16])
{
/**
- * mono_md5_get_digest_from_file: get the md5 hash of a file
- * @filename: file name
- * @digest: 16 bytes buffer receiving the hash code.
+ * mono_md5_get_digest_from_file:
+ * \param filename file name
+ * \param digest 16-byte buffer receiving the hash code.
*
- * Get the md5 hash of a file. The result is put in
- * the 16 bytes buffer @digest .
+ * Get the MD5 hash of a file. The result is put in
+ * the 16-byte buffer \p digest.
*
- * If an IO error happens the value in @digest is not updated.
- **/
+ * If an IO error happens the value in \p digest is not updated.
+ */
void
mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16])
{
-/*
- * mono-membar.h: Memory barrier inline functions
+/**
+ * \file
+ * Memory barrier inline functions
*
* Author:
* Mark Probst (mark.probst@gmail.com)
-/*
- * mono-memory-model.h: Mapping of the arch memory model.
+/**
+ * \file
+ * Mapping of the arch memory model.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-mmap-internals.h: Internal virtual memory stuff.
+/**
+ * \file
+ * Internal virtual memory stuff.
*
* Copyright (C) 2014 Xamarin Inc
*
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_MMAP_WINDOWS_H__
#define __MONO_UTILS_MMAP_WINDOWS_H__
-/*
- * mono-dl-windows-uwp.c: UWP dl support for Mono.
+/**
+ * \file
+ * UWP dl support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-mmap-windows.c: Windows support for mapping code into the process address space
+/**
+ * \file
+ * Windows support for mapping code into the process address space
*
* Author:
* Mono Team (mono-list@lists.ximian.com)
-/*
- * mono-mmap.c: Support for mapping code into the process address space
+/**
+ * \file
+ * Support for mapping code into the process address space
*
* Author:
* Mono Team (mono-list@lists.ximian.com)
/**
* mono_valloc:
- * @addr: memory address
- * @length: memory area size
- * @flags: protection flags
- *
- * Allocates @length bytes of virtual memory with the @flags
- * protection. @addr can be a preferred memory address or a
- * mandatory one if MONO_MMAP_FIXED is set in @flags.
- * @addr must be pagesize aligned and can be NULL.
- * @length must be a multiple of pagesize.
- *
- * Returns: NULL on failure, the address of the memory area otherwise
+ * \param addr memory address
+ * \param length memory area size
+ * \param flags protection flags
+ * Allocates \p length bytes of virtual memory with the \p flags
+ * protection. \p addr can be a preferred memory address or a
+ * mandatory one if MONO_MMAP_FIXED is set in \p flags.
+ * \p addr must be pagesize aligned and can be NULL.
+ * \p length must be a multiple of pagesize.
+ * \returns NULL on failure, the address of the memory area otherwise
*/
void*
mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
/**
* mono_vfree:
- * @addr: memory address returned by mono_valloc ()
- * @length: size of memory area
- *
- * Remove the memory mapping at the address @addr.
- *
- * Returns: 0 on success.
+ * \param addr memory address returned by mono_valloc ()
+ * \param length size of memory area
+ * Remove the memory mapping at the address \p addr.
+ * \returns \c 0 on success.
*/
int
mono_vfree (void *addr, size_t length, MonoMemAccountType type)
/**
* mono_file_map:
- * @length: size of data to map
- * @flags: protection flags
- * @fd: file descriptor
- * @offset: offset in the file
- * @ret_handle: pointer to storage for returning a handle for the map
- *
- * Map the area of the file pointed to by the file descriptor @fd, at offset
- * @offset and of size @length in memory according to the protection flags
- * @flags.
- * @offset and @length must be multiples of the page size.
- * @ret_handle must point to a void*: this value must be used when unmapping
- * the memory area using mono_file_unmap ().
- *
+ * \param length size of data to map
+ * \param flags protection flags
+ * \param fd file descriptor
+ * \param offset offset in the file
+ * \param ret_handle pointer to storage for returning a handle for the map
+ * Map the area of the file pointed to by the file descriptor \p fd, at offset
+ * \p offset and of size \p length in memory according to the protection flags
+ * \p flags.
+ * \p offset and \p length must be multiples of the page size.
+ * \p ret_handle must point to a void*: this value must be used when unmapping
+ * the memory area using \c mono_file_unmap().
*/
void*
mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_handle)
/**
* mono_file_unmap:
- * @addr: memory address returned by mono_file_map ()
- * @handle: handle of memory map
- *
- * Remove the memory mapping at the address @addr.
- * @handle must be the value returned in ret_handle by mono_file_map ().
- *
- * Returns: 0 on success.
+ * \param addr memory address returned by mono_file_map ()
+ * \param handle handle of memory map
+ * Remove the memory mapping at the address \p addr.
+ * \p handle must be the value returned in ret_handle by \c mono_file_map().
+ * \returns \c 0 on success.
*/
int
mono_file_unmap (void *addr, void *handle)
/**
* mono_mprotect:
- * @addr: memory address
- * @length: size of memory area
- * @flags: new protection flags
- *
- * Change the protection for the memory area at @addr for @length bytes
- * to matche the supplied @flags.
- * If @flags includes MON_MMAP_DISCARD the pages are discarded from memory
+ * \param addr memory address
+ * \param length size of memory area
+ * \param flags new protection flags
+ * Change the protection for the memory area at \p addr for \p length bytes
+ * to matche the supplied \p flags.
+ * If \p flags includes MON_MMAP_DISCARD the pages are discarded from memory
* and the area is cleared to zero.
- * @addr must be aligned to the page size.
- * @length must be a multiple of the page size.
- *
- * Returns: 0 on success.
+ * \p addr must be aligned to the page size.
+ * \p length must be a multiple of the page size.
+ * \returns \c 0 on success.
*/
#if defined(__native_client__)
int
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_MMAP_H__
#define __MONO_UTILS_MMAP_H__
+/**
+ * \file
+ */
+
#include "config.h"
#include "utils/mono-networkinterfaces.h"
/**
* mono_networkinterface_list:
- * @size: a pointer to a location where the size of the returned array is stored
- *
- * Return an array of names for the interfaces currently on the system.
- * The size of the array is stored in @size.
+ * \param size a pointer to a location where the size of the returned array is stored
+ * \returns an array of names for the interfaces currently on the system.
+ * The size of the array is stored in \p size.
*/
gpointer*
mono_networkinterface_list (int *size)
/**
* mono_network_get_data:
- * @name: name of the interface
- * @data: description of data to return
- *
- * Return a data item of a network adapter like bytes sent per sec, etc
- * according to the @data argumet.
+ * \param name name of the interface
+ * \param data description of data to return
+ * \return a data item of a network adapter like bytes sent per sec, etc
+ * according to the \p data argumet.
*/
gint64
mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error)
+/**
+ * \file
+ */
+
#ifndef __MONO_NETWORK_INTERFACES_H__
#define __MONO_NETWORK_INTERFACES_H__
/*
+/**
+ * \file
+ */
#ifndef __MONO_ONCE_H__
#define __MONO_ONCE_H__
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * mono-os-mutex.h: Portability wrappers around POSIX Mutexes
+/**
+ * \file
+ * Portability wrappers around POSIX Mutexes
*
* Authors: Jeffrey Stedfast <fejj@ximian.com>
*
-/*
- * mono-os-semaphore.h: Definitions for generic semaphore usage
+/**
+ * \file
+ * Definitions for generic semaphore usage
*
* Author:
* Geoff Norton <gnorton@novell.com>
-/*
- * mono-path.c: Routines for handling path names.
+/**
+ * \file
+ * Routines for handling path names.
*
* Authors:
* Gonzalo Paniagua Javier (gonzalo@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_PATH_H
#define __MONO_PATH_H
+/**
+ * \file
+ */
+
#include <config.h>
#ifdef HOST_WIN32
+/**
+ * \file
+ */
+
#ifndef MONO_POLL_H
#define MONO_POLL_H
+/**
+ * \file
+ */
+
#ifndef __MONO_UTILS_PROCLIB_WINDOWS_H__
#define __MONO_UTILS_PROCLIB_WINDOWS_H__
-/*
- * mono-proclib-windows-uwp.c: UWP proclib support for Mono.
+/**
+ * \file
+ * UWP proclib support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-proclib-windows.c: Windows proclib support for Mono.
+/**
+ * \file
+ * Windows proclib support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
/**
* mono_cpu_count:
- *
- * Return the number of processors on the system.
+ * \returns the number of processors on the system.
*/
int
mono_cpu_count (void)
-/*
+/**
+ * \file
* Copyright 2008-2011 Novell Inc
* Copyright 2011 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
/**
* mono_process_list:
- * @size: a pointer to a location where the size of the returned array is stored
- *
- * Return an array of pid values for the processes currently running on the system.
- * The size of the array is stored in @size.
+ * \param size a pointer to a location where the size of the returned array is stored
+ * \returns an array of pid values for the processes currently running on the system.
+ * The size of the array is stored in \p size.
*/
gpointer*
mono_process_list (int *size)
/**
* mono_process_get_name:
- * @pid: pid of the process
- * @buf: byte buffer where to store the name of the prcoess
- * @len: size of the buffer @buf
- *
- * Return the name of the process identified by @pid, storing it
- * inside @buf for a maximum of len bytes (including the terminating 0).
+ * \param pid pid of the process
+ * \param buf byte buffer where to store the name of the prcoess
+ * \param len size of the buffer \p buf
+ * \returns the name of the process identified by \p pid, storing it
+ * inside \p buf for a maximum of len bytes (including the terminating 0).
*/
char*
mono_process_get_name (gpointer pid, char *buf, int len)
/**
* mono_process_get_data:
- * @pid: pid of the process
- * @data: description of data to return
- *
- * Return a data item of a process like user time, memory use etc,
- * according to the @data argumet.
+ * \param pid pid of the process
+ * \param data description of data to return
+ * \returns a data item of a process like user time, memory use etc,
+ * according to the \p data argumet.
*/
gint64
mono_process_get_data_with_error (gpointer pid, MonoProcessData data, MonoProcessError *error)
/**
* mono_cpu_count:
- *
- * Return the number of processors on the system.
+ * \returns the number of processors on the system.
*/
#ifndef HOST_WIN32
int
/**
* mono_cpu_get_data:
- * @cpu_id: processor number or -1 to get a summary of all the processors
- * @data: type of data to retrieve
- *
+ * \param cpu_id processor number or -1 to get a summary of all the processors
+ * \param data type of data to retrieve
* Get data about a processor on the system, like time spent in user space or idle time.
*/
gint64
+/**
+ * \file
+ */
+
#ifndef __MONO_PROC_LIB_H__
#define __MONO_PROC_LIB_H__
/*
-/*
- * mono-property-hash.c: Hash table for (object, property) pairs
+/**
+ * \file
+ * Hash table for (object, property) pairs
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
-/*
- * mono-property-hash.h: Hash table for (object, property) pairs
+/**
+ * \file
+ * Hash table for (object, property) pairs
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
+/**
+ * \file
+ */
+
#include "config.h"
#include <mono/utils/mono-publib.h>
#include <glib.h>
/**
* mono_set_allocator_vtable
- *
- * Make the runtime use the functions in @vtable for allocating memory.
+ * Make the runtime use the functions in \p vtable for allocating memory.
* The provided functions must have the same semantics of their libc's equivalents.
- *
- * @return TRUE is the vtable was installed. FALSE if the version is incompatible.
+ * \returns TRUE if the vtable was installed. FALSE if the version is incompatible.
*/
mono_bool
mono_set_allocator_vtable (MonoAllocatorVTable* vtable)
+/**
+ * \file
+ */
+
#ifndef __MONO_PUBLIB_H__
#define __MONO_PUBLIB_H__
+/**
+ * \file
+ */
+
#ifndef _MONO_UTILS_RAND_WINDOWS_H_
#define _MONO_UTILS_RAND_WINDOWS_H_
-/*
- * mono-rand-windows-uwp.c: UWP rand support for Mono.
+/**
+ * \file
+ * UWP rand support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-rand-windows.c: Windows rand support for Mono.
+/**
+ * \file
+ * Windows rand support for Mono.
*
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
/**
* mono_rand_init:
- * @seed: A string containing seed data
- * @seed_size: Length of seed string
- *
- * Returns: On success, a non-NULL handle which can be used to fetch random data from mono_rand_try_get_bytes. On failure, NULL.
- *
+ * \param seed A string containing seed data
+ * \param seed_size Length of seed string
* Initializes an RNG client.
+ * \returns On success, a non-NULL handle which can be used to fetch random data from \c mono_rand_try_get_bytes. On failure, NULL.
*/
gpointer
mono_rand_init (guchar *seed, gint seed_size)
/**
* mono_rand_try_get_bytes:
- * @handle: A pointer to an RNG handle. Handle is set to NULL on failure.
- * @buffer: A buffer into which to write random data.
- * @buffer_size: Number of bytes to write into buffer.
- * @error: Set on error.
- *
- * Returns: FALSE on failure and sets @error, TRUE on success.
- *
+ * \param handle A pointer to an RNG handle. Handle is set to NULL on failure.
+ * \param buffer A buffer into which to write random data.
+ * \param buffer_size Number of bytes to write into buffer.
+ * \param error Set on error.
* Extracts bytes from an RNG handle.
+ * \returns FALSE on failure and sets \p error, TRUE on success.
*/
gboolean
mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, MonoError *error)
/**
* mono_rand_close:
- * @handle: An RNG handle.
- *
+ * \param handle An RNG handle.
* Releases an RNG handle.
*/
void
-/*
- * mono-rand.c:
+/**
+ * \file
*
* Authors:
* Mark Crichton (crichton@gimp.org)
/**
* mono_rand_try_get_uint32:
- * @handle: A pointer to an RNG handle. Handle is set to NULL on failure.
- * @val: A pointer to a 32-bit unsigned int, to which the result will be written.
- * @min: Result will be greater than or equal to this value.
- * @max: Result will be less than or equal to this value.
- *
- * Returns: FALSE on failure, TRUE on success.
- *
+ * \param handle A pointer to an RNG handle. Handle is set to NULL on failure.
+ * \param val A pointer to a 32-bit unsigned int, to which the result will be written.
+ * \param min Result will be greater than or equal to this value.
+ * \param max Result will be less than or equal to this value.
* Extracts one 32-bit unsigned int from an RNG handle.
+ * \returns FALSE on failure, TRUE on success.
*/
gboolean
mono_rand_try_get_uint32 (gpointer *handle, guint32 *val, guint32 min, guint32 max, MonoError *error)
+/**
+ * \file
+ */
+
#ifndef _MONO_UTILS_RAND_H_
#define _MONO_UTILS_RAND_H_
-/*
+/**
+\file
SHA-1 in C
By Steve Reid <sreid@sea-to-sky.net>
100% Public Domain
#if HAVE_COMMONCRYPTO_COMMONDIGEST_H
+/**
+ * mono_sha1_init:
+ */
void
mono_sha1_init (MonoSHA1Context* context)
{
CC_SHA1_Init (context);
}
+/**
+ * mono_sha1_update:
+ */
void
mono_sha1_update (MonoSHA1Context* context, const guchar* data, guint32 len)
{
CC_SHA1_Update (context, data, len);
}
+/**
+ * mono_sha1_final:
+ */
void
mono_sha1_final (MonoSHA1Context* context, unsigned char digest[20])
{
}
#endif
-
+
+/**
+ * mono_sha1_get_digest:
+ */
void
mono_sha1_get_digest (const guchar *buffer, gint buffer_size, guchar digest [20])
{
}
/**
- * mono_sha1_get_digest_from_file: get the sha1 hash of a file
- * @filename: file name
- * @digest: 20 bytes buffer receiving the hash code.
+ * mono_sha1_get_digest_from_file:
+ * \param filename file name
+ * \param digest 20-byte buffer receiving the hash code.
*
- * Get the sha1 hash of a file. The result is put in
- * the 20 bytes buffer @digest .
+ * Get the SHA-1 hash of a file. The result is put in
+ * the 20-byte buffer \p digest.
*
- * If an IO error happens the value in @digest is not updated.
- **/
+ * If an IO error happens the value in \p digest is not updated.
+ */
void
mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20])
{
mono_sha1_final (&ctx, digest);
}
-/*
+/**
* mono_digest_get_public_token:
*
* Get the public token from public key data.
- * @token must point to at least 8 bytes of storage.
+ * \p token must point to at least 8 bytes of storage.
*/
void
mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len)
+/**
+ * \file
+ */
+
#ifndef __MONO_MONO_SIGCONTEXT_H__
#define __MONO_MONO_SIGCONTEXT_H__
#define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__esi)
#define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__edi)
#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__eip)
+ #define UCONTEXT_REG_XMM
+ #define UCONTEXT_REG_XMM0(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm0)
+ #define UCONTEXT_REG_XMM1(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm1)
+ #define UCONTEXT_REG_XMM2(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm2)
+ #define UCONTEXT_REG_XMM3(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm3)
+ #define UCONTEXT_REG_XMM4(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm4)
+ #define UCONTEXT_REG_XMM5(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm5)
+ #define UCONTEXT_REG_XMM6(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm6)
+ #define UCONTEXT_REG_XMM7(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm7)
# else
#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->ss.eax)
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->ss.ebx)
-/*
- * mono-signal-handler.h: Handle signal handler differences across platforms
+/**
+ * \file
+ * Handle signal handler differences across platforms
*
* Copyright (C) 2013 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
+/**
+ * \file
* Copyright 2008-2010 Novell, Inc.
* Copyright 2011 Xamarin Inc.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
-/*
- * mono-stdlib.c: stdlib replacement functions.
+/**
+ * \file
+ * stdlib replacement functions.
*
* Authors:
* Gonzalo Paniagua Javier (gonzalo@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_FILE_H
#define __MONO_FILE_H
+/**
+ * \file
+ */
+
#ifndef __UTILS_MONO_STRING_H__
#define __UTILS_MONO_STRING_H__
#include <glib.h>
+/**
+ * \file
+ */
+
#include <config.h>
#if defined(PLATFORM_ANDROID)
-/*
- * mono-threads-api.h: Low level access to thread state.
+/**
+ * \file
+ * Low level access to thread state.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
- /*
- * mono-threads.c: Coop threading
+/**
+ * \file
+ * Coop threading
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-threads-coop.h: Cooperative suspend thread helpers
+/**
+ * \file
+ * Cooperative suspend thread helpers
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
+/**
+ * \file
+ */
#ifndef __MONO_UTILS_MONO_THREADS_DEBUG_H__
#define __MONO_UTILS_MONO_THREADS_DEBUG_H__
+/**
+ * \file
+ */
+
#include <config.h>
#if defined(__FreeBSD__)
+/**
+ * \file
+ */
+
#include <config.h>
#if (defined(__linux__) && !defined(PLATFORM_ANDROID)) || defined(__FreeBSD_kernel__)
-/*
- * mono-threads-mach-helper.c: ObjectiveC hacks to improve our changes with thread shutdown
+/**
+ * \file
+ * ObjectiveC hacks to improve our changes with thread shutdown
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-threads-mach.c: Low-level threading, mach version
+/**
+ * \file
+ * Low-level threading, mach version
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
+/**
+ * \file
+ */
+
#include <config.h>
#if defined(__NetBSD__)
+/**
+ * \file
+ */
+
#include <config.h>
#if defined(__OpenBSD__)
-/*
- * mono-threads-posix-signals.c: Shared facility for Posix signals support
+/**
+ * \file
+ * Shared facility for Posix signals support
*
* Author:
* Ludovic Henry (ludovic@gmail.com)
-/*
- * mono-threads-posix.c: Low-level threading, posix version
+/**
+ * \file
+ * Low-level threading, posix version
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
+/**
+ * \file
+ */
+
#include <config.h>
#include <mono/utils/mono-compiler.h>
-/*
- * mono-threads-windows.c: Low-level threading, windows version
+/**
+ * \file
+ * Low-level threading, windows version
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-threads.c: Low-level threading
+/**
+ * \file
+ * Low-level threading
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * mono-threads.h: Low-level threading
+/**
+ * \file
+ * Low-level threading
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
+/**
+ * \file
* Time utility functions.
* Author: Paolo Molaro (<lupus@ximian.com>)
* Copyright (C) 2008 Novell, Inc.
+/**
+ * \file
+ */
+
#ifndef __UTILS_MONO_TIME_H__
#define __UTILS_MONO_TIME_H__
-/*
- * mono-tls.c: Low-level TLS support
+/**
+ * \file
+ * Low-level TLS support
*
* Thread local variables that are accessed both from native and managed code
* are defined here and should be accessed only through this APIs
static MonoNativeTlsKey mono_tls_key_thread;
static MonoNativeTlsKey mono_tls_key_jit_tls;
static MonoNativeTlsKey mono_tls_key_domain;
-static MonoNativeTlsKey mono_tls_key_lmf;
static MonoNativeTlsKey mono_tls_key_sgen_thread_info;
static MonoNativeTlsKey mono_tls_key_lmf_addr;
MONO_THREAD_VAR_OFFSET (mono_tls_thread, tls_offsets [TLS_KEY_THREAD]);
MONO_THREAD_VAR_OFFSET (mono_tls_jit_tls, tls_offsets [TLS_KEY_JIT_TLS]);
MONO_THREAD_VAR_OFFSET (mono_tls_domain, tls_offsets [TLS_KEY_DOMAIN]);
- MONO_THREAD_VAR_OFFSET (mono_tls_lmf, tls_offsets [TLS_KEY_LMF]);
MONO_THREAD_VAR_OFFSET (mono_tls_lmf_addr, tls_offsets [TLS_KEY_LMF_ADDR]);
#else
mono_native_tls_alloc (&mono_tls_key_thread, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_jit_tls, tls_offsets [TLS_KEY_JIT_TLS]);
mono_native_tls_alloc (&mono_tls_key_domain, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_domain, tls_offsets [TLS_KEY_DOMAIN]);
- mono_native_tls_alloc (&mono_tls_key_lmf, NULL);
- MONO_THREAD_VAR_OFFSET (mono_tls_key_lmf, tls_offsets [TLS_KEY_LMF]);
mono_native_tls_alloc (&mono_tls_key_lmf_addr, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_lmf_addr, tls_offsets [TLS_KEY_LMF_ADDR]);
#endif
mono_native_tls_free (mono_tls_key_thread);
mono_native_tls_free (mono_tls_key_jit_tls);
mono_native_tls_free (mono_tls_key_domain);
- mono_native_tls_free (mono_tls_key_lmf);
mono_native_tls_free (mono_tls_key_sgen_thread_info);
mono_native_tls_free (mono_tls_key_lmf_addr);
#endif
return name ? (gpointer)"mono_tls_get_jit_tls" : (gpointer)mono_tls_get_jit_tls;
case TLS_KEY_DOMAIN:
return name ? (gpointer)"mono_tls_get_domain" : (gpointer)mono_tls_get_domain;
- case TLS_KEY_LMF:
- return name ? (gpointer)"mono_tls_get_lmf" : (gpointer)mono_tls_get_lmf;
case TLS_KEY_SGEN_THREAD_INFO:
return name ? (gpointer)"mono_tls_get_sgen_thread_info" : (gpointer)mono_tls_get_sgen_thread_info;
case TLS_KEY_LMF_ADDR:
return name ? (gpointer)"mono_tls_set_jit_tls" : (gpointer)mono_tls_set_jit_tls;
case TLS_KEY_DOMAIN:
return name ? (gpointer)"mono_tls_set_domain" : (gpointer)mono_tls_set_domain;
- case TLS_KEY_LMF:
- return name ? (gpointer)"mono_tls_set_lmf" : (gpointer)mono_tls_set_lmf;
case TLS_KEY_SGEN_THREAD_INFO:
return name ? (gpointer)"mono_tls_set_sgen_thread_info" : (gpointer)mono_tls_set_sgen_thread_info;
case TLS_KEY_LMF_ADDR:
return NULL;
}
-gpointer
-mono_tls_get_tls_addr (MonoTlsKey key)
-{
-#ifdef HAVE_GET_TLS_ADDR
- if (key == TLS_KEY_LMF) {
-#if defined(USE_KW_THREAD)
- return &mono_tls_lmf;
-#elif defined(TARGET_MACH)
- return mono_mach_get_tls_address_from_thread (pthread_self (), mono_tls_key_lmf);
-#endif
- }
-#endif
- /* Implement if we ever need for other targets/keys */
- g_assert_not_reached ();
- return NULL;
-}
-
/* Getters for each tls key */
gpointer mono_tls_get_thread (void)
{
return MONO_TLS_GET_VALUE (mono_tls_domain, mono_tls_key_domain);
}
-gpointer mono_tls_get_lmf (void)
-{
- return MONO_TLS_GET_VALUE (mono_tls_lmf, mono_tls_key_lmf);
-}
-
gpointer mono_tls_get_sgen_thread_info (void)
{
return MONO_TLS_GET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info);
MONO_TLS_SET_VALUE (mono_tls_domain, mono_tls_key_domain, value);
}
-void mono_tls_set_lmf (gpointer value)
-{
- MONO_TLS_SET_VALUE (mono_tls_lmf, mono_tls_key_lmf, value);
-}
-
void mono_tls_set_sgen_thread_info (gpointer value)
{
MONO_TLS_SET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info, value);
-/*
- * mono-tls.h: Low-level TLS support
+/**
+ * \file
+ * Low-level TLS support
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
TLS_KEY_JIT_TLS = 1,
/* mono_domain_get () */
TLS_KEY_DOMAIN = 2,
- TLS_KEY_LMF = 3,
- TLS_KEY_SGEN_THREAD_INFO = 4,
- TLS_KEY_LMF_ADDR = 5,
- TLS_KEY_NUM = 6
+ TLS_KEY_SGEN_THREAD_INFO = 3,
+ TLS_KEY_LMF_ADDR = 4,
+ TLS_KEY_NUM = 5
} MonoTlsKey;
#ifdef HAVE_KW_THREAD
#define USE_KW_THREAD
#endif
-#if defined(USE_KW_THREAD)
-#define HAVE_GET_TLS_ADDR
-#elif defined(TARGET_MACH) && (defined(TARGET_X86) || defined(TARGET_AMD64))
-/* mono_mach_get_tls_address_from_thread is untested for arm/arm64 */
-#define HAVE_GET_TLS_ADDR
-#endif
-
#ifdef HOST_WIN32
#include <windows.h>
gint32 mono_tls_get_tls_offset (MonoTlsKey key);
gpointer mono_tls_get_tls_getter (MonoTlsKey key, gboolean name);
gpointer mono_tls_get_tls_setter (MonoTlsKey key, gboolean name);
-gpointer mono_tls_get_tls_addr (MonoTlsKey key);
gpointer mono_tls_get_thread (void);
gpointer mono_tls_get_jit_tls (void);
gpointer mono_tls_get_domain (void);
-gpointer mono_tls_get_lmf (void);
gpointer mono_tls_get_sgen_thread_info (void);
gpointer mono_tls_get_lmf_addr (void);
void mono_tls_set_thread (gpointer value);
void mono_tls_set_jit_tls (gpointer value);
void mono_tls_set_domain (gpointer value);
-void mono_tls_set_lmf (gpointer value);
void mono_tls_set_sgen_thread_info (gpointer value);
void mono_tls_set_lmf_addr (gpointer value);
-/*
- * mono-uri.c: Simple routine used to escape uris.
+/**
+ * \file
+ * Simple routine used to escape uris.
*
* Author:
* Miguel de Icaza (miguel@novell.com)
+/**
+ * \file
+ */
+
#ifndef __MONO_URI_H
#define __MONO_URI_H
#include <glib.h>
-/*
- * mono-value-hash.c: A hash table which only stores values in the hash nodes.
+/**
+ * \file
+ * A hash table which only stores values in the hash nodes.
*
* Author:
* Miguel de Icaza (miguel@novell.com)
-/*
- * mono-value-hash.h: A hash table which only stores values in the hash nodes.
+/**
+ * \file
+ * A hash table which only stores values in the hash nodes.
*
* Author:
* Mark Probst (mark.probst@gmail.com)
+/**
+ * \file
+ */
+
#include <glib.h>
#include <string.h>
#define BITS_PER_CHUNK MONO_BITSET_BITS_PER_CHUNK
-/*
+/**
* mono_bitset_alloc_size:
- * @max_size: The number of bits you want to hold
- * @flags: unused
- *
- * Return the number of bytes required to hold the bitset.
+ * \param max_size The number of bits you want to hold
+ * \param flags unused
+ * \returns the number of bytes required to hold the bitset.
* Useful to allocate it on the stack or with mempool.
- * Use with mono_bitset_mem_new ().
+ * Use with \c mono_bitset_mem_new.
*/
guint32
mono_bitset_alloc_size (guint32 max_size, guint32 flags) {
return sizeof (MonoBitSet) + sizeof (gsize) * (real_size - MONO_ZERO_LEN_ARRAY);
}
-/*
+/**
* mono_bitset_new:
- * @max_size: The numer of bits you want to hold
- * @flags: bitfield of flags
- *
- * Return a bitset of size max_size. It must be freed using
- * mono_bitset_free.
+ * \param max_size The numer of bits you want to hold
+ * \param flags bitfield of flags
+ * \returns a bitset of size \p max_size. It must be freed using
+ * \c mono_bitset_free.
*/
MonoBitSet *
mono_bitset_new (guint32 max_size, guint32 flags) {
return result;
}
-/*
+/**
* mono_bitset_mem_new:
- * @mem: The location the bitset is stored
- * @max_size: The number of bits you want to hold
- * @flags: bitfield of flags
+ * \param mem The location the bitset is stored
+ * \param max_size The number of bits you want to hold
+ * \param flags bitfield of flags
*
- * Return mem, which is now a initialized bitset of size max_size. It is
- * not freed even if called with mono_bitset_free. mem must be at least
- * as big as mono_bitset_alloc_size returns for the same max_size.
+ * Return \p mem, which is now a initialized bitset of size \p max_size. It is
+ * not freed even if called with \c mono_bitset_free. \p mem must be at least
+ * as big as \c mono_bitset_alloc_size returns for the same \p max_size.
*/
MonoBitSet *
mono_bitset_mem_new (gpointer mem, guint32 max_size, guint32 flags) {
/*
* mono_bitset_free:
- * @set: bitset ptr to free
+ * \param set bitset ptr to free
*
- * Free bitset unless flags have MONO_BITSET_DONT_FREE set. Does not
- * free anything if flag MONO_BITSET_DONT_FREE is set or bitset was
- * made with mono_bitset_mem_new.
+ * Free bitset unless flags have \c MONO_BITSET_DONT_FREE set. Does not
+ * free anything if flag \c MONO_BITSET_DONT_FREE is set or bitset was
+ * made with \c mono_bitset_mem_new.
*/
void
mono_bitset_free (MonoBitSet *set) {
g_free (set);
}
-/*
+/**
* mono_bitset_set:
- * @set: bitset ptr
- * @pos: set bit at this pos
+ * \param set bitset ptr
+ * \param pos set bit at this pos
*
- * Set bit at pos @pos, counting from 0.
+ * Set bit at \p pos, counting from 0.
*/
void
mono_bitset_set (MonoBitSet *set, guint32 pos) {
set->data [j] |= (gsize)1 << bit;
}
-/*
+/**
* mono_bitset_test:
- * @set: bitset ptr
- * @pos: test bit at this pos
- *
- * Test bit at pos @pos, counting from 0.
- * Returns a value != 0 if set, 0 otherwise.
+ * \param set bitset ptr
+ * \param pos test bit at this pos
+ * Test bit at \p pos, counting from 0.
+ * \returns a nonzero value if set, 0 otherwise.
*/
int
mono_bitset_test (const MonoBitSet *set, guint32 pos) {
return (set->data [j] & ((gsize)1 << bit)) > 0;
}
-/*
+/**
* mono_bitset_test_bulk:
- * @set: bitset ptr
- * @pos: test bit at this pos
- *
- * Return 32/64 bits from the bitset, starting from @pos, which must be
+ * \param set bitset ptr
+ * \param pos test bit at this pos
+ * \returns 32/64 bits from the bitset, starting from \p pos, which must be
* divisible with 32/64.
*/
gsize
return set->data [j];
}
-/*
+/**
* mono_bitset_clear:
- * @set: bitset ptr
- * @pos: unset bit at this pos
+ * \param set bitset ptr
+ * \param pos unset bit at this pos
*
- * Unset bit at pos 'pos', counting from 0.
+ * Unset bit at \p pos, counting from 0.
*/
void
mono_bitset_clear (MonoBitSet *set, guint32 pos) {
set->data [j] &= ~((gsize)1 << bit);
}
-/*
+/**
* mono_bitset_clear_all:
- * @set: bitset ptr
+ * \param set bitset ptr
*
* Unset all bits.
*/
memset (set->data, 0, set->size / 8);
}
-/*
+/**
* mono_bitset_set_all:
- * @set: bitset ptr
+ * \param set bitset ptr
*
* Set all bits.
*/
memset (set->data, -1, set->size / 8);
}
-/*
+/**
* mono_bitset_invert:
- * @set: bitset ptr
+ * \param set bitset ptr
*
* Flip all bits.
*/
set->data [i] = ~set->data [i];
}
-/*
+/**
* mono_bitset_size:
- * @set: bitset ptr
- *
- * Returns the number of bits this bitset can hold.
+ * \param set bitset ptr
+ * \returns the number of bits this bitset can hold.
*/
guint32
mono_bitset_size (const MonoBitSet *set) {
*/
#if 1
-/*
+/**
* mono_bitset_count:
- * @set: bitset ptr
- *
- * return number of bits that is set.
+ * \param set bitset ptr
+ * \returns number of bits that are set.
*/
guint32
mono_bitset_count (const MonoBitSet *set) {
return -1;
}
-/*
+/**
* mono_bitset_find_start:
- * @set: bitset ptr
- *
- * Equivalent to mono_bitset_find_first (set, -1) but faster.
+ * \param set bitset ptr
+ * Equivalent to <code>mono_bitset_find_first (set, -1)</code> but faster.
*/
int
mono_bitset_find_start (const MonoBitSet *set)
return -1;
}
-/*
+/**
* mono_bitset_find_first:
- * @set: bitset ptr
- * @pos: pos to search _after_ (not including)
- *
- * Returns position of first set bit after @pos. If pos < 0 begin search from
- * start. Return -1 if no bit set is found.
+ * \param set bitset ptr
+ * \param pos pos to search after (not including)
+ * \returns position of first set bit after \p pos. If \p pos < 0, begin search from
+ * start. Return \c -1 if no bit set is found.
*/
int
mono_bitset_find_first (const MonoBitSet *set, gint pos) {
return -1;
}
-/*
+/**
* mono_bitset_find_last:
- * @set: bitset ptr
- * @pos: pos to search _before_ (not including)
- *
- * Returns position of last set bit before pos. If pos < 0 search is
- * started from the end. Returns -1 if no set bit is found.
+ * \param set bitset ptr
+ * \param pos pos to search before (not including)
+ * \returns position of last set bit before \p pos. If \p pos < 0 search is
+ * started from the end. Returns \c -1 if no set bit is found.
*/
int
mono_bitset_find_last (const MonoBitSet *set, gint pos) {
return -1;
}
-/*
+/**
* mono_bitset_find_first_unset:
- * @set: bitset ptr
- * @pos: pos to search _after_ (not including)
- *
- * Returns position of first unset bit after @pos. If pos < 0 begin search from
- * start. Return -1 if no bit set is found.
+ * \param set bitset ptr
+ * \param pos pos to search after (not including)
+ * \returns position of first unset bit after \p pos. If \p pos < 0 begin search from
+ * start. Return \c -1 if no bit set is found.
*/
int
mono_bitset_find_first_unset (const MonoBitSet *set, gint pos) {
return -1;
}
-/*
+/**
* mono_bitset_clone:
- * @set: bitset ptr to clone
- * @new_size: number of bits the cloned bitset can hold
- *
- * Return a cloned bitset of size new_size. MONO_BITSET_DONT_FREE
- * unset in cloned bitset. If new_size is 0, the cloned object is just
+ * \param set bitset ptr to clone
+ * \param new_size number of bits the cloned bitset can hold
+ * \returns a cloned bitset of size \p new_size. \c MONO_BITSET_DONT_FREE
+ * unset in cloned bitset. If \p new_size is 0, the cloned object is just
* as big.
*/
MonoBitSet*
return result;
}
-/*
+/**
* mono_bitset_copyto:
- * @src: bitset ptr to copy from
- * @dest: bitset ptr to copy to
+ * \param src bitset ptr to copy from
+ * \param dest bitset ptr to copy to
*
* Copy one bitset to another.
*/
memcpy (&dest->data, &src->data, dest->size / 8);
}
-/*
+/**
* mono_bitset_union:
- * @dest: bitset ptr to hold union
- * @src: bitset ptr to copy
+ * \param dest bitset ptr to hold union
+ * \param src bitset ptr to copy
*
* Make union of one bitset and another.
*/
dest->data [i] |= src->data [i];
}
-/*
+/**
* mono_bitset_intersection:
- * @dest: bitset ptr to hold intersection
- * @src: bitset ptr to copy
+ * \param dest bitset ptr to hold intersection
+ * \param src bitset ptr to copy
*
* Make intersection of one bitset and another.
*/
dest->data [i] &= src->data [i];
}
-/*
+/**
* mono_bitset_intersection_2:
- * @dest: bitset ptr to hold intersection
- * @src1: first bitset
- * @src2: second bitset
+ * \param dest bitset ptr to hold intersection
+ * \param src1 first bitset
+ * \param src2 second bitset
*
* Make intersection of two bitsets
*/
dest->data [i] = src1->data [i] & src2->data [i];
}
-/*
+/**
* mono_bitset_sub:
- * @dest: bitset ptr to hold bitset - src
- * @src: bitset ptr to copy
+ * \param dest bitset ptr to hold bitset - src
+ * \param src bitset ptr to copy
*
- * Unset all bits in dest, which are set in src.
+ * Unset all bits in \p dest that are set in \p src.
*/
void
mono_bitset_sub (MonoBitSet *dest, const MonoBitSet *src) {
dest->data [i] &= ~src->data [i];
}
-/*
+/**
* mono_bitset_equal:
- * @src: bitset ptr
- * @src1: bitset ptr
- *
- * return TRUE if their size are the same and the same bits are set in
+ * \param src bitset ptr
+ * \param src1 bitset ptr
+ * \returns TRUE if their size are the same and the same bits are set in
* both bitsets.
*/
gboolean
return TRUE;
}
-/*
+/**
* mono_bitset_foreach:
- * @set: bitset ptr
- * @func: Function to call for every set bit
- * @data: pass this as second arg to func
- *
- * Calls func for every bit set in bitset. Argument 1 is the number of
+ * \param set bitset ptr
+ * \param func Function to call for every set bit
+ * \param data pass this as second arg to func
+ * Calls \p func for every bit set in bitset. Argument 1 is the number of
* the bit set, argument 2 is data
*/
void
+/**
+ * \file
+ */
+
#ifndef __MONO_BITSET_H__
#define __MONO_BITSET_H__
-/*
- * networking-fallbacks.c: Fallback networking code that rely on old BSD apis or whatever else is available.
+/**
+ * \file
+ * Fallback networking code that rely on old BSD apis or whatever else is available.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * networking-missing.c: Implements missing standard socket functions.
+/**
+ * \file
+ * Implements missing standard socket functions.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * networking-posix.c: Modern posix networking code
+/**
+ * \file
+ * Modern posix networking code
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * networking-windows.c: Windows-specific networking implementations
+/**
+ * \file
+ * Windows-specific networking implementations
*
* Author:
* Alexander Köplinger (alex.koeplinger@outlook.com)
-/*
- * networking.c: Portable networking functions
+/**
+ * \file
+ * Portable networking functions
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * networking.h: Portable networking functions
+/**
+ * \file
+ * Portable networking functions
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * os-event-unix.c: MonoOSEvent on Unix
+/**
+ * \file
+ * MonoOSEvent on Unix
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
-/*
- * os-event-win32.c: MonoOSEvent on Win32
+/**
+ * \file
+ * MonoOSEvent on Win32
*
* Author:
* Ludovic Henry (luhenry@microsoft.com)
+/**
+ * \file
+ */
#ifndef _MONO_UTILS_OS_EVENT_H_
#define _MONO_UTILS_OS_EVENT_H_
-/*
- * parse.c: Parsing for GC options.
+/**
+ * \file
+ * Parsing for GC options.
*
* Copyright (C) 2015 Xamarin Inc
*
/**
* mono_gc_parse_environment_string_extract_number:
- *
- * @str: points to the first digit of the number
- * @out: pointer to the variable that will receive the value
- *
+ * \param str points to the first digit of the number
+ * \param out pointer to the variable that will receive the value
* Tries to extract a number from the passed string, taking in to account m, k
* and g suffixes
- *
- * Returns true if passing was successful
+ * \returns TRUE if passing was successful
*/
gboolean
mono_gc_parse_environment_string_extract_number (const char *str, size_t *out)
-/*
- * parse.h: Parsing for GC options.
+/**
+ * \file
+ * Parsing for GC options.
*
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
+/**
+ * \file
+ */
#ifndef __MONO_UTILS_REFCOUNT_H__
#define __MONO_UTILS_REFCOUNT_H__
-/*
- * strenc.c: string encoding conversions
+/**
+ * \file
+ * string encoding conversions
*
* Author:
* Dick Porter (dick@ximian.com)
/**
* mono_unicode_from_external:
- * @in: pointers to the buffer.
- * @bytes: number of bytes in the string.
- *
- * Tries to turn a NULL-terminated string into UTF16.
+ * \param in pointers to the buffer.
+ * \param bytes number of bytes in the string.
+ * Tries to turn a NULL-terminated string into UTF-16.
*
- * First, see if it's valid UTF8, in which case just turn it directly
- * into UTF16. Next, run through the colon-separated encodings in
- * MONO_EXTERNAL_ENCODINGS and do an iconv conversion on each,
- * returning the first successful conversion to UTF16. If no
+ * First, see if it's valid UTF-8, in which case just turn it directly
+ * into UTF-16. Next, run through the colon-separated encodings in
+ * \c MONO_EXTERNAL_ENCODINGS and do an \c iconv conversion on each,
+ * returning the first successful conversion to UTF-16. If no
* conversion succeeds, return NULL.
*
- * Callers must free the returned string if not NULL. bytes holds the number
+ * Callers must free the returned string if not NULL. \p bytes holds the number
* of bytes in the returned string, not including the terminator.
*/
gunichar2 *
/**
* mono_utf8_from_external:
- * @in: pointer to the string buffer.
- *
+ * \param in pointer to the string buffer.
* Tries to turn a NULL-terminated string into UTF8.
*
- * First, see if it's valid UTF8, in which case there's nothing more
+ * First, see if it's valid UTF-8, in which case there's nothing more
* to be done. Next, run through the colon-separated encodings in
- * MONO_EXTERNAL_ENCODINGS and do an iconv conversion on each,
- * returning the first successful conversion to utf8. If no
+ * \c MONO_EXTERNAL_ENCODINGS and do an \c iconv conversion on each,
+ * returning the first successful conversion to UTF-8. If no
* conversion succeeds, return NULL.
*
* Callers must free the returned string if not NULL.
*
- * This function is identical to mono_unicode_from_external, apart
- * from returning utf8 not utf16; it's handy in a few places to work
- * in utf8.
+ * This function is identical to \c mono_unicode_from_external, apart
+ * from returning UTF-8 not UTF-16; it's handy in a few places to work
+ * in UTF-8.
*/
gchar *mono_utf8_from_external (const gchar *in)
{
/**
* mono_unicode_to_external:
- * @uni: an UTF16 string to conver to an external representation.
- *
- * Turns NULL-terminated UTF16 into either UTF8, or the first
- * working item in MONO_EXTERNAL_ENCODINGS if set. If no conversions
- * work, then UTF8 is returned.
- *
+ * \param uni a UTF-16 string to convert to an external representation.
+ * Turns NULL-terminated UTF-16 into either UTF-8, or the first
+ * working item in \c MONO_EXTERNAL_ENCODINGS if set. If no conversions
+ * work, then UTF-8 is returned.
* Callers must free the returned string.
*/
gchar *mono_unicode_to_external (const gunichar2 *uni)
/**
* mono_utf8_validate_and_len
- * @source: Pointer to putative UTF-8 encoded string.
- *
- * Checks @source for being valid UTF-8. @utf is assumed to be
+ * \param source Pointer to putative UTF-8 encoded string.
+ * Checks \p source for being valid UTF-8. \p utf is assumed to be
* null-terminated.
- *
- * Return value: true if @source is valid.
- * oEnd : will equal the null terminator at the end of the string if valid.
- * if not valid, it will equal the first charater of the invalid sequence.
- * oLengh : will equal the length to @oEnd
+ * \returns TRUE if \p source is valid.
+ * \p oEnd will equal the null terminator at the end of the string if valid.
+ * if not valid, it will equal the first charater of the invalid sequence.
+ * \p oLength will equal the length to \p oEnd
**/
gboolean
mono_utf8_validate_and_len (const gchar *source, glong* oLength, const gchar** oEnd)
/**
* mono_utf8_validate_and_len_with_bounds
- * @source: Pointer to putative UTF-8 encoded string.
- * @max_bytes: Max number of bytes that can be decoded. This function returns FALSE if
- * it needs to decode characters beyond that.
+ * \param source: Pointer to putative UTF-8 encoded string.
+ * \param max_bytes: Max number of bytes that can be decoded.
*
- * Checks @source for being valid UTF-8. @utf is assumed to be
+ * Checks \p source for being valid UTF-8. \p utf is assumed to be
* null-terminated.
*
- * Return value: true if @source is valid.
- * oEnd : will equal the null terminator at the end of the string if valid.
- * if not valid, it will equal the first charater of the invalid sequence.
- * oLengh : will equal the length to @oEnd
+ * This function returns FALSE if it needs to decode characters beyond \p max_bytes.
+ *
+ * \returns TRUE if \p source is valid.
+ * \p oEnd will equal the null terminator at the end of the string if valid.
+ * if not valid, it will equal the first charater of the invalid sequence.
+ * \p oLength will equal the length to \p oEnd
**/
gboolean
mono_utf8_validate_and_len_with_bounds (const gchar *source, glong max_bytes, glong* oLength, const gchar** oEnd)
-/*
- * strenc.h: string encoding conversions
+/**
+ * \file
+ * string encoding conversions
*
* Author:
* Dick Porter (dick@ximian.com)
+/**
+ * \file
+ */
#ifndef __MONO_UTILS_W32API_H__
#define __MONO_UTILS_W32API_H__
{
##Look for diffs.
$mono_version = (Select-String -InputObject $_.InputObject -pattern '#define VERSION \"(.*)\"')
- if ($mono_version -eq $null) {
+ $mono_corlib_version = (Select-String -InputObject $_.InputObject -pattern '#define MONO_CORLIB_VERSION')
+ if ($mono_version -eq $null -And $mono_corlib_version -eq $null) {
Write-Host "Changes detected, versions doesn't match. Configuration must to be replaced."
exit 1;
}
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<LinkIncremental>true</LinkIncremental>\r
+ <CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
<LinkIncremental>true</LinkIncremental>\r
+ <CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+ <CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<PreBuildEvent>\r
<SubSystem>Console</SubSystem>\r
<TargetMachine>MachineX86</TargetMachine>\r
</Link>\r
- <PostBuildEvent>\r
+ <PostBuildEvent />\r
+ <CustomBuildStep>\r
<Command>runmdesc.bat "$(TargetPath)" $(Platform)</Command>\r
- </PostBuildEvent>\r
+ <Message>genmdesc.exe Custom Build Step.</Message>\r
+ <Outputs>$(MONO_INCLUDE_DIR)\mini\cpu-x86.h</Outputs>\r
+ <Inputs>$(MONO_INCLUDE_DIR)\mini\cpu-x86.md</Inputs>\r
+ </CustomBuildStep>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
<PreBuildEvent>\r
<SubSystem>Console</SubSystem>\r
<TargetMachine>MachineX64</TargetMachine>\r
</Link>\r
- <PostBuildEvent>\r
+ <PostBuildEvent />\r
+ <CustomBuildStep>\r
<Command>runmdesc.bat "$(TargetPath)" $(Platform)</Command>\r
- </PostBuildEvent>\r
+ </CustomBuildStep>\r
+ <CustomBuildStep>\r
+ <Message>genmdesc.exe Custom Build Step.</Message>\r
+ </CustomBuildStep>\r
+ <CustomBuildStep>\r
+ <Outputs>$(MONO_INCLUDE_DIR)\mini\cpu-amd64.h</Outputs>\r
+ </CustomBuildStep>\r
+ <CustomBuildStep>\r
+ <Inputs>$(MONO_INCLUDE_DIR)\mini\cpu-amd64.md</Inputs>\r
+ </CustomBuildStep>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<PreBuildEvent>\r
<TargetMachine>MachineX86</TargetMachine>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
</Link>\r
- <PostBuildEvent>\r
+ <PostBuildEvent />\r
+ <CustomBuildStep>\r
<Command>runmdesc.bat "$(TargetPath)" $(Platform)</Command>\r
- </PostBuildEvent>\r
+ <Message>genmdesc.exe Custom Build Step.</Message>\r
+ <Outputs>$(MONO_INCLUDE_DIR)\mini\cpu-x86.h</Outputs>\r
+ <Inputs>$(MONO_INCLUDE_DIR)\mini\cpu-x86.md</Inputs>\r
+ </CustomBuildStep>\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
<PreBuildEvent>\r
<TargetMachine>MachineX64</TargetMachine>\r
<GenerateDebugInformation>true</GenerateDebugInformation>\r
</Link>\r
- <PostBuildEvent>\r
+ <PostBuildEvent />\r
+ <CustomBuildStep>\r
<Command>runmdesc.bat "$(TargetPath)" $(Platform)</Command>\r
- </PostBuildEvent>\r
+ <Outputs>$(MONO_INCLUDE_DIR)\mini\cpu-amd64.h</Outputs>\r
+ <Inputs>$(MONO_INCLUDE_DIR)\mini\cpu-amd64.md</Inputs>\r
+ <Message>genmdesc.exe Custom Build Step.</Message>\r
+ </CustomBuildStep>\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<ClCompile Include="..\mono\mini\genmdesc.c">\r
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
<ItemGroup Label="ProjectConfigurations">\r
<ProjectConfiguration Include="Debug|Win32">\r
<Link>\r
<SubSystem>Windows</SubSystem>\r
</Link>\r
- <PostBuildEvent>\r
- <Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>\r
- </PostBuildEvent>\r
+ <PostBuildEvent />\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
<PreBuildEvent>\r
<Link>\r
<SubSystem>Windows</SubSystem>\r
</Link>\r
- <PostBuildEvent>\r
- <Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>\r
- </PostBuildEvent>\r
+ <PostBuildEvent />\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<PreBuildEvent>\r
<EnableCOMDATFolding>true</EnableCOMDATFolding>\r
<OptimizeReferences>true</OptimizeReferences>\r
</Link>\r
- <PostBuildEvent>\r
- <Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>\r
- </PostBuildEvent>\r
+ <PostBuildEvent />\r
</ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
<PreBuildEvent>\r
<EnableCOMDATFolding>true</EnableCOMDATFolding>\r
<OptimizeReferences>true</OptimizeReferences>\r
</Link>\r
- <PostBuildEvent>\r
- <Command>.\libmono.bat "$(MONO_INCLUDE_DIR)" "$(SolutionDir)include\mono" -q</Command>\r
- </PostBuildEvent>\r
+ <PostBuildEvent />\r
</ItemDefinitionGroup>\r
<ItemGroup>\r
<CustomBuildStep Include="..\mono\mini\mini-x86.h">\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ImportGroup>\r
-</Project>\r
+</Project>
\ No newline at end of file
{C36612BD-22D3-4B95-85E2-7FDC4FC5D740}.Release|x64.ActiveCfg = Release|x64\r
{C36612BD-22D3-4B95-85E2-7FDC4FC5D740}.Release|x64.Build.0 = Release|x64\r
{3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Debug|Win32.Build.0 = Debug|Win32\r
{3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Debug|x64.ActiveCfg = Debug|x64\r
- {3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Debug|x64.Build.0 = Debug|x64\r
{3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Release|Win32.ActiveCfg = Release|Win32\r
- {3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Release|Win32.Build.0 = Release|Win32\r
{3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Release|x64.ActiveCfg = Release|x64\r
- {3E0D229E-C39F-4EDA-9A6A-A33ECEA0322D}.Release|x64.Build.0 = Release|x64\r
{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}.Debug|Win32.ActiveCfg = Debug|Win32\r
{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}.Debug|Win32.Build.0 = Debug|Win32\r
{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}.Debug|x64.ActiveCfg = Debug|x64\r
{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}.Release|x64.ActiveCfg = Release|x64\r
{CB0D9E92-293C-439C-9AC7-C5F59B6E0772}.Release|x64.Build.0 = Release|x64\r
{C7D83158-4EB6-4409-8730-612AD45FAF6A}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {C7D83158-4EB6-4409-8730-612AD45FAF6A}.Debug|Win32.Build.0 = Debug|Win32\r
{C7D83158-4EB6-4409-8730-612AD45FAF6A}.Debug|x64.ActiveCfg = Debug|x64\r
- {C7D83158-4EB6-4409-8730-612AD45FAF6A}.Debug|x64.Build.0 = Debug|x64\r
{C7D83158-4EB6-4409-8730-612AD45FAF6A}.Release|Win32.ActiveCfg = Release|Win32\r
- {C7D83158-4EB6-4409-8730-612AD45FAF6A}.Release|Win32.Build.0 = Release|Win32\r
{C7D83158-4EB6-4409-8730-612AD45FAF6A}.Release|x64.ActiveCfg = Release|x64\r
- {C7D83158-4EB6-4409-8730-612AD45FAF6A}.Release|x64.Build.0 = Release|x64\r
{6C64262B-077B-4E12-AF91-9409ECCB75F6}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {6C64262B-077B-4E12-AF91-9409ECCB75F6}.Debug|Win32.Build.0 = Debug|Win32\r
{6C64262B-077B-4E12-AF91-9409ECCB75F6}.Debug|x64.ActiveCfg = Debug|x64\r
- {6C64262B-077B-4E12-AF91-9409ECCB75F6}.Debug|x64.Build.0 = Debug|x64\r
{6C64262B-077B-4E12-AF91-9409ECCB75F6}.Release|Win32.ActiveCfg = Release|Win32\r
- {6C64262B-077B-4E12-AF91-9409ECCB75F6}.Release|Win32.Build.0 = Release|Win32\r
{6C64262B-077B-4E12-AF91-9409ECCB75F6}.Release|x64.ActiveCfg = Release|x64\r
- {6C64262B-077B-4E12-AF91-9409ECCB75F6}.Release|x64.Build.0 = Release|x64\r
{7BECCFA0-28A0-4995-9856-558560F720E6}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {7BECCFA0-28A0-4995-9856-558560F720E6}.Debug|Win32.Build.0 = Debug|Win32\r
{7BECCFA0-28A0-4995-9856-558560F720E6}.Debug|x64.ActiveCfg = Debug|x64\r
- {7BECCFA0-28A0-4995-9856-558560F720E6}.Debug|x64.Build.0 = Debug|x64\r
{7BECCFA0-28A0-4995-9856-558560F720E6}.Release|Win32.ActiveCfg = Release|Win32\r
- {7BECCFA0-28A0-4995-9856-558560F720E6}.Release|Win32.Build.0 = Release|Win32\r
{7BECCFA0-28A0-4995-9856-558560F720E6}.Release|x64.ActiveCfg = Release|x64\r
- {7BECCFA0-28A0-4995-9856-558560F720E6}.Release|x64.Build.0 = Release|x64\r
{0046B994-40A8-4C64-AC9D-429DC9177B54}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {0046B994-40A8-4C64-AC9D-429DC9177B54}.Debug|Win32.Build.0 = Debug|Win32\r
{0046B994-40A8-4C64-AC9D-429DC9177B54}.Debug|x64.ActiveCfg = Debug|x64\r
- {0046B994-40A8-4C64-AC9D-429DC9177B54}.Debug|x64.Build.0 = Debug|x64\r
{0046B994-40A8-4C64-AC9D-429DC9177B54}.Release|Win32.ActiveCfg = Release|Win32\r
- {0046B994-40A8-4C64-AC9D-429DC9177B54}.Release|Win32.Build.0 = Release|Win32\r
{0046B994-40A8-4C64-AC9D-429DC9177B54}.Release|x64.ActiveCfg = Release|x64\r
- {0046B994-40A8-4C64-AC9D-429DC9177B54}.Release|x64.Build.0 = Release|x64\r
{DC50997D-8A0D-4EB6-849B-9D7FBC39CE53}.Debug|Win32.ActiveCfg = Debug|x64\r
{DC50997D-8A0D-4EB6-849B-9D7FBC39CE53}.Debug|x64.ActiveCfg = Debug|x64\r
{DC50997D-8A0D-4EB6-849B-9D7FBC39CE53}.Debug|x64.Build.0 = Debug|x64\r
{DC50997D-8A0D-4EB6-849B-9D7FBC39CE53} = {DE3617B4-17A8-4E5F-A00F-BA43D956881F}\r
EndGlobalSection\r
GlobalSection(ExtensibilityGlobals) = postSolution\r
- AMDCaProjectFile = C:\Users\Owner\Development\monogit\mono\msvc\CodeAnalyst\mono.caw\r
- AMDCaPersistentStartup = mono\r
AMDCaPersistentConfig = Debug|Win32\r
+ AMDCaPersistentStartup = mono\r
+ AMDCaProjectFile = C:\Users\Owner\Development\monogit\mono\msvc\CodeAnalyst\mono.caw\r
EndGlobalSection\r
GlobalSection(DPCodeReviewSolutionGUID) = preSolution\r
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\r
</project>
<project dir="class/Mono.Cecil" library="Mono.Cecil-basic">
<boot>true</boot>
- <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/basic/System.Core.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/basic/System.Core.dll -r:./../../class/lib/basic/System.dll</flags>
<output>Mono.Cecil.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/basic/Mono.Cecil.dll</library_output>
</project>
<project dir="class/Mono.Cecil" library="Mono.Cecil-build">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/build/System.Core.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/build/System.Core.dll -r:./../../class/lib/build/System.dll</flags>
<output>Mono.Cecil.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/build/Mono.Cecil.dll</library_output>
</project>
<project dir="class/corlib" library="corlib-net_4_x">
<boot>true</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib /debug:portable -optimize -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin -runtimemetadataversion:v4.0.30319 -d:MONO_FEATURE_CONSOLE</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib /debug:portable -optimize -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin -runtimemetadataversion:v4.0.30319 -d:MONO_FEATURE_CONSOLE -d:MONO_FEATURE_APPLETLS</flags>
<output>mscorlib.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/mscorlib.dll</library_output>
</project>
<project dir="class/System" library="System-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_APPLETLS -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
<output>System.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/System.dll</library_output>
</project>
<project dir="class/System" library="System-bare-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_APPLETLS -d:MONO_FEATURE_BTLS</flags>
<output>System.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/bare/System.dll</library_output>
</project>
<project dir="class/System" library="System-secxml-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -nowarn:436 -d:CODEDOM -d:MONO_FEATURE_APPLETLS -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
<output>System.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/secxml/System.dll</library_output>
</project>
<project dir="class/Mono.Cecil" library="Mono.Cecil-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -keyfile:../../mono.snk -d:NET_3_5 /publicsign -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.dll</flags>
<output>Mono.Cecil.dll</output>
<built_sources></built_sources>
- <library_output>./../../../class/lib/net_4_x/legacy/Mono.Cecil.dll</library_output>
+ <library_output>./../../class/lib/net_4_x/Mono.Cecil.dll</library_output>
<fx_version>4.5</fx_version>
<profile>net_4_x</profile>
<resources></resources>
<resources></resources>
<response>System.Reflection.Context.dll.sources</response>
</project>
- <project dir="class/legacy/Mono.Cecil" library="Mono.Cecil-net_4_x">
+ <project dir="class/legacy/Mono.Cecil" library="legacy_Mono.Cecil-net_4_x">
<boot>false</boot>
<flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib -r:./../../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -keyfile:../../mono.snk -d:NET_3_5 /publicsign -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
<output>Mono.Cecil.dll</output>
ECHO copy %WIN_CONFIG_H% %CONFIG_H%
copy %WIN_CONFIG_H% %CONFIG_H%
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content %CONFIG_H%) -replace '#MONO_VERSION#', (Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content %CONFIG_H%" 2>&1
+ %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
)
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cairo-net_4_x", "mcs/class/Mono.Cairo/Mono.Cairo-net_4_x.csproj", "{D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil-net_4_x", "mcs/class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj", "{6DE38817-EC25-433A-AE58-0D30C5E6C460}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil-net_4_x", "mcs/class/Mono.Cecil/Mono.Cecil-net_4_x.csproj", "{2C0D558F-0B38-4691-967E-A910A1B995C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Mdb-net_4_x", "mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj", "{CF14D34A-F69B-47FB-A99C-D25C77198F30}"
EndProject
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Context-net_4_x", "mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj", "{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "legacy_Mono.Cecil-net_4_x", "mcs/class/legacy/Mono.Cecil/legacy_Mono.Cecil-net_4_x.csproj", "{CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.X509Certificates-net_4_x", "mcs/class/Facades/System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj", "{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceModel.Primitives-net_4_x", "mcs/class/Facades/System.ServiceModel.Primitives/Facades_System.ServiceModel.Primitives-net_4_x.csproj", "{524B10FC-880D-4131-8CAE-027BC3A68B6F}"
{D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Release|Any CPU.Build.0 = Release|Any CPU
- {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2C0D558F-0B38-4691-967E-A910A1B995C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2C0D558F-0B38-4691-967E-A910A1B995C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2C0D558F-0B38-4691-967E-A910A1B995C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2C0D558F-0B38-4691-967E-A910A1B995C1}.Release|Any CPU.Build.0 = Release|Any CPU
{CF14D34A-F69B-47FB-A99C-D25C77198F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF14D34A-F69B-47FB-A99C-D25C77198F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF14D34A-F69B-47FB-A99C-D25C77198F30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CF1339E8-584B-4B3D-9A93-6F4AFDAFEE66}.Release|Any CPU.Build.0 = Release|Any CPU
{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
#!/bin/sh
-exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/xbuild/14.0/bin/xbuild.exe "$@"
+MONO_GC_PARAMS="nursery-size=64m,$MONO_GC_PARAMS" exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/xbuild/14.0/bin/xbuild.exe "$@"
};
static readonly Dictionary<int, string[][]> GroupSizes = new Dictionary<int, string[][]> {
- { 0x0028, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0026, new [] { new [] { "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0039, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0045, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0046, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0049, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004a, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004b, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x004c, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x004c, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004d, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004e, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004f, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x0051, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0053, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0054, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0051, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
{ 0x0057, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x005b, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x005d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x005e, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0060, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0061, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x006d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x006f, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0078, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x007c, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0428, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x006f, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
+ { 0x0426, new [] { new [] { "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0439, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0445, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0446, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0449, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044a, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044b, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x044c, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x044c, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044d, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044e, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044f, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x0451, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0453, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0454, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0451, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
{ 0x0457, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x045b, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x045d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x045e, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0460, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0461, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x046d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x046f, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0478, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x047c, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x046f, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
+ { 0x0820, new [] { new [] { "3", "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0845, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x0849, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0850, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x085d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0860, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x0c50, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0c51, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x4009, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x540a, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x785d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x7c28, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
{ 0x7c50, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x7c5d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
};
static readonly Dictionary<int, string[]> Text = new Dictionary<int, string[]> {
nuget-hash-extractor.exe: $(SOURCES)
mcs /r:System.Xml.Linq /r:System.IO.Compression -o:nuget-hash-extractor.exe $(SOURCES)
-download:
+.download_stamp_file: Makefile download.sh
echo "Downloading all the nugets"; \
./download.sh
-run: nuget-hash-extractor.exe
+download: .download_stamp_file
+
+run: nuget-hash-extractor.exe .download_stamp_file
mono nuget-hash-extractor.exe nugets
+
+run-asm: nuget-hash-extractor.exe .download_stamp_file
+ mono nuget-hash-extractor.exe nugets asm
+
+run-ver: nuget-hash-extractor.exe .download_stamp_file
+ mono nuget-hash-extractor.exe nugets ver
+
.PHONY: download run
#System.ValueTuple
wget https://www.nuget.org/api/v2/package/System.ValueTuple/4.3.0 -O nugets/system.valuetuple.4.3.0.nupkg
-#System.Security.Cryptography.OpenSsl when .net 4.6.2 + 1 is out
\ No newline at end of file
+#System.Security.Cryptography.OpenSsl when .net 4.6.2 + 1 is out
+
+touch .download_stamp_file
\ No newline at end of file
LoadAndDump (et, version);
}
}
+
+ static bool dump_asm, dump_ver;
static void Main (string[] args) {
+
+ if (args.Length > 1) {
+ dump_asm = args [1].Equals ("asm");
+ dump_ver = args [1].Equals ("ver");
+ } else {
+ dump_asm = true;
+ }
foreach (var f in Directory.GetFiles (args [0], "*.nupkg")) {
DumpNuget (f);
}
var data = StreamToArray (entry.Open ());
AppDomain ad = AppDomain.CreateDomain ("parse_" + ++domain_id);
DoParse p = (DoParse)ad.CreateInstanceAndUnwrap (typeof (DoParse).Assembly.FullName, typeof (DoParse).FullName);
- p.ParseAssembly (data, version, entry.Name, entry.FullName);
+ p.ParseAssembly (data, version, entry.Name, entry.FullName, dump_asm, dump_ver);
AppDomain.Unload (ad);
}
}
class DoParse : MarshalByRefObject {
+
static int Hash (string str) {
int h = 5381;
for (int i = 0; i < str.Length; ++i)
return parts[parts.Length - 2];
}
- public void ParseAssembly (byte[] data, string version, string name, string fullname) {
+ public void ParseAssembly (byte[] data, string version, string name, string fullname, bool dump_asm, bool dump_ver) {
var a = Assembly.ReflectionOnlyLoad (data);
var m = a.GetModules ()[0];
var id = m.ModuleVersionId.ToString ().ToUpper ();
string ver_str = version + " " + FileToMoniker (fullname);
- Console.WriteLine ($"IGNORED_ASSEMBLY (0x{hash_code}, {str}, \"{id}\", \"{ver_str}\"),");
+ if (dump_asm)
+ Console.WriteLine ($"IGNORED_ASSEMBLY (0x{hash_code}, {str}, \"{id}\", \"{ver_str}\"),");
+
+ //IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 2, 0),
+ var ver = a.GetName ().Version;
+ if (dump_ver)
+ Console.WriteLine ($"IGNORED_ASM_VER ({str}, {ver.Major}, {ver.Minor}, {ver.Build}, {ver.Revision}),");
+
}
}
\ No newline at end of file
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/tokentype.h>
#include <mono/metadata/appdomain.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/verify-internals.h>
*assembly = NULL;
fullpath = g_build_filename (path1, path2, path3, path4, NULL);
if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, NULL);
g_free (fullpath);
return (*assembly != NULL);
mono_verifier_set_mode (verifier_mode);
- assembly = mono_assembly_open (file, NULL);
+ assembly = mono_assembly_open_predicate (file, FALSE, FALSE, NULL, NULL, NULL);
/*fake an assembly for netmodules so the verifier works*/
if (!assembly && (image = mono_image_open (file, &status)) && image->tables [MONO_TABLE_ASSEMBLY].rows == 0) {
assembly = g_new0 (MonoAssembly, 1);
/* Version number of package */
#define VERSION "#MONO_VERSION#"
+
+/* Version of the corlib-runtime interface */
+#define MONO_CORLIB_VERSION #MONO_CORLIB_VERSION#
+
#endif