Add IObserver/IObservable to MOBILE profile.
[mono-project.git] / mono / metadata / mono-config.c
blobe73b23ab258c325e5a9b03058204f070a39b91f3
1 /*
2 * mono-config.c
4 * Runtime and assembly configuration file support routines.
6 * Author: Paolo Molaro (lupus@ximian.com)
8 * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
9 * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
11 #include "config.h"
12 #include <glib.h>
13 #include <string.h>
15 #include "mono/metadata/assembly.h"
16 #include "mono/metadata/loader.h"
17 #include "mono/metadata/mono-config.h"
18 #include "mono/metadata/metadata-internals.h"
19 #include "mono/metadata/object-internals.h"
20 #include "mono/utils/mono-logger-internal.h"
22 #if defined(TARGET_PS3)
23 #define CONFIG_OS "CellOS"
24 #elif defined(__linux__)
25 #define CONFIG_OS "linux"
26 #elif defined(__APPLE__)
27 #define CONFIG_OS "osx"
28 #elif defined(sun)
29 #define CONFIG_OS "solaris"
30 #elif defined(__FreeBSD__)
31 #define CONFIG_OS "freebsd"
32 #elif defined(__NetBSD__)
33 #define CONFIG_OS "netbsd"
34 #elif defined(__OpenBSD__)
35 #define CONFIG_OS "openbsd"
36 #elif defined(__WIN32__)
37 #define CONFIG_OS "windows"
38 #elif defined(_IBMR2)
39 #define CONFIG_OS "aix"
40 #elif defined(__hpux)
41 #define CONFIG_OS "hpux"
42 #elif defined(__HAIKU__)
43 #define CONFIG_OS "haiku"
44 #else
45 #warning Unknown operating system
46 #define CONFIG_OS "unknownOS"
47 #endif
49 #ifndef CONFIG_CPU
50 #if defined(__i386__)
51 #define CONFIG_CPU "x86"
52 #define CONFIG_WORDSIZE "32"
53 #elif defined(__x86_64__)
54 #define CONFIG_CPU "x86-64"
55 #define CONFIG_WORDSIZE "64"
56 #elif defined(sparc) || defined(__sparc__)
57 #define CONFIG_CPU "sparc"
58 #define CONFIG_WORDSIZE "32"
59 #elif defined(__ppc64__) || defined(__powerpc64__) || defined(TARGET_POWERPC)
60 #define CONFIG_WORDSIZE "64"
61 #ifdef __mono_ppc_ilp32__
62 # define CONFIG_CPU "ppc64ilp32"
63 #else
64 # define CONFIG_CPU "ppc64"
65 #endif
66 #elif defined(__ppc__) || defined(__powerpc__)
67 #define CONFIG_CPU "ppc"
68 #define CONFIG_WORDSIZE "32"
69 #elif defined(__s390x__)
70 #define CONFIG_CPU "s390x"
71 #define CONFIG_WORDSIZE "64"
72 #elif defined(__s390__)
73 #define CONFIG_CPU "s390"
74 #define CONFIG_WORDSIZE "32"
75 #elif defined(__arm__)
76 #define CONFIG_CPU "arm"
77 #define CONFIG_WORDSIZE "32"
78 #elif defined(__ia64__)
79 #define CONFIG_CPU "ia64"
80 #define CONFIG_WORDSIZE "64"
81 #elif defined(__alpha__)
82 #define CONFIG_CPU "alpha"
83 #define CONFIG_WORDSIZE "64"
84 #elif defined(hppa) || defined(__hppa__)
85 #define CONFIG_CPU "hppa"
86 #define CONFIG_WORDSIZE "32"
87 #elif defined(mips) || defined(__mips) || defined(_mips)
88 #define CONFIG_CPU "mips"
89 #define CONFIG_WORDSIZE "32"
90 #else
91 #error Unknown CPU
92 #define CONFIG_CPU "unknownCPU"
93 #endif
94 #endif
96 static void start_element (GMarkupParseContext *context,
97 const gchar *element_name,
98 const gchar **attribute_names,
99 const gchar **attribute_values,
100 gpointer user_data,
101 GError **error);
103 static void end_element (GMarkupParseContext *context,
104 const gchar *element_name,
105 gpointer user_data,
106 GError **error);
108 static void parse_text (GMarkupParseContext *context,
109 const gchar *text,
110 gsize text_len,
111 gpointer user_data,
112 GError **error);
114 static void passthrough (GMarkupParseContext *context,
115 const gchar *text,
116 gsize text_len,
117 gpointer user_data,
118 GError **error);
120 static void parse_error (GMarkupParseContext *context,
121 GError *error,
122 gpointer user_data);
124 static const GMarkupParser
125 mono_parser = {
126 start_element,
127 end_element,
128 parse_text,
129 passthrough,
130 parse_error
133 static GHashTable *config_handlers;
135 static const char *mono_cfg_dir = NULL;
136 static char *mono_cfg_dir_allocated = NULL;
138 /* when this interface is stable, export it. */
139 typedef struct MonoParseHandler MonoParseHandler;
141 struct MonoParseHandler {
142 const char *element_name;
143 void*(*init) (MonoImage *assembly);
144 void (*start) (gpointer user_data, const gchar *name,
145 const gchar **attributes,
146 const gchar **values);
147 void (*text) (gpointer user_data, const char *text, gsize test_len);
148 void (*end) (gpointer user_data, const char *name);
149 void (*finish) (gpointer user_data);
152 typedef struct {
153 MonoAssemblyBindingInfo *info;
154 void (*info_parsed)(MonoAssemblyBindingInfo *info, void *user_data);
155 void *user_data;
156 } ParserUserData;
158 typedef struct {
159 MonoParseHandler *current;
160 void *user_data;
161 MonoImage *assembly;
162 int inited;
163 } ParseState;
165 static void start_element (GMarkupParseContext *context,
166 const gchar *element_name,
167 const gchar **attribute_names,
168 const gchar **attribute_values,
169 gpointer user_data,
170 GError **error)
172 ParseState *state = user_data;
173 if (!state->current) {
174 state->current = g_hash_table_lookup (config_handlers, element_name);
175 if (state->current && state->current->init)
176 state->user_data = state->current->init (state->assembly);
178 if (state->current && state->current->start)
179 state->current->start (state->user_data, element_name, attribute_names, attribute_values);
182 static void end_element (GMarkupParseContext *context,
183 const gchar *element_name,
184 gpointer user_data,
185 GError **error)
187 ParseState *state = user_data;
188 if (state->current) {
189 if (state->current->end)
190 state->current->end (state->user_data, element_name);
191 if (strcmp (state->current->element_name, element_name) == 0) {
192 if (state->current->finish)
193 state->current->finish (state->user_data);
194 state->current = NULL;
195 state->user_data = NULL;
200 static void parse_text (GMarkupParseContext *context,
201 const gchar *text,
202 gsize text_len,
203 gpointer user_data,
204 GError **error)
206 ParseState *state = user_data;
207 if (state->current && state->current->text)
208 state->current->text (state->user_data, text, text_len);
211 static void passthrough (GMarkupParseContext *context,
212 const gchar *text,
213 gsize text_len,
214 gpointer user_data,
215 GError **error)
217 /* do nothing */
220 static void parse_error (GMarkupParseContext *context,
221 GError *error,
222 gpointer user_data)
224 ParseState *state = user_data;
225 const gchar *msg;
226 const gchar *filename;
228 filename = state && state->user_data ? (gchar *) state->user_data : "<unknown>";
229 msg = error && error->message ? error->message : "";
230 g_warning ("Error parsing %s: %s", filename, msg);
233 static int
234 arch_matches (const char* arch, const char *value)
236 char **splitted, **p;
237 int found = FALSE;
238 if (value [0] == '!')
239 return !arch_matches (arch, value + 1);
240 p = splitted = g_strsplit (value, ",", 0);
241 while (*p) {
242 if (strcmp (arch, *p) == 0) {
243 found = TRUE;
244 break;
246 p++;
248 g_strfreev (splitted);
249 return found;
252 typedef struct {
253 char *dll;
254 char *target;
255 int ignore;
256 MonoImage *assembly;
257 } DllInfo;
259 static void*
260 dllmap_init (MonoImage *assembly) {
261 DllInfo *info = g_new0 (DllInfo, 1);
262 info->assembly = assembly;
263 return info;
266 static void
267 dllmap_start (gpointer user_data,
268 const gchar *element_name,
269 const gchar **attribute_names,
270 const gchar **attribute_values)
272 int i;
273 DllInfo *info = user_data;
275 if (strcmp (element_name, "dllmap") == 0) {
276 g_free (info->dll);
277 g_free (info->target);
278 info->dll = info->target = NULL;
279 info->ignore = FALSE;
280 for (i = 0; attribute_names [i]; ++i) {
281 if (strcmp (attribute_names [i], "dll") == 0)
282 info->dll = g_strdup (attribute_values [i]);
283 else if (strcmp (attribute_names [i], "target") == 0)
284 info->target = g_strdup (attribute_values [i]);
285 else if (strcmp (attribute_names [i], "os") == 0 && !arch_matches (CONFIG_OS, attribute_values [i]))
286 info->ignore = TRUE;
287 else if (strcmp (attribute_names [i], "cpu") == 0 && !arch_matches (CONFIG_CPU, attribute_values [i]))
288 info->ignore = TRUE;
289 else if (strcmp (attribute_names [i], "wordsize") == 0 && !arch_matches (CONFIG_WORDSIZE, attribute_values [i]))
290 info->ignore = TRUE;
292 if (!info->ignore)
293 mono_dllmap_insert (info->assembly, info->dll, NULL, info->target, NULL);
294 } else if (strcmp (element_name, "dllentry") == 0) {
295 const char *name = NULL, *target = NULL, *dll = NULL;
296 int ignore = FALSE;
297 for (i = 0; attribute_names [i]; ++i) {
298 if (strcmp (attribute_names [i], "dll") == 0)
299 dll = attribute_values [i];
300 else if (strcmp (attribute_names [i], "target") == 0)
301 target = attribute_values [i];
302 else if (strcmp (attribute_names [i], "name") == 0)
303 name = attribute_values [i];
304 else if (strcmp (attribute_names [i], "os") == 0 && !arch_matches (CONFIG_OS, attribute_values [i]))
305 ignore = TRUE;
306 else if (strcmp (attribute_names [i], "cpu") == 0 && !arch_matches (CONFIG_CPU, attribute_values [i]))
307 ignore = TRUE;
308 else if (strcmp (attribute_names [i], "wordsize") == 0 && !arch_matches (CONFIG_WORDSIZE, attribute_values [i]))
309 ignore = TRUE;
311 if (!dll)
312 dll = info->dll;
313 if (!info->ignore && !ignore)
314 mono_dllmap_insert (info->assembly, info->dll, name, dll, target);
318 static void
319 dllmap_finish (gpointer user_data)
321 DllInfo *info = user_data;
323 g_free (info->dll);
324 g_free (info->target);
325 g_free (info);
328 static const MonoParseHandler
329 dllmap_handler = {
330 "dllmap",
331 dllmap_init,
332 dllmap_start,
333 NULL, /* text */
334 NULL, /* end */
335 dllmap_finish
338 static void
339 legacyUEP_start (gpointer user_data,
340 const gchar *element_name,
341 const gchar **attribute_names,
342 const gchar **attribute_values) {
343 if ((strcmp (element_name, "legacyUnhandledExceptionPolicy") == 0) &&
344 (attribute_names [0] != NULL) &&
345 (strcmp (attribute_names [0], "enabled") == 0)) {
346 if ((strcmp (attribute_values [0], "1") == 0) ||
347 (g_ascii_strcasecmp (attribute_values [0], "true") == 0)) {
348 mono_runtime_unhandled_exception_policy_set (MONO_UNHANDLED_POLICY_LEGACY);
353 static const MonoParseHandler
354 legacyUEP_handler = {
355 "legacyUnhandledExceptionPolicy",
356 NULL, /* init */
357 legacyUEP_start,
358 NULL, /* text */
359 NULL, /* end */
360 NULL, /* finish */
363 static int inited = 0;
365 static void
366 mono_config_init (void)
368 inited = 1;
369 config_handlers = g_hash_table_new (g_str_hash, g_str_equal);
370 g_hash_table_insert (config_handlers, (gpointer) dllmap_handler.element_name, (gpointer) &dllmap_handler);
371 g_hash_table_insert (config_handlers, (gpointer) legacyUEP_handler.element_name, (gpointer) &legacyUEP_handler);
374 void
375 mono_config_cleanup (void)
377 if (config_handlers)
378 g_hash_table_destroy (config_handlers);
379 g_free (mono_cfg_dir_allocated);
382 /* FIXME: error handling */
384 static void
385 mono_config_parse_xml_with_context (ParseState *state, const char *text, gsize len)
387 GMarkupParseContext *context;
389 if (!inited)
390 mono_config_init ();
392 context = g_markup_parse_context_new (&mono_parser, 0, state, NULL);
393 if (g_markup_parse_context_parse (context, text, len, NULL)) {
394 g_markup_parse_context_end_parse (context, NULL);
396 g_markup_parse_context_free (context);
399 /* If assembly is NULL, parse in the global context */
400 static int
401 mono_config_parse_file_with_context (ParseState *state, const char *filename)
403 gchar *text;
404 gsize len;
405 gint offset;
407 mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_CONFIG,
408 "Config attempting to parse: '%s'.", filename);
410 if (!g_file_get_contents (filename, &text, &len, NULL))
411 return 0;
414 offset = 0;
415 if (len > 3 && text [0] == '\xef' && text [1] == (gchar) '\xbb' && text [2] == '\xbf')
416 offset = 3; /* Skip UTF-8 BOM */
417 if (state->user_data == NULL)
418 state->user_data = (gpointer) filename;
419 mono_config_parse_xml_with_context (state, text + offset, len - offset);
420 g_free (text);
421 return 1;
425 * mono_config_parse_memory:
426 * @buffer: a pointer to an string XML representation of the configuration
428 * Parses the configuration from a buffer
430 void
431 mono_config_parse_memory (const char *buffer)
433 ParseState state = {NULL};
435 state.user_data = (gpointer) "<buffer>";
436 mono_config_parse_xml_with_context (&state, buffer, strlen (buffer));
439 static void
440 mono_config_parse_file (const char *filename)
442 ParseState state = {NULL};
443 state.user_data = (gpointer) filename;
444 mono_config_parse_file_with_context (&state, filename);
448 * use the equivalent lookup code from the GAC when available.
449 * Depending on state, this should give something like:
450 * aname/version-pubtoken/
451 * aname/version/
452 * aname
454 static char*
455 get_assembly_filename (MonoImage *image, int state)
457 switch (state) {
458 case 0:
459 return g_strdup (mono_image_get_name (image));
460 default:
461 return NULL;
465 typedef struct _BundledConfig BundledConfig;
467 struct _BundledConfig {
468 BundledConfig *next;
469 const char* aname;
470 const char* config_xml;
473 static BundledConfig *bundled_configs = NULL;
475 static const char *bundled_machine_config = NULL;
477 void
478 mono_register_config_for_assembly (const char* assembly_name, const char* config_xml)
480 BundledConfig *bconfig;
482 bconfig = g_new0 (BundledConfig, 1);
483 bconfig->aname = assembly_name;
484 bconfig->config_xml = config_xml;
485 bconfig->next = bundled_configs;
486 bundled_configs = bconfig;
489 const char *
490 mono_config_string_for_assembly_file (const char *filename)
492 BundledConfig *bconfig;
494 for (bconfig = bundled_configs; bconfig; bconfig = bconfig->next) {
495 if (bconfig->aname && strcmp (bconfig->aname, filename) == 0)
496 return bconfig->config_xml;
498 return NULL;
501 void
502 mono_config_for_assembly (MonoImage *assembly)
504 ParseState state = {NULL};
505 int got_it = 0, i;
506 char *aname, *cfg, *cfg_name;
507 const char *bundled_config;
508 const char *home;
510 state.assembly = assembly;
512 bundled_config = mono_config_string_for_assembly_file (assembly->module_name);
513 if (bundled_config) {
514 state.user_data = (gpointer) "<bundled>";
515 mono_config_parse_xml_with_context (&state, bundled_config, strlen (bundled_config));
518 cfg_name = g_strdup_printf ("%s.config", mono_image_get_filename (assembly));
519 mono_config_parse_file_with_context (&state, cfg_name);
520 g_free (cfg_name);
522 cfg_name = g_strdup_printf ("%s.config", mono_image_get_name (assembly));
524 home = g_get_home_dir ();
526 for (i = 0; (aname = get_assembly_filename (assembly, i)) != NULL; ++i) {
527 cfg = g_build_filename (mono_get_config_dir (), "mono", "assemblies", aname, cfg_name, NULL);
528 got_it += mono_config_parse_file_with_context (&state, cfg);
529 g_free (cfg);
531 #ifdef TARGET_WIN32
532 cfg = g_build_filename (home, ".mono", "assemblies", aname, cfg_name, NULL);
533 got_it += mono_config_parse_file_with_context (&state, cfg);
534 g_free (cfg);
535 #endif
536 g_free (aname);
537 if (got_it)
538 break;
540 g_free (cfg_name);
544 * mono_config_parse:
545 * @filename: the filename to load the configuration variables from.
547 * Pass a NULL filename to parse the default config files
548 * (or the file in the MONO_CONFIG env var).
550 void
551 mono_config_parse (const char *filename) {
552 const char *home;
553 char *mono_cfg;
554 #ifndef TARGET_WIN32
555 char *user_cfg;
556 #endif
558 if (filename) {
559 mono_config_parse_file (filename);
560 return;
563 home = g_getenv ("MONO_CONFIG");
564 if (home) {
565 mono_config_parse_file (home);
566 return;
569 mono_cfg = g_build_filename (mono_get_config_dir (), "mono", "config", NULL);
570 mono_config_parse_file (mono_cfg);
571 g_free (mono_cfg);
573 #ifndef TARGET_WIN32
574 home = g_get_home_dir ();
575 user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL);
576 mono_config_parse_file (user_cfg);
577 g_free (user_cfg);
578 #endif
581 /* Invoked during startup */
582 void
583 mono_set_config_dir (const char *dir)
585 /* If this variable is set, overrides the directory computed */
586 mono_cfg_dir = g_getenv ("MONO_CFG_DIR");
587 if (mono_cfg_dir == NULL)
588 mono_cfg_dir = mono_cfg_dir_allocated = g_strdup (dir);
591 const char*
592 mono_get_config_dir (void)
594 if (mono_cfg_dir == NULL)
595 mono_set_dirs (NULL, NULL);
597 return mono_cfg_dir;
600 void
601 mono_register_machine_config (const char *config_xml)
603 bundled_machine_config = config_xml;
606 const char *
607 mono_get_machine_config (void)
609 return bundled_machine_config;
612 static void
613 assembly_binding_end (gpointer user_data, const char *element_name)
615 ParserUserData *pud = user_data;
617 if (!strcmp (element_name, "dependentAssembly")) {
618 if (pud->info_parsed && pud->info) {
619 pud->info_parsed (pud->info, pud->user_data);
620 g_free (pud->info->name);
621 g_free (pud->info->culture);
626 static void
627 publisher_policy_start (gpointer user_data,
628 const gchar *element_name,
629 const gchar **attribute_names,
630 const gchar **attribute_values)
632 ParserUserData *pud;
633 MonoAssemblyBindingInfo *info;
634 int n;
636 pud = user_data;
637 info = pud->info;
638 if (!strcmp (element_name, "dependentAssembly")) {
639 info->name = NULL;
640 info->culture = NULL;
641 info->has_old_version_bottom = FALSE;
642 info->has_old_version_top = FALSE;
643 info->has_new_version = FALSE;
644 info->is_valid = FALSE;
645 memset (&info->old_version_bottom, 0, sizeof (info->old_version_bottom));
646 memset (&info->old_version_top, 0, sizeof (info->old_version_top));
647 memset (&info->new_version, 0, sizeof (info->new_version));
648 } if (!strcmp (element_name, "assemblyIdentity")) {
649 for (n = 0; attribute_names [n]; n++) {
650 const gchar *attribute_name = attribute_names [n];
652 if (!strcmp (attribute_name, "name"))
653 info->name = g_strdup (attribute_values [n]);
654 else if (!strcmp (attribute_name, "publicKeyToken")) {
655 if (strlen (attribute_values [n]) == MONO_PUBLIC_KEY_TOKEN_LENGTH - 1)
656 g_strlcpy ((char *) info->public_key_token, attribute_values [n], MONO_PUBLIC_KEY_TOKEN_LENGTH);
657 } else if (!strcmp (attribute_name, "culture")) {
658 if (!strcmp (attribute_values [n], "neutral"))
659 info->culture = g_strdup ("");
660 else
661 info->culture = g_strdup (attribute_values [n]);
664 } else if (!strcmp (element_name, "bindingRedirect")) {
665 for (n = 0; attribute_names [n]; n++) {
666 const gchar *attribute_name = attribute_names [n];
668 if (!strcmp (attribute_name, "oldVersion")) {
669 gchar **numbers, **version, **versions;
670 gint major, minor, build, revision;
672 /* Invalid value */
673 if (!strcmp (attribute_values [n], ""))
674 return;
676 versions = g_strsplit (attribute_values [n], "-", 2);
677 version = g_strsplit (*versions, ".", 4);
679 /* We assign the values to gint vars to do the checks */
680 numbers = version;
681 major = *numbers ? atoi (*numbers++) : -1;
682 minor = *numbers ? atoi (*numbers++) : -1;
683 build = *numbers ? atoi (*numbers++) : -1;
684 revision = *numbers ? atoi (*numbers) : -1;
685 g_strfreev (version);
686 if (major < 0 || minor < 0 || build < 0 || revision < 0) {
687 g_strfreev (versions);
688 return;
691 info->old_version_bottom.major = major;
692 info->old_version_bottom.minor = minor;
693 info->old_version_bottom.build = build;
694 info->old_version_bottom.revision = revision;
695 info->has_old_version_bottom = TRUE;
697 if (!*(versions + 1)) {
698 g_strfreev (versions);
699 continue;
702 numbers = version = g_strsplit (*(versions + 1), ".", 4);
703 major = *numbers ? atoi (*numbers++) : -1;
704 minor = *numbers ? atoi (*numbers++) : -1;
705 build = *numbers ? atoi (*numbers++) : -1;
706 revision = *numbers ? atoi (*numbers) : 1;
707 g_strfreev (version);
708 if (major < 0 || minor < 0 || build < 0 || revision < 0) {
709 g_strfreev (versions);
710 return;
713 info->old_version_top.major = major;
714 info->old_version_top.minor = minor;
715 info->old_version_top.build = build;
716 info->old_version_top.revision = revision;
717 info->has_old_version_top = TRUE;
719 g_strfreev (versions);
720 } else if (!strcmp (attribute_name, "newVersion")) {
721 gchar **numbers, **version;
723 /* Invalid value */
724 if (!strcmp (attribute_values [n], ""))
725 return;
727 numbers = version = g_strsplit (attribute_values [n], ".", 4);
728 info->new_version.major = *numbers ? atoi (*numbers++) : -1;
729 info->new_version.minor = *numbers ? atoi (*numbers++) : -1;
730 info->new_version.build = *numbers ? atoi (*numbers++) : -1;
731 info->new_version.revision = *numbers ? atoi (*numbers) : -1;
732 info->has_new_version = TRUE;
733 g_strfreev (version);
739 static MonoParseHandler
740 publisher_policy_parser = {
741 "", /* We don't need to use declare an xml element */
742 NULL,
743 publisher_policy_start,
744 NULL,
745 NULL,
746 NULL
749 void
750 mono_config_parse_publisher_policy (const gchar *filename, MonoAssemblyBindingInfo *info)
752 ParserUserData user_data = {
753 info,
754 NULL,
755 NULL
757 ParseState state = {
758 &publisher_policy_parser, /* MonoParseHandler */
759 &user_data, /* user_data */
760 NULL, /* MonoImage (we don't need it right now)*/
761 TRUE /* We are already inited */
764 mono_config_parse_file_with_context (&state, filename);
767 static MonoParseHandler
768 config_assemblybinding_parser = {
769 "", /* We don't need to use declare an xml element */
770 NULL,
771 publisher_policy_start,
772 NULL,
773 assembly_binding_end,
774 NULL
777 void
778 mono_config_parse_assembly_bindings (const char *filename, int amajor, int aminor, void *user_data, void (*infocb)(MonoAssemblyBindingInfo *info, void *user_data))
780 MonoAssemblyBindingInfo info;
781 ParserUserData pud;
782 ParseState state;
784 info.major = amajor;
785 info.minor = aminor;
787 pud.info = &info;
788 pud.info_parsed = infocb;
789 pud.user_data = user_data;
791 state.current = &config_assemblybinding_parser; /* MonoParseHandler */
792 state.user_data = &pud;
793 state.assembly = NULL; /* MonoImage (we don't need it right now)*/
794 state.inited = TRUE; /* We are already inited */
796 mono_config_parse_file_with_context (&state, filename);