=== added file '.gdbinit' --- .gdbinit 1970-01-01 00:00:00 +0000 +++ .gdbinit 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +define pst + call ps(st) +end === modified file 'EXTENDING.html' --- EXTENDING.html 2007-09-08 09:16:38 +0000 +++ EXTENDING.html 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ - + Exuberant Ctags: Adding support for a new language === added directory 'Eiffel' === added file 'Eiffel/Ace.ace' --- Eiffel/Ace.ace 1970-01-01 00:00:00 +0000 +++ Eiffel/Ace.ace 2011-03-11 21:16:06 +0000 @@ -0,0 +1,40 @@ +-- $Id$ + +system + readtags + +root + TAG_FILE_READER (root_cluster): "make" + +default + assertion (all) + multithreaded (no) + console_application (yes) + dynamic_runtime (yes) + dead_code_removal (yes) + profile (no) + line_generation (yes) + debug (yes) + array_optimization (yes) + inlining (yes) + inlining_size ("4") + + precompiled ("$ISE_EIFFEL/precomp/spec/$ISE_PLATFORM/base") + +cluster + + root_cluster: "." + + -- EiffelBase + all base: "$ISE_EIFFEL/library/base" + exclude + "desc";"table_eiffel3" + end + +external + + include_path: "../../../.." + + object: "../../../readtags.o" + +end === added file 'Eiffel/external_addressing.e' --- Eiffel/external_addressing.e 1970-01-01 00:00:00 +0000 +++ Eiffel/external_addressing.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,45 @@ +indexing + + description: "Compiler-dependent external addressing of objects" + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class EXTERNAL_ADDRESSING + +feature -- Access + + string_from_c (p: POINTER): STRING is + -- A new string created from an external C string + do + if (p /= default_pointer) then + create Result.make (0) + Result.from_c (p) + end + end + + string_to_c (str: STRING): POINTER is + -- The address of the first character of the string, or + -- default_pointer if `str' is void. This in an inherently + -- dangerous function, since the object referred to by the pointer + -- could be moved by the garbage collector before the pointer is + -- used. Caveat emptor! + local + a: ANY + do + if str = Void then + a := ("").to_c + else + a := str.to_c + end + Result := c_address ($a) + end + + c_address (p: POINTER): POINTER is + -- The address passed in + do + Result := p + end + +end === added file 'Eiffel/tag_entry.e' --- Eiffel/tag_entry.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_entry.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,187 @@ +indexing + + description: "Describes a single entry in a tag file." + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_ENTRY + +inherit + + ANY + redefine + out + end + +creation + + make_from_c + +feature -- Initialization + + make_from_c (buffer: STRING) is + -- Create from buffer containing C tagEntry structure + require + buffer_exists: buffer /= Void + local + p: POINTER + do + p := addressing.string_to_c (buffer) + + name := addressing.string_from_c (c_name (p)) + file := addressing.string_from_c (c_file (p)) + pattern := addressing.string_from_c (c_pattern (p)) + line_number := c_line_number (p) + kind := addressing.string_from_c (c_kind (p)) + file_scoped := c_file_scope (p) + + if c_field_count (p) > 0 then + create extension_fields.make_from_c (buffer) + end + end + +feature -- Access + + name: STRING + -- Name of tag + + file: STRING + -- Path of source file containing definition of tag + + pattern: STRING + -- Pattern for locating source line (may be void) + + line_number: INTEGER + -- Line number in source file of tag definition + -- (may be zero if not known) + + kind: STRING + -- Kind of tag (may by name, character, or void if not known) + + file_scoped: BOOLEAN + -- Is tag of file-limited scope? + + extension_fields: TAG_EXTENSION_FIELDS + -- Extension fields (may be void if not available) + +feature -- Output + + out: STRING is + -- Printable representation of tag entry + do + create Result.make (name.count + 1 + file.count + 1 + pattern.count + 40) + Result.append (name) + Result.extend (Tab) + Result.append (file) + Result.extend (Tab) + if pattern /= Void then + Result.append (pattern) + else + Result.append_integer (line_number) + end + end + + out_full: STRING is + -- Printable representation of tag entry with extension fields + local + sep: STRING + do + sep := ";%"" + Result := out + Result.copy (out) + if kind /= Void then + Result.append (sep); sep := Empty_string + Result.extend (Tab) + Result.append (Kind_key) + Result.extend (Colon) + Result.append (kind) + end + if file_scoped then + Result.append (sep); sep := Empty_string + Result.extend (Tab) + Result.append (File_scope_key) + Result.extend (Colon) + end + if extension_fields /= Void then + Result.append (sep); sep := Empty_string + Result.append (extension_fields.out) + end + end + +feature {NONE} -- Implementation + + Kind_key: STRING is "kind" + -- Key used for "kind" of tag + + File_scope_key: STRING is "file" + -- Key used for file scoping of tag + + Colon: CHARACTER is ':' + -- Key-value separator + + Tab: CHARACTER is '%T' + -- Field separator + + Empty_string: STRING is "" + -- Empty string + + addressing: EXTERNAL_ADDRESSING is + -- Access to external addressing features + once + create Result + end + +feature {NONE} -- Externals + + c_name (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagEntry): const char*" + alias + "name" + end + + c_file (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagEntry): const char*" + alias + "file" + end + + c_pattern (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagEntry): const char*" + alias + "address.pattern" + end + + c_line_number (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagEntry): unsigned long" + alias + "address.lineNumber" + end + + c_kind (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagEntry): const char*" + alias + "kind" + end + + c_file_scope (p: POINTER): BOOLEAN is + external + "C [struct %"readtags.h%"] (tagEntry): short" + alias + "fileScope" + end + + c_field_count (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagEntry): unsigned short" + alias + "fields.count" + end + +end === added file 'Eiffel/tag_extension_fields.e' --- Eiffel/tag_extension_fields.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_extension_fields.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,154 @@ +indexing + + description: "Variable extension fields for tag file entry." + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_EXTENSION_FIELDS + +inherit + + ARRAY [TUPLE [STRING, STRING]] + rename + item as array_item + export + {NONE} all + redefine + out + end + +creation + + make_from_c + +feature -- Initialization + + make_from_c (buffer: STRING) is + -- Create from buffer containing C tagEntry structure + require + buffer_exists: buffer /= Void + local + i: INTEGER + field_count: INTEGER + p, list: POINTER + key: STRING + value: STRING + do + from + field_count := c_field_count (addressing.string_to_c (buffer)) + make (1, field_count) + list := c_extension_fields (addressing.string_to_c (buffer)) + i := 0 + until + i >= field_count + loop + p := list + (i * tag_extension_field_size) + key := addressing.string_from_c (c_key (p)) + value := addressing.string_from_c (c_value (p)) + put ([value, key], i + 1) + i := i + 1 + end + end + +feature -- Access + + item (key: STRING): STRING is + -- Value associated with `key' + require + non_void_key: key /= Void + local + i: INTEGER + key_for_iteration: STRING + do + from + i := lower + until + i > upper or Result /= Void + loop + key_for_iteration ?= array_item (i).item (2) + check not_void: key_for_iteration /= Void end + if key.is_equal (key_for_iteration) then + Result ?= array_item (i).item (1) + end + end + end + +feature -- Output + + out: STRING is + -- Printable representation + local + key, value: STRING + i: INTEGER + do + create Result.make (30) + from + i := lower + until + i > upper + loop + Result.extend (Tab) + key ?= array_item (i).item (2) + check key_exists: key /= Void end + Result.append (key) + Result.extend (Colon) + value ?= array_item (i).item (1) + if value /= Void then + Result.append (value) + end + i := i + 1 + end + end + +feature {NONE} -- Implementation + + Colon: CHARACTER is ':' + + Tab: CHARACTER is '%T' + + addressing: EXTERNAL_ADDRESSING is + -- Access to external addressing features + once + create Result + end + +feature {NONE} -- Externals + + tag_extension_field_size: INTEGER is + external + "C [macro %"readtags.h%"] (): long" + alias + "sizeof (tagExtensionField)" + end + + c_field_count (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagEntry): unsigned short" + alias + "fields.count" + end + + c_extension_fields (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagEntry): tagExtensionField" + alias + "fields.list" + end + + c_key (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagExtensionField): const char*" + alias + "key" + end + + c_value (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagExtensionField): const char*" + alias + "value" + end + +end === added file 'Eiffel/tag_file.e' --- Eiffel/tag_file.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_file.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,481 @@ +indexing + + description: "Abstraction of file containing tag records" + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_FILE + +inherit + + TAG_FILE_FORMATS + TAG_FILE_SORT_TYPES + EXTERNAL_ADDRESSING + export + {NONE} all + end + +creation + + make + +feature -- Initialization + + make (nm: STRING) is + -- Create from name of existing tag file + require + name_not_empty: nm /= Void and then not nm.is_empty + do + format := Format_extended + sort_type := Sort_case_sensitive + create tag_file_info_struct.make_filled ('%U', tag_file_info_size) + create tag_entry_struct.make_filled ('%U', tag_entry_size) + handle := c_tags_open ( + string_to_c (nm), string_to_c (tag_file_info_struct)) + open := handle /= default_pointer + if open then + path := nm + format := c_file_format (string_to_c (tag_file_info_struct)) + sort_type := c_file_sort (string_to_c (tag_file_info_struct)) + program_author := string_from_c ( + c_program_author (string_to_c (tag_file_info_struct))) + program_name := string_from_c ( + c_program_name (string_to_c (tag_file_info_struct))) + program_url := string_from_c ( + c_program_url (string_to_c (tag_file_info_struct))) + program_version := string_from_c ( + c_program_version (string_to_c (tag_file_info_struct))) + else + error_number := c_file_error_number ( + string_to_c (tag_file_info_struct)) + error_description := string_from_c (c_strerror (error_number)) + end + ensure + opened: open or else (error_number > 0 and error_description /= Void) + end + +feature -- Access + + path: STRING + -- Path of tag file + + program_author: STRING + -- Name of author of generating program (may be null) + + program_name: STRING + -- Name of program (may be void) + + program_url: STRING + -- URL of distribution (may be void) + + program_version: STRING + -- Program version (may be void) + + item: TAG_ENTRY + -- Current tag + +feature -- Status report + + open: BOOLEAN + -- Is the tag file open? If this is false, then the system "errno" + -- variable may be examined to determine the cause. + + error_number: INTEGER + -- Value of errno of O/S when creation of `Current' fails + + error_description: STRING + -- Value of strerror(errno) of O/S when creation of `Current' fails + + off: BOOLEAN + -- Is there another tag after this one? + + format: INTEGER + -- Format of tag file + + sort_type: INTEGER + -- Type of sorting used on file. + + partial_matching: BOOLEAN + -- Should searches find tags whose whose leading characters match + -- the supplied string? + + ignoring_case: BOOLEAN + -- Should searches match without regard to case? + +feature -- Status setting + + set_sort_type (type: INTEGER) is + -- Force sort type of file (in case automatic detection does not + -- work). + require + open: open + valid_sort_type: valid_sort_type (type) + local + return_code: INTEGER + do + return_code := c_tags_set_sort_type (handle, type) + check no_error: return_code = Tag_success end + sort_type := type + ensure + sort_type_overridden: sort_type = type + end + + ignore_case is + -- Disable recognition of case for searches + require + open: open + do + ignoring_case := True + ensure + searches_ignore_case: ignoring_case + end + + observe_case is + -- Enable recognition of case for searches + require + open: open + do + ignoring_case := False + ensure + searches_observe_case: not ignoring_case + end + + match_partial is + -- Enable partial matching for searches + require + open: open + do + partial_matching := True + ensure + searches_match_partial: partial_matching + end + + match_full is + -- Enable full matching for searches + require + open: open + do + partial_matching := False + ensure + searches_match_full: not partial_matching + end + + start is + -- Move to first tag in file + require + exists: open + do + read_tag (c_tags_first (handle, string_to_c (tag_entry_struct))) + ensure + item_found: not off implies item /= Void + end + + forth is + -- Advance to next tag in file + require + exists: open + another_available: not off + do + read_tag (c_tags_next (handle, string_to_c (tag_entry_struct))) + ensure + item_found: not off implies item /= Void + end + + search (name: STRING) is + -- Search from beginning of file for tag matching `name'. + -- Search affected by values of `partial_matching' and + -- `ignoring_case'. + require + open: open + name_supplied: name /= Void and then not name.is_empty + do + search_name := clone (name) + read_tag (c_tags_find (handle, string_to_c (tag_entry_struct), + string_to_c (name), search_options)) + ensure + match: + not off implies (item /= Void and then not item.name.is_empty) + non_partial_match: + (not off and not partial_matching) + implies item.name.count = name.count + partial_match: + (not off and partial_matching) + implies item.name.count >= name.count + case_match: + (not off and not ignoring_case) implies + name.is_equal (item.name.substring (1, name.count)) + case_ignore_match: + (not off and not ignoring_case) implies + name.as_upper.is_equal ( + item.name.substring (1, name.count).as_upper) + end + + continue_search is + -- Continue search initiated with `search' using same parameters + -- and options. + require + open: open + not off + do + read_tag (c_tags_find_next (handle, string_to_c (tag_entry_struct))) + ensure + match: + not off implies (item /= Void and then not item.name.is_empty) + non_partial_match: + (not off and not partial_matching) + implies item.name.count = search_name.count + partial_match: + (not off and partial_matching) + implies item.name.count >= search_name.count + case_match: + (not off and not ignoring_case) implies + search_name.is_equal ( + item.name.substring (1, search_name.count)) + case_ignore_match: + (not off and not ignoring_case) implies + search_name.as_upper.is_equal ( + item.name.substring (1, search_name.count).as_upper) + end + + close is + -- Close tag file + require + open: open + local + return_code: INTEGER + do + return_code := c_tags_close (handle) + check no_failure: return_code = Tag_success end + handle := default_pointer + ensure + handle_reset: handle = default_pointer + end + +feature {NONE} -- Implementation + + handle: POINTER + -- Handle to tag file + + tag_file_info_struct: STRING + -- Buffer for tagFileInfo C structure + + tag_entry_struct: STRING + -- Buffer for tagEntry C structure + + search_name: STRING + -- Name used in `search' + + search_options: INTEGER is + -- Bit representation of search options + do + if partial_matching then + Result := Tag_partial_match + end + if ignoring_case then + Result := Result + Tag_ignore_case + end + end + + read_tag (return_code: INTEGER) is + do + if return_code = Tag_success then + create item.make_from_c (tag_entry_struct) + off := False + else + off := True + item := Void + end + end + +feature {NONE} -- Externals + + c_strerror (errnum: INTEGER): POINTER is + external + "C (int): char* | " + alias + "strerror" + end + + tag_file_info_size: INTEGER is + external + "C [macro %"readtags.h%"] (): long" + alias + "sizeof (tagFileInfo)" + end + + tag_entry_size: INTEGER is + external + "C [macro %"readtags.h%"] (): long" + alias + "sizeof (tagEntry)" + end + + Tag_success: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TagSuccess" + end + + Tag_failure: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TagFailure" + end + + Tag_unsorted: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TAG_UNSORTED" + end + + Tag_sorted: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TAG_SORTED" + end + + Tag_fold_sorted: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TAG_FOLDSORTED" + end + + Tag_partial_match: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TAG_PARTIALMATCH" + end + + Tag_ignore_case: INTEGER is + external + "C [macro %"readtags.h%"] (): int" + alias + "TAG_IGNORECASE" + end + + c_tags_open (file_path, info: POINTER): POINTER is + -- extern tagFile *tagsOpen (const char *filePath, + -- tagFileInfo *info); + external + "C (const char*, tagFileInfo*): tagFile* | %"readtags.h%"" + alias + "tagsOpen" + end + + c_tags_set_sort_type (h: POINTER; type: INTEGER): INTEGER is + -- extern tagResult tagsSetSortType (tagFile *file, sortType type); + external + "C (tagFile*, sortType): tagResult | %"readtags.h%"" + alias + "tagsSetSortType" + end + + c_tags_first (h, entry: POINTER): INTEGER is + external + "C (tagFile*, tagEntry*): tagResult | %"readtags.h%"" + alias + "tagsFirst" + end + + c_tags_next (h, entry: POINTER): INTEGER is + external + "C (tagFile*, tagEntry*): tagResult | %"readtags.h%"" + alias + "tagsNext" + end + + c_tags_find (h, entry, name: POINTER; options: INTEGER): INTEGER is + -- extern tagResult tagsFind (tagFile *file, tagEntry *entry, + -- const char *name, int options); + external + "C (tagFile*, tagEntry*, const char*, int): tagResult | %"readtags.h%"" + alias + "tagsFind" + end + + c_tags_find_next (h, entry: POINTER): INTEGER is + -- extern tagResult tagsFindNext (tagFile *file, tagEntry *entry); + external + "C (tagFile*, tagEntry*): tagResult | %"readtags.h%"" + alias + "tagsFindNext" + end + + c_tags_close (h: POINTER): INTEGER is + -- extern tagResult tagsClose (tagFile *file); + external + "C (tagFile*): tagResult | %"readtags.h%"" + alias + "tagsClose" + end + + c_file_opened (p: POINTER): BOOLEAN is + external + "C [struct %"readtags.h%"] (tagFileInfo): int" + alias + "status.opened" + end + + c_file_error_number (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagFileInfo): int" + alias + "status.error_number" + end + + c_file_format (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagFileInfo): short" + alias + "file.format" + end + + c_file_sort (p: POINTER): INTEGER is + external + "C [struct %"readtags.h%"] (tagFileInfo): short" + alias + "file.sort" + end + + c_program_author (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagFileInfo): const char*" + alias + "program.author" + end + + c_program_name (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagFileInfo): const char*" + alias + "program.name" + end + + c_program_url (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagFileInfo): const char*" + alias + "program.url" + end + + c_program_version (p: POINTER): POINTER is + external + "C [struct %"readtags.h%"] (tagFileInfo): const char*" + alias + "program.version" + end + +invariant + + valid_format: valid_format (format) + valid_sort_type: valid_sort_type (sort_type) + +end === added file 'Eiffel/tag_file_formats.e' --- Eiffel/tag_file_formats.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_file_formats.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,30 @@ +indexing + + description: "Constants describing defined tag file formats." + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_FILE_FORMATS + +feature -- Access + + Format_original: INTEGER is 1 + -- Original tag file format + + Format_extended: INTEGER is 2 + -- Extended tag file format + +feature -- Status report + + valid_format (format: INTEGER): BOOLEAN is + -- Is `format' a valid tag file format? + do + Result := format = Format_original or format = Format_extended + ensure + definition: Result implies + (format = Format_original or format = Format_extended) + end + +end === added file 'Eiffel/tag_file_reader.e' --- Eiffel/tag_file_reader.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_file_reader.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,236 @@ +indexing + + description: "Demo program for TAG_FILE functionality." + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_FILE_READER + +inherit + + TAG_FILE_SORT_TYPES + export + {NONE} all + end + +creation + + make + +feature -- Initialization + + make (args: ARRAY [STRING]) is + -- Root creation + do + set_program_name (args.item (0)) + if args.upper = 0 then + io.error.put_string (usage) + exceptions.die (1) + end + set_default_options + parse_command_line (args) + end + +feature {NONE} -- Implmentation + + program_name: STRING + -- Name by which program is executed + + tag_file_name: STRING + -- Name of tag file + + sort_type: INTEGER + -- Sort file override + + sort_override: BOOLEAN + -- Did the user override the sort method? + + showing_extension_fields: BOOLEAN + -- Did the user request extension fields in output? + + ignoring_case: BOOLEAN + -- Did the user request ignoring of case in searches? + + partial_matching: BOOLEAN + -- Did the user request partial matching? + + file: TAG_FILE + -- Tag file under consideration + + usage: STRING is + require + program_name_assigned: program_name /= Void + once + Result := + "Find tag file entries matching specified names.%N%NUsage: " + Result.append (program_name) + Result.append ( + " [-ilp] [-s[0|1]] [-t file] [name(s)]%N%N% + %Options:%N% + % -e Include extension fields in output.%N% + % -i Perform case-insensitive matching.%N% + % -l List all tags.%N% + % -p Perform partial matching.%N% + % -s[0|1|2] Override sort detection of tag file.%N% + % -t file Use specified tag file (default: %"tags%").%N% + %Note that options are acted upon as encountered, so order is significant.%N") + end + + set_program_name (name: STRING) is + -- Set the program name from path + require + name_supplied: name /= Void + local + slash: INTEGER + do + slash := name.last_index_of ('/', name.count) + if slash = 0 then + slash := name.last_index_of ('\', name.count) + end + program_name := clone (name) + if slash > 0 then + program_name.keep_tail (program_name.count - slash) + end + end + + set_default_options is + -- Set default options + do + tag_file_name := "tags" + end + + parse_command_line (args: ARRAY [STRING]) is + local + i, j: INTEGER + arg: STRING + action_supplied: BOOLEAN + do + from i := 1 until i > args.upper loop + arg := args.item (i) + if arg.item (1) /= '-' then + find_tag (arg) + action_supplied := True + else + from j := 2 until j > arg.count loop + inspect arg.item (j) + when 'e' then showing_extension_fields := True + when 'i' then ignoring_case := True + when 'p' then partial_matching := True + when 'l' then list_tags; action_supplied := True + when 't' then + if j < arg.count then + tag_file_name := arg.substring (j+1, arg.count) + j := arg.count + elseif i < args.upper then + i := i + 1 + tag_file_name := args.item (i) + else + io.error.put_string (usage) + exceptions.die (1) + end + when 's' then + sort_override := True + j := j + 1 + if j > arg.count then + sort_type := Sort_case_sensitive + elseif arg.item (j).is_digit then + sort_type := arg.item (j).code - ('0').code + else + io.error.put_string (usage) + exceptions.die (1) + end + else + report_unknown_option (arg.item (j)) + end + j := j + 1 + end + end + i := i + 1 + end + if not action_supplied then report_no_action end + end + + report_unknown_option (switch: CHARACTER) is + -- Report `switch' as unknown option + do + io.error.put_string (program_name) + io.error.put_string (": unknown option: ") + io.error.put_character (switch) + io.error.put_character ('%N') + exceptions.die (1) + end + + report_no_action is + -- Report `switch' as unknown option + do + io.error.put_string (program_name) + io.error.put_string ( + ": no action specified: specify tag name(s) or -l option%N") + exceptions.die (1) + end + + find_tag (name: STRING) is + -- Find tag matching `name' + do + from + open_tag_file + if ignoring_case then file.ignore_case end + if partial_matching then file.match_partial end + file.search (name) + until + file.off + loop + print_tag (file.item) + file.continue_search + end + file.close + end + + list_tags is + -- List all tags + do + open_tag_file + from file.start until file.off loop + print_tag (file.item) + file.forth + end + file.close + end + + open_tag_file is + -- Open tag file and check for errors + do + create file.make (tag_file_name) + if not file.open then + io.error.put_string (program_name) + io.error.put_string (": cannot open tag file: ") + io.error.put_string (file.error_description) + io.error.put_string (": ") + io.error.put_string (tag_file_name) + io.error.put_character ('%N') + exceptions.die (1) + end + if sort_override then file.set_sort_type (sort_type) end + end + + print_tag (tag: TAG_ENTRY) is + -- Print tag contents to standard output + require + tag_supplied: tag /= Void + do + if showing_extension_fields then + io.put_string (tag.out_full) + else + io.put_string (tag.out) + end + io.put_character ('%N') + end + + exceptions: EXCEPTIONS is + once + create Result + end + +end === added file 'Eiffel/tag_file_sort_types.e' --- Eiffel/tag_file_sort_types.e 1970-01-01 00:00:00 +0000 +++ Eiffel/tag_file_sort_types.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,36 @@ +indexing + + description: "Constants describing defined tag file sort types." + revision: "$Revision$" + date: "$Date$" + copyright: "Copyright 2002 Darren Hiebert and others" + license: "Eiffel Forum License, version 1" + +class TAG_FILE_SORT_TYPES + +feature + + Sort_none: INTEGER is 0 + -- Tag file is not sorted + + Sort_case_sensitive: INTEGER is 1 + -- Tag file is sorted in case-sensitive manner + + Sort_case_insensitive: INTEGER is 2 + -- Tag file is sorted in case-insensitive manner, with lower-case + -- folded onto upper case. + +feature -- Status report + + valid_sort_type (sort: INTEGER): BOOLEAN is + -- Is `sort' a valid tag file sort type? + do + Result := sort = Sort_none or + sort = Sort_case_sensitive or + sort = Sort_case_insensitive + ensure + definition: Result implies (sort = Sort_none or + sort = Sort_case_sensitive or sort = Sort_case_insensitive) + end + +end === modified file 'FAQ' --- FAQ 2004-03-30 11:56:40 +0000 +++ FAQ 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -Frequently Asked Questions +vberthoux@users.sourceforge.netFrequently Asked Questions ========================== * 1. Why do you call it "Exuberant Ctags"? @@ -354,7 +354,7 @@ And replace the configuration of step 3 with this: - :set tags=./tags,./../tags,./../../tags,./../../../tags,tags + :set tags=./tags;$HOME,tags As a caveat, it should be noted that step 2 builds a global tag file whose file names will be relative to the directory in which the global tag file === modified file 'Makefile.in' --- Makefile.in 2009-07-14 15:05:23 +0000 +++ Makefile.in 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: Makefile.in 709 2009-07-04 05:29:28Z dhiebert $ +# $Id$ # # Makefile for UNIX-like platforms. # === modified file 'NEWS' --- NEWS 2009-07-14 15:05:23 +0000 +++ NEWS 2011-03-11 21:16:06 +0000 @@ -1,4 +1,14 @@ -Current Version: 5.8 +Current Version: @VERSION@ + +ctags-@VERSION@ (@DATE@) +* Added support for new "attached" and "detachable" keywords [Eiffel]. +* Fixed parsing of comments after import statements and other tags, contributed by Huandari Lopez to Geany [Python]. +* Fixed PHP parser to ignore keywords inside comments [PHP, Bug #1795926]. +* Fixed regular expressions for Ant so they won't span multiple tags [Ant]. +* Fixed infinite loop with malformed Makefiles, contributed by Martin Dorey [Make, Bug #2959889]. +* Fixed Verilog parameter parsing, contributed by Nicolas Vincent [Verilog, Patch #2747828]. +* Fixed error when parsing empty file [OCaml]. +* Enabled Large File System support. [Bug #3062068] ctags-5.8 (09 Jul 2009) * Removed ".ml" as a Lisp extension (now OCaml) [Lisp]. === added directory 'Test' === added file 'Test/1795612.js' --- Test/1795612.js 1970-01-01 00:00:00 +0000 +++ Test/1795612.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,27 @@ + +// This file should generate the following tags: +// methods +// Test.RPC.asyncMethod +// Test.RPC.asyncRequest +// properties +// Test.RPC.request_id +Test.RPC = +{ + request_id: 0, + + asyncRequest: function( + /* string */ uri, + /* object */ data, + /* object */ callback) + { + }, + + asyncMethod: function( + /* string */ uri, + /* string */ method, + /* array */ params, + /* object */ callback) + { + } +}; + === added file 'Test/1850914.js' --- Test/1850914.js 1970-01-01 00:00:00 +0000 +++ Test/1850914.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,25 @@ +// This file should generate the following tags: +// +// methods +// objectLiteral.objLiteralMethod +// properties +// objectLiteral.objLiteralProperty + + +/** +* This is an object literal +*/ +var objectLiteral = { +/** +* This is a literal object property +*/ +objLiteralProperty : 1, +/** +* This is a literal object method +*/ +objLiteralMethod : function(){} +} + +// When I run ctags on this (ctags -f - test.js) I get no output. I expect it +// to give me something for both "objectLiteral" and "objLiteralMethod". + === added file 'Test/1878155.js' --- Test/1878155.js 1970-01-01 00:00:00 +0000 +++ Test/1878155.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,11 @@ + +// This should handle the escaped quote +var RE={/foo\"/: "bar"}; + +// This should also handle the escaped quote +// A tag should be created for the global variable "foo". +var foo="foo \" some other stuff"; + +// A tag should be created for this function "my_function". +function my_function() { +} === added file 'Test/1880687.js' --- Test/1880687.js 1970-01-01 00:00:00 +0000 +++ Test/1880687.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,98 @@ + +// All these examples contain various forms of IF statements +// with missing semicolons. Each of these are valid and must +// be accommodated. +// +// After running ctags: ctags -f tags 1880687.js +// The following tags should be generated: +// functions +// a +// b +// c +// d +// e +// f +// g +// h +// i +// j +// k +// l +// m +// n + +function a(flag){ + if(flag) + test(1); + else + test(2) +} + +function b(){ + var b= 33; +} + +function c(flag){ + if(flag) + test(1); +} + +function d(){ + var b= 33; +} + +function e(flag){ + if(flag) + test(1) +} + +function f(){ + var b= 33; +} + +function g(flag){ + if(flag) { + test(1) + } +} + +function h(){ + var b= 33; +} + +function i(flag){ + if(flag) { + test(1); + } +} + +function j(){ + var b= 33; +} + +function k(flag){ + if(flag) { + test(1); + } + else + flag = false; +} + +function l(){ + var b= 33; +} + +function m(flag){ + if(flag) { + test(1); + } + else { + flag = false; + } +} + +function n(){ + var b= 33; +} + + === added file 'Test/2023624.js' --- Test/2023624.js 1970-01-01 00:00:00 +0000 +++ Test/2023624.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +/* + * Both functions should be tagged. + * The embedded quote was fixed in issue: + * [ 1878155 ] Javascript escaped quotation mark brakes output + * [ 2023712 ] parseString for javascript broken on embedded quote + * The fix will be part of the 5.8 release. + */ + +function f1() { +var str = 'This function will be listed.'; +} + +function f2() { +var str = 'This function won\'t.'; +} === added file 'Test/68hc11.asm' --- Test/68hc11.asm 1970-01-01 00:00:00 +0000 +++ Test/68hc11.asm 2011-03-11 21:16:06 +0000 @@ -0,0 +1,23 @@ +INTERRUPTS: +; +PORTD EQU $1008 +; +SP EQU $20 +; +TRAPP FCB CR,LF + FCB CR,LF + FCC ' ******** ILLEGAL OPCODE TRAP !!! ********' + FCB CR,LF + FCB 0 +PROMPT FCB CR,LF + FCC ' 68Mon V1.2 (C) 1992 Keith Vasilakes' + FCB CR,LF + FCB 0 +COLD LDS #STACK + LDAA #$20 + +; http://www.mekatronix.com/downloads/docs/as11_man.pdf +sym1 EQU 1 +sym2: EQU 2 +sym3: +sym4: bne sym3 === added file 'Test/Package.pm' --- Test/Package.pm 1970-01-01 00:00:00 +0000 +++ Test/Package.pm 2011-03-11 21:16:06 +0000 @@ -0,0 +1,57 @@ +# This file is intended to test package keyword support along with +# multi-line subroutine definitions, like this: +# sub +# +# somefunction +# {... + +package Test::One; + +package Test::One::Two; + +package Test; + +use strict; +use warnings; + +sub + + init { +} + +use constant +CONST => 1; + +=head2 quo + +This is 'quo' subroutine + +=cut + +sub quo; + +quo; + +Test::quo; + +sub quo { + goto END; + die; +END: +END2 : + print "END!\n"; + return; +} + +sub xuz :lvalue; + +sub xtz (&@;$) :lvalue; + +sub +# This should create a tag +dude +{ + 1; +} + +1; === added file 'Test/aliases.e' --- Test/aliases.e 1970-01-01 00:00:00 +0000 +++ Test/aliases.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ +class ALIASES + +feature -- One + + attribute_a, attribute_b: INTEGER + + constant_a, constant_b: INTEGER is 1 + +feature -- Two + + function1a, function1b (one: DOUBLE): DOUBLE is + do + end + +feature -- Three + + procedure1a, procedure1b (one: DOUBLE) is + do + end + + a, infix "<", b (other: like Current): BOOLEAN is + do + end + + yor, infix "^", zor (other: like Current): INTEGER is + do + end + +end === added file 'Test/angle_bracket.cpp' --- Test/angle_bracket.cpp 1970-01-01 00:00:00 +0000 +++ Test/angle_bracket.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,16 @@ +static void foo (int nelem) +{ + int rsize = 2; + while (nelem < 0) { + rsize <<= 1; + } +} + +static void bar (int value) +{ + return value < 0 ? value : 3; +} + +static bar2 (void) +{ +} === added file 'Test/array-spec.f90' --- Test/array-spec.f90 1970-01-01 00:00:00 +0000 +++ Test/array-spec.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ + MODULE inm_df + IMPLICIT none + SAVE + TYPE df_type + REAL(8), POINTER :: & + df_mb_time(:), df_wb_time(:) + REAL(4), POINTER :: & + df_mb_data(:,:), df_wb_data(:,:) + END TYPE + END MODULE inm_df === added file 'Test/array_ref_and_out.cs' --- Test/array_ref_and_out.cs 1970-01-01 00:00:00 +0000 +++ Test/array_ref_and_out.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,33 @@ +// Programmer's Reference: Passing Array Using ref and out +public static void MyMethod(out int[] arr) +{ + arr = new int[10]; // definite assignment of arr +} + +public static void MyMethod(ref int[] arr) +{ + arr = new int[10]; // arr initialized to a different array +} + +using System; +class TestOut +{ + static public void FillArray(out int[] myArray) + { + // Initialize the array: + myArray = new int[5] {1, 2, 3, 4, 5}; + } + + static public void Main() + { + int[] myArray; // Initialization is not required + + // Pass the array to the callee using out: + FillArray(out myArray); + + // Display the array elements: + Console.WriteLine("Array elements are:"); + for (int i=0; i < myArray.Length; i++) + Console.WriteLine(myArray[i]); + } +} === added file 'Test/array_spec.f90' --- Test/array_spec.f90 1970-01-01 00:00:00 +0000 +++ Test/array_spec.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +! Bug reported by Jim Chen on 31 Dec 2002 +module Global_Variables +implicit none + +! Example of array-spec in entity-decl +real*8, save :: & +H (NDIM, NDIM) = 0.D0, & +H0(NDIM, NDIM), & +H1(NDIM, NDIM) = 0.D0, & +H2(NDIM, NDIM) = 0.D0, & +H3(NDIM, NDIM) = 0.D0, & +H4(NDIM, NDIM) = 0.D0, & +H5(NDIM, NDIM) = 0.D0 + +end module Global_Variables === added file 'Test/attributes.cs' --- Test/attributes.cs 1970-01-01 00:00:00 +0000 +++ Test/attributes.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,22 @@ +[DllImport] public class MyDllimportClass {} + +[DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] +[DllImport("user32.dll", ExactSpelling=false, SetLastError=false)] +[DllImport("user32.dll")] + +[Conditional("DEBUG"), Conditional("TEST1")] void TraceMethod() {} + +using System; +[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)] +public class Author : Attribute +{ + public Author(string name) { this.name = name; version = 1.0; } + public double version; + string name; +} + +[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, + AllowMultiple=true)] // multiuse attribute +public class Author : Attribute +{ +} === added file 'Test/attributes.e' --- Test/attributes.e 1970-01-01 00:00:00 +0000 +++ Test/attributes.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,31 @@ +expanded class ATTRIBUTES + +feature + + one: INTEGER + -- Header comment + + two: ARRAY [STRING] + -- Header comment + + three: HASH_TABLE [ARRAY [DOUBLE], STRING] + -- Header comment + + four: DOUBLE + -- Header comment + + five, six: INTEGER is unique + -- Header comment + + seven: INTEGER is 1 + -- Header comment + + eight: DOUBLE is 2.0 + -- Header comment + + nine: STRING is "abc" + -- Header comment + + anchored: like one + +end === added file 'Test/auto.f' --- Test/auto.f 1970-01-01 00:00:00 +0000 +++ Test/auto.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +! Provided by Brian Helsinki, 7 March 2003 + program AUTO_TEST + AUTOMATIC A, B, C + AUTOMATIC REAL P, D, Q + !IMPLICIT AUTOMATIC REAL (X-Z) + END + === added file 'Test/bd32.s' --- Test/bd32.s 1970-01-01 00:00:00 +0000 +++ Test/bd32.s 2011-03-11 21:16:06 +0000 @@ -0,0 +1,43 @@ +* From: http://www.programmersheaven.com/zone5/cat462/3642.htm +* For 68000 assembler manual, see http://www.ece.iit.edu/ftp/242/Asm.doc +* +* test driver for BD32 programming command +* Scott Howard February 1992 +* Format: TEST [ ...] +* simply echoes the command line parameters back to the user + + opt nol + include ipd.inc + opt l + dc.l TEST execution address +signon dc.b 'TEST PROGRAM for BD32 programming drivers' +CRLF dc.b 13,10,0 , , null + even + +* following is the mainline routine for the driver + +TEST move.l a0,a1 get argv in a1 + move.l d0,d2 get argc + lea.l signon(PC),a0 print signon string + moveq.l #BD_PUTS,d0 use 'putstring' function in BD32 + bgnd + cmpi.l #2,d2 arg count < 2? + bcc test_1 + moveq.l #1,d1 bail out - error code 1 + bra test_error +test_1 moveq.l #BD_PUTS,d0 puts () system call + movea.l (a1)+,a0 point to next string + bgnd + moveq.l #' ',d1 print space between each one + moveq.l #BD_PUTCHAR,d0 + bgnd + subq #1,d2 + bne test_1 loop till done + lea.l CRLF(PC),a0 point to string + moveq.l #BD_PUTS,d0 display it on user screen + bgnd + clr.l d1 indicate 'no error' to BD32 +test_error moveq.l #BD_QUIT,d0 all done - quit + bgnd + + END TEST === added file 'Test/bit_field.c' --- Test/bit_field.c 1970-01-01 00:00:00 +0000 +++ Test/bit_field.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,35 @@ +struct bit_fields { + unsigned int a: 1; + unsigned int b: 1; + unsigned int c: 2; +}; + +struct { + unsigned sign : 1; + unsigned exp : _FP_EXPBITS_D; + unsigned frac1 : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0) - _FP_W_TYPE_SIZE; + unsigned frac0 : _FP_W_TYPE_SIZE; +}; + +struct shortname_info { + unsigned char lower:1, + upper:1, + valid:1; +}; + +// Problem reported by Michael Brown on 23 October 2001. +typedef struct +{ + BYTE public: 1; + BYTE bad2: 1; + BYTE group: 1; + BYTE personal: 1; +} bitfield_flags; + +typedef struct +{ + BYTE this; + BYTE public; + BYTE private; + BYTE that; +} mystruct; === added file 'Test/bug1020715.c' --- Test/bug1020715.c 1970-01-01 00:00:00 +0000 +++ Test/bug1020715.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,52 @@ +/* +Bugs item #1020715, was opened at 2004-09-01 22:42 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=1020715&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Arne Georg Gleditsch (argggh) +Assigned to: Nobody/Anonymous (nobody) +Summary: Strange parsing of C code + +Initial Comment: +Running ctags 5.5.4 like this + +/usr/local/bin/ctags --fields=+S --excmd=number -f - --c-types=+l /usr/src/source/2.6.6/drivers/scsi/aha152x.c | grep ^done + +returns a bogus entry for the function "done" on line +1745 with a wacky signature. The file aha152x.c is +from Linux 2.6.6, but is appended for convenience. +*/ +/* +Date: 2007-08-14 01:00 +Sender: elliotth +Hide + +i don't really understand why the other lines in the test case were +necessary to exercise the bug, but changing parseParens to call +processAngleBracket instead of just skipToMatch("<>") fixes this bug. i've +committed that since it causes no regressions. + + +Date: 2007-08-14 00:34 +Sender: elliotth +Hide + +i've come up with a minimal test case, and committed it. it's pretty +weird: +*/ +void f() { + done(a<<1); + a->a; + if (a->a) { + } +} +/* +change just about anything and the bizarre "done" tag goes away. you can't +even switch from '->' to '.', which seems odd. +*/ === added file 'Test/bug1020715.cpp' --- Test/bug1020715.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1020715.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +void f() { + done(a<<1); + a->a; + if (a->a) { + } +} === added file 'Test/bug1085585.c' --- Test/bug1085585.c 1970-01-01 00:00:00 +0000 +++ Test/bug1085585.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,37 @@ +/* +Bugs item #1085585, was opened at 2004-12-14 20:55 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=1085585&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: boisterous (yadavnav) +Assigned to: Nobody/Anonymous (nobody) +Summary: ctags 5.5.4 doesn't work correctly on some files + +Initial Comment: +Hi, + +I ran exuberant ctags on the following file + +FreeBSD kernel : src/sys/crypto/des/des_setkey.c + +If I run the 5.5.4 ctags on version 1.3 of the above +file then it doesn't produce all the tags + +The version 1.3 is at: + +http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/crypto/des/des_setkey.c?rev=1.3&content-type=text/x-cvsweb-markup + +[...] + +Why does ctags fail on the 1.3 version of the file ? +*/ + +/* relevant portion from file */ +static int check_parity(des_cblock (*key)); +int des_check_key=0; === added file 'Test/bug1086609.c' --- Test/bug1086609.c 1970-01-01 00:00:00 +0000 +++ Test/bug1086609.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,41 @@ +/* +Bugs item #1086609, was opened at 2004-12-16 13:07 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=1086609&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Mikhail Kruk (meshko) +Assigned to: Nobody/Anonymous (nobody) +Summary: ctags getting confused by #if 0 + +Initial Comment: +Here is a sample C program which confuses ctags. I +think every line in it is significant. Dropping any of +the #ifdefs or the #define makes the problem go away: +*/ +#if 0 +#define __PROC__ +int func1( +#if 0 +#endif +) +{ +} +#endif + +int func2(int a) +{ +} +/* +Somehow the opening brace from line 3 doesn't get +ignored and the closing brace does get ignored and +ctags drops out on "int func2(int a)" line with "failed +to find match for '(' at line 11" error. +Granted, having #if 0 in the middle of args list is +weird, but perfeclty legal. +*/ === added file 'Test/bug1093123.cpp' --- Test/bug1093123.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1093123.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +#include + +int main() { +using namespace std; +cout << 0 << endl; +int m; +} === added file 'Test/bug1111214-j-chan.v' --- Test/bug1111214-j-chan.v 1970-01-01 00:00:00 +0000 +++ Test/bug1111214-j-chan.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +/* +* +**/ +module top(outsig, insig); +output outsig; +input insig; +assign outsig = insig; +endmodule === added file 'Test/bug1111214.v' --- Test/bug1111214.v 1970-01-01 00:00:00 +0000 +++ Test/bug1111214.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,17 @@ +// File example.v +// +// Below is an example of a comment that is mis-parsed by exuberant ctags. +// It uses the multi-line comment format, i.e. /* ... */ except that in +// this case, the character sequence immediately preceeding the closing +// delimiter is an asterisk. (Any even number of asterisks would have the +// same problem. +// The line immediately afterwards is used to demonstrate the problem. +// the module name 'wahoo' isn't recognised, because the parser mistakenly +// thinks we are still in a multi-line comment. +/* + * I am a multi-line comment + * I happen to end in a strange + * (but legal) way: **/ +module wahoo () +begin +end === added file 'Test/bug1187505.cpp' --- Test/bug1187505.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1187505.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +MY_MACRO(qwerty < 1); + +class Abra : public Kadabra +{ +}; === added file 'Test/bug1201689.c' --- Test/bug1201689.c 1970-01-01 00:00:00 +0000 +++ Test/bug1201689.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,35 @@ +/* +Bugs item #1201689, was opened at 2005-05-13 18:18 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=1201689&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Scott Ferguson (shf301) +Assigned to: Nobody/Anonymous (nobody) +Summary: Variable Length Argument Lists in K&R Style not Parsed + +Initial Comment: +A function with a K&R style parameter list that has a +variable length argument list will not be added to the tags file. + +For example create a file, say test.c with the following code +*/ +void test(a, ...) +char a; +{ + return; +} +/* +Run ctags test.c. the tags file with only contain the line: + a test.c /^char a;$/;" v + +This occurs with ctags 5.3 and 5.5.4. + +Variable length argument lists work fine if the function is in +ANSI style, void test(char a, ...) will work fine. +*/ === added file 'Test/bug1324663.sql' --- Test/bug1324663.sql 1970-01-01 00:00:00 +0000 +++ Test/bug1324663.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +-- The sql parser would go into an endless loop with the open but no closing comment. +-- ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --sql-types=cdfFlLPprstTvieURDVnxy bug1324663.sql +-- +'\'/*' === added file 'Test/bug1428714.sql' --- Test/bug1428714.sql 1970-01-01 00:00:00 +0000 +++ Test/bug1428714.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +-- The sql parser would go into an endless loop with the open but no closing comment. +-- ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --sql-types=cdfFlLPprstTvieURDVnxy bug1428714.sql +-- +/* === added file 'Test/bug1447756.java' --- Test/bug1447756.java 1970-01-01 00:00:00 +0000 +++ Test/bug1447756.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +// Java 1.5 generic interfaces appear to be tagged on the +// parameterized type name instead of the interface name, +// e.g., + + public interface Foo { + public T bar(); + } + +// is tagged on 'T' instead of 'Foo'. === added file 'Test/bug1458930.c' --- Test/bug1458930.c 1970-01-01 00:00:00 +0000 +++ Test/bug1458930.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +// test with --c-kinds=+p +char x(); +wchar_t y(); === added file 'Test/bug1466117.c' --- Test/bug1466117.c 1970-01-01 00:00:00 +0000 +++ Test/bug1466117.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +typedef struct mystruct { + int a; + int b; +}; + +typedef struct { + int a; + int b; +} mystruct; + === added file 'Test/bug1491666.c' --- Test/bug1491666.c 1970-01-01 00:00:00 +0000 +++ Test/bug1491666.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,13 @@ +typedef struct { + int + x; + + float + y; +} my_struct; + +void main (void) { + my_struct var1; + my_struct + var2; +} === added file 'Test/bug1515910.cs' --- Test/bug1515910.cs 1970-01-01 00:00:00 +0000 +++ Test/bug1515910.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +// Simple generic classes. +public class MyGenericClass1 { } + +// Derived enums. +enum Enum1 : byte { + Value1, Values +} + +// Verbatim strings. +public class C { + private string str1 = @"abc\"; + private int int1 = 123; + private string str2 = @"abc\"; + private string str3 = "abc"; +} === added file 'Test/bug1548443.cpp' --- Test/bug1548443.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1548443.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +union TestUnion +{ +int _number; +}; + +struct TestStruct +{ +int _number; +}; === added file 'Test/bug1563476.cpp' --- Test/bug1563476.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1563476.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,16 @@ +int g() { +} + +template< typename Accessor, typename bEnable = void > +struct IntroduceBitDef; + +template< typename Accessor > +struct IntroduceBitDef< Accessor, typename +boost::enable_if_c< CoreConfig::VERSION <= 3 >::type > +{ + +// class body here +// anything after this point is not parsed by ctags + int f() { } + +}; === added file 'Test/bug1570779.sql' --- Test/bug1570779.sql 1970-01-01 00:00:00 +0000 +++ Test/bug1570779.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,14 @@ +-- This should find the "address" column when --sql-types=r is used +-- ctags -f - --format=2 --excmd=pattern --fields=nks --sort=no --sql-types=cdfFlLPprstTvieURDVnxy bug1570779.sql +-- employees bug1570779.sql /^CREATE TABLE employees ($/;" t line:2 +-- employees.id bug1570779.sql /^ id integer NOT NULL,$/;" F line:3 +-- employees.name bug1570779.sql /^ name varchar(20),$/;" F line:4 +-- employees.address bug1570779.sql /^ address varchar(50),$/;" F line:5 + +CREATE TABLE employees ( + id integer NOT NULL, + name varchar(20), + address varchar(50), + primary key (id) +); + === added file 'Test/bug1575055.cpp' --- Test/bug1575055.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1575055.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +namespace TheNamespace { + class MyClass { }; + int variable; +} === added file 'Test/bug1585745.cpp' --- Test/bug1585745.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1585745.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +// Despite the weird whitespace, all these destructors should be recognized and tagged. +Class1::~Class1() { } +Class2::~ Class2() { } +Class3:: ~Class3() { } +Class4:: ~ Class4() { } +class Class5 { + public: ~ Class5() { } +}; === added file 'Test/bug1611054.cs' --- Test/bug1611054.cs 1970-01-01 00:00:00 +0000 +++ Test/bug1611054.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +class C { + public String a() { + return @"c:\"; + } + // this tag is missing in ctags 5.6 + public void b() { + } +} === added file 'Test/bug1691412.java' --- Test/bug1691412.java 1970-01-01 00:00:00 +0000 +++ Test/bug1691412.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,17 @@ +public class C { + @NonNull + @CheckReturnValue(explanation = "When this function returns, the caller can get the Cipher name selected by the user in the Dialog.") + public static DefaultCipherDialog newInstance() { + DefaultCipherDialog instance = new DefaultCipherDialog(); + instance.init(); + return instance; + } + + @Override + public String toString() { return "hello"; } +} + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.SOURCE) +public @interface CustomAnnotation { +} === added file 'Test/bug1742588.rb' --- Test/bug1742588.rb 1970-01-01 00:00:00 +0000 +++ Test/bug1742588.rb 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +class A + def a() + super(" do ") + end + def b() + end +end === added file 'Test/bug1743330.v' --- Test/bug1743330.v 1970-01-01 00:00:00 +0000 +++ Test/bug1743330.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +// somewhat contrived, but i came across a real-life file that caused this +// crash. +value= +hello/ +world; === added file 'Test/bug1764143.h' --- Test/bug1764143.h 1970-01-01 00:00:00 +0000 +++ Test/bug1764143.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,27 @@ +static inline void omap1_arch_reset(char mode) +{ + /* + * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 + * "Global Software Reset Affects Traffic Controller Frequency". + */ + if (cpu_is_omap5912()) { + omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), + DPLL_CTL); + omap_writew(0x8, ARM_RSTCT1); + } + + if (machine_is_voiceblue()) + voiceblue_reset(); + else + omap_writew(1, ARM_RSTCT1); +} + +static inline void arch_reset(char mode) +{ + if (!cpu_is_omap24xx()) + omap1_arch_reset(mode); + else + omap_prcm_arch_reset(mode); +} + +#endif === added file 'Test/bug1764148' --- Test/bug1764148 1970-01-01 00:00:00 +0000 +++ Test/bug1764148 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +#!/usr/bin/python +def PyFunc(msg): print msg === added file 'Test/bug1770479.cpp' --- Test/bug1770479.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1770479.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,17 @@ +#include + +int main (int argc, char **argv) +{ + std::ostringstream a; + a << "a"; + + std::ostringstream b; + b << "b"; + + return 0; +} + +int foo (int i) +{ + return i; +} === added file 'Test/bug1773926.cpp' --- Test/bug1773926.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1773926.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,12 @@ +#include + +#define ERROR_HAPPENED 50 +#define OK 2 +#define NEXT_DEFINE 3 + +int main(int argc, char* argv[]) +{ + printf("Hello world\n"); + return 0; +} + === added file 'Test/bug1777340.java' --- Test/bug1777340.java 1970-01-01 00:00:00 +0000 +++ Test/bug1777340.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +public @interface bug1777340 { + String n() default "ninjas; monkeys!"; + String m(); +} === added file 'Test/bug1777344.java' --- Test/bug1777344.java 1970-01-01 00:00:00 +0000 +++ Test/bug1777344.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +import java.util.*; +public class bug1777344 { + private HashMap map1; + private HashMap map2 = new HashMap(), map3; + private boolean b = (1 < 3), c; + private boolean d = 1 < 3, e; +} === added file 'Test/bug1799340.cpp' --- Test/bug1799340.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1799340.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +std::string & f1() {} +const std::string & f2() {} +std::string const & f3() {} === added file 'Test/bug1799343-1.cpp' --- Test/bug1799343-1.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1799343-1.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +#include +struct C { int x; }; +struct D : ::C { + D() { x = 123; } + ~D() { std::cout << x << std::endl; } +}; +int main(void) { + D d; + return 0; +} === added file 'Test/bug1799343-2.cpp' --- Test/bug1799343-2.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1799343-2.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,27 @@ +class P { + protected: + int x; +}; + +namespace A { + class P { + protected: + int x; + }; + class Q { + int y; + }; + + namespace C { + class R: ::P, A::Q { + int z; + int f (int v) { return v + x; } + }; + } +} + +namespace B { + class S : A::C::R { + int t; + }; +} === added file 'Test/bug1800065.cs' --- Test/bug1800065.cs 1970-01-01 00:00:00 +0000 +++ Test/bug1800065.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +using Gtk; +public class C { + private Gtk.Window window; + private string title; +} === added file 'Test/bug1809024.py' --- Test/bug1809024.py 1970-01-01 00:00:00 +0000 +++ Test/bug1809024.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ + def detach (self): + + model = self.view.props.model + sort_id, sort_order = tree_sortable_get_sort_column_id (model) + if sort_id >= 0: + self.app.state.sort_column = self.find_item_class (id = sort_id) + if sort_order == gtk.SORT_ASCENDING: + self.app.state.sort_order = "ascending" + else: + self.app.state.sort_order = "descending" === added file 'Test/bug1830343.cs' --- Test/bug1830343.cs 1970-01-01 00:00:00 +0000 +++ Test/bug1830343.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +class ForEachTest { + static void Main(string[] args) { + int[] fibarray = new int[] { 0, 1, 2, 3, 5, 8, 13 }; + foreach (int i in fibarray) { + System.Console.WriteLine(i); + } + } +} === added file 'Test/bug1830344.cs' --- Test/bug1830344.cs 1970-01-01 00:00:00 +0000 +++ Test/bug1830344.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +public class C { + public void m() { + bool flagCheck = true; + if (flagCheck == true) { + Console.WriteLine("true"); + } else { + Console.WriteLine("false"); + } + } +} === added file 'Test/bug1856363.py' --- Test/bug1856363.py 1970-01-01 00:00:00 +0000 +++ Test/bug1856363.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/python + +def main(): + # A broken ctags will see a function "initely_not_a_function" here. + definitely_not_a_function = 0 + return + +if __name__ == 'main': + main() === added file 'Test/bug1906062.py' --- Test/bug1906062.py 1970-01-01 00:00:00 +0000 +++ Test/bug1906062.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +include_file = ''' +class (b) +''' + === added file 'Test/bug1907083.cpp' --- Test/bug1907083.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1907083.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +// All of these should have "class:C", but m2-m4 have "class C::C" with ctags 5.7. +C::T * C::m1() {} +C::T * const C::m2() {} +C::T const * C::m3() {} +C::T const * const C::m4() {} === added file 'Test/bug1924919.cpp' --- Test/bug1924919.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug1924919.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +#include +namespace mud { + std::string MajorVersion; + std::string MinorVersion; +}; === added file 'Test/bug1938565.sql' --- Test/bug1938565.sql 1970-01-01 00:00:00 +0000 +++ Test/bug1938565.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,18 @@ +CREATE OR REPLACE PACKAGE demo_pkg +IS + +FUNCTION func1_proto( value in varchar ) RETURNS number; +FUNCTION func2_proto( value in varchar ) RETURN number; + +FUNCTION func1( value in varchar ) RETURNS number IS +BEGIN + RETURN 1; +END func1; + +FUNCTION func2( value in varchar ) RETURN number IS +BEGIN + RETURN 2; +END func2; + +END demo_pkg; +/ === added file 'Test/bug1944150.sql' --- Test/bug1944150.sql 1970-01-01 00:00:00 +0000 +++ Test/bug1944150.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +CREATE TRIGGER [tr_d_cash_trade_comment] ON dbo.cash_trade_comment +FOR DELETE +AS +BEGIN +END +GO + === added file 'Test/bug1950327.js' --- Test/bug1950327.js 1970-01-01 00:00:00 +0000 +++ Test/bug1950327.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,41 @@ +// I've attached the simple test case as bugDemo.js. Trigger the bug by +// uncommenting line 8. Attached are tags files with line 21 commented/not +// commented. This is the current tip, svn r663. +// +// When the container.dirtyTab line is uncommented you see these methods: +// TabChrome.createTabTile +// TabChrome.init +// +// When the container.dirtyTab line is commented you see these methods: +// TabChrome.createTabTile +// TabChrome.destroyTabTile +// TabChrome.init +// +TabChrome.prototype = { + init: function() + { + this.browserMap = new Object(); + }, + createTabTile: function(browser) + { + //container.dirtyTab = {'url': false, 'title':false, 'snapshot':false, '*': false} + return container; + }, + destroyTabTile: function(tile) + { + } +} +Different.prototype = { + init: function() + { + this.browserMap = new Object(); + }, + createTabTile: function(browser) + { + container.dirtyTab = {'url': false, 'title':false, 'snapshot':false, '*': false} + return container; + }, + destroyTabTile: function(tile) + { + } +} === added file 'Test/bug1988026.py' --- Test/bug1988026.py 1970-01-01 00:00:00 +0000 +++ Test/bug1988026.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ + +class testClass: + my_var = 0 + def main(): + pass + +if __name__ == '__main__': testClass.main() + def im_a_function(): + pass === added file 'Test/bug1988027.py' --- Test/bug1988027.py 1970-01-01 00:00:00 +0000 +++ Test/bug1988027.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# encoding: utf-8 + + +""" +bla +#""" + +"""make a tarball with all the sources in it; return (distdirname, tarballname)""" === added file 'Test/bug1988130.py' --- Test/bug1988130.py 1970-01-01 00:00:00 +0000 +++ Test/bug1988130.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +def testFunc(): + print 'The following works now' + '"""' + +def main(): + print 'nothing' + print 'This is another quoted triple string: """.' + return 0 === added file 'Test/bug2049723.java' --- Test/bug2049723.java 1970-01-01 00:00:00 +0000 +++ Test/bug2049723.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +import javax.annotation.Nonnull; + +public class bug2049723 { + public void m1(String arg) {} + public void m2(@Nonnull String arg) {} +} === added file 'Test/bug2117073.java' --- Test/bug2117073.java 1970-01-01 00:00:00 +0000 +++ Test/bug2117073.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,12 @@ +public class AAssignmentExp { + public AAssignmentExp(@SuppressWarnings("hiding") TAssign _token_, + @SuppressWarnings("hiding") PLvalue _lvalue_, + @SuppressWarnings("hiding") PExp _exp_) { + setToken(_token_); + setLvalue(_lvalue_); + setExp(_exp_); + } + + @Override void removeChild(@SuppressWarnings("unused") Node child) { + } +} === added file 'Test/bug2374109.vhd' --- Test/bug2374109.vhd 1970-01-01 00:00:00 +0000 +++ Test/bug2374109.vhd 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +function Pow2( N, Exp : integer ) return mylib.myinteger is + Variable Result : integer := 1; + +begin + for i in 1 to Exp loop + Result := Result * N; + end loop; + return( Result ); +end Pow; === added file 'Test/bug2411878.cs' --- Test/bug2411878.cs 1970-01-01 00:00:00 +0000 +++ Test/bug2411878.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +public class C { + private System.String m_name; +} === added file 'Test/bug2747828.v' --- Test/bug2747828.v 1970-01-01 00:00:00 +0000 +++ Test/bug2747828.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,1 @@ +parameter ramaddr_0 = {1'b1,9'd0}; === added file 'Test/bug2777310.js' --- Test/bug2777310.js 1970-01-01 00:00:00 +0000 +++ Test/bug2777310.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +var x = 1; +var z = {}; +var y = []; + === added file 'Test/bug2886870.tex' --- Test/bug2886870.tex 1970-01-01 00:00:00 +0000 +++ Test/bug2886870.tex 2011-03-11 21:16:06 +0000 @@ -0,0 +1,351 @@ +Sample LaTeX file +The name of this file is intro.tex. + +\documentclass[12pt]{article} + +\usepackage{amsmath} % need for subequations +\usepackage{graphicx} % need for figures +\usepackage{verbatim} % useful for program listings +\usepackage{color} % use if color is used in text +\usepackage{subfigure} % use for side-by-side figures +\usepackage{hyperref} % use for hypertext links, including those to external documents and URLs + +% don't need the following. simply use defaults +\setlength{\baselineskip}{16.0pt} % 16 pt usual spacing between lines + +\setlength{\parskip}{3pt plus 2pt} +\setlength{\parindent}{20pt} +\setlength{\oddsidemargin}{0.5cm} +\setlength{\evensidemargin}{0.5cm} +\setlength{\marginparsep}{0.75cm} +\setlength{\marginparwidth}{2.5cm} +\setlength{\marginparpush}{1.0cm} +\setlength{\textwidth}{150mm} + +\begin{comment} +\pagestyle{empty} % use if page numbers not wanted +\end{comment} + +% above is the preamble + +\begin{document} + +\begin{center} +{\large Introduction to \LaTeX} \\ % \\ = new line +\copyright 2006 by Harvey Gould \\ +December 5, 2006 +\end{center} + +\section{Introduction} +\TeX\ looks more difficult than it is. It is +almost as easy as $\pi$. See how easy it is to make special +symbols such as $\alpha$, +$\beta$, $\gamma$, +$\delta$, $\sin x$, $\hbar$, $\lambda$, $\ldots$ We also can make +subscripts +$A_{x}$, $A_{xy}$ and superscripts, $e^x$, $e^{x^2}$, and +$e^{a^b}$. We will use \LaTeX, which is based on \TeX\ and has +many higher-level commands (macros) for formatting, making +tables, etc. More information can be found in Ref.~\cite{latex}. + +We just made a new paragraph. Extra lines and spaces make no +difference. Note that all formulas are enclosed by +\$ and occur in \textit{math mode}. + +The default font is Computer Modern. It includes \textit{italics}, +\textbf{boldface}, +\textsl{slanted}, and \texttt{monospaced} fonts. + +\section{Equations} +Let us see how easy it is to write equations. +\begin{equation} +\Delta =\sum_{i=1}^N w_i (x_i - \bar{x})^2 . +\end{equation} +It is a good idea to number equations, but we can have a +equation without a number by writing +\begin{equation} +P(x) = \frac{x - a}{b - a} , \nonumber +\end{equation} +and +\begin{equation} +g = \frac{1}{2} \sqrt{2\pi} . \nonumber +\end{equation} + +We can give an equation a label so that we can refer to it later. +\begin{equation} +\label{eq:ising} +E = -J \sum_{i=1}^N s_i s_{i+1} , +\end{equation} +Equation~\eqref{eq:ising} expresses the energy of a configuration +of spins in the Ising model.\footnote{It is necessary to process (typeset) a +file twice to get the counters correct.} + +We can define our own macros to save typing. For example, suppose +that we introduce the macros: +\begin{verbatim} + \newcommand{\lb}{{\langle}} + \newcommand{\rb}{{\rangle}} +\end{verbatim} +\newcommand{\lb}{{\langle}} +\newcommand{\rb}{{\rangle}} +Then we can write the average value of $x$ as +\begin{verbatim} +\begin{equation} +\lb x \rb = 3 +\end{equation} +\end{verbatim} +The result is +\begin{equation} +\lb x \rb = 3 . +\end{equation} + +Examples of more complicated equations: +\begin{equation} +I = \! \int_{-\infty}^\infty f(x)\,dx \label{eq:fine}. +\end{equation} +We can do some fine tuning by adding small amounts of horizontal +spacing: +\begin{verbatim} + \, small space \! negative space +\end{verbatim} +as is done in Eq.~\eqref{eq:fine}. + +We also can align several equations: +\begin{align} +a & = b \\ +c &= d , +\end{align} +or number them as subequations: +\begin{subequations} +\begin{align} +a & = b \\ +c &= d . +\end{align} +\end{subequations} + +We can also have different cases: +\begin{equation} +\label{eq:mdiv} +m(T) = +\begin{cases} +0 & \text{$T > T_c$} \\ +\bigl(1 - [\sinh 2 \beta J]^{-4} \bigr)^{\! 1/8} & \text{$T < T_c$} +\end{cases} +\end{equation} +write matrices +\begin{align} +\textbf{T} &= +\begin{pmatrix} +T_{++} \hfill & T_{+-} \\ +T_{-+} & T_{--} \hfill +\end{pmatrix} , \nonumber \\ +& = +\begin{pmatrix} +e^{\beta (J + B)} \hfill & e^{-\beta J} \hfill \\ +e^{-\beta J} \hfill & e^{\beta (J - B)} \hfill +\end{pmatrix}. +\end{align} +and +\newcommand{\rv}{\textbf{r}} +\begin{equation} +\sum_i \vec A \cdot \vec B = -P\!\int\! \rv \cdot +\hat{\mathbf{n}}\, dA = P\!\int \! {\vec \nabla} \cdot \rv\, dV. +\end{equation} + +\section{Tables} +Tables are a little more difficult. TeX +automatically calculates the width of the columns. + +\begin{table}[h] +\begin{center} +\begin{tabular}{|l|l|r|l|} +\hline +lattice & $d$ & $q$ & $T_{\rm mf}/T_c$ \\ +\hline +square & 2 & 4 & 1.763 \\ +\hline +triangular & 2 & 6 & 1.648 \\ +\hline +diamond & 3 & 4 & 1.479 \\ +\hline +simple cubic & 3 & 6 & 1.330 \\ +\hline +bcc & 3 & 8 & 1.260 \\ +\hline +fcc & 3 & 12 & 1.225 \\ +\hline +\end{tabular} +\caption{\label{tab:5/tc}Comparison of the mean-field predictions +for the critical temperature of the Ising model with exact results +and the best known estimates for different spatial dimensions $d$ +and lattice symmetries.} +\end{center} +\end{table} + +\section{Lists} + +Some example of formatted lists include the +following: + +\begin{enumerate} + +\item bread + +\item cheese + +\end{enumerate} + +\begin{itemize} + +\item Tom + +\item Dick + +\end{itemize} + +\section{Figures} + +We can make figures bigger or smaller by scaling them. Figure~\ref{fig:lj} +has been scaled by 60\%. + +\begin{figure}[h] +\begin{center} +\includegraphics{figures/sine} +\caption{\label{fig:typical}Show me a sine.} +\end{center} +\end{figure} + +\begin{figure}[h] +\begin{center} +\scalebox{0.6}{\includegraphics{figures/lj}} +\caption{\label{fig:lj}Plot of the +Lennard-Jones potential +$u(r)$. The potential is characterized by a length +$\sigma$ and an energy +$\epsilon$.} +\end{center} +\end{figure} + +\section{Literal text} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\verb \end{verbatim} as in the following example: +\begin{verbatim} +double y0 = 10; // example of declaration and assignment statement +double v0 = 0; // initial velocity +double t = 0; // time +double dt = 0.01; // time step +double y = y0; +\end{verbatim} +The command \verb \verbatiminput{programs/Square.java}\ allows +you to list the file \texttt{Square.java} in the directory +programs. + +\section{Special Symbols} + +\subsection{Common Greek letters} + +These commands may be used only in math mode. Only the most common +letters are included here. + +$\alpha, +\beta, \gamma, \Gamma, +\delta,\Delta, +\epsilon, \zeta, \eta, \theta, \Theta, \kappa, +\lambda, \Lambda, \mu, \nu, +\xi, \Xi, +\pi, \Pi, +\rho, +\sigma, +\tau, +\phi, \Phi, +\chi, +\psi, \Psi, +\omega, \Omega$ +\subsubsection{Test for ctags} +\subsection{Special symbols} + +The derivative is defined as +\begin{equation} +\frac{dy}{dx} = \lim_{\Delta x \to 0} \frac{\Delta y} +{\Delta x} +\end{equation} +\begin{equation} +f(x) \to y \quad \mbox{as} \quad x \to +x_{0} +\end{equation} +\begin{equation} +f(x) \mathop {\longrightarrow} +\limits_{x \to x_0} y +\end{equation} + +\noindent Order of magnitude: +\begin{equation} +\log_{10}f \simeq n +\end{equation} +\begin{equation} +f(x)\sim 10^{n} +\end{equation} +Approximate equality: +\begin{equation} +f(x)\simeq g(x) +\end{equation} +\LaTeX\ is simple if we keep everything in proportion: +\begin{equation} +f(x) \propto x^3 . +\end{equation} + +Finally we can skip some space by using commands such as +\begin{verbatim} +\bigskip \medskip \smallskip \vspace{1pc} +\end{verbatim} +The space can be negative. + +\section{\color{red}Use of Color} + +{\color{blue}{We can change colors for emphasis}}, +{\color{green}{but}} {\color{cyan}{who is going pay for the ink?}} + +\section{\label{morefig}Subfigures} + +As soon as many students start becoming comfortable using \LaTeX, they want +to use some of its advanced features. So we now show how to place two +figures side by side. + +\begin{figure}[h!] +\begin{center} +\subfigure[Real and imaginary.]{ +\includegraphics[scale=0.5]{figures/reim}} +\subfigure[Amplitude and phase.]{ +\includegraphics[scale=0.5]{figures/phase}} +\caption{\label{fig:qm/complexfunctions} Two representations of complex +wave functions.} +\end{center} +\end{figure} + +We first have to include the necessary package, +\verb+\usepackage{subfigure}+, which has to go in the preamble (before +\verb+\begin{document}+). It sometimes can be difficult to place a figure in +the desired place. + +Your LaTeX document can be easily modified to make a poster or a screen +presentation similar to (and better than) PowerPoint. Conversion to HTML is +straightforward. Comments on this tutorial are appreciated. + +\begin{thebibliography}{5} + +\bibitem{latex}Helmut Kopka and Patrick W. Daly, \textsl{A Guide to +\LaTeX: Document Preparation for Beginners and Advanced Users}, +fourth edition, Addison-Wesley (2004). + +\bibitem{website}Some useful links are +given at \url{}. + +\end{thebibliography} + +{\small \noindent Updated 5 December 2006.} +\end{document} + +Updated 6 February 2006. + + === added file 'Test/bug2888482.js' --- Test/bug2888482.js 1970-01-01 00:00:00 +0000 +++ Test/bug2888482.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,12 @@ +function scrollEditBox() { + var editBoxEl = document.getElementById("wpTextbox1"); + var scrollTopEl = document.getElementById("wpScrolltop"); + var editFormEl = document.getElementById("editform"); + + if (editBoxEl && scrollTopEl) { + if (scrollTopEl.value) editBoxEl.scrollTop = scrollTopEl.value; + editFormEl.onsubmit = function() { + document.getElementById("wpScrolltop").value = document.getElementById("wpTextbox1").scrollTop; + } + } +} === added file 'Test/bug2959889.mak' --- Test/bug2959889.mak 1970-01-01 00:00:00 +0000 +++ Test/bug2959889.mak 2011-03-11 21:16:06 +0000 @@ -0,0 +1,1 @@ +{ \ No newline at end of file === added file 'Test/bug2961855.sql' --- Test/bug2961855.sql 1970-01-01 00:00:00 +0000 +++ Test/bug2961855.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,19 @@ +// When it should be demo_pkg.test_func and demo_pkg.test_var +// Tags are created for: +// packages +// demo_pkg +// variables +// test_var +// +// But no tags for the function. +// +// +create or replace package demo_pkg is +test_var number; + +function test_func return varchar2; +function more.test_func2 return varchar2; +function test_func3 return varchar2; + +end demo_pkg; + === added file 'Test/bug3032253.vim' --- Test/bug3032253.vim 1970-01-01 00:00:00 +0000 +++ Test/bug3032253.vim 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +" ctags will hang when it attempts to process this line + command. + command!. + comma!. + comma! ThisIsValid === added file 'Test/bug507864.c' --- Test/bug507864.c 1970-01-01 00:00:00 +0000 +++ Test/bug507864.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +FUNCSTS func1(ENTSEQNO(seq)) {} +FUNCSTS func2 (MEMTXT(form_msg), MEMTXT (text), MEMTXT (mail)) {} === added file 'Test/bug538629.asm' --- Test/bug538629.asm 1970-01-01 00:00:00 +0000 +++ Test/bug538629.asm 2011-03-11 21:16:06 +0000 @@ -0,0 +1,1 @@ + MYMACRO EQU 01234h === added file 'Test/bug556645.c' --- Test/bug556645.c 1970-01-01 00:00:00 +0000 +++ Test/bug556645.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,39 @@ +/* +From noreply@sourceforge.net Wed May 29 23:11:25 2002 +Date: Wed, 15 May 2002 23:25:52 -0700 +From: noreply@sourceforge.net +To: noreply@sourceforge.net +Subject: [ ctags-Bugs-556645 ] Some typedef can not be tagged in C code + +Bugs item #556645, was opened at 2002-05-16 14:25 +You can respond by visiting: +http://sourceforge.net/tracker/?func=detail&atid=106556&aid=556645&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Howard Wu (howardhbwu) +Assigned to: Nobody/Anonymous (nobody) +Summary: Some typedef can not be tagged in C code + +Initial Comment: +My Ctags version:5.2.3 + +The typedef of "Qtype" as the following, + +*/ +#define A1(_type, _length) \ +struct { \ + unsigned int head; \ + unsigned int tail; \ + bool is_full; \ + _type queue[_length]; \ + } + +typedef A1(ilm_struct, 1) Qtype; + +/* +As using ctags, the "Qtype" can not be tagged by it. +*/ === added file 'Test/bug556646.c' --- Test/bug556646.c 1970-01-01 00:00:00 +0000 +++ Test/bug556646.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,42 @@ +/* +Bugs item #556646, was opened at 2002-05-16 14:36 +You can respond by visiting: +http://sourceforge.net/tracker/?func=detail&atid=106556&aid=556646&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Howard Wu (howardhbwu) +Assigned to: Nobody/Anonymous (nobody) +Summary: Some typedef can not be tagged in C code + +Initial Comment: +My Ctags version: 5.2.3 +*/ +typedef enum{ + INDX_NIL = 0x00, + INDX_P, + INDX_S, + INDX_M, + INDX_S1, + INDX_S2, + INDX_S3, + INDX_C1, + INDX_C2, + INDX_S4, + INDX_T, + INDX_L, + INDX_R, + INDX_R2, + INDX_IM1, + INDX_IM2, + INDX_L2, + INDX_T2, + A = INDX_T2 +} task_indx_type; + +/* +"task_indx_type" can not be tagged with Ctags +*/ === added file 'Test/bug565813.f90' --- Test/bug565813.f90 1970-01-01 00:00:00 +0000 +++ Test/bug565813.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,42 @@ +module ctags_bug + + implicit none + private + save + + type :: foo_t + integer :: bar + end type foo_t + + integer, parameter :: N = 1000 + + public :: foo_t + public :: foo_setbar + public :: foo_set_bar + public :: foo_getbar + +contains + + subroutine foo_setbar (f,b) + type(foo_t), intent(out) :: f + integer, intent(in) :: b + + f%bar = b + end subroutine foo_setbar + + + pure subroutine foo_set_bar (f,b) + type(foo_t), intent(out) :: f + integer, intent(in) :: b + + f%bar = b + end subroutine foo_set_bar + + + integer function foo_getbar (f) + type(foo_t), intent(in) :: f + + foo_getbar = f%bar + end function foo_getbar + +end module ctags_bug === added file 'Test/bug612019.pas' --- Test/bug612019.pas 1970-01-01 00:00:00 +0000 +++ Test/bug612019.pas 2011-03-11 21:16:06 +0000 @@ -0,0 +1,33 @@ +(* +Bugs item #612019, was opened at 2002-09-20 15:29 +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=612019&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Konstantin Stupnik (xecutor) +Assigned to: Nobody/Anonymous (nobody) +Summary: pascal parser + +Initial Comment: +In attached sample there are some lines from tags file +generated for object pascal sources. +There are some problems with this lines. +Generaly speaking they are parsed incorrectly. +*) +unit a; + +interface +type + TTest=class + procedure Test1; + procedure Test2; + procedure Test3; + end; + +implementation + +end. === added file 'Test/bug612621.pl' --- Test/bug612621.pl 1970-01-01 00:00:00 +0000 +++ Test/bug612621.pl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,57 @@ +=pod +Bugs item #612621, was opened at 2002-09-21 21:23 +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=612621&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Richard Donkin (rdonkin) +Assigned to: Nobody/Anonymous (nobody) +Summary: Perl POD syntax -> incomplete tags file + +Initial Comment: +In the following test file, ctags 5.2.3 (compiled from +source on Cygwin) only adds the first subroutine (bar) to +the tags file, when run using: + +ctags --totals -- +language-force=perl temp + +----------------- +=cut +sub bar() +{ + + print "blah\n"; + +=for + print "blah2\n"; + # +Note: next line has trailing space +=cut + + +} + +sub foo { + print "hello\n"; +} +=pod +The +tags file looks like +this: +!_TAG_FILE_FORMAT 2 /extended format; -- format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.2.3 // +bar temp /^sub bar() {$/;" s + +The workaround is to delete the +trailing space at the end of the '=cut' line. + +=cut === added file 'Test/bug620288.f' --- Test/bug620288.f 1970-01-01 00:00:00 +0000 +++ Test/bug620288.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,98 @@ +C Bugs item #620288, was opened at 2002-10-08 08:15 +C You can respond by visiting: +C https://sourceforge.net/tracker/?func=detail&atid=106556&aid=620288&group_id=6556 +C +C Category: None +C Group: None +C Status: Open +C Resolution: None +C Priority: 5 +C Submitted By: Nobody/Anonymous (nobody) +C Assigned to: Nobody/Anonymous (nobody) +C Summary: fortran function definition +C +C Initial Comment: +C +C System Information: +C -------------- +C ctags version: +C Exuberant Ctags 5.3.1, Copyright (C) 1996-2002 Darren +C Hiebert +C Compiled: Sep 12 2002, 10:22:42 +C Addresses: , +C http://ctags.sourceforge.net +C Optional compiled features: +wildcards, +regex +C +C Unix: +C HP-UX B.11.00 A 9000/800 551726527 +C -------------- +C +C Symptoms: +C -------------- +C I have a fortran file that has a single function. This +C function has a +C return type of double precision. I type $ctags bar.f . +C This produces the expected +C tags file. However, tags does not contain the function +C definition. +C +C This does not occur when the same function's return +C type has been changed to +C a integer or character data return type. +C -------------- +C +C +C Examples in which I can repeat the experience with their +C respective tags files: +C -------------- +C +C +C foo.f +C -------------- + integer function foo(a) + + integer a + foo = a + end +C -------------- +C +C +C tags +C -------------- +C !_TAG_FILE_FORMAT 2 /extended +C format; --format=1 will not append ;" to lines/ +C !_TAG_FILE_SORTED 1 +C /0=unsorted, 1=sorted, 2=foldcase/ +C !_TAG_PROGRAM_AUTHOR Darren Hiebert +C /dhiebert@users.sourceforge.net/ +C !_TAG_PROGRAM_NAME Exuberant Ctags // +C !_TAG_PROGRAM_URL +C http://ctags.sourceforge.net /official site/ +C !_TAG_PROGRAM_VERSION 5.3.1 // +C foo foo.f /^ integer function foo(/;" f +C -------------- +C +C +C +C bar.f +C --------------- + double precision function bar(a) + + double precision a + bar = a + end +C -------------- +C +C tags +C --------------- +C !_TAG_FILE_FORMAT 2 /extended +C format; --format=1 will not append ;" to lines/ +C !_TAG_FILE_SORTED 1 +C /0=unsorted, 1=sorted, 2=foldcase/ +C !_TAG_PROGRAM_AUTHOR Darren Hiebert +C /dhiebert@users.sourceforge.net/ +C !_TAG_PROGRAM_NAME Exuberant Ctags // +C !_TAG_PROGRAM_URL +C http://ctags.sourceforge.net /official site/ +C !_TAG_PROGRAM_VERSION 5.3.1 // +C --------------- === added file 'Test/bug629115.sql' --- Test/bug629115.sql 1970-01-01 00:00:00 +0000 +++ Test/bug629115.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +/***/ +DECLARE + variable CLOB; +BEGIN +END; === added file 'Test/bug639639.h' --- Test/bug639639.h 1970-01-01 00:00:00 +0000 +++ Test/bug639639.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,46 @@ +/* +Date: Sun, 17 Nov 2002 04:41:42 -0800 +Subject: [ ctags-Bugs-639639 ] incorrect enum field for C++ header + +Bugs item #639639, was opened at 2002-11-17 13:41 +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=639639&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Matthias S. Benkmann (mbenkmann) +Assigned to: Nobody/Anonymous (nobody) +Summary: incorrect enum field for C++ header + +Initial Comment: +----------- temp2.h ------------- +*/ +namespace Namespace1 +{ + int function2(char* str); +} + +enum {anon2=1000}; +---------------------------- +/* +> ctags --excmd=number --fields=+kKmnsSz +--file-scope=no -f - temp2.h + +Namespace1 temp2.h 1;" kind:namespace line:1 +anon2 temp2.h 6;" kind:enumerator line:6 +enum:Namespace1 + + +As you can see ctags thinks that anon2 belongs to enum +Namespace1 which it obviously doesn't (Namespace1 is +not even an enum). It should be enum:. + + +---------------------------------------------------------------------- + +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=639639&group_id=6556 +*/ === added file 'Test/bug639644.h' --- Test/bug639644.h 1970-01-01 00:00:00 +0000 +++ Test/bug639644.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,41 @@ +/* +Date: Sun, 17 Nov 2002 04:57:43 -0800 +Subject: [ ctags-Bugs-639644 ] anonymous namespaces in headers + +Bugs item #639644, was opened at 2002-11-17 13:57 +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=639644&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Matthias S. Benkmann (mbenkmann) +Assigned to: Nobody/Anonymous (nobody) +Summary: anonymous namespaces in headers + +Initial Comment: +--------------------temp3.h---------------- +*/ +namespace +{ + int foo; +} +/* +--------------------------------------------- + +> ctags -f - temp3.h + +foo temp3.h /^ int foo;$/;" m namespace: + +That last field should be "namespace:" +and the kind field should be variable, not member. + + + +---------------------------------------------------------------------- + +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=639644&group_id=6556 +*/ === added file 'Test/bug665086.cpp' --- Test/bug665086.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug665086.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,32 @@ +/* +Bugs item #665086, was opened at 2003-01-09 15:30 +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=665086&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Welti Marco (cider101) +Assigned to: Nobody/Anonymous (nobody) +Summary: nested namespaces + +Initial Comment: +hi + +it seems that ctags has ommits the scope for nested +namespaces. +*/ +namespace N1 +{ + namespace N2 + { + class C12{} + } +} +/* +N1 test.h /^namespace N1$/;" namespace line:1 +N2 test.h /^namespace N2$/;" namespace line:3 +C12 test.h /^ class C12{};$/;" class line:5 namespace:N1::N2 +*/ === added file 'Test/bug670433.f90' --- Test/bug670433.f90 1970-01-01 00:00:00 +0000 +++ Test/bug670433.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,40 @@ +! Bugs item #670443, was opened at 2003-01-18 22:44 +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=670443&group_id=6556 +! +! Category: None +! Group: None +! Status: Open +! Resolution: None +! Priority: 5 +! Submitted By: Erik Edelmann (fanerier) +! Assigned to: Nobody/Anonymous (nobody) +! Summary: Fortran: Internal procedures causes trouble +! +! Initial Comment: +! If a function in a module has an internal procedure +! (after a CONTAINS-statement), everything in the module +! after the parent function will be skipped. I.e. in the +! attached file, the subroutine 'bar' will not be listed +! in the 'tags' file. Note that this problem arises only +! when the parent procedure is a function, if it is a +! subroutine everything works fine. + +module foobar + +contains + + integer function foo (i) + + contains + + real function f(x) + end function f + + end function foo + + + subroutine bar (n) + end subroutine bar + +end module foobar === added file 'Test/bug681824.php' --- Test/bug681824.php 1970-01-01 00:00:00 +0000 +++ Test/bug681824.php 2011-03-11 21:16:06 +0000 @@ -0,0 +1,31 @@ +// Bugs item #681824, was opened at 2003-02-06 18:14 +// You can respond by visiting: +// https://sourceforge.net/tracker/?func=detail&atid=106556&aid=681824&group_id=6556 +// +// Category: None +// Group: None +// Status: Open +// Resolution: None +// Priority: 5 +// Submitted By: Thomi Dammann (thomi35) +// Assigned to: Nobody/Anonymous (nobody) +// Summary: Comments disturb ctags (v. 5.4) scaning a PHP-file? +// +// Initial Comment: +// If I have (correct) statements like +// + function db_query + ($pDB, // connection handle + $pQuery) // query string + { +... +} +// +// it seems that ctags used with vim doesn't find the +// function names anymore. I think that either the +// comments or the distribution on more than one line +// disturb the parser. +// +// Regards +// +// Thomi === added file 'Test/bug699171.py' --- Test/bug699171.py 1970-01-01 00:00:00 +0000 +++ Test/bug699171.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +# Test for Bug #699171. +# Extracted from http://txt2tags.sourceforge.net/src/txt2tags-1.4.tar.gz + +HEADER_TEMPLATE = { +r"""Multiline raw string +""" +} +def Quit(msg, exitcode=0): print msg ; sys.exit(exitcode) === added file 'Test/bug722501.sql' --- Test/bug722501.sql 1970-01-01 00:00:00 +0000 +++ Test/bug722501.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,24 @@ +/* +The PL/SQL parser (v1.6) does not parse a standalone +procedure or function (i.e., not part of a package) when +the SQL is in the form +*/ +CREATE OR REPLACE PROCEDURE foo +AS /* or IS*/ + BEGIN + DECLARE + l_foo NUMBER; + BEGIN + l_foo := 1; + END; + END; +/* +When this is processed the only tag reported is +Procedure foo. If you remove the line with AS, the +variable l_foo is seen, but then the procedure will not +compile in Oracle. + +Functions seem to have similar problems in that the +parser will not see inside the function, but removing the +IS or AS does not remedy the problem for a function. +*/ === added file 'Test/bug726712.f90' --- Test/bug726712.f90 1970-01-01 00:00:00 +0000 +++ Test/bug726712.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,72 @@ +! Bugs item #726712, was opened at 2003-04-24 08:36 +! Message generated for change (Comment added) made by schubidu +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=726712&group_id=6556 +! +! Category: None +! Group: None +! Status: Open +! Resolution: None +! Priority: 5 +! Submitted By: sandra schrödter (schubidu) +! Assigned to: Darren Hiebert (dhiebert) +! Summary: ctags 5.5 and f90: "endsubroutine" not recognized +! +! Initial Comment: +! Dear Ctags'ers. :) +! +! First of all: good tool! :) I stumbled across ctags for +! my gvim6, wanted to use the nice plugin taglist. +! +! My System: HP-Unix and ctags 5.5 +! +! My problem is the following. The command: +! +! "ctags tagstest.f90" +! +! builds a tagsfile that lacks 1 of the declared 3 +! subroutines. +! The problem disappears when the declaration of the +! subroutine ends in "end subroutine" and not in +! "endsubroutine", although "endsubroutine" is correct +! Fortran90 syntax, AFAIK. +! +! Is there a chance to get this corrected? +! +! +! The example file tagstest.f90: + + subroutine tagstest_ctrl() + real :: a + a = 0.0 + call sub1( a) + call sub2( a) + endsubroutine tagstest_ctrl + + subroutine sub1( a) + real,intent( inout) ::a + a = 1.1 + endsubroutine sub1 + + subroutine sub2( a) + real,intent( inout) ::a + a = 2.2 + endsubroutine sub2 + +! ---------------------------------------------------------------------- +! +! Comment By: sandra schrödter (schubidu) +! Date: 2003-05-28 13:17 +! +! Message: +! Logged In: YES +! user_id=763447 +! +! I realized that there are also problems when a subroutine +! ends only with the keyword +! end +! +! The following subroutine is listed but cannot be selected +! (that is, the cursor wont go there) +! +! ---------------------------------------------------------------------- === added file 'Test/bug726875.f90' --- Test/bug726875.f90 1970-01-01 00:00:00 +0000 +++ Test/bug726875.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,28 @@ +! Bugs item #726875, was opened at 2003-04-24 15:30 +! Message generated for change (Tracker Item Submitted) made by Item Submitter +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=726875&group_id=6556 +! +! Category: None +! Group: None +! Status: Open +! Resolution: None +! Priority: 5 +! Submitted By: sandra schrödter (schubidu) +! Assigned to: Nobody/Anonymous (nobody) +! Summary: ctags 5.5 and f90: common and ! +! +! Initial Comment: +! ctags won't add a common-block definition to the tags +! file when the following occurs: + + common /coma/ a,b,!foobar + + c,d + + common /comb/ e,f + + common /comc/ g,h + +! The problem seems to be based on the fact that the +! comment "! foobar" is followed by a continuation line +! ("+" in column 6 shows that) === added file 'Test/bug734933.f90' --- Test/bug734933.f90 1970-01-01 00:00:00 +0000 +++ Test/bug734933.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,39 @@ + MODULE MDCOMPONENTS + + USE kindef + USE memory + + IMPLICIT NONE + + SAVE + + INTEGER (INT4), PARAMETER :: LIM_COMPONENTS = 1000; + INTEGER (INT4) :: NUM_COMPONENTS = 0, NCOMP; + TYPE COMPONENT + CHARACTER (LEN=30) :: NAME + INTEGER (INT4) :: NUM_PART + REAL (REAL8), DIMENSION(:), POINTER :: PART_LIST + END TYPE + + TYPE COMPONENT_POINTER + TYPE (COMPONENT), POINTER :: P + END TYPE + + TYPE (COMPONENT), POINTER :: COMP + TYPE (COMPONENT_POINTER) :: COMP_TMP + TYPE (COMPONENT_POINTER), DIMENSION(LIM_COMPONENTS) :: COMPONENTS, COMPONENTS_TMP + + INTERFACE MEMDEALLOC + MODULE PROCEDURE MEMDEALLOC_COMPONENTS_PTR + END INTERFACE + + CONTAINS + + SUBROUTINE ADD_COMPONENTS + + NUM_COMPONENTS = NUM_COMPONENTS + 1 + CALL MEMALLOC (COMPONENTS(NUM_COMPONENTS)%P, IDALL999) + + END SUBROUTINE ADD_COMPONENTS + + END MODULE MDCOMPONENTS === added file 'Test/bug762027.v' --- Test/bug762027.v 1970-01-01 00:00:00 +0000 +++ Test/bug762027.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,27 @@ +/* +Bugs item #762027, was opened at 2003-06-27 18:32 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=762027&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: cdic (cdic) +Assigned to: Nobody/Anonymous (nobody) +Summary: multi-line definition w/o back-slash will be missing + +Initial Comment: +There is a small bug (language verilog): +*/ + wire N_84, N_83; // is ok. + + wire N_84, + N_83; // then N_83 will be missing in tags. +/* +Thanks for fixing it. + +cdic +*/ === added file 'Test/bug814263.java' --- Test/bug814263.java 1970-01-01 00:00:00 +0000 +++ Test/bug814263.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +import java.util.Map; + +public class bug814263 { + protected java.util.Map map1; + protected Map map2; +} === added file 'Test/bug816636.sml' --- Test/bug816636.sml 1970-01-01 00:00:00 +0000 +++ Test/bug816636.sml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,26 @@ +(* +Bugs item #816636, was opened at 2003-10-02 11:01 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=816636&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Rahul Chaudhry (rahuldotc) +Assigned to: Nobody/Anonymous (nobody) +Summary: sml (standard ML) tag support + +Initial Comment: +The program does not handle the "and" keyword of ML. + +e.g. on the following code: +*) +fun f x = 1 + g x + +and g x = 2 + f 0; +(* +ctags generates a tag for function "f" but not for function "g". +*) === added file 'Test/bug823000.sql' --- Test/bug823000.sql 1970-01-01 00:00:00 +0000 +++ Test/bug823000.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,80 @@ +/* +Bugs item #823000, was opened at 2003-10-13 21:56 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=823000&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Jozsef Nagy (brutal) +Assigned to: Nobody/Anonymous (nobody) +Summary: PL/SQL functions and procedures + +Initial Comment: +I've tried to use ctags (version 5.5.2) to navigate +PL/SQL source codes in vim but jumping to +function/procedure definitions worked not properly. I +figured out that the problem was that I've defined +these functions/procedures in multiline format, for +example: + +test.pkb: +*/ +CREATE OR REPLACE PACKAGE TEST IS + +PROCEDURE TestFunc1 +( + arg1 IN NUMBER, + arg2 IN NUMBER +) +IS +BEGIN + NULL; +END TestFunc1; + +PROCEDURE TestFunc2 +( + arg1 IN NUMBER, + arg2 IN NUMBER +) +IS +BEGIN + NULL; +END TestFunc2; + +END TEST; +/ +/* +ctags creates a regexp type pattern for my +functions/procedures but unfortunately the pattern was +/^IS$/ for each function/procedure, that's why the +jumping method worked really crappy. (see the output of +ctags 5.5.2 on this example code below) + +ctags -f - --language-force=sql test.pkb +TEST test.pkb /^CREATE OR REPLACE PACKAGE +TEST IS$/;" P +TestFunc1 test.pkb /^IS$/;" p +TestFunc2 test.pkb /^IS$/;" p + +I've looked into the ctags source code and I saw that +in parseSubProgram() in sql.c called makeSqlTag() only +when KEYWORD_is reached. I have modified this function + so that makeSqlTag() is called immediately after a +function/procedure keyword and name is read (I have +attached the output of diff sql.c.5.5.2 sql.c). I don't +know much of ctags internals so I am not sure if this +is the best solution but it worked for me. (see the +output of my modified ctags below) + +ctags -f - --language-force=sql test.pkb +TEST test.pkb /^CREATE OR REPLACE PACKAGE +TEST IS$/;" P +TestFunc1 test.pkb /^PROCEDURE +TestFunc1$/;" p +TestFunc2 test.pkb /^PROCEDURE +TestFunc2$/;" p +*/ === added file 'Test/bug842077.pl' --- Test/bug842077.pl 1970-01-01 00:00:00 +0000 +++ Test/bug842077.pl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,33 @@ +# Bugs item #842077, was opened at 2003-11-14 10:57 +# Message generated for change (Tracker Item Submitted) made by Item Submitter +# You can respond by visiting: +# https://sourceforge.net/tracker/?func=detail&atid=106556&aid=842077&group_id=6556 + +# Category: None +# Group: None +# Status: Open +# Resolution: None +# Priority: 5 +# Submitted By: Christian Reis (kiko_async) +# Assigned to: Nobody/Anonymous (nobody) +# Summary: wrong precedence applied to perl POD and "here document" + +# Initial Comment: +# Basically, ctags stops parsing when it reaches code +# with the syntax below: + +# ... +$this->print_log(<::Foo() +{ + exit(0); +}; +/* +Generates erroneous tag +ParamClass1 test.cpp /^void MainClass< ParamClass1&, ParamClass2>::Foo()$/;" v + +Full ctags file: +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.5.2 // +Foo test.cpp /^void MainClass< const ParamClass1&, ParamClass2>::Foo()$/;" f class:ParamClass2 +ParamClass1 test.cpp /^void MainClass< ParamClass1&, ParamClass2>::Foo()$/;" v + +----- + +Removing space after first angle bracket: +*/ +void MainClass::Foo() +{ + exit(0); +}; +/* +makes ctags to drop first letter from parameter class +name: + +aramClass1 test.cpp /^void MainClass::Foo()$/;" v + + +Let me know if you need any clarification with this issue. +Many thanks in advance! +*/ === added file 'Test/bug852368.cpp' --- Test/bug852368.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug852368.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,34 @@ +/* +Bugs item #852368, was opened at 2003-12-01 23:20 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=852368&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Welti Marco (cider101) +Assigned to: Nobody/Anonymous (nobody) +Summary: c/c++ unabalanced template brackets in signature + +Initial Comment: +hi, + +ctags 5.5x generates unbalanced tempalte brackets in +the method/function signature if a funtion parameter +is a template. + +i.e. +*/ +void foo(std::vector &); +/* +generates the following signature +signature:void (std::vector<&) + +let me know if you need more details. + +regards +cider +*/ === added file 'Test/bug858165.f90' --- Test/bug858165.f90 1970-01-01 00:00:00 +0000 +++ Test/bug858165.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,25 @@ +! Bugs item #858165, was opened at 2003-12-11 10:09 +! Message generated for change (Tracker Item Submitted) made by Item Submitter +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=858165&group_id=6556 +! +! Category: None +! Group: None +! Status: Open +! Resolution: None +! Priority: 5 +! Submitted By: Blazej Krzeminski (blazk) +! Assigned to: Nobody/Anonymous (nobody) +! Summary: Fortran90: comment line after continuation character & +! +! Initial Comment: +program test + +integer :: a, & !comment on variable a + b, & !comment on variable b + !more comment on variable b, CTAGS STOPS HERE + c, & !comment on variable c + d !comment on variable d +end program test + +! ctags will index program test, a,b but not c,d === added file 'Test/bug872494.cpp' --- Test/bug872494.cpp 1970-01-01 00:00:00 +0000 +++ Test/bug872494.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,43 @@ +/* +Bugs item #872494, was opened at 2004-01-07 16:33 +Message generated for change (Tracker Item Submitted) made by Item Submitter +You can respond by visiting: +https://sourceforge.net/tracker/?func=detail&atid=106556&aid=872494&group_id=6556 + +Category: None +Group: None +Status: Open +Resolution: None +Priority: 5 +Submitted By: Igor Proskuriakov (proskig) +Assigned to: Nobody/Anonymous (nobody) +Summary: C++ class template specialization + +Initial Comment: +Hi, +some time ago I posted a bug related to C++ member +template, which was fixed using patch bug849591.diff. +Many thanks - it really fixed the problem ! +Now about a different one. +When parsing C++ file ctags seems to ignore template +specialization, but I think that it maybe useful to add it +as a configurable feature. Another problem is that +template specialization seems to confuse patched +version of ctags (patch bug849591.diff). When running a +patched version against the following file +*/ +template class TemplClass { double i;}; + +template<> class TemplClass< char* > { int i;}; + +class FooClass2{}; +/* +it does not generate tag for FooClass2 while ctags 5.5.2 +does generate tag for FooClass2. Neither of them +generate tag for specialization TemplClass. + +thanks in advance and let me know should you need +more info! + +Igor +*/ === added file 'Test/bug877956.f90' --- Test/bug877956.f90 1970-01-01 00:00:00 +0000 +++ Test/bug877956.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,54 @@ +! Bugs item #877956, was opened at 2004-01-15 17:59 +! Message generated for change (Tracker Item Submitted) made by Item Submitter +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=877956&group_id=6556 +! +! Category: None +! Group: None +! Status: Open +! Resolution: None +! Priority: 5 +! Submitted By: Randy Hood (randy762) +! Assigned to: Nobody/Anonymous (nobody) +! Summary: Broken Fortran variable listing after =-1 +! +! Initial Comment: +! When I run ctags v5.5.2 on Redhat Linux 9 with the command +! +! ctags --Fortran-kinds=v -x test.f90 +! +! where test.f90 is +! ---------------------------------- +PROGRAM test + + IMPLICIT NONE + INTEGER :: cm1 =-1, c2 = 2 + +END PROGRAM test +! ------------------------------------- +! +! I only get this one line of output +! +! cm1 variable 4 test.f90 INTEGER :: cm1 =-1, c2 = 2 +! +! If I change one line of test.f90 so that it is now +! ---------------------------------------- +PROGRAM test + + IMPLICIT NONE + INTEGER :: cm1 = -1, c2 = 2 + +END PROGRAM test +! ----------------------------------------- +! and run the command +! +! ctags --Fortran-kinds=v -x test.f90 +! +! I get this correct output +! +! c2 variable 4 test.f90 INTEGER :: cm1 = -1, c2 = 2 +! cm1 variable 4 test.f90 INTEGER :: cm1 = -1, c2 = 2 +! +! ---------------------------------------------------------------------- +! You can respond by visiting: +! https://sourceforge.net/tracker/?func=detail&atid=106556&aid=877956&group_id=6556 === added file 'Test/bug960316.v' --- Test/bug960316.v 1970-01-01 00:00:00 +0000 +++ Test/bug960316.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,53 @@ +/************************************************************************** +**** +* test task one +* the line below has 53 asteriks +*****************************************************/ +task pass_task_1; +begin +end +endtask + +/************************************************************************** +**** +* test task one +* the line below has 54 asteriks +******************************************************/ +task fail_task_2; +begin +end +endtask + +/************************************************************************** +**** +* test function one +* the line below has 53 asteriks +*****************************************************/ +function pass_func_1; +begin +end +endfunction + +/************************************************************************** +**** +* test function two +* the line below has 54 asteriks +******************************************************/ +function fail_func_2; +begin +end +endfunction + +/************************************************************************** +**** +* test function one +* the line below has 53 asteriks +*****************************************************/ +`define pass_define_1 1'b1; + +/************************************************************************** +**** +* test function two +* the line below has 54 asteriks +******************************************************/ +`define fail_define_2 1'b1; === added file 'Test/bug961001.v' --- Test/bug961001.v 1970-01-01 00:00:00 +0000 +++ Test/bug961001.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,26 @@ +/* + * In Verilog, the following two lines are both valid syntax: + * + * `define GUEST + * `define GUEST + * + * The first defines "GUEST" as existing, but with no assigned + * value. The second defines "GUEST" as existing with an + * assigned value. Ctags55 correctly handles both cases, but + * Ctags551 - Ctags554 only handles the `define with value + * correctly. Here is some test code to demonstrate this: + */ +`define HOSTA +`define HOSTB +`define HOSTC +`define HOSTD + +`define GUESTA 1 +`define GUESTB 2 +`define GUESTC 3 +`define GUESTD 4 +/* + * Ctags55 correctly generates a tag for all `defines in the + * code, but Ctags554 does not generate tags for "HOSTB" + * or "HOSTD". + */ === added file 'Test/build.xml' --- Test/build.xml 1970-01-01 00:00:00 +0000 +++ Test/build.xml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === added file 'Test/byte.f' --- Test/byte.f 1970-01-01 00:00:00 +0000 +++ Test/byte.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +! Provided by Brian Helsinki, 7 March 2003 + program byte_test + BYTE A, B, C + BYTE A1, B1, C1(10) + BYTE A2 /'x'/, B2 /255/, C2(10) + END + === added file 'Test/char-selector.f90' --- Test/char-selector.f90 1970-01-01 00:00:00 +0000 +++ Test/char-selector.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,19 @@ +! Test for bug in parsing of char-selector + MODULE OUT_RD5 + USE inmdmx + IMPLICIT NONE + SAVE + + CHARACTER*(MXPATHLNGTH) temp + PRIVATE :: temp + INTEGER(4), PRIVATE, PARAMETER :: MXDDI=45 + CHARACTER*40 titles(MXDDI) + PRIVATE :: titles + CHARACTER*12 units(MXDDI) + PRIVATE :: units + INTEGER(4), PRIVATE, DIMENSION (MXDDI+1) :: list + CHARACTER(1024) :: fpshape + INTEGER(4), PRIVATE :: nout + CHARACTER*(1024) :: fpshape2 + INTEGER(4), PRIVATE :: last + END MODULE OUT_RD5 === added file 'Test/class.e' --- Test/class.e 1970-01-01 00:00:00 +0000 +++ Test/class.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,72 @@ +indexing + + description: "Try everything" + +deferred class UBER_CLASS [G -> CONSTRAINT] obsolete "message" + +inherit + + ANY + rename + generator as my_generator, + generating_type as my_generating_type, + infix "/" as infix "//" + export + {NONE} my_generator, my_generating_type; + {ANY} same_type + undefine + is_equal + redefine + conforms_to + select + consitent + end + + LINKED_LIST [G] + export {NONE} + all + end + +creation + + make, make2 + +create {SOMETHING} + + make3 + +feature -- Initialization + + make is + do + end + + make2 is + do + end + + make3 is + do + end + +feature {ANY, NONE} -- Feature clause comment + + procedure_full is + require else + local + do + ensure then + rescue + end + + guard: INTEGER + +invariant + + invariant: condition + +indexing + + license: "May not be used for any purpose" + +end === added file 'Test/common.f' --- Test/common.f 1970-01-01 00:00:00 +0000 +++ Test/common.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ + PROGRAM main + COMMON /common1/ c1a, c1b + COMMON /common2/ c2a (1:3), c2b /common3/ c3a, c3b + END === added file 'Test/complex_decl.c' --- Test/complex_decl.c 1970-01-01 00:00:00 +0000 +++ Test/complex_decl.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +/* Complex declarations */ +static void (* const(ScanAction[5][5]))(void *)= {}; === added file 'Test/continuation.f90' --- Test/continuation.f90 1970-01-01 00:00:00 +0000 +++ Test/continuation.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +! Problem reported by Jim on 7 Jul 2002 +module test +real*8 :: & +para_a, & ! para_a is ... +para_b, & ! para_b is ... +para_c ! para_c is ... === added file 'Test/countall.sql' --- Test/countall.sql 1970-01-01 00:00:00 +0000 +++ Test/countall.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,43 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/countall.txt +rem Filename: countall.sql +rem Purpose: Count the number of rows for ALL tables in current schema +rem using PL/SQL +rem Date: 15-Apr-2000 +rem Author: Eberhardt, Roberto (Bolton) (reberhar@husky.ca) +rem ----------------------------------------------------------------------- + +set serveroutput on size 1000000 + +DECLARE + t_c1_tname user_tables.table_name%TYPE; + t_command varchar2(200); + t_cid integer; + t_total_records number(10); + stat integer; + row_count integer; + t_limit integer := 0; -- Only show tables with more rows + cursor c1 is select table_name from user_tables order by table_name; +BEGIN + t_limit := 0; + open c1; + loop + fetch c1 into t_c1_tname; + exit when c1%NOTFOUND; + t_command := 'SELECT COUNT(0) FROM '||t_c1_tname; + t_cid := DBMS_SQL.OPEN_CURSOR; + DBMS_SQL.PARSE(t_cid,t_command,dbms_sql.native); + DBMS_SQL.DEFINE_COLUMN(t_cid,1,t_total_records); + stat := DBMS_SQL.EXECUTE(t_cid); + row_count := DBMS_SQL.FETCH_ROWS(t_cid); + DBMS_SQL.COLUMN_VALUE(t_cid,1,t_total_records); + if t_total_records > t_limit then + DBMS_OUTPUT.PUT_LINE(rpad(t_c1_tname,55,' ')|| + to_char(t_total_records,'99999999')||' record(s)'); + + end if; + DBMS_SQL.CLOSE_CURSOR(t_cid); + end loop; + close c1; +END; +/ === added file 'Test/cpp_destructor.cpp' --- Test/cpp_destructor.cpp 1970-01-01 00:00:00 +0000 +++ Test/cpp_destructor.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +A::~A() { } + +B:: ~B () { } + +// bug 1585745 +C:: ~ C () { } === added file 'Test/cython_sample.pyx' --- Test/cython_sample.pyx 1970-01-01 00:00:00 +0000 +++ Test/cython_sample.pyx 2011-03-11 21:16:06 +0000 @@ -0,0 +1,46 @@ +# -*- cython-mode -*- +# test code for python/cython functionality + +python_var = 1 + +cdef int i = 2 # cython identifiers are not indexed +cdef : + int j = 3 +cdef k = 4 # no type here + +cdef int int_identity(int i) : return i + +# here is a long one +cdef object int2string(int i) : + return str(i) + +# a cdef class +cdef class CDefClass : + def __init__(self) : + pass + def standard_method(self,i) : + return i + cdef int c_method(self,int i) : + return i + +# a python function +def identity(x) : + return x + +# a python class +class StdClass : + def return_me(self) : + return "me" + +cdef CDefClass cdefObj = CDefClass() +stdObj = StdClass() + +print "cython_sample: testing to make sure this file compiles and runs..." +print "i is: ", i +print "j is: ", j +print "i via identity: ", int_identity(i) +print "i via int2string: ", int2string(i) +print "cdefObj: ", cdefObj.c_method(i) +print "k via py identity", identity(k) +print "py method call:", stdObj.return_me() + === added file 'Test/db-trig.sql' --- Test/db-trig.sql 1970-01-01 00:00:00 +0000 +++ Test/db-trig.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,31 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/db-trig.txt +rem Filename: db-trig.sql +rem Purpose: Demonstrate database triggers (available from Oracle 8i) +rem Need DBA or CREATE ANY TRIGGER privs +rem Date: 28-Aug-1998 +rem Author: Frank Naude (frank@ibi.co.za) +rem ----------------------------------------------------------------------- + +create or replace trigger restrict_login + after logon on database +declare + flag number := 0; +begin + select 1 into flag from sys.v_$session where program like '%sqlplus%'; + if flag = 1 then + raise_application_error(-20000, 'No access from sqlplus'); + end if; +end; +/ +show errors + + +CREATE OR REPLACE TRIGGER startup_db +after startup on database +begin + dbms_shared_pool.keep ('SYS.STANDARD','P'); + dbms_shared_pool.keep ('SYS.DBMS_STANDARD','P'); +end; +/ +show errors === added file 'Test/debian_432872.f90' --- Test/debian_432872.f90 1970-01-01 00:00:00 +0000 +++ Test/debian_432872.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +! { dg-do compile } +! PR18923 segfault after subroutine name confusion. +module FOO +contains + subroutine FOO ! { dg-error "conflicts with PROCEDURE" } + character(len=selected_int_kind(0)) :: C ! { dg-error "data declaration statement" } + end subroutine ! { dg-error "Expecting END MODULE statement" } +end ! { dg-warning "CONTAINS statement without FUNCTION" } \ No newline at end of file === added file 'Test/directives.c' --- Test/directives.c 1970-01-01 00:00:00 +0000 +++ Test/directives.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,69 @@ +/* Test simple cases */ +#define VARIABLE_LIKE some_value +#define FUNCTION_LIKE(a,b) (a + b) +#pragma weak WeakSymbol = StrongSymbol + +#define with_long_comment /* line 1 + line 2 */ + +/* Test usual case */ +#ifdef MY_MACRO +# define MACRO_TO_SEE1 1 +int a; +#elif YOUR_MACRO +# define MACRO_TO_SEE2 2 +int b; +#elif defined (THEIR_MACRO) +# define MACRO_TO_SEE3 3 +int c; +#else +# define MACRO_TO_SEE4 4 +int d; +#endif + +/* Test commented-out case */ +#if 0 +#define IGNORE_MACRO +int e; +# if 0 +# define ANOTHER_IGNORE_MACRO +int f; +# else +# define YAIM +# endif +#else +# define SEE_THIS_MACRO 1 +int g; +#endif + +/* Test path selection algorithm */ +#ifdef OK +#define PATH1 +int foo1 (void) +{ +#elif defined (OK) +#define PATH2 +int foo2 (void) +{ +#else +#define PATH3 +int foo3 (void) +{ +#endif +} + +int bar1 (void) +{ +#ifdef OK +#define PATH1b +} +int p1; +#elif defined (OK) +#define PATH2b +} +int p2; +#else +#define PATH3b +} +int p3; +#endif === added file 'Test/dopbl2.f' --- Test/dopbl2.f 1970-01-01 00:00:00 +0000 +++ Test/dopbl2.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,227 @@ +! Bug reported by Brian Helinski on 4 Feb 2003 + DOUBLE PRECISION FUNCTION DOPBL2( SUBNAM, M, N, KKL, KKU ) +* +* -- LAPACK timing routine (version 3.0) -- +* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., +* Courant Institute, Argonne National Lab, and Rice University +* June 30, 1999 +* +* .. Scalar Arguments .. + CHARACTER*6 SUBNAM + INTEGER KKL, KKU, M, N +* .. +* +* Purpose +* ======= +* +* DOPBL2 computes an approximation of the number of floating point +* operations used by a subroutine SUBNAM with the given values +* of the parameters M, N, KL, and KU. +* +* This version counts operations for the Level 2 BLAS. +* +* Arguments +* ========= +* +* SUBNAM (input) CHARACTER*6 +* The name of the subroutine. +* +* M (input) INTEGER +* The number of rows of the coefficient matrix. M >= 0. +* +* N (input) INTEGER +* The number of columns of the coefficient matrix. +* If the matrix is square (such as in a solve routine) then +* N is the number of right hand sides. N >= 0. +* +* KKL (input) INTEGER +* The lower band width of the coefficient matrix. +* KL is set to max( 0, min( M-1, KKL ) ). +* +* KKU (input) INTEGER +* The upper band width of the coefficient matrix. +* KU is set to max( 0, min( N-1, KKU ) ). +* +* ===================================================================== +* +* .. Local Scalars .. + CHARACTER C1 + CHARACTER*2 C2 + CHARACTER*3 C3 + DOUBLE PRECISION ADDS, EK, EM, EN, KL, KU, MULTS +* .. +* .. External Functions .. + LOGICAL LSAME, LSAMEN + EXTERNAL LSAME, LSAMEN +* .. +* .. Intrinsic Functions .. + INTRINSIC MAX, MIN +* .. +* .. Executable Statements .. +* +* Quick return if possible +* + IF( M.LE.0 .OR. .NOT.( LSAME( SUBNAM, 'S' ) .OR. LSAME( SUBNAM, + $ 'D' ) .OR. LSAME( SUBNAM, 'C' ) .OR. LSAME( SUBNAM, 'Z' ) ) ) + $ THEN + DOPBL2 = 0 + RETURN + END IF +* + C1 = SUBNAM( 1: 1 ) + C2 = SUBNAM( 2: 3 ) + C3 = SUBNAM( 4: 6 ) + MULTS = 0 + ADDS = 0 + KL = MAX( 0, MIN( M-1, KKL ) ) + KU = MAX( 0, MIN( N-1, KKU ) ) + EM = M + EN = N + EK = KL +* +* ------------------------------- +* Matrix-vector multiply routines +* ------------------------------- +* + IF( LSAMEN( 3, C3, 'MV ' ) ) THEN +* + IF( LSAMEN( 2, C2, 'GE' ) ) THEN +* + MULTS = EM*( EN+1.D0 ) + ADDS = EM*EN +* +* Assume M <= N + KL and KL < M +* N <= M + KU and KU < N +* so that the zero sections are triangles. +* + ELSE IF( LSAMEN( 2, C2, 'GB' ) ) THEN +* + MULTS = EM*( EN+1.D0 ) - ( EM-1.D0-KL )*( EM-KL ) / 2.D0 - + $ ( EN-1.D0-KU )*( EN-KU ) / 2.D0 + ADDS = EM*( EN+1.D0 ) - ( EM-1.D0-KL )*( EM-KL ) / 2.D0 - + $ ( EN-1.D0-KU )*( EN-KU ) / 2.D0 +* + ELSE IF( LSAMEN( 2, C2, 'SY' ) .OR. LSAMEN( 2, C2, 'SP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHP' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) + ADDS = EM*EM +* + ELSE IF( LSAMEN( 2, C2, 'SB' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHB' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHB' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) - ( EM-1.D0-EK )*( EM-EK ) + ADDS = EM*EM - ( EM-1.D0-EK )*( EM-EK ) +* + ELSE IF( LSAMEN( 2, C2, 'TR' ) .OR. LSAMEN( 2, C2, 'TP' ) ) + $ THEN +* + MULTS = EM*( EM+1.D0 ) / 2.D0 + ADDS = ( EM-1.D0 )*EM / 2.D0 +* + ELSE IF( LSAMEN( 2, C2, 'TB' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) / 2.D0 - + $ ( EM-EK-1.D0 )*( EM-EK ) / 2.D0 + ADDS = ( EM-1.D0 )*EM / 2.D0 - + $ ( EM-EK-1.D0 )*( EM-EK ) / 2.D0 +* + END IF +* +* --------------------- +* Matrix solve routines +* --------------------- +* + ELSE IF( LSAMEN( 3, C3, 'SV ' ) ) THEN +* + IF( LSAMEN( 2, C2, 'TR' ) .OR. LSAMEN( 2, C2, 'TP' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) / 2.D0 + ADDS = ( EM-1.D0 )*EM / 2.D0 +* + ELSE IF( LSAMEN( 2, C2, 'TB' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) / 2.D0 - + $ ( EM-EK-1.D0 )*( EM-EK ) / 2.D0 + ADDS = ( EM-1.D0 )*EM / 2.D0 - + $ ( EM-EK-1.D0 )*( EM-EK ) / 2.D0 +* + END IF +* +* ---------------- +* Rank-one updates +* ---------------- +* + ELSE IF( LSAMEN( 3, C3, 'R ' ) ) THEN +* + IF( LSAMEN( 3, SUBNAM, 'SGE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'DGE' ) ) THEN +* + MULTS = EM*EN + MIN( EM, EN ) + ADDS = EM*EN +* + ELSE IF( LSAMEN( 2, C2, 'SY' ) .OR. LSAMEN( 2, C2, 'SP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHP' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) / 2.D0 + EM + ADDS = EM*( EM+1.D0 ) / 2.D0 +* + END IF +* + ELSE IF( LSAMEN( 3, C3, 'RC ' ) .OR. LSAMEN( 3, C3, 'RU ' ) ) THEN +* + IF( LSAMEN( 3, SUBNAM, 'CGE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZGE' ) ) THEN +* + MULTS = EM*EN + MIN( EM, EN ) + ADDS = EM*EN +* + END IF +* +* ---------------- +* Rank-two updates +* ---------------- +* + ELSE IF( LSAMEN( 3, C3, 'R2 ' ) ) THEN + IF( LSAMEN( 2, C2, 'SY' ) .OR. LSAMEN( 2, C2, 'SP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'CHP' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHE' ) .OR. + $ LSAMEN( 3, SUBNAM, 'ZHP' ) ) THEN +* + MULTS = EM*( EM+1.D0 ) + 2.D0*EM + ADDS = EM*( EM+1.D0 ) +* + END IF + END IF +* +* ------------------------------------------------ +* Compute the total number of operations. +* For real and double precision routines, count +* 1 for each multiply and 1 for each add. +* For complex and complex*16 routines, count +* 6 for each multiply and 2 for each add. +* ------------------------------------------------ +* + IF( LSAME( C1, 'S' ) .OR. LSAME( C1, 'D' ) ) THEN +* + DOPBL2 = MULTS + ADDS +* + ELSE +* + DOPBL2 = 6*MULTS + 2*ADDS +* + END IF +* + RETURN +* +* End of DOPBL2 +* + END === added file 'Test/dosbatch_test.cmd' --- Test/dosbatch_test.cmd 1970-01-01 00:00:00 +0000 +++ Test/dosbatch_test.cmd 2011-03-11 21:16:06 +0000 @@ -0,0 +1,86 @@ +@SETLOCAL +@echo off + +SET OPTIONS=%1 +SET SAMPLE_DATA=%1 +if NOT '%SAMPLE_DATA%' EQU '' SET SAMPLE_DATA=1 +if '%SAMPLE_DATA%' EQU '' SET SAMPLE_DATA=0 +@echo. +@echo. +@echo.Sample data:[%SAMPLE_DATA%] +@echo. +@echo. + +@IF NOT DEFINED SCRIPT_DIR FOR /f %%i IN ('cd') DO @SET SCRIPT_DIR=%%i + + +CALL setenv.cmd +@if NOT "%errorlevel%" EQU "0" goto ERROR +IF DEFINED required_software_missing goto ERROR + +set PATH=%SQLANY11%\bin32;%PATH% + +@if "%OPTIONS%." EQU "1." set OPTIONS= +@rem Jump to label if specified +@if NOT "%OPTIONS%." EQU "." goto %OPTIONS% + +CALL cleanup11.cmd + +:UPDATE +@echo. +@echo. +@echo Update objects (triggers, procedures, web services) +@echo. +:SAMPLE_DATA +@echo. +@echo. +@echo Create report +@echo. +cd %SQL_DIR% +@echo on +%DBISQL% -c "dsn=%CONS%;uid=dba;pwd=%CONS_PWD%;autostop=no" read schema_logging.sql; +@echo off +@if NOT "%errorlevel%" EQU "0" goto ERROR +@echo errorlevel [%errorlevel%] + +:DONE +@echo. +@echo. +@echo.------------------------------------------- +@echo All Done! +@echo.------------------------------------------- +@echo. +@echo. +goto END + +:ERROR +FOR /f %%i IN ('cd') DO @SET CURR_DIR=%%i +@echo. +@echo. +@echo.------------------------------------------- +@echo. ERROR!! +@echo errorlevel = %errorlevel% +@echo gendb11.cmd +@echo. +@echo.Working directory: +@echo CURR_DIR=%CURR_DIR% +@echo.------------------------------------------- +@echo. +goto END + +:ERROR_OPTIONS +@echo. +@echo. +@echo. +@echo ******************************************************** +@echo * Please provide dev, qa, demo as a commandline option * +@echo ******************************************************** +@echo. +@echo. +@echo. +GOTO END + + +:END +cd %SCRIPT_DIR% +@ENDLOCAL === added file 'Test/enum.c' --- Test/enum.c 1970-01-01 00:00:00 +0000 +++ Test/enum.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ +enum test_enumeration { + ENUM_1 = 1, + ENUM_2, + ENUM_3 +}; === added file 'Test/enum.java' --- Test/enum.java 1970-01-01 00:00:00 +0000 +++ Test/enum.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,20 @@ +public enum e { + A, // should be 'e', not 'f' + B(), // should be 'e', not 'm' + C(1), // should be 'e', not missing + D, // should be 'e', not 'f' + E(), // should be 'e', not 'm' + F(1), // should be 'e', not missing + ; + + public String string; + public final Shape shape; + public final boolean twoKeywordsInARow; + + public String getString() { + return string; + } + public final Shape getShape() { + return shape; + } +} === added file 'Test/events.cs' --- Test/events.cs 1970-01-01 00:00:00 +0000 +++ Test/events.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,192 @@ +// events1.cs +using System; +namespace MyCollections +{ + using System.Collections; + + // A delegate type for hooking up change notifications. + public delegate void ChangedEventHandler(object sender, EventArgs e); + + // A class that works just like ArrayList, but sends event + // notifications whenever the list changes. + public class ListWithChangedEvent: ArrayList + { + // An event that clients can use to be notified whenever the + // elements of the list change. + public event ChangedEventHandler Changed; + + // Invoke the Changed event; called whenever list changes + protected virtual void OnChanged(EventArgs e) + { + if (Changed != null) + Changed(this, e); + } + + // Override some of the methods that can change the list; + // invoke event after each + public override int Add(object value) + { + int i = base.Add(value); + OnChanged(EventArgs.Empty); + return i; + } + + public override void Clear() + { + base.Clear(); + OnChanged(EventArgs.Empty); + } + + public override object this[int index] + { + set + { + base[index] = value; + OnChanged(EventArgs.Empty); + } + } + } +} + +namespace TestEvents +{ + using MyCollections; + + class EventListener + { + private ListWithChangedEvent List; + + public EventListener(ListWithChangedEvent list) + { + List = list; + // Add "ListChanged" to the Changed event on "List". + List.Changed += new ChangedEventHandler(ListChanged); + } + + // This will be called whenever the list changes. + private void ListChanged(object sender, EventArgs e) + { + Console.WriteLine("This is called when the event fires."); + } + + public void Detach() + { + // Detach the event and delete the list + List.Changed -= new ChangedEventHandler(ListChanged); + List = null; + } + } + + class Test + { + // Test the ListWithChangedEvent class. + public static void Main() + { + // Create a new list. + ListWithChangedEvent list = new ListWithChangedEvent(); + + // Create a class that listens to the list's change event. + EventListener listener = new EventListener(list); + + // Add and remove items from the list. + list.Add("item 1"); + list.Clear(); + listener.Detach(); + } + } +} + +// events2.cs +using System; +namespace MyCollections +{ + using System.Collections; + + // A class that works just like ArrayList, but sends event + // notifications whenever the list changes: + public class ListWithChangedEvent: ArrayList + { + // An event that clients can use to be notified whenever the + // elements of the list change: + public event EventHandler Changed; + + // Invoke the Changed event; called whenever list changes: + protected virtual void OnChanged(EventArgs e) + { + if (Changed != null) + Changed(this,e); + } + + // Override some of the methods that can change the list; + // invoke event after each: + public override int Add(object value) + { + int i = base.Add(value); + OnChanged(EventArgs.Empty); + return i; + } + + public override void Clear() + { + base.Clear(); + OnChanged(EventArgs.Empty); + } + + public override object this[int index] + { + set + { + base[index] = value; + OnChanged(EventArgs.Empty); + } + } + } +} + +namespace TestEvents +{ + using MyCollections; + + class EventListener + { + private ListWithChangedEvent List; + + public EventListener(ListWithChangedEvent list) + { + List = list; + // Add "ListChanged" to the Changed event on "List": + List.Changed += new EventHandler(ListChanged); + } + + // This will be called whenever the list changes: + private void ListChanged(object sender, EventArgs e) + { + Console.WriteLine("This is called when the event fires."); + } + + public void Detach() + { + // Detach the event and delete the list: + List.Changed -= new EventHandler(ListChanged); + List = null; + } + } + + class Test + { + // Test the ListWithChangedEvent class: + public static void Main() + { + // Create a new list: + ListWithChangedEvent list = new ListWithChangedEvent(); + + // Create a class that listens to the list's change event: + EventListener listener = new EventListener(list); + + // Add and remove items from the list: + list.Add("item 1"); + list.Clear(); + listener.Detach(); + } + } +} === added file 'Test/extern_variable.h' --- Test/extern_variable.h 1970-01-01 00:00:00 +0000 +++ Test/extern_variable.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +extern int a; +extern struct B b; +struct S; +class C; === added file 'Test/flex_comment.mxml' --- Test/flex_comment.mxml 1970-01-01 00:00:00 +0000 +++ Test/flex_comment.mxml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ + === added file 'Test/flex_only_mxml.mxml' --- Test/flex_only_mxml.mxml 1970-01-01 00:00:00 +0000 +++ Test/flex_only_mxml.mxml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + === added file 'Test/flex_override.mxml' --- Test/flex_override.mxml 1970-01-01 00:00:00 +0000 +++ Test/flex_override.mxml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,20 @@ + + + + + + === added file 'Test/flex_with_actionscript.mxml' --- Test/flex_with_actionscript.mxml 1970-01-01 00:00:00 +0000 +++ Test/flex_with_actionscript.mxml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,16 @@ + + + + + + + + + + === added file 'Test/format.pl' --- Test/format.pl 1970-01-01 00:00:00 +0000 +++ Test/format.pl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +# Test format tag generation. + +format XYZ = +@<<< @>>> +"1", "a" +. + +format = + @>>> +24 +. + +write; +$~ = XYZ; +write; === added file 'Test/func_typedef.h' --- Test/func_typedef.h 1970-01-01 00:00:00 +0000 +++ Test/func_typedef.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,1 @@ +typedef SLIST_HEAD(symlist, symbol_node) symlist_t; === added file 'Test/functions.e' --- Test/functions.e 1970-01-01 00:00:00 +0000 +++ Test/functions.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,40 @@ +deferred class FUNCTIONS + +feature -- One + + function0: INTEGER is + do + end + +feature -- Two + + function1 (one: STRING) is + once + end + + function2 (one: INTEGER; two: STRING): INTEGER is + deferred + end + + function_anchored: like function0 is + do + end + + function_full (one: STRING) is + require + local + do + -- Implementation + ensure + rescue + end + + infix "<" (other: like Current): BOOLEAN is + do + end + + prefix "+": like Current is + do + end + +end === added file 'Test/gas.s' --- Test/gas.s 1970-01-01 00:00:00 +0000 +++ Test/gas.s 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +.macro sum from=0, to=5 + .long \from + .if \to-\from + sum "(\from+1)",\to + .endif + .endm === added file 'Test/general.cs' --- Test/general.cs 1970-01-01 00:00:00 +0000 +++ Test/general.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,46 @@ +// General Structure of a C# Program +// A skeleton of a C# program +using System; +namespace MyNamespace1 +{ + class MyClass1 + { + } + struct MyStruct + { + } + interface IMyInterface + { + } + delegate int MyDelegate(); + enum MyEnum + { + } + namespace MyNamespace2 + { + } + class MyClass2 + { + public static void Main(string[] args) + { + } + } +} + + +// Using Fully Qualified Names +namespace N1 // N1 +{ + class C1 // N1.C1 + { + class C2 // N1.C1.C2 + { + } + } + namespace N2 // N1.N2 + { + class C2 // N1.N2.C2 + { + } + } +} === added file 'Test/hex2dec.sql' --- Test/hex2dec.sql 1970-01-01 00:00:00 +0000 +++ Test/hex2dec.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,50 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/hex2dec.txt +rem Filename: hex2dec.sql +rem Purpose: Functions to convert Hex to Decimal and vice versa +rem Author: Mark Malakanov, Feb-1999 + Anonymous +rem ----------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION hex2dec (hexnum in char) RETURN number IS + i number; + digits number; + result number := 0; + current_digit char(1); + current_digit_dec number; +BEGIN + digits := length(hexnum); + for i in 1..digits loop + current_digit := SUBSTR(hexnum, i, 1); + if current_digit in ('A','B','C','D','E','F') then + current_digit_dec := ascii(current_digit) - ascii('A') + 10; + else + current_digit_dec := to_number(current_digit); + end if; + result := (result * 16) + current_digit_dec; + end loop; + return result; +END hex2dec; +/ +show errors + +CREATE OR REPLACE FUNCTION num2hex (N in number) RETURN varchar2 IS + H varchar2(64) :=''; + N2 integer := N; +BEGIN + loop + select rawtohex(chr(N2))||H + into H + from dual; + + N2 := trunc(N2 / 256); + exit when N2=0; + end loop; + return H; +END num2hex; +/ +show errors + +-- Examples: +select hex2dec('FF') from dual; + +select num2hex(10) from dual; === added file 'Test/implied_program.f' --- Test/implied_program.f 1970-01-01 00:00:00 +0000 +++ Test/implied_program.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +C Bug reported by Brian Helinski on 28 Feb 2003 + ! implicit program main + integer i + i = 5 + write(*,*) i + end === added file 'Test/indexer.cs' --- Test/indexer.cs 1970-01-01 00:00:00 +0000 +++ Test/indexer.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,37 @@ +// cs_keyword_indexers.cs +using System; +class IndexerClass +{ + private int [] myArray = new int[100]; + public int this [int index] // indexer declaration + { + get + { + // Check the index limits + if (index < 0 || index >= 100) + return 0; + else + return myArray[index]; + } + set + { + if (!(index < 0 || index >= 100)) + myArray[index] = value; + } + } +} + +public class MainClass +{ + public static void Main() + { + IndexerClass b = new IndexerClass(); + // call the indexer to initialize the elements #3 and #5: + b[3] = 256; + b[5] = 1024; + for (int i=0; i<=10; i++) + { + Console.WriteLine("Element #{0} = {1}", i, b[i]); + } + } +} === added file 'Test/indexing.e' --- Test/indexing.e 1970-01-01 00:00:00 +0000 +++ Test/indexing.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,13 @@ +indexing + + description: "A simple description" + revision: "$Revision$" + date: "$Date$" + +class INDEXING + +indexing + + license: "Eiffel Forum License, version 1" + +end === added file 'Test/infinite_loop.java' --- Test/infinite_loop.java 1970-01-01 00:00:00 +0000 +++ Test/infinite_loop.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +class C { + void main \ No newline at end of file === added file 'Test/ingres_procedures.sql' --- Test/ingres_procedures.sql 1970-01-01 00:00:00 +0000 +++ Test/ingres_procedures.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,63 @@ +CREATE PROCEDURE db0001 (short_name varchar(12) not null) +BEGIN +END; + +PROCEDURE db0002 (short_name varchar(12) not null) = +DECLARE +x = varchar(12) not null; +n = i4 not null; +err = varchar(80) not null not default; +BEGIN + + if short_name = '' then + err := 'db0001: Pusty short_name!'; + raise error 8001 :err; + return -1; + endif; + + select :x = bank_sh_name from "cafa". banks_directory_066 + where bank_sh_name = :short_name; + if iierrornumber != 0 THEN rollback; + err := 'db0001: Podczas sprawdzania unikalnosci short_name + banku wystapil blad!'; + raise error 8001 :err; + return -1; + endif; + + n := iirowcount; + commit; + return n; +END; + +-- OR with AS instead of =: + + +PROCEDURE db0003 (short_name varchar(12) not null) +AS +DECLARE +x = varchar(12) not null; +n = i4 not null; +err = varchar(80) not null not default; +BEGIN + + if short_name = '' then + err := 'db0001: Pusty short_name!'; + raise error 8001 :err; + return -1; + endif; + + select :x = bank_sh_name from "cafa". banks_directory_066 + where bank_sh_name = :short_name; + if iierrornumber != 0 THEN rollback; + err := 'db0001: Podczas sprawdzania unikalnosci short_name + banku wystapil blad!'; + raise error 8001 :err; + return -1; + endif; + + n := iirowcount; + commit; + return n; +END + + === added file 'Test/initialization.f90' --- Test/initialization.f90 1970-01-01 00:00:00 +0000 +++ Test/initialization.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,16 @@ +! Tests for correct parsing of complicated initialization + MODULE funcon + IMPLICIT NONE + REAL(8),DIMENSION(3,3),PARAMETER :: & + imat= reshape((/1.d0,0.d0,0.d0, & + 0.d0,1.d0,0.d0, & + 0.d0,0.d0,1.d0/),(/3,3/)) + REAL(8),DIMENSION(6,6),PARAMETER :: & + imat6= reshape((/1.d0,0.d0,0.d0,0.d0,0.d0,0.d0, & + 0.d0,1.d0,0.d0,0.d0,0.d0,0.d0, & + 0.d0,0.d0,1.d0,0.d0,0.d0,0.d0, & + 0.d0,0.d0,0.d0,1.d0,0.d0,0.d0, & + 0.d0,0.d0,0.d0,0.d0,1.d0,0.d0, & + 0.d0,0.d0,0.d0,0.d0,0.d0,1.d0/),(/6,6/)) + + END MODULE funcon === added file 'Test/interface_indexers.cs' --- Test/interface_indexers.cs 1970-01-01 00:00:00 +0000 +++ Test/interface_indexers.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,49 @@ +// cs_interface_indexers.cs +using System; +// Indexer on an interface: +public interface IMyInterface +{ + // indexer declaration: + int this[int index] + { + get; + set; + } +} + +// Implementing the interface: +class IndexerClass : IMyInterface +{ + private int [] myArray = new int[100]; + public int this [int index] // indexer declaration + { + get + { + // Check the index limits + if (index < 0 || index >= 100) + return 0; + else + return myArray[index]; + } + set + { + if (!(index < 0 || index >= 100)) + myArray[index] = value; + } + } +} + +public class MainClass +{ + public static void Main() + { + IndexerClass b = new IndexerClass(); + // call the indexer to initialize the elements #3 and #5: + b[2] = 4; + b[5] = 32; + for (int i=0; i<=10; i++) + { + Console.WriteLine("Element #{0} = {1}", i, b[i]); + } + } +} === added file 'Test/interface_properties.cs' --- Test/interface_properties.cs 1970-01-01 00:00:00 +0000 +++ Test/interface_properties.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,64 @@ +// cs_interface_properties.cs +// Interface Properties +using System; +interface IEmployee +{ + string Name + { + get; + set; + } + + int Counter + { + get; + } +} + +public class Employee: IEmployee +{ + public static int numberOfEmployees; + private int counter; + private string name; + // Read-write instance property: + public string Name + { + get + { + return name; + } + set + { + name = value; + } + } + // Read-only instance property: + public int Counter + { + get + { + return counter; + } + } + // Constructor: + public Employee() + { + counter = ++counter + numberOfEmployees; + } +} + +public class MainClass +{ + public static void Main() + { + Console.Write("Enter number of employees: "); + string s = Console.ReadLine(); + Employee.numberOfEmployees = int.Parse(s); + Employee e1 = new Employee(); + Console.Write("Enter the name of the new employee: "); + e1.Name = Console.ReadLine(); + Console.WriteLine("The employee information:"); + Console.WriteLine("Employee number: {0}", e1.Counter); + Console.WriteLine("Employee name: {0}", e1.Name); + } +} === added file 'Test/internal.cs' --- Test/internal.cs 1970-01-01 00:00:00 +0000 +++ Test/internal.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ +// Assembly1.cs +// compile with: /target:library +internal class BaseClass +{ + public static int IntM = 0; +} === added file 'Test/intro.tex' --- Test/intro.tex 1970-01-01 00:00:00 +0000 +++ Test/intro.tex 2011-03-11 21:16:06 +0000 @@ -0,0 +1,40 @@ +% http://sip.clarku.edu/tutorials/TeX/intro.html +\documentclass[12pt]{article} + +\usepackage{amsmath} % need for subequations +\chapter{chapter text} +\include{chapter1-intro.inc} +\section{section1 text} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\section{Introduction} +\part{Part1} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\subsection{subsection2} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\subsubsection{subsubsection3 with extra text} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\section[short section4]{section4 text} +\paragraph[short para1]{long paragraph1} +\paragraph{long paragraph2} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\part{Part2} +\section[shorter intro2]*{Introduction2longtitle} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\subsection[subsec5 text]*{subsection5} +\subparagraph[short subpara1]{long subparagraph1} +\subparagraph{long subparagraph2} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\subsubsection{subsubsection6 with extra text} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\chapter{chapter2} +\include{chapter2-intro.inc} +\end{document} + === added file 'Test/intro_orig.tex' --- Test/intro_orig.tex 1970-01-01 00:00:00 +0000 +++ Test/intro_orig.tex 2011-03-11 21:16:06 +0000 @@ -0,0 +1,346 @@ +% http://sip.clarku.edu/tutorials/TeX/intro.html +\documentclass[12pt]{article} + +\usepackage{amsmath} % need for subequations +\usepackage{graphicx} % need for figures +\usepackage{verbatim} % useful for program listings +\usepackage{color} % use if color is used in text +\usepackage{subfigure} % use for side-by-side figures +\usepackage{hyperref} % use for hypertext links, including those to external documents and URLs + +% don't need the following. simply use defaults +\setlength{\baselineskip}{16.0pt} % 16 pt usual spacing between lines + +\setlength{\parskip}{3pt plus 2pt} +\setlength{\parindent}{20pt} +\setlength{\oddsidemargin}{0.5cm} +\setlength{\evensidemargin}{0.5cm} +\setlength{\marginparsep}{0.75cm} +\setlength{\marginparwidth}{2.5cm} +\setlength{\marginparpush}{1.0cm} +\setlength{\textwidth}{150mm} + +\begin{comment} +\pagestyle{empty} % use if page numbers not wanted +\end{comment} + +% above is the preamble + +\begin{document} + +\begin{center} +{\large Introduction to \LaTeX} \\ % \\ = new line +\copyright 2006 by Harvey Gould \\ +December 5, 2006 +\end{center} + +\section{Introduction} +\TeX\ looks more difficult than it is. It is +almost as easy as $\pi$. See how easy it is to make special +symbols such as $\alpha$, +$\beta$, $\gamma$, +$\delta$, $\sin x$, $\hbar$, $\lambda$, $\ldots$ We also can make +subscripts +$A_{x}$, $A_{xy}$ and superscripts, $e^x$, $e^{x^2}$, and +$e^{a^b}$. We will use \LaTeX, which is based on \TeX\ and has +many higher-level commands (macros) for formatting, making +tables, etc. More information can be found in Ref.~\cite{latex}. + +We just made a new paragraph. Extra lines and spaces make no +difference. Note that all formulas are enclosed by +\$ and occur in \textit{math mode}. + +The default font is Computer Modern. It includes \textit{italics}, +\textbf{boldface}, +\textsl{slanted}, and \texttt{monospaced} fonts. + +\section{Equations} +Let us see how easy it is to write equations. +\begin{equation} +\Delta =\sum_{i=1}^N w_i (x_i - \bar{x})^2 . +\end{equation} +It is a good idea to number equations, but we can have a +equation without a number by writing +\begin{equation} +P(x) = \frac{x - a}{b - a} , \nonumber +\end{equation} +and +\begin{equation} +g = \frac{1}{2} \sqrt{2\pi} . \nonumber +\end{equation} + +We can give an equation a label so that we can refer to it later. +\begin{equation} +\label{eq:ising} +E = -J \sum_{i=1}^N s_i s_{i+1} , +\end{equation} +Equation~\eqref{eq:ising} expresses the energy of a configuration +of spins in the Ising model.\footnote{It is necessary to process (typeset) a +file twice to get the counters correct.} + +We can define our own macros to save typing. For example, suppose +that we introduce the macros: +\begin{verbatim} + \newcommand{\lb}{{\langle}} + \newcommand{\rb}{{\rangle}} +\end{verbatim} +\newcommand{\lb}{{\langle}} +\newcommand{\rb}{{\rangle}} +Then we can write the average value of $x$ as +\begin{verbatim} +\begin{equation} +\lb x \rb = 3 +\end{equation} +\end{verbatim} +The result is +\begin{equation} +\lb x \rb = 3 . +\end{equation} + +Examples of more complicated equations: +\begin{equation} +I = \! \int_{-\infty}^\infty f(x)\,dx \label{eq:fine}. +\end{equation} +We can do some fine tuning by adding small amounts of horizontal +spacing: +\begin{verbatim} + \, small space \! negative space +\end{verbatim} +as is done in Eq.~\eqref{eq:fine}. + +We also can align several equations: +\begin{align} +a & = b \\ +c &= d , +\end{align} +or number them as subequations: +\begin{subequations} +\begin{align} +a & = b \\ +c &= d . +\end{align} +\end{subequations} + +We can also have different cases: +\begin{equation} +\label{eq:mdiv} +m(T) = +\begin{cases} +0 & \text{$T > T_c$} \\ +\bigl(1 - [\sinh 2 \beta J]^{-4} \bigr)^{\! 1/8} & \text{$T < T_c$} +\end{cases} +\end{equation} +write matrices +\begin{align} +\textbf{T} &= +\begin{pmatrix} +T_{++} \hfill & T_{+-} \\ +T_{-+} & T_{--} \hfill +\end{pmatrix} , \nonumber \\ +& = +\begin{pmatrix} +e^{\beta (J + B)} \hfill & e^{-\beta J} \hfill \\ +e^{-\beta J} \hfill & e^{\beta (J - B)} \hfill +\end{pmatrix}. +\end{align} +and +\newcommand{\rv}{\textbf{r}} +\begin{equation} +\sum_i \vec A \cdot \vec B = -P\!\int\! \rv \cdot +\hat{\mathbf{n}}\, dA = P\!\int \! {\vec \nabla} \cdot \rv\, dV. +\end{equation} + +\section{Tables} +Tables are a little more difficult. TeX +automatically calculates the width of the columns. + +\begin{table}[h] +\begin{center} +\begin{tabular}{|l|l|r|l|} +\hline +lattice & $d$ & $q$ & $T_{\rm mf}/T_c$ \\ +\hline +square & 2 & 4 & 1.763 \\ +\hline +triangular & 2 & 6 & 1.648 \\ +\hline +diamond & 3 & 4 & 1.479 \\ +\hline +simple cubic & 3 & 6 & 1.330 \\ +\hline +bcc & 3 & 8 & 1.260 \\ +\hline +fcc & 3 & 12 & 1.225 \\ +\hline +\end{tabular} +\caption{\label{tab:5/tc}Comparison of the mean-field predictions +for the critical temperature of the Ising model with exact results +and the best known estimates for different spatial dimensions $d$ +and lattice symmetries.} +\end{center} +\end{table} + +\section{Lists} + +Some example of formatted lists include the +following: + +\begin{enumerate} + +\item bread + +\item cheese + +\end{enumerate} + +\begin{itemize} + +\item Tom + +\item Dick + +\end{itemize} + +\section{Figures} + +We can make figures bigger or smaller by scaling them. Figure~\ref{fig:lj} +has been scaled by 60\%. + +\begin{figure}[h] +\begin{center} +\includegraphics{figures/sine} +\caption{\label{fig:typical}Show me a sine.} +\end{center} +\end{figure} + +\begin{figure}[h] +\begin{center} +\scalebox{0.6}{\includegraphics{figures/lj}} +\caption{\label{fig:lj}Plot of the +Lennard-Jones potential +$u(r)$. The potential is characterized by a length +$\sigma$ and an energy +$\epsilon$.} +\end{center} +\end{figure} + +\section{Literal text} +It is desirable to print program code exactly as it is typed in a +monospaced font. Use \verb \begin{verbatim} and +\verb \end{verbatim} as in the following example: +\begin{verbatim} +double y0 = 10; // example of declaration and assignment statement +double v0 = 0; // initial velocity +double t = 0; // time +double dt = 0.01; // time step +double y = y0; +\end{verbatim} +The command \verb \verbatiminput{programs/Square.java}\ allows +you to list the file \texttt{Square.java} in the directory +programs. + +\section{Special Symbols} + +\subsection{Common Greek letters} + +These commands may be used only in math mode. Only the most common +letters are included here. + +$\alpha, +\beta, \gamma, \Gamma, +\delta,\Delta, +\epsilon, \zeta, \eta, \theta, \Theta, \kappa, +\lambda, \Lambda, \mu, \nu, +\xi, \Xi, +\pi, \Pi, +\rho, +\sigma, +\tau, +\phi, \Phi, +\chi, +\psi, \Psi, +\omega, \Omega$ + +\subsection{Special symbols} + +The derivative is defined as +\begin{equation} +\frac{dy}{dx} = \lim_{\Delta x \to 0} \frac{\Delta y} +{\Delta x} +\end{equation} +\begin{equation} +f(x) \to y \quad \mbox{as} \quad x \to +x_{0} +\end{equation} +\begin{equation} +f(x) \mathop {\longrightarrow} +\limits_{x \to x_0} y +\end{equation} + +\noindent Order of magnitude: +\begin{equation} +\log_{10}f \simeq n +\end{equation} +\begin{equation} +f(x)\sim 10^{n} +\end{equation} +Approximate equality: +\begin{equation} +f(x)\simeq g(x) +\end{equation} +\LaTeX\ is simple if we keep everything in proportion: +\begin{equation} +f(x) \propto x^3 . +\end{equation} + +Finally we can skip some space by using commands such as +\begin{verbatim} +\bigskip \medskip \smallskip \vspace{1pc} +\end{verbatim} +The space can be negative. + +\section{\color{red}Use of Color} + +{\color{blue}{We can change colors for emphasis}}, +{\color{green}{but}} {\color{cyan}{who is going pay for the ink?}} + +\section{\label{morefig}Subfigures} + +As soon as many students start becoming comfortable using \LaTeX, they want +to use some of its advanced features. So we now show how to place two +figures side by side. + +\begin{figure}[h!] +\begin{center} +\subfigure[Real and imaginary.]{ +\includegraphics[scale=0.5]{figures/reim}} +\subfigure[Amplitude and phase.]{ +\includegraphics[scale=0.5]{figures/phase}} +\caption{\label{fig:qm/complexfunctions} Two representations of complex +wave functions.} +\end{center} +\end{figure} + +We first have to include the necessary package, +\verb+\usepackage{subfigure}+, which has to go in the preamble (before +\verb+\begin{document}+). It sometimes can be difficult to place a figure in +the desired place. + +Your LaTeX document can be easily modified to make a poster or a screen +presentation similar to (and better than) PowerPoint. Conversion to HTML is +straightforward. Comments on this tutorial are appreciated. + +\begin{thebibliography}{5} + +\bibitem{latex}Helmut Kopka and Patrick W. Daly, \textsl{A Guide to +\LaTeX: Document Preparation for Beginners and Advanced Users}, +fourth edition, Addison-Wesley (2004). + +\bibitem{website}Some useful links are +given at \url{}. + +\end{thebibliography} + +{\small \noindent Updated 5 December 2006.} +\end{document} + === added file 'Test/invalid_name.f90' --- Test/invalid_name.f90 1970-01-01 00:00:00 +0000 +++ Test/invalid_name.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,12 @@ +! Test of parsing type with invalid name + Module TR_DetectionRecording + Implicit None + Save + Integer :: DR_Lun + Character*1024 DR_Filename + Type Detection_Record + Integer(2) :: Activity + Integer(2) :: Type ! "Type" not valid entity name + Integer(2) :: Face + End Type Detection_Record + End Module TR_DetectionRecording === added file 'Test/java_enum.java' --- Test/java_enum.java 1970-01-01 00:00:00 +0000 +++ Test/java_enum.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +public class C { + public enum TrivialEnum { + FIRST_VALUE, + SECOND_VALUE + } + public enum FancyEnum { + A(1), B(2); + private int i; + FancyEnum(int i) { + this.i = i; + } + void m() { + } + } +} === added file 'Test/jbrown.vr' --- Test/jbrown.vr 1970-01-01 00:00:00 +0000 +++ Test/jbrown.vr 2011-03-11 21:16:06 +0000 @@ -0,0 +1,47 @@ +// Sample taken from: +// http://groups.google.com/groups?q=vera+group:comp.*&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=39BD28D2.40737022%40us.ibm.com.remove.this.spam.filter&rnum=6 +#include + +typedef class Transaction; + +program myProgram { + + Transaction t; // t is of type Transaction + + repeat(100) { // write 100 times to the bus + t = new(); // random values to bus + t.writeBus(); + } + + t = new(32'h0000_0000, 32'h1111_afaf); // write direct value to bus + t.writeBus(); +} + +class Transaction { + + rand bit[31:0] address; // allow for address to be random + rand bit[31:0] data; // allow for data to be random + + constraint c1 { // rules for generating address + address >= 32'h0000_1000; + address <= 32'h0000_1fff; + } + + // no rules for data: any value is valid + + task new( (bit[31:0] address = -1), (bit[31:0] data = -1)) { + void = this.randomize(); // randomize address, data + if (address != -1) this.address = address; + if (data != -1) this.data = data; + } + + task writeBus() { + printf("Writing Bus w/ Addr=%h_%h Data=%h_%h\n", + address[31:16], address[15:0], data[31:16], data[15:0]); + + @1 bus.address = address; + bus.data = data; + @1 bus.addrress = 32'hzzzz_zzzz; + bus.data = 32'hzzzz_zzzz; + } +} // end class Transaction === added file 'Test/jsFunc_tutorial.js' --- Test/jsFunc_tutorial.js 1970-01-01 00:00:00 +0000 +++ Test/jsFunc_tutorial.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,524 @@ + +/* + * These samples were retrieved from this website: + * http://www.permadi.com/tutorial/jsFunc/ + * + * This the output you should see from running: + * ctags -f - Test/jsFunc_tutorial.js + * functions + * Ball1 + * Ball3 + * D1 + * D2 + * D2A + * D3 + * D4 + * D5 + * DT1 + * DT2 + * DT2A + * DT3 + * PT1 + * calculate8 + * getHalfOf7 + * getHalfOf7.calculate + * getHalfOf8 + * getSalaryFunctionDT9 + * myFunction4 + * myFunction5 + * myFunction6 + * myFunction6A + * myFunction6AE + * myFunction6B + * myFunction6E + * myObject.add + * savedFunc6B + * sayName4A + * theAdd + * classes + * DT4 + * DT5 + * DT6 + * DT7 + * DT7A + * DT8 + * DT9 + * PT2 + * PT3 + * addSalaryFunction + * addSalaryFunctionDT9 + * methods + * DT7.getSalary + * DT7A.getSalary + * DT8.getSalary + * PT2.livesIn + * PT2.price + * PT3.addSalary + * PT3.getSalary + * variables + * my_global_var1 + */ + +// Example D1 + +function D1(a, b) +{ + return a+b; +} +alert(D1(1,2)); // produces 3 + +var my_global_var1 = 'global'; + +// Example D2 + +var D2=function(a, b) +{ + return a+b; +} +alert(D2(1,2)); // produces 3 + + +// Example D2A + +var D2A=function theAdd(a, b) +{ + return a+b; +} +alert(D2A(1,2)); // produces 3 +alert(theAdd(1,2)); // also produces 3 + +var myObject=new Object(); +myObject.add=function(a,b){return a+b}; +// myObject now has a property/a method named "add" +// and I can use it like below +myObject.add(1, 2); + + +// Example D3 + +var D3=new Function("a", "b", "return a+b;"); +alert(D3(3,4)); // produces 7 + + +// Example D4 + +var D4=new Function("a", "b", + "alert" + // chop string using "+" + "('adding '+a+' and ' +b);\ // separate string using "\" + return a+b;"); +alert(D4(3,4)); // produces 7 + + +// Example D5 + +function D5(myOperator) +{ + return new Function("a", "b", "return a" + myOperator + "b;"); +} + +var add=D5("+"); // creates "add" function +var subtract=D5("-"); // creates "subtract" function +var multiply=D5("*"); // created "multiply" function + +// test the functions +alert("result of add="+add(10,2)); // result is 12 +alert("result of substract="+subtract(10,2)); // result is 8 +alert("result of multiply="+multiply(10,2)); // result is 20 +alert(add); + + +// Example 1 + +function Ball1() // it may seem odd, but this declaration +{ // creates a object named Ball + i=1; +} +alert(typeof Ball1); // produces "function" + + +// Example 3 + +function Ball3() // it may seem odd, but declaration +{ // creates an object named Ball, and you can +} // refer to it or add properties to it like below +Ball3.callsign="The Ball"; // add property to Ball +alert(Ball3.callsign); // produces "The Ball" + + +// Example 4 + +function myFunction4(message) +{ + alert(message); +} +var ptr=myFunction4; // ptr points to myFunction +ptr("hello"); // executes myFunction which will prints "hello" + + +// Example 4A + +function sayName4A(name) +{ + alert(name); +} + +var object1=new Object(); // creates 3 objects +var object2=new Object(); +var object3=new Object(); +object1.sayMyName4A=sayName; // assign the function to all objects +object2.sayMyName4A=sayName; +object3.sayMyName4A=sayName; + +object1.sayMyName4A("object1"); // prints "object1" +object2.sayMyName4A("object2"); // prints "object2" +object3.sayMyName4A("object3"); // prints "object3" + + +// Example 5 + +function myFunction5() +{ + alert(myFunction.message); +} +myFunction5.message="old"; +var ptr1=myFunction5; // ptr1 points to myFunction +var ptr2=myFunction5; // ptr2 also points to myFunction + +ptr1(); // prints "old" +ptr2(); // prints "old" + +myFunction5.message="new"; + +ptr1(); // prints "new" +ptr2(); // prints "new" + + +//Example 6: + +function myFunction6() +{ + alert("Old"); +} +myFunction6(); // prints "Old" + +myFunction6E=function() +{ + alert("New"); +}; +myFunction6E(); // prints "New" + + +//Example 6A: + +function myFunction6A() +{ + alert("Old"); +} +var savedFunction=myFunction6A; + +myFunction6AE=function() +{ + alert("New"); +}; +myFunction6AE(); // prints "New" +savedFunction(); // printf "Old" + +//Example 6B: + +function myFunction6B() +{ + alert("Old"); +} +var savedFunc=myFunction6B; +savedFunc6B=function() +{ + alert("New"); +}; +myFunction6B(); // prints "Old" +savedFunc6B(); // prints "New" + +// Example 7 + +function getHalfOf7(num1, num2, num3) +{ + function calculate(number) + { + return number/2; + } + + var result=""; + result+=calculate(num1)+" "; + result+=calculate(num2)+" "; + result+=calculate(num3); +} +var resultString=getHalfOf7(10,20,30); +alert(resultString); // prints "5 10 15" + +// Example 8 + +function calculate8(number) +{ + return number/3; +} + +function getHalfOf8(num1, num2, num3) +{ + function calculate(number) + { + return number/2; + } + + var result=""; + result+=calculate(num1)+" "; + result+=calculate(num2)+" "; + result+=calculate(num3); +} +var resultString=getHalfOf8(10,20,30); +alert(resultString); // prints "5 10 15" + +// Example DT1 +function DT1() +{ +} +var ball0=new DT1(); // ball0 now points to a new object + +alert(ball0); // prints "Object" because ball0 is now an Object + + +// Example DT2 + +function DT2(message) +{ + alert(message); +} +var ball1=new DT2("creating new Ball"); // creates object & + // prints the message +ball1.name="ball-1"; // ball0 now has a "name" property +alert(ball1.name); // prints "ball-0" + + +// Example DT2A + +function DT2A(message) +{ + alert(message); +} +var ball2=new Object(); +ball2.construct=DT2A; +ball2.construct("creating new ball2"); // executes ball0.Ball("creating.."); +ball2.name="ball-2"; +alert(ball2.name); + + +// Example DT3 (creates 3 ball objects) + +function DT3() +{ +} +var ball3=new DT3(); // ball0 now points to a new instance of type Ball +ball3.name="ball-3"; // ball0 now has a "name" property + +var ball4=new DT3(); +ball4.name="ball-4"; + +var ball5=new DT3(); + +alert(ball0.name); // prints "ball-0" +alert(ball1.name); // prints "ball-1" +alert(ball2.name); // oops, I forgot to add "name" to ball2! + + +// Example DT4 + +function DT4(message, specifiedName) +{ + alert(message); + this.name=specifiedName; +} +var ball6=new DT4("creating new Ball", "Soccer Ball"); +alert(ball6.name); // prints "Soccer Ball" + + +// Example DT5 + +function DT5(color, specifiedName, owner, weight) +{ + this.name=specifiedName; + this.color=color; + this.owner=owner; + this.weight=weigth; +} +var ball7=new DT5("black/white", "Soccer Ball", "John", 20); +var ball8=new DT5("gray", "Bowling Ball", "John", 30); +var ball9=new DT5("yellow", "Golf Ball", "John", 55); +var balloon=new DT5("red", "Balloon", "Pete", 10); + +alert(ball7.name); // prints "Soccer Ball" +alert(balloon.name); // prints "Balloon" +alert(ball9.weight); // prints "55" + + +// Example DT6 + +function DT6(name, salary, mySupervisor) +{ + this.name=name; + this.salary=salary; + this.supervisor=mySupervisor; +} +var boss=new DT6("John", 200); + +var manager=new DT6("Joan", 50, boss); +var teamLeader=new DT6("Rose", 50, boss); + +alert(manager.supervisor.name+" is the supervisor of "+manager.name); +alert(manager.name+"\'s supervisor is "+manager.supervisor.name); + + +// Example DT7 + +function DT7(name, salary) +{ + this.name=name; + this.salary=salary; + + this.addSalary=addSalaryFunction; + + this.getSalary=function() + { + return this.salary; + }; +} + +function addSalaryFunction(addition) +{ + this.salary=this.salary+addition; +} + +var boss=new DT7("John", 200000); +boss.addSalary(10000); // boss gets 10K raise +alert(boss.getSalary()); // print 210K + + + +function DT7A(name, salary) +{ + this.name=name; + this.salary=salary; + + this.addSalary=addSalaryFunction; + + this.getSalary=function() + { + return this.salary; + }; +} + +function addSalaryFunction(addition) +{ + this.salary=this.salary+addition; +} + +var boss=new DT7A("John", 200000); +var boss2=new DT7A("Joan", 200000); +var boss3=new DT7A("Kim", 200000); + + +// Example DT8 + +function DT8(name, salary) +{ + this.name=name; + this.salary=salary; + + this.addSalary=addSalaryFunction; + this.getSalary=function() + { + return this.salary; + }; +} + +function addSalaryFunction(addition) +{ + this.salary=this.salary+addition; +} + +var boss1=new DT8("John", 200000); +var boss2=new DT8("Joan", 200000); + + +// add properties to getSalary function object. +boss1.getSalary.owner="boss1"; +boss2.getSalary.owner="boss2"; +alert(boss1.getSalary.owner); // prints "boss1" +alert(boss2.getSalary.owner); // prints "boss2" +// if both objects are pointing to the same function object, then +// both output above should have printed "boss2". + +// add properties to addSalary function object. +boss1.addSalary.owner="boss1"; +boss1.addSalary.owner="boss2"; +alert(boss1.addSalary.owner); // prints "boss2" +alert(boss2.addSalary.owner); // prints "boss2" +// since both objects are not pointing to the same function, +// then changes in one, affects all instances (so, both prints "boss2"). + + +// Example DT9 + +function DT9(name, salary) +{ + this.name=name; + this.salary=salary; + + this.addSalary=addSalaryFunctionDT9; + this.getSalary=getSalaryFunctionDT9; +} + +function getSalaryFunctionDT9() +{ + return this.salary; +} + +function addSalaryFunctionDT9(addition) +{ + this.salary=this.salary+addition; +} + + +// Example PT1 + +function PT1() +{ +} +alert(PT1.prototype); // prints "Object" + + +// Example PT2 + +function PT2(name, color) +{ + this.name=name; + this.color=color; +} +PT2.prototype.livesIn="water"; +PT2.prototype.price=20; + + +// Example PT3 + +function PT3(name, salary) +{ + this.name=name; + this.salary=salary; +} + +PT3.prototype.getSalary=function getSalaryFunction() +{ + return this.salary; +} + +PT3.prototype.addSalary=function addSalaryFunction(addition) +{ + this.salary=this.salary+addition; +} === added file 'Test/keyword_abstract.cs' --- Test/keyword_abstract.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_abstract.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,51 @@ +// abstract_keyword.cs +// Abstract Classes +using System; +abstract class MyBaseC // Abstract class +{ + protected int x = 100; + protected int y = 150; + public abstract void MyMethod(); // Abstract method + + public abstract int GetX // Abstract property + { + get; + } + + public abstract int GetY // Abstract property + { + get; + } +} + +class MyDerivedC: MyBaseC +{ + public override void MyMethod() + { + x++; + y++; + } + + public override int GetX // overriding property + { + get + { + return x+10; + } + } + + public override int GetY // overriding property + { + get + { + return y+10; + } + } + + public static void Main() + { + MyDerivedC mC = new MyDerivedC(); + mC.MyMethod(); + Console.WriteLine("x = {0}, y = {1}", mC.GetX, mC.GetY); + } +} === added file 'Test/keyword_catch_try.cs' --- Test/keyword_catch_try.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_catch_try.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,33 @@ +// Ordering catch clauses +using System; +class MyClass +{ + public static void Main() + { + MyClass x = new MyClass(); + try + { + string s = null; + x.MyFn(s); + } + + // Most specific: + catch (ArgumentNullException e) + { + Console.WriteLine("{0} First exception caught.", e); + } + + // Least specific: + catch (Exception e) + { + Console.WriteLine("{0} Second exception caught.", e); + } + + } + + public void MyFn(string s) + { + if (s == null) + throw new ArgumentNullException(); + } +} === added file 'Test/keyword_class.cs' --- Test/keyword_class.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_class.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,49 @@ +// keyword_class.cs +// class example +using System; +public class Kid +{ + private int age; + private string name; + + // Default constructor: + public Kid() + { + name = "N/A"; + } + + // Constructor: + public Kid(string name, int age) + { + this.name = name; + this.age = age; + } + + // Printing method: + public void PrintKid() + { + Console.WriteLine("{0}, {1} years old.", name, age); + } +} + +public class MainClass +{ + public static void Main() + { + // Create objects + // Objects must be created using the new operator: + Kid kid1 = new Kid("Craig", 11); + Kid kid2 = new Kid("Sally", 10); + + // Create an object using the default constructor: + Kid kid3 = new Kid(); + + // Display results: + Console.Write("Kid #1: "); + kid1.PrintKid(); + Console.Write("Kid #2: "); + kid2.PrintKid(); + Console.Write("Kid #3: "); + kid3.PrintKid(); + } +} === added file 'Test/keyword_const.cs' --- Test/keyword_const.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_const.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,26 @@ +// const_keyword.cs +// Constants +using System; +public class ConstTest +{ + class MyClass + { + public int x; + public int y; + public const int c1 = 5; + public const int c2 = c1 + 5; + + public MyClass(int p1, int p2) + { + x = p1; + y = p2; + } + } + + public static void Main() + { + MyClass mC = new MyClass(11, 22); + Console.WriteLine("x = {0}, y = {1}", mC.x, mC.y); + Console.WriteLine("c1 = {0}, c2 = {1}", MyClass.c1, MyClass.c2 ); + } +} === added file 'Test/keyword_delegate.cs' --- Test/keyword_delegate.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_delegate.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,57 @@ +// keyword_delegate.cs +// delegate declaration +delegate void MyDelegate(int i); + +class Program +{ + public static void Main() + { + TakesADelegate(new MyDelegate(DelegateFunction)); + } + + public static void TakesADelegate(MyDelegate SomeFunction) + { + SomeFunction(21); + } + + public static void DelegateFunction(int i) + { + System.Console.WriteLine("Called by delegate with number: {0}.", i); + } +} +// +// keyword_delegate2.cs +// Calling both static and instance methods from delegates +using System; + +// delegate declaration +delegate void MyDelegate(); + +public class MyClass +{ + public void InstanceMethod() + { + Console.WriteLine("A message from the instance method."); + } + + static public void StaticMethod() + { + Console.WriteLine("A message from the static method."); + } +} + +public class MainClass +{ + static public void Main() + { + MyClass p = new MyClass(); + + // Map the delegate to the instance method: + MyDelegate d = new MyDelegate(p.InstanceMethod); + d(); + + // Map to the static method: + d = new MyDelegate(MyClass.StaticMethod); + d(); + } +} === added file 'Test/keyword_enum.cs' --- Test/keyword_enum.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_enum.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,31 @@ +// C# Programmer's Reference: enum +// keyword_enum.cs +// enum initialization: +using System; +public class EnumTest +{ + enum Days {Sat=1, Sun, Mon, Tue, Wed, Thu, Fri}; + + public static void Main() + { + int x = (int) Days.Sun; + int y = (int) Days.Fri; + Console.WriteLine("Sun = {0}", x); + Console.WriteLine("Fri = {0}", y); + } +} + +// keyword_enum2.cs +// Using long enumerators +using System; +public class EnumTest +{ + enum Range :long {Max = 2147483648L, Min = 255L}; + public static void Main() + { + long x = (long) Range.Max; + long y = (long) Range.Min; + Console.WriteLine("Max = {0}", x); + Console.WriteLine("Min = {0}", y); + } +} === added file 'Test/keyword_event.cs' --- Test/keyword_event.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_event.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,180 @@ +// event_keyword.cs +using System; +public delegate void MyDelegate(); // delegate declaration + +public interface I +{ + event MyDelegate MyEvent; + void FireAway(); +} + +public class MyClass: I +{ + public event MyDelegate MyEvent; + + public void FireAway() + { + if (MyEvent != null) + MyEvent(); + } +} + +public class MainClass +{ + static private void f() + { + Console.WriteLine("This is called when the event fires."); + } + + static public void Main () + { + I i = new MyClass(); + + i.MyEvent += new MyDelegate(f); + i.FireAway(); + } +} + +// event_keyword2.cs +using System; +using System.Collections; + +public delegate void MyDelegate1(int i); +public delegate void MyDelegate2(string s); +public delegate void MyDelegate3(int i, object o); +public delegate void MyDelegate4(); + +public class PropertyEventsSample +{ + private Hashtable eventTable = new Hashtable(); + + public event MyDelegate1 Event1 + { + add + { + eventTable["Event1"] = (MyDelegate1)eventTable["Event1"] + value; + } + remove + { + eventTable["Event1"] = (MyDelegate1)eventTable["Event1"] - value; + } + } + + public event MyDelegate1 Event2 + { + add + { + eventTable["Event2"] = (MyDelegate1)eventTable["Event2"] + value; + } + remove + { + eventTable["Event2"] = (MyDelegate1)eventTable["Event2"] - value; + } + } + + public event MyDelegate2 Event3 + { + add + { + eventTable["Event3"] = (MyDelegate2)eventTable["Event3"] + value; + } + remove + { + eventTable["Event3"] = (MyDelegate2)eventTable["Event3"] - value; + } + } + + public event MyDelegate3 Event4 + { + add + { + eventTable["Event4"] = (MyDelegate3)eventTable["Event4"] + value; + } + remove + { + eventTable["Event4"] = (MyDelegate3)eventTable["Event4"] - value; + } + } + + public event MyDelegate3 Event5 + { + add + { + eventTable["Event5"] = (MyDelegate3)eventTable["Event5"] + value; + } + remove + { + eventTable["Event5"] = (MyDelegate3)eventTable["Event5"] - value; + } + } + + public event MyDelegate4 Event6 + { + add + { + eventTable["Event6"] = (MyDelegate4)eventTable["Event6"] + value; + } + remove + { + eventTable["Event6"] = (MyDelegate4)eventTable["Event6"] - value; + } + } +} + +public class MyClass +{ + public static void Main() + { + } +} + +// event_keyword3.cs +using System; + +public delegate void MyDelegate1(); + +public interface I1 +{ + event MyDelegate1 MyEvent; +} + +public delegate int MyDelegate2(string s); + +public interface I2 +{ + event MyDelegate2 MyEvent; +} + +public class ExplicitEventsSample: I1, I2 +{ + public event MyDelegate1 MyEvent; // normal implementation of I1.MyEvent. + + event MyDelegate2 I2.MyEvent // explicit implementation of I2.MyEvent + { + add + { + MyEvent2Storage += value; + } + remove + { + MyEvent2Storage -= value; + } + } + + private MyDelegate2 MyEvent2Storage; // underlying storage for I2.MyEvent. + + private void FireEvents() + { + if (MyEvent != null) + MyEvent(); + if (MyEvent2Storage != null) + MyEvent2Storage("hello"); + } +} + +public class MyClass +{ + public static void Main() + { + } +} === added file 'Test/keyword_explicit.cs' --- Test/keyword_explicit.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_explicit.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,27 @@ +// cs_keyword_explicit.cs +using System; +struct Digit +{ + byte value; + public Digit(byte value) + { + if (value<0 || value>9) throw new ArgumentException(); + this.value = value; + } + + // define explicit byte-to-Digit conversion operator: + public static explicit operator Digit(byte b) + { + Console.WriteLine("conversion occurred"); + return new Digit(b); + } +} + +class Test +{ + public static void Main() + { + byte b = 3; + Digit d = (Digit)b; // explicit conversion + } +} === added file 'Test/keyword_extern.cs' --- Test/keyword_extern.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_extern.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +using System; +using System.Runtime.InteropServices; +class MyClass +{ + [DllImport("User32.dll")] + public static extern int MessageBox(int h, string m, string c, int type); + + public static int Main() + { + string myString; + Console.Write("Enter your message: "); + myString = Console.ReadLine(); + return MessageBox(0, myString, "My Message Box", 0); + } +} === added file 'Test/keyword_implicit.cs' --- Test/keyword_implicit.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_implicit.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,30 @@ +// cs_keyword_implicit.cs +using System; +struct Digit +{ + byte value; + + public Digit(byte value) + { + if (value < 0 || value > 9) throw new ArgumentException(); + this.value = value; + } + + // define implicit Digit-to-byte conversion operator: + public static implicit operator byte(Digit d) + { + Console.WriteLine( "conversion occurred" ); + return d.value; + } +} + +class Test +{ + public static void Main() + { + Digit d = new Digit(3); + + // implicit (no cast) conversion from Digit to byte + byte b = d; + } +} === added file 'Test/keyword_interface.cs' --- Test/keyword_interface.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_interface.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,73 @@ +// keyword_interface.cs +// Interface implementation +using System; +interface IPoint +{ + // Property signatures: + int x + { + get; + set; + } + + int y + { + get; + set; + } +} + +class MyPoint : IPoint +{ + // Fields: + private int myX; + private int myY; + + // Constructor: + public MyPoint(int x, int y) + { + myX = x; + myY = y; + } + + // Property implementation: + public int x + { + get + { + return myX; + } + + set + { + myX = value; + } + } + + public int y + { + get + { + return myY; + } + set + { + myY = value; + } + } +} + +class MainClass +{ + private static void PrintPoint(IPoint p) + { + Console.WriteLine("x={0}, y={1}", p.x, p.y); + } + + public static void Main() + { + MyPoint p = new MyPoint(2,3); + Console.Write("My Point: "); + PrintPoint(p); + } +} === added file 'Test/keyword_namespace.cs' --- Test/keyword_namespace.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_namespace.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,31 @@ +// cs_namespace_keyword.cs +using System; +namespace SomeNameSpace +{ + public class MyClass + { + public static void Main() + { + Nested.NestedNameSpaceClass.SayHello(); + } + } + + namespace Nested // a nested namespace + { + public class NestedNameSpaceClass + { + public static void SayHello() + { + Console.WriteLine("Hello"); + } + } + } +} + +// namespace can nest multiple levels at once. +namespace SomeNameSpace.Nested +{ + public class AlternativeNestedNameSpaceClass + { + } +} === added file 'Test/keyword_out.cs' --- Test/keyword_out.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_out.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,17 @@ +// cs_out.cs +using System; +public class MyClass +{ + public static int TestOut(out char i) + { + i = 'b'; + return -1; + } + + public static void Main() + { + char i; // variable need not be initialized + Console.WriteLine(TestOut(out i)); + Console.WriteLine(i); + } +} === added file 'Test/keyword_override.cs' --- Test/keyword_override.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_override.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,44 @@ +// cs_override_keyword.cs +// Calling overriden methods from the base class +using System; +class TestClass +{ + public class Square + { + public double x; + + // Constructor: + public Square(double x) + { + this.x = x; + } + + public virtual double Area() + { + return x*x; + } + } + + class Cube: Square + { + // Constructor: + public Cube(double x): base(x) + { + } + + // Calling the Area base method: + public override double Area() + { + return (6*(base.Area())); + } + } + + public static void Main() + { + double x = 5.2; + Square s = new Square(x); + Square c = new Cube(x); + Console.WriteLine("Area of Square = {0:F2}", s.Area()); + Console.WriteLine("Area of Cube = {0:F2}", c.Area()); + } +} === added file 'Test/keyword_params.cs' --- Test/keyword_params.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_params.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,28 @@ +// cs_params.cs +using System; +public class MyClass +{ + + public static void UseParams(params int[] list) + { + for ( int i = 0 ; i < list.Length ; i++ ) + Console.WriteLine(list[i]); + Console.WriteLine(); + } + + public static void UseParams2(params object[] list) + { + for ( int i = 0 ; i < list.Length ; i++ ) + Console.WriteLine((object)list[i]); + Console.WriteLine(); + } + + public static void Main() + { + UseParams(1, 2, 3); + UseParams2(1, 'a', "test"); + + int[] myarray = new int[3] {10,11,12}; + UseParams(myarray); + } +} === added file 'Test/keyword_private.cs' --- Test/keyword_private.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_private.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,25 @@ +// private_keyword.cs +using System; +class Employee +{ + public string name = "xx"; + double salary = 100.00; // private access by default + private int not_visible = 3; // strangely, not in original example + public double AccessSalary() { + return salary; + } +} + +class MainClass +{ + public static void Main() + { + Employee e = new Employee(); + + // Accessing the public field: + string n = e.name; + + // Accessing the private field: + double s = e.AccessSalary(); + } +} === added file 'Test/keyword_protected.cs' --- Test/keyword_protected.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_protected.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,20 @@ +// protected_keyword.cs +using System; +class MyClass +{ + protected int x; + protected int y; +} + +class MyDerivedC: MyClass +{ + public static void Main() + { + MyDerivedC mC = new MyDerivedC(); + + // Direct access to protected members: + mC.x = 10; + mC.y = 15; + Console.WriteLine("x = {0}, y = {1}", mC.x, mC.y); + } +} === added file 'Test/keyword_public.cs' --- Test/keyword_public.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_public.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,21 @@ +// protected_public.cs +// Public access +using System; +class MyClass1 +{ + public int x; + public int y; +} + +class MyClass2 +{ + public static void Main() + { + MyClass1 mC = new MyClass1(); + + // Direct access to public members: + mC.x = 10; + mC.y = 15; + Console.WriteLine("x = {0}, y = {1}", mC.x, mC.y); + } +} === added file 'Test/keyword_sealed.cs' --- Test/keyword_sealed.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_sealed.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,19 @@ +// cs_sealed_keyword.cs +// Sealed classes +using System; +sealed class MyClass +{ + public int x; + public int y; +} + +class MainClass +{ + public static void Main() + { + MyClass mC = new MyClass(); + mC.x = 110; + mC.y = 150; + Console.WriteLine("x = {0}, y = {1}", mC.x, mC.y); + } +} === added file 'Test/keyword_static.cs' --- Test/keyword_static.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_static.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,47 @@ +// cs_static_keyword.cs +// Static members +using System; +public class Employee +{ + public string id; + public string name; + + public Employee () + { + } + + public Employee (string name, string id) + { + this.name = name; + this.id = id; + } + + public static int employeeCounter; + + public static int AddEmployee() + { + return ++employeeCounter; + } +} + +class MainClass: Employee +{ + public static void Main() + { + Console.Write("Enter the employee's name: "); + string name = Console.ReadLine(); + Console.Write("Enter the employee's ID: "); + string id = Console.ReadLine(); + // Create the employee object: + Employee e = new Employee (name, id); + Console.Write("Enter the current number of employees: "); + string n = Console.ReadLine(); + Employee.employeeCounter = Int32.Parse(n); + Employee.AddEmployee(); + // Display the new information: + Console.WriteLine("Name: {0}", e.name); + Console.WriteLine("ID: {0}", e.id); + Console.WriteLine("New Number of Employees: {0}", + Employee.employeeCounter); + } +} === added file 'Test/keyword_struct.cs' --- Test/keyword_struct.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_struct.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ +// keyword_struct.cs +// struct declaration and initialization +using System; +public struct Point +{ + public int x, y; + + public Point(int p1, int p2) + { + x = p1; + y = p2; + } +} + +class MainClass +{ + public static void Main() + { + // Initialize: + Point myPoint = new Point(); + Point yourPoint = new Point(10,10); + + // Display results: + Console.Write("My Point: "); + Console.WriteLine("x = {0}, y = {1}", myPoint.x, myPoint.y); + Console.Write("Your Point: "); + Console.WriteLine("x = {0}, y = {1}", yourPoint.x, yourPoint.y); + } +} === added file 'Test/keyword_virtual.cs' --- Test/keyword_virtual.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_virtual.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,72 @@ +// cs_virtual_keyword.cs +// Virtual and override +using System; +class TestClass +{ + public class Dimensions + { + public const double pi = Math.PI; + protected double x, y; + public Dimensions() + { + } + public Dimensions (double x, double y) + { + this.x = x; + this.y = y; + } + + public virtual double Area() + { + return x*y; + } + } + + public class Circle: Dimensions + { + public Circle(double r): base(r, 0) + { + } + + public override double Area() + { + return pi * x * x; + } + } + + class Sphere: Dimensions + { + public Sphere(double r): base(r, 0) + { + } + + public override double Area() + { + return 4 * pi * x * x; + } + } + + class Cylinder: Dimensions + { + public Cylinder(double r, double h): base(r, h) + { + } + + public override double Area() + { + return 2*pi*x*x + 2*pi*x*y; + } + } + + public static void Main() + { + double r = 3.0, h = 5.0; + Dimensions c = new Circle(r); + Dimensions s = new Sphere(r); + Dimensions l = new Cylinder(r, h); + // Display results: + Console.WriteLine("Area of Circle = {0:F2}", c.Area()); + Console.WriteLine("Area of Sphere = {0:F2}", s.Area()); + Console.WriteLine("Area of Cylinder = {0:F2}", l.Area()); + } +} === added file 'Test/keyword_volatile.cs' --- Test/keyword_volatile.cs 1970-01-01 00:00:00 +0000 +++ Test/keyword_volatile.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,14 @@ +// csharp_volatile.cs +class Test +{ + public volatile int i; + + Test(int _i) + { + i = _i; + } + public static void Main() + { + + } +} === added file 'Test/labels.sql' --- Test/labels.sql 1970-01-01 00:00:00 +0000 +++ Test/labels.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8 @@ +PROCEDURE outer_procedure IS +BEGIN + <> + DECLARE + x INTEGER; + BEGIN + END my_label; +END === added file 'Test/lanus.for' --- Test/lanus.for 1970-01-01 00:00:00 +0000 +++ Test/lanus.for 2011-03-11 21:16:06 +0000 @@ -0,0 +1,47 @@ +* From jlanus@netscape.net Thu Jan 16 20:38:12 2003 +* Date: Tue, 24 Sep 2002 12:20:07 -0400 +* From: Juan Lanus +* To: ctags-users@lists.sourceforge.net +* Subject: [Ctags] seeking for help to set ctags to work with old FORTRAN +* +* Hi +* +* I'm trying to set ctags to work with some old FORTRAN 77 programs. +* I'm in Windows 2000, vim 6.1 and exuberant ctags 5.3.1. +* The programs are for VAX FORTRAN 77 as of 1988. Writen with tabs and 132 columns line length. +* +* [...] +* +* What am I doing wrong? This is my first contact with tags files of any sort and I'm vexed. +* +* A sample .DES file is included at the bottom. +* +* TIA +* +* Juan Lanus +* TECNOSOL +* Argentina +* +* +**************** +********************************************************************* +* * +* Sistema Personalizado - descripcion de registros - CGA - 1/12/89 * +* * +* De tablas generales PERTAB012 - tabla 010 * +* * +********************************************************************* + + character*6 FEC010 !Fecha de Proceso aa/mm/dd + character*5 URE010 !Ultimo Numero de Pedido + character*5 REM010 !Ultimo Numero de Remito + character*5 FAC010 !Ultimo Numero de Factura + + character*40 PER010 !Registro de Fecha + + equivalence (PER010(1:1) ,FEC010(1:1)) + equivalence (PER010(7:7) ,URE010(1:1)) + equivalence (PER010(12:12),REM010(1:1)) + equivalence (PER010(17:17),FAC010(1:1)) + +****************** Fin Registro de Fecha *********************************** === added file 'Test/line_directives.c' --- Test/line_directives.c 1970-01-01 00:00:00 +0000 +++ Test/line_directives.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,12 @@ +/* ANSI format */ +# line 10 "a.c" +int a; +/* GNU C format */ +# 20 "b.c" +int b; +/* obsolete format */ +# 30 c.c +int c; +/* invalid formats */ +# 1 OK +# 0 Not OK === added file 'Test/local.c' --- Test/local.c 1970-01-01 00:00:00 +0000 +++ Test/local.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,22 @@ +main () +{ + int a; + int b = 3; + a = 2; +} + +static boolean isContextualKeyword (const tokenInfo *const token) +{ + boolean result; +label: + goto label; + switch (token->keyword) + { + case KEYWORD_UNION: + result = TRUE; + break; + + default: result = FALSE; break; + } + return result; +} === added file 'Test/macros.c' --- Test/macros.c 1970-01-01 00:00:00 +0000 +++ Test/macros.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +#define VARIABLE_LIKE some_value +#define FUNCTION_LIKE(a,b) (a + b) +#pragma weak WeakSymbol = StrongSymbol + +/* handling of spoofing macros */ +MACRO(foo); +void prototype __ARGS((int arg1, void *arg2)); === added file 'Test/masm.asm' --- Test/masm.asm 1970-01-01 00:00:00 +0000 +++ Test/masm.asm 2011-03-11 21:16:06 +0000 @@ -0,0 +1,33 @@ +.MODEL medium +.DATA +Msg DB "Text string" +.CODE +QUACK PROC PUBLIC + enter 0, 0 ; May be an instruction or a macro + mov bx, OFFSET DGROUP:Msg + mov bx, [bp+6] + mov WORD PTR [bx], ax + leave + ret 2 +QUACK ENDP +END + +myequ EQU 3 +myequal = 4 + +; http://www.xploiter.com/mirrors/asm/asm_1.htm +hllequal := 4 + +BYTE_BUFFER LABEL BYTE +WORD_BUFFER DW 512 dup (?) + + mov bx, ax +LabelMaker1: + xor ax, ax +LabelMaker2: + +mymacro macro args +endm + +mystruct struct +ends === added file 'Test/matlab_backtracking.m' --- Test/matlab_backtracking.m 1970-01-01 00:00:00 +0000 +++ Test/matlab_backtracking.m 2011-03-11 21:16:06 +0000 @@ -0,0 +1,101 @@ +% http://www.math.washington.edu/~burke/crs/516/HTML/backtrack.html +% Backtracking Linesearch + +function [xn,fn,fcall] = backtrack(xc,d,fc,fnc,DDfnc,c,gamma,eps) +% +%GENERAL DESCRIPTION +% +%This function performs the basic backtracking subroutine. +%The subroutine requires the following input: +% xc = the current point, +% d = the direction of search, +% fc = the current function value, +% fnc = a string variable for the function name, +% DDfnc = the directional derivative of fnc at xc in the +% direction d, must have DDfnc < 0, +% c = the slope modification parameter in (0,1), +% gamma = the backstepping parameter in (0,1), +% eps = the stopping criteria for norm(xn - xc), +% that is, the main algorithm stops when +% norm(xn - xc) <= eps. +% +%The routine returns +% xn = the new point, +% fn = the function value at the new point, +% fnc = the number of calls to fnc. +% +%TERMINATION CRITERIA +% +%The backtracking is terminated if the step to the new point +%xn is so small that it triggers termination in the main algorithm, +%i.e. norm(xc - xn) <= eps. In this case we return xn = xc if +%fn >= fc (we have not reduced the function value); otherwise, +%we return xn. +% +%THE MATH +% +%The backtracking routing attempts to find a step size for +%reducing the value of the function fnc given the current point xc +%and a direction d. It does this by successively trying step sizes +%of the form gamma^s for s = 0,1,2... to find the smallest +%value of s for which the inequality +% +% fnc(xc+gamma^s*d)\le fnc(xc)+c*gamma^s*DD +% +% is satisfied. The new point to be returned is then given +% by xn = xc+gamma^s*d. +% +%CHECK INPUT SPECIFICATIONS +% +if DDfnc >= 0, + error('The backtracking subroutine has been sent a direction of nondesce +nt. Program has been terminated.') +end +if c<= 0 | c>= 1, + error('The slope modification parameter c in the backtracking subroutine + is not in (0,1).') +end +if gamma<=0 | gamma >=1, + error('The backtracking parameter gamma is not in (0,1).') +end +if eps <= 0, + error('The termination criteria eps sent to the backtracking line search + is not positive.') +end + +% +%CHECK DIMENSIONS +% +if size(xc)~=size(d) + error('The vectors sent to backtrack are not of the same dimension.') +end + +% +% +%EXECUTE THE LINE SEARCH +% +% + +xn = xc+d; +cDDfnc = c*DDfnc; +fn = feval(fnc,xn); +fcall = 1 ; + +while fn > fc+cDDfnc, + d = gamma*d; + cDDfnc = gamma*cDDfnc; + xn = xc+d; + fn = feval(fnc,xn); + fcall = fcall+1; + +%Check if the step to xn is too small. + if norm(d) <= eps, + disp('linesearch step too small') + if fn >= fc, + xn = xc; + end + break + end +end + + === added file 'Test/matlab_test.m' --- Test/matlab_test.m 1970-01-01 00:00:00 +0000 +++ Test/matlab_test.m 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +function [x,y,z] = func1 +function x = func2 +function func3 + === added file 'Test/maze.erl' --- Test/maze.erl 1970-01-01 00:00:00 +0000 +++ Test/maze.erl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,127 @@ +-module(maze). +-vsn('2002.0317'). +-author('cpressey@catseye.mb.ca'). +-copyright('Copyright (c)2002 Cat`s Eye Technologies. All rights reserved.'). + +%%% Redistribution and use in source and binary forms, with or without +%%% modification, are permitted provided that the following conditions +%%% are met: +%%% +%%% Redistributions of source code must retain the above copyright +%%% notice, this list of conditions and the following disclaimer. +%%% +%%% Redistributions in binary form must reproduce the above copyright +%%% notice, this list of conditions and the following disclaimer in +%%% the documentation and/or other materials provided with the +%%% distribution. +%%% +%%% Neither the name of Cat's Eye Technologies nor the names of its +%%% contributors may be used to endorse or promote products derived +%%% from this software without specific prior written permission. +%%% +%%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +%%% CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +%%% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +%%% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +%%% DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +%%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +%%% OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +%%% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +%%% OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +%%% ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +%%% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +%%% OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%%% POSSIBILITY OF SUCH DAMAGE. + +-include("maze.hrl"). + +-export([build/0, generate/1]). + + +%%% BEGIN maze.erl %%% + +%%% A simple maze-drawing program. + +%% Driver function ----------------------------------------------------- + +build() -> + Tot = generate(#maze{}), + tot_print(Tot). + +%% Maze generation function -------------------------------------------- + +generate(#maze{}=M) -> + seed(), + {X, Y} = {random:uniform(M#maze.width div 2) * 2, random:uniform(M#maze.height div 2) * 2}, + + R2 = tot_put(X, Y, tot_new(M#maze.width, M#maze.height, M#maze.wall), M#maze.space), + generate(M, R2, X, Y). + +generate(#maze{}=M, R, X, Y) -> + lists:foldl(fun({DX, DY}, A) -> + NX = X + DX * 2, NY = Y + DY * 2, + W = M#maze.wall, + case catch tot_get(NX, NY, A) of + W -> + M1 = tot_put(X + DX, Y + DY, A, M#maze.space), + M2 = tot_put(NX, NY, M1, M#maze.space), + generate(M, M2, NX, NY); + _ -> A + end + end, R, scramble([{-1,0}, {1,0}, {0,-1}, {0,1}])). + +%%% ToT (Tuple-of-Tuples) Utilities ------------------------------------ + +tot_new(W, H, Cell) -> + erlang:make_tuple(H, erlang:make_tuple(W, Cell)). + +tot_get(X, Y, Tot) -> + element(X, element(Y, Tot)). + +tot_put(X, Y, Tot, V) -> + setelement(Y, Tot, setelement(X, element(Y, Tot), V)). + +tot_print(ToT) -> + tot_print(1, ToT). +tot_print(Y, ToT) when Y =< size(ToT) -> + tot_print_tuple(element(Y, ToT)), + io:fwrite("~n"), + tot_print(Y+1, ToT); +tot_print(Y, ToT) -> ok. +tot_print_tuple(T) -> + tot_print_tuple(1, T). +tot_print_tuple(X, T) when X =< size(T) -> + io:fwrite("~s", [[element(X, T)]]), + tot_print_tuple(X+1, T); +tot_print_tuple(X, T) -> ok. + +%%% Randomness Functions ----------------------------------------------- + +%% Seed the random number generator so that it will produce unpredictable +%% values. Should be called once at startup, before using random numbers. + +seed() -> + {H,M,S} = time(), + random:seed(S,M,H), + random:uniform(23). % prime the pump - first number can be iffy + +%% Pick a random element from a tuple or a list (equal chance for every +%% element.) + +pick(Tuple) when tuple(Tuple) -> + pick(tuple_to_list(Tuple)); +pick(List) -> + lists:nth(random:uniform(length(List)), List). + +%% Mix up the order (shuffle or scramble) a tuple or list. + +scramble(Tuple) when tuple(Tuple) -> + list_to_tuple(scramble(tuple_to_list(Tuple))); +scramble(List) -> + scramble(List, []). +scramble([], Acc) -> Acc; +scramble(List, Acc) -> + S = pick(List), + scramble(List -- [S], Acc ++ [S]). + +%%% END of maze.erl %%% === added file 'Test/maze.hrl' --- Test/maze.hrl 1970-01-01 00:00:00 +0000 +++ Test/maze.hrl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,42 @@ +-vsn('2002.0317'). +-author('cpressey@catseye.mb.ca'). +-copyright('Copyright (c)2002 Cat`s Eye Technologies. All rights reserved.'). + +%%% Redistribution and use in source and binary forms, with or without +%%% modification, are permitted provided that the following conditions +%%% are met: +%%% +%%% Redistributions of source code must retain the above copyright +%%% notice, this list of conditions and the following disclaimer. +%%% +%%% Redistributions in binary form must reproduce the above copyright +%%% notice, this list of conditions and the following disclaimer in +%%% the documentation and/or other materials provided with the +%%% distribution. +%%% +%%% Neither the name of Cat's Eye Technologies nor the names of its +%%% contributors may be used to endorse or promote products derived +%%% from this software without specific prior written permission. +%%% +%%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +%%% CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +%%% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +%%% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +%%% DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE +%%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +%%% OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +%%% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +%%% OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +%%% ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +%%% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +%%% OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%%% POSSIBILITY OF SUCH DAMAGE. + +%%% BEGIN maze.hrl %%% + +-define(SPACE, $ ). +-define(WALL, $#). + +-record(maze,{width = 40,height = 30, space = ?SPACE ,wall = ?WALL}). + +%%% END of maze.erl %%% === added file 'Test/misc_types.f' --- Test/misc_types.f 1970-01-01 00:00:00 +0000 +++ Test/misc_types.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,32 @@ +! Provided by Brian Helsinki, 7 March 2003 +! cexternal +! cglobal +! pexternal +! pglobal +! inline +! virtual +! volatile +! pascal + program specs + + VIRTUAL M(10,10), Y(100) + VOLATILE V, Z, MAT, /INI/ + + EXTERNAL ABS ! varations of external and global + CEXTERNAL ABS1 ! not supported + CGLOBAL ABS2 ! not supported + PEXTERNAL ABS3 ! not supported +$IF DEFINED(MAC_DEP) + PASCAL EXTERNAL ABS3_var2 ! not supported +$ENDIF + PGLOBAL ABS4 + + INTEGER INFOOBAR + INLINE (INFOOBAR=00000) ! not supported + + INTEGER M(5) + DATA M/5*0/ + + CALL INFOOBAR(5,4) + END + === added file 'Test/misc_types.f90' --- Test/misc_types.f90 1970-01-01 00:00:00 +0000 +++ Test/misc_types.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,43 @@ +! Provided by Brian Helsinki, 7 March 2003 + program testalloc + integer base_type + automatic foobar_var ! automatic breaks parsing + integer i2 + static s_var ! static breaks parsing + integer i3 + volatile v_var ! volatile breaks var parsing + integer i4 + + DLL_IMPORT foobar2 ! break var parsing + DLL_EXPORT foobar ! breaks var parsing + + integer i5 + common foobar_var, s_var, v_var + integer i6 + + structure /my_struct/ + integer(1) :: first_byte + integer(1) :: %fill + integer(2) :: align_second_16 + end structure + + integer i7 + + record /m_struct/ the_struct ! break var parsing + integer i8 + + real, dimension (:), allocatable :: list ! allocatable + integer i, status + + + i = 99 + allocate (list(i), stat=status ) ! create array allocate + list (1) = 1.2 + deallocate (list) ! deallocate + + do i=1,100 + j=i + end do + stop + end + === added file 'Test/moniker.x68' --- Test/moniker.x68 1970-01-01 00:00:00 +0000 +++ Test/moniker.x68 2011-03-11 21:16:06 +0000 @@ -0,0 +1,116 @@ +* http://www.xrmx.com/solutions/software/68k-fe/samples/moniker.x68 +* MONIKER.X68 +* Author : Greg Colley +* Date : 29/01/99 + +* Program Description. +* This will prompt for surname and firstname, and check if its uppercase +* If it is it prints Initial + surname else it repromts. +* This program will only exit when nothing is entered in the surname or +* firstname. + +PRTSTR EQU 1 Print string Function +READSTR EQU 2 Read string function + + ORG $1000 Start of code location + +* Print user prompt for enter the firstname +* ========================================= +START MOVEA.L #PROMPT1,A1 Pointer to start of prompt text + MOVE.B #PRTSTR,D0 Set up print string function + MOVE.W #(PROMPT2-PROMPT1),D1 The prompt string length + TRAP #15 Print Prompt + +* Get firstname +* ============= + MOVEA.L #F_NAME,A1 Pointer to store teh sentance + MOVE.B #READSTR,D0 Set up readstring function + TRAP #15 Get string from KB + MOVE.W D1,D4 Save length of input string to d4 + + +* Check if Return is pressed + CMPI.W #0,D4 Is the length = 0 + BEQ QUIT If length = 0 then Quit + +* Set up the stuff to check it the entered word is in CAPS +* ======================================================== + MOVEA.L #F_NAME,A0 Move the first char to A0 + JSR CHECK2 Check if uppercase + + CMPI.B #1,D5 See if all the sentance is CAPS + BCS START if it is'nt then re-enter + + +* Print user prompt for enter the surname +* ======================================= +SURNAME MOVEA.L #PROMPT2,A1 Pointer to start of prompt text + MOVE.B #PRTSTR,D0 Set up print string function + MOVE.W #(F_NAME-PROMPT2),D1 The prompt string lenght + TRAP #15 Print Prompt + +* Get surname +* =========== + MOVEA.L #S_NAME,A1 Pointer to store the sentance + MOVE.B #READSTR,D0 Set up readstring function + TRAP #15 Get string from KB + MOVE.W D1,D4 Save length on input string + MOVE.W D1,D3 Save length of input string to d3 + +* Check is Return is pressed + CMPI.W #0,D4 Is the length = 0 + BEQ QUIT If length = 0 then Quit + +* Set up the stuff to check it the entered word is in CAPS +* ======================================================== + MOVEA.L #S_NAME,A0 Move the first char to A0 + JSR CHECK2 Check if uppercase + + CMPI.B #1,D5 See if all the sentance is CAPS + BCS SURNAME if it is'nt then re-enter + +* Move the first char for fname and prints it (Initial Bit) +* ========================================================= +INITIAL MOVEA.L #F_NAME,A1 Move the first char to A1 + MOVE.B (A1),D1 Move the first char of F_NAME to D1 + MOVE.B #6,D0 Set up trap number + TRAP #15 Print the Initial + +PRNSURNAME MOVEA.L #S_NAME,A1 Pointer to start of prompt text + MOVE.B #0,D0 Set up print string function + MOVE.W D3,D1 The prompt string lenght + TRAP #15 Print Prompt + +QUIT STOP #$2700 Stop the prorgam + + +* Check if uppercase +* ================== +* This subroutine will return a 1 in, d5 if it's OK or +* return a 0 in d5 if its not ok. + +CHECK2 CMPI.B #'A',(A0) Is Char > A ? + BCS RETURNFALSE If no then re-enter + CMP.B #('Z'+1),(A0)+ Check if char is < Z + BCC RETURNFALSE If it is then it must be a cap + SUBI.B #1,D4 Decrease s_name / f_name Length + BNE CHECK2 jump if the sentance is not = 0 + +RETURNTRUE MOVE.B #1,D5 Moves a one to D5 to make CAPS ture + RTS Jump back to the main program + +RETURNFALSE MOVE.B #0,D5 Moves a zero to D5 to make CAPS false + RTS Jump back to the main program + + + +* Var's & Const's +* =============== + +PROMPT1 DC.B 'Please enter your firstname (Max 80): ' +PROMPT2 DC.B 'Please enter your surname (Max 80): ' +F_NAME DS.B 80 +S_NAME DS.B 80 +DUMMY DS.B 1 + + END $1000 End of assembley === added file 'Test/namelist.f' --- Test/namelist.f 1970-01-01 00:00:00 +0000 +++ Test/namelist.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ + PROGRAM main + NAMELIST /namelist1/ n1a, n1b + NAMELIST /namelist2/ n2a, n2b /namelist3/ n3a, n3b + END === added file 'Test/namespace.cpp' --- Test/namespace.cpp 1970-01-01 00:00:00 +0000 +++ Test/namespace.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +namespace { + void anon_f() { } +} + +namespace a { + void a_f() { } + namespace b { + void a_b_f() { } + } +} === added file 'Test/no_terminator.js' --- Test/no_terminator.js 1970-01-01 00:00:00 +0000 +++ Test/no_terminator.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,32 @@ +function ts_resortTable(lnk) { + if (span.getAttribute("sortdir") == 'down') { + span.setAttribute('sortdir','up'); + } else { + span.setAttribute('sortdir','down'); + } +} +function getParent(el, pTagName) { + if (el == null) return null; + else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase + return el; + else + return getParent(el.parentNode, pTagName); +} +function ts_sort_currency(a,b) { + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,''); + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,''); + return parseFloat(aa) - parseFloat(bb); +} +function checkForUpdate() { + if( 1==1 ) { + document.write("hello from checkForUpdate
") + } + return 1; +} +function checkForUpdate2() { + if( 1==1 ) { + document.write("hello from checkForUpdate
"); + } + return 2; +} + === added file 'Test/numlib.f90' --- Test/numlib.f90 1970-01-01 00:00:00 +0000 +++ Test/numlib.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,57 @@ +! Bug reported by Brian Helinski on 4 Feb 2003 + module numerical_libraries + interface + + subroutine a2ald (nf, nl, y, nrf, indrf, nef, nfef, indef, conper, iprint& + , model, aov, ems, vc, ldvc, ymeans, wk, iwk, c13ksp) + integer, intent(in) :: nf + integer, dimension(*), intent(in) :: nl + real(kind(1e0)), dimension(*) :: y + integer, intent(in) :: nrf + integer, dimension(*), intent(in) :: indrf + integer, intent(in) :: nef + integer, dimension(*), intent(in) :: nfef + integer, dimension(*), intent(in) :: indef + real(kind(1e0)), intent(in) :: conper + integer, intent(in) :: iprint + integer, intent(in) :: model + real(kind(1e0)), dimension(*), intent(in) :: aov + real(kind(1e0)), dimension(*), intent(inout) :: ems + real(kind(1e0)), dimension(ldvc,*), intent(inout) :: vc + integer, intent(in) :: ldvc + real(kind(1e0)), dimension(*), intent(in) :: ymeans + real(kind(1e0)), dimension(*), intent(inout) :: wk + integer, dimension(*), intent(in) :: iwk + character (len = 13), dimension(*), intent(out) :: c13ksp + end subroutine + + + subroutine b2lsf (fcn, m, n, xguess, ibtype, xlb, xub, xscale, fscale& + , iparam, rparam, x, fvec, fjac, ldfjac, wk, iwk) + integer, intent(in) :: m + integer, intent(in) :: n + real(kind(1e0)), dimension(*) :: xguess + integer, intent(in) :: ibtype + real(kind(1e0)), dimension(*), intent(inout) :: xlb + real(kind(1e0)), dimension(*), intent(inout) :: xub + real(kind(1e0)), dimension(*) :: xscale + real(kind(1e0)), dimension(*) :: fscale + integer, dimension(*) :: iparam + real(kind(1e0)), dimension(*) :: rparam + real(kind(1e0)), dimension(*) :: x + real(kind(1e0)), dimension(*) :: fvec + real(kind(1e0)), dimension(*) :: fjac + integer, intent(in) :: ldfjac + real(kind(1e0)), dimension(*) :: wk + integer, dimension(*) :: iwk + interface + subroutine fcn(m, n, x, f) + integer, intent(in) :: m, n + real(kind(1e0)), intent(in) :: x(*) + real(kind(1e0)), intent(out) :: f(*) + end subroutine + end interface + end subroutine + + END INTERFACE + end module === added file 'Test/objectivec_implementation.m' --- Test/objectivec_implementation.m 1970-01-01 00:00:00 +0000 +++ Test/objectivec_implementation.m 2011-03-11 21:16:06 +0000 @@ -0,0 +1,125 @@ + +@implementation FileTree +- (FileSize)getDiskSize +{ + return diskSize; +} + +- (id)initWithName:(NSString*)treeName + atPlace:(FolderTree*)parentFolder +{ + self = [super init]; + + diskSize = 0; + name = treeName; + parent = parentFolder; + [name retain]; + representation = nil; + + return self; +} + +- (id)initWithName:(NSString*)treeName + andSize:(FileSize)size + atPlace:(FolderTree*)parentFolder +{ + self = [super init]; + + diskSize = size; + name = treeName; + parent = parentFolder; + [name retain]; + representation = nil; + + return self; +} + +- (void)dealloc +{ + [name release]; + [representation release]; + [super dealloc]; +} + +- (LayoutTree*)createLayoutTree +{ + return nil; +} +@end + +@implementation FolderTree +- (id)initWithName:(NSString*)treeName + atPlace:(FolderTree*)parentFolder +{ + self = [super initWithName:treeName + atPlace:parentFolder]; + + children = [[NSMutableArray alloc] init]; + return self; +} + +- (void)dealloc +{ + [children release]; + [super dealloc]; +} + ++ (void) createFileList: (NSString*)root atPlace:(FolderTree*)parentFolder +{ + NSFileManager *localFileManager = [[NSFileManager alloc] init]; + NSURL *rootUrl = [NSURL fileURLWithPath:root]; + NSDirectoryEnumerator *dirEnumerator = [localFileManager enumeratorAtURL:rootUrl + + includingPropertiesForKeys:[NSArray arrayWithObjects: + NSURLNameKey, + NSURLIsDirectoryKey, + nil] + + options:NSDirectoryEnumerationSkipsHiddenFiles + + errorHandler:nil]; + + for (NSURL *theURL in dirEnumerator) + { + [theURL getResourceValue:&fileName + forKey:NSURLNameKey + error:NULL]; + + // Ignore files under the _extras directory + if ([isDirectory boolValue]==YES) + { + [folder populateChildList:root]; + } + else if ([isDirectory boolValue]==NO) + { + [parentFolder addChild:f]; + } + } +} + +- (void) populateChildList:(NSString*)root +{ + NSString *thisRoot = [[root stringByAppendingString:@"/"] + stringByAppendingString:name]; + + [FolderTree createFileList:thisRoot + atPlace:self]; + + for ( FileTree *f in children ) + diskSize += [f getDiskSize]; +} + +- (FolderTree*)addChild:(FileTree*)subTree +{ + [children addObject:subTree]; + return self; +} + +- (LayoutTree*)createLayoutTree +{ + return + [[LayoutTree alloc] initWithFileList:children + andTotalSize:diskSize]; +} +@end + === added file 'Test/objectivec_interface.h' --- Test/objectivec_interface.h 1970-01-01 00:00:00 +0000 +++ Test/objectivec_interface.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,64 @@ +// +// commentary test +// SupaView +// +// Created by Vincent Berthoux on 14/06/10. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import +#import "LayoutTree.h" + +@class LayoutTree; +@class FolderTree; + +#define A_MACRO_TEST + +typedef something SampleTypedefObjC; + +// Mer & no_struct_name must not be present in output +// tag + # define ANOTHER_MACRO( WITH, MOAR ) \ + Mer( ) \ + struct no_struct_name + +struct aStruct +{ + int aStructMember; + char *anotherStructMember[ NOT_IN_TAG ]; +}; + +#pragma DONTCARE /* :-) */ + +@interface FileTree : NSObject { + NSString *name; + LayoutTree *representation; + FolderTree *parent[THISISNOTATAG]; + FileSize diskSize; +} +- (id)initWithName:(NSString*)treeName + andSize:(uint64_t)size + atPlace:(FolderTree*)parentFolder; + +- (id)initWithName:(NSString*)treeName + atPlace:(FolderTree*)parentFolder; + +- (void)dealloc; + +- (FileSize)getDiskSize; +- (LayoutTree*)createLayoutTree; +@end + +@interface FolderTree : FileTree { + NSMutableArray *children; +} + +- (id)initWithName:(NSString*)treeName + atPlace:(FolderTree*)parentFolder; +- (void)dealloc; + +- (FolderTree*)addChild:(FileTree*)subTree; +- (void) populateChildList:(NSString*)root; +- (LayoutTree*)createLayoutTree; +@end + === added file 'Test/objectivec_property.h' --- Test/objectivec_property.h 1970-01-01 00:00:00 +0000 +++ Test/objectivec_property.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,13 @@ + +@interface Person : NSObject { + @public + NSString *m_name; + @private + int m_age; +} + +@property(copy) NSString *personName; +@property(readonly) int personAge; + +-(id)initWithAge:(int)age; +@end === added file 'Test/objectivec_protocol.h' --- Test/objectivec_protocol.h 1970-01-01 00:00:00 +0000 +++ Test/objectivec_protocol.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,6 @@ + +@protocol Locking +- (void)lock; +- (void)unlock; +@end + === added file 'Test/obsolete.e' --- Test/obsolete.e 1970-01-01 00:00:00 +0000 +++ Test/obsolete.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,15 @@ +class OBSOLETE obsolete "Use a different one" + +feature + + obsolete_attribute: INTEGER obsolete "Use something else" + + obsolete_function (one: INTEGER): INTEGER obsolete "Use something else" is + do + end + + obsolete_procedure (one: INTEGER) obsolete "Use something else" is + do + end + +end === added file 'Test/ocamlAllKinds.ml' --- Test/ocamlAllKinds.ml 1970-01-01 00:00:00 +0000 +++ Test/ocamlAllKinds.ml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,26 @@ +module ModuleFoo = struct + type foobar = + ConstructorFoo + | ConstructorBar of int * char list +end + +type 'a foorecord = + { foofield : 'a; + barfield : int; + mutable foobarfield : list char -> int -> unit } + +(* op redif *) +let (+-) a b = + let aplus = a + b + and aminus = a - b + in + (aplus, aminus) + +let foo_function a b = (a, b) + +class fooClass = +object (self) + val x = () + method fooMethod = x +end + === added file 'Test/ocamlCommentInStringAllowed.ml' --- Test/ocamlCommentInStringAllowed.ml 1970-01-01 00:00:00 +0000 +++ Test/ocamlCommentInStringAllowed.ml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +(* the string "(*" does NOT start a comment *) +let p = print_endline +let _ = p "foo" === added file 'Test/ocaml_empty.ml' === added file 'Test/ocaml_onlystr.ml' --- Test/ocaml_onlystr.ml 1970-01-01 00:00:00 +0000 +++ Test/ocaml_onlystr.ml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +"(*)(*)" + === added file 'Test/ocaml_stringTsts.ml' --- Test/ocaml_stringTsts.ml 1970-01-01 00:00:00 +0000 +++ Test/ocaml_stringTsts.ml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ + +let valueStr = "(*)(*)" + === added file 'Test/procedures.e' --- Test/procedures.e 1970-01-01 00:00:00 +0000 +++ Test/procedures.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,28 @@ +deferred class PROCEDURES + +feature -- One + + procedure0 is + do + end + +feature -- Two + + procedure1 (one: STRING) is + once + end + + procedure2 (one: INTEGER; two: STRING) is + deferred + end + + procedure_full (one: STRING) is + require + local + do + -- Implementation + ensure + rescue + end + +end === added file 'Test/property.cs' --- Test/property.cs 1970-01-01 00:00:00 +0000 +++ Test/property.cs 2011-03-11 21:16:06 +0000 @@ -0,0 +1,50 @@ +// property.cs +// Properties +using System; +public class Employee +{ + public static int numberOfEmployees; + private static int counter; + private string name; + + // A read-write instance property: + public string Name + { + get + { + return name; + } + set + { + name = value; + } + } + + // A read-only static property: + public static int Counter + { + get + { + return counter; + } + } + + // Constructor: + public Employee() + { + // Calculate the employee's number: + counter = ++counter + numberOfEmployees; + } +} + +public class MainClass +{ + public static void Main() + { + Employee.numberOfEmployees = 100; + Employee e1 = new Employee(); + e1.Name = "Claude Vige"; + Console.WriteLine("Employee number: {0}", Employee.Counter); + Console.WriteLine("Employee name: {0}", e1.Name); + } +} === added file 'Test/prototype.h' --- Test/prototype.h 1970-01-01 00:00:00 +0000 +++ Test/prototype.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,2 @@ +int prototype_a (int a, char *b); +extern void prototype_b (void); === added file 'Test/pure_elem.f95' --- Test/pure_elem.f95 1970-01-01 00:00:00 +0000 +++ Test/pure_elem.f95 2011-03-11 21:16:06 +0000 @@ -0,0 +1,37 @@ +! elemental +! +!Pure procedures are procedures declared with the PURE keyword and which +!satisfy certain constraints that ensure they have no side +!effects. They can be used in specification expressions and +!within FORALL constructs and statements. + +!Elemental procedures can be written in Fortran 95 using the ELEMENTAL +!keyword. Elemental procedures are automatically ``pure''. + +!Example: + + PURE REAL FUNCTION pure_func(x,y) ! pure okay + IMPLICIT NONE + REAL, INTENT(IN) :: x, y + pure_func = x*x + y*y + 2*x*y + ASIN(MIN(x/y,y/x)) + END FUNCTION pure_func + + PURE REAL FUNCTION F(x,y) ! pure broken returns 'PURE REAL FU' + IMPLICIT NONE + REAL, INTENT(IN) :: x, y + F = x*x + y*y + 2*x*y + ASIN(MIN(x/y,y/x)) + END FUNCTION F + + + ELEMENTAL REAL FUNCTION elem_maxabs(a,b) ! elemental broke + IMPLICIT NONE + REAL,INTENT(IN) :: a,b + elem_maxabs = MAX(ABS(a),ABS(b)) + END + + PURE REAL FUNCTION pure_maxabs2(a,b) ! pure okay + IMPLICIT NONE + REAL,INTENT(IN) :: a,b + pure_maxabs2 = MAX(ABS(a),ABS(b)) + END + === added file 'Test/random.sql' --- Test/random.sql 1970-01-01 00:00:00 +0000 +++ Test/random.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,100 @@ +/* +------------------------------------------------------------------------------ +URL: http://www.orafaq.com/scripts/plsql/random.txt +Filename: random.txt +Purpose: Random number/ string generator package +Author: Unknown +Original: http://www.orafaq.org/scripts/sql/random.txt +Edits: + 19990908 Phil Rand Added functions rand_string(), smaller(). +------------------------------------------------------------------------------ +*/ + +create or replace package random +is + procedure srand(new_seed in number); + procedure get_rand(r OUT number); + procedure get_rand_max(r OUT number, n IN number); + function rand return number; + function rand_max(n IN number) return number; + function rand_string(ssiz IN number) return varchar2; + function smaller(x IN number, y IN number) return number; + pragma restrict_references(rand, WNDS); + pragma restrict_references(rand_max, WNDS); + pragma restrict_references(random, WNDS, RNPS); + pragma restrict_references(rand_string, WNDS); + pragma restrict_references(smaller, WNDS); +end random; +/ + +create or replace package body random +is + multiplier constant number := 22695477; + increment constant number := 1; + "2^32" constant number := 2 ** 32; + "2^16" constant number := 2 ** 16; + "0x7fff" constant number := 32767; + Seed number := 1; + + function smaller(x IN number, y IN number) return number is + begin + if x <= y then + return x; + else + return y; + end if; + end smaller; + + function rand_string(ssiz IN number) return varchar2 is + i number; + m number; + c char; + result varchar2(2000) := ''; + begin + m := smaller(ssiz,2000); + for i in 1..m loop + c := substr('abcdefghijklmnopqrstuvwxyz0123456789',rand_max(36),1); + result := result || c; + end loop; + return result; + end rand_string; + + procedure srand(new_seed in number) is + begin + Seed := new_seed; + end srand; + + function rand return number is + begin + Seed := mod(multiplier * Seed + increment, "2^32"); + return bitand(Seed/"2^16", "0x7fff"); + end rand; + + procedure get_rand(r OUT number) is + begin + r := rand; + end get_rand; + + function rand_max(n IN number) return number is + begin + return mod(rand, n) + 1; + end rand_max; + + procedure get_rand_max(r OUT number, n IN number) is + begin + r := rand_max(n); + end get_rand_max; + +begin + select userenv('SESSIONID') + into Seed + from dual; +end random; +/ + +-- Some examples: +select random.rand_max(10) from dual; +select random.rand_max(10) from dual; +select random.rand_string(20) from dual; +select random.rand_string(20) from dual; + === added file 'Test/readlob.sql' --- Test/readlob.sql 1970-01-01 00:00:00 +0000 +++ Test/readlob.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,39 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/readlob.txt +rem Filename: readlob.sql +rem Purpose: Fetch LOB column values piece-wise from PL/SQL +rem Date: 12-Jun-2000 +rem Author: Frank Naude (frank@ibi.co.za) +rem ----------------------------------------------------------------------- + +set serveroutput on + +DROP TABLE lob_table; -- Create table to hols LOBs +CREATE TABLE lob_table ( + id INTEGER, + b_lob BLOB, + c_lob CLOB, + b_file BFILE ); + +INSERT INTO lob_table -- Create sample record + VALUES (1, EMPTY_BLOB(), 'abcde', NULL); + +DECLARE + clob_locator CLOB; + charbuf VARCHAR2(20); + read_offset INTEGER; + read_amount INTEGER; +BEGIN + -- First we need to get the lob locator + SELECT c_lob INTO clob_locator FROM lob_table WHERE id = 1; + + DBMS_OUTPUT.PUT_LINE('CLOB Size: ' || + DBMS_LOB.GETLENGTH(clob_locator)); + + -- Read LOB field contents + read_offset := 1; + read_amount := 20; + dbms_lob.read(clob_locator, read_amount, read_offset, charbuf); + dbms_output.put_line('CLOB Value: ' || charbuf); +END; +/ === added file 'Test/readlong.sql' --- Test/readlong.sql 1970-01-01 00:00:00 +0000 +++ Test/readlong.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,41 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/readlong.txt +rem Filename: readlong.sql +rem Purpose: Fetch Long column values piece-wise from PL/SQL +rem Date: 12-Jan-1999 +rem Author: Frank Naude (frank@ibi.co.za) +rem ----------------------------------------------------------------------- + +set serveroutput on + +-- Create test table +drop table longtable; +create table longtable (longcol long) tablespace TOOLS; +insert into longtable values ( rpad('x', 257, 'QWERTY') ); + +DECLARE + cur1 PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;; + rc NUMBER; + long_piece VARCHAR2(256); + piece_len INTEGER := 0; + long_tab DBMS_SQL.VARCHAR2S; + long_len INTEGER := 0; +BEGIN + DBMS_SQL.PARSE(cur1, 'select longcol from longtable', DBMS_SQL.NATIVE); + DBMS_SQL.DEFINE_COLUMN_LONG(cur1, 1); + rc := DBMS_SQL.EXECUTE(cur1); + rc := DBMS_SQL.FETCH_ROWS(cur1); -- Get one row + + -- Loop until all pieces of the long column are processed + LOOP + DBMS_SQL.COLUMN_VALUE_LONG(cur1, 1, 256, long_len, long_piece, piece_len); + EXIT WHEN piece_len = 0; + DBMS_OUTPUT.PUT_LINE('Long piece len='|| piece_len); + + long_tab( NVL(long_tab.LAST, 0)+1 ) := long_piece; -- Add piece to table + long_len := long_len + piece_len; + END LOOP; + DBMS_SQL.CLOSE_CURSOR(cur1); + DBMS_OUTPUT.PUT_LINE('Total long col fetched, len='|| long_len); +END; +/ === added file 'Test/recursive.f95' --- Test/recursive.f95 1970-01-01 00:00:00 +0000 +++ Test/recursive.f95 2011-03-11 21:16:06 +0000 @@ -0,0 +1,68 @@ +! result/recursive broken + MODULE approx + interface + + recursive function arcsin (angle, terms) ! no result keyword + double precision arcsin1 + double precision angle + integer terms + end function arcsin + + recursive function arcsin1 (angle, terms) result (value) ! no explicit type + double precision angle + integer terms + double precision value + end function arcsin1 + + double precision recursive function arcsin2 (angle, terms) result (value) ! type + recurs + double precision angle + integer terms + end function arcsin2 + + + ! only this function seems to be found + recursive double precision function arcsin3 (angle, terms) result (value ) ! recurs + type + double precision angle + integer terms + end function arcsin3 + + + end interface + double precision :: y + integer :: parts + END MODULE + + + MODULE approx2 + interface + + double precision recursive function as (angle, terms) result (value) ! type + recurs + double precision angle + integer terms + end function as + + recursive double precision function as1 (angle, terms) result (value ) ! recurs + type + double precision angle + integer terms + end function as1 + + ! but now I can see this one + recursive function as2 (angle, terms) ! no result keyword + double precision arcsin1 + double precision angle + integer terms + end function as2 + + ! .. and this one! + recursive function as3 (angle, terms) result (value) ! no explicit type + double precision angle + integer terms + double precision value + end function as3 + + + end interface + double precision :: z + integer :: parts2 + END MODULE + === added file 'Test/refcurs.sql' --- Test/refcurs.sql 1970-01-01 00:00:00 +0000 +++ Test/refcurs.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,75 @@ +rem ----------------------------------------------------------------------- +rem URL: http://www.orafaq.com/scripts/plsql/refcurs.txt +rem Filename: refcurs.sql +rem Purpose: Pass result sets (REF CURSOR) between procedures and +rem functions +rem Date: 15-Jun-2001 +rem Author: Frank Naude (frank@ibi.co.za) +rem ----------------------------------------------------------------------- + +set serveroutput on + +-- Define TYPES package separately to be available to all programming +-- environments... +CREATE OR REPLACE PACKAGE types AS + TYPE cursortyp is REF CURSOR; -- use weak form +END; +/ + +-- Create test package to demonstrate passing result sets... +CREATE OR REPLACE PACKAGE test_ref_cursor AS + PROCEDURE main; + FUNCTION get_cursor_ref(typ NUMBER) RETURN types.cursortyp; + PROCEDURE process_cursor(cur types.cursortyp); +END; +/ +show errors + + +CREATE OR REPLACE PACKAGE BODY test_ref_cursor AS + + -- Main program entry point + PROCEDURE main IS + BEGIN + process_cursor( get_cursor_ref(1) ); + process_cursor( get_cursor_ref(2) ); + END; + + -- Get and return a CURSOR REF/ Result Set + FUNCTION get_cursor_ref(typ NUMBER) RETURN types.cursortyp IS + cur types.cursortyp; + BEGIN + if typ = 1 THEN + OPEN cur FOR SELECT * FROM emp WHERE ROWNUM < 5; + ELSE + OPEN cur FOR SELECT * FROM dept WHERE ROWNUM < 5; + END IF; + RETURN cur; + END; + + -- Process rows for an EMP or DEPT cursor + PROCEDURE process_cursor(cur types.cursortyp) IS + empRec emp%ROWTYPE; + deptRec dept%ROWTYPE; + BEGIN + LOOP + FETCH cur INTO empRec; -- Maybe it was an EMP cursor, try to fetch... + EXIT WHEN cur%NOTFOUND; + dbms_output.put_line('EMP ROW: '||empRec.ename); + END LOOP; + EXCEPTION + WHEN ROWTYPE_MISMATCH THEN -- OK, so it was't EMP, let's try DEPT. + LOOP + FETCH cur INTO deptRec; + EXIT WHEN cur%NOTFOUND; + dbms_output.put_line('DEPT ROW: '||deptRec.dname); + END LOOP; + END; + +END; +/ +show errors + + +EXEC test_ref_cursor.main; + === added file 'Test/rojas.h' --- Test/rojas.h 1970-01-01 00:00:00 +0000 +++ Test/rojas.h 2011-03-11 21:16:06 +0000 @@ -0,0 +1,20 @@ +/* Problem reported by Emil Rojas on 22 May 2002 */ +/* Fixed by reinitializing statement when either of "extern", "static", or + * "typedef" keywords are read. + */ +# ifdef NOT_DEFINED + typedef unsigned long uint32 //; // remove comment before ";" to make ctags work +# endif + +extern "C" { + +typedef void * FooBar; +FooBar * afunc (const char * aparam); +struct astruct +{ + int m_member; +}; +typedef struct astruct astruct; +typedef uint32 (*FFunc) (const astruct * pP, int n); + +} === added file 'Test/secondary_fcn_name.js' --- Test/secondary_fcn_name.js 1970-01-01 00:00:00 +0000 +++ Test/secondary_fcn_name.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,40 @@ +/* + * ctags should return the following for parsing this file using: + * ctags -f - test.js + * functions + * D1 + * D2 + * D2A + * theAdd + * variables + * global + */ +function D1(a, b) +{ + var my_local_var1 = 'local'; + return a+b; +} +alert(D1(1,2)); // produces 3 + + +// Example D2 + +var D2=function(a, b) +{ + return a+b; +} +alert(D2(1,2)); // produces 3 + +var my_global_var1 = 'global'; + +// Example D2A + +// Tags should be generated for both: +// D2A +// theAdd +var D2A=function theAdd(a, b) +{ + return a+b; +} +alert(D2A(1,2)); // produces 3 +alert(theAdd(1,2)); // also produces 3 === added file 'Test/semicolon.f90' --- Test/semicolon.f90 1970-01-01 00:00:00 +0000 +++ Test/semicolon.f90 2011-03-11 21:16:06 +0000 @@ -0,0 +1,5 @@ + MODULE SEMI + + INTEGER (4) :: VAR1; INTEGER (4) VAR2 + + END MODULE SEMI === added file 'Test/signature.cpp' --- Test/signature.cpp 1970-01-01 00:00:00 +0000 +++ Test/signature.cpp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +/* Tests for collection of signature */ + +void foo (int a, char b) {} + +int bar (a, b) int a; char b; {} + +char *BAR::bar (char *c, double d[]) const {} + +void foobar __ARGS ((int a, char b)); === added file 'Test/simple.asp' --- Test/simple.asp 1970-01-01 00:00:00 +0000 +++ Test/simple.asp 2011-03-11 21:16:06 +0000 @@ -0,0 +1,14 @@ +' "_descriptions.asp" +' Documentation for my variables + +Const constDecl = 512 + +Dim lang_start '(htmlct.inc) char-index, use for multilanguage-strings +DIM lang_length '(htmlct.inc) num.chars to get, i.e. mid(str, lang_start, lang_length) +function HtmlCutout(lang, str) 'dig-out a piece of text from a multilang. string str + +dim lang_swe(230) 'translation-table for pagetitles, buttons, etc. +Function f_translate_9data(id,defaulttext,data) 'lookup lang_???(id) and insert data at $0,$1,... + +sub js_erroralert(txt) 'print inline-script to generate popup-window with txt + === added file 'Test/simple.bas' --- Test/simple.bas 1970-01-01 00:00:00 +0000 +++ Test/simple.bas 2011-03-11 21:16:06 +0000 @@ -0,0 +1,22 @@ +Gosub start + +Const one = 1 + +Common a As Integer +Dim b As Integer +DIM AS STRING str + +Type test + a As Integer + b As Integer +End Type + +Function f() + a = 3 +End Function + +start: + f() +Return + + === added file 'Test/simple.bb' --- Test/simple.bb 1970-01-01 00:00:00 +0000 +++ Test/simple.bb 2011-03-11 21:16:06 +0000 @@ -0,0 +1,20 @@ +Gosub start + +Const one# = 1.0 + +Global a +Dim b(100) + +Type test + Field a + Field b +End Type + +Function f() + a = 3 +End Function + +.start + f() +Return + === added file 'Test/simple.cbl' --- Test/simple.cbl 1970-01-01 00:00:00 +0000 +++ Test/simple.cbl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,30 @@ + IDENTIFICATION DIVISION. + PROGRAM-ID. Program-Name. + AUTHOR. Darren Hiebert. + + ENVIRONMENT DIVISION. + INPUT-OUPUT SECTION. + FILE-CONTROL. + SELECT File-Name ASSIGN TO "SAMPLE.DAT" + ORGANIZATION IS LINE SEQUENTIAL. + + DATA DIVISION. + FILE SECTION. + FD File-Name. + 01 File-Group-Name. + 02 File-Data-Item PIC 9(7). + + WORKING-STORAGE SECTION. + 01 Group-Name. + 02 Data-Item1 PIC 9 VALUE ZEROS. + 03 SH-WORK-MMDDYYYY PIC 9(08) VALUE 0. + 03 SH-WORK-MMDDYYYY-2 REDEFINES SH-WORK-MMDDYYYY. + 03 DW-DAYS-IN-MONTHS VALUE "312831303130313130313031". + 05 DW-DAYS-IN-MONTH OCCURS 12 TIMES + PIC 9(02). + + PROCEDURE DIVISION. + Begin. + STOP RUN. + + Subprogram-Name. === added file 'Test/simple.html' --- Test/simple.html 1970-01-01 00:00:00 +0000 +++ Test/simple.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + === added file 'Test/simple.js' --- Test/simple.js 1970-01-01 00:00:00 +0000 +++ Test/simple.js 2011-03-11 21:16:06 +0000 @@ -0,0 +1,101 @@ +/* + * ctags should return the following for parsing this file using: + * ctags -f - simple.js + * + * functions + * extra.validFunctionFour + * getHalfOf + * getHalfOf.calculate + * testlib.core.validFunctionSix + * testlib.validFunctionFive + * validFunctionOne + * validFunctionThree + * validFunctionThree.innerThree + * validFunctionTwo + * classes + * Database + * ValidClassTwo + * testlib.extras.ValidClassOne + * methods + * Database.executeQueryString + * Database.getTodaysDate + * ValidClassTwo.validMethodFour + * ValidClassTwo.validMethodThree + * testlib.extras.ValidClassOne.validMethodOne + * testlib.extras.ValidClassOne.validMethodTwo + * variables + * my_global_var1 + * my_global_var2 + * my_global_var3 + * my_global_var4 + */ + +validFunctionOne = function(a,b) {} + +function validFunctionTwo(a,b) {} + +function validFunctionThree(a,b) { + var innerThree = function(a,b) {} +} + +var my_global_var1 = 33; + +function extra.validFunctionFour(a,b) {} + +//pseudo-module setup +testlib = {} +testlib.core = {} +testlib.extras = {} + +var my_global_var2 = "Something"; + +testlib.validFunctionFive = function(a,b) {} + + var invalidInnerFunction = function(a,b) {} + +testlib.core.validFunctionSix = function(a,b) {} + +testlib.extras.ValidClassOne = function(a,b) { + this.a = a; +} + +testlib.extras.ValidClassOne.prototype = { + 'validMethodOne' : function(a,b) {}, + 'validMethodTwo' : function(a,b) {} +} + +ValidClassTwo = function () +{ + this.validMethodThree = function() {} + + // unnamed method + this.validMethodFour = () {} +} + +var my_global_var4 = document.getElementsByTagName("input"); +for (var i = 0; i < my_global_var4.length; i++) { + var originalvalue = my_global_var4[i].value; + my_global_var4[i].onchange = function () { + alert(this.value + " == " + originalvalue); + } +} + +function getHalfOf(num1, num2, num3) +{ + function calculate(number) + { + return number/2; + } + + var result=""; + result+=calculate(num1)+" "; + result+=calculate(num2)+" "; + result+=calculate(num3); +} + +var my_global_var3; + +Database.prototype.getTodaysDate = Database_getTodaysDate; +Database.prototype.executeQueryString = Db_executeQueryString; + + === added file 'Test/simple.ksh' --- Test/simple.ksh 1970-01-01 00:00:00 +0000 +++ Test/simple.ksh 2011-03-11 21:16:06 +0000 @@ -0,0 +1,7 @@ +#!/bin/ksh + +f1() { +} + +function f2 { +} === added file 'Test/simple.lua' --- Test/simple.lua 1970-01-01 00:00:00 +0000 +++ Test/simple.lua 2011-03-11 21:16:06 +0000 @@ -0,0 +1,16 @@ +-- Comment line + -- Indented comment line +test = {} + +function test.me_12a(one, two) + print"me_12a" +end + + + test.i_123 = function (x) + print"i_123" +end + + +test.me_12a(1,2) +test.i_123(1) === added file 'Test/simple.mak' --- Test/simple.mak 1970-01-01 00:00:00 +0000 +++ Test/simple.mak 2011-03-11 21:16:06 +0000 @@ -0,0 +1,19 @@ +A = 1 +B := 2 +define C +3 +endef +a.o: D = 4 + E = 5 +b.o: + ENV_VAR1=something command +$(obj)/raid6int1.c: F := 6 +default: + ENV_VAR2=something command +# COMMENT = nada +G = 7 # ignore comment +H = $(A:.y=.c) ${B:.l=.c} +export I = 8 +NO_TAG1 += \ +-DA=0x00000000L \ +-DB=0x00000000L === added file 'Test/simple.pb' --- Test/simple.pb 1970-01-01 00:00:00 +0000 +++ Test/simple.pb 2011-03-11 21:16:06 +0000 @@ -0,0 +1,18 @@ +Gosub start + +Global a.l +Dim b.l(100) + +Structure test + a.l + b.l +EndStructure + +Procedure f.l() + a = 3 +EndProcedure + +start: + f() +Return + === added file 'Test/simple.php' --- Test/simple.php 1970-01-01 00:00:00 +0000 +++ Test/simple.php 2011-03-11 21:16:06 +0000 @@ -0,0 +1,48 @@ +// Examples from PHP Language Reference at +// http://www.php.net/manual/en/langref.php + + + + + +function foo ($arg_1, $arg_2, ..., $arg_n) +{ + echo "Example function.\n"; + return $retval; +} + +class Cart +{ + var $items; // Items in our shopping cart + + // Add $num articles of $artnr to the cart + + function add_item ($artnr, $num) + { + $this->items[$artnr] += $num; + } + + // Take $num articles of $artnr out of the cart + + function remove_item ($artnr, $num) + { + if ($this->items[$artnr] > $num) { + $this->items[$artnr] -= $num; + return true; + } else { + return false; + } + } +} === added file 'Test/simple.pl' --- Test/simple.pl 1970-01-01 00:00:00 +0000 +++ Test/simple.pl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,11 @@ +=head1 NAME +Some stuff to ignore +package NotAPackage; +sub NotASub {} +=cut +package A::B; +sub MySub {} +use constant A => 3; +LABEL: +__END__ +sub IgnoreSub {} === added file 'Test/simple.py' --- Test/simple.py 1970-01-01 00:00:00 +0000 +++ Test/simple.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,60 @@ +"""A long string +literal +""" + +from bsddb import btopen + +# Public global constants + +VERSION = '1.2.0' + +# Flags for list() and children() +ALL = 0xff +KEY = 0x01 +TREEID = 0x02 +INDENT = 0x04 +DATA = 0x08 # Used by dbtreedata + +class one: + + def __init__(self, filename, pathsep='', treegap=64): + """Another string + literal""" + + def __private_function__(self, key, data): + + def public_function(self, key): + class this_is_ignored: + + def _pack(self, i, s): '''this is''' """a""" '''string + literal'''""" + class inside_string: + """ + + class so_is_this: + +def _test(test, code, outcome, exception): + def ignored_function(): + def more_nesting(): + class deeply_nested(): + def even_more(): + @blah class this is seen??? + @bleh def this also? good! + +if __name__ == '__main__': + +class two (one): + + def only(arg): + +# line continuation +class\ +three\ +(A, B, +C): + +def\ +foo( +x +, +y, z): === added file 'Test/simple.rb' --- Test/simple.rb 1970-01-01 00:00:00 +0000 +++ Test/simple.rb 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/ruby + +module ModuleExample + class ClassExample + def class_method + puts "in class_method" + end + def ClassExample.singleton_class_method + puts "in singleton_class_method" + end + def class_method_exclamation! + puts "in class_method_exclamation!" + end + def class_method_question? + puts "in class_method_question?" + end + def `(command) + return "just testing a backquote override" + end + end + def module_method + puts "in module_method" + end + def ModuleExample.singleton_module_method + puts "in singleton_module_method" + end +end + +ModuleExample::ClassExample.singleton_class_method === added file 'Test/simple.sh' --- Test/simple.sh 1970-01-01 00:00:00 +0000 +++ Test/simple.sh 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +#!/bin/sh + +f1() { +} + +function f2() { +} + +function _a_b() { +} === added file 'Test/simple.sml' --- Test/simple.sml 1970-01-01 00:00:00 +0000 +++ Test/simple.sml 2011-03-11 21:16:06 +0000 @@ -0,0 +1,86 @@ +(* This is a comment *) + +abstype abstype_name + +datatype suit = Spades | Hearts | Diamonds | Clubs + +exception Change + +fun dist (x:real, y:real):real = sqrt (x*x + y*y) + +fun checked_factorial n = + if n < 0 then + raise Factorial + else if n=0 then + 1 + else + n * checked_factorial (n-1) + +exception Factorial + +local + fun fact 0 = 1 + | fact n = n * fact (n-1) +in + fun checked_factorial n = + if n >= 0 then + fact n + else + raise Factorial +end + +functor Matcher (structure RegExp : REGEXP) :> MATCHER = struct + + structure RegExp = RegExp + + open RegExp + + fun match_is Zero cs k = false + | match_is One cs k = k cs + | match_is (Char c) nil _ = false + | match_is (Char c) (c'::cs) k = (c=c') andalso (k cs) + | match_is (Plus (r1, r2)) cs k = + (match_is r1 cs k) orelse (match_is r2 cs k) + | match_is (Times (r1, r2)) cs k = + match_is r1 cs (fn cs' => match_is r2 cs' k) + | match_is (r as Star r1) cs k = + (k cs) orelse match_is r1 cs (fn cs' => match_is r cs' k) + + fun match regexp string = + match_is regexp (String.explode string) + (fn nil => true | _ => false) + +end + +signature SUSP = sig + type 'a susp + val force : 'a susp -> 'a + val delay : (unit -> 'a) -> 'a susp +end + +structure Susp :> SUSP = struct + type 'a susp = unit -> 'a + fun force t = t () + fun delay (t : 'a susp) = + let + exception Impossible + val memo : 'a susp ref = ref (fn () => raise Impossible) + fun t' () = + let val r = t () in memo := (fn () => r); r end + in + memo := t'; + fn () => (!memo)() + end + fun loopback f = + let + exception Circular + val r = ref (fn () => raise Circular) + fun t () = force (!r) + in + r := f t ; t + end +end + +type hyperlink = { protocol : string, address : string, display : string } + +val dist : real * real -> real = fn (x:real, y:real) => sqrt (x*x + y*y) === added file 'Test/simple.tcl' --- Test/simple.tcl 1970-01-01 00:00:00 +0000 +++ Test/simple.tcl 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +# proc comment +proc simple1 + +class tcl_class + +itcl::class itcl_class + +public method method1 +protected method method2 +private method method3 === added file 'Test/simple.vim' --- Test/simple.vim 1970-01-01 00:00:00 +0000 +++ Test/simple.vim 2011-03-11 21:16:06 +0000 @@ -0,0 +1,114 @@ + +" These variables should be tagged +let g:var_global_scope = 1 +let s:var_script_scope = 1 +let var_script_default_scope = 1 +let forms#FT_TEXTFIELD = 'textfield' +let forms#form = { + \ 'title': 'Address Entry Form', + \ 'fields': [], + \ 'defaultbutton': 'ok', + \ 'fieldMap': {}, + \ 'hotkeyMap': {}, + \ } +let $env_var = 'something' + + +" These lets should be ignored +let &errorformat = "%A%.%#rror reported by parser: %m" +let @a = 'set register a' +let [a, b; rest] = ["aval", "bval", 3, 4] + +let + +" These lets should be ignored Vim variables are readonly +let v:version = 'something' + +" autogroups +augroup uncompress + au! + au BufEnter *.gz %!gunzip +augroup END + +" This deletes the autogroup and should be ignored +augroup! uncompress + +" Ensure line is ignored +augroup + +" commands +command! -nargs=+ SelectCmd :call s:DB_execSql("select " . ) +command! -nargs=* -complete=customlist,DB_settingsComplete DBSetOption :call s:DB_setMultipleOptions() +comma -bang + \NoSpaceBeforeContinue edit +com -nargs=1 -bang -complete=customlist,EditFileComplete + \ SpaceBeforeContinue edit +com -nargs=1 -bang + \-complete=customlist,EditFileComplete + \ -complete=file + \ ExtraLines edit + +" functions +fu Bar(arg) + let var_inside_func = [] +endf + +fu invalidFuncLowerCaseInitialLetter(arg) +endf + +function! Foo(arg) +endfunction + + fu IndentedFunction(arg) + endf + +function! Foo_SID(arg) +endfu + +function! s:Foo_scolon(arg) +endfunction + +function! s:validFuncLowerCaseInitialLetter(arg) +endfunction + +" New to Vim7 +let mydict = {'data': [0, 1, 2, 3]} +function mydict.len() dict + let var_in_func = 2 + let s:script_var_in_func = 2 + return len(self.data) +endfunction +echo mydict.len() + +function autoloadFunc#subdirname#Funcname() + echo "Done!" +endfunction + +function! forms#form.addTextField(fname, flabel, fvalue, hotkey) + let field = s:field.new(self, g:forms#FT_TEXTFIELD, a:fname, a:flabel, + \ a:fvalue, a:hotkey) + return field +endfunction + +" Invalid function, must start with an UPPER case letter +function e +endfunction + +" Shortest possible function name +function E +endfunction + +" Ensure it ingores the invalid function declaration +function s: +endfunction + +" Tags should be created for +" +" scdt +" ,,, +" ( +nnoremap :Tlist +map! scdt GetColumnDataType +inoremap ,,, diwi<pa>pa>kA +inoremap ( =PreviewFunctionSignature() + === added file 'Test/simple.vr' --- Test/simple.vr 1970-01-01 00:00:00 +0000 +++ Test/simple.vr 2011-03-11 21:16:06 +0000 @@ -0,0 +1,103 @@ +// Sample provide by Dave Eggum on 05 Sep 2002. +#define DEFAULT_INT 0 +#define DEFAULT_BIT 1'bz + +typedef class ExampleClass; + +program main { + ExampleClass oModel1, oModel2, oModel3; + integer i; + string s; + + oModel1 = new("first"); + oModel2 = new("second", 2); + oModel3 = new("third", 3); + + oModel1.setInt(5); + i = oModel1.getInt(); + + oModel2.m_bit; // BUG: this jump should fail... but doesn't + + oModel2.setData(8'o272); + oModel2.setData(8'hbA); + oModel2.setData(8'b1011_1010); + + s = oModel3.getName(); + + fork { + oModel3.wait(); + } { + oModel3.trigger(); + } + join all + + wait_child(); + + oModel3.setTrigger(void); +} + +class ExampleClass { + local integer m_int = DEFAULT_INT; + local bit m_bit = DEFAULT_BIT; + local bit [7:0] m_data = 8'hzz; + local string m_sName; + local event m_eTrigger; + + public task new(string sInstName, integer index = DEFAULT_INT) { + m_sName = sInstName; + m_int = index; + } + + public task setInt(integer i) { + m_int = i; + } + + public function integer getInt() { + getInt = m_int; + } + + public task setBit(bit b) { + m_bit = b; + } + + public function bit getBit() { + getBit = m_bit; + } + + public task setData(bit[7:0] data) { + m_data = data; + } + + public function bit[7:0] getData() { + getData = m_data; + } + + public task setName(string name) { + m_sName = name; + } + + public function string getName() { + getName = m_sName; + } + + public task wait() { + sync(ALL,m_eTrigger); + } + + public task trigger() { + trigger(m_eTrigger); + } + + public task setTrigger(event e); // prototype + public function event getTrigger(); // prototype +} + +task ExampleClass::setTrigger(event e) { + m_eTrigger = e; +} + +function event ExampleClass::getTrigger() { + getTrigger = m_eTrigger; +} + +// vim: sw=4:ts=4:expandtab === added file 'Test/spurious_label_tags.c' --- Test/spurious_label_tags.c 1970-01-01 00:00:00 +0000 +++ Test/spurious_label_tags.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,17 @@ +/* When run with --c-kinds=+lp option demonstrates spurious tags for statement + * following a label + */ +static void label_forced_tags(void) +{ +label1: + proto1(arg); +label2: + if (arg) + proto2(arg); +label3: + variable = 3; + while (condition) { + label4: + proto3(arg); + } +} === added file 'Test/sql_single_quote.sql' --- Test/sql_single_quote.sql 1970-01-01 00:00:00 +0000 +++ Test/sql_single_quote.sql 2011-03-11 21:16:06 +0000 @@ -0,0 +1,18 @@ +CREATE PROCEDURE "p1"( +) +BEGIN + SET someting = ChannelPath + '\' + ChannelName; +END; + +CREATE PROCEDURE "p2"( +) +BEGIN + SET someting = '''' + ChannelPath + ''''; +END; + +CREATE PROCEDURE "p3"( +) +BEGIN +END; + + === added file 'Test/state_machine.v' --- Test/state_machine.v 1970-01-01 00:00:00 +0000 +++ Test/state_machine.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,61 @@ +// Taken from http://www.europa.com/~celiac/fsm_samp.html + +// These are the symbolic names for states +parameter [1:0] //synopsys enum state_info + S0 = 2'h0, + S1 = 2'h1, + S2 = 2'h2, + S3 = 2'h3; + +// These are the current state and next state variables +reg [1:0] /* synopsys enum state_info */ state; +reg [1:0] /* synopsys enum state_info */ next_state; + + +// synopsys state_vector state + +always @ (state or y or x) +begin + next_state = state; + case (state) // synopsys full_case parallel_case + S0: begin + if (x) begin + next_state = S1; + end + else begin + + next_state = S2; + end + end + S1: begin + if (y) begin + next_state = S2; + end + else begin + next_state = S0; + end + end + S2: begin + if (x & y) begin + next_state = S3; + end + else begin + next_state = S0; + end + end + S3: begin + next_state = S0; + end + endcase +end + + +always @ (posedge clk or posedge reset) +begin + if (reset) begin + state <= S0; + end + else begin + state <= next_state; + end +end === added file 'Test/static_array.c' --- Test/static_array.c 1970-01-01 00:00:00 +0000 +++ Test/static_array.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,3 @@ +/* Demonstrates temporary bug caused by statement reinitialization */ +static wchar_t charset2uni[256] = { +}; === added file 'Test/stdcall.f' --- Test/stdcall.f 1970-01-01 00:00:00 +0000 +++ Test/stdcall.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,178 @@ +* Obtained from http://www.nag.com/local/nagping/np006a3.asp +* D02CJF Example Program Text +* Mark 14 Revised. NAG Copyright 1989. +* .. Parameters .. + CHARACTER RELABS*15 !NEW + INTEGER NOUT + PARAMETER (NOUT=6) + INTEGER N, IW + PARAMETER (N=3,IW=21*N+28) +* .. Scalars in Common .. + DOUBLE PRECISION H, XEND + INTEGER K +* .. Local Scalars .. + DOUBLE PRECISION PI, TOL, X + INTEGER I, IFAIL, J +* .. Local Arrays .. + DOUBLE PRECISION W(IW), Y(N) +* .. External Functions .. + DOUBLE PRECISION D02CJW, G, X01AAF + STDCALL EXTERNAL D02CJW, G, X01AAF !CHANGE +* .. External Subroutines .. + STDCALL EXTERNAL D02CJF, D02CJX, FCN, OUT !CHANGE +* .. Intrinsic Functions .. + INTRINSIC DBLE +* .. Common blocks .. + COMMON XEND, H, K +* .. Executable Statements .. + WRITE (NOUT,*) 'D02CJF Example Program Results' + RELABS = "Default" !NEW + XEND = 10.0D0 + PI = X01AAF(0.0D0) + WRITE (NOUT,*) + WRITE (NOUT,*) 'Case 1: intermediate output, root-finding' + DO 20 J = 4, 5 + TOL = 10.0D0**(-J) + WRITE (NOUT,*) + WRITE (NOUT,99999) ' Calculation with TOL =', TOL + X = 0.0D0 + Y(1) = 0.5D0 + Y(2) = 0.5D0 + Y(3) = PI/5.0D0 + K = 4 + H = (XEND-X)/DBLE(K+1) + WRITE (NOUT,*) ' X Y(1) Y(2) Y(3)' + IFAIL = 0 +* + CALL D02CJF(X,XEND,N,Y,FCN,TOL,VAL(LOC(RELABS)),VAL(7),OUT,G,W,!CHANGE + + IFAIL) +* + WRITE (NOUT,99998) ' Root of Y(1) = 0.0 at', X + WRITE (NOUT,99997) ' Solution is', (Y(I),I=1,N) + 20 CONTINUE + WRITE (NOUT,*) + WRITE (NOUT,*) + WRITE (NOUT,*) 'Case 2: no intermediate output, root-finding' + DO 40 J = 4, 5 + TOL = 10.0D0**(-J) + WRITE (NOUT,*) + WRITE (NOUT,99999) ' Calculation with TOL =', TOL + X = 0.0D0 + Y(1) = 0.5D0 + Y(2) = 0.5D0 + Y(3) = PI/5.0D0 + IFAIL = 0 +* + CALL D02CJF(X,XEND,N,Y,FCN,TOL,VAL(LOC(RELABS)),VAL(7),D02CJX, !CHANGE + + G,W,IFAIL) +* + WRITE (NOUT,99998) ' Root of Y(1) = 0.0 at', X + WRITE (NOUT,99997) ' Solution is', (Y(I),I=1,N) + 40 CONTINUE + WRITE (NOUT,*) + WRITE (NOUT,*) + WRITE (NOUT,*) 'Case 3: intermediate output, no root-finding' + DO 60 J = 4, 5 + TOL = 10.0D0**(-J) + WRITE (NOUT,*) + WRITE (NOUT,99999) ' Calculation with TOL =', TOL + X = 0.0D0 + Y(1) = 0.5D0 + Y(2) = 0.5D0 + Y(3) = PI/5.0D0 + K = 4 + H = (XEND-X)/DBLE(K+1) + WRITE (NOUT,*) ' X Y(1) Y(2) Y(3)' + IFAIL = 0 +* + CALL D02CJF(X,XEND,N,Y,FCN,TOL,VAL(LOC(RELABS)),VAL(7),OUT, CHANGE + + D02CJW,W,IFAIL) +* + 60 CONTINUE + WRITE (NOUT,*) + WRITE (NOUT,*) + WRITE (NOUT,*) + +'Case 4: no intermediate output, no root-finding ( integrate to XE + +ND)' + DO 80 J = 4, 5 + TOL = 10.0D0**(-J) + WRITE (NOUT,*) + WRITE (NOUT,99999) ' Calculation with TOL =', TOL + X = 0.0D0 + Y(1) = 0.5D0 + Y(2) = 0.5D0 + Y(3) = PI/5.0D0 + WRITE (NOUT,*) ' X Y(1) Y(2) Y(3)' + WRITE (NOUT,99996) X, (Y(I),I=1,N) + IFAIL = 0 +* + CALL D02CJF(X,XEND,N,Y,FCN,TOL,VAL(LOC(RELABS)),VAL(7),D02CJX, !CHANGE + + D02CJW,W,IFAIL) +* + WRITE (NOUT,99996) X, (Y(I),I=1,N) + 80 CONTINUE + STOP +* +99999 FORMAT (1X,A,D8.1) +99998 FORMAT (1X,A,F7.3) +99997 FORMAT (1X,A,3F13.5) +99996 FORMAT (1X,F8.2,3F13.5) + END +* + STDCALL SUBROUTINE OUT(X,Y) !CHANGE +* .. Parameters .. + INTEGER NOUT + PARAMETER (NOUT=6) + INTEGER N + PARAMETER (N=3) +* .. Scalar Arguments .. + DOUBLE PRECISION X +* .. Array Arguments .. + DOUBLE PRECISION Y(N) +* .. Scalars in Common .. + DOUBLE PRECISION H, XEND + INTEGER I +* .. Local Scalars .. + INTEGER J +* .. Intrinsic Functions .. + INTRINSIC DBLE +* .. Common blocks .. + COMMON XEND, H, I +* .. Executable Statements .. + WRITE (NOUT,99999) X, (Y(J),J=1,N) + X = XEND - DBLE(I)*H + I = I - 1 + RETURN +* +99999 FORMAT (1X,F8.2,3F13.5) + END +* + STDCALL SUBROUTINE FCN(T,Y,F) !CHANGE +* .. Parameters .. + INTEGER N + PARAMETER (N=3) +* .. Scalar Arguments .. + DOUBLE PRECISION T +* .. Array Arguments .. + DOUBLE PRECISION F(N), Y(N) +* .. Intrinsic Functions .. + INTRINSIC COS, TAN +* .. Executable Statements .. + F(1) = TAN(Y(3)) + F(2) = -0.032D0*TAN(Y(3))/Y(2) - 0.02D0*Y(2)/COS(Y(3)) + F(3) = -0.032D0/Y(2)**2 + RETURN + END +* + STDCALL DOUBLE PRECISION FUNCTION G(T,Y) !CHANGE +* .. Parameters .. + INTEGER N + PARAMETER (N=3) +* .. Scalar Arguments .. + DOUBLE PRECISION T +* .. Array Arguments .. + DOUBLE PRECISION Y(N) +* .. Executable Statements .. + G = Y(1) + RETURN + END === added file 'Test/structure.f' --- Test/structure.f 1970-01-01 00:00:00 +0000 +++ Test/structure.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,29 @@ + program uninitialized_structure + structure /weather/ + integer month, day, year + character*20 clouds + real rainfall + end structure + record /weather/ latest + end + + program initialized_structure + structure /weather/ + integer*1 month /08/, day /10/, year /89/ + character*20 clouds /' overcast'/ + real rainfall /3.12/ + end structure + record /weather/ latest + print *, latest.month, latest.day, latest.year, + + latest.clouds, latest.rainfall + end program + + program nested_structure + structure /top/ + structure /nested/ level2 + structure level3a, level3b + integer a + end structure + end structure + end structure + end program === added file 'Test/test.py' --- Test/test.py 1970-01-01 00:00:00 +0000 +++ Test/test.py 2011-03-11 21:16:06 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +def main(): + + return 0 + +if __name__ == '__main__': main() + +var = 'hi' +var2 = 'hi' # blah = blah === added file 'Test/test.vhd' --- Test/test.vhd 1970-01-01 00:00:00 +0000 +++ Test/test.vhd 2011-03-11 21:16:06 +0000 @@ -0,0 +1,8174 @@ +package body badger is +end package body; + +package body badger2 is +end package body badger2; + +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity accumulator is port ( + a: in std_logic_vector(3 downto 0); + clk, reset: in std_logic; + accum: out std_logic_vector(3 downto 0) + ); +end accumulator; + +architecture simple of accumulator is + +signal accumL: unsigned(3 downto 0); + +begin + + accumulate: process (clk, reset) begin + if (reset = '1') then + accumL <= "0000"; + elsif (clk'event and clk= '1') then + accumL <= accumL + to_unsigned(a); + end if; + end process; + + accum <= std_logic_vector(accumL); + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity adder is port ( + a,b : in std_logic_vector (15 downto 0); + sum: out std_logic_vector (15 downto 0) + ); +end adder; + +architecture dataflow of adder is + +begin + + sum <= a + b; + +end dataflow; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pAdderAttr is + generic(n : integer := 8); + port (a : in std_logic_vector(n - 1 downto 0); + b : in std_logic_vector(n - 1 downto 0); + cin : in std_logic; + sum : out std_logic_vector(n - 1 downto 0); + cout : out std_logic); +end pAdderAttr; + + +architecture loopDemo of pAdderAttr is + +begin + + process(a, b, cin) + variable carry: std_logic_vector(sum'length downto 0); + variable localSum: std_logic_vector(sum'high downto 0); + + begin + + carry(0) := cin; + + for i in sum'reverse_range loop + localSum(i) := (a(i) xor b(i)) xor carry(i); + carry(i + 1) := (a(i) and b(i)) or (carry(i) and (a(i) or b(i))); + end loop; + + sum <= localSum; + cout <= carry(carry'high - 1); + + end process; + +end loopDemo; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity adder is port ( + a,b: in unsigned(3 downto 0); + sum: out unsigned(3 downto 0) + ); +end adder; + +architecture simple of adder is + +begin + + sum <= a + b; + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity AND2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end AND2; + +architecture rtl of AND2 is + +begin + + y <= '1' when i1 = '1' and i2 = '1' else '0'; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity asyncLoad is port ( + loadVal, d: in std_logic_vector(3 downto 0); + clk, load: in std_logic; + q: out std_logic_vector(3 downto 0) + ); +end asyncLoad; + +architecture rtl of asyncLoad is + +begin + + process (clk, load, loadVal) begin + if (load = '1') then + q <= loadVal; + elsif (clk'event and clk = '1' ) then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity BidirBuf is port ( + OE: in std_logic; + input: in std_logic_vector; + output: out std_logic_vector + ); +end BidirBuf; + +architecture behavioral of BidirBuf is + +begin + + bidirBuf: process (OE, input) begin + if (OE = '1') then + output <= input; + else + output <= (others => 'Z'); + end if; + end process; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; + +entity BidirCnt is port ( + OE: in std_logic; + CntEnable: in std_logic; + LdCnt: in std_logic; + Clk: in std_logic; + Rst: in std_logic; + Cnt: inout std_logic_vector(3 downto 0) + ); +end BidirCnt; + +architecture behavioral of BidirCnt is + + component LoadCnt port ( + CntEn: in std_logic; + LdCnt: in std_logic; + LdData: in std_logic_vector(3 downto 0); + Clk: in std_logic; + Rst: in std_logic; + CntVal: out std_logic_vector(3 downto 0) + ); + end component; + + component BidirBuf port ( + OE: in std_logic; + input: in std_logic_vector; + output: inout std_logic_vector + ); + end component; + +signal CntVal: std_logic_vector(3 downto 0); +signal LoadVal: std_logic_vector(3 downto 0); + +begin + + u1: loadcnt port map (CntEn => CntEnable, + LdCnt => LdCnt, + LdData => LoadVal, + Clk => Clk, + Rst => Rst, + CntVal => CntVal + ); + + u2: bidirbuf port map (OE => oe, + input => CntVal, + output => Cnt + ); + + LoadVal <= Cnt; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; + +entity BIDIR is port ( + ip: in std_logic; + oe: in std_logic; + op_fb: out std_logic; + op: inout std_logic + ); +end BIDIR; + +architecture rtl of BIDIR is + +begin + + op <= ip when oe = '1' else 'Z'; + op_fb <= op; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity bidirbuffer is port ( + input: in std_logic; + enable: in std_logic; + feedback: out std_logic; + output: inout std_logic + ); +end bidirbuffer; + +architecture structural of bidirbuffer is + +begin + + u1: bidir port map (ip => input, + oe => enable, + op_fb => feedback, + op => output + ); + +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +entity clkGen is port ( + clk: in std_logic; + reset: in std_logic; + ClkDiv2, ClkDiv4, + ClkDiv6,ClkDiv8: out std_logic + ); +end clkGen; + +architecture behav of clkGen is + +subtype numClks is std_logic_vector(1 to 4); +subtype numPatterns is integer range 0 to 11; + +type clkTableType is array (numpatterns'low to numPatterns'high) of numClks; + +constant clkTable: clkTableType := clkTableType'( +-- ClkDiv8______ +-- ClkDiv6_____ | +-- ClkDiv4____ || +-- ClkDiv2 __ ||| +-- |||| + "1111", + "0111", + "1011", + "0001", + "1100", + "0100", + "1010", + "0010", + "1111", + "0001", + "1001", + "0101"); + +signal index: numPatterns; + +begin + + lookupTable: process (clk, reset) begin + if reset = '1' then + index <= 0; + elsif (clk'event and clk = '1') then + if index = numPatterns'high then + index <= numPatterns'low; + else + index <= index + 1; + end if; + end if; + end process; + + (ClkDiv2,ClkDiv4,ClkDiv6,ClkDiv8) <= clkTable(index); + +end behav; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + enable: in std_logic; + reset: in std_logic; + count: buffer unsigned(3 downto 0) + ); +end counter; + +architecture simple of counter is + +begin + + increment: process (clk, reset) begin + if reset = '1' then + count <= "0000"; + elsif(clk'event and clk = '1') then + if enable = '1' then + count <= count + 1; + else + count <= count; + end if; + end if; + end process; + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.scaleable.all; + +entity count8 is port ( + clk: in std_logic; + rst: in std_logic; + count: out std_logic_vector(7 downto 0) + ); +end count8; + +architecture structural of count8 is + +begin + + u1: scaleUpCnt port map (clk => clk, + reset => rst, + cnt => count + ); + +end structural; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(0 to 9) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(0 to 9); + +begin + + increment: process (clk, reset) begin + if reset = '1' then + countL <= to_unsigned(3,10); + elsif(clk'event and clk = '1') then + countL <= countL + 1; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(9 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(9 downto 0); + +begin + + increment: process (clk, reset) begin + if reset = '1' then + countL <= to_unsigned(0,10); + elsif(clk'event and clk = '1') then + countL <= countL + 1; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + load: in std_logic; + enable: in std_logic; + data: in std_logic_vector(3 downto 0); + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk, reset) begin + if (reset = '1') then + countL <= "0000"; + elsif(clk'event and clk = '1') then + if (load = '1') then + countL <= to_unsigned(data); + elsif (enable = '1') then + countL <= countL + 1; + end if; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + load: in std_logic; + data: in std_logic_vector(3 downto 0); + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk, reset) begin + if (reset = '1') then + countL <= "0000"; + elsif(clk'event and clk = '1') then + if (load = '1') then + countL <= to_unsigned(data); + else + countL <= countL + 1; + end if; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity Cnt4Term is port ( + clk: in std_logic; + Cnt: out std_logic_vector(3 downto 0); + TermCnt: out std_logic + ); +end Cnt4Term; + +architecture behavioral of Cnt4Term is + +signal CntL: unsigned(3 downto 0); + +begin + + increment: process begin + wait until clk = '1'; + CntL <= CntL + 1; + end process; + + Cnt <= to_stdlogicvector(CntL); + + TermCnt <= '1' when CntL = "1111" else '0'; + +end behavioral; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity Counter is port ( + clock: in std_logic; + Count: out std_logic_vector(3 downto 0) + ); +end Counter; + +architecture structural of Counter is + + component Cnt4Term port ( + clk: in std_logic; + Cnt: out std_logic_vector(3 downto 0); + TermCnt: out std_logic); + end component; + +begin + + u1: Cnt4Term port map (clk => clock, + Cnt => Count, + TermCnt => open + ); + +end structural; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk) begin + if(clk'event and clk = '1') then + if (reset = '1') then + countL <= "0000"; + else + countL <= countL + 1; + end if; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity convertArith is port ( + truncate: out unsigned(3 downto 0); + extend: out unsigned(15 downto 0); + direction: out unsigned(0 to 7) + ); +end convertArith; + +architecture simple of convertArith is + +constant Const: unsigned(7 downto 0) := "00111010"; + +begin + + truncate <= resize(Const, truncate'length); + extend <= resize(Const, extend'length); + direction <= resize(Const, direction'length); + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +architecture concurrent of FEWGATES is + +constant THREE: std_logic_vector(1 downto 0) := "11"; + +begin + + y <= '1' when (a & b = THREE) or (c & d /= THREE) else '0'; + +end concurrent; +-- incorporates Errata 12.1 + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity typeConvert is port ( + a: out unsigned(7 downto 0) + ); +end typeConvert; + +architecture simple of typeConvert is + +constant Const: natural := 43; + +begin + + a <= To_unsigned(Const,8); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk) begin + if (clk'event and clk = '1') then + countL <= countL + 1; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(0 to 3) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(0 to 3); + +begin + + increment: process (clk, reset) begin + if reset = '1' then + countL <= "1001"; + elsif(clk'event and clk = '1') then + countL <= countL + 1; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk, reset) begin + if (reset = '1') then + countL <= "0000"; + elsif(clk'event and clk = '1') then + countL <= countL + "001"; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk, reset) begin + if reset = '1' then + countL <= "1001"; + elsif(clk'event and clk = '1') then + countL <= countL + 1; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity counter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end counter; + +architecture simple of counter is + +signal countL: unsigned(3 downto 0); + +begin + + increment: process (clk, reset) begin + if (reset = '1') then + countL <= "1001"; + elsif(clk'event and clk = '1') then + countL <= countL + "0001"; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.decProcs.all; + +entity decoder is port ( + decIn: in std_logic_vector(1 downto 0); + decOut: out std_logic_vector(3 downto 0) + ); +end decoder; + +architecture simple of decoder is + +begin + + DEC2x4(decIn,decOut); + +end simple; + +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + + decOut_n: out std_logic_vector(5 downto 0) + +); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + + alias sio_dec_n: std_logic is decOut_n(5); + alias rst_ctrl_rd_n: std_logic is decOut_n(4); + alias atc_stat_rd_n: std_logic is decOut_n(3); + alias mgmt_stat_rd_n: std_logic is decOut_n(2); + alias io_int_stat_rd_n: std_logic is decOut_n(1); + alias int_ctrl_rd_n: std_logic is decOut_n(0); + + alias upper: std_logic_vector(2 downto 0) is dev_adr(19 downto 17); + alias CtrlBits: std_logic_vector(16 downto 0) is dev_adr(16 downto 0); + +begin + + decoder: process (upper, CtrlBits) + begin + -- Set defaults for outputs - for synthesis reasons. + + sio_dec_n <= '1'; + int_ctrl_rd_n <= '1'; + io_int_stat_rd_n <= '1'; + rst_ctrl_rd_n <= '1'; + atc_stat_rd_n <= '1'; + mgmt_stat_rd_n <= '1'; + + case upper is + + when SuperIoRange => + sio_dec_n <= '0'; + + when CtrlRegRange => + + case CtrlBits is + + when IntCtrlReg => + int_ctrl_rd_n <= '0'; + + when IoIntStatReg => + io_int_stat_rd_n <= '0'; + + when RstCtrlReg => + rst_ctrl_rd_n <= '0'; + + when AtcStatusReg => + atc_stat_rd_n <= '0'; + + when MgmtStatusReg => + mgmt_stat_rd_n <= '0'; + + when others => + null; + + end case; + + when others => + null; + + end case; + + end process decoder; + +end synthesis; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n: out std_logic; + int_ctrl_rd_n: out std_logic +); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + +begin + + decoder: process (dev_adr) + begin + -- Set defaults for outputs + + sio_dec_n <= '1'; + int_ctrl_rd_n <= '1'; + io_int_stat_rd_n <= '1'; + rst_ctrl_rd_n <= '1'; + atc_stat_rd_n <= '1'; + mgmt_stat_rd_n <= '1'; + + case dev_adr(19 downto 17) is + + when SuperIoRange => + sio_dec_n <= '0'; + + when CtrlRegRange => + + case dev_adr(16 downto 0) is + + when IntCtrlReg => + int_ctrl_rd_n <= '0'; + + when IoIntStatReg => + io_int_stat_rd_n <= '0'; + + when RstCtrlReg => + rst_ctrl_rd_n <= '0'; + + when AtcStatusReg => + atc_stat_rd_n <= '0'; + + when MgmtStatusReg => + mgmt_stat_rd_n <= '0'; + + when others => + null; + + end case; + + when others => + null; + + end case; + + end process decoder; + +end synthesis; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n:out std_logic; + int_ctrl_rd_n: out std_logic + ); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + +begin + sio_dec_n <= '0' when dev_adr (19 downto 17) = SuperIORange else '1'; + + int_ctrl_rd_n <= '0' when (dev_adr (19 downto 17) = CtrlRegRange) + and (dev_adr(16 downto 0) = IntCtrlReg) else '1'; + + io_int_stat_rd_n <= '0' when (dev_adr (19 downto 17) = CtrlRegRange) + and (dev_adr(16 downto 0) = IoIntStatReg) else '1'; + + rst_ctrl_rd_n <= '0' when (dev_adr (19 downto 17) = CtrlRegRange) + and (dev_adr(16 downto 0) = RstCtrlReg) else '1'; + + atc_stat_rd_n <= '0' when (dev_adr (19 downto 17) = CtrlRegRange) + and (dev_adr(16 downto 0) = AtcStatusReg) else '1'; + + mgmt_stat_rd_n <= '0' when (dev_adr (19 downto 17) = CtrlRegRange) + and (dev_adr(16 downto 0) = MgmtStatusReg) else '1'; + + +end synthesis; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + cs0_n: in std_logic; + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n: out std_logic; + int_ctrl_rd_n: out std_logic +); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + +begin + + decoder: process (dev_adr, cs0_n) + begin + -- Set defaults for outputs - for synthesis reasons. + + sio_dec_n <= '1'; + int_ctrl_rd_n <= '1'; + io_int_stat_rd_n <= '1'; + rst_ctrl_rd_n <= '1'; + atc_stat_rd_n <= '1'; + mgmt_stat_rd_n <= '1'; + + if (cs0_n = '0') then + case dev_adr(19 downto 17) is + + when SuperIoRange => + sio_dec_n <= '0'; + + when CtrlRegRange => + + case dev_adr(16 downto 0) is + + when IntCtrlReg => + int_ctrl_rd_n <= '0'; + + when IoIntStatReg => + io_int_stat_rd_n <= '0'; + + when RstCtrlReg => + rst_ctrl_rd_n <= '0'; + + when AtcStatusReg => + atc_stat_rd_n <= '0'; + + when MgmtStatusReg => + mgmt_stat_rd_n <= '0'; + + when others => + null; + + end case; + + when others => + null; + + end case; + else + null; + end if; + + end process decoder; + +end synthesis; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + cs0_n: in std_logic; + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n: out std_logic; + int_ctrl_rd_n: out std_logic +); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + + signal Lsio_dec_n: std_logic; + signal Lrst_ctrl_rd_n: std_logic; + signal Latc_stat_rd_n: std_logic; + signal Lmgmt_stat_rd_n: std_logic; + signal Lio_int_stat_rd_n: std_logic; + signal Lint_ctrl_rd_n: std_logic; + +begin + + decoder: process (dev_adr) + begin + -- Set defaults for outputs - for synthesis reasons. + + Lsio_dec_n <= '1'; + Lint_ctrl_rd_n <= '1'; + Lio_int_stat_rd_n <= '1'; + Lrst_ctrl_rd_n <= '1'; + Latc_stat_rd_n <= '1'; + Lmgmt_stat_rd_n <= '1'; + + case dev_adr(19 downto 17) is + + when SuperIoRange => + Lsio_dec_n <= '0'; + + when CtrlRegRange => + + case dev_adr(16 downto 0) is + + when IntCtrlReg => + Lint_ctrl_rd_n <= '0'; + + when IoIntStatReg => + Lio_int_stat_rd_n <= '0'; + + when RstCtrlReg => + Lrst_ctrl_rd_n <= '0'; + + when AtcStatusReg => + Latc_stat_rd_n <= '0'; + + when MgmtStatusReg => + Lmgmt_stat_rd_n <= '0'; + + when others => + null; + + end case; + + when others => + null; + + end case; + + end process decoder; + + qualify: process (cs0_n) begin + + sio_dec_n <= '1'; + int_ctrl_rd_n <= '1'; + io_int_stat_rd_n <= '1'; + rst_ctrl_rd_n <= '1'; + atc_stat_rd_n <= '1'; + mgmt_stat_rd_n <= '1'; + + if (cs0_n = '0') then + sio_dec_n <= Lsio_dec_n; + int_ctrl_rd_n <= Lint_ctrl_rd_n; + io_int_stat_rd_n <= Lio_int_stat_rd_n; + rst_ctrl_rd_n <= Lrst_ctrl_rd_n; + atc_stat_rd_n <= Latc_stat_rd_n; + mgmt_stat_rd_n <= Lmgmt_stat_rd_n; + else + null; + end if; + end process qualify; + +end synthesis; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n: out std_logic; + int_ctrl_rd_n: out std_logic +); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + +begin + + decoder: process ( dev_adr) + begin + -- Set defaults for outputs - for synthesis reasons. + + sio_dec_n <= '1'; + int_ctrl_rd_n <= '1'; + io_int_stat_rd_n <= '1'; + rst_ctrl_rd_n <= '1'; + atc_stat_rd_n <= '1'; + mgmt_stat_rd_n <= '1'; + + if dev_adr(19 downto 17) = SuperIOrange then + + sio_dec_n <= '0'; + + elsif dev_adr(19 downto 17) = CtrlRegrange then + + if dev_adr(16 downto 0) = IntCtrlReg then + + int_ctrl_rd_n <= '0'; + + elsif dev_adr(16 downto 0)= IoIntStatReg then + + io_int_stat_rd_n <= '0'; + + elsif dev_adr(16 downto 0) = RstCtrlReg then + + rst_ctrl_rd_n <= '0'; + + elsif dev_adr(16 downto 0) = AtcStatusReg then + + atc_stat_rd_n <= '0'; + + elsif dev_adr(16 downto 0) = MgmtStatusReg then + + mgmt_stat_rd_n <= '0'; + + else + + null; + + end if; + + else + + null; + + end if; + + end process decoder; + +end synthesis; +library IEEE; +use IEEE.std_logic_1164.all; + +package decProcs is + + procedure DEC2x4 (inputs : in std_logic_vector(1 downto 0); + decode: out std_logic_vector(3 downto 0) + ); +end decProcs; + +package body decProcs is + + procedure DEC2x4 (inputs : in std_logic_vector(1 downto 0); + decode: out std_logic_vector(3 downto 0) + ) is + begin + case inputs is + when "11" => + decode := "1000"; + when "10" => + decode := "0100"; + when "01" => + decode := "0010"; + when "00" => + decode := "0001"; + when others => + decode := "0001"; + end case; + end DEC2x4; + +end decProcs; +library ieee; +use ieee.std_logic_1164.all; + +entity isa_dec is port +( + dev_adr: in std_logic_vector(19 downto 0); + + sio_dec_n: out std_logic; + rst_ctrl_rd_n: out std_logic; + atc_stat_rd_n: out std_logic; + mgmt_stat_rd_n: out std_logic; + io_int_stat_rd_n:out std_logic; + int_ctrl_rd_n: out std_logic + ); +end isa_dec; + + +architecture synthesis of isa_dec is + + constant CtrlRegRange: std_logic_vector(2 downto 0) := "100"; + constant SuperIoRange: std_logic_vector(2 downto 0) := "010"; + + constant IntCtrlReg: std_logic_vector(16 downto 0) := "00000000000000000"; + constant IoIntStatReg: std_logic_vector(16 downto 0) := "00000000000000001"; + constant RstCtrlReg: std_logic_vector(16 downto 0) := "00000000000000010"; + constant AtcStatusReg: std_logic_vector(16 downto 0) := "00000000000000011"; + constant MgmtStatusReg:std_logic_vector(16 downto 0) := "00000000000000100"; + +begin + with dev_adr(19 downto 17) select + sio_dec_n <= '0' when SuperIORange, + '1' when others; + + with dev_adr(19 downto 0) select + int_ctrl_rd_n <= '0' when CtrlRegRange & IntCtrlReg, + '1' when others; + + with dev_adr(19 downto 0) select + io_int_stat_rd_n <= '0' when CtrlRegRange & IoIntStatReg, + '1' when others; + + with dev_adr(19 downto 0) select + rst_ctrl_rd_n <= '0' when CtrlRegRange & RstCtrlReg, + '1' when others; + + with dev_adr(19 downto 0) select + atc_stat_rd_n <= '0' when CtrlRegRange & AtcStatusReg, + '1' when others; + + with dev_adr(19 downto 0) select + mgmt_stat_rd_n <= '0' when CtrlRegRange & MgmtStatusReg, + '1' when others; + + +end synthesis; +-- Incorporates Errata 5.1 and 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity progPulse is port ( + clk, reset: in std_logic; + loadLength,loadDelay: in std_logic; + data: in std_logic_vector(7 downto 0); + pulse: out std_logic + ); +end progPulse; + +architecture rtl of progPulse is + +signal delayCnt, pulseCnt: unsigned(7 downto 0); +signal delayCntVal, pulseCntVal: unsigned(7 downto 0); +signal startPulse, endPulse: std_logic; + +begin + + delayReg: process (clk, reset) begin + if reset = '1' then + delayCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadDelay = '1' then + delayCntVal <= unsigned(data); + end if; + end if; + end process; + + lengthReg: process (clk, reset) begin + if reset = '1' then + pulseCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadLength = '1' then -- changed loadLength to loadDelay (Errata 5.1) + pulseCntVal <= unsigned(data); + end if; + end if; + end process; + + pulseDelay: process (clk, reset) begin + if (reset = '1') then + delayCnt <= "11111111"; + elsif(clk'event and clk = '1') then + if (loadDelay = '1' or loadLength = '1' or endPulse = '1') then -- changed startPulse to endPulse (Errata 5.1) + delayCnt <= delayCntVal; + elsif endPulse = '1' then + delayCnt <= delayCnt - 1; + end if; + end if; + end process; + + startPulse <= '1' when delayCnt = "00000000" else '0'; + + pulseLength: process (clk, reset) begin + if (reset = '1') then + pulseCnt <= "11111111"; + elsif (clk'event and clk = '1') then + if (loadLength = '1') then + pulseCnt <= pulseCntVal; + elsif (startPulse = '1' and endPulse = '1') then + pulseCnt <= pulseCntVal; + elsif (endPulse = '1') then + pulseCnt <= pulseCnt; + else + pulseCnt <= pulseCnt - 1; + end if; + end if; + end process; + + endPulse <= '1' when pulseCnt = "00000000" else '0'; + + pulseOutput: process (clk, reset) begin + if (reset = '1') then + pulse <= '0'; + elsif (clk'event and clk = '1') then + if (startPulse = '1') then + pulse <= '1'; + elsif (endPulse = '1') then + pulse <= '0'; + end if; + end if; + end process; + + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + arst : in std_logic; + q: out std_logic; + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + if arst = '1' then + q <= '0'; + elsif clk'event and clk = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + a,b,c : in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk, a,b,c) begin + if ((a = '1' and b = '1') or c = '1') then + q <= '0'; + elsif clk'event and clk = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + a,b,c : in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +signal localRst: std_logic; + +begin + + localRst <= '1' when (( a = '1' and b = '1') or c = '1') else '0'; + + process (clk, localRst) begin + if localRst = '1' then + q <= '0'; + elsif clk'event and clk = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + arst: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk, arst) begin + if arst = '1' then + q <= '0'; + elsif clk'event and clk = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + aset : in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk, aset) begin + if aset = '1' then + q <= '1'; + elsif clk'event and clk = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d1, d2: in std_logic; + clk: in std_logic; + arst : in std_logic; + q1, q2: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk, arst) begin + if arst = '1' then + q1 <= '0'; + q2 <= '1'; + elsif clk'event and clk = '1' then + q1 <= d1; + q2 <= d2; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process begin + if clk'event and clk = '1' then + if en = '1' then + q <= d; + end if; + end if; + wait on clk; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFFE is port ( + d: in std_logic; + en: in std_logic; + clk: in std_logic; + q: out std_logic + ); +end DFFE; + +architecture rtl of DFFE is + +begin + + process begin + wait until clk = '1'; + if en = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + envector: in std_logic_vector(7 downto 0); + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + if clk'event and clk = '1' then + if envector = "10010111" then + q <= d; + end if; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + if clk'event and clk = '1' then + if en = '1' then + q <= d; + end if; + end if; + end process; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFFE_SR is port ( + d: in std_logic; + en: in std_logic; + clk: in std_logic; + rst: in std_logic; + prst: in std_logic; + q: out std_logic + ); +end DFFE_SR; + +architecture rtl of DFFE_SR is + +begin + + process (clk, rst, prst) begin + if (prst = '1') then + q <= '1'; + elsif (rst = '1') then + q <= '0'; + elsif (clk'event and clk = '1') then + if (en = '1') then + q <= d; + end if; + end if; + end process; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity flipFlop is port ( + clock, input: in std_logic; + ffOut: out std_logic + ); +end flipFlop; + +architecture simple of flipFlop is + + procedure dff (signal clk: in std_logic; + signal d: in std_logic; + signal q: out std_logic + ) is + begin + if clk'event and clk = '1' then + q <= d; + end if; + end procedure dff; + +begin + + dff(clock, input, ffOut); + +end simple; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + end: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process begin + wait until rising_edge(clk); + if en = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d1, d2: in std_logic; + clk: in std_logic; + srst : in std_logic; + q1, q2: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + if clk'event and clk = '1' then + if srst = '1' then + q1 <= '0'; + q2 <= '1'; + else + q1 <= d1; + q2 <= d2; + end if; + end if; + end process; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFFE_SR is port ( + d: in std_logic; + en: in std_logic; + clk: in std_logic; + rst: in std_logic; + prst: in std_logic; + q: out std_logic + ); +end DFFE_SR; + +architecture rtl of DFFE_SR is + +begin + + process (clk, rst, prst) begin + if (rst = '1') then + q <= '0'; + elsif (prst = '1') then + q <= '1'; + elsif (clk'event and clk = '1') then + if (en = '1') then + q <= d; + end if; + end if; + end process; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + srst : in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process begin + wait until clk = '1'; + if srst = '1' then + q <= '0'; + else + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity struct_dffe_sr is port ( + d: in std_logic; + clk: in std_logic; + en: in std_logic; + rst,prst: in std_logic; + q: out std_logic + ); +end struct_dffe_sr; + +use work.primitive.all; + +architecture instance of struct_dffe_sr is + +begin + + ff: dffe_sr port map ( + d => d, + clk => clk, + en => en, + rst => rst, + prst => prst, + q => q + ); + +end instance; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + srst : in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + if clk'event and clk = '1' then + if srst = '1' then + q <= '0'; + else + q <= d; + end if; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity struct_dffe is port ( + d: in std_logic; + clk: in std_logic; + en: in std_logic; + q: out std_logic + ); +end struct_dffe; + +use work.primitive.all; + +architecture instance of struct_dffe is + +begin + + ff: dffe port map ( + d => d, + clk => clk, + en => en, + q => q + ); + +end instance; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity dffTri is + generic (size: integer := 8); + port ( + data: in std_logic_vector(size - 1 downto 0); + clock: in std_logic; + ff_enable: in std_logic; + op_enable: in std_logic; + qout: out std_logic_vector(size - 1 downto 0) + ); +end dffTri; + +architecture parameterize of dffTri is + +type tribufType is record + ip: std_logic; + oe: std_logic; + op: std_logic; +end record; + +type tribufArrayType is array (integer range <>) of tribufType; + +signal tri: tribufArrayType(size - 1 downto 0); + +begin + + g0: for i in 0 to size - 1 generate + u1: DFFE port map (data(i), tri(i).ip, ff_enable, clock); + end generate; + + g1: for i in 0 to size - 1 generate + u2: TRIBUF port map (tri(i).ip, tri(i).oe, tri(i).op); + tri(i).oe <= op_enable; + qout(i) <= tri(i).op; + end generate; + +end parameterize; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process begin + wait until clk = '1'; + if en = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF is port ( + ip: in std_logic; + oe: in std_logic; + op: out std_logic bus + ); +end TRIBUF; + +architecture sequential of TRIBUF is + +begin + + enable: process (ip,oe) begin + if (oe = '1') then + op <= ip; + else + op <= null; + end if; + end process; + +end sequential; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DLATCHH is port ( + d: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DLATCHH; + +architecture rtl of DLATCHH is + +signal qLocal: std_logic; + +begin + + qLocal <= d when en = '1' else qLocal; + + q <= qLocal; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DLATCHH is port ( + d: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DLATCHH; + +architecture rtl of DLATCHH is + +begin + + process (en, d) begin + if en = '1' then + q <= d; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity struct_dlatch is port ( + d: in std_logic; + en: in std_logic; + q: out std_logic + ); +end struct_dlatch; + +use work.primitive.all; + +architecture instance of struct_dlatch is + +begin + + latch: dlatchh port map ( + d => d, + en => en, + q => q + ); + +end instance; +-- Incorporates Errata 5.4 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity downCounter is port ( + clk: in std_logic; + reset: in std_logic; + count: out std_logic_vector(3 downto 0) + ); +end downCounter; + +architecture simple of downCounter is + +signal countL: unsigned(3 downto 0); +signal termCnt: std_logic; + +begin + + decrement: process (clk, reset) begin + if (reset = '1') then + countL <= "1011"; -- Reset to 11 + termCnt <= '1'; + elsif(clk'event and clk = '1') then + if (termCnt = '1') then + countL <= "1011"; -- Count rolls over to 11 + else + countL <= countL - 1; + end if; + + if (countL = "0001") then -- Terminal count decoded 1 cycle earlier + termCnt <= '1'; + else + termCnt <= '0'; + end if; + end if; + end process; + + count <= std_logic_vector(countL); + +end simple; +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_unsigned.all; + +entity compareDC is port ( + addressBus: in std_logic_vector(31 downto 0); + addressHit: out std_logic + ); +end compareDC; + +architecture wontWork of compareDC is + +begin + + compare: process(addressBus) begin + if (addressBus = "011110101011--------------------") then + addressHit <= '1'; + else + addressHit <= '0'; + end if; + end process compare; + +end wontWork; +library ieee; +use ieee.std_logic_1164.all; +entity encoder is + port (invec: in std_logic_vector(7 downto 0); + enc_out: out std_logic_vector(2 downto 0) + ); +end encoder; + +architecture rtl of encoder is + +begin + + encode: process (invec) begin + case invec is + when "00000001" => + enc_out <= "000"; + + when "00000010" => + enc_out <= "001"; + + when "00000100" => + enc_out <= "010"; + + when "00001000" => + enc_out <= "011"; + + when "00010000" => + enc_out <= "100"; + + when "00100000" => + enc_out <= "101"; + + when "01000000" => + enc_out <= "110"; + + when "10000000" => + enc_out <= "111"; + + when others => + enc_out <= "000"; + + end case; + end process; + +end rtl; +library ieee; +use ieee.std_logic_1164.all; + +entity encoder is + port (invec:in std_logic_vector(7 downto 0); + enc_out:out std_logic_vector(2 downto 0) + ); +end encoder; + +architecture rtl of encoder is +begin + process (invec) + begin + if invec(7) = '1' then + enc_out <= "111"; + + elsif invec(6) = '1' then + enc_out <= "110"; + + elsif invec(5) = '1' then + enc_out <= "101"; + + elsif invec(4) = '1' then + enc_out <= "100"; + + elsif invec(3) = '1' then + enc_out <= "011"; + + elsif invec(2) = '1' then + enc_out <= "010"; + + elsif invec(1) = '1' then + enc_out <= "001"; + + elsif invec(0) = '1' then + enc_out <= "000"; + + else + enc_out <= "000"; + end if; + end process; +end rtl; + +library ieee; +use ieee.std_logic_1164.all; +entity encoder is + port (invec: in std_logic_vector(7 downto 0); + enc_out: out std_logic_vector(2 downto 0) + ); +end encoder; + +architecture rtl of encoder is + +begin + enc_out <= "111" when invec(7) = '1' else + "110" when invec(6) = '1' else + "101" when invec(5) = '1' else + "100" when invec(4) = '1' else + "011" when invec(3) = '1' else + "010" when invec(2) = '1' else + "001" when invec(1) = '1' else + "000" when invec(0) = '1' else + "000"; + +end rtl; +-- includes Errata 5.2 +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; -- errata 5.2 + +entity compare is port ( + ina: in std_logic_vector (3 downto 0); + inb: in std_logic_vector (2 downto 0); + equal: out std_logic + ); +end compare; + +architecture simple of compare is + +begin + + equalProc: process (ina, inb) begin + if (ina = inb ) then + equal <= '1'; + else + equal <= '0'; + end if; + end process; + +end simple; +library IEEE; +use IEEE.std_logic_1164.all; + +entity LogicFcn is port ( + A: in std_logic; + B: in std_logic; + C: in std_logic; + Y: out std_logic + ); +end LogicFcn; + +architecture behavioral of LogicFcn is + +begin + + fcn: process (A,B,C) begin + + if (A = '0' and B = '0') then + Y <= '1'; + elsif C = '1' then + Y <= '1'; + else + Y <= '0'; + end if; + + end process; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; + +entity LogicFcn is port ( + A: in std_logic; + B: in std_logic; + C: in std_logic; + Y: out std_logic + ); +end LogicFcn; + +architecture dataflow of LogicFcn is + +begin + + Y <= '1' when (A = '0' AND B = '0') OR + (C = '1') + else '0'; + +end dataflow; +library IEEE; +use IEEE.std_logic_1164.all; +use work.primitive.all; + +entity LogicFcn is port ( + A: in std_logic; + B: in std_logic; + C: in std_logic; + Y: out std_logic + ); +end LogicFcn; + +architecture structural of LogicFcn is + +signal notA, notB, andSignal: std_logic; + +begin + + i1: inverter port map (i => A, + o => notA); + + i2: inverter port map (i => B, + o => notB); + + a1: and2 port map (i1 => notA, + i2 => notB, + y => andSignal); + + o1: or2 port map (i1 => andSignal, + i2 => C, + y => Y); + +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +entity SimDFF is port ( + D, Clk: in std_logic; + Q: out std_logic + ); +end SimDff; + +architecture SimModel of SimDFF is + +constant tCQ: time := 8 ns; +constant tS: time := 4 ns; +constant tH: time := 3 ns; + +begin + + reg: process (Clk, D) begin + + -- Assign output tCQ after rising clock edge + if (Clk'event and Clk = '1') then + Q <= D after tCQ; + end if; + + -- Check setup time + if (Clk'event and Clk = '1') then + assert (D'last_event >= tS) + report "Setup time violation" + severity Warning; + end if; + + -- Check hold time + if (D'event and Clk'stable and Clk = '1') then + assert (D'last_event - Clk'last_event > tH) + report "Hold Time Violation" + severity Warning; + end if; + + end process; + +end simModel; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process (clk) begin + wait until clk = '1'; + q <= d; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d: in std_logic; + clk: in std_logic; + q: out std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + process begin + wait until clk = '1'; + q <= d; + + wait on clk; + end process; + +end rtl; +configuration SimpleGatesCfg of FEWGATES is + + for structural + + for all: AND2 + use entity work.and2(rtl); + end for; + + for u3: inverter + use entity work.inverter(rtl); + end for; + + for u4: or2 + use entity work.or2(rtl); + end for; + + end for; + +end SimpleGatesCfg; +configuration SimpleGatesCfg of FEWGATES is + + for structural + + for u1: and2 + use entity work.and2(rtl); + end for; + + for u2: and2 + use entity work.and2(rtl); + end for; + + for u3: inverter + use entity work.inverter(rtl); + end for; + + for u4: or2 + use entity work.or2(rtl); + end for; + + end for; + +end SimpleGatesCfg; +library IEEE; +use IEEE.std_logic_1164.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +use work.and2; +use work.or2; +use work.inverter; + +architecture structural of FEWGATES is + + component AND2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component OR2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component INVERTER port ( + i: in std_logic; + o: out std_logic + ); + end component; + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +begin + + u1: and2 port map (i1 => a , + i2 => b, + y => a_and_b + ); + + u2: and2 port map (i1 => c, + i2 => d, + y => c_and_d + ); + + u3: inverter port map (i => c_and_d, + o => not_c_and_d); + + u4: or2 port map (i1 => a_and_b, + i2 => not_c_and_d, + y => y + ); +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +use work.and2; +use work.or2; +use work.inverter; + +architecture structural of FEWGATES is + + component AND2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component OR2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component INVERTER port ( + i: in std_logic; + o: out std_logic + ); + end component; + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +-- Configution specifications + +for all: and2 use entity work.and2(rtl); +for u3: inverter use entity work.inverter(rtl); +for u4: or2 use entity work.or2(rtl); + +begin + + u1: and2 port map (i1 => a, i2 => b, + y => a_and_b + ); + + u2: and2 port map (i1 => c, i2 => d, + y => c_and_d + ); + + u3: inverter port map (i => c_and_d, + o => not_c_and_d); + + u4: or2 port map (i1 => a_and_b, i2 => not_c_and_d, + y => y + ); +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +use work.GatesPkg.all; + +architecture structural of FEWGATES is + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +begin + + u1: and2 port map (i1 => a , + i2 => b, + y => a_and_b + ); + + u2: and2 port map (i1 => c, + i2 => d, + y => c_and_d + ); + + u3: inverter port map (i => c_and_d, + o => not_c_and_d); + + u4: or2 port map (i1 => a_and_b, + i2 => not_c_and_d, + y => y + ); +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +architecture concurrent of FEWGATES is + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +begin + + a_and_b <= '1' when a = '1' and b = '1' else '0'; + c_and_d <= '1' when c = '1' and d = '1' else '0'; + + not_c_and_d <= not c_and_d; + + y <= '1' when a_and_b = '1' or not_c_and_d = '1' else '0'; + +end concurrent; +library IEEE; +use IEEE.std_logic_1164.all; + +package GatesPkg is + + component AND2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component OR2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component INVERTER port ( + i: in std_logic; + o: out std_logic + ); + end component; + +end GatesPkg; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +architecture structural of FEWGATES is + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +begin + + u1: and2 port map (i1 => a , + i2 => b, + y => a_and_b + ); + + u2: and2 port map (i1 =>c, + i2 => d, + y => c_and_d + ); + + u3: inverter port map (a => c_and_d, + y => not_c_and_d); + + u4: or2 port map (i1 => a_and_b, + i2 => not_c_and_d, + y => y + ); + +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +entity AND2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end AND2; + +architecture rtl of AND2 is + +begin + + y <= '1' when i1 = '1' and i2 = '1' else '0'; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity OR2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end OR2; + +architecture rtl of OR2 is + +begin + + y <= '1' when i1 = '1' or i2 = '1' else '0'; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity INVERTER is port ( + i: in std_logic; + o: out std_logic + ); +end INVERTER; + +architecture rtl of INVERTER is + +begin + + o <= not i; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity FEWGATES is port ( + a,b,c,d: in std_logic; + y: out std_logic + ); +end FEWGATES; + +architecture structural of FEWGATES is + + component AND2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component OR2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component INVERTER port ( + i: in std_logic; + o: out std_logic + ); + end component; + +signal a_and_b, c_and_d, not_c_and_d: std_logic; + +begin + + u1: and2 port map (i1 => a , + i2 => b, + y => a_and_b + ); + + u2: and2 port map (i1 => c, + i2 => d, + y => c_and_d + ); + + u3: inverter port map (i => c_and_d, + o => not_c_and_d); + + u4: or2 port map (i1 => a_and_b, + i2 => not_c_and_d, + y => y + ); +end structural; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.simPrimitives.all; + +entity simHierarchy is port ( + A, B, Clk: in std_logic; + Y: out std_logic + ); +end simHierarchy; + +architecture hierarchical of simHierarchy is + +signal ADly, BDly, OrGateDly, ClkDly: std_logic; +signal OrGate, FlopOut: std_logic; + +begin + + ADly <= transport A after 2 ns; + BDly <= transport B after 2 ns; + OrGateDly <= transport OrGate after 1.5 ns; + ClkDly <= transport Clk after 1 ns; + + u1: OR2 generic map (tPD => 10 ns) + port map ( I1 => ADly, + I2 => BDly, + Y => OrGate + ); + + u2: simDFF generic map ( tS => 4 ns, + tH => 3 ns, + tCQ => 8 ns + ) + port map ( D => OrGateDly, + Clk => ClkDly, + Q => FlopOut + ); + + Y <= transport FlopOut after 2 ns; + +end hierarchical; +library IEEE; +use IEEE.std_logic_1164.all; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity INVERTER is port ( + i: in std_logic; + o: out std_logic + ); +end INVERTER; + +architecture rtl of INVERTER is + +begin + + o <= not i; + +end rtl; +-------------------------------------------------------------------------------- +--| File name : $RCSfile: io1164.vhd $ +--| Library : SUPPORT +--| Revision : $Revision: 1.1 $ +--| Author(s) : Vantage Analysis Systems, Inc; Des Young +--| Integration : Des Young +--| Creation : Nov 1995 +--| Status : $State: Exp $ +--| +--| Purpose : IO routines for std_logic_1164. +--| Assumptions : Numbers use radixed character set with no prefix. +--| Limitations : Does not read VHDL pound-radixed numbers. +--| Known Errors: none +--| +--| Description: +--| This is a modified library. The source is basically that donated by +--| Vantage to libutil. Des Young removed std_ulogic_vector support (to +--| conform to synthesizable libraries), and added read_oct/hex to integer. +--| +--| ======================================================================= +--| Copyright (c) 1992-1994 Vantage Analysis Systems, Inc., all rights +--| reserved. This package is provided by Vantage Analysis Systems. +--| The package may not be sold without the express written consent of +--| Vantage Analysis Systems, Inc. +--| +--| The VHDL for this package may be copied and/or distributed as long as +--| this copyright notice is retained in the source and any modifications +--| are clearly marked in the History: list. +--| +--| Title : IO1164 package VHDL source +--| Package Name: somelib.IO1164 +--| File Name : io1164.vhdl +--| Author(s) : dbb +--| Purpose : * Overloads procedures READ and WRITE for STD_LOGIC types +--| in manner consistent with TEXTIO package. +--| * Provides procedures to read and write logic values as +--| binary, octal, or hexadecimal values ('X' as appropriate). +--| These should be particularly useful for models +--| to read in stimulus as 0/1/x or octal or hex. +--| Subprograms : +--| Notes : +--| History : 1. Donated to libutil by Dave Bernstein 15 Jun 94 +--| 2. Removed all std_ulogic_vector support, Des Young, 14 Nov 95 +--| (This is because that type is not supported for synthesis). +--| 3. Added read_oct/hex to integer, Des Young, 20 Nov 95 +--| +--| ======================================================================= +--| Extra routines by Des Young, des@alantec.com. 1995. GNU copyright. +--| ======================================================================= +--| +-------------------------------------------------------------------------------- + +library ieee; +package io1164 is + + --$ !VANTAGE_METACOMMENTS_ON + --$ !VANTAGE_DNA_ON + + -- import std_logic package + use ieee.std_logic_1164.all; + + -- import textio package + use std.textio.all; + + -- + -- the READ and WRITE procedures act similarly to the procedures in the + -- STD.TEXTIO package. for each type, there are two read procedures and + -- one write procedure for converting between character and internal + -- representations of values. each value is represented as the string of + -- characters that you would use in VHDL code. (remember that apostrophes + -- and quotation marks are not used.) input is case-insensitive. output + -- is in upper case. see the following LRM sections for more information: + -- + -- 2.3 - Subprogram Overloading + -- 3.3 - Access Types (STD.TEXTIO.LINE is an access type) + -- 7.3.6 - Allocators (allocators create access values) + -- 14.3 - Package TEXTIO + -- + + -- Note that the procedures for std_ulogic will match calls with the value + -- parameter of type std_logic. + + -- + -- declare READ procedures to overload like in TEXTIO + -- + procedure read(l: inout line; value: out std_ulogic ; good: out boolean); + procedure read(l: inout line; value: out std_ulogic ); + procedure read(l: inout line; value: out std_logic_vector ; good: out boolean); + procedure read(l: inout line; value: out std_logic_vector ); + + -- + -- declare WRITE procedures to overload like in TEXTIO + -- + procedure write(l : inout line ; + value : in std_ulogic ; + justified: in side := right; + field : in width := 0 ); + procedure write(l : inout line ; + value : in std_logic_vector ; + justified: in side := right; + field : in width := 0 ); + + -- + -- declare procedures to convert between logic values and octal + -- or hexadecimal ('X' where appropriate). + -- + + -- octal / std_logic_vector + procedure read_oct (l : inout line ; + value : out std_logic_vector ; + good : out boolean ); + procedure read_oct (l : inout line ; + value : out std_logic_vector ); + procedure write_oct(l : inout line ; + value : in std_logic_vector ; + justified : in side := right; + field : in width := 0 ); + + -- hexadecimal / std_logic_vector + procedure read_hex (l : inout line ; + value : out std_logic_vector ; + good : out boolean ); + procedure read_hex (l : inout line ; + value : out std_logic_vector ); + procedure write_hex(l : inout line ; + value : in std_logic_vector ; + justified : in side := right; + field : in width := 0 ); + + -- read a number into an integer + procedure read_oct(l : inout line; + value : out integer; + good : out boolean); + procedure read_oct(l : inout line; + value : out integer); + procedure read_hex(l : inout line; + value : out integer; + good : out boolean); + procedure read_hex(l : inout line; + value : out integer); + +end io1164; + +-------------------------------------------------------------------------------- +--| Copyright (c) 1992-1994 Vantage Analysis Systems, Inc., all rights reserved +--| This package is provided by Vantage Analysis Systems. +--| The package may not be sold without the express written consent of +--| Vantage Analysis Systems, Inc. +--| +--| The VHDL for this package may be copied and/or distributed as long as +--| this copyright notice is retained in the source and any modifications +--| are clearly marked in the History: list. +--| +--| Title : IO1164 package body VHDL source +--| Package Name: VANTAGE_LOGIC.IO1164 +--| File Name : io1164.vhdl +--| Author(s) : dbb +--| Purpose : source for IO1164 package body +--| Subprograms : +--| Notes : see package declaration +--| History : see package declaration +-------------------------------------------------------------------------------- + +package body io1164 is + + + --$ !VANTAGE_METACOMMENTS_ON + --$ !VANTAGE_DNA_ON + + -- define lowercase conversion of characters for canonical comparison + type char2char_t is array (character'low to character'high) of character; + constant lowcase: char2char_t := ( + nul, soh, stx, etx, eot, enq, ack, bel, + bs, ht, lf, vt, ff, cr, so, si, + dle, dc1, dc2, dc3, dc4, nak, syn, etb, + can, em, sub, esc, fsp, gsp, rsp, usp, + + ' ', '!', '"', '#', '$', '%', '&', ''', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + + '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '[', '\', ']', '^', '_', + + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', del); + + -- define conversions between various types + + -- logic -> character + type f_logic_to_character_t is + array (std_ulogic'low to std_ulogic'high) of character; + constant f_logic_to_character : f_logic_to_character_t := + ( + 'U' => 'U', + 'X' => 'X', + '0' => '0', + '1' => '1', + 'Z' => 'Z', + 'W' => 'W', + 'L' => 'L', + 'H' => 'H', + '-' => '-' + ); + + -- character, integer, logic + + constant x_charcode : integer := -1; + constant maxoct_charcode: integer := 7; + constant maxhex_charcode: integer := 15; + constant bad_charcode : integer := integer'left; + + type digit2int_t is + array ( character'low to character'high ) of integer; + constant octdigit2int: digit2int_t := ( + '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, + '5' => 5, '6' => 6, '7' => 7, + 'X' | 'x' => x_charcode, others => bad_charcode ); + constant hexdigit2int: digit2int_t := ( + '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, + '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, + 'A' | 'a' => 10, 'B' | 'b' => 11, 'C' | 'c' => 12, + 'D' | 'd' => 13, 'E' | 'e' => 14, 'F' | 'f' => 15, + 'X' | 'x' => x_charcode, others => bad_charcode ); + + constant oct_bits_per_digit: integer := 3; + constant hex_bits_per_digit: integer := 4; + + type int2octdigit_t is + array ( 0 to maxoct_charcode ) of character; + constant int2octdigit: int2octdigit_t := + ( 0 => '0', 1 => '1', 2 => '2', 3 => '3', + 4 => '4', 5 => '5', 6 => '6', 7 => '7' ); + + type int2hexdigit_t is + array ( 0 to maxhex_charcode ) of character; + constant int2hexdigit: int2hexdigit_t := + ( 0 => '0', 1 => '1', 2 => '2', 3 => '3', + 4 => '4', 5 => '5', 6 => '6', 7 => '7', + 8 => '8', 9 => '9', 10 => 'A', 11 => 'B', + 12 => 'C', 13 => 'D', 14 => 'E', 15 => 'F' ); + + type oct_logic_vector_t is + array(1 to oct_bits_per_digit) of std_ulogic; + type octint2logic_t is + array (x_charcode to maxoct_charcode) of oct_logic_vector_t; + constant octint2logic : octint2logic_t := ( + ( 'X', 'X', 'X' ), + ( '0', '0', '0' ), + ( '0', '0', '1' ), + ( '0', '1', '0' ), + ( '0', '1', '1' ), + ( '1', '0', '0' ), + ( '1', '0', '1' ), + ( '1', '1', '0' ), + ( '1', '1', '1' ) + ); + + type hex_logic_vector_t is + array(1 to hex_bits_per_digit) of std_ulogic; + type hexint2logic_t is + array (x_charcode to maxhex_charcode) of hex_logic_vector_t; + constant hexint2logic : hexint2logic_t := ( + ( 'X', 'X', 'X', 'X' ), + ( '0', '0', '0', '0' ), + ( '0', '0', '0', '1' ), + ( '0', '0', '1', '0' ), + ( '0', '0', '1', '1' ), + ( '0', '1', '0', '0' ), + ( '0', '1', '0', '1' ), + ( '0', '1', '1', '0' ), + ( '0', '1', '1', '1' ), + ( '1', '0', '0', '0' ), + ( '1', '0', '0', '1' ), + ( '1', '0', '1', '0' ), + ( '1', '0', '1', '1' ), + ( '1', '1', '0', '0' ), + ( '1', '1', '0', '1' ), + ( '1', '1', '1', '0' ), + ( '1', '1', '1', '1' ) + ); + + ---------------------------------------------------------------------------- + -- READ procedure bodies + -- + -- The strategy for duplicating TEXTIO's overloading of procedures + -- with and without GOOD parameters is to put all the logic in the + -- version with the GOOD parameter and to have the version without + -- GOOD approximate a runtime error by use of an assertion. + -- + ---------------------------------------------------------------------------- + + -- + -- std_ulogic + -- note: compatible with std_logic + -- + + procedure read( l: inout line; value: out std_ulogic; good : out boolean ) is + + variable c : character; -- char read while looping + variable m : line; -- safe copy of L + variable success: boolean := false; -- readable version of GOOD + variable done : boolean := false; -- flag to say done reading chars + + begin + + -- + -- algorithm: + -- + -- if there are characters in the line + -- save a copy of the line + -- get the next character + -- if got one + -- set value + -- if all ok + -- free temp copy + -- else + -- free passed in line + -- assign copy back to line + -- set GOOD + -- + + -- only operate on lines that contain characters + if ( ( l /= null ) and ( l.all'length /= 0 ) ) then + + -- save a copy of string in case read fails + m := new string'( l.all ); + + -- grab the next character + read( l, c, success ); + + -- if read ok + if success then + +-- +-- an issue here is whether lower-case values should be accepted or not +-- + + -- determine the value + case c is + when 'U' | 'u' => value := 'U'; + when 'X' | 'x' => value := 'X'; + when '0' => value := '0'; + when '1' => value := '1'; + when 'Z' | 'z' => value := 'Z'; + when 'W' | 'w' => value := 'W'; + when 'L' | 'l' => value := 'L'; + when 'H' | 'h' => value := 'H'; + when '-' => value := '-'; + when others => success := false; + end case; + + end if; + + -- free working storage + if success then + deallocate( m ); + else + deallocate( l ); + l := m; + end if; + + end if; -- non null access, non empty string + + -- set output parameter + good := success; + + end read; + + procedure read( l: inout line; value: out std_ulogic ) is + variable success: boolean; -- internal good flag + begin + read( l, value, success ); -- use safe version + assert success + report "IO1164.READ: Unable to read STD_ULOGIC value." + severity error; + end read; + + -- + -- std_logic_vector + -- note: NOT compatible with std_ulogic_vector + -- + + procedure read(l : inout line ; + value: out std_logic_vector; + good : out boolean ) is + + variable m : line ; -- saved copy of L + variable success : boolean := true; -- readable GOOD + variable logic_value : std_logic ; -- value for one array element + variable c : character ; -- read a character + + begin + + -- + -- algorithm: + -- + -- this procedure strips off leading whitespace, and then calls the + -- READ procedure for each single logic value element in the output + -- array. + -- + + -- only operate on lines that contain characters + if ( ( l /= null ) and ( l.all'length /= 0 ) ) then + + -- save a copy of string in case read fails + m := new string'( l.all ); + + -- loop for each element in output array + for i in value'range loop + + -- prohibit internal blanks + if i /= value'left then + if l.all'length = 0 then + success := false; + exit; + end if; + c := l.all(l.all'left); + if c = ' ' or c = ht then + success := false; + exit; + end if; + end if; + + -- read the next logic value + read( l, logic_value, success ); + + -- stuff the value in if ok, else bail out + if success then + value( i ) := logic_value; + else + exit; + end if; + + end loop; -- each element in output array + + -- free working storage + if success then + deallocate( m ); + else + deallocate( l ); + l := m; + end if; + + elsif ( value'length /= 0 ) then + -- string is empty but the return array has 1+ elements + success := false; + end if; + + -- set output parameter + good := success; + + end read; + + procedure read(l: inout line; value: out std_logic_vector ) is + variable success: boolean; + begin + read( l, value, success ); + assert success + report "IO1164.READ: Unable to read T_WLOGIC_VECTOR value." + severity error; + end read; + + ---------------------------------------------------------------------------- + -- WRITE procedure bodies + ---------------------------------------------------------------------------- + + -- + -- std_ulogic + -- note: compatible with std_logic + -- + + procedure write(l : inout line ; + value : in std_ulogic ; + justified: in side := right; + field : in width := 0 ) is + begin + + -- + -- algorithm: + -- + -- just write out the string associated with the enumerated + -- value. + -- + + case value is + when 'U' => write( l, character'('U'), justified, field ); + when 'X' => write( l, character'('X'), justified, field ); + when '0' => write( l, character'('0'), justified, field ); + when '1' => write( l, character'('1'), justified, field ); + when 'Z' => write( l, character'('Z'), justified, field ); + when 'W' => write( l, character'('W'), justified, field ); + when 'L' => write( l, character'('L'), justified, field ); + when 'H' => write( l, character'('H'), justified, field ); + when '-' => write( l, character'('-'), justified, field ); + end case; + end write; + + -- + -- std_logic_vector + -- note: NOT compatible with std_ulogic_vector + -- + + procedure write(l : inout line ; + value : in std_logic_vector ; + justified: in side := right; + field : in width := 0 ) is + + variable m: line; -- build up intermediate string + + begin + + -- + -- algorithm: + -- + -- for each value in array + -- add string representing value to intermediate string + -- write intermediate string to line parameter + -- free intermediate string + -- + + -- for each value in array + for i in value'range loop + + -- add string representing value to intermediate string + write( m, value( i ) ); + + end loop; + + -- write intermediate string to line parameter + write( l, m.all, justified, field ); + + -- free intermediate string + deallocate( m ); + + end write; + + +-------------------------------------------------------------------------------- + + ---------------------------------------------------------------------------- + -- procedure bodies for octal and hexadecimal read and write + ---------------------------------------------------------------------------- + + -- + -- std_logic_vector/octal + -- note: NOT compatible with std_ulogic_vector + -- + + procedure read_oct(l : inout line ; + value : out std_logic_vector; + good : out boolean ) is + + variable m : line ; -- safe L + variable success : boolean := true; -- readable GOOD + variable logic_value : std_logic ; -- elem value + variable c : character ; -- char read + variable charcode : integer ; -- char->int + variable oct_logic_vector: oct_logic_vector_t ; -- for 1 digit + variable bitpos : integer ; -- in state vec. + begin + + -- + -- algorithm: + -- + -- skip over leading blanks, then read a digit + -- and do a conversion into a logic value + -- for each element in array + -- + + -- make sure logic array is right size to read this base + success := ( ( value'length rem oct_bits_per_digit ) = 0 ); + if success then + + -- only operate on non-empty strings + if ( ( l /= null ) and ( l.all'length /= 0 ) ) then + + -- save old copy of string in case read fails + m := new string'( l.all ); + + -- pick off leading white space and get first significant char + c := ' '; + while success and ( l.all'length > 0 ) and ( ( c = ' ' ) or ( c = ht ) ) loop + read( l, c, success ); + end loop; + + -- turn character into integer + charcode := octdigit2int( c ); + + -- not doing any bits yet + bitpos := 0; + + -- check for bad first character + if charcode = bad_charcode then + success := false; + else + -- loop through each value in array + oct_logic_vector := octint2logic( charcode ); + for i in value'range loop + + -- doing the next bit + bitpos := bitpos + 1; + + -- stick the value in + value( i ) := oct_logic_vector( bitpos ); + + -- read the next character if we're not at array end + if ( bitpos = oct_bits_per_digit ) and ( i /= value'right ) then + read( l, c, success ); + if not success then + exit; + end if; + -- turn character into integer + charcode := octdigit2int( c ); + -- check for bad char + if charcode = bad_charcode then + success := false; + exit; + end if; + -- reset bit position + bitpos := 0; + -- turn character code into state array + oct_logic_vector := octint2logic( charcode ); + end if; + + end loop; -- each index in return array + + end if; -- if bad first character + + -- clean up working storage + if success then + deallocate( m ); + else + deallocate( l ); + l := m; + end if; + + -- no characters to read for return array that isn't null slice + elsif ( value'length /= 0 ) then + success := false; + end if; -- non null access, non empty string + + end if; + + -- set out parameter of success + good := success; + + end read_oct; + + + procedure read_oct(l : inout line ; + value : out std_logic_vector) is + variable success: boolean; -- internal good flag + begin + read_oct( l, value, success ); -- use safe version + assert success + report "IO1164.READ_OCT: Unable to read T_LOGIC_VECTOR value." + severity error; + end read_oct; + + procedure write_oct(l : inout line ; + value : in std_logic_vector ; + justified: in side := right; + field : in width := 0 ) is + + variable m : line ; -- safe copy of L + variable goodlength : boolean ; -- array is ok len for this base + variable isx : boolean ; -- an X in this digit + variable integer_value: integer ; -- accumulate integer value + variable c : character; -- character read + variable charpos : integer ; -- index string being contructed + variable bitpos : integer ; -- bit index inside digit + + begin + + -- + -- algorithm: + -- + -- make sure this array can be written in this base + -- create a string to place intermediate results + -- initialize counters and flags to beginning of string + -- for each item in array + -- note unknown, else accumulate logic into integer + -- if at this digit's last bit + -- stuff digit just computed into intermediate result + -- reset flags and counters except for charpos + -- write intermediate result into line + -- free work storage + -- + + -- make sure this array can be written in this base + goodlength := ( ( value'length rem oct_bits_per_digit ) = 0 ); + assert goodlength + report "IO1164.WRITE_OCT: VALUE'Length is not a multiple of 3." + severity error; + if goodlength then + + -- create a string to place intermediate results + m := new string(1 to ( value'length / oct_bits_per_digit ) ); + + -- initialize counters and flags to beginning of string + charpos := 0; + bitpos := 0; + isx := false; + integer_value := 0; + + -- for each item in array + for i in value'range loop + + -- note unknown, else accumulate logic into integer + case value(i) is + when '0' | 'L' => + integer_value := integer_value * 2; + when '1' | 'H' => + integer_value := ( integer_value * 2 ) + 1; + when others => + isx := true; + end case; + + -- see if we've done this digit's last bit + bitpos := bitpos + 1; + if bitpos = oct_bits_per_digit then + + -- stuff the digit just computed into the intermediate result + charpos := charpos + 1; + if isx then + m.all(charpos) := 'X'; + else + m.all(charpos) := int2octdigit( integer_value ); + end if; + + -- reset flags and counters except for location in string being constructed + bitpos := 0; + isx := false; + integer_value := 0; + + end if; + + end loop; + + -- write intermediate result into line + write( l, m.all, justified, field ); + + -- free work storage + deallocate( m ); + + end if; + + end write_oct; + + -- + -- std_logic_vector/hexadecimal + -- note: NOT compatible with std_ulogic_vector + -- + + procedure read_hex(l : inout line ; + value : out std_logic_vector; + good : out boolean ) is + + variable m : line ; -- safe L + variable success : boolean := true; -- readable GOOD + variable logic_value : std_logic ; -- elem value + variable c : character ; -- char read + variable charcode : integer ; -- char->int + variable hex_logic_vector: hex_logic_vector_t ; -- for 1 digit + variable bitpos : integer ; -- in state vec. + begin + + -- + -- algorithm: + -- + -- skip over leading blanks, then read a digit + -- and do a conversion into a logic value + -- for each element in array + -- + + -- make sure logic array is right size to read this base + success := ( ( value'length rem hex_bits_per_digit ) = 0 ); + if success then + + -- only operate on non-empty strings + if ( ( l /= null ) and ( l.all'length /= 0 ) ) then + + -- save old copy of string in case read fails + m := new string'( l.all ); + + -- pick off leading white space and get first significant char + c := ' '; + while success and ( l.all'length > 0 ) and ( ( c = ' ' ) or ( c = ht ) ) loop + read( l, c, success ); + end loop; + + -- turn character into integer + charcode := hexdigit2int( c ); + + -- not doing any bits yet + bitpos := 0; + + -- check for bad first character + if charcode = bad_charcode then + success := false; + else + -- loop through each value in array + hex_logic_vector := hexint2logic( charcode ); + for i in value'range loop + + -- doing the next bit + bitpos := bitpos + 1; + + -- stick the value in + value( i ) := hex_logic_vector( bitpos ); + + -- read the next character if we're not at array end + if ( bitpos = hex_bits_per_digit ) and ( i /= value'right ) then + read( l, c, success ); + if not success then + exit; + end if; + -- turn character into integer + charcode := hexdigit2int( c ); + -- check for bad char + if charcode = bad_charcode then + success := false; + exit; + end if; + -- reset bit position + bitpos := 0; + -- turn character code into state array + hex_logic_vector := hexint2logic( charcode ); + end if; + + end loop; -- each index in return array + + end if; -- if bad first character + + -- clean up working storage + if success then + deallocate( m ); + else + deallocate( l ); + l := m; + end if; + + -- no characters to read for return array that isn't null slice + elsif ( value'length /= 0 ) then + success := false; + end if; -- non null access, non empty string + + end if; + + -- set out parameter of success + good := success; + + end read_hex; + + + procedure read_hex(l : inout line ; + value : out std_logic_vector) is + variable success: boolean; -- internal good flag + begin + read_hex( l, value, success ); -- use safe version + assert success + report "IO1164.READ_HEX: Unable to read T_LOGIC_VECTOR value." + severity error; + end read_hex; + + procedure write_hex(l : inout line ; + value : in std_logic_vector ; + justified: in side := right; + field : in width := 0 ) is + + variable m : line ; -- safe copy of L + variable goodlength : boolean ; -- array is ok len for this base + variable isx : boolean ; -- an X in this digit + variable integer_value: integer ; -- accumulate integer value + variable c : character; -- character read + variable charpos : integer ; -- index string being contructed + variable bitpos : integer ; -- bit index inside digit + + begin + + -- + -- algorithm: + -- + -- make sure this array can be written in this base + -- create a string to place intermediate results + -- initialize counters and flags to beginning of string + -- for each item in array + -- note unknown, else accumulate logic into integer + -- if at this digit's last bit + -- stuff digit just computed into intermediate result + -- reset flags and counters except for charpos + -- write intermediate result into line + -- free work storage + -- + + -- make sure this array can be written in this base + goodlength := ( ( value'length rem hex_bits_per_digit ) = 0 ); + assert goodlength + report "IO1164.WRITE_HEX: VALUE'Length is not a multiple of 4." + severity error; + if goodlength then + + -- create a string to place intermediate results + m := new string(1 to ( value'length / hex_bits_per_digit ) ); + + -- initialize counters and flags to beginning of string + charpos := 0; + bitpos := 0; + isx := false; + integer_value := 0; + + -- for each item in array + for i in value'range loop + + -- note unknown, else accumulate logic into integer + case value(i) is + when '0' | 'L' => + integer_value := integer_value * 2; + when '1' | 'H' => + integer_value := ( integer_value * 2 ) + 1; + when others => + isx := true; + end case; + + -- see if we've done this digit's last bit + bitpos := bitpos + 1; + if bitpos = hex_bits_per_digit then + + -- stuff the digit just computed into the intermediate result + charpos := charpos + 1; + if isx then + m.all(charpos) := 'X'; + else + m.all(charpos) := int2hexdigit( integer_value ); + end if; + + -- reset flags and counters except for location in string being constructed + bitpos := 0; + isx := false; + integer_value := 0; + + end if; + + end loop; + + -- write intermediate result into line + write( l, m.all, justified, field ); + + -- free work storage + deallocate( m ); + + end if; + + end write_hex; + +------------------------------------------------------------------------------ + + ------------------------------------ + -- Read octal/hex numbers to integer + ------------------------------------ + + -- + -- Read octal to integer + -- + + procedure read_oct(l : inout line; + value : out integer; + good : out boolean) is + + variable pos : integer; + variable digit : integer; + variable result : integer := 0; + variable success : boolean := true; + variable c : character; + variable old_l : line := l; + + begin + -- algorithm: + -- + -- skip leading white space, read digit, convert + -- into integer + -- + if (l /= NULL) then + -- set pos to start of actual number by skipping white space + pos := l'LEFT; + c := l(pos); + while ( l.all'length > 0 ) and ( ( c = ' ' ) or ( c = HT ) ) loop + pos := pos + 1; + c := l(pos); + end loop; + + -- check for start of valid number + digit := octdigit2int(l(pos)); + + if ((digit = bad_charcode) or (digit = x_charcode)) then + good := FALSE; + return; + else + -- calculate integer value + for i in pos to l'RIGHT loop + digit := octdigit2int(l(pos)); + exit when (digit = bad_charcode) or (digit = x_charcode); + result := (result * 8) + digit; + pos := pos + 1; + end loop; + value := result; + -- shrink line + if (pos > 1) then + l := new string'(old_l(pos to old_l'HIGH)); + deallocate(old_l); + end if; + good := TRUE; + return; + end if; + else + good := FALSE; + end if; + + end read_oct; + + -- simple version + procedure read_oct(l : inout line; + value : out integer) is + + variable success: boolean; -- internal good flag + + begin + read_oct( l, value, success ); -- use safe version + assert success + report "IO1164.READ_OCT: Unable to read octal integer value." + severity error; + end read_oct; + + + -- + -- Read hex to integer + -- + + procedure read_hex(l : inout line; + value : out integer; + good : out boolean) is + + variable pos : integer; + variable digit : integer; + variable result : integer := 0; + variable success : boolean := true; + variable c : character; + variable old_l : line := l; + + begin + -- algorithm: + -- + -- skip leading white space, read digit, convert + -- into integer + -- + if (l /= NULL) then + -- set pos to start of actual number by skipping white space + pos := l'LEFT; + c := l(pos); + while ( l.all'length > 0 ) and ( ( c = ' ' ) or ( c = HT ) ) loop + pos := pos + 1; + c := l(pos); + end loop; + + -- check for start of valid number + digit := hexdigit2int(l(pos)); + + if ((digit = bad_charcode) or (digit = x_charcode)) then + good := FALSE; + return; + else + -- calculate integer value + for i in pos to l'RIGHT loop + digit := hexdigit2int(l(pos)); + exit when (digit = bad_charcode) or (digit = x_charcode); + result := (result * 16) + digit; + pos := pos + 1; + end loop; + value := result; + -- shrink line + if (pos > 1) then + l := new string'(old_l(pos to old_l'HIGH)); + deallocate(old_l); + end if; + good := TRUE; + return; + end if; + else + good := FALSE; + end if; + + end read_hex; + + -- simple version + procedure read_hex(l : inout line; + value : out integer) is + + variable success: boolean; -- internal good flag + + begin + read_hex( l, value, success ); -- use safe version + assert success + report "IO1164.READ_HEX: Unable to read hex integer value." + severity error; + end read_hex; + +end io1164; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity asyncLdCnt is port ( + loadVal: in std_logic_vector(3 downto 0); + clk, load: in std_logic; + q: out std_logic_vector(3 downto 0) + ); +end asyncLdCnt; + +architecture rtl of asyncLdCnt is + +signal qLocal: unsigned(3 downto 0); + +begin + + process (clk, load, loadVal) begin + if (load = '1') then + qLocal <= to_unsigned(loadVal); + elsif (clk'event and clk = '1' ) then + qLocal <= qLocal + 1; + end if; + end process; + + q <= to_stdlogicvector(qLocal); + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity LoadCnt is port ( + CntEn: in std_logic; + LdCnt: in std_logic; + LdData: in std_logic_vector(3 downto 0); + Clk: in std_logic; + Rst: in std_logic; + CntVal: out std_logic_vector(3 downto 0) + ); +end LoadCnt; + +architecture behavioral of LoadCnt is + +signal Cnt: std_logic_vector(3 downto 0); + +begin + + counter: process (Clk, Rst) begin + if Rst = '1' then + Cnt <= (others => '0'); + elsif (Clk'event and Clk = '1') then + if (LdCnt = '1') then + Cnt <= LdData; + elsif (CntEn = '1') then + Cnt <= Cnt + 1; + else + Cnt <= Cnt; + end if; + end if; + end process; + + CntVal <= Cnt; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; +library UTILS; +use UTILS.io1164.all; +use std.textio.all; + +entity loadCntTB is +end loadCntTB; + +architecture testbench of loadCntTB is + + component loadCnt port ( + data: in std_logic_vector (7 downto 0); + load: in std_logic; + clk: in std_logic; + rst: in std_logic; + q: out std_logic_vector (7 downto 0) + ); + end component; + +file vectorFile: text is in "vectorfile"; +type vectorType is record + data: std_logic_vector(7 downto 0); + load: std_logic; + rst: std_logic; + q: std_logic_vector(7 downto 0); +end record; + +signal testVector: vectorType; +signal TestClk: std_logic := '0'; +signal Qout: std_logic_vector(7 downto 0); + +constant ClkPeriod: time := 100 ns; + +for all: loadCnt use entity work.loadcnt(rtl); + +begin + +-- File reading and stimulus application + readVec: process + variable VectorLine: line; + variable VectorValid: boolean; + variable vRst: std_logic; + variable vLoad: std_logic; + variable vData: std_logic_vector(7 downto 0); + variable vQ: std_logic_vector(7 downto 0); + + begin + while not endfile (vectorFile) loop + readline(vectorFile, VectorLine); + + read(VectorLine, vRst, good => VectorValid); + next when not VectorValid; + read(VectorLine, vLoad); + read(VectorLine, vData); + read(VectorLine, vQ); + + wait for ClkPeriod/4; + + testVector.Rst <= vRst; + testVector.Load <= vLoad; + testVector.Data <= vData; + testVector.Q <= vQ; + + wait for (ClkPeriod/4) * 3; + + end loop; + + assert false + report "Simulation complete" + severity note; + + wait; + + end process; + +-- Free running test clock + TestClk <= not TestClk after ClkPeriod/2; + +-- Instance of design being tested + u1: loadCnt port map (Data => testVector.Data, + load => testVector.Load, + clk => TestClk, + rst => testVector.Rst, + q => Qout + ); + +-- Process to verify outputs + verify: process (TestClk) + variable ErrorMsg: line; + begin + if (TestClk'event and TestClk = '0') then + if Qout /= testVector.Q then + write(ErrorMsg, string'("Vector failed ")); + write(ErrorMsg, now); + writeline(output, ErrorMsg); + end if; + end if; + end process; + + +end testbench; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity loadCnt is port ( + data: in std_logic_vector (7 downto 0); + load: in std_logic; + clk: in std_logic; + rst: in std_logic; + q: out std_logic_vector (7 downto 0) + ); +end loadCnt; + +architecture rtl of loadCnt is + +signal cnt: std_logic_vector (7 downto 0); + +begin + + counter: process (clk, rst) begin + if (rst = '1') then + cnt <= (others => '0'); + elsif (clk'event and clk = '1') then + if (load = '1') then + cnt <= data; + else + cnt <= cnt + 1; + end if; + end if; + end process; + + q <= cnt; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity multiplier is port ( + a,b : in std_logic_vector (15 downto 0); + product: out std_logic_vector (31 downto 0) + ); +end multiplier; + +architecture dataflow of multiplier is + +begin + + product <= a * b; + +end dataflow; +library IEEE; +use IEEE.std_logic_1164.all; + +entity mux is port ( + A, B, Sel: in std_logic; + Y: out std_logic + ); +end mux; + +architecture simModel of mux is + +-- Delay Constants +constant tPD_A: time := 10 ns; +constant tPD_B: time := 15 ns; +constant tPD_Sel: time := 5 ns; + +begin + + DelayMux: process (A, B, Sel) + + variable localY: std_logic; -- Zero delay place holder for Y + + begin + + -- Zero delay model + case Sel is + when '0' => + localY := A; + when others => + localY := B; + end case; + + -- Delay calculation + if (B'event) then + Y <= localY after tPD_B; + elsif (A'event) then + Y <= localY after tPD_A; + else + Y <= localY after tPD_Sel; + end if; + + end process; + + +end simModel; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity ForceShare is port ( + a,b,c,d,e,f: in std_logic_vector (7 downto 0); + result: out std_logic_vector(7 downto 0) + ); +end ForceShare; + +architecture behaviour of ForceShare is + +begin + + sum: process (a,c,b,d,e,f) + begin + + if (a + b = "10011010") then + result <= c; + elsif (a + b = "01011001") then + result <= d; + elsif (a + b = "10111011") then + result <= e; + else + result <= f; + end if; + end process; + +end behaviour; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF8 is port ( + ip: in std_logic_vector(7 downto 0); + oe: in std_logic; + op: out std_logic_vector(7 downto 0) + ); +end TRIBUF8; + +architecture concurrent of TRIBUF8 is + +begin + + op <= ip when oe = '1' else (others => 'Z'); + +end concurrent; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF is port ( + ip: in std_logic; + oe: in std_logic; + op: out std_logic + ); +end TRIBUF; + +architecture concurrent of TRIBUF is + +begin + + op <= ip when oe = '1' else 'Z'; + +end concurrent; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF8 is port ( + ip: in std_logic_vector(7 downto 0); + oe: in std_logic; + op: out std_logic_vector(7 downto 0) + ); +end TRIBUF8; + +architecture sequential of TRIBUF8 is + +begin + + enable: process (ip,oe) begin + if (oe = '1') then + op <= ip; + else + op <= (others => 'Z'); + end if; + end process; + +end sequential; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF is port ( + ip: in bit; + oe: in bit; + op: out bit + ); +end TRIBUF; + +architecture sequential of TRIBUF is + +begin + + enable: process (ip,oe) begin + if (oe = '1') then + op <= ip; + else + op <= null; + end if; + end process; + +end sequential; +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF is port ( + ip: in std_logic; + oe: in std_logic; + op: out std_logic + ); +end TRIBUF; + +architecture sequential of TRIBUF is + +begin + + enable: process (ip,oe) begin + if (oe = '1') then + op <= ip; + else + op <= 'Z'; + end if; + end process; + +end sequential; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity tribuffer is port ( + input: in std_logic; + enable: in std_logic; + output: out std_logic + ); +end tribuffer; + +architecture structural of tribuffer is + +begin + + u1: tribuf port map (ip => input, + oe => enable, + op => output + ); + +end structural; +library ieee; +use ieee.std_logic_1164.all; + +use work.primitive.all; + +entity oddParityGen is + generic ( width : integer := 8 ); + port (ad: in std_logic_vector (width - 1 downto 0); + oddParity : out std_logic ) ; +end oddParityGen; + +architecture scaleable of oddParityGen is + +signal genXor: std_logic_vector(ad'range); + +begin + + genXOR(0) <= '0'; + + parTree: for i in 1 to ad'high generate + x1: xor2 port map (i1 => genXor(i - 1), + i2 => ad(i - 1), + y => genXor(i) + ); + end generate; + + oddParity <= genXor(ad'high) ; + +end scaleable ; +library ieee; +use ieee.std_logic_1164.all; + +entity oddParityLoop is + generic ( width : integer := 8 ); + port (ad: in std_logic_vector (width - 1 downto 0); + oddParity : out std_logic ) ; +end oddParityLoop ; + +architecture scaleable of oddParityLoop is +begin + + process (ad) + variable loopXor: std_logic; + begin + loopXor := '0'; + + for i in 0 to width -1 loop + loopXor := loopXor xor ad( i ) ; + end loop ; + + oddParity <= loopXor ; + + end process; + +end scaleable ; +library IEEE; +use IEEE.std_logic_1164.all; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity OR2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end OR2; + +architecture rtl of OR2 is + +begin + + y <= '1' when i1 = '1' or i2 = '1' else '0'; + +end rtl; +library IEEE; +USE IEEE.std_logic_1164.all; + + +entity OR2 is port ( + I1, I2: in std_logic; + Y: out std_logic + ); +end OR2; + +architecture simple of OR2 is + +begin + + Y <= I1 OR I2 after 10 ns; + +end simple; +library IEEE; +USE IEEE.std_logic_1164.all; + +package simPrimitives is + + component OR2 + generic (tPD: time := 1 ns); + + port (I1, I2: in std_logic; + Y: out std_logic + ); + end component; + +end simPrimitives; + + +library IEEE; +USE IEEE.std_logic_1164.all; + +entity OR2 is + generic (tPD: time := 1 ns); + + port (I1, I2: in std_logic; + Y: out std_logic + ); +end OR2; + +architecture simple of OR2 is + +begin + + Y <= I1 OR I2 after tPD; + +end simple; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity adder is port ( + a,b: in std_logic_vector(3 downto 0); + sum: out std_logic_vector(3 downto 0); + overflow: out std_logic + ); +end adder; + +architecture concat of adder is + +signal localSum: std_logic_vector(4 downto 0); + +begin + + localSum <= std_logic_vector(unsigned('0' & a) + unsigned('0' & b)); + + sum <= localSum(3 downto 0); + overflow <= localSum(4); + +end concat; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity paramDFF is + generic (size: integer := 8); + port ( + data: in std_logic_vector(size - 1 downto 0); + clock: in std_logic; + reset: in std_logic; + ff_enable: in std_logic; + op_enable: in std_logic; + qout: out std_logic_vector(size - 1 downto 0) + ); +end paramDFF; + +architecture parameterize of paramDFF is + +signal reg: std_logic_vector(size - 1 downto 0); + +begin + + u1: pDFFE generic map (n => size) + port map (d => data, + clk =>clock, + rst => reset, + en => ff_enable, + q => reg + ); + u2: pTRIBUF generic map (n => size) + port map (ip => reg, + oe => op_enable, + op => qout + ); + +end paramterize; +library ieee; +use ieee.std_logic_1164.all; + +use work.primitive.all; + +entity oddParityGen is + generic ( width : integer := 32 ); + port (ad: in std_logic_vector (width - 1 downto 0); + oddParity : out std_logic ) ; +end oddParityGen; + +architecture scaleable of oddParityGen is + +signal genXor: std_logic_vector(ad'range); + +signal one: std_logic := '1'; + +begin + + parTree: for i in ad'range generate + g0: if i = 0 generate + x0: xor2 port map (i1 => one, + i2 => one, + y => genXor(0) + ); + end generate; + + g1: if i > 0 and i <= ad'high generate + x1: xor2 port map (i1 => genXor(i - 1), + i2 => ad(i - 1), + y => genXor(i) + ); + end generate; + + end generate; + + oddParity <= genXor(ad'high) ; + +end scaleable ; +library ieee; +use ieee.std_logic_1164.all; + +use work.primitive.all; + +entity oddParityGen is + generic ( width : integer := 32 ); -- (2 <= width <= 32) and a power of 2 + port (ad: in std_logic_vector (width - 1 downto 0); + oddParity : out std_logic ) ; +end oddParityGen; + +architecture scaleable of oddParityGen is + +signal stage0: std_logic_vector(31 downto 0); +signal stage1: std_logic_vector(15 downto 0); +signal stage2: std_logic_vector(7 downto 0); +signal stage3: std_logic_vector(3 downto 0); +signal stage4: std_logic_vector(1 downto 0); + +begin + + g4: for i in stage4'range generate + g41: if (ad'length > 2) generate + x4: xor2 port map (stage3(i), stage3(i + stage4'length), stage4(i)); + end generate; + end generate; + + g3: for i in stage3'range generate + g31: if (ad'length > 4) generate + x3: xor2 port map (stage2(i), stage2(i + stage3'length), stage3(i)); + end generate; + end generate; + + g2: for i in stage2'range generate + g21: if (ad'length > 8) generate + x2: xor2 port map (stage1(i), stage1(i + stage2'length), stage2(i)); + end generate; + end generate; + + g1: for i in stage1'range generate + g11: if (ad'length > 16) generate + x1: xor2 port map (stage0(i), stage0(i + stage1'length), stage1(i)); + end generate; + end generate; + + + s1: for i in ad'range generate + s14: if (ad'length = 2) generate + stage4(i) <= ad(i); + end generate; + + s13: if (ad'length = 4) generate + stage3(i) <= ad(i); + end generate; + + s12: if (ad'length = 8) generate + stage2(i) <= ad(i); + end generate; + + s11: if (ad'length = 16) generate + stage1(i) <= ad(i); + end generate; + + s10: if (ad'length = 32) generate + stage0(i) <= ad(i); + end generate; + + end generate; + + + genPar: xor2 port map (stage4(0), stage4(1), oddParity); + +end scaleable ; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity powerOfFour is port( + clk : in std_logic; + inputVal : in unsigned(3 downto 0); + power : out unsigned(15 downto 0) + ); +end powerOfFour; + +architecture behavioral of powerOfFour is + + function Pow( N, Exp : integer ) return integer is + Variable Result : integer := 1; + + begin + for i in 1 to Exp loop + Result := Result * N; + end loop; + return( Result ); + end Pow; + +signal inputValInt: integer range 0 to 15; +signal powerL: integer range 0 to 65535; + +begin + + inputValInt <= to_integer(inputVal); + power <= to_unsigned(powerL,16); + + process begin + wait until Clk = '1'; + + powerL <= Pow(inputValInt,4); + + end process; + +end behavioral; +package PowerPkg is + component Power port( + Clk : in bit; + inputVal : in bit_vector(0 to 3); + power : out bit_vector(0 to 15) ); + end component; +end PowerPkg; + +use work.bv_math.all; +use work.int_math.all; +use work.PowerPkg.all; + +entity Power is port( + Clk : in bit; + inputVal : in bit_vector(0 to 3); + power : out bit_vector(0 to 15) ); +end Power; + + + + +architecture funky of Power is + + function Pow( N, Exp : integer ) return integer is + Variable Result : integer := 1; + Variable i : integer := 0; + begin + while( i < Exp ) loop + Result := Result * N; + i := i + 1; + end loop; + return( Result ); + end Pow; + + + function RollVal( CntlVal : integer ) return integer is + begin + return( Pow( 2, CntlVal ) + 2 ); + end RollVal; + + +begin + process + begin + wait until Clk = '1'; + + power <= i2bv(Rollval(bv2I(inputVal)),16); + + end process; +end funky; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity priority_encoder is port + (interrupts : in std_logic_vector(7 downto 0); + priority : in std_logic_vector(2 downto 0); + result : out std_logic_vector(2 downto 0) + ); +end priority_encoder; + +architecture behave of priority_encoder is +begin + + process (interrupts) + variable selectIn : integer; + variable LoopCount : integer; + begin + + LoopCount := 1; + selectIn := to_integer(to_unsigned(priority)); + + while (LoopCount <= 7) and (interrupts(selectIn) /= '0') loop + + if (selectIn = 0) then + selectIn := 7; + else + selectIn := selectIn - 1; + end if; + + LoopCount := LoopCount + 1; + + end loop; + + result <= std_logic_vector(to_unsigned(selectIn,3)); + + end process; + +end behave; +library IEEE; +use IEEE.std_logic_1164.all; + +package primitive is + component DFFE port ( + d: in std_logic; + q: out std_logic; + en: in std_logic; + clk: in std_logic + ); + end component; + + component DFFE_SR port ( + d: in std_logic; + en: in std_logic; + clk: in std_logic; + rst: in std_logic; + prst: in std_logic; + q: out std_logic + ); + end component; + + component DLATCHH port ( + d: in std_logic; + en: in std_logic; + q: out std_logic + ); + end component; + + component AND2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component OR2 port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); + end component; + + component INVERTER port ( + i: in std_logic; + o: out std_logic + ); + end component; + + component TRIBUF port ( + ip: in std_logic; + oe: in std_logic; + op: out std_logic + ); + end component; + + component BIDIR port ( + ip: in std_logic; + oe: in std_logic; + op_fb: out std_logic; + op: inout std_logic + ); + end component; + +end package; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFFE is port ( + d: in std_logic; + q: out std_logic; + en: in std_logic; + clk: in std_logic + ); +end DFFE; + +architecture rtl of DFFE is + +begin + + process begin + wait until clk = '1'; + if (en = '1') then + q <= d; + end if; + end process; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFFE_SR is port ( + d: in std_logic; + en: in std_logic; + clk: in std_logic; + rst: in std_logic; + prst: in std_logic; + q: out std_logic + ); +end DFFE_SR; + +architecture rtl of DFFE_SR is + +begin + + process (clk, rst, prst) begin + if (rst = '1') then + q <= '0'; + elsif (prst = '1') then + q <= '1'; + elsif (clk'event and clk = '1') then + if (en = '1') then + q <= d; + end if; + end if; + end process; + +end rtl; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity DLATCHH is port ( + d: in std_logic; + en: in std_logic; + q: out std_logic + ); +end DLATCHH; + +architecture rtl of DLATCHH is + +begin + + process (en) begin + if (en = '1') then + q <= d; + end if; + end process; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity AND2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end AND2; + +architecture rtl of AND2 is + +begin + + y <= '1' when i1 = '1' and i2 = '1' else '0'; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity OR2 is port ( + i1: in std_logic; + i2: in std_logic; + y: out std_logic + ); +end OR2; + +architecture rtl of OR2 is + +begin + + y <= '1' when i1 = '1' or i2 = '1' else '0'; + +end rtl; + + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity INVERTER is port ( + i: in std_logic; + o: out std_logic + ); +end INVERTER; + +architecture rtl of INVERTER is + +begin + + o <= not i; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity TRIBUF is port ( + ip: in std_logic; + oe: in std_logic; + op: out std_logic + ); +end TRIBUF; + +architecture rtl of TRIBUF is + +begin + + op <= ip when oe = '1' else 'Z'; + +end rtl; + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity BIDIR is port ( + ip: in std_logic; + oe: in std_logic; + op_fb: out std_logic; + op: inout std_logic + ); +end BIDIR; + +architecture rtl of BIDIR is + +begin + + op <= ip when oe = '1' else 'Z'; + op_fb <= op; + +end rtl; + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity progPulse is port ( + clk, reset: in std_logic; + loadLength,loadDelay: in std_logic; + data: in std_logic_vector(7 downto 0); + pulse: out std_logic + ); +end progPulse; + +architecture rtl of progPulse is + +signal downCnt, downCntData: unsigned(7 downto 0); +signal downCntLd, downCntEn: std_logic; +signal delayCntVal, pulseCntVal: unsigned(7 downto 0); +signal startPulse, endPulse: std_logic; + +subtype fsmType is std_logic_vector(1 downto 0); +constant loadDelayCnt : fsmType := "00"; +constant waitDelayEnd : fsmType := "10"; +constant loadLengthCnt : fsmType := "11"; +constant waitLengthEnd : fsmType := "01"; + +signal currState, nextState: fsmType; + +begin + + delayreg: process (clk, reset) begin + if reset = '1' then + delayCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadDelay = '1' then + delayCntVal <= to_unsigned(data); + end if; + end if; + end process; + + lengthReg: process (clk, reset) begin + if reset = '1' then + pulseCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadDelay = '1' then + pulseCntVal <= to_unsigned(data); + end if; + end if; + end process; + + nextStProc: process (currState, downCnt, loadDelay, loadLength) begin + case currState is + when loadDelayCnt => + nextState <= waitDelayEnd; + + when waitDelayEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCnt = 0) then + nextState <= loadLengthCnt; + else + nextState <= waitDelayEnd; + end if; + + when loadLengthCnt => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + else + nextState <= waitLengthEnd; + end if; + + when waitLengthEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCnt = 0) then + nextState <= loadDelayCnt; + else + nextState <= waitDelayEnd; + end if; + + when others => + null; + + end case; + end process nextStProc; + + currStProc: process (clk, reset) begin + if (reset = '1') then + currState <= loadDelayCnt; + elsif (clk'event and clk = '1') then + currState <= nextState; + end if; + end process currStProc; + + outConProc: process (currState, delayCntVal, pulseCntVal) begin + case currState is + when loadDelayCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= delayCntVal; + + when waitDelayEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downCntData <= delayCntVal; + + when loadLengthCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= pulseCntVal; + + when waitLengthEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downCntData <= pulseCntVal; + + when others => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= pulseCntVal; + + end case; + end process outConProc; + + downCntr: process (clk,reset) begin + if (reset = '1') then + downCnt <= "00000000"; + elsif (clk'event and clk = '1') then + if (downCntLd = '1') then + downCnt <= downCntData; + elsif (downCntEn = '1') then + downCnt <= downCnt - 1; + else + downCnt <= downCnt; + end if; + end if; + end process; + + -- Assign pulse output + pulse <= currState(0); + + +end rtl; +library ieee; +use ieee.std_logic_1164.all; + +entity pulseErr is port + (a: in std_logic; + b: out std_logic + ); +end pulseErr; + +architecture behavior of pulseErr is + +signal c: std_logic; + +begin + + pulse: process (a,c) begin + b <= c XOR a; + + c <= a; + end process; + +end behavior; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity progPulse is port ( + clk, reset: in std_logic; + loadLength,loadDelay: in std_logic; + data: in std_logic_vector(7 downto 0); + pulse: out std_logic + ); +end progPulse; + +architecture rtl of progPulse is + +signal downCnt, downCntData: unsigned(7 downto 0); +signal downCntLd, downCntEn: std_logic; +signal delayCntVal, pulseCntVal: unsigned(7 downto 0); +signal startPulse, endPulse: std_logic; + +type progPulseFsmType is (loadDelayCnt, waitDelayEnd, loadLengthCnt, waitLengthEnd); +signal currState, nextState: progPulseFsmType; + +begin + + delayreg: process (clk, reset) begin + if reset = '1' then + delayCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadDelay = '1' then + delayCntVal <= to_unsigned(data); + end if; + end if; + end process; + + lengthReg: process (clk, reset) begin + if reset = '1' then + pulseCntVal <= "11111111"; + elsif clk'event and clk = '1' then + if loadDelay = '1' then + pulseCntVal <= to_unsigned(data); + end if; + end if; + end process; + + nextStProc: process (currState, downCnt, loadDelay, loadLength) begin + case currState is + when loadDelayCnt => + nextState <= waitDelayEnd; + + when waitDelayEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCnt = 0) then + nextState <= loadLengthCnt; + else + nextState <= waitDelayEnd; + end if; + + when loadLengthCnt => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + else + nextState <= waitLengthEnd; + end if; + + when waitLengthEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCnt = 0) then + nextState <= loadDelayCnt; + else + nextState <= waitDelayEnd; + end if; + + when others => + null; + + end case; + end process nextStProc; + + currStProc: process (clk, reset) begin + if (reset = '1') then + currState <= loadDelayCnt; + elsif (clk'event and clk = '1') then + currState <= nextState; + end if; + end process currStProc; + + outConProc: process (currState, delayCntVal, pulseCntVal) begin + case currState is + when loadDelayCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= delayCntVal; + pulse <= '0'; + + when waitDelayEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downCntData <= delayCntVal; + pulse <= '0'; + + when loadLengthCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= pulseCntVal; + pulse <= '1'; + + when waitLengthEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downCntData <= pulseCntVal; + pulse <= '1'; + + when others => + downCntEn <= '0'; + downCntLd <= '1'; + downCntData <= pulseCntVal; + pulse <= '0'; + + end case; + end process outConProc; + + downCntr: process (clk,reset) begin + if (reset = '1') then + downCnt <= "00000000"; + elsif (clk'event and clk = '1') then + if (downCntLd = '1') then + downCnt <= downCntData; + elsif (downCntEn = '1') then + downCnt <= downCnt - 1; + else + downCnt <= downCnt; + end if; + end if; + end process; + + +end rtl; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity progPulseFsm is port ( + downCnt: in std_logic_vector(7 downto 0); + delayCntVal: in std_logic_vector(7 downto 0); + lengthCntVal: in std_logic_vector(7 downto 0); + loadLength: in std_logic; + loadDelay: in std_logic; + clk: in std_logic; + reset: in std_logic; + + downCntEn: out std_logic; + downCntLd: out std_logic; + downCntData: out std_logic_vector(7 downto 0); + + pulse: out std_logic + ); +end progPulseFsm; + +architecture fsm of progPulseFsm is + +type progPulseFsmType is (loadDelayCnt, waitDelayEnd, loadLengthCnt, waitLengthEnd); +type stateVec is array (3 downto 0) of std_logic; +type stateBits is array (progPulseFsmType) of stateVec; + +signal loadVal: std_logic; + +constant stateTable: stateBits := ( + loadDelayCnt => "0010", + waitDelayEnd => "0100", + loadLengthCnt => "0011", + waitLengthEnd => "1101" ); +-- ^^^^ +-- ||||__ loadVal +-- |||___ downCntLd +-- ||____ downCntEn +-- |_____ pulse + +signal currState, nextState: progPulseFsmType; + +begin + + nextStProc: process (currState, downCnt, loadDelay, loadLength) begin + case currState is + when loadDelayCnt => + nextState <= waitDelayEnd; + + when waitDelayEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (to_unsigned(downCnt) = 0) then + nextState <= loadLengthCnt; + else + nextState <= waitDelayEnd; + end if; + + when loadLengthCnt => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + else + nextState <= waitLengthEnd; + end if; + + when waitLengthEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (to_unsigned(downCnt) = 0) then + nextState <= loadDelayCnt; + else + nextState <= waitDelayEnd; + end if; + + when others => + null; + + end case; + + end process nextStProc; + + currStProc: process (clk, reset) begin + if (reset = '1') then + currState <= loadDelayCnt; + elsif (clk'event and clk = '1') then + currState <= nextState; + end if; + end process currStProc; + + pulse <= stateTable(currState)(3); + downCntEn <= stateTable(currState)(2); + downCntLd <= stateTable(currState)(1); + loadVal <= stateTable(currState)(0); + + downCntData <= delayCntVal when loadVal = '0' else lengthCntVal; + +end fsm; +-- Incorporates Errata 6.1 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity progPulseFsm is port ( + downCnt: in std_logic_vector(7 downto 0); + delayCntVal: in std_logic_vector(7 downto 0); + lengthCntVal: in std_logic_vector(7 downto 0); + loadLength: in std_logic; + loadDelay: in std_logic; + clk: in std_logic; + reset: in std_logic; + + downCntEn: out std_logic; + downCntLd: out std_logic; + downtCntData: out std_logic_vector(7 downto 0); + + pulse: out std_logic + ); +end progPulseFsm; + +architecture fsm of progPulseFsm is + +type progPulseFsmType is (loadDelayCnt, waitDelayEnd, loadLengthCnt, waitLengthEnd); +signal currState, nextState: progPulseFsmType; +signal downCntL: unsigned (7 downto 0); + +begin + + downCntL <= to_unsigned(downCnt); -- convert downCnt to unsigned + + nextStProc: process (currState, downCntL, loadDelay, loadLength) begin + case currState is + when loadDelayCnt => + nextState <= waitDelayEnd; + + when waitDelayEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCntL = 0) then + nextState <= loadLengthCnt; + else + nextState <= waitDelayEnd; + end if; + + when loadLengthCnt => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + else + nextState <= waitLengthEnd; + end if; + + when waitLengthEnd => + if (loadDelay = '1' or loadLength = '1') then + nextState <= loadDelayCnt; + elsif (downCntL = 0) then + nextState <= loadDelayCnt; + else + nextState <= waitDelayEnd; + end if; + + when others => + null; + + end case; + + end process nextStProc; + + currStProc: process (clk, reset) begin + if (reset = '1') then + currState <= loadDelayCnt; + elsif (clk'event and clk = '1') then + currState <= nextState; + end if; + end process currStProc; + + outConProc: process (currState, delayCntVal, lengthCntVal) begin + case currState is + when loadDelayCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downtCntData <= delayCntVal; + pulse <= '0'; + + when waitDelayEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downtCntData <= delayCntVal; + pulse <= '0'; + + when loadLengthCnt => + downCntEn <= '0'; + downCntLd <= '1'; + downtCntData <= lengthCntVal; + pulse <= '1'; + + when waitLengthEnd => + downCntEn <= '1'; + downCntLd <= '0'; + downtCntData <= lengthCntVal; + pulse <= '1'; + + when others => + downCntEn <= '0'; + downCntLd <= '1'; + downtCntData <= delayCntVal; + pulse <= '0'; + + end case; + end process outConProc; + +end fsm; +-- Incorporates errata 5.4 + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +use work.specialFunctions.all; + +entity powerOfFour is port( + clk : in std_logic; + inputVal : in std_logic_vector(3 downto 0); + power : out std_logic_vector(15 downto 0) + ); +end powerOfFour; + +architecture behavioral of powerOfFour is + +begin + + process begin + wait until Clk = '1'; + + power <= std_logic_vector(to_unsigned(Pow(to_integer(unsigned(inputVal)),4),16)); + + end process; + +end behavioral; +-- Incorporate errata 5.4 + +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity powerOfFour is port( + clk : in std_logic; + inputVal : in std_logic_vector(3 downto 0); + power : out std_logic_vector(15 downto 0) + ); +end powerOfFour; + +architecture behavioral of powerOfFour is + + function Pow( N, Exp : integer ) return integer is + Variable Result : integer := 1; + + begin + for i in 1 to Exp loop + Result := Result * N; + end loop; + return( Result ); + end Pow; + +begin + + process begin + wait until Clk = '1'; + + power <= std_logic_vector(to_unsigned(Pow(to_integer(to_unsigned(inputVal)),4),16)); + + end process; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; +use IEEE.std_logic_unsigned.all; + +entity powerOfFour is port( + clk : in std_logic; + inputVal : in std_logic_vector(3 downto 0); + power : out std_logic_vector(15 downto 0) + ); +end powerOfFour; + +architecture behavioral of powerOfFour is + + function Pow( N, Exp : integer ) return integer is + Variable Result : integer := 1; + + begin + for i in 1 to Exp loop + Result := Result * N; + end loop; + return( Result ); + end Pow; + +begin + + process begin + wait until Clk = '1'; + + power <= conv_std_logic_vector(Pow(conv_integer(inputVal),4),16); + + end process; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; + +entity regFile is port ( + clk, rst: in std_logic; + data: in std_logic_vector(31 downto 0); + regSel: in std_logic_vector(1 downto 0); + wrEnable: in std_logic; + regOut: out std_logic_vector(31 downto 0) + ); +end regFile; + +architecture behavioral of regFile is + +subtype reg is std_logic_vector(31 downto 0); +type regArray is array (integer range <>) of reg; + +signal registerFile: regArray(0 to 3); + +begin + + regProc: process (clk, rst) + variable i: integer; + + begin + i := 0; + + if rst = '1' then + while i <= registerFile'high loop + registerFile(i) <= (others => '0'); + i := i + 1; + end loop; + + elsif clk'event and clk = '1' then + if (wrEnable = '1') then + case regSel is + when "00" => + registerFile(0) <= data; + when "01" => + registerFile(1) <= data; + when "10" => + registerFile(2) <= data; + when "11" => + registerFile(3) <= data; + when others => + null; + end case; + end if; + end if; + end process; + + outputs: process(regSel, registerFile) begin + case regSel is + when "00" => + regOut <= registerFile(0); + when "01" => + regOut <= registerFile(1); + when "10" => + regOut <= registerFile(2); + when "11" => + regOut <= registerFile(3); + when others => + null; + end case; + end process; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; + +entity DFF is port ( + d1,d2: in std_logic; + q1,q2: out std_logic; + clk: in std_logic; + rst : in std_logic + ); +end DFF; + +architecture rtl of DFF is + +begin + + resetLatch: process (clk, rst) begin + if rst = '1' then + q1 <= '0'; + elsif clk'event and clk = '1' then + q1 <= d1; + q2 <= d2; + end if; + end process; + +end rtl; +library ieee; +use ieee.std_logic_1164.all; + +entity resFcnDemo is port ( + a, b: in std_logic; + oeA,oeB: in std_logic; + result: out std_logic + ); +end resFcnDemo; + +architecture multiDriver of resFcnDemo is + +begin + + result <= a when oeA = '1' else 'Z'; + result <= b when oeB = '1' else 'Z'; + +end multiDriver; +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity scaleDFF is port ( + data: in std_logic_vector(7 downto 0); + clock: in std_logic; + enable: in std_logic; + qout: out std_logic_vector(7 downto 0) + ); +end scaleDFF; + +architecture scalable of scaleDFF is + +begin + + u1: sDFFE port map (d => data, + clk =>clock, + en => enable, + q => qout + ); + +end scalable; +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_unsigned.all; + +entity sevenSegment is port ( + bcdInputs: in std_logic_vector (3 downto 0); + a_n, b_n, c_n, d_n, + e_n, f_n, g_n: out std_logic + ); +end sevenSegment; + +architecture behavioral of sevenSegment is + +signal la_n, lb_n, lc_n, ld_n, le_n, lf_n, lg_n: std_logic; +signal oe: std_logic; + +begin + + bcd2sevSeg: process (bcdInputs) begin + + -- Assign default to "off" + la_n <= '1'; lb_n <= '1'; + lc_n <= '1'; ld_n <= '1'; + le_n <= '1'; lf_n <= '1'; + lg_n <= '1'; + + case bcdInputs is + when "0000" => la_n <= '0'; lb_n <= '0'; + lc_n <= '0'; ld_n <= '0'; + le_n <= '0'; lf_n <= '0'; + + when "0001" => lb_n <= '0'; lc_n <= '0'; + + when "0010" => la_n <= '0'; lb_n <= '0'; + ld_n <= '0'; le_n <= '0'; + lg_n <= '0'; + + when "0011" => la_n <= '0'; lb_n <= '0'; + lc_n <= '0'; ld_n <= '0'; + lg_n <= '0'; + + when "0100" => lb_n <= '0'; lc_n <= '0'; + lf_n <= '0'; lg_n <= '0'; + + when "0101" => la_n <= '0'; lc_n <= '0'; + ld_n <= '0'; lf_n <= '0'; + lg_n <= '0'; + + when "0110" => la_n <= '0'; lc_n <= '0'; + ld_n <= '0'; le_n <= '0'; + lf_n <= '0'; lg_n <= '0'; + + when "0111" => la_n <= '0'; lb_n <= '0'; + lc_n <= '0'; + + when "1000" => la_n <= '0'; lb_n <= '0'; + lc_n <= '0'; ld_n <= '0'; + le_n <= '0'; lf_n <= '0'; + lg_n <= '0'; + + when "1001" => la_n <= '0'; lb_n <= '0'; + lc_n <= '0'; ld_n <= '0'; + lf_n <= '0'; lg_n <= '0'; + +-- All other inputs possibilities are "don't care" + + when others => la_n <= 'X'; lb_n <= 'X'; + lc_n <= 'X'; ld_n <= 'X'; + le_n <= 'X'; lf_n <= 'X'; + lg_n <= 'X'; + + end case; + + end process bcd2sevSeg; + + -- Disable outputs for all invalid input values + + oe <= '1' when (bcdInputs < 10) else '0'; + + a_n <= la_n when oe = '1' else 'Z'; + b_n <= lb_n when oe = '1' else 'Z'; + c_n <= lc_n when oe = '1' else 'Z'; + d_n <= ld_n when oe = '1' else 'Z'; + e_n <= le_n when oe = '1' else 'Z'; + f_n <= lf_n when oe = '1' else 'Z'; + g_n <= lg_n when oe = '1' else 'Z'; + + +end behavioral; +library ieee; +use ieee.std_logic_1164.all; + +use std.textio.all; + +entity sevenSegmentTB is +end sevenSegmentTB; + +architecture testbench of sevenSegmentTB is + +component sevenSegment port ( + bcdInputs: in std_logic_vector (3 downto 0); + a_n, b_n, c_n, d_n, + e_n, f_n, g_n: out std_logic + ); +end component; + +type vector is record + bcdStimulus: std_logic_vector(3 downto 0); + sevSegOut: std_logic_vector(6 downto 0); +end record; + +constant NumVectors: integer:= 17; +constant PropDelay: time := 40 ns; +constant SimLoopDelay: time := 10 ns; + +type vectorArray is array (0 to NumVectors - 1) of vector; +constant vectorTable: vectorArray := ( + (bcdStimulus => "0000", sevSegOut => "0000001"), + (bcdStimulus => "0001", sevSegOut => "1001111"), + (bcdStimulus => "0010", sevSegOut => "0010010"), + (bcdStimulus => "0011", sevSegOut => "0000110"), + (bcdStimulus => "0100", sevSegOut => "1001100"), + (bcdStimulus => "0101", sevSegOut => "0100100"), + (bcdStimulus => "0110", sevSegOut => "0100000"), + (bcdStimulus => "0111", sevSegOut => "0001111"), + (bcdStimulus => "1000", sevSegOut => "0000000"), + (bcdStimulus => "1001", sevSegOut => "0000100"), + (bcdStimulus => "1010", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "1011", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "1100", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "1101", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "1110", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "1111", sevSegOut => "ZZZZZZZ"), + (bcdStimulus => "0000", sevSegOut => "0110110") -- this vector fails + ); + +for all : sevenSegment use entity work.sevenSegment(behavioral); + +signal StimInputs: std_logic_vector(3 downto 0); +signal CaptureOutputs: std_logic_vector(6 downto 0); + +begin + + u1: sevenSegment port map (bcdInputs => StimInputs, + a_n => CaptureOutputs(6), + b_n => CaptureOutputs(5), + c_n => CaptureOutputs(4), + d_n => CaptureOutputs(3), + e_n => CaptureOutputs(2), + f_n => CaptureOutputs(1), + g_n => CaptureOutputs(0)); + + LoopStim: process + variable FoundError: boolean := false; + variable TempVector: vector; + variable ErrorMsgLine: line; + begin + + for i in vectorTable'range loop + TempVector := vectorTable(i); + + StimInputs <= TempVector.bcdStimulus; + + wait for PropDelay; + + if CaptureOutputs /= TempVector.sevSegOut then + write (ErrorMsgLine, string'("Vector failed at ")); + write (ErrorMsgLine, now); + writeline (output, ErrorMsgLine); + FoundError := true; + end if; + + wait for SimLoopDelay; + + end loop; + + assert FoundError + report "No errors. All vectors passed." + severity note; + + wait; + + end process; + +end testbench; +library ieee; +use ieee.std_logic_1164.all; + +entity sevenSegment is port ( + bcdInputs: in std_logic_vector (3 downto 0); + a_n, b_n, c_n, d_n, + e_n, f_n, g_n: out std_logic + ); +end sevenSegment; + +architecture behavioral of sevenSegment is + +begin + + bcd2sevSeg: process (bcdInputs) begin + + -- Assign default to "off" + a_n <= '1'; b_n <= '1'; + c_n <= '1'; d_n <= '1'; + e_n <= '1'; f_n <= '1'; + g_n <= '1'; + + case bcdInputs is + when "0000" => + a_n <= '0'; b_n <= '0'; + c_n <= '0'; d_n <= '0'; + e_n <= '0'; f_n <= '0'; + + when "0001" => + b_n <= '0'; c_n <= '0'; + + when "0010" => + a_n <= '0'; b_n <= '0'; + d_n <= '0'; e_n <= '0'; + g_n <= '0'; + + when "0011" => + a_n <= '0'; b_n <= '0'; + c_n <= '0'; d_n <= '0'; + g_n <= '0'; + + when "0100" => + b_n <= '0'; c_n <= '0'; + f_n <= '0'; g_n <= '0'; + + when "0101" => + a_n <= '0'; c_n <= '0'; + d_n <= '0'; f_n <= '0'; + g_n <= '0'; + + when "0110" => + a_n <= '0'; c_n <= '0'; + d_n <= '0'; e_n <= '0'; + f_n <= '0'; g_n <= '0'; + + when "0111" => + a_n <= '0'; b_n <= '0'; + c_n <= '0'; + + when "1000" => + a_n <= '0'; b_n <= '0'; + c_n <= '0'; d_n <= '0'; + e_n <= '0'; f_n <= '0'; + g_n <= '0'; + + when "1001" => + a_n <= '0'; b_n <= '0'; + c_n <= '0'; d_n <= '0'; + f_n <= '0'; g_n <= '0'; + + when others => + null; + + end case; + + end process bcd2sevSeg; + +end behavioral; +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity ForceShare is port ( + a,b,c,d,e,f: in std_logic_vector (7 downto 0); + result: out std_logic_vector(7 downto 0) + ); +end ForceShare; + +architecture behaviour of ForceShare is + +begin + + sum: process (a,c,b,d,e,f) + variable tempSum: std_logic_vector(7 downto 0); + begin + + tempSum := a + b; -- temporary node for sum + + if (tempSum = "10011010") then + result <= c; + elsif (tempSum = "01011001") then + result <= d; + elsif (tempSum = "10111011") then + result <= e; + else + result <= f; + end if; + end process; + +end behaviour; +library IEEE; +use IEEE.std_logic_1164.all; + +entity shifter is port ( + clk, rst: in std_logic; + shiftEn,shiftIn: std_logic; + q: out std_logic_vector (15 downto 0) + ); +end shifter; + + +architecture behav of shifter is + +signal qLocal: std_logic_vector(15 downto 0); + +begin + + shift: process (clk, rst) begin + if (rst = '1') then + qLocal <= (others => '0'); + elsif (clk'event and clk = '1') then + if (shiftEn = '1') then + qLocal <= qLocal(14 downto 0) & shiftIn; + else + qLocal <= qLocal; + end if; + end if; + + q <= qLocal; + end process; + +end behav; +library ieee; +use ieee.std_logic_1164.all; + +entity lastAssignment is port + (a, b: in std_logic; + selA, selb: in std_logic; + result: out std_logic + ); +end lastAssignment; + +architecture behavioral of lastAssignment is + +begin + + demo: process (a,b,selA,selB) begin + if (selA = '1') then + result <= a; + else + result <= '0'; + end if; + + if (selB = '1') then + result <= b; + else + result <= '0'; + end if; + end process demo; + +end behavioral; +library ieee; +use ieee.std_logic_1164.all; + +entity signalDemo is port ( + a: in std_logic; + b: out std_logic + ); +end signalDemo; + +architecture basic of signalDemo is + +signal c: std_logic; + +begin + + demo: process (a) begin + + c <= a; + + if c = '0' then + b <= a; + else + b <= '0'; + end if; + + end process; + +end basic; +library ieee; +use ieee.std_logic_1164.all; + +entity signalDemo is port ( + a: in std_logic; + b: out std_logic + ); +end signalDemo; + +architecture basic of signalDemo is + +signal c: std_logic; + +begin + + demo: process (a) begin + + c <= a; + + if c = '1' then + b <= a; + else + b <= '0'; + end if; + + end process; + +end basic; +library IEEE; +USE IEEE.std_logic_1164.all; + +package simPrimitives is + + component OR2 + generic (tPD: time := 1 ns); + + port (I1, I2: in std_logic; + Y: out std_logic + ); + end component; + + component SimDFF + generic(tCQ: time := 1 ns; + tS : time := 1 ns; + tH : time := 1 ns + ); + port (D, Clk: in std_logic; + Q: out std_logic + ); + end component; + + +end simPrimitives; + + +library IEEE; +USE IEEE.std_logic_1164.all; + +entity OR2 is + generic (tPD: time := 1 ns); + + port (I1, I2: in std_logic; + Y: out std_logic + ); +end OR2; + +architecture simple of OR2 is + +begin + + Y <= I1 OR I2 after tPD; + +end simple; + + + +library IEEE; +use IEEE.std_logic_1164.all; + +entity SimDFF is + generic(tCQ: time := 1 ns; + tS : time := 1 ns; + tH : time := 1 ns + ); + port (D, Clk: in std_logic; + Q: out std_logic + ); +end SimDff; + +architecture SimModel of SimDFF is + +begin + + reg: process (Clk, D) begin + + -- Assign output tCQ after rising clock edge + if (Clk'event and Clk = '1') then + Q <= D after tCQ; + end if; + + -- Check setup time + if (Clk'event and Clk = '1') then + assert (D'last_event >= tS) + report "Setup time violation" + severity Warning; + end if; + + -- Check hold time + if (D'event and Clk'stable and Clk = '1') then + assert (D'last_event - Clk'last_event > tH) + report "Hold Time Violation" + severity Warning; + end if; + + end process; + +end simModel; + +library IEEE; +use IEEE.std_logic_1164.all; + +entity SRFF is port ( + s,r: in std_logic; + clk: in std_logic; + q: out std_logic + ); +end SRFF; + +architecture rtl of SRFF is + +begin + + process begin + wait until rising_edge(clk); + if s = '0' and r = '1' then + q <= '0'; + elsif s = '1' and r = '0' then + q <= '1'; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +entity SRFF is port ( + s,r: in std_logic; + clk: in std_logic; + q: out std_logic + ); +end SRFF; + +architecture rtl of SRFF is + +begin + + process begin + wait until clk = '1'; + if s = '0' and r = '1' then + q <= '0'; + elsif s = '1' and r = '0' then + q <= '1'; + end if; + end process; + +end rtl; +library IEEE; +use IEEE.std_logic_1164.all; + +package scaleable is + component scaleUpCnt port ( + clk: in std_logic; + reset: in std_logic; + cnt: in std_logic_vector + ); + end component; +end scaleable; + +library IEEE; +use IEEE.std_logic_1164.all; + +use work.primitive.all; + +entity scaleUpCnt is port ( + clk: in std_logic; + reset: in std_logic; + cnt: out std_logic_vector + ); +end scaleUpCnt; + +architecture scaleable of scaleUpCnt is + +signal one: std_logic := '1'; +signal cntL: std_logic_vector(cnt'range); +signal andTerm: std_logic_vector(cnt'range); + +begin + +-- Special case is the least significant bit + + lsb: tff port map (t => one, + reset => reset, + clk => clk, + q => cntL(cntL'low) + ); + + andTerm(0) <= cntL(cntL'low); + + +-- General case for all other bits + + genAnd: for i in 1 to cntL'high generate + andTerm(i) <= andTerm(i - 1) and cntL(i); + end generate; + + genTFF: for i in 1 to cntL'high generate + t1: tff port map (t => andTerm(i), + clk => clk, + reset => reset, + q => cntl(i) + ); + end generate; + + cnt <= CntL; + +end scaleable; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(2 downto 0); + +constant Idle: targetFsmType := "000"; +constant B_Busy: targetFsmType := "101"; +constant Backoff: targetFsmType := "010"; +constant S_Data: targetFsmType := "011"; +constant Turn_Ar: targetFsmType := "110"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + null; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(2 downto 0); + +constant Idle: targetFsmType := "000"; +constant B_Busy: targetFsmType := "001"; +constant Backoff: targetFsmType := "011"; +constant S_Data: targetFsmType := "010"; +constant Turn_Ar: targetFsmType := "110"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + null; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(2 downto 0); + +constant Idle: targetFsmType := "000"; +constant B_Busy: targetFsmType := "001"; +constant Backoff: targetFsmType := "010"; +constant S_Data: targetFsmType := "011"; +constant Turn_Ar: targetFsmType := "100"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + null; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(3 downto 0); + +constant Idle: targetFsmType := "0000"; +constant B_Busy: targetFsmType := "0001"; +constant Backoff: targetFsmType := "0011"; +constant S_Data: targetFsmType := "1100"; +constant Turn_Ar: targetFsmType := "1101"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + null; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(2 downto 0); + +constant Idle: targetFsmType := "000"; +constant B_Busy: targetFsmType := "101"; +constant Backoff: targetFsmType := "010"; +constant S_Data: targetFsmType := "011"; +constant Turn_Ar: targetFsmType := "110"; +constant Dont_Care: targetFsmType := "XXX"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + nextState <= Dont_Care; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + + -- Set default output assignments + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Stop_n: out std_logic; -- PCI Stop# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +type targetFsmType is (Idle, B_Busy, Backoff, S_Data, Turn_Ar); + +signal currState, nextState: targetFsmType; + +begin + +-- Process to generate next state logic + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when Idle => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_Busy; + else + nextState <= Idle; + end if; + + when B_Busy => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= Idle; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= Backoff; + else + nextState <= B_Busy; + end if; + + when S_Data => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= Backoff; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= Turn_Ar; + else + nextState <= S_Data; + end if; + + + when Backoff => + if PCI_Frame_n = '1' then + nextState <= Turn_Ar; + else + nextState <= Backoff; + end if; + + when Turn_Ar => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_Busy; + else + nextState <= Idle; + end if; + + when others => + null; + + end case; + + end process nxtStProc; + + +-- Process to register the current state + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + +-- Process to generate outputs + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + +-- Assign output ports + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +-- Incorporates Errata 10.1 and 10.2 + +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(4 downto 0); + +constant Idle: integer := 0; +constant B_Busy: integer := 1; +constant Backoff: integer := 2; +constant S_Data: integer := 3; +constant Turn_Ar: integer := 4; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + + nextState <= (others => '0'); + + if currState(Idle) = '1' then + if (PCI_Frame_n = '0' and Hit = '0') then + nextState(B_Busy) <= '1'; + else + nextState(Idle) <= '1'; + end if; + end if; + + if currState(B_Busy) = '1' then + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState(Idle) <= '1'; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState(S_Data) <= '1'; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState(Backoff) <= '1'; + else + nextState(B_Busy) <= '1'; + end if; + end if; + + if currState(S_Data) = '1' then + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and + (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState(Backoff) <= '1'; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState(Turn_Ar) <= '1'; + else + nextState(S_Data) <= '1'; + end if; + end if; + + + if currState(Backoff) = '1' then + if PCI_Frame_n = '1' then + nextState(Turn_Ar) <= '1'; + else + nextState(Backoff) <= '1'; + end if; + end if; + + if currState(Turn_Ar) = '1' then + if (PCI_Frame_n = '0' and Hit = '0') then + nextState(B_Busy) <= '1'; + else + nextState(Idle) <= '1'; + end if; + end if; + + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= (others => '0'); -- per Errata 10.2 + currState(Idle) <= '1'; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + OE_Trdy_n <= '0'; OE_Stop_n <= '0'; OE_Devsel_n <= '0'; -- defaults per errata 10.1 + OE_AD <= '0'; LPCI_Trdy_n <= '1'; LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + if (currState(S_Data) = '1') then + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + end if; + + + if (currState(Backoff) = '1') then + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + end if; + + + if (currState(Turn_Ar) = '1') then + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + end if; + + if (currState(Idle) = '1' or currState(B_Busy) = '1') then + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + end if; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + + ); +end pci_target; + +architecture fsm of pci_target is + +signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + +subtype targetFsmType is std_logic_vector(2 downto 0); + +constant Idle: targetFsmType := "000"; +constant B_Busy: targetFsmType := "001"; +constant Backoff: targetFsmType := "011"; +constant S_Data: targetFsmType := "110"; +constant Turn_Ar: targetFsmType := "100"; + +signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when IDLE => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when B_BUSY => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= IDLE; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= BACKOFF; + else + nextState <= B_BUSY; + end if; + + when S_DATA => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= BACKOFF; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= TURN_AR; + else + nextState <= S_DATA; + end if; + + + when BACKOFF => + if PCI_Frame_n = '1' then + nextState <= TURN_AR; + else + nextState <= BACKOFF; + end if; + + when TURN_AR => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_BUSY; + else + nextState <= IDLE; + end if; + + when others => + nextState <= IDLE; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + + -- Set default output assignments + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library IEEE; +use IEEE.std_logic_1164.all; + +entity pci_target is port ( + PCI_Frame_n: in std_logic; -- PCI Frame# + PCI_Irdy_n: in std_logic; -- PCI Irdy# + Hit: in std_logic; -- Hit on address decode + D_Done: in std_logic; -- Device decode complete + Term: in std_logic; -- Terminate transaction + Ready: in std_logic; -- Ready to transfer data + Cmd_Write: in std_logic; -- Command is Write + Cmd_Read: in std_logic; -- Command is Read + T_Abort: in std_logic; -- Target error - abort transaction + PCI_Clk: in std_logic; -- PCI Clock + PCI_Reset_n: in std_logic; -- PCI Reset# + + PCI_Devsel_n: out std_logic; -- PCI Devsel# + PCI_Trdy_n: out std_logic; -- PCI Trdy# + PCI_Stop_n: out std_logic; -- PCI Stop# + OE_AD: out std_logic; -- PCI AD bus enable + OE_Trdy_n: out std_logic; -- PCI Trdy# enable + OE_Stop_n: out std_logic; -- PCI Stop# enable + OE_Devsel_n: out std_logic -- PCI Devsel# enable + ); +end pci_target; + +architecture fsm of pci_target is + + signal LPCI_Devsel_n, LPCI_Trdy_n, LPCI_Stop_n: std_logic; + + subtype targetFsmType is std_logic_vector(2 downto 0); + + constant Idle: targetFsmType := "000"; + constant B_Busy: targetFsmType := "001"; + constant Backoff: targetFsmType := "011"; + constant S_Data: targetFsmType := "110"; + constant Turn_Ar: targetFsmType := "100"; + + signal currState, nextState: targetFsmType; + +begin + + nxtStProc: process (currState, PCI_Frame_n, Hit, D_Done, PCI_Irdy_n, LPCI_Trdy_n, + LPCI_Devsel_n, LPCI_Stop_n, Term, Ready) begin + case currState is + when Idle => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_Busy; + else + nextState <= Idle; + end if; + + when B_Busy => + if (PCI_Frame_n ='1' and D_Done = '1') or + (PCI_Frame_n = '1' and D_Done = '0' and LPCI_Devsel_n = '0') then + nextState <= Idle; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '0' or (Term = '1' and Ready = '1') ) then + nextState <= S_Data; + elsif (PCI_Frame_n = '0' or PCI_Irdy_n = '0') and Hit = '1' and + (Term = '1' and Ready = '0') then + nextState <= Backoff; + else + nextState <= B_Busy; + end if; + + when S_Data => + if PCI_Frame_n = '0' and LPCI_Stop_n = '0' and + (LPCI_Trdy_n = '1' or PCI_Irdy_n = '0') then + nextState <= Backoff; + elsif PCI_Frame_n = '1' and (LPCI_Trdy_n = '0' or LPCI_Stop_n = '0') then + nextState <= Turn_Ar; + else + nextState <= S_Data; + end if; + + + when Backoff => + if PCI_Frame_n = '1' then + nextState <= Turn_Ar; + else + nextState <= Backoff; + end if; + + when Turn_Ar => + if (PCI_Frame_n = '0' and Hit = '0') then + nextState <= B_Busy; + else + nextState <= Idle; + end if; + + when others => + null; + end case; + end process nxtStProc; + + + curStProc: process (PCI_Clk, PCI_Reset_n) begin + if (PCI_Reset_n = '0') then + currState <= Idle; + elsif (PCI_Clk'event and PCI_Clk = '1') then + currState <= nextState; + end if; + end process curStProc; + + + outConProc: process (currState, Ready, T_Abort, Cmd_Write, + Cmd_Read, T_Abort, Term) begin + case currState is + when S_Data => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + if (Ready = '1' and T_Abort = '0' and (Cmd_Write = '1' or Cmd_Read = '1')) then + LPCI_Trdy_n <= '0'; + else + LPCI_Trdy_n <= '1'; + end if; + + if (T_Abort = '1' or Term = '1') and (Cmd_Write = '1' or Cmd_Read = '1') then + LPCI_Stop_n <= '0'; + else + LPCI_Stop_n <= '1'; + end if; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when Backoff => + if (Cmd_Read = '1') then + OE_AD <= '1'; + else + OE_AD <= '0'; + end if; + + LPCI_Stop_n <= '0'; + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + if (T_Abort = '0') then + LPCI_Devsel_n <= '0'; + else + LPCI_Devsel_n <= '1'; + end if; + + when Turn_Ar => + + OE_Trdy_n <= '1'; + OE_Stop_n <= '1'; + OE_Devsel_n <= '1'; + + when others => + + OE_Trdy_n <= '0'; + OE_Stop_n <= '0'; + OE_Devsel_n <= '0'; + OE_AD <= '0'; + LPCI_Trdy_n <= '1'; + LPCI_Stop_n <= '1'; + LPCI_Devsel_n <= '1'; + + end case; + + end process outConProc; + + PCI_Devsel_n <= LPCI_Devsel_n; + PCI_Trdy_n <= LPCI_Trdy_n; + PCI_Stop_n <= LPCI_Stop_n; + +end fsm; +library ieee; +use ieee.std_logic_1164.all; + +entity test is port ( + a: in std_logic; + z: out std_logic; + en: in std_logic + ); +end test; + +architecture simple of test is + +begin + + z <= a when en = '1' else 'z'; + +end simple; === added file 'Test/traffic_signal.v' --- Test/traffic_signal.v 1970-01-01 00:00:00 +0000 +++ Test/traffic_signal.v 2011-03-11 21:16:06 +0000 @@ -0,0 +1,49 @@ +// http://www.eg.bucknell.edu/~cs320/1995-fall/verilog-manual.html#RTFToC33 + +// Digital model of a traffic light +// By Dan Hyde August 10, 1995 +module traffic; +parameter on = 1, off = 0, red_tics = 35, + amber_tics = 3, green_tics = 20; +reg clock, red, amber, green; + +// will stop the simulation after 1000 time units +initial begin: stop_at + #1000; $stop; +end + +// initialize the lights and set up monitoring of registers +initial begin: Init + red = off; amber = off; green = off; + $display(" Time green amber red"); + $monitor("%3d %b %b %b", $time, green, amber, red); +end + +// task to wait for 'tics' positive edge clocks +// before turning light off +task light; + output color; + input [31:0] tics; + begin + repeat(tics) // wait to detect tics positive edges on clock + @(posedge clock); + color = off; + end +endtask + +// waveform for clock period of 2 time units +always begin: clock_wave + #1 clock = 0; + #1 clock = 1; +end + +always begin: main_process + red = on; + light(red, red_tics); // call task to wait + green = on; + light(green, green_tics); + amber = on; + light(amber, amber_tics); +end + +endmodule === added file 'Test/unicode8.java' --- Test/unicode8.java 1970-01-01 00:00:00 +0000 +++ Test/unicode8.java 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ + void ueberweisen ( Konto empfänger, int betrag ) { + abheben(betrag); + empfänger.einzahlen(betrag); + } === added file 'Test/union.f' --- Test/union.f 1970-01-01 00:00:00 +0000 +++ Test/union.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,21 @@ + program writedate + structure /start/ + union + map + character*2 month + character*2 day + character*2 year + end map + map + character*6 date + end map + end union + end structure + record /start/ sdate + sdate.month = '08' + sdate.day = '10' + sdate.year = '89' + write (*, 10) sdate.date +10 format (a) + stop + end === added file 'Test/value.f' --- Test/value.f 1970-01-01 00:00:00 +0000 +++ Test/value.f 2011-03-11 21:16:06 +0000 @@ -0,0 +1,9 @@ +! Provided by Brian Helsinki, 7 March 2003 + program figure(aa) + REAL aa + VALUE aa ! not supported breaks fig; pass by value + integer fig + call fig2(aa) + RETURN + END + === added file 'Test/verbatim.e' --- Test/verbatim.e 1970-01-01 00:00:00 +0000 +++ Test/verbatim.e 2011-03-11 21:16:06 +0000 @@ -0,0 +1,34 @@ +indexing + + description: "[ + This is a verbatim string. + ]" + +class VERBATIM + +feature -- Sample + + constant: STRING is "[ + Vertbatim constant + ]" + +feature {NONE} -- Implementation + + cpp_query (obj: FX_OBJECT; app: POINTER): POINTER is + -- Header comment + external "[ + C++ [ClassName %"EFXVisual.h%"] + (EIF_OBJECT, FXApp*): void* + ]" + end + + tail_attribute: INTEGER + +indexing + + library: "[ + EiffelBase: Library of reusable components for Eiffel. + ]" + + +end === modified file 'ant.c' --- ant.c 2009-07-14 15:05:23 +0000 +++ ant.c 2011-03-11 21:16:06 +0000 @@ -24,9 +24,9 @@ static void installAntRegex (const langType language) { addTagRegex (language, - "^[ \t]*<[ \t]*project.*name=\"([^\"]+)\".*", "\\1", "p,project,projects", NULL); + "^[ \t]*<[ \t]*project[^>]+name=\"([^\"]+)\".*", "\\1", "p,project,projects", NULL); addTagRegex (language, - "^[ \t]*<[ \t]*target.*name=\"([^\"]+)\".*", "\\1", "t,target,targets", NULL); + "^[ \t]*<[ \t]*target[^>]+name=\"([^\"]+)\".*", "\\1", "t,target,targets", NULL); } extern parserDefinition* AntParser () === modified file 'argproc.c' --- argproc.c 2007-09-08 09:16:38 +0000 +++ argproc.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: argproc.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1989, Mark Pizzolato (mark@infopiz.uucp) * === modified file 'args.c' --- args.c 2007-09-08 09:16:38 +0000 +++ args.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: args.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 1999-2002, Darren Hiebert * === modified file 'args.h' --- args.h 2007-09-08 09:16:38 +0000 +++ args.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: args.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1999-2002, Darren Hiebert * === modified file 'asm.c' --- asm.c 2007-09-08 09:16:38 +0000 +++ asm.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: asm.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * === modified file 'asp.c' --- asp.c 2009-07-14 15:05:23 +0000 +++ asp.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: asp.c 711 2009-07-04 16:52:11Z dhiebert $ +* $Id$ * * Copyright (c) 2000, Patrick Dehne * === modified file 'awk.c' --- awk.c 2007-09-08 09:16:38 +0000 +++ awk.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: awk.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2002, Darren Hiebert * === modified file 'beta.c' --- beta.c 2007-09-08 09:16:38 +0000 +++ beta.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: beta.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 1999-2000, Mjølner Informatics * === modified file 'c.c' --- c.c 2009-07-14 15:05:23 +0000 +++ c.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: c.c 689 2008-12-13 21:17:36Z elliotth $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'cobol.c' --- cobol.c 2007-09-08 09:16:38 +0000 +++ cobol.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: cobol.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * === removed file 'config.h.in' --- config.h.in 2009-07-14 15:05:23 +0000 +++ config.h.in 1970-01-01 00:00:00 +0000 @@ -1,277 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define this label if your system uses case-insensitive file names */ -#undef CASE_INSENSITIVE_FILENAMES - -/* Define this label if you wish to check the regcomp() function at run time - for correct behavior. This function is currently broken on Cygwin. */ -#undef CHECK_REGCOMP - -/* You can define this label to be a string containing the name of a - site-specific configuration file containing site-wide default options. The - files /etc/ctags.conf and /usr/local/etc/ctags.conf are already checked, so - only define one here if you need a file somewhere else. */ -#undef CUSTOM_CONFIGURATION_FILE - - -/* Define this as desired. - * 1: Original ctags format - * 2: Extended ctags format with extension flags in EX-style comment. - */ -#define DEFAULT_FILE_FORMAT 2 - - - -/* Define this label to use the system sort utility (which is probably more -* efficient) over the internal sorting algorithm. -*/ -#ifndef INTERNAL_SORT -# undef EXTERNAL_SORT -#endif - - -/* Define to 1 if you have the `chmod' function. */ -#undef HAVE_CHMOD - -/* Define to 1 if you have the `chsize' function. */ -#undef HAVE_CHSIZE - -/* Define to 1 if you have the `clock' function. */ -#undef HAVE_CLOCK - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fgetpos' function. */ -#undef HAVE_FGETPOS - -/* Define to 1 if you have the `findfirst' function. */ -#undef HAVE_FINDFIRST - -/* Define to 1 if you have the `fnmatch' function. */ -#undef HAVE_FNMATCH - -/* Define to 1 if you have the header file. */ -#undef HAVE_FNMATCH_H - -/* Define to 1 if you have the `ftruncate' function. */ -#undef HAVE_FTRUNCATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the `opendir' function. */ -#undef HAVE_OPENDIR - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `remove' function. */ -#undef HAVE_REMOVE - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_STAT_H - -/* Define this macro if the field "st_ino" exists in struct stat in - . */ -#undef HAVE_STAT_ST_INO - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `stricmp' function. */ -#undef HAVE_STRICMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strncasecmp' function. */ -#undef HAVE_STRNCASECMP - -/* Define to 1 if you have the `strnicmp' function. */ -#undef HAVE_STRNICMP - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the `tempnam' function. */ -#undef HAVE_TEMPNAM - -/* Define to 1 if you have the `times' function. */ -#undef HAVE_TIMES - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the `truncate' function. */ -#undef HAVE_TRUNCATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `_findfirst' function. */ -#undef HAVE__FINDFIRST - -/* Define as the maximum integer on your system if not defined . */ -#undef INT_MAX - -/* Define to the appropriate size for tmpnam() if does not define - this. */ -#undef L_tmpnam - -/* Define this label if you want macro tags (defined lables) to use patterns - in the EX command by default (original ctags behavior is to use line - numbers). */ -#undef MACROS_USE_PATTERNS - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_FGETPOS - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_FTRUNCATE - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_GETENV - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_LSTAT - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_MALLOC - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_REMOVE - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_STAT - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_TRUNCATE - -/* If you receive error or warning messages indicating that you are missing a - prototype for, or a type mismatch using, the following function, define - this label and remake. */ -#undef NEED_PROTO_UNLINK - -/* Define this is you have a prototype for putenv() in , but doesn't - declare its argument as "const char *". */ -#undef NON_CONST_PUTENV_PROTOTYPE - -/* Package name. */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define this label if regcomp() is broken. */ -#undef REGCOMP_BROKEN - -/* Define this value used by fseek() appropriately if (or - on SunOS 4.1.x) does not define them. */ -#undef SEEK_SET - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define this label if your system supports starting scripts with a line of - the form "#! /bin/sh" to select the interpreter to use for the script. */ -#undef SYS_INTERPRETER - -/* If you wish to change the directory in which temporary files are stored, - define this label to the directory desired. */ -#undef TMPDIR - -/* Package version. */ -#undef VERSION - -/* This corrects the problem of missing prototypes for certain functions in - some GNU installations (e.g. SunOS 4.1.x). */ -#undef __USE_FIXED_PROTOTYPES__ - -/* Define to the appropriate type if does not define this. */ -#undef clock_t - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to long if does not define this. */ -#undef fpos_t - -/* Define to `long int' if does not define. */ -#undef off_t - -/* Define remove to unlink if you have unlink(), but not remove(). */ -#undef remove - -/* Define to `unsigned int' if does not define. */ -#undef size_t === removed file 'configure' --- configure 2009-07-14 15:05:23 +0000 +++ configure 1970-01-01 00:00:00 +0000 @@ -1,7704 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="ctags.h" -ac_header_list= -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -install_targets -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -LN_S -STRIP -sort_found -CPP -GREP -EGREP -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-etags enable the installation of links for etags - --disable-extended-format - disable extension flags; use original ctags file - format only - --disable-external-sort use internal sort algorithm instead of sort program - --enable-custom-config=FILE - enable custom config file for site-wide defaults - --enable-macro-patterns use patterns as default method to locate macros - instead of line numbers - --enable-maintainer-mode - use maintainer makefile - --enable-shell-globbing=DIR - does shell expand wildcards (yes|no)? yes - --enable-tmpdir=DIR default directory for temporary files ARG=/tmp - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-posix-regex use Posix regex interface, if available - --with-readlib include readtags library object during install - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -ac_header_list="$ac_header_list dirent.h" -ac_header_list="$ac_header_list fcntl.h" -ac_header_list="$ac_header_list fnmatch.h" -ac_header_list="$ac_header_list stat.h" -ac_header_list="$ac_header_list stdlib.h" -ac_header_list="$ac_header_list string.h" -ac_header_list="$ac_header_list time.h" -ac_header_list="$ac_header_list types.h" -ac_header_list="$ac_header_list unistd.h" -ac_header_list="$ac_header_list sys/dir.h" -ac_header_list="$ac_header_list sys/stat.h" -ac_header_list="$ac_header_list sys/times.h" -ac_header_list="$ac_header_list sys/types.h" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers config.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Report system info -# ------------------ -program_name=`grep 'PROGRAM_NAME *"' ctags.h | sed -e 's/.*"\([^"]*\)".*/\1/'` -program_version=`grep 'PROGRAM_VERSION *"' ctags.h | sed -e 's/.*"\([^"]*\)".*/\1/'` -echo "$program_name, version $program_version" -uname -mrsv 2>/dev/null - -# Define convenience macros -# ------------------------- -# CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ]) - - -# Checks for configuration options -# -------------------------------- - - -# Check whether --with-posix-regex was given. -if test "${with_posix_regex+set}" = set; then - withval=$with_posix_regex; -fi - - - -# Check whether --with-readlib was given. -if test "${with_readlib+set}" = set; then - withval=$with_readlib; -fi - - -# AC_ARG_WITH(perl-regex, -# [ --with-perl-regex use Perl pcre interface, if available]) - -# Check whether --enable-etags was given. -if test "${enable_etags+set}" = set; then - enableval=$enable_etags; -fi - - -# Check whether --enable-extended-format was given. -if test "${enable_extended_format+set}" = set; then - enableval=$enable_extended_format; cat >>confdefs.h <<\_ACEOF -#define DEFAULT_FILE_FORMAT 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define DEFAULT_FILE_FORMAT 2 -_ACEOF - -fi - - -# Check whether --enable-external-sort was given. -if test "${enable_external_sort+set}" = set; then - enableval=$enable_external_sort; -fi - - -# Check whether --enable-custom-config was given. -if test "${enable_custom_config+set}" = set; then - enableval=$enable_custom_config; -fi - - -# Check whether --enable-macro-patterns was given. -if test "${enable_macro_patterns+set}" = set; then - enableval=$enable_macro_patterns; -fi - - -# Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then - enableval=$enable_maintainer_mode; -fi - - -# Check whether --enable-shell-globbing was given. -if test "${enable_shell_globbing+set}" = set; then - enableval=$enable_shell_globbing; -fi - - -# Check whether --enable-tmpdir was given. -if test "${enable_tmpdir+set}" = set; then - enableval=$enable_tmpdir; tmpdir_specified=yes -fi - - - -# Process configuration options -# ----------------------------- - -if test "$enable_maintainer_mode" = yes ; then - { echo "$as_me:$LINENO: result: enabling maintainer mode" >&5 -echo "${ECHO_T}enabling maintainer mode" >&6; } -fi - -install_targets="install-ctags" -{ echo "$as_me:$LINENO: checking whether to install link to etags" >&5 -echo $ECHO_N "checking whether to install link to etags... $ECHO_C" >&6; } -if test yes = "$enable_etags"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - install_targets="$install_targets install-etags" -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -{ echo "$as_me:$LINENO: checking whether to install readtags object file" >&5 -echo $ECHO_N "checking whether to install readtags object file... $ECHO_C" >&6; } -if test yes = "$with_readlib"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - install_targets="$install_targets install-lib" -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$enable_custom_config" = no -o "$enable_custom_config" = yes ; then - { echo "$as_me:$LINENO: result: no name supplied for custom configuration file" >&5 -echo "${ECHO_T}no name supplied for custom configuration file" >&6; } -elif test -n "$enable_custom_config" ; then - cat >>confdefs.h <<_ACEOF -#define CUSTOM_CONFIGURATION_FILE "$enable_custom_config" -_ACEOF - - { echo "$as_me:$LINENO: result: $enable_custom_config will be used as custom configuration file" >&5 -echo "${ECHO_T}$enable_custom_config will be used as custom configuration file" >&6; } -fi - -if test "$enable_macro_patterns" = yes ; then - cat >>confdefs.h <<\_ACEOF -#define MACROS_USE_PATTERNS 1 -_ACEOF - - { echo "$as_me:$LINENO: result: tag file will use patterns for macros by default" >&5 -echo "${ECHO_T}tag file will use patterns for macros by default" >&6; } -fi - -# Checks for programs -# ------------------- - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -case `uname` in - HP-UX) - { echo "$as_me:$LINENO: checking HP-UX native compiler" >&5 -echo $ECHO_N "checking HP-UX native compiler... $ECHO_C" >&6; } - if test "$CC" = "cc"; then - { echo "$as_me:$LINENO: result: yes; adding compiler options for ANSI support" >&5 -echo "${ECHO_T}yes; adding compiler options for ANSI support" >&6; } - CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE" - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - fi - ;; - SunOS) - if uname -r | grep '5\.' >/dev/null 2>&1; then - { echo "$as_me:$LINENO: checking Solaris native compiler" >&5 -echo $ECHO_N "checking Solaris native compiler... $ECHO_C" >&6; } - if test "$CC" = "cc" -a "`which cc`" = "/usr/ucb/cc"; then - { echo "$as_me:$LINENO: result: yes; adding compiler option for ANSI support" >&5 -echo "${ECHO_T}yes; adding compiler option for ANSI support" >&6; } - CC="$CC -Xa" - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - fi - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - -# Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - - -# Checks for operating environment -# -------------------------------- - -# Check for temporary directory -{ echo "$as_me:$LINENO: checking directory to use for temporary files" >&5 -echo $ECHO_N "checking directory to use for temporary files... $ECHO_C" >&6; } -if test -n "$enable_tmpdir"; then - tmpdir="$enable_tmpdir" -elif test -n "$TMPDIR"; then - tmpdir="$TMPDIR" -elif test -n "$TMPDIR"; then - tmpdir="$TMPDIR" -elif test -n "$TMP"; then - tmpdir="$TMP" -elif test -n "$TEMP"; then - tmpdir="$TEMP" -elif test -d "c:/"; then - tmpdir="c:/" -else - tmpdir="/tmp" -fi -if test -d $tmpdir ; then - { echo "$as_me:$LINENO: result: $tmpdir" >&5 -echo "${ECHO_T}$tmpdir" >&6; } - cat >>confdefs.h <<_ACEOF -#define TMPDIR "$tmpdir" -_ACEOF - -else - { { echo "$as_me:$LINENO: error: $tmpdir does not exist" >&5 -echo "$as_me: error: $tmpdir does not exist" >&2;} - { (exit 1); exit 1; }; } -fi - -# Check whether system supports #! scripts -{ echo "$as_me:$LINENO: checking whether #! works in shell scripts" >&5 -echo $ECHO_N "checking whether #! works in shell scripts... $ECHO_C" >&6; } -if test "${ac_cv_sys_interpreter+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - echo '#! /bin/cat -exit 69 -' >conftest -chmod u+x conftest -(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1) -if test $? -ne 69; then - ac_cv_sys_interpreter=yes -else - ac_cv_sys_interpreter=no -fi -rm -f conftest -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_interpreter" >&5 -echo "${ECHO_T}$ac_cv_sys_interpreter" >&6; } -interpval=$ac_cv_sys_interpreter - -if test yes = "$interpval"; then - cat >>confdefs.h <<\_ACEOF -#define SYS_INTERPRETER 1 -_ACEOF - -fi - -# Test for case-insensitive filenames -{ echo "$as_me:$LINENO: checking for case-insensitive filenames" >&5 -echo $ECHO_N "checking for case-insensitive filenames... $ECHO_C" >&6; } -touch conftest.cif -if test -f CONFTEST.CIF; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF -#define CASE_INSENSITIVE_FILENAMES 1 -_ACEOF - -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest.cif - -{ echo "$as_me:$LINENO: checking selected sort method" >&5 -echo $ECHO_N "checking selected sort method... $ECHO_C" >&6; } -if test no = "$enable_external_sort"; then - { echo "$as_me:$LINENO: result: simple internal algorithm" >&5 -echo "${ECHO_T}simple internal algorithm" >&6; } -else - { echo "$as_me:$LINENO: result: external sort utility" >&5 -echo "${ECHO_T}external sort utility" >&6; } - enable_external_sort=no - # Extract the first word of "sort", so it can be a program name with args. -set dummy sort; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_sort_found+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$sort_found"; then - ac_cv_prog_sort_found="$sort_found" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_sort_found="yes" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_sort_found" && ac_cv_prog_sort_found="no" -fi -fi -sort_found=$ac_cv_prog_sort_found -if test -n "$sort_found"; then - { echo "$as_me:$LINENO: result: $sort_found" >&5 -echo "${ECHO_T}$sort_found" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - if test "$sort_found" = yes ; then - { echo "$as_me:$LINENO: checking if sort accepts our command line" >&5 -echo $ECHO_N "checking if sort accepts our command line... $ECHO_C" >&6; } - touch ${tmpdir}/sort.test - sort -u -f -o ${tmpdir}/sort.test ${tmpdir}/sort.test 1>/dev/null 2>&1 - if test $? -ne 0 ; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - else - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF -#define EXTERNAL_SORT 1 -_ACEOF - - enable_external_sort=yes - fi - rm -f ${tmpdir}/sort.test - fi -fi -if test "$enable_external_sort" != yes ; then - { echo "$as_me:$LINENO: result: using internal sort algorithm as fallback" >&5 -echo "${ECHO_T}using internal sort algorithm as fallback" >&6; } -fi - - -# Checks for header files -# ----------------------- - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - -for ac_header in $ac_header_list -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Checks for header file macros -# ----------------------------- - - - { echo "$as_me:$LINENO: checking if L_tmpnam is defined in stdio.h" >&5 -echo $ECHO_N "checking if L_tmpnam is defined in stdio.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef L_tmpnam - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define L_tmpnam 20 -_ACEOF - - -fi -rm -f conftest* - - - - { echo "$as_me:$LINENO: checking if INT_MAX is defined in limits.h" >&5 -echo $ECHO_N "checking if INT_MAX is defined in limits.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef INT_MAX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - - { echo "$as_me:$LINENO: checking if MAXINT is defined in limits.h" >&5 -echo $ECHO_N "checking if MAXINT is defined in limits.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef MAXINT - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF -#define INT_MAX MAXINT -_ACEOF - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define INT_MAX 32767 -_ACEOF - - -fi -rm -f conftest* - - -fi -rm -f conftest* - - - -# Checks for typedefs -# ------------------- - -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef off_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_off_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - -fi - - -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fpos_t" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define fpos_t long -_ACEOF - - -fi -rm -f conftest* - - -{ echo "$as_me:$LINENO: checking for clock_t" >&5 -echo $ECHO_N "checking for clock_t... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "clock_t" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define clock_t long -_ACEOF - - -fi -rm -f conftest* - - - -# Checks for compiler characteristics -# ----------------------------------- - -# AC_CYGWIN -# AC_MINGW32 -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - - - - -{ echo "$as_me:$LINENO: checking if struct stat contains st_ino" >&5 -echo $ECHO_N "checking if struct stat contains st_ino... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ - - struct stat st; - stat(".", &st); - if (st.st_ino > 0) - exit(0); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - have_st_ino=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - have_st_ino=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_st_ino" >&5 -echo "${ECHO_T}$have_st_ino" >&6; } -if test yes = "$have_st_ino"; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_STAT_ST_INO 1 -_ACEOF - -fi - - -# Checks for library functions -# ---------------------------- - - -for ac_func in fnmatch -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -for ac_func in strstr -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -for ac_func in strcasecmp stricmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in strncasecmp strnicmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - -for ac_func in fgetpos -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_fgetpos=yes -fi -done - - -# SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x -if test "$have_fgetpos" != yes ; then - - { echo "$as_me:$LINENO: checking if SEEK_SET is defined in stdio.h" >&5 -echo $ECHO_N "checking if SEEK_SET is defined in stdio.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef SEEK_SET - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - - { echo "$as_me:$LINENO: checking if SEEK_SET is defined in unistd.h" >&5 -echo $ECHO_N "checking if SEEK_SET is defined in unistd.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef SEEK_SET - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define SEEK_SET 0 -_ACEOF - - -fi -rm -f conftest* - - -fi -rm -f conftest* - -fi - - -for ac_func in mkstemp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_mkstemp=yes -fi -done - -if test "$have_mkstemp" != yes ; then - -for ac_func in tempnam -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_tempnam=yes -fi -done - -fi -if test "$have_mkstemp" != yes -a "$have_tempnam" != yes; then - -for ac_func in chmod -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - if test "$tmpdir_specified" = yes ; then - { echo "$as_me:$LINENO: result: use of tmpnam overrides temporary directory selection" >&5 -echo "${ECHO_T}use of tmpnam overrides temporary directory selection" >&6; } - fi -fi - - - - -for ac_func in opendir findfirst _findfirst -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - -for ac_func in strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -for ac_func in clock times -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - -for ac_func in remove -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_remove=yes -else - - { echo "$as_me:$LINENO: checking if remove is defined in unistd.h" >&5 -echo $ECHO_N "checking if remove is defined in unistd.h... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#ifdef remove - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - - -else - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define remove unlink -_ACEOF - - -fi -rm -f conftest* - -fi -done - - - -for ac_func in truncate -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_truncate=yes -fi -done - -# === Cannot nest AC_CHECK_FUNCS() calls -if test "$have_truncate" != yes ; then - -for ac_func in ftruncate -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_ftruncate=yes -fi -done - - if test "$have_ftruncate" != yes ; then - -for ac_func in chsize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - fi -fi - - -for ac_func in setenv -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_setenv=yes -fi -done - -# === Cannot nest AC_CHECK_FUNCS() calls -if test "$have_setenv" != yes ; then - -for ac_func in putenv -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - have_putenv=yes -fi -done - - if test "$have_putenv" = yes ; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "putenv" >/dev/null 2>&1; then - have_putenv_prototype=yes -fi -rm -f conftest* - - if test "$have_putenv_prototype" = yes ; then - { echo "$as_me:$LINENO: checking putenv prototype" >&5 -echo $ECHO_N "checking putenv prototype... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-zo-9_]putenv[ ]*\(.*const.*\)[ ]*;" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: correct" >&5 -echo "${ECHO_T}correct" >&6; } -else - - { echo "$as_me:$LINENO: result: no const" >&5 -echo "${ECHO_T}no const" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NON_CONST_PUTENV_PROTOTYPE 1 -_ACEOF - - -fi -rm -f conftest* - - fi - fi -fi - -# -# if test yes = "$CYGWIN"; then with_posix_regex=no; fi -if test no != "$with_posix_regex"; then - -for ac_func in regcomp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - { echo "$as_me:$LINENO: checking if regcomp works" >&5 -echo $ECHO_N "checking if regcomp works... $ECHO_C" >&6; } - if test "$cross_compiling" = yes; then - cat >>confdefs.h <<\_ACEOF -#define CHECK_REGCOMP 1 -_ACEOF - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include -main() { - regex_t patbuf; - exit (regcomp (&patbuf, "/hello/", 0) != 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - regcomp_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -regcomp_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - { echo "$as_me:$LINENO: result: $regcomp_works" >&5 -echo "${ECHO_T}$regcomp_works" >&6; } - if test yes != "$regcomp_works"; then - cat >>confdefs.h <<\_ACEOF -#define REGCOMP_BROKEN 1 -_ACEOF - - fi -fi - -# if test yes = "$with_perl_regex"; then -# AC_MSG_CHECKING(for Perl regex library) -# pcre_candidates="$with_perl_regex $HOME/local/lib* /usr*/local/lib* /usr/lib*" -# for lib in $pcre_candidates; do -# if test -f $lib/libpcreposix.so; then -# pcre_lib="-L$lib -lpcreposix" -# break -# elif test -f $lib/libpcreposix.a; then -# pcre_lib="$lib/libpcreposix.a" -# break -# fi -# done -# if test -z "$pcre_lib"; then -# AC_MSG_RESULT(not found) -# else -# AC_MSG_RESULT($lib) -# AC_DEFINE(HAVE_REGCOMP) -# LDFLAGS="$LDFLAGS $pcre_lib" -# have_regex=yes -# fi -# fi - - -# Checks for missing prototypes -# ----------------------------- -{ echo "$as_me:$LINENO: checking for new missing prototypes..." >&5 -echo "$as_me: checking for new missing prototypes..." >&6;} - - - -if test "$have_remove" = yes ; then - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]remove([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for remove" >&5 -echo "${ECHO_T}adding prototype for remove" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_REMOVE 1 -_ACEOF - - -fi -rm -f conftest* - -else - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]unlink([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for unlink" >&5 -echo "${ECHO_T}adding prototype for unlink" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_UNLINK 1 -_ACEOF - - -fi -rm -f conftest* - -fi - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]malloc([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for malloc" >&5 -echo "${ECHO_T}adding prototype for malloc" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_MALLOC 1 -_ACEOF - - -fi -rm -f conftest* - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]getenv([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for getenv" >&5 -echo "${ECHO_T}adding prototype for getenv" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_GETENV 1 -_ACEOF - - -fi -rm -f conftest* - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]stat([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for stat" >&5 -echo "${ECHO_T}adding prototype for stat" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_STAT 1 -_ACEOF - - -fi -rm -f conftest* - - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]lstat([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for lstat" >&5 -echo "${ECHO_T}adding prototype for lstat" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_LSTAT 1 -_ACEOF - - -fi -rm -f conftest* - -if test "$have_fgetpos" = yes ; then - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]fgetpos([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for fgetpos" >&5 -echo "${ECHO_T}adding prototype for fgetpos" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_FGETPOS 1 -_ACEOF - - -fi -rm -f conftest* - -fi -if test "$have_truncate" = yes ; then - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]truncate([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for truncate" >&5 -echo "${ECHO_T}adding prototype for truncate" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_TRUNCATE 1 -_ACEOF - - -fi -rm -f conftest* - -fi -if test "$have_ftruncate" = yes ; then - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "[^A-Za-z0-9_]ftruncate([ ]+[A-Za-z0-9_]*)?[ ]*\(" >/dev/null 2>&1; then - : -else - - { echo "$as_me:$LINENO: result: adding prototype for ftruncate" >&5 -echo "${ECHO_T}adding prototype for ftruncate" >&6; } - cat >>confdefs.h <<\_ACEOF -#define NEED_PROTO_FTRUNCATE 1 -_ACEOF - - -fi -rm -f conftest* - -fi - - -# Output files -# ------------ - - -rm -f Makefile -if test "$enable_maintainer_mode" = yes ; then - { echo "$as_me:$LINENO: result: creating maintainer Makefile" >&5 -echo "${ECHO_T}creating maintainer Makefile" >&6; } - ln -s maintainer.mak Makefile - makefile_out= -else - makefile_out=Makefile -fi -ac_config_files="$ac_config_files $makefile_out" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "$makefile_out") CONFIG_FILES="$CONFIG_FILES $makefile_out" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -install_targets!$install_targets$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -LN_S!$LN_S$ac_delim -STRIP!$STRIP$ac_delim -sort_found!$sort_found$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - -# vim:ts=4:sw=4: === modified file 'configure.ac' --- configure.ac 2009-07-14 15:05:23 +0000 +++ configure.ac 2011-03-11 21:16:06 +0000 @@ -248,6 +248,7 @@ AC_PROG_LN_S AC_CHECK_PROG(STRIP, strip, strip, :) +AC_SYS_LARGEFILE # Checks for operating environment === modified file 'ctags.1' --- ctags.1 2009-07-14 15:05:23 +0000 +++ ctags.1 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -.TH CTAGS 1 "Version 5.8" "Darren Hiebert" "Exuberant Ctags" +.TH CTAGS 1 "Version @VERSION@" "Darren Hiebert" "Exuberant Ctags" .SH "NAME" @@ -199,7 +199,7 @@ .RS 8 /* creates an RCS version string in module */ .br -MODULE_VERSION("$Revision: 690 $") +MODULE_VERSION("$Revision$") .RE .IP @@ -387,7 +387,7 @@ Specifies whether to include extra tag entries for certain kinds of information. The parameter \fIflags\fP is a set of one-letter flags, each representing one kind of extra tag entry to include in the tag file. If -\fIflags\fP is preceded by by either the '+' or '\-' character, the effect of +\fIflags\fP is preceded by either the '+' or '\-' character, the effect of each flag is added to, or removed from, those currently enabled; otherwise the flags replace any current settings. The meaning of each flag is as follows: @@ -494,7 +494,7 @@ file name parsed when the \fB\-\-filter\fP option is enabled. This may permit an application reading the output of ctags to determine when the output for each file is finished. Note that if the file name read is a directory and -\fB\-\-recurse\fP is enabled, this string will be printed only one once at the +\fB\-\-recurse\fP is enabled, this string will be printed only once at the end of all tags found for by descending the directory. This string will always be separated from the last tag line for the file by its terminating newline. This option is quite esoteric and is empty by default. This option must appear @@ -1006,7 +1006,7 @@ .SH "HOW TO USE WITH NEDIT" NEdit version 5.1 and later can handle the new extended tag file format (see \fB\-\-format\fP). To make NEdit use the tag file, select "File\->Load Tags -File". To jump to the definition for a tag, highlight the word, the press +File". To jump to the definition for a tag, highlight the word, then press Ctrl-D. NEdit 5.1 can can read multiple tag files from different directories. Setting the X resource nedit.tagFile to the name of a tag file instructs NEdit to automatically load that tag file at startup time. === modified file 'ctags.h' --- ctags.h 2009-07-14 15:05:23 +0000 +++ ctags.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: ctags.h 702 2009-03-14 03:52:21Z dhiebert $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * @@ -15,7 +15,7 @@ * MACROS */ #ifndef PROGRAM_VERSION -# define PROGRAM_VERSION "5.8" +# define PROGRAM_VERSION "Development" #endif #define PROGRAM_NAME "Exuberant Ctags" #define PROGRAM_URL "http://ctags.sourceforge.net" === removed file 'ctags.html' --- ctags.html 2009-07-14 15:05:23 +0000 +++ ctags.html 1970-01-01 00:00:00 +0000 @@ -1,2087 +0,0 @@ - - - - - - - - - -CTAGS - - - - -

CTAGS

- -NAME
-SYNOPSIS
-DESCRIPTION
-SOURCE FILES
-OPTIONS
-OPERATIONAL DETAILS
-TAG FILE FORMAT
-HOW TO USE WITH VI
-HOW TO USE WITH GNU EMACS
-HOW TO USE WITH NEDIT
-CAVEATS
-BUGS
-ENVIRONMENT VARIABLES
-FILES
-SEE ALSO
-AUTHOR
-MOTIVATION
-CREDITS
- -
- - - -

NAME

- - -

ctags − -Generate tag files for source code

- - -

SYNOPSIS

- - -

ctags -[options] [file(s)]
-etags
[options] [file(s)]

- - -

DESCRIPTION

- - -

The -ctags and etags programs (hereinafter -collectively referred to as ctags, except where -distinguished) generate an index (or "tag") file -for a variety of language objects found in file(s). -This tag file allows these items to be quickly and easily -located by a text editor or other utility. A "tag" -signifies a language object for which an index entry is -available (or, alternatively, the index entry created for -that object).

- -

Alternatively, -ctags can generate a cross reference file which -lists, in human readable form, information about the various -source objects found in a set of language files.

- -

Tag index files -are supported by numerous editors, which allow the user to -locate the object associated with a name appearing in a -source file and jump to the file and line which defines the -name. Those known about at the time of this release are:

- -

Vi(1) -and its derivatives (e.g. Elvis, Vim, Vile, Lemmy), -CRiSP, Emacs, FTE (Folding Text -Editor), JED, jEdit, Mined, -NEdit (Nirvana Edit), TSE (The SemWare -Editor), UltraEdit, WorkSpace, X2, -Zeus

- -

Ctags is -capable of generating different kinds of tags for each of -many different languages. For a complete list of supported -languages, the names by which they are recognized, and the -kinds of tags which are generated for each, see the -−−list−languages and -−−list−kinds options.

- - -

SOURCE FILES

- - -

Unless the -−−language−force option is -specified, the language of each source file is automatically -selected based upon a mapping of file names to languages. -The mappings in effect for each language may be display -using the −−list−maps option and -may be changed using the −−langmap -option. On platforms which support it, if the name of a file -is not mapped to a language and the file is executable, the -first line of the file is checked to see if the file is a -"#!" script for a recognized language.

- -

By default, all -other files names are ignored. This permits running -ctags on all files in either a single directory (e.g. -"ctags *"), or on all files in an entire source -directory tree (e.g. "ctags −R"), since only -those files whose names are mapped to languages will be -scanned.

- -

[The reason -that .h extensions are mapped to C++ files rather than C -files is because it is common to use .h extensions in C++, -and no harm results in treating them as C++ files.]

- - -

OPTIONS

- - -

Despite the -wealth of available options, defaults are set so that -ctags is most commonly executed without any options -(e.g. "ctags *", or "ctags −R"), -which will create a tag file in the current directory for -all recognized source files. The options described below are -provided merely to allow custom tailoring to meet special -needs.

- -

Note that -spaces separating the single-letter options from their -parameters are optional.

- -

Note also that -the boolean parameters to the long form options (those -beginning with "−−" and that take a -"[=yes|no]" parameter) may be -omitted, in which case "=yes" is -implied. (e.g. −−sort is equivalent to -−−sort=yes). Note further that -"=1" and "=on" are -considered synonyms for "=yes", and that -"=0" and "=off" are -considered synonyms for "=no".

- -

Some options -are either ignored or useful only when used while running in -etags mode (see −e option). Such options will -be noted.

- -

Most options -may appear anywhere on the command line, affecting only -those files which follow the option. A few options, however, -must appear before the first file name and will be noted as -such.

- -

Options taking -language names will accept those names in either upper or -lower case. See the -−−list−languages option for a -complete list of the built-in language names.

- - - - - - - - - - - - - - - - - -
- - - -

−a

- - -

Equivalent to -−−append.

- - -

−B

- - -

Use backward searching patterns (e.g. ?pattern?). -[Ignored in etags mode]

- - -

−e

- - -

Enable etags mode, which will create a tag file for use -with the Emacs editor. Alternatively, if ctags is -invoked by a name containing the string "etags" -(either by renaming, or creating a link to, the executable), -etags mode will be enabled. This option must appear before -the first file name.

- -

−f -tagfile

- -

Use the name specified by -tagfile for the tag file (default is -"tags", or "TAGS" when running in etags -mode). If tagfile is specified as -"−", then the tag file is written to -standard output instead. Ctags will stubbornly refuse -to take orders if tagfile exists and its first line -contains something other than a valid tags line. This will -save your neck if you mistakenly type "ctags −f -*.c", which would otherwise overwrite your first C file -with the tags generated by the rest! It will also refuse to -accept a multi-character file name which begins with a -’−’ (dash) character, since this most -likely means that you left out the tag file name and this -option tried to grab the next option as the file name. If -you really want to name your output tag file -"−ugly", specify it as -"./−ugly". This option must appear before -the first file name. If this option is specified more than -once, only the last will apply.

- - - - - - - -
- - - -

−F

- - -

Use forward -searching patterns (e.g. /pattern/) (default). [Ignored in -etags mode]

- -

−h list

- -

Specifies a list of file -extensions, separated by periods, which are to be -interpreted as include (or header) files. To indicate files -having no extension, use a period not followed by a -non-period character (e.g. ".", "..x", -".x."). This option only affects how the scoping -of a particular kinds of tags is interpreted (i.e. whether -or not they are considered as globally visible or visible -only within the file in which they are defined); it does not -map the extension to any particular language. Any tag which -is located in a non-include file and cannot be seen (e.g. -linked to) from another file is considered to have -file-limited (e.g. static) scope. No kind of tag appearing -in an include file will be considered to have file-limited -scope. If the first character in the list is a plus sign, -then the extensions in the list will be appended to the -current list; otherwise, the list will replace the current -list. See, also, the −−file−scope -option. The default list is -".h.H.hh.hpp.hxx.h++.inc.def". To restore the -default list, specify −h default. Note -that if an extension supplied to this option is not already -mapped to a particular language (see SOURCE FILES, -above), you will also need to use either the -−−langmap or -−−language−force option.

- -

−I -identifier−list

- -

Specifies a list of identifiers -which are to be specially handled while parsing C and C++ -source files. This option is specifically provided to handle -special cases arising through the use of preprocessor -macros. When the identifiers listed are simple identifiers, -these identifiers will be ignored during parsing of the -source files. If an identifier is suffixed with a -’+’ character, ctags will also ignore any -parenthesis-enclosed argument list which may immediately -follow the identifier in the source files. If two -identifiers are separated with the ’=’ -character, the first identifiers is replaced by the second -identifiers for parsing purposes. The list of identifiers -may be supplied directly on the command line or read in from -a separate file. If the first character of -identifier−list is ’@’, -’.’ or a pathname separator (’/’ or -’\’), or the first two characters specify a -drive letter (e.g. "C:"), the parameter -identifier−list will be interpreted as a -filename from which to read a list of identifiers, one per -input line. Otherwise, identifier−list is a -list of identifiers (or identifier pairs) to be specially -handled, each delimited by a either a comma or by white -space (in which case the list should be quoted to keep the -entire list as one command line argument). Multiple -−I options may be supplied. To clear the list -of ignore identifiers, supply a single dash -("−") for identifier−list.

- -

This feature is -useful when preprocessor macros are used in such a way that -they cause syntactic confusion due to their presence. -Indeed, this is the best way of working around a number of -problems caused by the presence of syntax-busting macros in -source files (see CAVEATS, below). Some examples will -illustrate this point.

- -

int foo -ARGDECL4(void *, ptr, long int, nbytes)

- -

In the above -example, the macro "ARGDECL4" would be mistakenly -interpreted to be the name of the function instead of the -correct name of "foo". Specifying −I -ARGDECL4 results in the correct behavior.

- -

/* creates an -RCS version string in module */
-MODULE_VERSION("$Revision: 690 $")

- -

In the above -example the macro invocation looks too much like a function -definition because it is not followed by a semicolon -(indeed, it could even be followed by a global variable -definition that would look much like a K&R style -function parameter declaration). In fact, this seeming -function definition could possibly even cause the rest of -the file to be skipped over while trying to complete the -definition. Specifying −I -MODULE_VERSION+ would avoid such a problem.

- -

CLASS Example { -
-// your content here
-};

- -

The example -above uses "CLASS" as a preprocessor macro which -expands to something different for each platform. For -instance CLASS may be defined as "class -__declspec(dllexport)" on Win32 platforms and simply -"class" on UNIX. Normally, the absence of the C++ -keyword "class" would cause the source file to be -incorrectly parsed. Correct behavior can be restored by -specifying −I CLASS=class.

- -

−L file

- -

Read from file a list of -file names for which tags should be generated. If -file is specified as "−", then file -names are read from standard input. File names read using -this option are processed following file names appearing on -the command line. Options are also accepted in this input. -If this option is specified more than once, only the last -will apply. Note: file is read in -line-oriented mode, where a new line is the only delimiter -and non-trailing white space is considered significant, in -order that file names containing spaces may be supplied -(however, trailing white space is stripped from lines); this -can affect how options are parsed if included in the -input.

- - - - - - - - - - - - - - -
- - - -

−n

- - -

Equivalent to -−−excmd=number.

-
- - -

−N

- - -

Equivalent to -−−excmd=pattern.

-
- -

−o -tagfile

- -

Equivalent to −f -tagfile.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -

−R

- - -

Equivalent to -−−recurse.

- - -

−u

- - -

Equivalent to −−sort=no (i.e. -"unsorted").

- - -

−V

- - -

Equivalent to −−verbose.

- - -

−w

- - -

This option is silently ignored for -backward-compatibility with the ctags of SVR4 Unix.

- - -

−x

- - -

Print a tabular, human-readable cross reference (xref) -file to standard output instead of generating a tag file. -The information contained in the output includes: the tag -name; the kind of tag; the line number, file name, and -source line (with extra white space condensed) of the file -which defines the tag. No tag file is written and all -options affecting tag file output will be ignored. Example -applications for this feature are generating a listing of -all functions located in a source file (e.g. ctags -−x −−c−kinds=f file), or -generating a list of all externally visible global variables -located in a source file (e.g. ctags −x -−−c−kinds=v -−−file−scope=no file). This -option must appear before the first file name.

- - -

−−append[=yes|no]

- -

Indicates whether tags -generated from the specified files should be appended to -those already present in the tag file or should replace -them. This option is off by default. This option must appear -before the first file name.

- - -

−−etags−include=file

- -

Include a reference to -file in the tag file. This option may be specified as -many times as desired. This supports Emacs’ capability -to use a tag file which "includes" other tag -files. [Available only in etags mode]

- - -

−−exclude=[pattern]

- -

Add pattern to a list of -excluded files and directories. This option may be specified -as many times as desired. For each file name considered by -ctags, each pattern specified using this -option will be compared against both the complete path (e.g. -some/path/base.ext) and the base name (e.g. base.ext) of the -file, thus allowing patterns which match a given file name -irrespective of its path, or match only a specific path. If -appropriate support is available from the runtime library of -your C compiler, then pattern may contain the usual -shell wildcards (not regular expressions) common on Unix (be -sure to quote the option parameter to protect the wildcards -from being expanded by the shell before being passed to -ctags; also be aware that wildcards can match the -slash character, ’/’). You can determine if -shell wildcards are available on your platform by examining -the output of the −−version option, which -will include "+wildcards" in the compiled feature -list; otherwise, pattern is matched against file -names using a simple textual comparison.

- -

If -pattern begins with the character ’@’, -then the rest of the string is interpreted as a file name -from which to read exclusion patterns, one per line. If -pattern is empty, the list of excluded patterns is -cleared. Note that at program startup, the default exclude -list contains "EIFGEN", "SCCS", -"RCS", and "CVS", which are names of -directories for which it is generally not desirable to -descend while processing the −−recurse -option.

- - -

−−excmd=type

- -

Determines the type of EX -command used to locate tags in the source file. [Ignored in -etags mode]

- -

The valid -values for type (either the entire word or the first -letter is accepted) are:

- - - - - - - -
- - -

number

- - -

Use only line -numbers in the tag file for locating tags. This has four -advantages:

- - - - - - - - - - - - - - - - - - - - - - -
- - -

1.

- - -

Significantly reduces the size of the -resulting tag file.

- - -

2.

- - -

Eliminates failures to find tags because -the line defining the tag has changed, causing the pattern -match to fail (note that some editors, such as vim, -are able to recover in many such instances).

- - -

3.

- - -

Eliminates finding identical matching, but -incorrect, source lines (see BUGS, below).

- - -

4.

- - -

Retains separate entries in the tag file -for lines which are identical in content. In pattern -mode, duplicate entries are dropped because the search -patterns they generate are identical, making the duplicate -entries useless.

- -

However, this -option has one significant drawback: changes to the source -files can cause the line numbers recorded in the tag file to -no longer correspond to the lines in the source file, -causing jumps to some tags to miss the target definition by -one or more lines. Basically, this option is best used when -the source code to which it is applied is not subject to -change. Selecting this option type causes the following -options to be ignored: −BF.

- - - - - - - - - - - - -
- - -

pattern

- - -

Use only search -patterns for all tags, rather than the line numbers usually -used for macro definitions. This has the advantage of not -referencing obsolete line numbers when lines have been added -or removed since the tag file was generated.

- - -

mixed

- - -

In this mode, patterns are generally used with a few -exceptions. For C, line numbers are used for macro -definition tags. This was the default format generated by -the original ctags and is, therefore, retained as the -default for this option. For Fortran, line numbers are used -for common blocks because their corresponding source lines -are generally identical, making pattern searches useless for -finding all matches.

- - -

−−extra=[+|−]flags

- -

Specifies whether to include -extra tag entries for certain kinds of information. The -parameter flags is a set of one-letter flags, each -representing one kind of extra tag entry to include in the -tag file. If flags is preceded by by either the -’+’ or ’−’ character, the -effect of each flag is added to, or removed from, those -currently enabled; otherwise the flags replace any current -settings. The meaning of each flag is as follows:

- - - - - - - - - - - - -
- - -

f

- - -

Include an entry -for the base file name of every source file (e.g. -"example.c"), which addresses the first line of -the file.

- - -

q

- - -

Include an extra -class-qualified tag entry for each tag which is a member of -a class (for languages for which this information is -extracted; currently C++, Eiffel, and Java). The actual form -of the qualified tag depends upon the language from which -the tag was derived (using a form that is most natural for -how qualified calls are specified in the language). For C++, -it is in the form "class::member"; for Eiffel and -Java, it is in the form "class.member". This may -allow easier location of a specific tags when multiple -occurrences of a tag name occur in the tag file. Note, -however, that this could potentially more than double the -size of the tag file.

- - -

−−fields=[+|−]flags

- -

Specifies the available -extension fields which are to be included in the entries of -the tag file (see TAG FILE FORMAT, below, for more -information). The parameter flags is a set of -one-letter flags, each representing one type of extension -field to include, with the following meanings (disabled by -default unless indicated):

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -

a

- - -

Access (or export) -of class members

- - -

f

- - -

File-restricted scoping [enabled]

- - -

i

- - -

Inheritance information

- - -

k

- - -

Kind of tag as a single letter -[enabled]

- - -

K

- - -

Kind of tag as full name

- - -

l

- - -

Language of source file containing tag

- - -

m

- - -

Implementation information

- - -

n

- - -

Line number of tag definition

- - -

s

- - -

Scope of tag definition [enabled]

- - -

S

- - -

Signature of routine (e.g. prototype or -parameter list)

- - -

z

- - -

Include the "kind:" key in kind -field

- - -

t

- - -

Type and name of a variable or typedef as -"typeref:" field [enabled]

- -

Each letter or -group of letters may be preceded by either ’+’ -to add it to the default set, or ’−’ to -exclude it. In the absence of any preceding ’+’ -or ’−’ sign, only those kinds explicitly -listed in flags will be included in the output (i.e. -overriding the default set). This option is ignored if the -option −−format=1 has been -specified. The default value of this option is -fkst.

- - -

−−file−scope[=yes|no]

- -

Indicates whether tags scoped -only for a single file (i.e. tags which cannot be seen -outside of the file in which they are defined, such as -"static" tags) should be included in the output. -See, also, the −h option. This option is -enabled by default.

- - -

−−filter[=yes|no]

- -

Causes ctags to behave -as a filter, reading source file names from standard input -and printing their tags to standard output on a file-by-file -basis. If −−sorted is enabled, tags are -sorted only within the source file in which they are -defined. File names are read from standard input in -line-oriented input mode (see note for −L -option) and only after file names listed on the command line -or from any file supplied using the −L option. -When this option is enabled, the options −f, -−o, and −−totals are -ignored. This option is quite esoteric and is disabled by -default. This option must appear before the first file -name.

- - -

−−filter−terminator=string

- -

Specifies a string to print to -standard output following the tags for each file name parsed -when the −−filter option is enabled. This -may permit an application reading the output of ctags to -determine when the output for each file is finished. Note -that if the file name read is a directory and -−−recurse is enabled, this string will be -printed only one once at the end of all tags found for by -descending the directory. This string will always be -separated from the last tag line for the file by its -terminating newline. This option is quite esoteric and is -empty by default. This option must appear before the first -file name.

- - -

−−format=level

- -

Change the format of the output -tag file. Currently the only valid values for level -are 1 or 2. Level 1 specifies the original tag -file format and level 2 specifies a new extended format -containing extension fields (but in a manner which retains -backward-compatibility with original vi(1) -implementations). The default level is 2. This option must -appear before the first file name. [Ignored in etags -mode]

- -

−−help

- -

Prints to standard output a -detailed usage description, and then exits.

- - -

−−if0[=yes|no]

- -

Indicates a preference as to -whether code within an "#if 0" branch of a -preprocessor conditional should be examined for non-macro -tags (macro tags are always included). Because the intent of -this construct is to disable code, the default value of this -option is no. Note that this indicates a preference -only and does not guarantee skipping code within an -"#if 0" branch, since the fall-back algorithm used -to generate tags when preprocessor conditionals are too -complex follows all branches of a conditional. This option -is disabled by default.

- - -

−−<LANG>−kinds=[+|−]kinds

- -

Specifies a list of -language-specific kinds of tags (or kinds) to include in the -output file for a particular language, where -<LANG> is case-insensitive and is one of the -built-in language names (see the -−−list−languages option for a -complete list). The parameter kinds is a group of -one-letter flags designating kinds of tags (particular to -the language) to either include or exclude from the output. -The specific sets of flags recognized for each language, -their meanings and defaults may be list using the -−−list−kinds option. Each letter or -group of letters may be preceded by either ’+’ -to add it to, or ’−’ to remove it from, -the default set. In the absence of any preceding -’+’ or ’−’ sign, only those -kinds explicitly listed in kinds will be included in -the output (i.e. overriding the default for the specified -language).

- -

As an example -for the C language, in order to add prototypes and external -variable declarations to the default set of tag kinds, but -exclude macros, use -−−c−kinds=+px−d; to -include only tags for functions, use -−−c−kinds=f.

- - -

−−langdef=name

- -

Defines a new user-defined -language, name, to be parsed with regular -expressions. Once defined, name may be used in other -options taking language names. The typical use of this -option is to first define the language, then map file names -to it using −−langmap, then specify -regular expressions using -−−regex−<LANG> to define how -its tags are found.

- - -

−−langmap=map[,map[...]]

- -

Controls how file names are -mapped to languages (see the -−−list−maps option). Each -comma-separated map consists of the language name -(either a built-in or user-defined language), a colon, and a -list of file extensions and/or file name patterns. A file -extension is specified by preceding the extension with a -period (e.g. ".c"). A file name pattern is -specified by enclosing the pattern in parentheses (e.g. -"([Mm]akefile)"). If appropriate support is -available from the runtime library of your C compiler, then -the file name pattern may contain the usual shell wildcards -common on Unix (be sure to quote the option parameter to -protect the wildcards from being expanded by the shell -before being passed to ctags). You can determine if -shell wildcards are available on your platform by examining -the output of the −−version option, which -will include "+wildcards" in the compiled feature -list; otherwise, the file name patterns are matched against -file names using a simple textual comparison. When mapping a -file extension, it will first be unmapped from any other -languages.

- -

If the first -character in a map is a plus sign, then the extensions and -file name patterns in that map will be appended to the -current map for that language; otherwise, the map will -replace the current map. For example, to specify that only -files with extensions of .c and .x are to be treated as C -language files, use -"−−langmap=c:.c.x"; to -also add files with extensions of .j as Java language files, -specify -"−−langmap=c:.c.x,java:+.j". -To map makefiles (e.g. files named either -"Makefile", "makefile", or having the -extension ".mak") to a language called -"make", specify -"−−langmap=make:([Mm]akefile).mak". -To map files having no extension, specify a period not -followed by a non-period character (e.g. ".", -"..x", ".x."). To clear the mapping for -a particular language (thus inhibiting automatic generation -of tags for that language), specify an empty extension list -(e.g. -"−−langmap=fortran:"). -To restore the default language mappings for all a -particular language, supply the keyword "default" -for the mapping. To specify restore the default language -mappings for all languages, specify -"−−langmap=default". -Note that file extensions are tested before file name -patterns when inferring the language of a file.

- - -

−−language−force=language

- -

By default, ctags -automatically selects the language of a source file, -ignoring those files whose language cannot be determined -(see SOURCE FILES, above). This option forces the -specified language (case-insensitive; either built-in -or user-defined) to be used for every supplied file instead -of automatically selecting the language based upon its -extension. In addition, the special value auto -indicates that the language should be automatically selected -(which effectively disables this option).

- - -

−−languages=[+|−]list

- -

Specifies the languages for -which tag generation is enabled, with list containing -a comma-separated list of language names (case-insensitive; -either built-in or user-defined). If the first language of -list is not preceded by either a ’+’ or -’−’, the current list will be cleared -before adding or removing the languages in list. -Until a ’−’ is encountered, each language -in the list will be added to the current list. As either the -’+’ or ’−’ is encountered in -the list, the languages following it are added or removed -from the current list, respectively. Thus, it becomes simple -to replace the current list with a new one, or to add or -remove languages from the current list. The actual list of -files for which tags will be generated depends upon the -language extension mapping in effect (see the -−−langmap option). Note that all -languages, including user-defined languages are enabled -unless explicitly disabled using this option. Language names -included in list may be any built-in language or one -previously defined with −−langdef. The -default is "all", which is also accepted as a -valid argument. See the -−−list−languages option for a -complete list of the built-in language names.

- - -

−−license

- -

Prints a summary of the -software license to standard output, and then exits.

- - -

−−line−directives[=yes|no]

- -

Specifies whether -"#line" directives should be recognized. These are -present in the output of preprocessors and contain the line -number, and possibly the file name, of the original source -file(s) from which the preprocessor output file was -generated. When enabled, this option will cause ctags -to generate tag entries marked with the file names and line -numbers of their locations original source file(s), instead -of their actual locations in the preprocessor output. The -actual file names placed into the tag file will have the -same leading path components as the preprocessor output -file, since it is assumed that the original source files are -located relative to the preprocessor output file (unless, of -course, the #line directive specifies an absolute path). -This option is off by default. Note: This option is -generally only useful when used together with the -−−excmd=number (−n) -option. Also, you may have to use either the -−−langmap or -−−language−force option if the -extension of the preprocessor output file is not known to -ctags.

- - -

−−links[=yes|no]

- -

Indicates whether symbolic -links (if supported) should be followed. When disabled, -symbolic links are ignored. This option is on by -default.

- - -

−−list−kinds[=language|all]

- -

Lists the tag kinds recognized -for either the specified language or all languages, and then -exits. Each kind of tag recorded in the tag file is -represented by a one-letter flag, which is also used to -filter the tags placed into the output through use of the -−−<LANG>−kinds option. Note -that some languages and/or tag kinds may be implemented -using regular expressions and may not be available if regex -support is not compiled into ctags (see the -−−regex−<LANG> option). Each -kind listed is enabled unless followed by -"[off]".

- - -

−−list−maps[=language|all]

- -

Lists the file extensions and -file name patterns which associate a file name with a -language for either the specified language or all languages, -and then exits. See the −−langmap option, -and SOURCE FILES, above.

- - -

−−list−languages

- -

Lists the names of the -languages understood by ctags, and then exits. These -language names are case insensitive and may be used in the -−−language−force, -−−languages, -−−<LANG>−kinds, and -−−regex−<LANG> options.

- - -

−−options=file

- -

Read additional options from -file. The file should contain one option per line. As -a special case, if −−options=NONE -is specified as the first option on the command line, it -will disable the automatic reading of any configuration -options from either a file or the environment (see -FILES).

- - -

−−recurse[=yes|no]

- -

Recurse into directories -encountered in the list of supplied files. If the list of -supplied files is empty and no file list is specified with -the −L option, then the current directory (i.e. -".") is assumed. Symbolic links are followed. If -you don’t like these behaviors, either explicitly -specify the files or pipe the output of find(1) into -ctags −L− instead. Note: This -option is not supported on all platforms at present. It is -available if the output of the −−help -option includes this option. See, also, the -−−exclude to limit recursion.

- - -

−−regex−<LANG>=/regexp/replacement/[kind−spec/][flags]

- -

The /regexp/replacement/ -pair define a regular expression replacement pattern, -similar in style to sed substitution commands, with -which to generate tags from source files mapped to the named -language, <LANG>, (case-insensitive; either a -built-in or user-defined language). The regular expression, -regexp, defines an extended regular expression -(roughly that used by egrep(1)), which is used to -locate a single source line containing a tag and may specify -tab characters using \t. When a matching line is found, a -tag will be generated for the name defined by -replacement, which generally will contain the special -back-references \1 through \9 to refer to matching -sub-expression groups within regexp. The -’/’ separator characters shown in the parameter -to the option can actually be replaced by any character. -Note that whichever separator character is used will have to -be escaped with a backslash (’\’) character -wherever it is used in the parameter as something other than -a separator. The regular expression defined by this option -is added to the current list of regular expressions for the -specified language unless the parameter is omitted, in which -case the current list is cleared.

- -

Unless modified -by flags, regexp is interpreted as a Posix -extended regular expression. The replacement should -expand for all matching lines to a non-empty string of -characters, or a warning message will be reported. An -optional kind specifier for tags matching regexp may -follow replacement, which will determine what kind of -tag is reported in the "kind" extension field (see -TAG FILE FORMAT, below). The full form of -kind−spec is in the form of a single letter, a -comma, a name (without spaces), a comma, a description, -followed by a separator, which specify the short and long -forms of the kind value and its textual description -(displayed using −−list−kinds). -Either the kind name and/or the description may be omitted. -If kind−spec is omitted, it defaults to -"r,regex". Finally, flags are one or -more single-letter characters having the following effect -upon the interpretation of regexp:

- - - - - - - - - - - - - - - - - -
- - -

b

- - -

The pattern is -interpreted as a Posix basic regular expression.

- - -

e

- - -

The pattern is -interpreted as a Posix extended regular expression -(default).

- - -

i

- - -

The regular -expression is to be applied in a case-insensitive -manner.

- -

Note that this -option is available only if ctags was compiled with -support for regular expressions, which depends upon your -platform. You can determine if support for regular -expressions is compiled in by examining the output of the -−−version option, which will include -"+regex" in the compiled feature list.

- -

For more -information on the regular expressions used by ctags, -see either the regex(5,7) man page, or the GNU info -documentation for regex (e.g. "info regex").

- - -

−−sort[=yes|no|foldcase]

- -

Indicates whether the tag file -should be sorted on the tag name (default is yes). -Note that the original vi(1) required sorted tags. -The foldcase value specifies case insensitive (or -case-folded) sorting. Fast binary searches of tag files -sorted with case-folding will require special support from -tools using tag files, such as that found in the ctags -readtags library, or Vim version 6.2 or higher (using -"set ignorecase"). This option must appear before -the first file name. [Ignored in etags mode]

- - -

−−tag−relative[=yes|no]

- -

Indicates that the file paths -recorded in the tag file should be relative to the directory -containing the tag file, rather than relative to the current -directory, unless the files supplied on the command line are -specified with absolute paths. This option must appear -before the first file name. The default is yes when -running in etags mode (see the −e option), -no otherwise.

- - -

−−totals[=yes|no]

- -

Prints statistics about the -source files read and the tag file written during the -current invocation of ctags. This option is off by -default. This option must appear before the first file -name.

- - -

−−verbose[=yes|no]

- -

Enable verbose mode. This -prints out information on option processing and a brief -message describing what action is being taken for each file -considered by ctags. Normally, ctags does not -read command line arguments until after options are read -from the configuration files (see FILES, below) and -the CTAGS environment variable. However, if this -option is the first argument on the command line, it will -take effect before any options are read from these sources. -The default is no.

- - -

−−version

- -

Prints a version identifier for -ctags to standard output, and then exits. This is -guaranteed to always contain the string "Exuberant -Ctags".

- - -

OPERATIONAL DETAILS

- - -

As ctags -considers each file name in turn, it tries to determine the -language of the file by applying the following three tests -in order: if the file extension has been mapped to a -language, if the file name matches a shell pattern mapped to -a language, and finally if the file is executable and its -first line specifies an interpreter using the Unix-style -"#!" specification (if supported on the platform). -If a language was identified, the file is opened and then -the appropriate language parser is called to operate on the -currently open file. The parser parses through the file and -adds an entry to the tag file for each language object it is -written to handle. See TAG FILE FORMAT, below, for -details on these entries.

- -

This -implementation of ctags imposes no formatting -requirements on C code as do legacy implementations. Older -implementations of ctags tended to rely upon certain -formatting assumptions in order to help it resolve coding -dilemmas caused by preprocessor conditionals.

- -

In general, -ctags tries to be smart about conditional -preprocessor directives. If a preprocessor conditional is -encountered within a statement which defines a tag, -ctags follows only the first branch of that -conditional (except in the special case of "#if -0", in which case it follows only the last branch). The -reason for this is that failing to pursue only one branch -can result in ambiguous syntax, as in the following -example:

- -

#ifdef -TWO_ALTERNATIVES
-struct {
-#else
-union {
-#endif

- -

short a;
-long b;

- -

}

- -

Both branches -cannot be followed, or braces become unbalanced and -ctags would be unable to make sense of the -syntax.

- -

If the -application of this heuristic fails to properly parse a -file, generally due to complicated and inconsistent pairing -within the conditionals, ctags will retry the file -using a different heuristic which does not selectively -follow conditional preprocessor branches, but instead falls -back to relying upon a closing brace ("}") in -column 1 as indicating the end of a block once any brace -imbalance results from following a #if conditional -branch.

- -

Ctags -will also try to specially handle arguments lists enclosed -in double sets of parentheses in order to accept the -following conditional construct:

- -

extern void foo -__ARGS((int one, char two));

- -

Any name -immediately preceding the "((" will be -automatically ignored and the previous name will be -used.

- -

C++ operator -definitions are specially handled. In order for consistency -with all types of operators (overloaded and conversion), the -operator name in the tag file will always be preceded by the -string "operator " (i.e. even if the actual -operator definition was written as -"operator<<").

- -

After creating -or appending to the tag file, it is sorted by the tag name, -removing identical tag lines.

- - -

TAG FILE FORMAT

- - -

When not -running in etags mode, each entry in the tag file consists -of a separate line, each looking like this in the most -general case:

- - -

tag_name<TAB>file_name<TAB>ex_cmd;"<TAB>extension_fields

- -

The fields and -separators of these lines are specified as follows:

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -

1.

- - -

tag name

- - -

2.

- - -

single tab character

- - -

3.

- - -

name of the file in which the object -associated with the tag is located

- - -

4.

- - -

single tab character

- - -

5.

- - -

EX command used to locate the tag within -the file; generally a search pattern (either /pattern/ or -?pattern?) or line number (see −−excmd). -Tag file format 2 (see −−format) extends -this EX command under certain circumstances to include a set -of extension fields (described below) embedded in an EX -comment immediately appended to the EX command, which leaves -it backward-compatible with original vi(1) -implementations.

- -

A few special -tags are written into the tag file for internal purposes. -These tags are composed in such a way that they always sort -to the top of the file. Therefore, the first two characters -of these tags are used a magic number to detect a tag file -for purposes of determining whether a valid tag file is -being overwritten rather than a source file.

- -

Note that the -name of each source file will be recorded in the tag file -exactly as it appears on the command line. Therefore, if the -path you specified on the command line was relative to the -current directory, then it will be recorded in that same -manner in the tag file. See, however, the -−−tag−relative option for how this -behavior can be modified.

- -

Extension -fields are tab-separated key-value pairs appended to the end -of the EX command as a comment, as described above. These -key value pairs appear in the general form -"key:value". Their presence in the -lines of the tag file are controlled by the -−−fields option. The possible keys and -the meaning of their values are as follows:

- - - - - - - - - - - - - - - - - -
- - -

access

- - -

Indicates the -visibility of this class member, where value is -specific to the language.

- - -

file

- - -

Indicates that the tag has file-limited visibility. This -key has no corresponding value.

- - -

kind

- - -

Indicates the type, or kind, of tag. Its value is either -one of the corresponding one-letter flags described under -the various −−<LANG>−kinds -options above, or a full name. It is permitted (and is, in -fact, the default) for the key portion of this field to be -omitted. The optional behaviors are controlled with the -−−fields option.

- -

implementation

- -

When present, this indicates a -limited implementation (abstract vs. concrete) of a routine -or class, where value is specific to the language -("virtual" or "pure virtual" for C++; -"abstract" for Java).

- - - - - - - - - - - - -
- - - -

inherits

- - -

When present, -value. is a comma-separated list of classes from -which this class is derived (i.e. inherits from).

- - -

signature

- - -

When present, value is a language-dependent -representation of the signature of a routine. A routine -signature in its complete form specifies the return type of -a routine and its formal argument list. This extension field -is presently supported only for C-based languages and does -not include the return type.

- -

In addition, -information on the scope of the tag definition may be -available, with the key portion equal to some -language-dependent construct name and its value the name -declared for that construct in the program. This scope entry -indicates the scope in which the tag was found. For example, -a tag generated for a C structure member would have a scope -looking like "struct:myStruct".

- - -

HOW TO USE WITH VI

- - -

Vi will, by -default, expect a tag file by the name "tags" in -the current directory. Once the tag file is built, the -following commands exercise the tag indexing feature:

- - - - - - - - - - - - - - - - - - - - - - -
- - -

vi −t -tag

- - -

Start vi and -position the cursor at the file and line where -"tag" is defined.

- - -

:ta tag

- - -

Find a tag.

- - -

Ctrl-]

- - -

Find the tag under -the cursor.

- - -

Ctrl-T

- - -

Return to previous -location before jump to tag (not widely implemented).

- - -

HOW TO USE WITH GNU EMACS

- - -

Emacs will, by -default, expect a tag file by the name "TAGS" in -the current directory. Once the tag file is built, the -following commands exercise the tag indexing feature: -
-M-x visit−tags−table <RET> FILE -<RET>

- -

Select the tag file, -"FILE", to use.

- -

M-. [TAG] -<RET>

- -

Find the first definition of -TAG. The default tag is the identifier under the cursor.

- - - - - - - - - - - - - - -
- - -

M-*

- - -

Pop back to where -you previously invoked "M-.".

-
- - -

C-u M-.

- - -

Find the next -definition for the last tag.

-
- -

For more -commands, see the Tags topic in the Emacs info -document.

- - -

HOW TO USE WITH NEDIT

- - -

NEdit version -5.1 and later can handle the new extended tag file format -(see −−format). To make NEdit use the tag -file, select "File−>Load Tags File". To -jump to the definition for a tag, highlight the word, the -press Ctrl-D. NEdit 5.1 can can read multiple tag files from -different directories. Setting the X resource nedit.tagFile -to the name of a tag file instructs NEdit to automatically -load that tag file at startup time.

- - -

CAVEATS

- - -

Because -ctags is neither a preprocessor nor a compiler, use -of preprocessor macros can fool ctags into either -missing tags or improperly generating inappropriate tags. -Although ctags has been designed to handle certain -common cases, this is the single biggest cause of reported -problems. In particular, the use of preprocessor constructs -which alter the textual syntax of C can fool ctags. -You can work around many such problems by using the -−I option.

- -

Note that since -ctags generates patterns for locating tags (see the -−−excmd option), it is entirely possible -that the wrong line may be found by your editor if there -exists another source line which is identical to the line -containing the tag. The following example demonstrates this -condition:

- -

int -variable;

- -

/* ... */
-void foo(variable)
-int variable;
-{

- -

/* ... */

- -

}

- -

Depending upon -which editor you use and where in the code you happen to be, -it is possible that the search pattern may locate the local -parameter declaration in foo() before it finds the actual -global variable definition, since the lines (and therefore -their search patterns are identical). This can be avoided by -use of the −−excmd=n option.

- - -

BUGS

- - -

Ctags -has more options than ls(1).

- -

When parsing a -C++ member function definition (e.g. -"className::function"), ctags cannot -determine whether the scope specifier is a class name or a -namespace specifier and always lists it as a class name in -the scope portion of the extension fields. Also, if a C++ -function is defined outside of the class declaration (the -usual case), the access specification (i.e. public, -protected, or private) and implementation information (e.g. -virtual, pure virtual) contained in the function declaration -are not known when the tag is generated for the function -definition. It will, however be available for prototypes -(e.g −−c++−kinds=+p).

- -

No qualified -tags are generated for language objects inherited into a -class.

- - -

ENVIRONMENT VARIABLES

- - - - - - - - - - - - - - - - - - -
- - -

CTAGS

- - -

If this environment -variable exists, it will be expected to contain a set of -default options which are read when ctags starts, -after the configuration files listed in FILES, below, -are read, but before any command line options are read. -Options appearing on the command line will override options -specified in this variable. Only options will be read from -this variable. Note that all white space in this variable is -considered a separator, making it impossible to pass an -option parameter containing an embedded space. If this is a -problem, use a configuration file instead.

- - -

ETAGS

- - -

Similar to the CTAGS variable above, this -variable, if found, will be read when etags starts. -If this variable is not found, etags will try to use -CTAGS instead.

- - -

TMPDIR

- - -

On Unix-like hosts where mkstemp() is available, the -value of this variable specifies the directory in which to -place temporary files. This can be useful if the size of a -temporary file becomes too large to fit on the partition -holding the default temporary directory defined at -compilation time. ctags creates temporary files only -if either (1) an emacs-style tag file is being generated, -(2) the tag file is being sent to standard output, or (3) -the program was compiled to use an internal sort algorithm -to sort the tag files instead of the the sort utility of the -operating system. If the sort utility of the operating -system is being used, it will generally observe this -variable also. Note that if ctags is setuid, the -value of TMPDIR will be ignored.

- - -

FILES

- - -

/ctags.cnf -(on MSDOS, MSWindows only)
-/etc/ctags.conf
-/usr/local/etc/ctags.conf
-$HOME/.ctags
-$HOME/ctags.cnf (on MSDOS, MSWindows only)
-.ctags
-ctags.cnf (on MSDOS, MSWindows only)

- -

If any of these configuration -files exist, each will be expected to contain a set of -default options which are read in the order listed when -ctags starts, but before the CTAGS environment -variable is read or any command line options are read. This -makes it possible to set up site-wide, personal or -project-level defaults. It is possible to compile -ctags to read an additional configuration file before -any of those shown above, which will be indicated if the -output produced by the −−version option -lists the "custom-conf" feature. Options appearing -in the CTAGS environment variable or on the command -line will override options specified in these files. Only -options will be read from these files. Note that the option -files are read in line-oriented mode in which spaces are -significant (since shell quoting is not possible). Each line -of the file is read as one command line parameter (as if it -were quoted with single quotes). Therefore, use new lines to -indicate separate command-line arguments.

- - - - - - - - - - - - - - -
- - -

tags

- - -

The default tag -file created by ctags.

-
- - -

TAGS

- - -

The default tag -file created by etags.

-
- - -

SEE ALSO

- - -

The official -Exuberant Ctags web site at:

- - -

http://ctags.sourceforge.net

- -

Also -ex(1), vi(1), elvis, or, better yet, -vim, the official editor of ctags. For more -information on vim, see the VIM Pages web site -at:

- - -

http://www.vim.org/

- - -

AUTHOR

- - -

Darren Hiebert -<dhiebert at users.sourceforge.net>
-http://DarrenHiebert.com/

- - -

MOTIVATION

- - -

"Think ye -at all times of rendering some service to every member of -the human race."

- -

"All -effort and exertion put forth by man from the fullness of -his heart is worship, if it is prompted by the highest -motives and the will to do service to humanity."

- -

−− -From the Baha’i Writings

- - -

CREDITS

- - -

This version of -ctags was originally derived from and inspired by the -ctags program by Steve Kirkendall -<kirkenda@cs.pdx.edu> that comes with the Elvis vi -clone (though virtually none of the original code -remains).

- -

Credit is also -due Bram Moolenaar <Bram@vim.org>, the author of -vim, who has devoted so much of his time and energy -both to developing the editor as a service to others, and to -helping the orphans of Uganda.

- -

The section -entitled "HOW TO USE WITH GNU EMACS" was -shamelessly stolen from the info page for GNU -etags.

-
- - === modified file 'debian/changelog' --- debian/changelog 2010-08-17 18:31:40 +0000 +++ debian/changelog 2011-03-11 21:16:06 +0000 @@ -1,3 +1,31 @@ +exuberant-ctags (1:5.9~svn20110310-0ubuntu1) natty; urgency=low + + * New upstream release snapshot. + This includes a lot of fixes since the last release. + - Fixes LP: #554898, #582347 + * Add dh_autoreconf for svn snapshot build + - debian/rules, debian/control + * Drop accepted patches: + - debian/patches/make-match-loop.patch + - debian/patches/php-ignore-keywords-in-comments.patch + * Patches in Ubuntu: + - For Python, disable -i so imports are not tagged by default. + - LP: #618979 + - debian/patches/python-disable-imports.patch + * Set version to "5.9~svn20110310" instead of "Development". + This is required for tools that check for ctag's version (e.g. the + vim-easytags plugin). + - debian/patches/version.patch + + -- Daniel Hahler Fri, 11 Mar 2011 21:19:51 +0100 + +exuberant-ctags (1:5.8-4) unstable; urgency=low + + * Apply patch from Ben Spencer to use memmove rather than strcpy on + overlapping strings (closes: #594185). + + -- Colin Watson Thu, 17 Feb 2011 13:47:11 +0000 + exuberant-ctags (1:5.8-3ubuntu1) maverick; urgency=low * For Python, disable -i so imports are not tagged by default. @@ -296,18 +324,18 @@ -- Heiko Schlittermann Sun, 1 Jun 1997 10:44:43 +0200 +exuberant-ctags (1.6b2-1) unstable; urgency=high + + * new upstream release + + -- Heiko schlittermann Wed, 23 Apr 1997 11:07:09 +0200 + exuberant-ctags (1.6-1) unstable; urgency=high * new upstream release -- Heiko Schlittermann Sat, 17 May 1997 20:25:08 +0200 -exuberant-ctags (1.6b2-1) unstable; urgency=high - - * new upstream release - - -- Heiko schlittermann Wed, 23 Apr 1997 11:07:09 +0200 - vimctags (1.5-1) unstable; urgency=low * new upstream release === modified file 'debian/control' --- debian/control 2010-08-17 16:55:42 +0000 +++ debian/control 2011-03-11 21:16:06 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Colin Watson -Build-Depends: debhelper (>= 7.0.50) +Build-Depends: debhelper (>= 7.0.50), dh-autoreconf Standards-Version: 3.8.4 Package: exuberant-ctags === added file 'debian/patches/memmove.patch' --- debian/patches/memmove.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/memmove.patch 2011-03-11 21:16:06 +0000 @@ -0,0 +1,28 @@ +Description: Use memmove on overlapping strings + strcpy is not guaranteed to work on overlapping strings, and this can lead + to broken paths appearing in tag files. Use memmove instead. +Author: Ben Spencer +Origin: other, http://sourceforge.net/tracker/?func=detail&aid=3034816&group_id=6556&atid=306556 +Forwarded: yes +Last-Update: 2011-02-17 + +Index: b/routines.c +=================================================================== +--- a/routines.c ++++ b/routines.c +@@ -757,13 +757,13 @@ + else if (cp [0] != PATH_SEPARATOR) + cp = slashp; + #endif +- strcpy (cp, slashp + 3); ++ memmove (cp, slashp + 3, strlen(slashp + 3) + 1); + slashp = cp; + continue; + } + else if (slashp [2] == PATH_SEPARATOR || slashp [2] == '\0') + { +- strcpy (slashp, slashp + 2); ++ memmove (slashp, slashp + 2, strlen(slashp + 2) + 1); + continue; + } + } === modified file 'debian/patches/series' --- debian/patches/series 2010-08-17 17:10:05 +0000 +++ debian/patches/series 2011-03-11 21:16:06 +0000 @@ -1,3 +1,3 @@ -make-match-loop.patch -php-ignore-keywords-in-comments.patch +memmove.patch python-disable-imports.patch +version.patch === added file 'debian/patches/version.patch' --- debian/patches/version.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/version.patch 2011-03-11 21:16:06 +0000 @@ -0,0 +1,13 @@ +Index: upstream-snapshot/ctags.h +=================================================================== +--- upstream-snapshot.orig/ctags.h 2011-03-11 21:18:41.000000000 +0100 ++++ upstream-snapshot/ctags.h 2011-03-11 21:19:20.000000000 +0100 +@@ -15,7 +15,7 @@ + * MACROS + */ + #ifndef PROGRAM_VERSION +-# define PROGRAM_VERSION "Development" ++# define PROGRAM_VERSION "5.9~svn20110310" + #endif + #define PROGRAM_NAME "Exuberant Ctags" + #define PROGRAM_URL "http://ctags.sourceforge.net" === modified file 'debian/rules' --- debian/rules 2010-07-12 10:12:13 +0000 +++ debian/rules 2011-03-11 21:16:06 +0000 @@ -1,6 +1,6 @@ #! /usr/bin/make -f %: - dh $@ + dh --with autoreconf $@ dtmp = debian/exuberant-ctags === modified file 'debug.c' --- debug.c 2007-09-08 09:16:38 +0000 +++ debug.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: debug.c 558 2007-06-15 19:17:02Z elliotth $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * === modified file 'debug.h' --- debug.h 2007-09-08 09:16:38 +0000 +++ debug.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: debug.h 558 2007-06-15 19:17:02Z elliotth $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'descrip.mms' --- descrip.mms 2007-09-08 09:16:38 +0000 +++ descrip.mms 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: descrip.mms 2 2001-11-02 04:53:43Z darren $ +# $Id$ # # Makefile for building CTAGS under OpenVMS # === modified file 'e_amiga.h' --- e_amiga.h 2007-09-08 09:16:38 +0000 +++ e_amiga.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_amiga.h 136 2002-03-08 22:35:19Z darren $ +* $Id$ * * Copyright (c) 2002, Darren Hiebert * === modified file 'e_djgpp.h' --- e_djgpp.h 2007-09-08 09:16:38 +0000 +++ e_djgpp.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_djgpp.h 375 2003-10-31 04:15:35Z darren $ +* $Id$ * * Copyright (c) 2002-2003, Darren Hiebert * === modified file 'e_mac.h' --- e_mac.h 2007-09-08 09:16:38 +0000 +++ e_mac.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_mac.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2001, Maarten L. Hekkelman * === modified file 'e_msoft.h' --- e_msoft.h 2007-09-08 09:16:38 +0000 +++ e_msoft.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_msoft.h 577 2007-06-30 15:30:16Z dhiebert $ +* $Id$ * * Copyright (c) 2002-2003, Darren Hiebert * === modified file 'e_os2.h' --- e_os2.h 2007-09-08 09:16:38 +0000 +++ e_os2.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_os2.h 136 2002-03-08 22:35:19Z darren $ +* $Id$ * * Copyright (c) 2002, Darren Hiebert * === modified file 'e_qdos.h' --- e_qdos.h 2007-09-08 09:16:38 +0000 +++ e_qdos.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_qdos.h 136 2002-03-08 22:35:19Z darren $ +* $Id$ * * Copyright (c) 2002, Darren Hiebert * === modified file 'e_riscos.h' --- e_riscos.h 2007-09-08 09:16:38 +0000 +++ e_riscos.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_riscos.h 136 2002-03-08 22:35:19Z darren $ +* $Id$ * * Copyright (c) 2002, Andrew Wingate * === modified file 'e_vms.h' --- e_vms.h 2007-09-08 09:16:38 +0000 +++ e_vms.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: e_vms.h 136 2002-03-08 22:35:19Z darren $ +* $Id$ * * Copyright (c) 2002, Darren Hiebert * === modified file 'eiffel.c' --- eiffel.c 2009-07-14 15:05:23 +0000 +++ eiffel.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: eiffel.c 706 2009-06-28 23:09:30Z dhiebert $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * @@ -53,13 +53,15 @@ */ typedef enum eKeywordId { KEYWORD_NONE = -1, - KEYWORD_alias, KEYWORD_all, KEYWORD_and, KEYWORD_as, KEYWORD_assign, + KEYWORD_alias, KEYWORD_all, KEYWORD_and, + KEYWORD_as, KEYWORD_assign, KEYWORD_attached, KEYWORD_check, KEYWORD_class, KEYWORD_convert, KEYWORD_create, KEYWORD_creation, KEYWORD_Current, - KEYWORD_debug, KEYWORD_deferred, KEYWORD_do, KEYWORD_else, - KEYWORD_elseif, KEYWORD_end, KEYWORD_ensure, KEYWORD_expanded, - KEYWORD_export, KEYWORD_external, KEYWORD_false, KEYWORD_feature, - KEYWORD_from, KEYWORD_frozen, KEYWORD_if, KEYWORD_implies, + KEYWORD_debug, KEYWORD_deferred, KEYWORD_detachable, KEYWORD_do, + KEYWORD_else, KEYWORD_elseif, KEYWORD_end, KEYWORD_ensure, + KEYWORD_expanded, KEYWORD_export, KEYWORD_external, + KEYWORD_false, KEYWORD_feature, KEYWORD_from, KEYWORD_frozen, + KEYWORD_if, KEYWORD_implies, KEYWORD_indexing, KEYWORD_infix, KEYWORD_inherit, KEYWORD_inspect, KEYWORD_invariant, KEYWORD_is, KEYWORD_like, KEYWORD_local, KEYWORD_loop, KEYWORD_not, KEYWORD_obsolete, KEYWORD_old, KEYWORD_once, @@ -154,6 +156,7 @@ { "and", KEYWORD_and }, { "as", KEYWORD_as }, { "assign", KEYWORD_assign }, + { "attached", KEYWORD_attached }, { "check", KEYWORD_check }, { "class", KEYWORD_class }, { "convert", KEYWORD_convert }, @@ -162,6 +165,7 @@ { "current", KEYWORD_Current }, { "debug", KEYWORD_debug }, { "deferred", KEYWORD_deferred }, + { "detachable", KEYWORD_detachable }, { "do", KEYWORD_do }, { "else", KEYWORD_else }, { "elseif", KEYWORD_elseif }, @@ -870,7 +874,9 @@ } else { - if (isKeyword (id, KEYWORD_expanded)) + if (isKeyword (id, KEYWORD_attached) || + isKeyword (id, KEYWORD_detachable) || + isKeyword (id, KEYWORD_expanded)) { copyToken (id, token); readToken (token); === modified file 'entry.c' --- entry.c 2007-09-08 09:16:38 +0000 +++ entry.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: entry.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * @@ -772,6 +772,8 @@ boolean newlineTerminated; int length = 0; + if (line == NULL) + error (FATAL, "bad tag in %s", vStringValue (File.name)); if (tag->truncateLine) truncateTagLine (line, tag->name, FALSE); newlineTerminated = (boolean) (line [strlen (line) - 1] == '\n'); === modified file 'entry.h' --- entry.h 2007-09-08 09:16:38 +0000 +++ entry.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: entry.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'erlang.c' --- erlang.c 2007-09-08 09:16:38 +0000 +++ erlang.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: erlang.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2003, Brent Fulgham * === modified file 'flex.c' --- flex.c 2009-07-14 15:05:23 +0000 +++ flex.c 2011-03-11 21:16:06 +0000 @@ -78,9 +78,12 @@ KEYWORD_static, KEYWORD_class, KEYWORD_id, + KEYWORD_name, KEYWORD_script, KEYWORD_cdata, - KEYWORD_mx + KEYWORD_mx, + KEYWORD_fx, + KEYWORD_override } keywordId; /* Used to determine whether keyword is valid for the token language and @@ -116,7 +119,8 @@ TOKEN_CLOSE_SGML, TOKEN_LESS_THAN, TOKEN_GREATER_THAN, - TOKEN_QUESTION_MARK + TOKEN_QUESTION_MARK, + TOKEN_OPEN_NAMESPACE } tokenType; typedef struct sTokenInfo { @@ -182,9 +186,12 @@ { "static", KEYWORD_static }, { "class", KEYWORD_class }, { "id", KEYWORD_id }, + { "name", KEYWORD_name }, { "script", KEYWORD_script }, { "cdata", KEYWORD_cdata }, - { "mx", KEYWORD_mx } + { "mx", KEYWORD_mx }, + { "fx", KEYWORD_fx }, + { "override", KEYWORD_override } }; /* @@ -196,6 +203,7 @@ static boolean parseBlock (tokenInfo *const token, tokenInfo *const parent); static boolean parseLine (tokenInfo *const token); static boolean parseActionScript (tokenInfo *const token); +static boolean parseMXML (tokenInfo *const token); static boolean isIdentChar (const int c) { @@ -518,13 +526,15 @@ if ( (d != '!' ) && /* is this the start of a comment? */ (d != '/' ) && /* is this the start of a closing mx tag */ - (d != 'm' ) ) /* is this the start of a mx tag */ + (d != 'm' ) && /* is this the start of a mx tag */ + (d != 'f' ) && /* is this the start of a fx tag */ + (d != 's' ) ) /* is this the start of a spark tag */ { fileUngetc (d); token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); - + break; } else { @@ -582,23 +592,24 @@ } } } - else if (d == 'm') + else if (d == 'm' || d == 'f' || d == 's' ) { int e = fileGetc (); - if ( e != 'x' ) /* continuing an mx tag */ + if ( (d == 'm' || d == 'f') && e != 'x' ) /* continuing an mx or fx tag */ { fileUngetc (e); fileUngetc (d); token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); + break; } else { - if (e == 'x') + if ( (d == 'm' || d == 'f') && e == 'x' ) { int f = fileGetc (); - if ( f != ':' ) /* is this the start of a comment? */ + if ( f != ':' ) /* start of the tag */ { fileUngetc (f); fileUngetc (e); @@ -606,40 +617,57 @@ token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); + break; } else { - if (f == ':') - { - token->type = TOKEN_OPEN_MXML; - token->lineNumber = getSourceLineNumber (); - token->filePosition = getInputFilePosition (); - } + token->type = TOKEN_OPEN_MXML; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; } } + if ( d == 's' && e == ':') /* continuing a spark tag */ + { + token->type = TOKEN_OPEN_MXML; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; + } + else + { + fileUngetc (e); + fileUngetc (d); + token->type = TOKEN_LESS_THAN; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; + } } } else if (d == '/') { int e = fileGetc (); - if ( e != 'm' ) /* continuing an mx tag */ + if ( !(e == 'm' || e == 'f' || e == 's' )) { fileUngetc (e); fileUngetc (d); token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); + break; } else { int f = fileGetc (); - if ( f != 'x' ) /* continuing an mx tag */ + if ( (e == 'm' || e == 'f') && f != 'x' ) /* continuing an mx or fx tag */ { fileUngetc (f); fileUngetc (e); token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); + break; } else { @@ -654,17 +682,32 @@ token->type = TOKEN_LESS_THAN; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); + break; } else { - if (g == ':') - { - token->type = TOKEN_CLOSE_MXML; - token->lineNumber = getSourceLineNumber (); - token->filePosition = getInputFilePosition (); - } + token->type = TOKEN_CLOSE_MXML; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; } } + if ( e == 's' && f == ':') /* continuing a spark tag */ + { + token->type = TOKEN_CLOSE_MXML; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; + } + else + { + fileUngetc (f); + fileUngetc (e); + token->type = TOKEN_LESS_THAN; + token->lineNumber = getSourceLineNumber (); + token->filePosition = getInputFilePosition (); + break; + } } } } @@ -1982,10 +2025,81 @@ return TRUE; } +static boolean parseNamespace (tokenInfo *const token) +{ + /* + * If we have found a <, we know it is not a TOKEN_OPEN_MXML + * but it could potentially be a different namespace. + * This means it will also have a closing tag, which will + * mess up the parser if we do not properly recurse + * through these tags. + */ + + if (isType (token, TOKEN_LESS_THAN)) + { + readToken (token); + } + + /* + * Check if we have reached a other namespace tag + * + * or + * + * + */ + if (isType (token, TOKEN_IDENTIFIER)) + { + readToken (token); + if (isType (token, TOKEN_COLON)) + { + readToken (token); + if ( ! isType (token, TOKEN_IDENTIFIER)) + { + return TRUE; + } + } + else + { + return TRUE; + } + } + else + { + return TRUE; + } + + /* + * Confirmed we are inside a namespace tag, so + * process it until the close tag. + * + * But also check for new tags, which will either + * be recursive namespaces or MXML tags + */ + do + { + if (isType (token, TOKEN_LESS_THAN)) + { + parseNamespace (token); + readToken (token); + } + if (isType (token, TOKEN_OPEN_MXML)) + { + parseMXML (token); + } + else + { + readToken (token); + } + } while (! (isType (token, TOKEN_CLOSE_SGML) || isType (token, TOKEN_CLOSE_MXML)) ); + + return TRUE; +} + static boolean parseMXML (tokenInfo *const token) { tokenInfo *const name = newToken (); tokenInfo *const type = newToken (); + boolean inside_attributes = TRUE; /* * Detect the common statements, if, while, for, do, ... * This is necessary since the last statement within a block "{}" @@ -2059,21 +2173,44 @@ readToken (token); do { - if (isType (token, TOKEN_OPEN_MXML)) + if (isType (token, TOKEN_GREATER_THAN)) + { + inside_attributes = FALSE; + } + if (isType (token, TOKEN_LESS_THAN)) + { + parseNamespace (token); + readToken (token); + } + else if (isType (token, TOKEN_OPEN_MXML)) { parseMXML (token); + readToken (token); } - else if (isKeyword (token, KEYWORD_id)) + else if (inside_attributes && (isKeyword (token, KEYWORD_id) || isKeyword (token, KEYWORD_name))) { - /* = */ - readToken (token); - readToken (token); + if (vStringLength(name->string) == 0 ) + { + /* + * If we have already created the tag based on either "name" + * or "id" do not do it again. + */ + readToken (token); + readToken (token); - copyToken (name, token); - addToScope (name, type->string); - makeMXTag (name); - } - readToken (token); + copyToken (name, token); + addToScope (name, type->string); + makeMXTag (name); + } + else + { + readToken (token); + } + } + else + { + readToken (token); + } } while (! (isType (token, TOKEN_CLOSE_SGML) || isType (token, TOKEN_CLOSE_MXML)) ); if (isType (token, TOKEN_CLOSE_MXML)) @@ -2154,6 +2291,33 @@ { if (isType(token, TOKEN_KEYWORD)) { + if (isKeyword (token, KEYWORD_private) || + isKeyword (token, KEYWORD_public) || + isKeyword (token, KEYWORD_override) ) + { + /* + * Methods can be defined as: + * private function f_name + * public override function f_name + * override private function f_name + * Ignore these keywords if present. + */ + readToken (token); + } + if (isKeyword (token, KEYWORD_private) || + isKeyword (token, KEYWORD_public) || + isKeyword (token, KEYWORD_override) ) + { + /* + * Methods can be defined as: + * private function f_name + * public override function f_name + * override private function f_name + * Ignore these keywords if present. + */ + readToken (token); + } + switch (token->keyword) { case KEYWORD_function: parseFunction (token); break; @@ -2178,11 +2342,14 @@ { parseMXML (token); } - if (isType (token, TOKEN_LESS_THAN)) + else if (isType (token, TOKEN_LESS_THAN)) { readToken (token); if (isType (token, TOKEN_QUESTION_MARK)) { + /* + * + */ readToken (token); while (! isType (token, TOKEN_QUESTION_MARK) ) { @@ -2190,6 +2357,19 @@ } readToken (token); } + else if (isKeyword (token, KEYWORD_NONE)) + { + /* + * This is a simple XML tag, read until the closing statement + * + * + */ + readToken (token); + while (! isType (token, TOKEN_GREATER_THAN) ) + { + readToken (token); + } + } } else { === modified file 'fortran.c' --- fortran.c 2009-07-14 15:05:23 +0000 +++ fortran.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: fortran.c 660 2008-04-20 23:30:12Z elliotth $ +* $Id$ * * Copyright (c) 1998-2003, Darren Hiebert * === modified file 'general.h' --- general.h 2007-09-08 09:16:38 +0000 +++ general.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: general.h 508 2007-05-03 03:20:59Z dhiebert $ +* $Id$ * * Copyright (c) 1998-2003, Darren Hiebert * === modified file 'get.c' --- get.c 2007-09-08 09:16:38 +0000 +++ get.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: get.c 559 2007-06-17 03:30:09Z elliotth $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * === modified file 'get.h' --- get.h 2007-09-08 09:16:38 +0000 +++ get.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: get.h 525 2007-05-28 01:50:41Z elliotth $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'html.c' --- html.c 2007-09-08 09:16:38 +0000 +++ html.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: html.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2003, Darren Hiebert * === added file 'index.html' --- index.html 1970-01-01 00:00:00 +0000 +++ index.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,225 @@ + + + + + + + + + Exuberant Ctags + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Exuberant Ctags +
+
+
+ + + A multilanguage implementation of Ctags
+
+
+
+
 
+ + + + + + + + + + + + + +
+ + + +
About
+
  • What is ctags?
  • +
  • Unique features
  • +
  • Supported languages
  • +
  • Supporting tools
  • +
  • Exuberant user feedback
  • +
    +
    + + + +
    Documentation
    +
  • Manual
  • +
  • FAQ
  • +
  • Change Notes
  • +
  • Tag file format
  • +
  • GNU regex
  • +
    +
    + + + +
    Download
    +
  • + Releases +
  • +
    +
    + + + +
    Development
    +
  • + Adding support for a new language +
  • +
  • + Adding tag file support to a software tool +
  • +
    +
    + + + +
    Support
    +
  • + SourceForge project page +
  • +
  • + Report a bug (requires SourceForge account) +
  • +
  • + How to Report Bugs Effectively +
  • +
  • + Mailing lists +
  • +
  • + Email the author +
  • +
  • + Ctags on VMS +
  • +
    +
    +
    Please take a moment to rate ctags:
    +
    Freshmeat
    +
    + IceWalkers +
    +
    +
    +
    + Ctags is hosted at
    +
    + + SourceForge Logo +
    +
    +
    +
    +

    + + ex·u·ber·ant + + : produced in extreme abundance : + PLENTIFUL  synonym see PROFUSE +

    + + + +
    +
    + + + Version @VERSION@ [@DATE@] + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    ContentsPackage
    Source only distribution (gzipped)ctags-@VERSION@.tar.gz 
    Source RPMctags-@VERSION@-1.src.rpm 
    Fedora 10 binary RPM (glibc-2.9)ctags-@VERSION@-1.i386.rpm 
    Source and binary for Windows 98/NT/2000/XPctags@DOS_VERSION@.zip
    +
    + + + + + === modified file 'jscript.c' --- jscript.c 2009-07-14 15:05:23 +0000 +++ jscript.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* - * $Id: jscript.c 666 2008-05-15 17:47:31Z dfishburn $ + * $Id$ * * Copyright (c) 2003, Darren Hiebert * @@ -959,9 +959,10 @@ return is_class; } -static void parseMethods (tokenInfo *const token, tokenInfo *const class) +static boolean parseMethods (tokenInfo *const token, tokenInfo *const class) { tokenInfo *const name = newToken (); + boolean has_methods = FALSE; /* * This deals with these formats @@ -974,6 +975,16 @@ do { readToken (token); + if (isType (token, TOKEN_CLOSE_CURLY)) + { + /* + * This was most likely a variable declaration of a hash table. + * indicate there were no methods and return. + */ + has_methods = FALSE; + goto cleanUp; + } + if (isType (token, TOKEN_STRING) || isKeyword(token, KEYWORD_NONE)) { copyToken(name, token); @@ -992,6 +1003,7 @@ if (isType (token, TOKEN_OPEN_CURLY)) { + has_methods = TRUE; addToScope (name, class->string); makeJsTag (name, JSTAG_METHOD); parseBlock (token, name); @@ -1005,6 +1017,7 @@ } else { + has_methods = TRUE; addToScope (name, class->string); makeJsTag (name, JSTAG_PROPERTY); @@ -1020,7 +1033,10 @@ findCmdTerm (token); +cleanUp: deleteToken (name); + + return has_methods; } static boolean parseStatement (tokenInfo *const token, boolean is_inside_class) @@ -1032,6 +1048,7 @@ boolean is_terminated = TRUE; boolean is_global = FALSE; boolean is_prototype = FALSE; + boolean has_methods = FALSE; vString * fulltag; vStringClear(saveScope); @@ -1345,8 +1362,54 @@ * 'validMethodOne' : function(a,b) {}, * 'validMethodTwo' : function(a,b) {} * } + * Or checks if this is a hash variable. + * var z = {}; */ - parseMethods(token, name); + has_methods = parseMethods(token, name); + if ( ! has_methods ) + { + /* + * Only create variables for global scope + */ + if ( token->nestLevel == 0 && is_global ) + { + /* + * A pointer can be created to the function. + * If we recognize the function/class name ignore the variable. + * This format looks identical to a variable definition. + * A variable defined outside of a block is considered + * a global variable: + * var g_var1 = 1; + * var g_var2; + * This is not a global variable: + * var g_var = function; + * This is a global variable: + * var g_var = different_var_name; + */ + fulltag = vStringNew (); + if (vStringLength (token->scope) > 0) + { + vStringCopy(fulltag, token->scope); + vStringCatS (fulltag, "."); + vStringCatS (fulltag, vStringValue(token->string)); + } + else + { + vStringCopy(fulltag, token->string); + } + vStringTerminate(fulltag); + if ( ! stringListHas(FunctionNames, vStringValue (fulltag)) && + ! stringListHas(ClassNames, vStringValue (fulltag)) ) + { + readToken (token); + if ( ! isType (token, TOKEN_SEMICOLON)) + findCmdTerm (token); + if (isType (token, TOKEN_SEMICOLON)) + makeJsTag (name, JSTAG_VARIABLE); + } + vStringDelete (fulltag); + } + } if (isType (token, TOKEN_CLOSE_CURLY)) { /* === modified file 'keyword.c' --- keyword.c 2009-07-14 15:05:23 +0000 +++ keyword.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: keyword.c 715 2009-07-06 03:31:00Z dhiebert $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'keyword.h' --- keyword.h 2009-07-14 15:05:23 +0000 +++ keyword.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: keyword.h 658 2008-04-20 23:21:35Z elliotth $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'lisp.c' --- lisp.c 2009-07-14 15:05:23 +0000 +++ lisp.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: lisp.c 717 2009-07-07 03:40:50Z dhiebert $ +* $Id$ * * Copyright (c) 2000-2002, Darren Hiebert * === modified file 'lregex.c' --- lregex.c 2007-09-08 09:16:38 +0000 +++ lregex.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: lregex.c 576 2007-06-30 04:16:23Z elliotth $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * @@ -408,7 +408,7 @@ const char* regexfile = parameter + 1; FILE* const fp = fopen (regexfile, "r"); if (fp == NULL) - error (WARNING | PERROR, regexfile); + error (WARNING | PERROR, "%s", regexfile); else { vString* const regex = vStringNew (); === modified file 'lua.c' --- lua.c 2007-09-08 09:16:38 +0000 +++ lua.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: lua.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2001, Max Ischenko . * === modified file 'mac.c' --- mac.c 2007-09-08 09:16:38 +0000 +++ mac.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: mac.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2001, Maarten L. Hekkelman * === modified file 'main.c' --- main.c 2007-09-08 09:16:38 +0000 +++ main.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: main.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'main.h' --- main.h 2007-09-08 09:16:38 +0000 +++ main.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: main.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'maintainer.mak' --- maintainer.mak 2009-07-14 15:05:23 +0000 +++ maintainer.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: maintainer.mak 722 2009-07-09 16:10:35Z dhiebert $ +# $Id$ # # Copyright (c) 1996-2009, Darren Hiebert # @@ -60,7 +60,7 @@ HOST_ARCH := $(shell uname -p) ifneq ($(findstring $(HOST_ARCH),i386 i686),) -COMP_ARCH := -march=i686 +#COMP_ARCH := -march=i686 endif CC := gcc @@ -215,6 +215,9 @@ @ echo "5. On Windows: cd $(WINDOWS_DIR)/winXY; nmake -f mk_mvc.mak ctags.exe mostlyclean" @ echo "6. make version=X.Y win-zip" @ echo "7. make website-X.Y" + @ echo "8. make upload-X.Y [uploads release files to SourceForge]" + @ echo "9. Create SourceForge release." + @ echo "9. make upload-website" .SECONDARY: @@ -343,6 +346,24 @@ $(WINDOWS_DIR): mkdir -p $@ +upload-%: + $(MAKE) version="$*" upload + +UPLOAD_FILES := \ + ctags-$(version).tar.gz \ + ctags-$(version)-1.i386.rpm \ + ctags-$(version)-1.src.rpm \ + ctags$(win_version).zip + +UPLOAD_PATHS := $(addprefix $(RELEASE_DIR)/,$(UPLOAD_FILES)) + +upload: #$(UPLOAD_PATHS) + echo scp -p $^ dhiebert@frs.sourceforge.net:uploads + +upload-website: + chmod 644 website/* + scp -p website/*.html dhiebert,ctags@web.sourceforge.net:htdocs + # # Web site files # === modified file 'make.c' --- make.c 2010-02-26 23:20:58 +0000 +++ make.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: make.c 681 2008-10-12 22:43:00Z dhiebert $ +* $Id$ * * Copyright (c) 2000-2005, Darren Hiebert * === modified file 'mk_bc3.mak' --- mk_bc3.mak 2007-09-08 09:16:38 +0000 +++ mk_bc3.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_bc3.mak 278 2003-02-24 02:27:53Z darren $ +# $Id$ # # Simple makefile for Borland C++ 3.1 === modified file 'mk_bc5.mak' --- mk_bc5.mak 2009-07-14 15:05:23 +0000 +++ mk_bc5.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_bc5.mak 623 2007-09-10 02:52:22Z dhiebert $ +# $Id$ # # Makefile for Win32 using Borland C++ compiler, version 5.5 (free version) === modified file 'mk_djg.mak' --- mk_djg.mak 2007-09-08 09:16:38 +0000 +++ mk_djg.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_djg.mak 307 2003-03-31 04:53:22Z darren $ +# $Id$ # # The most simplistic Makefile, for DJGPP Version 2 on Windows # === modified file 'mk_manx.mak' --- mk_manx.mak 2007-09-08 09:16:38 +0000 +++ mk_manx.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_manx.mak 264 2003-02-13 02:59:30Z darren $ +# $Id$ # # Makefile for ctags on the Amiga, using Aztec/Manx C 5.0 or later === modified file 'mk_mingw.mak' --- mk_mingw.mak 2009-07-14 15:05:23 +0000 +++ mk_mingw.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_mingw.mak 723 2009-07-09 20:53:19Z dhiebert $ +# $Id$ # # Makefile for Exuberant Ctags under Win32 with MinGW compiler # === modified file 'mk_mpw.mak' --- mk_mpw.mak 2007-09-08 09:16:38 +0000 +++ mk_mpw.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_mpw.mak 264 2003-02-13 02:59:30Z darren $ +# $Id$ # # Makefile for Macintosh using MPW # === modified file 'mk_mvc.mak' --- mk_mvc.mak 2009-07-14 15:05:23 +0000 +++ mk_mvc.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_mvc.mak 724 2009-07-09 20:54:01Z dhiebert $ +# $Id$ # # Makefile for Win32 using Microsoft Visual C++ compiler === modified file 'mk_os2.mak' --- mk_os2.mak 2007-09-08 09:16:38 +0000 +++ mk_os2.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_os2.mak 74 2002-01-27 21:20:55Z darren $ +# $Id$ # # A Makefile for OS/2 using EMX/gcc # You may want to use the OS/2 port of autoconf for building === modified file 'mk_qdos.mak' --- mk_qdos.mak 2007-09-08 09:16:38 +0000 +++ mk_qdos.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_qdos.mak 264 2003-02-13 02:59:30Z darren $ +# $Id$ # # Makefile for ctags on QDOS/SMS systems and C68 v4.24 # Submitted by Thierry Godefroy === added file 'mk_risc.mak' --- mk_risc.mak 1970-01-01 00:00:00 +0000 +++ mk_risc.mak 2011-03-11 21:16:06 +0000 @@ -0,0 +1,146 @@ +# $Id$ +# Makefile for Exuberant Ctags on RISC OS + +GCC = gcc -DRISCOS -mthrowback +REGEX = -I RegEx: +OPT = -O3 +CC = $(GCC) $(OPT) + +# Object list +OBJECTS = \ + o.args o.asm o.asp o.awk o.beta o.clang o.cobol o.eiffel o.entry + o.erlang o.fortran o.get o.keyword o.lisp o.lregex o.lua o.main \ + o.make o.options o.parse o.pascal o.perl o.php o.python o.read \ + o.rexx o.routines o.ruby o.scheme o.sh o.slang o.sort o.strlist \ + o.tcl o.verilog o.vim o.vstring o.yacc + +all: $(OBJECTS) + gcc -o ctags $(OBJECTS) RegEx:libregex + +install: ctags + squeeze -v ctags ctags +clean: + create o.!fake! 0 + wipe o.* ~cf + IfThere ctags Then remove ctags + +# Rules for object files + +o.args: c.args + $(CC) -c c.args -o o.args + +o.asm: c.asm + $(CC) $(REGEX) -c c.asm -o o.asm + +o.asp: c.asp + $(CC) -c c.asp -o o.asp + +o.awk: c.awk + $(CC) -c c.awk -o o.awk + +o.beta: c.beta + $(CC) -c c.beta -o o.beta + +o.clang: c.c + $(CC) -c c.c -o o.clang + +o.cobol: c.cobol + $(CC) -c c.cobol -o o.cobol + +o.eiffel: c.eiffel + $(CC) -c c.eiffel -o o.eiffel + +o.entry: c.entry + $(CC) -c c.entry -o o.entry + +o.erlang: c.erlang + $(CC) -c c.erlang -o o.erlang + +o.fortran: c.fortran + $(CC) -c c.fortran -o o.fortran + +o.get: c.get + $(CC) -c c.get -o o.get + +o.keyword: c.keyword + $(CC) -c c.keyword -o o.keyword + +o.lisp: c.lisp + $(CC) -c c.lisp -o o.lisp + +o.lregex: c.lregex + $(CC) $(REGEX) -c c.lregex -o o.lregex + +o.lua: c.lua + $(CC) -c c.lua -o o.lua + +o.main: c.main + $(CC) -c c.main -o o.main + +o.make: c.make + $(CC) -c c.make -o o.make + +o.options: c.options + $(CC) -c c.options -o o.options + +o.parse: c.parse + $(CC) -c c.parse -o o.parse + +o.pascal: c.pascal + $(CC) -c c.pascal -o o.pascal + +o.perl: c.perl + $(CC) -c c.perl -o o.perl + +o.php: c.php + $(CC) -c c.php -o o.php + +o.python: c.python + $(CC) -c c.python -o o.python + +o.read: c.read + $(CC) -c c.read -o o.read + +o.rexx: c.rexx + $(CC) -c c.rexx -o o.rexx + +o.routines: c.routines + $(CC) -c c.routines -o o.routines + +o.ruby: c.ruby + $(CC) -c c.ruby -o o.ruby + +o.scheme: c.scheme + $(CC) -c c.scheme -o o.scheme + +o.sh: c.sh + $(CC) -c c.sh -o o.sh + +o.slang: c.slang + $(CC) -c c.slang -o o.slang + +o.sort: c.sort + $(CC) -c c.sort -o o.sort + +o.sml: c.sml + $(CC) -c c.sml -o o.sml + +o.sql: c.sql + $(CC) -c c.sql -o o.sql + +o.strlist: c.strlist + $(CC) -c c.strlist -o o.strlist + +o.tcl: c.tcl + $(CC) -c c.tcl -o o.tcl + +o.vim: c.vim + $(CC) -c c.vim -o o.vim + +o.vstring: c.vstring + $(CC) -c c.vstring -o o.vstring + +o.yacc: c.yacc + $(CC) -c c.yacc -o o.yacc + +# End of Makefile === modified file 'mk_sas.mak' --- mk_sas.mak 2007-09-08 09:16:38 +0000 +++ mk_sas.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: mk_sas.mak 264 2003-02-13 02:59:30Z darren $ +# $Id$ # # Makefile for SAS/C Amiga Compiler # Submitted by Stefan Haubenthal === modified file 'mkinstalldirs' --- mkinstalldirs 2007-09-08 09:16:38 +0000 +++ mkinstalldirs 2011-03-11 21:16:06 +0000 @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs 2 2001-11-02 04:53:43Z darren $ +# $Id$ errstatus=0 === added file 'objc.c' --- objc.c 1970-01-01 00:00:00 +0000 +++ objc.c 2011-03-11 21:16:06 +0000 @@ -0,0 +1,1147 @@ + +/* +* Copyright (c) 2010, Vincent Berthoux +* +* This source code is released for free distribution under the terms of the +* GNU General Public License. +* +* This module contains functions for generating tags for Objective C +* language files. +*/ +/* +* INCLUDE FILES +*/ +#include "general.h" /* must always come first */ + +#include + +#include "keyword.h" +#include "entry.h" +#include "options.h" +#include "read.h" +#include "routines.h" +#include "vstring.h" + +/* To get rid of unused parameter warning in + * -Wextra */ +#ifdef UNUSED +#elif defined(__GNUC__) +# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) +#elif defined(__LCLINT__) +# define UNUSED(x) /*@unused@*/ x +#else +# define UNUSED(x) x +#endif + +typedef enum { + K_INTERFACE, + K_IMPLEMENTATION, + K_PROTOCOL, + K_METHOD, + K_CLASSMETHOD, + K_VAR, + K_FIELD, + K_FUNCTION, + K_PROPERTY, + K_TYPEDEF, + K_STRUCT, + K_ENUM, + K_MACRO +} objcKind; + +static kindOption ObjcKinds[] = { + {TRUE, 'i', "interface", "class interface"}, + {TRUE, 'I', "implementation", "class implementation"}, + {TRUE, 'p', "protocol", "Protocol"}, + {TRUE, 'm', "method", "Object's method"}, + {TRUE, 'c', "class", "Class' method"}, + {TRUE, 'v', "var", "Global variable"}, + {TRUE, 'F', "field", "Object field"}, + {TRUE, 'f', "function", "A function"}, + {TRUE, 'p', "property", "A property"}, + {TRUE, 't', "typedef", "A type alias"}, + {TRUE, 's', "struct", "A type structure"}, + {TRUE, 'e', "enum", "An enumeration"}, + {TRUE, 'M', "macro", "A preprocessor macro"}, +}; + +typedef enum { + ObjcTYPEDEF, + ObjcSTRUCT, + ObjcENUM, + ObjcIMPLEMENTATION, + ObjcINTERFACE, + ObjcPROTOCOL, + ObjcENCODE, + ObjcSYNCHRONIZED, + ObjcSELECTOR, + ObjcPROPERTY, + ObjcEND, + ObjcDEFS, + ObjcCLASS, + ObjcPRIVATE, + ObjcPACKAGE, + ObjcPUBLIC, + ObjcPROTECTED, + ObjcSYNTHESIZE, + ObjcDYNAMIC, + ObjcOPTIONAL, + ObjcREQUIRED, + ObjcSTRING, + ObjcIDENTIFIER, + + Tok_COMA, /* ',' */ + Tok_PLUS, /* '+' */ + Tok_MINUS, /* '-' */ + Tok_PARL, /* '(' */ + Tok_PARR, /* ')' */ + Tok_CurlL, /* '{' */ + Tok_CurlR, /* '}' */ + Tok_SQUAREL, /* '[' */ + Tok_SQUARER, /* ']' */ + Tok_semi, /* ';' */ + Tok_dpoint, /* ':' */ + Tok_Sharp, /* '#' */ + Tok_Backslash, /* '\\' */ + Tok_EOL, /* '\r''\n' */ + Tok_any, + + Tok_EOF /* END of file */ +} objcKeyword; + +typedef objcKeyword objcToken; + +typedef struct sOBjcKeywordDesc { + const char *name; + objcKeyword id; +} objcKeywordDesc; + + +static const objcKeywordDesc objcKeywordTable[] = { + {"typedef", ObjcTYPEDEF}, + {"struct", ObjcSTRUCT}, + {"enum", ObjcENUM}, + {"@implementation", ObjcIMPLEMENTATION}, + {"@interface", ObjcINTERFACE}, + {"@protocol", ObjcPROTOCOL}, + {"@encode", ObjcENCODE}, + {"@property", ObjcPROPERTY}, + {"@synchronized", ObjcSYNCHRONIZED}, + {"@selector", ObjcSELECTOR}, + {"@end", ObjcEND}, + {"@defs", ObjcDEFS}, + {"@class", ObjcCLASS}, + {"@private", ObjcPRIVATE}, + {"@package", ObjcPACKAGE}, + {"@public", ObjcPUBLIC}, + {"@protected", ObjcPROTECTED}, + {"@synthesize", ObjcSYNTHESIZE}, + {"@dynamic", ObjcDYNAMIC}, + {"@optional", ObjcOPTIONAL}, + {"@required", ObjcREQUIRED}, +}; + +static langType Lang_ObjectiveC; + +/*////////////////////////////////////////////////////////////////// +//// lexingInit */ +typedef struct _lexingState { + vString *name; /* current parsed identifier/operator */ + const unsigned char *cp; /* position in stream */ +} lexingState; + +static void initKeywordHash (void) +{ + const size_t count = sizeof (objcKeywordTable) / sizeof (objcKeywordDesc); + size_t i; + + for (i = 0; i < count; ++i) + { + addKeyword (objcKeywordTable[i].name, Lang_ObjectiveC, + (int) objcKeywordTable[i].id); + } +} + +/*////////////////////////////////////////////////////////////////////// +//// Lexing */ +static boolean isNum (char c) +{ + return c >= '0' && c <= '9'; +} + +static boolean isLowerAlpha (char c) +{ + return c >= 'a' && c <= 'z'; +} + +static boolean isUpperAlpha (char c) +{ + return c >= 'A' && c <= 'Z'; +} + +static boolean isAlpha (char c) +{ + return isLowerAlpha (c) || isUpperAlpha (c); +} + +static boolean isIdent (char c) +{ + return isNum (c) || isAlpha (c) || c == '_'; +} + +static boolean isSpace (char c) +{ + return c == ' ' || c == '\t'; +} + +/* return true if it end with an end of line */ +static void eatWhiteSpace (lexingState * st) +{ + const unsigned char *cp = st->cp; + while (isSpace (*cp)) + cp++; + + st->cp = cp; +} + +static void eatString (lexingState * st) +{ + boolean lastIsBackSlash = FALSE; + boolean unfinished = TRUE; + const unsigned char *c = st->cp + 1; + + while (unfinished) + { + /* end of line should never happen. + * we tolerate it */ + if (c == NULL || c[0] == '\0') + break; + else if (*c == '"' && !lastIsBackSlash) + unfinished = FALSE; + else + lastIsBackSlash = *c == '\\'; + + c++; + } + + st->cp = c; +} + +static void eatComment (lexingState * st) +{ + boolean unfinished = TRUE; + boolean lastIsStar = FALSE; + const unsigned char *c = st->cp + 2; + + while (unfinished) + { + /* we've reached the end of the line.. + * so we have to reload a line... */ + if (c == NULL || *c == '\0') + { + st->cp = fileReadLine (); + /* WOOPS... no more input... + * we return, next lexing read + * will be null and ok */ + if (st->cp == NULL) + return; + c = st->cp; + } + /* we've reached the end of the comment */ + else if (*c == '/' && lastIsStar) + unfinished = FALSE; + else + { + lastIsStar = '*' == *c; + c++; + } + } + + st->cp = c; +} + +static void readIdentifier (lexingState * st) +{ + const unsigned char *p; + vStringClear (st->name); + + /* first char is a simple letter */ + if (isAlpha (*st->cp) || *st->cp == '_') + vStringPut (st->name, (int) *st->cp); + + /* Go till you get identifier chars */ + for (p = st->cp + 1; isIdent (*p); p++) + vStringPut (st->name, (int) *p); + + st->cp = p; + + vStringTerminate (st->name); +} + +/* read the @something directives */ +static void readIdentifierObjcDirective (lexingState * st) +{ + const unsigned char *p; + vStringClear (st->name); + + /* first char is a simple letter */ + if (*st->cp == '@') + vStringPut (st->name, (int) *st->cp); + + /* Go till you get identifier chars */ + for (p = st->cp + 1; isIdent (*p); p++) + vStringPut (st->name, (int) *p); + + st->cp = p; + + vStringTerminate (st->name); +} + +/* The lexer is in charge of reading the file. + * Some of sub-lexer (like eatComment) also read file. + * lexing is finished when the lexer return Tok_EOF */ +static objcKeyword lex (lexingState * st) +{ + int retType; + + /* handling data input here */ + while (st->cp == NULL || st->cp[0] == '\0') + { + st->cp = fileReadLine (); + if (st->cp == NULL) + return Tok_EOF; + + return Tok_EOL; + } + + if (isAlpha (*st->cp)) + { + readIdentifier (st); + retType = lookupKeyword (vStringValue (st->name), Lang_ObjectiveC); + + if (retType == -1) /* If it's not a keyword */ + { + return ObjcIDENTIFIER; + } + else + { + return retType; + } + } + else if (*st->cp == '@') + { + readIdentifierObjcDirective (st); + retType = lookupKeyword (vStringValue (st->name), Lang_ObjectiveC); + + if (retType == -1) /* If it's not a keyword */ + { + return Tok_any; + } + else + { + return retType; + } + } + else if (isSpace (*st->cp)) + { + eatWhiteSpace (st); + return lex (st); + } + else + switch (*st->cp) + { + case '(': + st->cp++; + return Tok_PARL; + + case '\\': + st->cp++; + return Tok_Backslash; + + case '#': + st->cp++; + return Tok_Sharp; + + case '/': + if (st->cp[1] == '*') /* ergl, a comment */ + { + eatComment (st); + return lex (st); + } + else if (st->cp[1] == '/') + { + st->cp = NULL; + return lex (st); + } + else + { + st->cp++; + return Tok_any; + } + break; + + case ')': + st->cp++; + return Tok_PARR; + case '{': + st->cp++; + return Tok_CurlL; + case '}': + st->cp++; + return Tok_CurlR; + case '[': + st->cp++; + return Tok_SQUAREL; + case ']': + st->cp++; + return Tok_SQUARER; + case ',': + st->cp++; + return Tok_COMA; + case ';': + st->cp++; + return Tok_semi; + case ':': + st->cp++; + return Tok_dpoint; + case '"': + eatString (st); + return Tok_any; + case '+': + st->cp++; + return Tok_PLUS; + case '-': + st->cp++; + return Tok_MINUS; + + default: + st->cp++; + break; + } + + /* default return if nothing is recognized, + * shouldn't happen, but at least, it will + * be handled without destroying the parsing. */ + return Tok_any; +} + +/*////////////////////////////////////////////////////////////////////// +//// Parsing */ +typedef void (*parseNext) (vString * const ident, objcToken what); + +/********** Helpers */ +/* This variable hold the 'parser' which is going to + * handle the next token */ +parseNext toDoNext; + +/* Special variable used by parser eater to + * determine which action to put after their + * job is finished. */ +parseNext comeAfter; + +/* Used by some parsers detecting certain token + * to revert to previous parser. */ +parseNext fallback; + + +/********** Grammar */ +static void globalScope (vString * const ident, objcToken what); +static void parseMethods (vString * const ident, objcToken what); +static void parseImplemMethods (vString * const ident, objcToken what); +static vString *tempName = NULL; +static vString *parentName = NULL; +static objcKind parentType = K_INTERFACE; + +/* used to prepare tag for OCaml, just in case their is a need to + * add additional information to the tag. */ +static void prepareTag (tagEntryInfo * tag, vString const *name, objcKind kind) +{ + initTagEntry (tag, vStringValue (name)); + tag->kindName = ObjcKinds[kind].name; + tag->kind = ObjcKinds[kind].letter; + + if (parentName != NULL) + { + tag->extensionFields.scope[0] = ObjcKinds[parentType].name; + tag->extensionFields.scope[1] = vStringValue (parentName); + } +} + +void pushEnclosingContext (const vString * parent, objcKind type) +{ + vStringCopy (parentName, parent); + parentType = type; +} + +void popEnclosingContext () +{ + vStringClear (parentName); +} + +/* Used to centralise tag creation, and be able to add + * more information to it in the future */ +static void addTag (vString * const ident, int kind) +{ + tagEntryInfo toCreate; + prepareTag (&toCreate, ident, kind); + makeTagEntry (&toCreate); +} + +objcToken waitedToken, fallBackToken; + +/* Ignore everything till waitedToken and jump to comeAfter. + * If the "end" keyword is encountered break, doesn't remember + * why though. */ +static void tillToken (vString * const UNUSED (ident), objcToken what) +{ + if (what == waitedToken) + toDoNext = comeAfter; +} + +static void tillTokenOrFallBack (vString * const UNUSED (ident), objcToken what) +{ + if (what == waitedToken) + toDoNext = comeAfter; + else if (what == fallBackToken) + { + toDoNext = fallback; + } +} + +static void ignoreBalanced (vString * const UNUSED (ident), objcToken what) +{ + static int count = 0; + + switch (what) + { + case Tok_PARL: + case Tok_CurlL: + case Tok_SQUAREL: + count++; + break; + + case Tok_PARR: + case Tok_CurlR: + case Tok_SQUARER: + count--; + break; + + default: + /* don't care */ + break; + } + + if (count == 0) + toDoNext = comeAfter; +} + +static void parseFields (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_CurlR: + toDoNext = &parseMethods; + break; + + case Tok_SQUAREL: + case Tok_PARL: + toDoNext = &ignoreBalanced; + comeAfter = &parseFields; + break; + + // we got an identifier, keep track + // of it + case ObjcIDENTIFIER: + vStringCopy (tempName, ident); + break; + + // our last kept identifier must be our + // variable name =) + case Tok_semi: + addTag (tempName, K_FIELD); + vStringClear (tempName); + break; + + default: + /* NOTHING */ + break; + } +} + +objcKind methodKind; + + +static vString *fullMethodName; +static vString *prevIdent; + +static void parseMethodsName (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_PARL: + toDoNext = &tillToken; + comeAfter = &parseMethodsName; + waitedToken = Tok_PARR; + break; + + case Tok_dpoint: + vStringCat (fullMethodName, prevIdent); + vStringCatS (fullMethodName, ":"); + vStringClear (prevIdent); + break; + + case ObjcIDENTIFIER: + vStringCopy (prevIdent, ident); + break; + + case Tok_CurlL: + case Tok_semi: + // method name is not simple + if (vStringLength (fullMethodName) != '\0') + { + addTag (fullMethodName, methodKind); + vStringClear (fullMethodName); + } + else + addTag (prevIdent, methodKind); + + toDoNext = &parseMethods; + parseImplemMethods (ident, what); + vStringClear (prevIdent); + break; + + default: + break; + } +} + +static void parseMethodsImplemName (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_PARL: + toDoNext = &tillToken; + comeAfter = &parseMethodsImplemName; + waitedToken = Tok_PARR; + break; + + case Tok_dpoint: + vStringCat (fullMethodName, prevIdent); + vStringCatS (fullMethodName, ":"); + vStringClear (prevIdent); + break; + + case ObjcIDENTIFIER: + vStringCopy (prevIdent, ident); + break; + + case Tok_CurlL: + case Tok_semi: + // method name is not simple + if (vStringLength (fullMethodName) != '\0') + { + addTag (fullMethodName, methodKind); + vStringClear (fullMethodName); + } + else + addTag (prevIdent, methodKind); + + toDoNext = &parseImplemMethods; + parseImplemMethods (ident, what); + vStringClear (prevIdent); + break; + + default: + break; + } +} + +static void parseImplemMethods (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_PLUS: /* + */ + toDoNext = &parseMethodsImplemName; + methodKind = K_CLASSMETHOD; + break; + + case Tok_MINUS: /* - */ + toDoNext = &parseMethodsImplemName; + methodKind = K_METHOD; + break; + + case ObjcEND: /* @end */ + popEnclosingContext (); + toDoNext = &globalScope; + break; + + case Tok_CurlL: /* { */ + toDoNext = &ignoreBalanced; + ignoreBalanced (ident, what); + comeAfter = &parseImplemMethods; + break; + + default: + break; + } +} + +static void parseProperty (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_PARL: + toDoNext = &tillToken; + comeAfter = &parseProperty; + waitedToken = Tok_PARR; + break; + + // we got an identifier, keep track + // of it + case ObjcIDENTIFIER: + vStringCopy (tempName, ident); + break; + + // our last kept identifier must be our + // variable name =) + case Tok_semi: + addTag (tempName, K_PROPERTY); + vStringClear (tempName); + break; + + default: + break; + } +} + +static void parseMethods (vString * const UNUSED (ident), objcToken what) +{ + switch (what) + { + case Tok_PLUS: /* + */ + toDoNext = &parseMethodsName; + methodKind = K_CLASSMETHOD; + break; + + case Tok_MINUS: /* - */ + toDoNext = &parseMethodsName; + methodKind = K_METHOD; + break; + + case ObjcPROPERTY: + toDoNext = &parseProperty; + break; + + case ObjcEND: /* @end */ + popEnclosingContext (); + toDoNext = &globalScope; + break; + + case Tok_CurlL: /* { */ + toDoNext = &parseFields; + break; + + default: + break; + } +} + + +static void parseProtocol (vString * const ident, objcToken what) +{ + if (what == ObjcIDENTIFIER) + { + pushEnclosingContext (ident, K_PROTOCOL); + addTag (ident, K_PROTOCOL); + } + toDoNext = &parseMethods; +} + +static void parseImplementation (vString * const ident, objcToken what) +{ + if (what == ObjcIDENTIFIER) + { + addTag (ident, K_IMPLEMENTATION); + pushEnclosingContext (ident, K_IMPLEMENTATION); + } + toDoNext = &parseImplemMethods; +} + +static void parseInterface (vString * const ident, objcToken what) +{ + if (what == ObjcIDENTIFIER) + { + addTag (ident, K_INTERFACE); + pushEnclosingContext (ident, K_INTERFACE); + } + + toDoNext = &parseMethods; +} + +static void parseStructMembers (vString * const ident, objcToken what) +{ + static parseNext prev = NULL; + + if (prev != NULL) + { + comeAfter = prev; + prev = NULL; + } + + switch (what) + { + case ObjcIDENTIFIER: + vStringCopy (tempName, ident); + break; + + case Tok_semi: /* ';' */ + addTag (tempName, K_FIELD); + vStringClear (tempName); + break; + + // some types are complex, the only one + // we will loose is the function type. + case Tok_CurlL: /* '{' */ + case Tok_PARL: /* '(' */ + case Tok_SQUAREL: /* '[' */ + toDoNext = &ignoreBalanced; + prev = comeAfter; + comeAfter = &parseStructMembers; + ignoreBalanced (ident, what); + break; + + case Tok_CurlR: + toDoNext = comeAfter; + break; + + default: + /* don't care */ + break; + } +} + +/* Called just after the struct keyword */ +static void parseStruct (vString * const ident, objcToken what) +{ + static boolean gotName = FALSE; + + switch (what) + { + case ObjcIDENTIFIER: + if (!gotName) + { + addTag (ident, K_STRUCT); + pushEnclosingContext (ident, K_STRUCT); + gotName = TRUE; + } + else + { + gotName = FALSE; + popEnclosingContext (); + toDoNext = comeAfter; + comeAfter (ident, what); + } + break; + + case Tok_CurlL: + toDoNext = &parseStructMembers; + break; + + /* maybe it was just a forward declaration + * in which case, we pop the context */ + case Tok_semi: + if (gotName) + popEnclosingContext (); + + toDoNext = comeAfter; + comeAfter (ident, what); + break; + + default: + /* we don't care */ + break; + } +} + +/* Parse enumeration members, ignoring potential initialization */ +static void parseEnumFields (vString * const ident, objcToken what) +{ + static parseNext prev = NULL; + + if (prev != NULL) + { + comeAfter = prev; + prev = NULL; + } + + switch (what) + { + case ObjcIDENTIFIER: + addTag (ident, K_ENUM); + prev = comeAfter; + waitedToken = Tok_COMA; + /* last item might not have a coma */ + fallBackToken = Tok_CurlR; + fallback = comeAfter; + comeAfter = parseEnumFields; + toDoNext = &tillTokenOrFallBack; + break; + + case Tok_CurlR: + toDoNext = comeAfter; + popEnclosingContext (); + break; + + default: + /* don't care */ + break; + } +} + +/* parse enum ... { ... */ +static void parseEnum (vString * const ident, objcToken what) +{ + static boolean named = FALSE; + + switch (what) + { + case ObjcIDENTIFIER: + if (!named) + { + addTag (ident, K_ENUM); + pushEnclosingContext (ident, K_ENUM); + named = TRUE; + } + else + { + named = FALSE; + popEnclosingContext (); + toDoNext = comeAfter; + comeAfter (ident, what); + } + break; + + case Tok_CurlL: /* '{' */ + toDoNext = &parseEnumFields; + named = FALSE; + break; + + case Tok_semi: /* ';' */ + if (named) + popEnclosingContext (); + toDoNext = comeAfter; + comeAfter (ident, what); + break; + + default: + /* don't care */ + break; + } +} + +/* Parse something like + * typedef .... ident ; + * ignoring the defined type but in the case of struct, + * in which case struct are parsed. + */ +static void parseTypedef (vString * const ident, objcToken what) +{ + switch (what) + { + case ObjcSTRUCT: + toDoNext = &parseStruct; + comeAfter = &parseTypedef; + break; + + case ObjcENUM: + toDoNext = &parseEnum; + comeAfter = &parseTypedef; + break; + + case ObjcIDENTIFIER: + vStringCopy (tempName, ident); + break; + + case Tok_semi: /* ';' */ + addTag (tempName, K_TYPEDEF); + vStringClear (tempName); + toDoNext = &globalScope; + break; + + default: + /* we don't care */ + break; + } +} + +static void ignorePreprocStuff (vString * const UNUSED (ident), objcToken what) +{ + static boolean escaped = FALSE; + + switch (what) + { + case Tok_Backslash: + escaped = TRUE; + break; + + case Tok_EOL: + if (escaped) + { + escaped = FALSE; + } + else + { + toDoNext = &globalScope; + } + break; + + default: + escaped = FALSE; + break; + } +} + +static void parseMacroName (vString * const ident, objcToken what) +{ + if (what == ObjcIDENTIFIER) + addTag (ident, K_MACRO); + + toDoNext = &ignorePreprocStuff; +} + +static void parsePreproc (vString * const ident, objcToken what) +{ + switch (what) + { + case ObjcIDENTIFIER: + if (strcmp (vStringValue (ident), "define") == 0) + toDoNext = &parseMacroName; + else + toDoNext = &ignorePreprocStuff; + break; + + default: + toDoNext = &ignorePreprocStuff; + break; + } +} + +/* Handle the "strong" top levels, all 'big' declarations + * happen here */ +static void globalScope (vString * const ident, objcToken what) +{ + switch (what) + { + case Tok_Sharp: + toDoNext = &parsePreproc; + break; + + case ObjcSTRUCT: + toDoNext = &parseStruct; + comeAfter = &globalScope; + break; + + case ObjcIDENTIFIER: + /* we keep track of the identifier if we + * come across a function. */ + vStringCopy (tempName, ident); + break; + + case Tok_PARL: + /* if we find an opening parenthesis it means we + * found a function (or a macro...) */ + addTag (tempName, K_FUNCTION); + vStringClear (tempName); + comeAfter = &globalScope; + toDoNext = &ignoreBalanced; + ignoreBalanced (ident, what); + break; + + case ObjcINTERFACE: + toDoNext = &parseInterface; + break; + + case ObjcIMPLEMENTATION: + toDoNext = &parseImplementation; + break; + + case ObjcPROTOCOL: + toDoNext = &parseProtocol; + break; + + case ObjcTYPEDEF: + toDoNext = parseTypedef; + comeAfter = &globalScope; + break; + + case Tok_CurlL: + comeAfter = &globalScope; + toDoNext = &ignoreBalanced; + ignoreBalanced (ident, what); + break; + + case ObjcEND: + case ObjcPUBLIC: + case ObjcPROTECTED: + case ObjcPRIVATE: + + default: + /* we don't care */ + break; + } +} + +/*//////////////////////////////////////////////////////////////// +//// Deal with the system */ + +static void findObjcTags (void) +{ + vString *name = vStringNew (); + lexingState st; + objcToken tok; + + parentName = vStringNew (); + tempName = vStringNew (); + fullMethodName = vStringNew (); + prevIdent = vStringNew (); + + st.name = vStringNew (); + st.cp = fileReadLine (); + toDoNext = &globalScope; + tok = lex (&st); + while (tok != Tok_EOF) + { + (*toDoNext) (st.name, tok); + tok = lex (&st); + } + + vStringDelete (name); + vStringDelete (parentName); + vStringDelete (tempName); + vStringDelete (fullMethodName); + vStringDelete (prevIdent); + parentName = NULL; + tempName = NULL; + prevIdent = NULL; + fullMethodName = NULL; +} + +static void objcInitialize (const langType language) +{ + Lang_ObjectiveC = language; + + initKeywordHash (); +} + +extern parserDefinition *ObjcParser (void) +{ + static const char *const extensions[] = { "m", "h", NULL }; + parserDefinition *def = parserNew ("ObjectiveC"); + def->kinds = ObjcKinds; + def->kindCount = KIND_COUNT (ObjcKinds); + def->extensions = extensions; + def->parser = findObjcTags; + def->initialize = objcInitialize; + + return def; +} === modified file 'ocaml.c' --- ocaml.c 2009-07-14 15:05:23 +0000 +++ ocaml.c 2011-03-11 21:16:06 +0000 @@ -72,6 +72,7 @@ OcaKEYWORD_if, OcaKEYWORD_in, OcaKEYWORD_let, + OcaKEYWORD_value, OcaKEYWORD_match, OcaKEYWORD_method, OcaKEYWORD_module, @@ -145,7 +146,7 @@ { "try" , OcaKEYWORD_try }, { "type" , OcaKEYWORD_type }, { "val" , OcaKEYWORD_val }, - { "value" , OcaKEYWORD_let }, /* just to handle revised syntax */ + { "value" , OcaKEYWORD_value }, /* just to handle revised syntax */ { "virtual" , OcaKEYWORD_virtual }, { "while" , OcaKEYWORD_while }, { "with" , OcaKEYWORD_with }, @@ -297,7 +298,6 @@ if (st->cp == NULL) return; c = st->cp; - continue; } /* we've reached the end of the comment */ else if (*c == ')' && lastIsStar) @@ -308,13 +308,33 @@ { st->cp = c; eatComment (st); + c = st->cp; + if (c == NULL) + return; + lastIsStar = FALSE; + c++; } + /* OCaml has a rule which says : + * + * "Comments do not occur inside string or character literals. + * Nested comments are handled correctly." + * + * So if we encounter a string beginning, we must parse it to + * get a good comment nesting (bug ID: 3117537) + */ + else if (*c == '"') + { + st->cp = c; + eatString (st); + c = st->cp; + } else + { lastIsStar = '*' == *c; - - c++; + c++; + } } st->cp = c; @@ -554,8 +574,7 @@ for (i = stackIndex - 1; i >= 0; --i) { - if (stack[i].contextName->buffer && - strlen (stack[i].contextName->buffer) > 0) + if (vStringLength (stack[i].contextName) > 0) { return i; } @@ -866,6 +885,11 @@ tag->kindName = OcamlKinds[kind].name; tag->kind = OcamlKinds[kind].letter; + if (kind == K_MODULE) + { + tag->lineNumberEntry = TRUE; + tag->lineNumber = 1; + } parentIndex = getLastNamedIndex (); if (parentIndex >= 0) { @@ -880,9 +904,12 @@ * more information to it in the future */ static void addTag (vString * const ident, int kind) { - tagEntryInfo toCreate; - prepareTag (&toCreate, ident, kind); - makeTagEntry (&toCreate); + if (OcamlKinds [kind].enabled && ident != NULL && vStringLength (ident) > 0) + { + tagEntryInfo toCreate; + prepareTag (&toCreate, ident, kind); + makeTagEntry (&toCreate); + } } boolean needStrongPoping = FALSE; @@ -942,15 +969,17 @@ } /* handle : - * exception ExceptionName ... */ + * exception ExceptionName of ... */ static void exceptionDecl (vString * const ident, ocaToken what) { if (what == OcaIDENTIFIER) { addTag (ident, K_EXCEPTION); } - /* don't know what to do on else... */ - + else /* probably ill-formed, give back to global scope */ + { + globalScope (ident, what); + } toDoNext = &globalScope; } @@ -1006,7 +1035,6 @@ */ static void typeDecl (vString * const ident, ocaToken what) { - switch (what) { /* parameterized */ @@ -1046,7 +1074,6 @@ * let typeRecord handle it. */ static void typeSpecification (vString * const ident, ocaToken what) { - switch (what) { case OcaIDENTIFIER: @@ -1243,8 +1270,14 @@ * than the let definitions. * Used after a match ... with, or a function ... or fun ... * because their syntax is similar. */ -static void matchPattern (vString * const UNUSED (ident), ocaToken what) +static void matchPattern (vString * const ident, ocaToken what) { + /* keep track of [], as it + * can be used in patterns and can + * mean the end of match expression in + * revised syntax */ + static int braceCount = 0; + switch (what) { case Tok_To: @@ -1252,6 +1285,14 @@ toDoNext = &mayRedeclare; break; + case Tok_BRL: + braceCount++; + break; + + case OcaKEYWORD_value: + popLastNamed (); + globalScope (ident, what); + break; case OcaKEYWORD_in: popLastNamed (); @@ -1269,6 +1310,11 @@ { switch (what) { + case OcaKEYWORD_value: + // let globalScope handle it + globalScope (ident, what); + break; + case OcaKEYWORD_let: case OcaKEYWORD_val: toDoNext = localLet; @@ -1388,6 +1434,7 @@ * nearly a copy/paste of globalLet. */ static void methodDecl (vString * const ident, ocaToken what) { + switch (what) { case Tok_PARL: @@ -1435,6 +1482,7 @@ */ static void moduleSpecif (vString * const ident, ocaToken what) { + switch (what) { case OcaKEYWORD_functor: @@ -1566,7 +1614,7 @@ { /* Do not touch, this is used only by the global scope * to handle an 'and' */ - static parseNext previousParser = NULL; + static parseNext previousParser = &globalScope; switch (what) { @@ -1608,6 +1656,7 @@ /* val is mixed with let as global * to be able to handle mli & new syntax */ case OcaKEYWORD_val: + case OcaKEYWORD_value: case OcaKEYWORD_let: cleanupPreviousParser (); toDoNext = &globalLet; @@ -1617,7 +1666,7 @@ case OcaKEYWORD_exception: cleanupPreviousParser (); toDoNext = &exceptionDecl; - previousParser = NULL; + previousParser = &globalScope; break; /* must be a #line directive, discard the @@ -1769,7 +1818,7 @@ if (isLowerAlpha (moduleName->buffer[0])) moduleName->buffer[0] += ('A' - 'a'); - makeSimpleTag (moduleName, OcamlKinds, K_MODULE); + addTag (moduleName, K_MODULE); vStringDelete (moduleName); } @@ -1779,6 +1828,7 @@ int i; for (i = 0; i < OCAML_MAX_STACK_SIZE; ++i) stack[i].contextName = vStringNew (); + stackIndex = 0; } static void clearStack ( void ) @@ -1794,8 +1844,8 @@ lexingState st; ocaToken tok; + initStack (); computeModuleName (); - initStack (); tempIdent = vStringNew (); lastModule = vStringNew (); lastClass = vStringNew (); === modified file 'options.c' --- options.c 2007-09-08 09:16:38 +0000 +++ options.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: options.c 576 2007-06-30 04:16:23Z elliotth $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'options.h' --- options.h 2007-09-08 09:16:38 +0000 +++ options.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: options.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1998-2003, Darren Hiebert * === modified file 'parse.c' --- parse.c 2007-09-08 09:16:38 +0000 +++ parse.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: parse.c 597 2007-07-31 05:35:30Z dhiebert $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'parse.h' --- parse.h 2007-09-08 09:16:38 +0000 +++ parse.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: parse.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1998-2003, Darren Hiebert * === modified file 'parsers.h' --- parsers.h 2009-07-14 15:05:23 +0000 +++ parsers.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: parsers.h 717 2009-07-07 03:40:50Z dhiebert $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * @@ -38,6 +38,7 @@ LuaParser, \ MakefileParser, \ MatLabParser, \ + ObjcParser , \ OcamlParser, \ PascalParser, \ PerlParser, \ === modified file 'pascal.c' --- pascal.c 2007-09-08 09:16:38 +0000 +++ pascal.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: pascal.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 2001-2002, Darren Hiebert * === modified file 'perl.c' --- perl.c 2007-09-08 09:16:38 +0000 +++ perl.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: perl.c 601 2007-08-02 04:45:16Z perlguy0 $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * === modified file 'php.c' --- php.c 2010-02-26 23:20:58 +0000 +++ php.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: php.c 734 2009-08-20 23:33:54Z jafl $ +* $Id$ * * Copyright (c) 2000, Jesus Castagnetto * === modified file 'python.c' --- python.c 2010-08-17 15:10:27 +0000 +++ python.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: python.c 720 2009-07-07 03:55:23Z dhiebert $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * @@ -240,7 +240,7 @@ { for (; *cp; cp++) { - if (*cp == '"' || *cp == '\'') + if (*cp == '"' || *cp == '\'' || *cp == '#') { cp = skipString(cp); if (!*cp) break; @@ -398,7 +398,9 @@ cp = parseIdentifier (cp, def); arglist = parseArglist (cp); makeFunctionTag (def, parent, is_class_parent, arglist); - eFree (arglist); + if (arglist != NULL) { + eFree (arglist); + } } /* Get the combined name of a nested symbol. Classes are separated with ".", === modified file 'qdos.c' --- qdos.c 2007-09-08 09:16:38 +0000 +++ qdos.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: qdos.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1999, Thierry Godefroy * === modified file 'read.c' --- read.c 2009-07-14 15:05:23 +0000 +++ read.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: read.c 708 2009-07-04 05:29:02Z dhiebert $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * @@ -271,7 +271,6 @@ fgetpos (File.fp, &StartOfLine); fgetpos (File.fp, &File.filePosition); File.currentLine = NULL; - File.language = language; File.lineNumber = 0L; File.eof = FALSE; File.newLine = TRUE; === modified file 'read.h' --- read.h 2009-07-14 15:05:23 +0000 +++ read.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: read.h 659 2008-04-20 23:27:48Z elliotth $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * @@ -77,7 +77,6 @@ int ungetch; /* a single character that was ungotten */ boolean eof; /* have we reached the end of file? */ boolean newLine; /* will the next character begin a new line? */ - langType language; /* language of input file */ /* Contains data pertaining to the original source file in which the tag * was defined. This may be different from the input file when #line === modified file 'readtags.c' --- readtags.c 2007-09-08 09:16:38 +0000 +++ readtags.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: readtags.c 592 2007-07-31 03:30:41Z dhiebert $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'readtags.h' --- readtags.h 2007-09-08 09:16:38 +0000 +++ readtags.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: readtags.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1996-2003, Darren Hiebert * === modified file 'rexx.c' --- rexx.c 2007-09-08 09:16:38 +0000 +++ rexx.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: rexx.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2001-2003, Darren Hiebert * === modified file 'routines.c' --- routines.c 2007-09-08 09:16:38 +0000 +++ routines.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: routines.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 2002-2003, Darren Hiebert * === modified file 'routines.h' --- routines.h 2007-09-08 09:16:38 +0000 +++ routines.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: routines.h 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 2002, Darren Hiebert * === modified file 'ruby.c' --- ruby.c 2007-09-08 09:16:38 +0000 +++ ruby.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: ruby.c 571 2007-06-24 23:32:14Z elliotth $ +* $Id$ * * Copyright (c) 2000-2001, Thaddeus Covert * Copyright (c) 2002 Matthias Veit === modified file 'scheme.c' --- scheme.c 2007-09-08 09:16:38 +0000 +++ scheme.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: scheme.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2002, Darren Hiebert * === modified file 'sh.c' --- sh.c 2007-09-08 09:16:38 +0000 +++ sh.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: sh.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2002, Darren Hiebert * === modified file 'slang.c' --- slang.c 2007-09-08 09:16:38 +0000 +++ slang.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* - * $Id: slang.c 443 2006-05-30 04:37:13Z darren $ + * $Id$ * * Copyright (c) 2000-2001, Francesc Rocher * === modified file 'sml.c' --- sml.c 2007-09-08 09:16:38 +0000 +++ sml.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: sml.c 536 2007-06-02 06:09:00Z elliotth $ +* $Id$ * * Copyright (c) 2002, Venkatesh Prasad Ranganath and Darren Hiebert * === modified file 'sort.c' --- sort.c 2007-09-08 09:16:38 +0000 +++ sort.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: sort.c 498 2007-02-17 22:43:15Z dhiebert $ +* $Id$ * * Copyright (c) 1996-2002, Darren Hiebert * @@ -109,7 +109,7 @@ if (fp != NULL) fclose (fp); if (msg == NULL) - error (FATAL | PERROR, cannotSort); + error (FATAL | PERROR, "%s", cannotSort); else error (FATAL, "%s: %s", msg, cannotSort); } === modified file 'sort.h' --- sort.h 2007-09-08 09:16:38 +0000 +++ sort.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: sort.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'source.mak' --- source.mak 2009-07-14 15:05:23 +0000 +++ source.mak 2011-03-11 21:16:06 +0000 @@ -1,4 +1,4 @@ -# $Id: source.mak 720 2009-07-07 03:55:23Z dhiebert $ +# $Id$ # # Shared macros @@ -33,6 +33,7 @@ main.c \ make.c \ matlab.c \ + objc.c \ ocaml.c \ options.c \ parse.c \ @@ -95,6 +96,7 @@ main.$(OBJEXT) \ make.$(OBJEXT) \ matlab.$(OBJEXT) \ + objc.$(OBJEXT) \ ocaml.$(OBJEXT) \ options.$(OBJEXT) \ parse.$(OBJEXT) \ === modified file 'sql.c' --- sql.c 2009-07-14 15:05:23 +0000 +++ sql.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* - * $Id: sql.c 703 2009-03-14 22:06:12Z dfishburn $ + * $Id$ * * Copyright (c) 2002-2003, Darren Hiebert * @@ -65,9 +65,14 @@ KEYWORD_end, KEYWORD_function, KEYWORD_if, + KEYWORD_else, + KEYWORD_elseif, + KEYWORD_endif, KEYWORD_loop, + KEYWORD_while, KEYWORD_case, KEYWORD_for, + KEYWORD_do, KEYWORD_call, KEYWORD_package, KEYWORD_pragma, @@ -114,6 +119,7 @@ KEYWORD_ml_conn_dnet, KEYWORD_ml_conn_java, KEYWORD_ml_conn_chk, + KEYWORD_ml_prop, KEYWORD_local, KEYWORD_temporary, KEYWORD_drop, @@ -140,6 +146,7 @@ TOKEN_BLOCK_LABEL_END, TOKEN_CHARACTER, TOKEN_CLOSE_PAREN, + TOKEN_COLON, TOKEN_SEMICOLON, TOKEN_COMMA, TOKEN_IDENTIFIER, @@ -154,7 +161,8 @@ TOKEN_OPEN_SQUARE, TOKEN_CLOSE_SQUARE, TOKEN_TILDE, - TOKEN_FORWARD_SLASH + TOKEN_FORWARD_SLASH, + TOKEN_EQUAL } tokenType; typedef struct sTokenInfoSQL { @@ -198,6 +206,7 @@ SQLTAG_SYNONYM, SQLTAG_MLTABLE, SQLTAG_MLCONN, + SQLTAG_MLPROP, SQLTAG_COUNT } sqlKind; @@ -223,7 +232,8 @@ { TRUE, 'V', "view", "views" }, { TRUE, 'n', "synonym", "synonyms" }, { TRUE, 'x', "mltable", "MobiLink Table Scripts" }, - { TRUE, 'y', "mlconn", "MobiLink Conn Scripts" } + { TRUE, 'y', "mlconn", "MobiLink Conn Scripts" }, + { TRUE, 'z', "mlprop", "MobiLink Properties " } }; static const keywordDesc SqlKeywordTable [] = { @@ -237,9 +247,14 @@ { "end", KEYWORD_end }, { "function", KEYWORD_function }, { "if", KEYWORD_if }, + { "else", KEYWORD_else }, + { "elseif", KEYWORD_elseif }, + { "endif", KEYWORD_endif }, { "loop", KEYWORD_loop }, + { "while", KEYWORD_while }, { "case", KEYWORD_case }, { "for", KEYWORD_for }, + { "do", KEYWORD_do }, { "call", KEYWORD_call }, { "package", KEYWORD_package }, { "pragma", KEYWORD_pragma }, @@ -286,6 +301,7 @@ { "ml_add_dnet_connection_script", KEYWORD_ml_conn_dnet }, { "ml_add_java_connection_script", KEYWORD_ml_conn_java }, { "ml_add_lang_conn_script_chk", KEYWORD_ml_conn_chk }, + { "ml_add_property", KEYWORD_ml_prop }, { "local", KEYWORD_local }, { "temporary", KEYWORD_temporary }, { "drop", KEYWORD_drop }, @@ -303,6 +319,7 @@ /* Recursive calls */ static void parseBlock (tokenInfo *const token, const boolean local); +static void parseDeclare (tokenInfo *const token, const boolean local); static void parseKeywords (tokenInfo *const token); static void parseSqlFile (tokenInfo *const token); @@ -541,6 +558,7 @@ case EOF: longjmp (Exception, (int)ExceptionEOF); break; case '(': token->type = TOKEN_OPEN_PAREN; break; case ')': token->type = TOKEN_CLOSE_PAREN; break; + case ':': token->type = TOKEN_COLON; break; case ';': token->type = TOKEN_SEMICOLON; break; case '.': token->type = TOKEN_PERIOD; break; case ',': token->type = TOKEN_COMMA; break; @@ -549,6 +567,7 @@ case '~': token->type = TOKEN_TILDE; break; case '[': token->type = TOKEN_OPEN_SQUARE; break; case ']': token->type = TOKEN_CLOSE_SQUARE; break; + case '=': token->type = TOKEN_EQUAL; break; case '\'': case '"': @@ -764,6 +783,16 @@ } } +static void copyToken (tokenInfo *const dest, tokenInfo *const src) +{ + dest->lineNumber = src->lineNumber; + dest->filePosition = src->filePosition; + dest->type = src->type; + dest->keyword = src->keyword; + vStringCopy(dest->string, src->string); + vStringCopy(dest->scope, src->scope); +} + static void skipArgumentList (tokenInfo *const token) { /* @@ -782,6 +811,7 @@ static void parseSubProgram (tokenInfo *const token) { tokenInfo *const name = newToken (); + vString * saveScope = vStringNew (); /* * This must handle both prototypes and the body of @@ -821,16 +851,44 @@ * * RETURN @name; * END; + * + * Note, a Package adds scope to the items within. + * create or replace package demo_pkg is + * test_var number; + * function test_func return varchar2; + * function more.test_func2 return varchar2; + * end demo_pkg; + * So the tags generated here, contain the package name: + * demo_pkg.test_var + * demo_pkg.test_func + * demo_pkg.more.test_func2 */ const sqlKind kind = isKeyword (token, KEYWORD_function) ? SQLTAG_FUNCTION : SQLTAG_PROCEDURE; Assert (isKeyword (token, KEYWORD_function) || isKeyword (token, KEYWORD_procedure)); - readToken (name); - readToken (token); + + vStringCopy(saveScope, token->scope); + readToken (token); + copyToken (name, token); + readToken (token); + if (isType (token, TOKEN_PERIOD)) { - readToken (name); + /* + * If this is an Oracle package, then the token->scope should + * already be set. If this is the case, also add this value to the + * scope. + * If this is not an Oracle package, chances are the scope should be + * blank and the value just read is the OWNER or CREATOR of the + * function and should not be considered part of the scope. + */ + if ( vStringLength(saveScope) > 0 ) + { + addToScope(token, name->string); + } + readToken (token); + copyToken (name, token); readToken (token); } if (isType (token, TOKEN_OPEN_PAREN)) @@ -870,6 +928,7 @@ isKeyword (token, KEYWORD_internal) || isKeyword (token, KEYWORD_external) || isKeyword (token, KEYWORD_url) || + isType (token, TOKEN_EQUAL) || isCmdTerm (token) ) ) @@ -900,6 +959,12 @@ vStringClear (token->scope); } + if ( isType (token, TOKEN_EQUAL) ) + readToken (token); + + if ( isKeyword (token, KEYWORD_declare) ) + parseDeclare (token, FALSE); + if (isKeyword (token, KEYWORD_is) || isKeyword (token, KEYWORD_begin) ) { @@ -914,7 +979,9 @@ vStringClear (token->scope); } } + vStringCopy(token->scope, saveScope); deleteToken (name); + vStringDelete(saveScope); } static void parseRecord (tokenInfo *const token) @@ -1066,18 +1133,18 @@ case KEYWORD_type: parseType (token); break; default: - if (isType (token, TOKEN_IDENTIFIER)) - { - if (local) - { - makeSqlTag (token, SQLTAG_LOCAL_VARIABLE); - } - else - { - makeSqlTag (token, SQLTAG_VARIABLE); - } - } - break; + if (isType (token, TOKEN_IDENTIFIER)) + { + if (local) + { + makeSqlTag (token, SQLTAG_LOCAL_VARIABLE); + } + else + { + makeSqlTag (token, SQLTAG_VARIABLE); + } + } + break; } findToken (token, TOKEN_SEMICOLON); readToken (token); @@ -1164,12 +1231,13 @@ } } -static void parseStatements (tokenInfo *const token) +static void parseStatements (tokenInfo *const token, const boolean exit_on_endif ) { boolean isAnsi = TRUE; boolean stmtTerm = FALSE; do { + if (isType (token, TOKEN_BLOCK_LABEL_BEGIN)) parseLabel (token); else @@ -1210,6 +1278,7 @@ */ while (! isKeyword (token, KEYWORD_then)) readToken (token); + readToken (token); continue; @@ -1220,6 +1289,15 @@ * IF...THEN * END IF; * + * IF...THEN + * ELSE + * END IF; + * + * IF...THEN + * ELSEIF...THEN + * ELSE + * END IF; + * * or non-ANSI * IF ... * BEGIN @@ -1248,7 +1326,22 @@ else { readToken (token); - parseStatements (token); + + while( ! (isKeyword (token, KEYWORD_end ) || + isKeyword (token, KEYWORD_endif ) ) + ) + { + if ( isKeyword (token, KEYWORD_else) || + isKeyword (token, KEYWORD_elseif) ) + readToken (token); + + parseStatements (token, TRUE); + + if ( isCmdTerm(token) ) + readToken (token); + + } + /* * parseStatements returns when it finds an END, an IF * should follow the END for ANSI anyway. @@ -1258,7 +1351,13 @@ if( isKeyword (token, KEYWORD_end ) ) readToken (token); - if( ! isKeyword (token, KEYWORD_if ) ) + if( isKeyword (token, KEYWORD_if ) || isKeyword (token, KEYWORD_endif ) ) + { + readToken (token); + if ( isCmdTerm(token) ) + stmtTerm = TRUE; + } + else { /* * Well we need to do something here. @@ -1284,14 +1383,64 @@ * END CASE; * * FOR loop_name AS cursor_name CURSOR FOR ... + * DO * END FOR; */ + if( isKeyword (token, KEYWORD_for ) ) + { + /* loop name */ + readToken (token); + /* AS */ + readToken (token); + + while ( ! isKeyword (token, KEYWORD_is) ) + { + /* + * If this is not an AS keyword this is + * not a proper FOR statement and should + * simply be ignored + */ + return; + } + + while ( ! isKeyword (token, KEYWORD_do) ) + readToken (token); + } + + readToken (token); - parseStatements (token); + while( ! isKeyword (token, KEYWORD_end ) ) + { + /* + if ( isKeyword (token, KEYWORD_else) || + isKeyword (token, KEYWORD_elseif) ) + readToken (token); + */ + + parseStatements (token, FALSE); + + if ( isCmdTerm(token) ) + readToken (token); + } + if( isKeyword (token, KEYWORD_end ) ) readToken (token); + /* + * Typically ended with + * END LOOP [loop name]; + * END CASE + * END FOR [loop name]; + */ + if ( isKeyword (token, KEYWORD_loop) || + isKeyword (token, KEYWORD_case) || + isKeyword (token, KEYWORD_for) ) + readToken (token); + + if ( isCmdTerm(token) ) + stmtTerm = TRUE; + break; case KEYWORD_create: @@ -1324,11 +1473,36 @@ * * So we must read to the first semi-colon or an END block */ - while ( ! stmtTerm && - ! ( isKeyword (token, KEYWORD_end) || - (isCmdTerm(token)) ) + while ( ! stmtTerm && + ! ( isKeyword (token, KEYWORD_end) || + (isCmdTerm(token)) ) ) { + if ( isKeyword (token, KEYWORD_endif) && + exit_on_endif ) + return; + + if (isType (token, TOKEN_COLON) ) + { + /* + * A : can signal a loop name + * myloop: + * LOOP + * LEAVE myloop; + * END LOOP; + * Unfortunately, labels do not have a + * cmd terminator, therefore we have to check + * if the next token is a keyword and process + * it accordingly. + */ + readToken (token); + if ( isKeyword (token, KEYWORD_loop) || + isKeyword (token, KEYWORD_while) || + isKeyword (token, KEYWORD_for) ) + /* parseStatements (token); */ + return; + } + readToken (token); if (isType (token, TOKEN_OPEN_PAREN) || @@ -1336,6 +1510,20 @@ isType (token, TOKEN_OPEN_SQUARE) ) skipToMatched (token); + /* + * Since we know how to parse various statements + * if we detect them, parse them to completion + */ + if (isType (token, TOKEN_BLOCK_LABEL_BEGIN) || + isKeyword (token, KEYWORD_exception) || + isKeyword (token, KEYWORD_loop) || + isKeyword (token, KEYWORD_case) || + isKeyword (token, KEYWORD_for) || + isKeyword (token, KEYWORD_begin) ) + parseStatements (token, FALSE); + else if (isKeyword (token, KEYWORD_if)) + parseStatements (token, TRUE); + } } /* @@ -1343,11 +1531,12 @@ * See comment above, now, only read if the current token * is not a command terminator. */ - if ( isCmdTerm(token) ) - { - readToken (token); - } - } while (! isKeyword (token, KEYWORD_end) && ! stmtTerm ); + if ( isCmdTerm(token) && ! stmtTerm ) + stmtTerm = TRUE; + + } while (! isKeyword (token, KEYWORD_end) && + ! (exit_on_endif && isKeyword (token, KEYWORD_endif) ) && + ! stmtTerm ); } static void parseBlock (tokenInfo *const token, const boolean local) @@ -1378,7 +1567,10 @@ token->begin_end_nest_lvl++; while (! isKeyword (token, KEYWORD_end)) { - parseStatements (token); + parseStatements (token, FALSE); + + if ( isCmdTerm(token) ) + readToken (token); } token->begin_end_nest_lvl--; @@ -1415,7 +1607,7 @@ * or by specifying a package body * CREATE OR REPLACE PACKAGE BODY pkg_name AS * CREATE OR REPLACE PACKAGE BODY owner.pkg_name AS - */ + */ tokenInfo *const name = newToken (); readToken (name); if (isKeyword (name, KEYWORD_body)) @@ -1440,7 +1632,9 @@ if (isType (name, TOKEN_IDENTIFIER) || isType (name, TOKEN_STRING)) makeSqlTag (name, SQLTAG_PACKAGE); + addToScope (token, name->string); parseBlock (token, FALSE); + vStringClear (token->scope); } findCmdTerm (token, FALSE); deleteToken (name); @@ -1994,6 +2188,70 @@ deleteToken (event); } +static void parseMLProp (tokenInfo *const token) +{ + tokenInfo *const component = newToken (); + tokenInfo *const prop_set_name = newToken (); + tokenInfo *const prop_name = newToken (); + + /* + * This deals with these formats + * ml_add_property ( + * 'comp_name', + * 'prop_set_name', + * 'prop_name', + * 'prop_value' + * ) + */ + + readToken (token); + if ( isType (token, TOKEN_OPEN_PAREN) ) + { + readToken (component); + readToken (token); + while (!(isType (token, TOKEN_COMMA) || + isType (token, TOKEN_CLOSE_PAREN) + )) + { + readToken (token); + } + + if (isType (token, TOKEN_COMMA)) + { + readToken (prop_set_name); + readToken (token); + while (!(isType (token, TOKEN_COMMA) || + isType (token, TOKEN_CLOSE_PAREN) + )) + { + readToken (token); + } + + if (isType (token, TOKEN_COMMA)) + { + readToken (prop_name); + + if (isType (component, TOKEN_STRING) && + isType (prop_set_name, TOKEN_STRING) && + isType (prop_name, TOKEN_STRING) ) + { + addToScope(component, prop_set_name->string); + addToScope(component, prop_name->string); + makeSqlTag (component, SQLTAG_MLPROP); + } + } + if( !isType (token, TOKEN_CLOSE_PAREN) ) + findToken (token, TOKEN_CLOSE_PAREN); + } + } + + findCmdTerm (token, TRUE); + + deleteToken (component); + deleteToken (prop_set_name); + deleteToken (prop_name); +} + static void parseComment (tokenInfo *const token) { /* @@ -2039,7 +2297,7 @@ case KEYWORD_drop: parseDrop (token); break; case KEYWORD_event: parseEvent (token); break; case KEYWORD_function: parseSubProgram (token); break; - case KEYWORD_if: parseStatements (token); break; + case KEYWORD_if: parseStatements (token, FALSE); break; case KEYWORD_index: parseIndex (token); break; case KEYWORD_ml_table: parseMLTable (token); break; case KEYWORD_ml_table_lang: parseMLTable (token); break; @@ -2051,6 +2309,7 @@ case KEYWORD_ml_conn_dnet: parseMLConn (token); break; case KEYWORD_ml_conn_java: parseMLConn (token); break; case KEYWORD_ml_conn_chk: parseMLConn (token); break; + case KEYWORD_ml_prop: parseMLProp (token); break; case KEYWORD_package: parsePackage (token); break; case KEYWORD_procedure: parseSubProgram (token); break; case KEYWORD_publication: parsePublication (token); break; === modified file 'strlist.c' --- strlist.c 2007-09-08 09:16:38 +0000 +++ strlist.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: strlist.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1999-2002, Darren Hiebert * === modified file 'strlist.h' --- strlist.h 2007-09-08 09:16:38 +0000 +++ strlist.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: strlist.h 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 1999-2002, Darren Hiebert * === modified file 'tcl.c' --- tcl.c 2007-09-08 09:16:38 +0000 +++ tcl.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: tcl.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * === added file 'testing.mak' --- testing.mak 1970-01-01 00:00:00 +0000 +++ testing.mak 2011-03-11 21:16:06 +0000 @@ -0,0 +1,101 @@ +# $Id$ +# +# Copyright (c) 1996-2002, Darren Hiebert +# +# Development makefile for Exuberant Ctags, used to build releases. +# Requires GNU make. + +CTAGS_TEST = ./ctags +CTAGS_REF = ./ctags.ref +TEST_OPTIONS = -nu --c-kinds=+lpx + +DIFF_OPTIONS = -U 0 -I '^!_TAG' +DIFF = if diff $(DIFF_OPTIONS) tags.ref tags.test > $(DIFF_FILE); then \ + rm -f tags.ref tags.test $(DIFF_FILE) ; \ + echo "Passed" ; \ + else \ + echo "FAILED: differences left in $(DIFF_FILE)" ; \ + fi + +.PHONY: test test.include test.fields test.extra test.linedir test.etags test.eiffel test.linux + +test: test.include test.fields test.extra test.linedir test.etags test.eiffel test.linux + +test.%: DIFF_FILE = $@.diff + +REF_INCLUDE_OPTIONS = $(TEST_OPTIONS) --format=1 +TEST_INCLUDE_OPTIONS = $(TEST_OPTIONS) --format=1 +test.include: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing tag inclusion..." + @ $(CTAGS_REF) -R $(REF_INCLUDE_OPTIONS) -o tags.ref Test + @ $(CTAGS_TEST) -R $(TEST_INCLUDE_OPTIONS) -o tags.test Test + @- $(DIFF) + +REF_FIELD_OPTIONS = $(TEST_OPTIONS) --fields=+afmikKlnsSz +TEST_FIELD_OPTIONS = $(TEST_OPTIONS) --fields=+afmikKlnsStz +test.fields: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing extension fields..." + @ $(CTAGS_REF) -R $(REF_FIELD_OPTIONS) -o tags.ref Test + @ $(CTAGS_TEST) -R $(TEST_FIELD_OPTIONS) -o tags.test Test + @- $(DIFF) + +REF_EXTRA_OPTIONS = $(TEST_OPTIONS) --extra=+fq --format=1 +TEST_EXTRA_OPTIONS = $(TEST_OPTIONS) --extra=+fq --format=1 +test.extra: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing extra tags..." + @ $(CTAGS_REF) -R $(REF_EXTRA_OPTIONS) -o tags.ref Test + @ $(CTAGS_TEST) -R $(TEST_EXTRA_OPTIONS) -o tags.test Test + @- $(DIFF) + +REF_LINEDIR_OPTIONS = $(TEST_OPTIONS) --line-directives -n +TEST_LINEDIR_OPTIONS = $(TEST_OPTIONS) --line-directives -n +test.linedir: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing line directives..." + @ $(CTAGS_REF) $(REF_LINEDIR_OPTIONS) -o tags.ref Test/line_directives.c + @ $(CTAGS_TEST) $(TEST_LINEDIR_OPTIONS) -o tags.test Test/line_directives.c + @- $(DIFF) + +REF_ETAGS_OPTIONS = -e +TEST_ETAGS_OPTIONS = -e +test.etags: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing TAGS output..." + @ $(CTAGS_REF) -R $(REF_ETAGS_OPTIONS) -o tags.ref Test + @ $(CTAGS_TEST) -R $(TEST_ETAGS_OPTIONS) -o tags.test Test + @- $(DIFF) + +REF_EIFFEL_OPTIONS = $(TEST_OPTIONS) --format=1 --languages=eiffel +TEST_EIFFEL_OPTIONS = $(TEST_OPTIONS) --format=1 --languages=eiffel +EIFFEL_DIRECTORY = $(ISE_EIFFEL)/library +HAVE_EIFFEL := $(shell ls -dtr $(EIFFEL_DIRECTORY) 2>/dev/null) +ifeq ($(HAVE_EIFFEL),) +test.eiffel: + @ echo "No Eiffel library source found for testing" +else +test.eiffel: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing Eiffel tag inclusion..." + @ $(CTAGS_REF) -R $(REF_EIFFEL_OPTIONS) -o tags.ref $(EIFFEL_DIRECTORY) + @ $(CTAGS_TEST) -R $(TEST_EIFFEL_OPTIONS) -o tags.test $(EIFFEL_DIRECTORY) + @- $(DIFF) +endif + +REF_LINUX_OPTIONS = $(TEST_OPTIONS) --fields=k +TEST_LINUX_OPTIONS = $(TEST_OPTIONS) --fields=k +LINUX_KERNELS_DIRECTORY := +LINUX_DIRECTORY := $(shell find $(LINUX_KERNELS_DIRECTORY) -maxdepth 1 -type d -name 'linux-[1-9]*' 2>/dev/null | tail -1) +ifeq ($(LINUX_DIRECTORY),) +test.linux: + @ echo "No Linux kernel source found for testing" +else +test.linux: $(CTAGS_TEST) $(CTAGS_REF) + @ echo -n "Testing Linux tag inclusion..." + @ $(CTAGS_REF) -R $(REF_LINUX_OPTIONS) -o tags.ref $(LINUX_DIRECTORY) + @ $(CTAGS_TEST) -R $(TEST_LINUX_OPTIONS) -o tags.test $(LINUX_DIRECTORY) + @- $(DIFF) +endif + +TEST_ARTIFACTS = test.*.diff tags.ref tags.test + +clean-test: + rm -f $(TEST_ARTIFACTS) + +# vi:ts=4 sw=4 === modified file 'tex.c' --- tex.c 2009-07-14 15:05:23 +0000 +++ tex.c 2011-03-11 21:16:06 +0000 @@ -53,7 +53,8 @@ KEYWORD_subsubsection, KEYWORD_part, KEYWORD_paragraph, - KEYWORD_subparagraph + KEYWORD_subparagraph, + KEYWORD_include } keywordId; /* Used to determine whether keyword is valid for the token language and @@ -68,27 +69,15 @@ TOKEN_UNDEFINED, TOKEN_CHARACTER, TOKEN_CLOSE_PAREN, - TOKEN_SEMICOLON, - TOKEN_COLON, TOKEN_COMMA, TOKEN_KEYWORD, TOKEN_OPEN_PAREN, - TOKEN_OPERATOR, TOKEN_IDENTIFIER, TOKEN_STRING, - TOKEN_PERIOD, TOKEN_OPEN_CURLY, TOKEN_CLOSE_CURLY, - TOKEN_EQUAL_SIGN, - TOKEN_EXCLAMATION, - TOKEN_FORWARD_SLASH, TOKEN_OPEN_SQUARE, TOKEN_CLOSE_SQUARE, - TOKEN_OPEN_MXML, - TOKEN_CLOSE_MXML, - TOKEN_CLOSE_SGML, - TOKEN_LESS_THAN, - TOKEN_GREATER_THAN, TOKEN_QUESTION_MARK, TOKEN_STAR } tokenType; @@ -118,6 +107,7 @@ TEXTAG_PART, TEXTAG_PARAGRAPH, TEXTAG_SUBPARAGRAPH, + TEXTAG_INCLUDE, TEXTAG_COUNT } texKind; @@ -128,7 +118,8 @@ { TRUE, 'b', "subsubsection", "subsubsections" }, { TRUE, 'p', "part", "parts" }, { TRUE, 'P', "paragraph", "paragraphs" }, - { TRUE, 'G', "subparagraph", "subparagraphs" } + { TRUE, 'G', "subparagraph", "subparagraphs" }, + { TRUE, 'i', "include", "includes" } }; static const keywordDesc TexKeywordTable [] = { @@ -139,7 +130,8 @@ { "subsubsection", KEYWORD_subsubsection }, { "part", KEYWORD_part }, { "paragraph", KEYWORD_paragraph }, - { "subparagraph", KEYWORD_subparagraph } + { "subparagraph", KEYWORD_subparagraph }, + { "include", KEYWORD_include } }; /* @@ -150,7 +142,7 @@ { return (boolean) (isalpha (c) || isdigit (c) || c == '$' || - c == '_' || c == '#'); + c == '_' || c == '#' || c == '-' || c == '.'); } static void buildTexKeywordHash (void) @@ -297,16 +289,11 @@ case EOF: longjmp (Exception, (int)ExceptionEOF); break; case '(': token->type = TOKEN_OPEN_PAREN; break; case ')': token->type = TOKEN_CLOSE_PAREN; break; - case ';': token->type = TOKEN_SEMICOLON; break; case ',': token->type = TOKEN_COMMA; break; - case '.': token->type = TOKEN_PERIOD; break; - case ':': token->type = TOKEN_COLON; break; case '{': token->type = TOKEN_OPEN_CURLY; break; case '}': token->type = TOKEN_CLOSE_CURLY; break; - case '=': token->type = TOKEN_EQUAL_SIGN; break; case '[': token->type = TOKEN_OPEN_SQUARE; break; case ']': token->type = TOKEN_CLOSE_SQUARE; break; - case '?': token->type = TOKEN_QUESTION_MARK; break; case '*': token->type = TOKEN_STAR; break; case '\'': @@ -427,7 +414,8 @@ readToken (token); while (! isType (token, TOKEN_CLOSE_CURLY) ) { - if (isType (token, TOKEN_IDENTIFIER) && useLongName) + /* if (isType (token, TOKEN_IDENTIFIER) && useLongName) */ + if (useLongName) { if (fullname->length > 0) vStringCatS (fullname, " "); @@ -465,7 +453,7 @@ parseTag (token, TEXTAG_SECTION); break; case KEYWORD_subsection: - parseTag (token, TEXTAG_SUBSUBSECTION); + parseTag (token, TEXTAG_SUBSECTION); break; case KEYWORD_subsubsection: parseTag (token, TEXTAG_SUBSUBSECTION); @@ -479,6 +467,9 @@ case KEYWORD_subparagraph: parseTag (token, TEXTAG_SUBPARAGRAPH); break; + case KEYWORD_include: + parseTag (token, TEXTAG_INCLUDE); + break; default: break; } === modified file 'verilog.c' --- verilog.c 2007-09-08 09:16:38 +0000 +++ verilog.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: verilog.c 573 2007-06-26 05:41:27Z elliotth $ +* $Id$ * * Copyright (c) 2003, Darren Hiebert * @@ -232,6 +232,7 @@ c = skipWhite (c); if (c == '=') { + c = skipWhite (vGetc ()); if (c == '{') skipPastMatch ("{}"); else === modified file 'vim.c' --- vim.c 2007-09-08 09:16:38 +0000 +++ vim.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: vim.c 485 2006-10-24 12:06:19Z dfishburn $ +* $Id$ * * Copyright (c) 2000-2003, Darren Hiebert * @@ -362,6 +362,17 @@ if ((int) *cp == '!') ++cp; + if ((int) *cp != ' ') + { + /* + * :command must be followed by a space. If it is not, it is + * not a valid command. + * Treat the line as processed and continue. + */ + cmdProcessed = TRUE; + goto cleanUp; + } + while (*cp && isspace ((int) *cp)) ++cp; } @@ -389,7 +400,7 @@ else if (*cp == '-') { /* - * Read until the next space which sparates options or the name + * Read until the next space which separates options or the name */ while (*cp && !isspace ((int) *cp)) ++cp; === modified file 'vstring.c' --- vstring.c 2007-09-08 09:16:38 +0000 +++ vstring.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: vstring.c 558 2007-06-15 19:17:02Z elliotth $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === modified file 'vstring.h' --- vstring.h 2009-07-14 15:05:23 +0000 +++ vstring.h 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: vstring.h 719 2009-07-07 03:46:59Z dhiebert $ +* $Id$ * * Copyright (c) 1998-2002, Darren Hiebert * === added directory 'website' === added file 'website/.cvsignore' --- website/.cvsignore 1970-01-01 00:00:00 +0000 +++ website/.cvsignore 2011-03-11 21:16:06 +0000 @@ -0,0 +1,4 @@ +index.html +news.html +ctags.html +EXTENDING.html === added file 'website/FORMAT' --- website/FORMAT 1970-01-01 00:00:00 +0000 +++ website/FORMAT 2011-03-11 21:16:06 +0000 @@ -0,0 +1,348 @@ +$Id$ + +Proposal for extended Vi tags file format +========================================= + +Version: 0.06 DRAFT + Date: 1998 Feb 8 + Author: Bram Moolenaar + and: Darren Hiebert + + +1. Introduction +--------------- + +The file format for the "tags" file, as used by Vi and many of its +descendants, has limited capabilities. + +This additional functionality is desired: + +1. Static or local tags. + The scope of these tags is the file where they are defined. The same tag + can appear in several files, without really being a duplicate. +2. Duplicate tags. + Allow the same tag to occur more then once. They can be located in + a different file and/or have a different command. +3. Support for C++. + A tag is not only specified by its name, but also by the context (the + class name). +4. Future extension. + When even more additional functionality is desired, it must be possible to + add this later, whithout breaking programs that don't support it. + + +2. From proposal to standard +---------------------------- + +To make this proposal into a standard for tags files, it needs to be supported +by most people working on versions of Vi, ctags, etc.. Currently this +standard is supported by: + +Darren Hiebert Exuberant ctags +Bram Moolenaar Vim (Vi IMproved) + +These have been or will be asked to support this standard: + +Nvi Keith Bostic +Vile Tom E. Dickey +NEdit Mark Edel +CRiSP Paul Fox +Lemmy James Iuliano +Zeus Jussi Jumppanen +Elvis Steve Kirkendall +FTE Marko Macek + + +3. Backwards compatibility +-------------------------- + +A tags file that is generated in the new format should still be usable by Vi. +This makes it possible to distribute tags files that are usable by all +versions and descendants of Vi. + +This restricts the format to what Vi can handle. The format is: + +1. The tags file is a list of lines, each line in the format: + + {tagname}{tagfile}{tagaddress} + + {tagname} Any identifier, not containing white space.. + Exactly one TAB character (although many versions of Vi can + handle any amount of white space). + {tagfile} The name of the file where {tagname} is defined, relative to + the current directory (or location of the tags file?). + {tagaddress} Any Ex command. When executed, it behaves like 'magic' was + not set. + +2. The tags file is sorted on {tagname}. This allows for a binary search in + the file. + +3. Duplicate tags are allowed, but which one is actually used is + unpredictable (because of the binary search). + +The best way to add extra text to the line for the new functionality, without +breaking it for Vi, is to put a comment in the {tagaddress}. This gives the +freedom to use any text, and should work in any traditional Vi implementation. + +For example, when the old tags file contains: + + main main.c /^main(argc, argv)$/ + DEBUG defines.c 89 + +The new lines can be: + + main main.c /^main(argc, argv)$/;"any additional text + DEBUG defines.c 89;"any additional text + +Note that the ';' is required to put the cursor in the right line, and then +the '"' is recognized as the start of a comment. + +For Posix compliant Vi versions this will NOT work, since only a line number +or a search command is recognized. I hope Posix can be adjusted. Nvi suffers +from this. + + +4. Security +----------- + +Vi allows the use of any Ex command in a tags file. This has the potential of +a trojan horse security leak. + +The proposal is to allow only Ex commands that position the cursor in a single +file. Other commands, like editing another file, quitting the editor, +changing a file or writing a file, are not allowed. It is therefore logical +to call the command a tagaddress. + +Specifically, these two Ex commands are allowed: +- A decimal line number. + 89 +- A search command. It is a regular expression pattern, as used by Vi, + enclosed in // or ??. + /^int c;$/ + ?main()? + +There are two combinations possible: +- Concatenation of the above, with ';' in between. The meaning is that the + first line number or search command is used, the cursor is positioned in + that line, and then the second search command is used (a line number would + not be useful). This can be done multiple times. This is useful when the + information in a single line is not unique, and the search needs to start + in a specified line. + /struct xyz {/;/int count;/ + 389;/struct foo/;/char *s;/ +- A trailing comment can be added, starting with ';"' (two characters: + semi-colon and double-quote). This is used below. + 89;" foo bar + +This might be extended in the future. What is currently missing is a way to +position the cursor in a certain column. + + +5. Goals +-------- + +Now the usage of the comment text has to be defined. The following is aimed +at: + +1. Keep the text short, because: + - The line length that Vi can handle is limited to 512 characters. + - Tags files can contain thousands of tags. I have seen tags files of + several Mbytes. + - More text makes searching slower. +2. Keep the text readable, because: + - It is often necessary to check the output of a new ctags program. + - Be able to edit the file by hand. + - Make it easier to write a program to produce or parse the file. +3. Don't use special characters, because: + - It should be possible to treat a tags file like any normal text file. + + +6. Proposal +----------- + +Use a comment after the {tagaddress} field. The format would be: + + {tagname}{tagfile}{tagaddress}[;"{tagfield}..] + + {tagname} Any identifier, not containing white space.. + Exactly one TAB character (although many versions of Vi can + handle any amount of white space). + {tagfile} The name of the file where {tagname} is defined, relative to + the current directory (or location of the tags file?). + {tagaddress} Any Ex command. When executed, it behaves like 'magic' was + not set. It may be restricted to a line number or a search + pattern (Posix). +Optionally: + ;" semicolon + doublequote: Ends the tagaddress in way that looks + like the start of a comment to Vi. + {tagfield} See below. + +A tagfield has a name, a colon, and a value: "name:value". +- The name consist only out of alphabetical characters. Upper and lower case + are allowed. Lower case is recommended. Case matters ("kind:" and "Kind: + are different tagfields). +- The value may be empty. + It cannot contain a . + When a value contains a "\t", this stands for a . + When a value contains a "\r", this stands for a . + When a value contains a "\n", this stands for a . + When a value contains a "\\", this stands for a single '\' character. + Other use of the backslash character is reserved for future expansion. + Warning: When a tagfield value holds an MS-DOS file name, the backslashes + must be doubled! + + +Proposed tagfield names: + +FIELD-NAME DESCRIPTION + +arity Number of arguments for a function tag. + +class Name of the class for which this tag is a member or method. + +enum Name of the enumeration in which this tag is an enumerator. + +file Static (local) tag, with a scope of the specified file. When + the value is empty, {tagfile} is used. + +function Function in which this tag is defined. Useful for local + variables (and functions). When functions nest (e.g., in + Pascal), the function names are concatenated, separated with + '/', so it looks like a path. + +kind Kind of tag. The value depends on the language. For C and + C++ these kinds are recommended: + c class name + d define (from #define XXX) + e enumerator + f function or method name + F file name + g enumeration name + m member (of structure or class data) + p function prototype + s structure name + t typedef + u union name + v variable + When this field is omitted, the kind of tag is undefined. + +struct Name of the struct in which this tag is a member. + +union Name of the union in which this tag is a member. + + +Note that these are mostly for C and C++. When tags programs are written for +other languages, this list should be extended to include the used field names. +This will help users to be independent of the tags program used. + +Examples: + + asdf sub.cc /^asdf()$/;" new_field:some\svalue file: + foo_t sub.h /^typedef foo_t$/;" kind:t + func3 sub.p /^func3()$/;" function:/func1/func2 file: + getflag sub.c /^getflag(arg)$/;" kind:f file: + inc sub.cc /^inc()$/;" file: class:PipeBuf + + +The name of the "kind:" field can be omitted. This is to reduce the size of +the tags file by about 15%. A program reading the tags file can recognize the +"kind:" field by the missing ':'. Examples: + + foo_t sub.h /^typedef foo_t$/;" t + getflag sub.c /^getflag(arg)$/;" f file: + + +Additional remarks: +- When a tagfield appears twice in a tag line, only the last one is used. + + +Note about line separators: + +Vi traditionally runs on Unix systems, where the line separator is a single +linefeed character . On MS-DOS and compatible systems is the +standard line separator. To increase portability, this line separator is also +supported. + +On the Macintosh a single is used for line separator. Supporting this on +Unix systems causes problems, because most fgets() implementation don't see +the as a line separator. Therefore the support for a as line +separator is limited to the Macintosh. + +Summary: +line separator generated on accepted on + Unix Unix, MS-DOS, Macintosh + Macintosh Macintosh + MS-DOS Unix, MS-DOS, Macintosh + +The characters and cannot be used inside a tag line. This is not +mentioned elsewhere (because it's obvious). + + +Note about white space: + +Vi allowed any white space to separate the tagname from the tagfile, and the +filename from the tagaddress. This would need to be allowed for backwards +compatibility. However, all known programs that generate tags use a single + to separate fields. + +There is a problem for using file names with embedded white space in the +tagfile field. To work around this, the same special characters could be used +as in the new fields, for example "\s". But, unfortunately, in MS-DOS the +backslash character is used to separate file names. The file name +"c:\vim\sap" contains "\s", but this is not a . The number of +backslashes could be doubled, but that will add a lot of characters, and make +parsing the tags file slower and clumsy. + +To avoid these problems, we will only allow a to separate fields, and +not support a file name or tagname that contains a character. This +means that we are not 100% Vi compatible. However, there is no known tags +program that uses something else than a to separate the fields. Only +when a user typed the tags file himself, or made his own program to generate a +tags file, we could run into problems. To solve this, the tags file should be +filtered, to replace the arbitrary white space with a single . This Vi +command can be used: + + :%s/^\([^ ^I]*\)[ ^I]*\([^ ^I]*\)[ ^I]*/\1^I\2^I/ + +(replace ^I with a real ). + + +TAG FILE INFORMATION: + +Psuedo-tag lines can be used to encode information into the tag file regarding +details about its content (e.g. have the tags been sorted?, are the optional +tagfields present?), and regarding the program used to generate the tag file. +This information can be used both to optimize use of the tag file (e.g. +enable/disable binary searching) and provide general information (what version +of the generator was used). + +The names of the tags used in these lines may be suitably chosen to ensure +that when sorted, they will always be located near the first lines of the tag +file. The use of "!_TAG_" is recommended. Note that a rare tag like "!" +can sort to before these lines. The program reading the tags file should be +smart enough to skip over these tags. + +The lines described below have been chosen to convey a select set of +information. + +Tag lines providing information about the content of the tag file: + +!_TAG_FILE_FORMAT {version-number} /optional comment/ +!_TAG_FILE_SORTED {0|1} /0=unsorted, 1=sorted/ + +The {version-number} used in the tag file format line reserves the value of +"1" for tag files complying with the original UNIX vi/ctags format, and +reserves the value "2" for tag files complying with this proposal. This value +may be used to determine if the extended features described in this proposal +are present. + +Tag lines providing information about the program used to generate the tag +file, and provided solely for documentation purposes: + +!_TAG_PROGRAM_AUTHOR {author-name} /{email-address}/ +!_TAG_PROGRAM_NAME {program-name} /optional comment/ +!_TAG_PROGRAM_URL {URL} /optional comment/ +!_TAG_PROGRAM_VERSION {version-id} /optional comment/ + + +[End Of Document] === added file 'website/countries.html' --- website/countries.html 1970-01-01 00:00:00 +0000 +++ website/countries.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,67 @@ + + + +Exuberant Ctags: Country List + + + +

    Countries Where Exuberant Ctags is Used

    + +
      +
    1. Argentina [AR]
    2. +
    3. Australia [AU]
    4. +
    5. Austria [AT]
    6. +
    7. Belarus [BY]
    8. +
    9. Belgium [BE]
    10. +
    11. Brazil [BR]
    12. +
    13. Brunei [BN]
    14. +
    15. Canada [CA]
    16. +
    17. China [CN]
    18. +
    19. Cyprus [CY]
    20. +
    21. Czech Republic [CZ]
    22. +
    23. Denmark [DK]
    24. +
    25. Estonia [EE]
    26. +
    27. Finland [FI]
    28. +
    29. France [FR]
    30. +
    31. Germany [DE]
    32. +
    33. Greece [GR]
    34. +
    35. Hong Kong [HK]
    36. +
    37. Hungary [HU]
    38. +
    39. Iceland [IS]
    40. +
    41. India [IN]
    42. +
    43. Ireland [IE]
    44. +
    45. Israel [IL]
    46. +
    47. Italy [IT]
    48. +
    49. Japan [JP]
    50. +
    51. Korea [KR]
    52. +
    53. Lithuania [LT]
    54. +
    55. Luxembourg [LU]
    56. +
    57. Malaysia [MY]
    58. +
    59. Netherlands [NL]
    60. +
    61. New Zealand [NZ]
    62. +
    63. Norway [NO]
    64. +
    65. Peru [PE]
    66. +
    67. Poland [PL]
    68. +
    69. Portugal [PT]
    70. +
    71. Romania [RO]
    72. +
    73. Russian Federation [RU]
    74. +
    75. Singapore [SG]
    76. +
    77. Slovenia [SI]
    78. +
    79. South Africa [ZA]
    80. +
    81. Soviet Union [SU]
    82. +
    83. Spain [ES]
    84. +
    85. Sri Lanka [LK]
    86. +
    87. Sweden [SE]
    88. +
    89. Switzerland [CH]
    90. +
    91. Turkey [TR]
    92. +
    93. Ukraine [UA]
    94. +
    95. United Kingdom [UK]
    96. +
    97. United States [US]
    98. +
    99. Vietnam [VN]
    100. +
    + +
    +Back to Exuberant Ctags + + + === added file 'website/ctags.png' Binary files website/ctags.png 1970-01-01 00:00:00 +0000 and website/ctags.png 2011-03-11 21:16:06 +0000 differ === added file 'website/ctags.xcf' Binary files website/ctags.xcf 1970-01-01 00:00:00 +0000 and website/ctags.xcf 2011-03-11 21:16:06 +0000 differ === added file 'website/desire.html' --- website/desire.html 1970-01-01 00:00:00 +0000 +++ website/desire.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,74 @@ + + + +Exuberant Ctags: Why? + + + +

    What makes this implementation of ctags desirable?

    + +
      + +

      +

    1. +Supports many programming languages. +
    2. +

      + +

      +

    3. It is capable of generating tags for all types + of C/C++ language tags, including all of the following: +

      +

      +
    4. class names +
    5. macro definitions +
    6. enumeration names +
    7. enumerators +
    8. function definitions +
    9. function prototypes/declarations +
    10. class, interface, struct, and union data members +
    11. structure names +
    12. typedefs +
    13. union names +
    14. variables (definitions and external declarations) +
    15. +
    16. +

      + +

      +

    17. It is far less easily fooled by C code containing #if + preprocessor conditional constructs, using a conditional path selection + algorithm to resolve complicated choices, and a fall-back algorithm when + this one fails. +
    18. +

      + +

      +

    19. Supports user-defined languages, using regular expressions. +
    20. +

      + +

      +

    21. Supports output of Emacs-style TAGS files. +
    22. +

      + +

      +

    23. Can also be used to print out a list of selected objects found in source + files. +
    24. +

      + +

      +

    25. Compiles on UNIX, MSDOS, Windows 95/98/NT, OS/2, QNX, Amiga, QDOS, VMS, + Macintosh, and Cray. +
    26. +

      + +
    + +
    +Back to Exuberant Ctags + + + === added file 'website/faq.html' --- website/faq.html 1970-01-01 00:00:00 +0000 +++ website/faq.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,567 @@ + + + + +Exuberant Ctags FAQ + + + +

    Exuberant Ctags FAQ

    + + + +
    +

    + +1. Why do you call it Exuberant Ctags? + +

    + +Because one of the meanings of the word exuberant is: +
      +ex·u·ber·ant : produced in extreme abundance +: PLENTIFUL   +synonym see PROFUSE +
    + +Compare the tag file produced by Exuberant Ctags +with that produced by any other ctags and you will see how appropriate the +name is. + +
    +

    + +2. Why doesn't my editor work with these tag files? + +

    + +

    + +3. What are these strange bits of text beginning with ;" which +follow many of the lines in the tag file? + +

    + +These are "extension flags". They are added in order to provide extra +information about the tag that may be utilized by the editor in order to +more intelligently handle tags. They are appended to the EX command part of +the tag line in a manner that provides backwards compatibility with existing +implementations of the Vi editor. The semicolon is an EX command separator +and the double quote begins an EX comment. Thus, the extension flags appear +as an EX comment and should be ignored by the editor when it processes the +EX command. +

    +Some non-vi editors, however, implement only the bare minimum of EX commands +in order to process the search command or line number in the third field of +the tag file. If you encounter this problem, use the option +--format=1 to generate a tag file without these extensions +(remember that you can set the CTAGS environment variable to any +default arguments you wish to supply). Then ask the supplier of your editor to +implement handling of this feature of EX commands. +

    + +


    +

    + +4. Why doesn't XEmacs' Speedbar module work with Exuberant +Ctags? + +

    + +The default command line switches used by XEmacs for etags are not +compatible with Exuberant Ctags options. By default, +Exuberant Ctags installs a symbolic link, "etags", +pointing to the ctags executable. When Exuberant +Ctags is started with the name "etags", it produces Emacs-style +tag files by default. +

    +To fix this, add the following lines to your .emacs file, replacing the path +to etags with the path where the symbolic link was installed. +

    + + +

    +(autoload 'speedbar "speedbar")
    +(setq speedbar-fetch-etags-command "/usr/local/bin/etags"
    +      speedbar-fetch-etags-arguments '("-f" "-"))
    +
    + + +
    +

    + +5. Why doesn't XEmacs correctly locate the tag in the source file? + +

    + +This has been observed with version 20.3. It seems that when XEmacs searches +for a tag, it searches using the tag name instead of the search string located +in the TAGS file. This is a bug in XEmacs and does not occur in the GNU +version of Emacs. This has been reported to be corrected as of version 21.4.16. + +
    +

    + +6. Why doesn't NEdit correctly locate the tag in the source file? + +

    + +Versions of NEdit prior to 5.1 did not support +the extended tag file format generated by Exuberant +Ctags by default. Either upgrade to version 5.1 or specify the +option --format=1 when running ctags to output the old tag file +format. +

    + +


    +

    + +7. Why can't I jump to class::member? + +

    + +Because, by default, ctags only generates tags for the separate identifiers +found in the source files. If you specify the --extra=+q +option, then ctags will also generate a second, class-qualified tag for each +class member (data and function/method) in the form class::member +for C++, and in the form class.method for Eiffel and Java. +

    + +


    +

    + +8. How can I avoid having to specify my favorite option every time? + +

    + +Either by setting the environment variable CTAGS to your custom +options, or putting them into a .ctags file in your home +directory. +

    + +


    +

    + +9. Why do I end up on the wrong line when I jump to a tag? + +

    + +By default, ctags encodes the line number in the file where macro (#define) +tags are found. This was done to remain compatible with the original UNIX +version of ctags. If you change the file containing the tag without +rebuilding the tag file, the location of tag in the tag file may no longer +match the current location. +

    + +In order to avoid this problem, you can specify the option +--excmd=p, which causes ctags to use a search pattern to locate +macro tags. I have never uncovered the reason why the original UNIX ctags used +line numbers exclusively for macro tags, but have so far resisted changing the +default behaviour of Exuberant Ctags to behave +differently. +

    + +


    +

    + +10. How do I jump to the tag I want instead of the wrong one by the same name? + +

    + +A tag file is simple a list of tag names and where to find them. If there +are duplicate entries, you often end up going to the wrong one because the +tag file is sorted and your editor locates the first one in the tag file. +

    + +Standard Vi provides no facilities to alter this behavior. However, Vim +has some nice features to minimize this problem, primarly by examining all +matches and choosing the best one under the circumstances. Vim also provides +commands which allow for selection of the desired matching tag. +

    + +


    +

    + +11. What is Vim? + +

    + +Vim is a vi-compatible editor available as source and compilable for any +platform. Yeah, I know the first reaction is to shy away from this. But you +will never regret getting it, and you will become greatly attached to its +features, which you can learn gradually. I would be willing to say that it +is the best vi-clone available within 4 light-years of Alpha Centauri. It +works (nearly) exactly like standard vi, but provides some incredibly useful +extensions (some of which I have participated in designing with the author). +Most Linux distributions have adopted Vim as its standard vi. +

    + +


    +

    + +12. How can I locate all references to a specific function or variable? + +

    + +There are several packages already available which provide this capability. +As of this writing, they are: + + + +
    +

    + +13. Why does appending tags to a tag file tag so long? + +

    + +Sometimes, in an attempt to build a global tag file for all source files in +a large source tree of many directories, someone will make an attempt to run +ctags in append (-a) mode on every directory in the hierarchy. Each time +ctags is invoked, its default behavior is to sort the tag file once the tags +for that pass have been added. As the cumulative tag file grows, the sort +time increases exponentially. +

    + +The best way to avoid this problem (and the most efficient) is to make +use of the --recurse (or -R) option of ctags by executing the following +command in the root of the directory hierarchy (thus running ctags only once): +

    + + +

    +        ctags -R
    +
    + + +If you really insist on running ctags separately on each directory, you can +avoid the sort pass each time by specifying the option --sort=no. +Once the tag file is completely built, use the sort command to manually sort +the final tag file, or let the final invocation of ctags sort the file. +

    + +


    +

    + +14. How do I get regex support for Win32? + +

    + +You need to download the GNU regex package for Win32 from the following +location: + +
    + + http://people.delphiforums.com/gjc/gnu_regex.html +
    + +Then point the makefile macro, REGEX_DIR, found in mk_mvc.mak and mk_bc5.mak, +to the directory created by extracting this archive. + +
    +

    + +15. How should I set up tag files for a multi-level directory hierarchy? + +

    + +There are a few ways of approaching this: +

    + +

      +
    1. A local tag file in each directory containing only the tags for source + files in that directory. + +
    2. One single big, global tag file present in the root directory of your + hierarchy, containing all tags present in all source files in the + hierarchy. + +
    3. A local tag file in each directory containing only the tags for source + files in that directory, in addition to one single global tag file + present in the root directory of your hierarchy, containing all + non-static tags present in all source files in the hierarchy. + +
    4. A local tag file in each directory of the hierarchy, each one + containing all tags present in source files in that directory and all + non-static tags in every directory below it (note that this implies + also having one big tag file in the root directory of the hierarchy). +
    + +Each of these approaches has its own set of advantages disadvantages, +depending upon your particular conditions. Which approach is deemed best +depends upon the following factors: +

    + +

      +
    1. The ability of your editor to use multiple tag files. +

      + + If your editor cannot make use of multiple tag files (original vi + implementations could not), then one large tag file is the only way to + go if you ever desire to jump to tags located in other directories. If + you never need to jump to tags in another directory (i.e. the source + in each directory is entirely self-contained), then a local tag file + in each directory will fit your needs. +

      + +

    2. The time is takes for your editor to look up a tag in the tag file. +

      + + The significance of this factor depends upon the size of your source + tree and on whether the source files are located on a local or remote + file system. For source and tag files located on a local file system, + looking up a tag is not as big a hit as one might first imagine, since + vi implementations typically perform a binary search on a sorted tag + file. This may or may not be true for the editor you use. For files + located on a remote file system, reading a large file is an expensive + operation. +

      + +

    3. Whether or not you expect the source code to change and the time it + takes to rebuild a tag file to account for changes to the source code. +

      + + While Exuberant Ctags is particularly fast in + scanning source code (around 1-2 MB/sec), a large project may still result + in objectionable delays if one wishes to keep their tag file(s) up to date + on a frequent basis, or if the files are located on a remote file system. +

      + +

    4. The presence of duplicate tags in the source code and the ability to + handle them. The impact of this factor is influenced by the following + three issues: +

      + + 1. How common are duplicate tags in your project? +

      + + 2. Does your editor provide any facilities for dealing with duplicate + tags? +

      + + While standard vi does not, many modern vi implementations, such + as Vim have good facilities for selecting the desired match from + the list of duplicates. If your editor does not support duplicate + tags, then it will typically send you to only one of them, whether + or not that is the one you wanted (and not even notifying you that + there are other potential matches). +

      + + 3. What is the significance of duplicate tags? +

      + + For example, if you have two tags of the same name from entirely + isolated software components, jumping first to the match found + in component B while working in component A may be entirely + misleading, distracting or inconvenient (to keep having to choose + which one if your editor provides you with a list of matches). + However, if you have two tags of the same name for parallel builds + (say two initialization routines for different hosts), you may + always want to specify which one you want. +

    + +Of the approaches listed above, I tend to favor Approach 3. My editor of +choice is Vim, which provides a rich set of features for handling multiple +tag files, which partly influences my choice. If you are working with +source files on a remote file system, then I would recommend either +Approach 3 or Approach 4, depending upon the hit when reading the global +tag file. +

    + +The advantages of Approach 3 are many (assuming that your editor has +the ability to support both multiple tag files and duplicate tags). All +lookups of tag located in the currect directory are fast and the local +tag file can be quickly and easily regenerated in one second or less +(I have even mapped a keystroke to do this easily). A lookup of a +(necessarily non-static) tag found in another directory fails a lookup in +the local tag file, but is found in the global tag file, which satisfies +all cross-directory lookups. The global tag file can be automatically +regenerated periodically with a cron job (and perhaps the local tag files +also). +

    + +Now I give an example of how you would implement Approach 3. Means of +implementing the other approaches can be performed in a similar manner. +

    + +Here is a visual representation of an example directory hierarchy: +

    + + +

    +project
    +  `-----misccomp
    +  |       `...
    +  `-----sysint
    +          `-----client
    +          |       `-----hdrs
    +          |       `-----lib
    +          |       `-----src
    +          |       `-----test
    +          `-----common
    +          |       `-----hdrs
    +          |       `-----lib
    +          |       `-----src
    +          |       `-----test
    +          `-----server
    +                  `-----hdrs
    +                  `-----lib
    +                  `-----src
    +                  `-----test
    +
    + + +Here is a recommended solution (conceptually) to build the tag files: +

    + +

      +
    1. Within each of the leaf nodes (i.e. hdrs, lib, src, test) build a tag + file using "ctags *.[ch]". This can be easily be done for the whole + hierarchy by making a shell script, call it "dirtags", containing the + following lines: + + +
      +        #!/bin/sh
      +	cd $1
      +	ctags *
      +
      +
      + + Now execute the following command: + + +
      +        find * -type d -exec dirtags {} \;
      +
      +
      + + These tag files are trivial (and extremely quick) to rebuild while + making changes within a directory. The following Vim key mapping is + quite useful to rebuild the tag file in the directory of the current + source file: + + +
      +        :nmap ,t :!(cd %:p:h;ctags *.[ch])&
      +
      +
      + +
    2. Build the global tag file: + + +
      +        cd ~/project
      +        ctags --file-scope=no -R
      +
      +
      + + thus constructing a tag file containing only non-static tags for all + source files in all descendent directories. + +
    3. Configure your editor to read the local tag file first, then consult + the global tag file when not found in the local tag file. In Vim, + this is done as follows: + + :set tags=./tags,tags,~/project/tags + +
    + +If you wish to implement Approach 4, you would need to replace the +"dirtags" script of step 1 with the following: +

    + + +

    +        #!/bin/sh
    +	cd $1
    +	ctags *
    +	# Now append the non-static tags from descendent directories
    +	find * -type d -prune -print | ctags -aR --file-scope=no -L-
    +
    + + +And replace the configuration of step 3 with this: +

    + + +

    +        :set tags=./tags,./../tags,./../../tags,./../../../tags,tags
    +
    + + +As a caveat, it should be noted that step 2 builds a global tag file whose +file names will be relative to the directory in which the global tag file +is being built. This takes advantage of the Vim 'tagrelative' option, +which causes the path to be interpreted a relative to the location of the +tag file instead of the current directory. For standard vi, which always +interprets the paths as relative to the current directory, we need to +build the global tag file with absolute path names. This can be +accomplished by replacing step 2 with the following: +

    + + +

    +        cd ~/project
    +	ctags --file-scope=no -R `pwd`
    +
    + + +

    +


    +Back to Exuberant Ctags + + + === added file 'website/gpl.html' --- website/gpl.html 1970-01-01 00:00:00 +0000 +++ website/gpl.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,400 @@ + + + +The GNU General Public License + + + +
    +

    The GNU General Public License +

    +
    +

    +
    +

    +Version 2, June 1991 + +

    +
    +
    +© Copyright 1989, 1991 +Free Software Foundation, Inc. + +
    +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +
    +

    +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +

    +
    + Preamble +
    +

    +

    + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. +

    + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

    + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

    + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

    + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

    + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

    + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

    + The precise terms and conditions for copying, distribution and +modification follow. +

    +

    +
    + GNU GENERAL PUBLIC LICENSE +
    + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +
    +

    +

    + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". +

    +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

    + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. +

    +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

    + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: +

    +

      + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. +

      + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. +

      + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +

    +

    +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +

    +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

    +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

    + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: +

    +

      + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, +

      + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, +

      + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) +

    +

    +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

    +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +

    + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. +

    + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. +

    + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. +

    + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. +

    +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

    +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

    +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +

    + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. +

    + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. +

    +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

    + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. +

    +

    +
    + NO WARRANTY +
    +

    +

    + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +

    + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +

    + END OF TERMS AND CONDITIONS +

    + How to Apply These Terms to Your New Programs +

    + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

    + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. +

    + +

      + <one line to give the program's name and a brief idea of what it does.> +
      + Copyright (C) 19yy <name of author> +

      + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. +

      + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +

      + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +

      +

    + + +Also add information on how to contact you by electronic and paper mail. +

    +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

    + +

      + Gnomovision version 69, Copyright (C) 19yy name of author +
      + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. +
      + This is free software, and you are welcome to redistribute it +
      + under certain conditions; type `show c' for details. +
    + +

    +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. +

    +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: +

    + +

      + Yoyodyne, Inc., hereby disclaims all copyright interest in the program +
      + `Gnomovision' (which makes passes at compilers) written by James Hacker. +

      + <signature of Ty Coon>, 1 April 1989 +
      + Ty Coon, President of Vice +

    + +

    +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +

    + + + === added file 'website/languages.html' --- website/languages.html 1970-01-01 00:00:00 +0000 +++ website/languages.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,60 @@ + + + +Languages Supported by Exuberant Ctags + + + +

    +Languages Supported by Exuberant Ctags: +

    +
      +
    1. Ant
    2. +
    3. Assembler
    4. +
    5. ASP
    6. +
    7. Awk
    8. +
    9. BASIC
    10. +
    11. BETA
    12. +
    13. C
    14. +
    15. C++
    16. +
    17. C#
    18. +
    19. COBOL
    20. +
    21. DOS Batch
    22. +
    23. Eiffel
    24. +
    25. Erlang
    26. +
    27. Flex
    28. +
    29. Fortran
    30. +
    31. HTML
    32. +
    33. Java
    34. +
    35. JavaScript
    36. +
    37. Lisp
    38. +
    39. Lua
    40. +
    41. Make
    42. +
    43. MATLAB
    44. +
    45. Objective Caml
    46. +
    47. Pascal
    48. +
    49. Perl
    50. +
    51. PHP
    52. +
    53. PL/SQL
    54. +
    55. Python (Pyrex/Cython)
    56. +
    57. REXX
    58. +
    59. Ruby
    60. +
    61. Scheme
    62. +
    63. Shell scripts (Bourne/Korn/Z)
    64. +
    65. S-Lang
    66. +
    67. SML (Standard ML)
    68. +
    69. Tcl
    70. +
    71. TeX
    72. +
    73. Vera
    74. +
    75. Verilog
    76. +
    77. VHDL
    78. +
    79. Vim
    80. +
    81. YACC
    82. +
    + +
    +Back to Exuberant Ctags + + + + === added file 'website/lg18-wkndmech.html' --- website/lg18-wkndmech.html 1970-01-01 00:00:00 +0000 +++ website/lg18-wkndmech.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,47 @@ + + + +Linux Weekend Mechanic - June 1997 + + + +
    +

    +Published +in the June 1997 +Issue of the Linux GazetteTM

    + +Copyright © 1997 John M. Fisk <fiskjm@ctrvax.vanderbilt.edu>
    +The Linux Gazette is Copyright © 1997 +Specialized Systems Consultants Inc. +
    +
    + +
    +
    +

    + +I've been using Exuberant Ctags, version 1.5, by Darren Hiebert for the +past little bit now and really like this a lot. As the name implies, it does +a pretty thorough job of scouring your source files for all sorts of useful +stuff -- function declarations, typedefs, enum's, variable declarations, macro +definitions, enum/struct/union tags, external function prototypes, and so +forth. It continues on in the time honored tradition of providing a bazillion +options, but not to fear: it's default behavior is sane and savvy and +provides a very nice OOBE*. +

    + +

    +*(Out Of Box Experience) +

    + +

    +...This one is definitely worth having. +

    + +

    +


    +Back to Exuberant Ctags + + + === added file 'website/quotes.html' --- website/quotes.html 1970-01-01 00:00:00 +0000 +++ website/quotes.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,885 @@ + + + +Exuberant Ctags: Feedback + + + +

    Exuberant Ctags User Feedback

    + +
      + +
    • 23 Jul 2004 +

      + Exuberant ctags is incredible! It is making my life so much easier. I + told my friends about it and they love it too. +

      +

      + Thank-you! +

      +
    • + +
    • 11 Jan 2004 +

      + I've been extending support for the D programming language (you gave me a + diff a while back) and going over this code its the cleanest C-code I've + ever seen! Adding support is a breeze , they should use this code to + teach :). Mas limpio amigo. +

      +
    • + +
    • 13 Aug 2003 +

      + I want to thank you for the support and also say that your ctags is a very + good tool. I haven't seen any other similiar free software yet that's + nearly as clean and useful for this problem. +

      +
    • + +
    • 20 Mar 2003 +

      + Ctags is great and i've been using it for years in c/c++ projects. +

      +
    • + +
    • 17 Mar 2003 +

      + Every since I have started working on a large C++ application + (over 600 src files) I have become a devoted user of ctags. +

      +
    • + +
    • 30 Jan 2003 +

      + Hi Darren, congratulations on ctags! It's a wonderful tool. +

      +
    • + +
    • 14 Nov 2002 +

      + I am using ctags in my development since a long time. And I am addicted to + its use. +

      +
    • + +
    • 13 Nov 2002 +

      + Thank you for writing ctags! Ever since I started using ctags together + with vim a couple of weeks ago to keep track of the sources we're writing, + it's become nearly indispensable. Instead of grepping through sources to + find where subroutines are defined, I can just double-click on an + identifier and jump to the right place. Then Ctrl+T takes me back to where + I was. +

      + +

      + All this only possible because of tags files... and ctags is configurable + enough that it can parse not only C but also such things as JAM screens in + ASCII format or our programs' message file format. And because the source + was available, I could hack it to recognise the brand of Fortran that is + in use in the legacy code we maintain... the default Fortran mode didn't + work (probably because of extensions in the implementation). +

      +
    • + +
    • 23 Sep 2002 +

      + Thanks for the fix - very quick!! Ctags is a great tool, and the support + is impressive :) +

      +
    • + +
    • 28 Aug 2002 +

      + Thank you (and all those who helped you) for a wonderful + program. I have used it _many_ times to navigate through c/c++ + code (using vim) and was very pleased to learn today that it + supports python code too (if only I had learned this 3 years ago + ... oh well ). +

      +
    • + +
    • 2 Mar 2002 +

      + Great work on ctags, I use it everyday and is an invaluable tool to a + programmer. +

      +
    • + +
    • 14 Nov 2001 +

      + I really like the Exuberant Ctags program. We [are] all indebted to + Darren Hiebert for providing us with such a fine program. +

      +
    • + +
    • 5 Nov 2001 +

      + CTags is great. I use it all the time now, and I + have no idea how I got by without it before. +

      +
    • + +
    • 3 Nov 2001 +

      + First of all, let me thank you for Exuberant Ctags. I use this on a daily + basis and couldn't imagine life without it. +

      +
    • + +
    • 23 Oct 2001 +

      + Hello! I've been a devout user of ctags for the + past 4 years - thanks for a great program! +

      +
    • + +
    • 7 Jul 2001 +

      + Ctags is an absolutely amazing program now thanks to you. +

      +

      [Australia]

      +
    • + +
    • 22 Jun 2001 +

      + Your Ctags is by far the best ctags around. +

      +
    • + +
    • 29 May 2001 +

      + Hi, I just wanted to let you know how much I appreciate your ctags + implementation. I have used it for a few months now, and I can safely say + it rocks! I have introduced it to everyone at work, and we're all ecstatic + about it. People use it for Java, ASP, JavaScript and SQL development. + Thanks to the ingenious plug-and-play support for adding parsers, I had no + trouble adding parsers for JavaScript and SQL.... +

      +

      + CTags is now one of the programs I could not survive without, so once + again, a big thank you! +

      +

      [Norway]

      +
    • + +
    • 15 Apr 2001 +

      + BTW very impressive tool - I started using it with vim at work after + seeing the 5.0 announcement and have found it a "must have". +

      +

      [United Kingdom]

      +
    • + +
    • 27 Feb 2001 +

      + I want to thank you again for ctags. It keeps getting better and better; + I get so used to the development environment made possible by tags in our + C source, it's a blessing to be able to use the same habits whether it's + C, perl, shell, or whatever. +

      + +
    • 2 Feb 2001 +

      + Couldn't live w/o ctags. I don't know how I went so long without it. +

      + +
    • 26 Sep 2000 +

      + In a new job and new to Unix, I was afraid I would have to write my own + source analysis tools. Disappointed that the default version of ctags failed + to properly identify the oddly formatted function definitions in my source I + was thrilled to find your Exuberant Ctags! The clouds have parted and the + sun is peeking through. +

      + +

      + Thank you for your kind contribution to the free software library. Know that + your work continues to make my life a little easier. I appreciate this. +

      + +

      + May lady luck shine on you. +

      + +
    • 18 Aug 2000 +

      + Hi, +

      + +

      + you mention on your web site that you've had no reports of your program + being used in Antarctica, guess what? +

      + +

      + I work for the British Antarctic Survey on software which runs a + scientific radar system down at Halley (76 south, 26 west), Antarctica. + The radar is controlled by a huge and complex system called Radops, on top + of the QNX operating system. +

      + +

      + Basically ctags makes writing new software and maintaining the system much + easier, thanks. I had previously relied on a horrible system of scripts + to find function definitions. +

      +

      [Antarctica]

      + +
    • 4 Jul 2000 +

      + Thank U for the fact to support Python in ctags. +

      +

      + Recently I was puzzled in the case that I can't use ctags in python old + version. +

      +

      + When I visited your site, I got the bright hope!! +

      +

      + I'm the fan of CTAGS!! +

      +

      + May the force with U. +

      +

      [Korea]

      +
    • + +
    • 23 Jun 2000 +

      + I've been a VIM user for years (and a VI user for a long time), and + finally today I decided to play w/ the ctags that came w/ my RedHat + 6.1 installation, and I was impressed to say the least, I kicked + myself for not using it before. +

      + +

      + Then I found out (on Freshmeat.net) that there was a new version (4.0) + with some more languages supported. Downloaded it, compiled and tested + it w/ some awk and python code, worked great. And as I am a PHP-head, + I stole some of the code from the awk and the python files and made a + file to process php classes and functions, nothing revolutionary, but + it works. +

      + +

      + Your code is clear, so even a dumb programmer like me could figure out + what was going on, modified the appropriate files, and got the + modified ctags working in under half and hour. I am including the + "diff -c" files so you can patch your code. +

      + +

      + When I get some more time to play w/ ctags (downloaded at 2:50am, it + is 3:30am now), I'll add more to the php.c so it'll recognize + methods, variable definitions, etc. +

      + +

      + Great tool man! +

      +
    • + +
    • 12 Jun 2000 +

      + First, LOVE ctags!!! + Now that I've buttered you up ... just kidding ... I LOVE ctags!  ;-) +

      +
    • + +
    • 05 Jun 2000 +

      + First, thanx for producing the useful CTAGS tool. My colleagues and I use + it all the time, and it comes in very handy when reviewing software source + files that have been written by others. +

      +
    • + +
    • 16 May 2000 +

      + First let me thank you (over and over again) for the Exuberant ctags + you've written for the variety of platforms. +

      +
    • + +
    • 10 May 2000 +

      + Thank you for the wonderful ctags program. I'm using it + for a parser I'm writing that works with C/C++ code.... +

      +

      + PS. I know you've heard this several times also, but your + code is really easy to read, and makes the whole process of + understanding so much... nicer. Thanks again. +

      +
    • + +
    • 10 Apr 2000 +

      + Thanks for doing such a wonderful job; this ctags is *FAR* superior to the + stock one that came with the system (HP-UX). +

      +
    • + +
    • 02 Feb 2000 +

      + Exuberant ctags is just what I have been looking for for ages - I have + been trying to do it all in Perl (albeit wrongly no doubt with numerous + regex's) but I must say ctags is spot on! +

      +
    • + +
    • 26 Jan 2000 +

      + I've been looking at your code, and I'm very impressed, and I'm not easily + impressed. +

      +
    • + +
    • 13 Jan 2000 +

      + Your ctags utility allows for much better software engineering practices - + and without being tied to the heavyweight utilities provided by compiler + manufacturers. We will be using ctags as a major component for our C++ + build process. It now allows us to define error and message enumerators on + a per-class basis rather than as a global resource. Also, many thanks for + your very prompt attention in the whole area of technical support. +

      +

      [United Kingdom]

      +
    • + +
    • 08 Dec 1999 +

      + Thank you very much for taking on the task of looking after ctags. It is + really very much appreciated. My company are planning on using ctags for + many of our software maintenance and development tasks. After all this +

      +

      [United Kingdom]

      +
    • + +
    • 07 Dec 1999 +

      + I've been using Exuberant Ctags for awhile now. It's really great, + useful program. I've integrated tag-hyperlinking into my editor, and + I'm now addicted to tags. I've written my own tags programs for + various assembly languages (simple to parse) using Perl. +

      +
    • + +
    • 15 Sep 1999 +

      + We wish to take this opportunity to thank you for support. ctags has + revolutionary changed our way of developing our models. +

      +

      [United Kingdom]

      +
    • + +
    • 09 Sep 1999 +

      + Vim is shipping with Darren Hiebert's excellent Exuberant Ctags :) + ...this is a thing of great beauty that we can't live without round here. +

      +

      [United Kingdom]

      +
    • + +
    • 12 Jul 1999 +

      + I really like your implementation of ctags, it works really well and + your code is very clean. +

      +
    • + +
    • 07 Jul 1999 +

      + Hi Darren, let me congratulate you for this excellent tool. +

      +

      [Germany]

      +
    • + +
    • 14 Jun 1999 +

      + Many thanks for making the ctags package freely available. Its a + great package. I particularly like the C++ support. I'm working on + a telecommunications system with approximately 150 C++ classes. + Being able to immediately get to the definition of C++ items + easily and quickly via ctags makes work a joyful experience. +

      +
    • + +
    • 19 Mar 1999 +

      + I use your ctags here at work, and wanted to thank you for writing such a + nice software package. I like it so much more than the normal ctags + program.... Thank you so much for writing such a great package! +

      +
    • + +
    • 05 Mar 1999 +

      + I am just glad that such great software is avaiable out there. Most ctags + on Unix simply blow chunks! Yours is absoulutely fantastic and has saved + me numerous hours of wasted time. I have even managed to get the project + managament here to make it sort of a standard, though it had to be + installed as vtags so it would not confuse the curmudgeons still using the + broken ctags that comes with the system. When used with vim, it works + absolutely fantastic. I hope I am not gushing here. :) +

      +
    • + +
    • 27 Jan 1999 +

      + Looks like nothing can spoil my ctags pleasure now +

      +
    • + +
    • 21 Dec 1998 +

      + Exuberant Ctags is a great tool indeed! +

      +

      [Germany]

      +
    • + +
    • 11 Dec 1998 +

      + In better news, I'm trying to convert all the developers here (30+) to use + ctags-3.0. Just finding enumeration fields will probably be enough for any + of us to switch! +

      +
    • + +
    • 18 Nov 1998 +

      + Hi.... +

      +

      + Thank you very much for your quick reply + and detail explanation. +

      +

      + Since I received your mail I have spent time to make simple shell + script which should be executed in root hierarchy in project, create 2 + files ( one for making "tags" in root hierarchy and subdirectories + previously listed, the other is ".vimrc" file for setting VIM to update + necessary "tags" files when program source file is saved ), and making + symbolic link of .vimrc to each subdirectories. It's simple for veteran, + As for me, novice in shell script, It's an excellent accomplishment. +

      +

      + I used to think before that the internet is for someone who find + sexual things and for someone who earns money by less productive way. + But I am changing my mind by someone like you who use internet to make + better world. Thank you again..... +

      +

      [Korea]

      +
    • + +
    • 23 Oct 1998 +

      + First off, I would like to thank you for creating Exuberant Ctags. This + program completely kicks ass, if you'll pardon me for saying so. :) +

      +
    • + +
    • 20 Oct 1998 +

      + Well done on producing a very decent version of ctags. I use it at work + and at home and find it very useful for navigating moderately sized + projects. Thanks! +

      +
    • + +
    • 25 Sep 1998 +

      + Thanks for Exuberant Ctags - it is quite an improvement over ctags, + even gnu ctags. +

      +
    • + +
    • 24 Sep 1998 +

      + I just spent the last few days integrating your Ctags program into our + build environment here. On NT, Visual C++'s browse files don't work + because our project is too large. So, I wrote a plug-in for Visual Studio + to use a tags file instead. We are traditionally a Unix house and use + tags elsewhere. Anyway, Ctags goes through our source in about 8 minutes + and generates a 20meg+ tags file (with lots of options turned off). + That's pretty impressive speed and thoroughness. +

      +

      + Thanks a lot for creating a great tool! +

      +
    • + +
    • 17 Sep 1998 +

      + Your ctags program is extremely useful and a key part of my development + environment. Thank you for writing it. I'm sure it will live a loooong + life. +

      +
    • + +
    • 26 Aug 1998 +

      + Thanks for your great piece of software. It has saved me the headache of + creating my own little C++ parser for a Microsoft Visual Studio addin I + was writing. +

      +
    • + +
    • 24 Aug 1998 +

      + I love your ctags program and I've gotten all my co-workers to love it too. +

      +
    • + +
    • 24 Aug 1998 +

      + Just to add my voice to the chorus of happy exuberant ctags users: it's + just great. +

      +

      [Luxembourg]

      +
    • + +
    • 05 Aug 1998 +

      + I am using your ctags for Java -- & it's is a great convenience! + ...This really is a great help for working in Java. +

      +

      [Denmark]

      +
    • + +
    • 05 Aug 1998 +

      + I very much appreciate what you have done for all of us with exuberant + Ctags! +

      +
    • + +
    • 23 Jul 1998 +

      + I'm using your WONDERFULL program ctags (Verison 2.2). +

      +

      [Germany]

      +
    • + +
    • 21 Jul 1998 +

      + Brilliant brilliant brilliant, thanks very much... Now a truly + indispensable piece of software. Thanks for the perfect companion for Vim. +

      +

      [Australia]

      +
    • + +
    • 10 Jul 1998 +

      + Again, ec21 is great, especially the C++ support. Keep up the good work. +

      +
    • + +
    • 02 Jul 1998 +

      + You did an excellent job in producing this product, and you deserve *much* + thanks for it. +

      +
    • + +
    • 01 Jul 1998 +

      + ...the best ctags program in the world! +

      +

    • + +
    • 15 Jun 1998 +

      + Great product! I'm trying to get others in my group to use this with vim. +

      +
    • + +
    • 14 May 1998 +

      + First of all, let me congratulate you on the terrific 2.0 release of + ctags with C++ support. +

      +
    • + +
    • 05 May 1998 +

      + I love the program. It has the process of "figuring out" code much easier. +

      +
    • + +
    • 03 May 1998 +

      + I have just completed the task of changing Zeus [Win95 editor] to + support for your new tag file format and I have to say that I am very + impressed with your ctags.exe program. In fact it is just amazing! +

      +

      [Australia]

      +
    • + +
    • 14 Mar 1998 +

      + I would like to congradulate you on your implementation of Exuberant Ctags. +

      +

      + I have added master tag files for everything in /usr/include and I have + a cron job to build master tag files for the linux kernel(which makes for + highly productive hack sessions when you have nearly the entire kernel + at your fingertips). I often wonder how I got along for so many years + without it! In fact, I have converted users of the dreaded Microsoft(tm) + MSDEV(tm) IDE(probably a TM here too) to VIM-5.0 for NT(tm) along with + your implmentation of ctags because it was easier for them to navigate + around the code! +

      +

      + Now, whenever I use a ctags that isn't yours, I feel crippled in my ability + to write good code quickly. I love your enhancments to it. +

      +

      + Please keep up the good work! The world needs people like you. +

      +

      + [And later...] +

      +

      + I love the fact that if one really hates some piece of software, they + can get third party stuff written by people like you that are ten times + better than the original product. + ...Anyway. Once again, I thank you for writing such a valuable piece + of art, and that is really what it is. +

      +
    • + +
    • 12 Mar 1998 +

      + I just wanted to let you know that I have been looking for a program + just like ctags.... Definitely a service to the programming community! +

      +
    • + +
    • 23 Jan 1998 +

      + Thank you very much for writing Exuberant Ctags. It has been extremely + useful! +

      +
    • + +
    • 04 Jan 1998 +

      + I'm another enthusiastic fan of your exuberant ctags package; nice work! + I use it to streamline all of my C programming. I'm addicted ;-). +

      +
    • + +
    • 03 Dec 1997 +

      + I just want to let you know that I really like your version of ctags. + I downloaded it about 6 months ago (probably need to update my copy) + and have been using it alot. + Thanks for the good work! +

      +
    • + +
    • 12 Sep 1997 +

      + I love your ctags program and have used it for about a year now and think + the additions are great. +

      +
    • + +
    • 06 Jul 1997 +

      + I've made heavy use of your Exuberant Ctags program this spring for my + Software Engineering and Data Structures courses at school -- coupled with + VIM this is a truly fantastic combo that saved my... er, *gluteus m.* on + several occasions! Thanks SO much for a truly great program. +

      +
    • + +
    • 11 Jun 1997 +

      + Thanks for your GREAT work on ctags. +

      +

      [Germany]

      +
    • + +
    • 27 May 1997 +

      + Subject: exuberant ctags rocks! +

      +

      + ...gnu ctags didn't know squat about variables, structures, enums... etc. +

      +

      + After doing a search on the web for 'ctags' I found your + extended ctags. What a lifesaver. This thing does almost + everything a person could ask for. +

      +

      + It rocks, it rocks, it rocks. +

      +
    • + +
    • 21 Apr 1997 +

      + Hello. One of my users told me about your ctags package. They tell me + its great stuff. +

      +
    • + +
    • 27 Mar 1997 +

      + I've just begun using your ctags program and it is indeed wonderful! +

      +
    • + +
    • 19 Feb 1997 +

      + Wow! +

      +

      + I've been a vi/vim/ctags user for about 12 years now. Most of + those 12 years I've been frustrated by various tags generators and + wished someone would combine all the different features into a single + program. And have it work. I've never found the time/energy to tackle + that one (I've tackled enough other extracurricular programming). But, + now you've done it! And in a big way! +

      +

      + Hats off, I bow to you and send many grateful thanks. +

      +
    • + +
    • 02 Oct 1996 +

      + main() { int i; for(i=0;i<10;i++) printf("WOWWOW\n");} +

      +

      + Your new ctags is very very excellent. Usually if I want to insert the + enum'ed variable into tags file, I always had to + "grep/awk/grep/awk/grep/awk/", then ":%!sort" + in vi... a lot of trouble to me. Furthermore, it can give me all the + global variables, how excellent your package is! And another thing.. is + If a source file is something like this, + typedef void (*func_t)(const char **b, int c); + Then other ctags gives me a very very strange results to me, on the + contrary your ctags gives me exact results. +

      +

      + I only downloaded your package about 2 hours ago, so there must be a lot + of new improvement that I didn't find out yet. +

      +

      + Thank you +

      +

      [Korea]

      +
    • + +
    • 13 Aug 1996 +

      + ...your ctags and your advice have and will save me countless hours + hunting down defines, functions, etc. Koodos for the effort and keep up + the good work. +

      +
    • + +
    • 06 Aug 1996 +

      + I've downloaded your ctags- it is great!!! I have been pulling my hair + out trying to figure out how to do some of this. The macros and extern'ed + functions are very, very helpful. Also, I'd like to complement your on + your coding style: very consistent and fairly easy to read. It definitely + shows when a software developer feels pride in their work. +

      +
    • + +
    • 29 May 1996 +

      + I use `ctags' on ugly source codes thus your version is very helpful. + Thank you! +

      +

      [Russia]

      +
    • + +
    • 22 May 1996 +

      + My initial impression (after 5 minutes use) is that it works better than + the solaris ctags. Excellent tool! +

      +

      [United Kingdom]

      +
    • + +
    • 21 May 1996 +

      + Been a long time ctags user. Love your improvements. +

      +
    • + +
    • 10 May 1996 +

      + I'm using ctags-0.31 and I'm quite happy with it. +

      +

      [Finland]

      +
    • + +
    • 25 Apr 1996 +

      + People will want to get Vim just because it includes such a fine ctags + program! +

      +

      [Netherlands]

      +
    • + +
    • 17 Apr 1996 +

      + I want to thank and congratulate you for ctags. +

      +

      [Germany]

      +
    • + +
    • 16 Apr 1996 +

      + Glad to see a major improvement of the (already) best ctags. +

      +

      [Germany]

      +
    • + +
    • 02 Apr 1996 +

      + First let me thank you for the ctags program. It handles finding of tags + better than every other ctags I've used so far. +

      +

      [Germany]

      +
    • + +
    • 02 Apr 1996 +

      + Wow! I've just tried this out, and despite being the very first beta + release of this program, it already seems to be the best ctags program + I've seen. Up to now I have been using the ctags that came with elvis, + and I've just compared the output "tags" files. +

      +

      + The elvis ctags had lots of little tags for things that shouldn't have had + tags (e.g. "if", "return", "TRUE", + etc.), but this new ctags doesn't produce tags for those. It does find + several tags though that the elvis ctags could not (e.g. + "insstr" in the vim code!). +

      +

      + [And later...] +

      + Wow! All the bugs I reported last time have been fixed :-) It does + indeed seem very robust now. Well done! +

      +

      [Australia]

      +
    • + +
    + +


    +Back to Exuberant Ctags + + + === added file 'website/tool_support.html' --- website/tool_support.html 1970-01-01 00:00:00 +0000 +++ website/tool_support.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,44 @@ + + + +Exuberant Ctags: Addiing Tag File Support to Software Tools + + + +

    How to Add Tag File Support to Software Tools

    + +

    +Exuberant Ctags now includes a library to easily add tag file +support to software tools, such as editors. The distributed makefile contains +a target for library object file, readtags.o, and a demonstration +program for the library, readtags. +

    + +

    +The functions provided by this library are intended to provide tag file +support to a software tool. The tag lookups provided are sufficiently fast +enough to permit opening a sorted tag file, searching for a matching tag, then +closing the tag file each time a tag is looked up (search times are on the +order of hundreths of a second, even for huge tag files). This is the +recommended use of this library for most tool applications. Adhering to this +approach permits a user to regenerate a tag file at will without the tool +needing to detect and resynchronize with changes to the tag file. Even for an +unsorted 24MB tag file, tag searches take about one second on my 650 MHz +Athlon Linux machine. +

    + +

    +The interface to the library is documented in the include file +readtags.h. For an example implementation, see the function +findTag() in the conditionally compiled portion of the source +file readtags.c. +

    + +

    +To facilitate widespread support of tag files, the readtags library is +released in the public domain, allowing its use in even commercial +applications. +

    + + + === added file 'website/tools.html' --- website/tools.html 1970-01-01 00:00:00 +0000 +++ website/tools.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,76 @@ + + + +Editors and Tools Supporting CTAGS + + + +
    +

    Editors and Tools Supporting CTAGS

    +
    + +

    Editors

    + + +

    Tools

    + + +
    +Back to Exuberant Ctags + + + + === added file 'website/whatis.html' --- website/whatis.html 1970-01-01 00:00:00 +0000 +++ website/whatis.html 2011-03-11 21:16:06 +0000 @@ -0,0 +1,30 @@ + + +What is Ctags? + + + +

    What is ctags?

    + +

    +Ctags generates an index (or tag) file of language +objects found in source files that allows these items to be quickly and easily +located by a text editor or other utility. A tag signifies a language +object for which an index entry is available (or, alternatively, the index +entry created for that object). +

    + +

    +Tag generation is supported for these programming languages. +

    + +

    +A list of editors and tools utilizing tag files may be found here. +

    + +
    +Back to Exuberant Ctags + + + === added directory 'win32' === added file 'win32/ctags.ide' Binary files win32/ctags.ide 1970-01-01 00:00:00 +0000 and win32/ctags.ide 2011-03-11 21:16:06 +0000 differ === added file 'win32/makefile.in' --- win32/makefile.in 1970-01-01 00:00:00 +0000 +++ win32/makefile.in 2011-03-11 21:16:06 +0000 @@ -0,0 +1,39 @@ +# $Id$ +# Makefile for building Win32 releases + +VERSION = @@DOS_VERSION@@ + +# Borland C library directory +ZIP = "c:\Program Files\WinZip\wzzip" +#ZIP = pkzip -xctags$(VERSION)\gnu_regex_dist\*.* + +# Add this file for wildcard expansion (does NOT work with 4.0!) + +#ctagsw32.exe: ctags$(VERSION)\mk_mvc.mak +# cd ctags$(VERSION) +# nmake -f mk_mvc.mak clean +# nmake -f mk_mvc.mak +# copy ctags.exe ..\$@ +# nmake -f mk_mvc.mak clean +# cd .. + +zip: ctagsw32.exe + - del ec$(VERSION)w32.zip + - del ctags$(VERSION)\ctags.tds + copy ctagsw32.exe ctags$(VERSION)\ctags.exe + $(ZIP) -Pr ec$(VERSION)w32 ctags$(VERSION)\*.* + - del ctags$(VERSION)\ctags.exe +# copy ctags16.exe ctags$(VERSION)\ctags.exe +# $(ZIP) -Pr ec$(VERSION)-16 ctags$(VERSION)\*.* +# copy ctags32.exe ctags$(VERSION)\ctags.exe +# $(ZIP) -Pr ec$(VERSION)-32 ctags$(VERSION)\*.* + +zip-os2: ctagsos2.exe + - del ec$(VERSION)os2.zip + copy ctagsos2.exe ctags$(VERSION)\ctags.exe + $(ZIP) -Pr ec$(VERSION)os2 ctags$(VERSION)\*.* + del ctags$(VERSION)\ctags.exe + +clean: + - del ctagsw32.exe + - del ctagsos2.exe === modified file 'yacc.c' --- yacc.c 2007-09-08 09:16:38 +0000 +++ yacc.c 2011-03-11 21:16:06 +0000 @@ -1,5 +1,5 @@ /* -* $Id: yacc.c 443 2006-05-30 04:37:13Z darren $ +* $Id$ * * Copyright (c) 2001-2002, Nick Hibma *