next up previous contents index
Next: Others Up: Functions Previous: Modes

Browser interface

 

Here are the functions to customize browser and access browser database. The examples can be placed in a SmacLib file.

Cpp functions:

browser_set_pp

     void browser_set_pp(char * mode, char * exec)

To indicate where the C and C++ pre-processor are (default pre-processor is /lib/cpp for each mode). mode must be "C-mode or "C++mode", and exec must be an absolute filename.

browser_set_pp_options

   void browser_set_pp_options(char * mode, char *options)

mode must be "C-mode or "C++mode". If options is 0, removes pre-processing before parsing, else indicates the pre-processor options and asks for a pre-processing before parsing.

File management:

browser_add

   void browser_add(char * path [, int rec])

parses the given file or directory, momentary forces the browser toggle button to Rec if the second argument is given not equal to 0.

browser_del

   void browser_del([char * name])

deletes the file name (or all files if the function is called without argument) from the browser database.

browser_dump

    int browser_dump(char * filename)

Saves the current browser database in the specified file, Returns 1 if the dump can be made, else 0 (file is write protected or other error).

browser_restore

   int browser_restore(char * filename)

Restores (quickly) the browser database information dumped in the specified file. Returns 1 on success, else 0 (file doesn't not exist or other error).

An implicit Del is made before updating the browser database, for all the files referenced in the dump.

Access functions:

browser_class_file

   char * browser_class_file(char * type\_name [, int * pline])

Returns the file pathname where type_name is defined, if pline is given, it is modified to the line number. Returns 0 if type_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the string is allocated each time the function is called, use free() to release it.

browser_class_parents

   char ** browser_class_parents(char * class_name)

Returns a vector containing the class_name parents names and the inheritance specifier, or 0 if class_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2595

browser_class_children

   char ** browser_class_children(char * class_name)

Returns a vector containing the class_name children names, or 0 if class_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2608

browser_class_methods

   char ** browser_class_methods(char * class_name)

Returns a vector containing the class_name methods declaration with its flags, their declaration and definition files, their lines, and information bits. Returns 0 if class_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2621

browser_class_attributes

   char ** browser_class_attributes(char * class_name)

Returns a vector containing the class_name attributes declaration with its flags, their declaration file, their line, and information bits. Returns 0 if class_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2634

browser_class_flags

   char * browser_class_flags(char * class_name)

Returns the class flags and name, or 0 if class_name is not in the browser database or if cannot allocate memory to memorize the result.

Be careful, the string is allocated each time the function is called, use free() to release it.


tabular2646

browser_functions

   char ** browser_functions(char * prefix)

Returns a vector containing the list of functions (with their flags, definition file and line) which name and eventually parameter type list begins with the given prefix.

Returns 0 if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2657

browser_globals

   char ** browser_globals(char * prefix)

Returns a vector containing the list of globals (with their flags and definition file and line) which name begins with the given prefix. Returns 0 if cannot allocate memory to memorize the result.

Be careful, the result is allocated each time the function is called, use free() to release it. The vector and its included strings are placed in a unique allocated block.


tabular2668

browser_select_class

   int browser_select_class(char * prefix)

Selects the first type in the browser subwindow Types which name matches prefix as you can do it with the mouse. Returns 1 if a type name is found, else 0 (an hidden class cannot be selected).

browser_select_method

   int browser_select_method(char * prefix)

Selects the first method in the browser subwindow Methods which name (and optionally parameter type list) matches prefix as you can do it with the mouse. Returns 1 if a method is found, else 0 (an hidden method cannot be selected).

browser_select_attribute

   int browser_select_attribute(char * prefix)

Selects the first attribute in the browser subwindow Attribute which name matches prefix as you can do it with the mouse. Returns 1 if an attribute is found, else 0 (an hidden attribute cannot be selected).

browser_select_function

   int browser_select_function(char * prefix)

Selects the first function in the browser subwindow Functions which name (and optionally parameter type list) matches prefix as you can do it with the mouse. Returns 1 if a function is found, else 0 (an hidden function cannot be selected).

browser_select_global

   int browser_select_global(char * prefix)

Selects the first global in the browser subwindow Globals which name matches prefix as you can do it with the mouse. Returns 1 if a global is found, else 0 (an hidden global cannot be selected).

browser_edit

   void browser_edit()

Edits the last selected item, as a double click on the browser window.


tabular2701

browser_class_entry

   int browser_class_entry(char * prefix)

Returns the rank of the first visible or hidden type in the browser Types list (alphabetically sorted) which name matches prefix, or -1 if a type cannot be found. See browser_class() described below.

browser_function_entry

   int browser_function_entry(char * prefix)

Returns the rank of the first visible or hidden function in the browser Functions list (alphabetically sorted) which name (and optionally parameter type list) matches prefix, or -1 if a function cannot be found. See browser_function() described below.

browser_global_entry

   int browser_global_entry(char * prefix)

Returns the rank of the first visible or hidden global in the browser Globals list (alphabetically sorted) which name matches prefix, or -1 if a global cannot be found. See browser_global() described below.

browser_file_entry

   int browser_file_entry(char * prefix)

Returns the rank of the first file in the browser Files list (alphabetically sorted) with complete pathname matching prefix, or -1. See browser_global() described below.

browser_class

   char * browser_class(int n)

Returns the name (without flags) of the nth type from the browser Types list (alphabetically sorted), or 0 for invalid index.


tabular2734

browser_function

   char * browser_function(int n)

Returns the name (without flags) and parameter type list of the nth function from the browser Function list (alphabetically sorted), or 0 for invalid index.

browser_global

   char * browser_global(int n)

Returns the name (without flags) of the nth global from the browser Global list (alphabetically sorted), or 0 for invalid index.

browser_file

   char * browser_file(int n)

Returns the pathname of the nth file from the browser File list (alphabetically sorted), or 0 for invalid index.

Visibility:

By default, all browser information are displayed on its window, but you can hide some of them with the following functions (or browser window Hide buttons §3.2 page gif).

browser_show_all

     void browser_show_all()

All browser information become visible.

browser_hide_private_members

   void browser_hide_private_members()

Hides all private class members (methods and attributes).

browser_hide_protected_and_private_members

   void browser_hide_protected_and_private_members()

Hides all protected and private class members (methods and attributes). Only public members still visible.

browser_show_protected_and_private_members

   void browser_show_protected_and_private_members()

All class members (methods and attributes) become visible.

browser_hide_inherited_members

   void browser_hide_inherited_members()

Hides all inherited class members.

browser_show_inherited_members

   void browser_show_inherited_members()

All class inherited members become visible

browser_hide_internal_types

   void browser_hide_internal_types()

Hides types defined inside another type. For instance if the browser knows the following definitions:


tabular2776

the types displayed on the browser window are S and S::SS, this last will be hidden after calling browser_hide_internal_types.

browser_show_internal_types

   void browser_show_internal_types()

Types defined inside one type become visible.

browser_hide_static_functions

   void browser_hide_static_functions()

Hides functions declared static.

browser_show_static_functions

   void browser_show_static_functions()

Shows all functions

browser_hide_static_globals

   void browser_hide_static_globals()

Hides globals declared static.

browser_show_static_globals

   void browser_show_static_globals()

Shows all globals.

browser_hide_children_of

   void browser_hide_children_of(char * parent)

Hides sub classes of the specified class. Re-browsing the specified class definition cancels this hidding.

browser_show_children_of

   void browser_show_children_of(char * parent)

Show sub classes of the specified class (except if another hidding cause exists).

browser_hide_class

   void browser_hide_class(char * name)

Hides the specified class, but the visibility of its sub classes is not affected. Re-browsing the specified class definition cancels this hidding.

browser_show_class

   void browser_show_class(char * name)

The specified class becomes visible (except if another hidding cause exists).

browser_hide_global

   void browser_hide_global(char * name)

Hides the specified global. Re-browsing the specified global definition cancels this hidding.

browser_show_global

   void browser_show_global(char * name)

The specified global becomes visible (except if another hidding cause exists).

browser_hide_function

   void browser_hide_function(char * name)

Hides the specified function (name may contain parameters type list). Re-browsing the specified function definition cancels this hidding.

browser_show_function

   void browser_show_function(char * name)

The specified function becomes visible (except if another hidding cause exists).


next up previous contents index
Next: Others Up: Functions Previous: Modes

Lionel Fournigault
Wed Apr 30 10:44:37 MET DST 1997