Windows msbuild triggers too much to rebuild.
[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
# 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])
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 44bc86223530a07fa74ab87007cf264e53d63400
-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.
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
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/
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=
# so we need a System.dll that can do that.
#NO_PROCESS_START=1
NO_MONO_SECURITY=1
+MONO_FEATURE_APPLETLS=
+ONLY_APPLETLS=
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
<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
<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
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 ();
}
}
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;
}
}
[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
$(wildcard Test/System.Data/schemas/*.xsd) \
Test/test-config-file \
Test/System.Data/binserialize/*.bin \
+ Test/ProviderTests/sql/*.sql \
SqliteTest.db \
corefx.common.sources
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>
+++ /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
</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
base.GetObjectData (info, context);
}
-
+
private static string GetMessage(PrinterSettings settings)
{
if (settings.PrinterName == null || settings.PrinterName == String.Empty)
using System.IO;
using System.Drawing.Imaging;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
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);
// 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.ComponentModel;
[Browsable(false)]
public bool IsSystemFont {
get {
- if (systemFontName == null)
- return false;
-
- return StringComparer.InvariantCulture.Compare (systemFontName, string.Empty) != 0;
+ return !string.IsNullOrEmpty (systemFontName);
}
}
}
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.ComponentModel;
using System.Drawing.Imaging;
using System.IO;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
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);
}
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
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 \
--- /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
$(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
--- /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");
}
}
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)
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
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
}
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
- }
-}
-
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]
}
[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 ();
+ }
+ }
+ }
+ }
}
}
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
--- /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
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
+
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 =
+#if MONO_FEATURE_APPLETLS
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
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 // ONLY_APPLETLS should not support any other option
+ return InitFromHandleApple (handle);
+#elif MONOTOUCH_WATCH
+ throw new PlatformNotSupportedException ();
+#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 // ONLY_APPLETLS should not support any other option
+ return ImportApple (rawData);
+#elif MONOTOUCH_WATCH
+ throw new PlatformNotSupportedException ();
+#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
- }
-}
-
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
<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="..\referencesource\mscorlib\system\unsafecharbuffer.cs" />\r
<Compile Include="..\referencesource\mscorlib\system\version.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="CoreFoundation\CFHelpers.cs" />\r
<Compile Include="corefx\SR.cs" />\r
<Compile Include="corert\AddrofIntrinsics.cs" />\r
<Compile Include="corert\Debug.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
../../../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
+
/// 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;
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;
+ }
}
}
<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
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;
}
<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
-/*
- * 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)
/**
* 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)
{
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.
*/
-/*
- * 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)
/**
* 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
/**
* 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 *
/**
* 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)
/**
* 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:
- * @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)
{
/**
* 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)
/**
* 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)
/**
* 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_
-/*
- * 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)
+/**
+ * \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/>
-/*
- * coree.h: mscoree.dll functions
+/**
+ * \file
+ * mscoree.dll functions
*
* Author:
* Kornel Pal <http://www.kornelpal.hu/>
+/**
+ * \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.
-/*
- * domain.c: MonoDomain functions
+/**
+ * \file
+ * MonoDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
/**
* 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)
/**
* 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:
-/*
+/**
+ * \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)
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)
{
gboolean
mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 minor, guint16 build, guint16 revision)
{
- return FALSE;
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 ||
}
/**
- * 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__
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>
+/**
+ * \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)
{
/**
* 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)
+/**
+ * \file
+ */
#ifndef _MONO_METADATA_THREADPOOL_WORKER_H
#define _MONO_METADATA_THREADPOOL_WORKER_H
-/*
- * threadpool.c: Microsoft threadpool runtime support
+/**
+ * \file
+ * Microsoft threadpool runtime support
*
* Author:
* Ludovic Henry (ludovic.henry@xamarin.com)
+/**
+ * \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)
-/*
- * 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)
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)
+/**
+ * \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)
exit (1);
}
+/**
+ * mono_parse_default_optimizations:
+ */
int
mono_parse_default_optimizations (const char* p)
{
/**
* 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
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.
*/
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.
*
*
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:
{
+/**
+ * \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)
/**
* 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)
-/*
- * mini-amd64-gsharedvt.c: libcorkscrew-based native unwinder
+/**
+ * \file
+ * libcorkscrew-based native unwinder
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
-/*
- * 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.
*
/**
* 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)
}
/*
- * 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__
+/**
+ * \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)
/**
* 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
* 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>
+/**
+ * \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)
*
-/*
- * mini-arm64.h
+/**
+ * \file
*
* Copyright 2013 Xamarin Inc
*
-/*
- * 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)
-/*
- * mini-ia64.c: IA64 backend for the Mono code generator
+/**
+ * \file
+ * IA64 backend for the Mono code generator
*
* Authors:
* Zoltan Varga (vargaz@gmail.com)
+/**
+ * \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)
+/**
+ * \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)
/**
* 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;
/**
* 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)
/**
* 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)
/**
* 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 */
+/**
+ * \file
+ */
+
#ifndef __MONO_MINI_S390X_H__
#define __MONO_MINI_S390X_H__
-/*
- * 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 (!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)
* 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];
}
}
+#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);
}
/**
- * 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__
-/*
- * mini.c: The new Mono code generator.
+/**
+ * \file
+ * The new Mono code generator.
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
-/*
+/**
+ * \file
* Copyright 2002-2003 Ximian Inc
* Copyright 2003-2011 Novell Inc
* Copyright 2011 Xamarin Inc
+/**
+ * \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_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;
-/*
- * 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)
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)
{
-/*
- * 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*
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)
{
-/*
- * 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)
-/*
- * tramp-ppc.c: JIT trampoline code for PowerPC
+/**
+ * \file
+ * JIT trampoline code for PowerPC
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
-/*------------------------------------------------------------------*/
-/* */
-/* 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 */
-/*
- * 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)
+/**
+ * \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
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 \
--- /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
+}
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;
+ }
}
TEST_RUNNER_ARGS += $(if $(V), --verbose,)
-CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
-
if FULL_AOT_TESTS
TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
endif
-/*
- * 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)
-/*
- * mono-context.h: plat independent machine state definitions
+/**
+ * \file
+ * plat independent machine state definitions
*
*
* Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+/**
+ * \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__
-/*
- * 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
-/*
- * mono-tls.h: Low-level TLS support
+/**
+ * \file
+ * Low-level TLS support
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
-/*
- * 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__
</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>
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 "$@"