[xbuild] Add new reserved properties $(MSBuildThisFile*).
[mono.git] / mono / metadata / monosn.c
index 7ac5bfcbecc4106c5ce0bd75333782348a937bab..c9114c4744a45d4947cefa9b2f7393611e4d5df5 100644 (file)
@@ -4,7 +4,8 @@
  * Author:
  *   Paolo Molaro (lupus@ximian.com)
  *
- * (C) 2002 Ximian, Inc.
+ * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
+ * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  *
  */
 #include <mono/metadata/class.h>
@@ -68,6 +69,12 @@ show_token (const char *file, int is_assembly, int show_pubkey) {
                MonoImage *image;
                const char *pubkey;
                guint32 len;
+
+               mono_metadata_init ();
+        mono_images_init ();
+        mono_assemblies_init ();
+        mono_loader_init ();
+
                image = mono_image_open (file, NULL);
                if (!image) {
                        printf ("Cannot open image file: %s\n", file);
@@ -75,7 +82,7 @@ show_token (const char *file, int is_assembly, int show_pubkey) {
                }
                pubkey = mono_image_get_public_key (image, &len);
                if (!pubkey) {
-                       printf ("%s does not represent a strongly named assembly\n", image->name);
+                       printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
                        mono_image_close (image);
                        return 2;
                }
@@ -108,7 +115,7 @@ extract_data_to_file (int pubk, const char *assembly, const char *outfile) {
        else
                pubkey = mono_image_get_strong_name (image, &len);
        if (!pubkey) {
-               printf ("%s does not represent a strongly named assembly\n", image->name);
+               printf ("%s does not represent a strongly named assembly\n", mono_image_get_name(image));
                mono_image_close (image);
                return 2;
        }
@@ -408,7 +415,7 @@ convert_format (const char *from, const char *outfile) {
        int binlen, ret, lenout;
        FILE *file;
        
-       if (!g_file_get_contents (from, &key, &len, NULL)) {
+       if (!g_file_get_contents (from, (gchar**) &key, &len, NULL)) {
                printf ("Cannot load file: %s\n", from);
                return 2;
        }
@@ -461,7 +468,7 @@ get_digest (const char *from, const char *outfile)
                snsize = 0;
        }
        
-       if (!g_file_get_contents (from, &ass, &len, NULL)) {
+       if (!g_file_get_contents (from, (gchar**) &ass, &len, NULL)) {
                printf ("Cannot load file: %s\n", from);
                mono_image_close (image);
                return 2;