Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)
[binutils-gdb.git] / gdb / language.c
index 5a6c689f21975985c008b6c86692fafa9ca91d9f..9d55936e6091122d0cbef9076d523ac8832826e3 100644 (file)
@@ -1022,6 +1022,22 @@ range_error (va_alist)
 \f
 /* This page contains miscellaneous functions */
 
+/* Return the language struct for a given language enum. */
+
+const struct language_defn *
+language_def(lang)
+   enum language lang;
+{
+  int i;
+
+  for (i = 0; i < languages_size; i++) {
+    if (languages[i]->la_language == lang) {
+      return languages[i];
+    }
+  }
+  return NULL;
+}
+
 /* Return the language as a string */
 char *
 language_str(lang)
@@ -1116,8 +1132,44 @@ unk_lang_printstr (stream, string, length, force_ellipses)
   error ("internal error - unimplemented function unk_lang_printstr called.");
 }
 
+static struct type *
+unk_lang_create_fundamental_type (objfile, typeid)
+     struct objfile *objfile;
+     int typeid;
+{
+  error ("internal error - unimplemented function unk_lang_create_fundamental_type called.");
+}
+
+void
+unk_lang_print_type (type, varstring, stream, show, level)
+     struct type *type;
+     char *varstring;
+     FILE *stream;
+     int show;
+     int level;
+{
+  error ("internal error - unimplemented function unk_lang_print_type called.");
+}
+
+int
+unk_lang_val_print (type, valaddr, address, stream, format, deref_ref,
+                   recurse, pretty)
+     struct type *type;
+     char *valaddr;
+     CORE_ADDR address;
+     FILE *stream;
+     int format;
+     int deref_ref;
+     int recurse;
+     enum val_prettyprint pretty;
+{
+  error ("internal error - unimplemented function unk_lang_val_print called.");
+}
+
 static struct type ** const (unknown_builtin_types[]) = { 0 };
-static const struct op_print unk_op_print_tab[] = { 0 };
+static const struct op_print unk_op_print_tab[] = {
+    {NULL, 0, 0, 0}
+};
 
 const struct language_defn unknown_language_defn = {
   "unknown",
@@ -1129,6 +1181,9 @@ const struct language_defn unknown_language_defn = {
   unk_lang_error,
   unk_lang_printchar,          /* Print character constant */
   unk_lang_printstr,
+  unk_lang_create_fundamental_type,
+  unk_lang_print_type,         /* Print a type using appropriate syntax */
+  unk_lang_val_print,          /* Print a value using appropriate syntax */
   &builtin_type_error,         /* longest signed   integral type */
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */
@@ -1151,6 +1206,9 @@ const struct language_defn auto_language_defn = {
   unk_lang_error,
   unk_lang_printchar,          /* Print character constant */
   unk_lang_printstr,
+  unk_lang_create_fundamental_type,
+  unk_lang_print_type,         /* Print a type using appropriate syntax */
+  unk_lang_val_print,          /* Print a value using appropriate syntax */
   &builtin_type_error,         /* longest signed   integral type */
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */
@@ -1172,6 +1230,9 @@ const struct language_defn local_language_defn = {
   unk_lang_error,
   unk_lang_printchar,          /* Print character constant */
   unk_lang_printstr,
+  unk_lang_create_fundamental_type,
+  unk_lang_print_type,         /* Print a type using appropriate syntax */
+  unk_lang_val_print,          /* Print a value using appropriate syntax */
   &builtin_type_error,         /* longest signed   integral type */
   &builtin_type_error,         /* longest unsigned integral type */
   &builtin_type_error,         /* longest floating point type */