C API Functions

## udbDbLanguage

### Description

Return the specific language variety of the current (open) Understand database.

The language returned is most often used in conjunction with Udb_mask_language to determine the general language type (Ada, C, or Fortran) of the database.

Only one Understand database can be open at any time.

### Syntax

     #include "udb/udb.h"
     UdbLanguage udbDbLanguage(void)

### Arguments

There are no arguments to udbDbLanguage.

### Return Values

UdbDbLanuage returns one of the following values specifying the language and variety of the Understand database.

.

Return values | description
Udb_languageC_KR | Project Database is K&R C
Udb_languageC_ANSI | Project Database is ANSI C
Udb_languageC_CPP | Project Database is C++
Udb_languageFortran_77 | Project Database conforms to Fortran 77
Udb_languageFortran_90 | Project Database conforms to Fortran 90
Udb_languageFortran_95 | Project Database conforms to Fortran 95
Udb_languageAda83 | Project Database conforms to Ada83
Udb_languageAda95 | Project Database conforms Ada95

The following values are also available for use as a bitwise mask with the above language return values. See example usage below.

MASK values | description
Udb_mask_languageC | C
Udb_mask_languageFortran | Fortran
Udb_mask_languageAda | Ada
Udb_mask_language | Use as bitwise mask to determine general language type as shown below.

general language type | description
Udb_languageC | Project Database is C/C++ Language
Udb_languageAda | Project Database is Ada
Udb_languageFortran | Project Database is Fortran

### Example Usage

The following example obtains the language of the database and performs a bitwise AND with Udb_mask_language to determine the general language type.

     language = udbDbLanguage();
    switch (language & Udb_mask_language) {
       case Udb_languageC : ...
       case Udb_languageFortran : ...
       case Udb_languageAda : ...
       }

The following uses the general language mask Udb_mask_languageC to determine if the specific variety of language is C.

     isLanguageC = 	 (lang & Udb_mask_languageC);

### See Also

udbEntityLanguage to get the language of a particular entity.

Scientific Toolworks, Inc. http://www.scitools.com Voice: (802) 763-2995 Fax: (802) 763-3066 support@scitools.com sales@scitools.com