DEC C
User's Guide for OpenVMS Systems


Previous Contents Index


Glossary


additive operator: An operator that performs addition (+) or subtraction (--). These operators perform arithmetic conversion on each of the operands, if necessary. See also arithmetic conversion rules.

aggregate: A data structure (array, structure, or union) composed of segments called members. You declare the members to be of either a scalar or aggregate data type. Members of an array are called elements and must be of the same data type. A structure has named members that can be of different data types. A union is a structure that is as long as its longest declared member and that contains the value of only one member at a time.

ampersand (&): As a unary operator, computes the address of its operand. As a binary operator, performs a bitwise AND on two operands; both must be of an integral type. As an assignment operator (&=), performs a bitwise AND on two expressions and assigns the result to the left object. The double ampersand (&&), a binary operator, performs a logical AND on two operands. See also binary operator, bitwise operator, logical operator, and unary operator.

argument: An expression that appears within the parentheses of a function call. The expression is evaluated and the result is copied into the corresponding parameter of the called function. See also argument passing and parameter.

argument passing: The mechanism by which the value of the argument in a function call is copied to a parameter in the called function. In C, all arguments are passed by value; that is, the parameter receives a copy of the argument's value. Therefore, a function called in C cannot modify the value of an argument except by using its address. In general, addresses are passed using the ampersand operator (see ampersand (&)) in the function call or by passing a pointer variable. In addition, using an array or function name (an array with no brackets or function identifier with no parentheses) as an argument results in the passing of the address of the array or function.

arithmetic conversion rules: The set of rules that govern the changing of a value of an operand from one data type to another in arithmetic expressions. Conversions take place in assignments by changing the type of the right operand's result to that of the object referred to by the left operand; the resultant type also applies to the assignment expression. Conversions are also performed when arguments are passed to functions.

arithmetic operator: A C operator that performs a mathematical operation. In an expression, certain operations take precedence (are performed first) over other operations. The unary minus operator (--) is at the highest level of precedence. At the next level are the binary operators for multiplication (*), division (/), and mod (%). At the next level are addition (+) and subtraction (--). There is no unary plus operator, and there is no exponentiation operator. If necessary, all the binary operators perform the arithmetic conversions on their operands. See also arithmetic conversion rules.

arithmetic type: One of the integral data types, enumerated types, float , or double .

array: An aggregate data type consisting of subscripted members, called elements, all of the same type. Elements of an array can be one of the fundamental types or can be structures, unions, or other arrays (to form multidimensional arrays).

assignment expression: An expression that has the following form:

E1 asgnop E2

Expression E1 must evaluate to an lvalue, the asgnop operator is an assignment operator, and E2 is an expression. The type of an assignment expression is that of its left operand. The value of an assignment expression is that of the left operand after the assignment takes place. If the operator is of the form op=, then the operation E1 op (E2) is performed, and the result is assigned to the object referred to by E1; E1 is evaluated once.

assignment operator: The combination of an arithmetic or bitwise operator with the assignment symbol (=); also, the assignment symbol by itself. See also assignment expression.

asterisk (*): As a unary operator, treats its operand as an address and results in the contents of that address. As a binary operator, multiplies two operands, performing the arithmetic conversions, if necessary. As an assignment operator (*=), multiplies an expression by the value of the object referred to by the left operand, and assigns the product to that object. See also binary operator and unary operator.

binary operator: An operator that is placed between two operands. The binary operators include arithmetic operators, shift operators, relational operators, equality operators, bitwise operators (AND, OR, and XOR), logical connectives, and the comma operator, in that order of precedence. All binary operators group from left to right. DEC C has no exponentiation operator. The exp library function must be used instead.

bitwise operator: An operator that performs Boolean algebra on the binary values of two operands, which must be integral. If necessary, the operators perform the arithmetic conversions. Both operands are evaluated. All bitwise operators are associative, and expressions using them may be rearranged. The operators include, in order of precedence, the single ampersand (&) (bitwise AND), the circumflex (^) (bitwise exclusive OR), and the single bar (|) (bitwise inclusive OR).

block: See compound statement.

block activation: The run-time activation of a block or function, in which local auto and register variables are allocated storage and, if they are declared with initializers, given initial values. Variables of storage class static , extern , globaldef , and globalvalue are allocated and initialized at link time. The block activation precedes the execution of any executable statements in the function or block. Functions are activated when they are called. Internal blocks (compound statements) are activated when the program control flows into them. Internal blocks are not activated if they are entered by a goto statement, unless the goto target is the label of the block rather than the label of some statement within the block. If a block is entered by a goto statement, references to auto and register variables declared in the block are still valid references, but the variables may not be properly initialized. Blocks that make up the body of a switch statement are not activated; auto or register variables declared in the block are not initialized.

built-in functions: The function definitions that are part of the DEC C compiler for OpenVMS systems. A call to one of these functions does not call a function in a run-time library or in your program. Most of the built-in functions access the VAX hardware instructions to perform operations quickly that are cumbersome, slow, or impossible in the C language.

cast: An expression preceded by a cast operator of the form (type_name). The cast operator forces the conversion of the evaluated expression to the given type. The expression is assigned to a variable of the specified type, which is then used in place of the whole construction. The cast operator has the same precedence as the other unary operators.

CDD/Repository: An optional OpenVMS software product, available under a separate license, that maintains a set of data structure definitions that many programs on a system, written in many languages, can access. The language-independent definitions are translated into the target language when they are included in the program stream. You can include the CDD records in DEC C programs using the #dictionary preprocessor directive. This directive is specific to DEC C for OpenVMS Systems, and is not portable.

character:

See also string.

comma operator: A C operator used to separate two expressions as follows:

E1, E2

The expressions E1 and E2 are evaluated left to right, and the value of E1 is discarded. The type and value of the comma expression are those of E2.

comment: A sequence of characters introduced by the pair /* and terminated by */. Comments are ignored during compilation. They may not be nested.

Common Data Dictionary (CDD): See CDD/Repository.

compilation unit: All the source files compiled to form a single object module. In other C documentation, the term source file is synonymous with the OpenVMS compilation unit, which is not necessarily a single source file. Declarations and definitions within a compilation unit determine the lexical scope of functions and variables.

compound statement: Valid C statements enclosed in braces ({ }). Compound statements can also include declarations. The scope of these variables is local to the compound statement. A compound statement, when it is not the body of a function, is called a block.

conditional operator: The C operator (?:), which is used in conditional expressions of the following form:

E1 ? E2 : E3

E1, E2, and E3 are valid C expressions. E1 is evaluated, and if it is nonzero, the result is the value of E2; otherwise, the result is the value of E3. Either E2 or E3 is evaluated, but not both.

constant: A primary expression whose value does not change. A constant may be literal or symbolic.

constant expression: An expression involving only constants. Constant expressions are evaluated at compile time so they may be used wherever a constant is valid.

conversion: The changing of a value from one data type to another. Conversions take place in assignments by changing the type of the right operand's result to that of the object referred to by the left operand; the resultant type also applies to the assignment expression. Conversions are also performed when arguments are passed to functions: char and short become int ; unsigned char and unsigned short become unsigned int if no function prototype is in scope; float becomes double . Conversions can also be forced by means of a cast. Conversions are performed on operands in arithmetic expressions by the arithmetic conversions.

conversion characters: A character used with the DEC C RTL Standard I/O functions that is preceded by a percent sign (%) and specifies an input or output format. For example, letter d instructs the function to input/output the value in a decimal format.

Curses: A screen management package comprised of DEC C RTL functions and macros that create and modify defined sections of the terminal screen, and optimize cursor movement. Curses defines rectangular regions on the terminal display that you may write upon, rearrange, move to new positions on the screen, and delete from the screen. These rectangular regions are called windows. To use any of the Curses functions or macros, you must include the <curses.h> header file using the #include preprocessor directive.

data definition: The syntax that both declares the data type of an object and reserves its storage. For variables that are internal to a function, the data definition is the same as the declaration. For external variables, the data definition is external to any function (an external data definition).

data-type modifier: Keywords that affect the allocation or access of data storage. The two data-type modifiers are const and volatile .

declaration: A statement that gives the data type and possibly the storage class of one or more variables.

DEC/Shell: An optional OpenVMS software product available under a separate license that is a command-language interpreter based on the UNIX Version 7.0 Bourne Shell with commands for interactive program development, device and data file manipulation, and interactive and batch execution. DEC/Shell RTL functions were added to the DEC C RTL so that valid DEC/Shell file specifications could be used in DEC C for OpenVMS source programs. See also file specification.

dictionaries: A hierarchical organization, similar to the organization of directories and subdirectories, of data structure definitions in the CDD/Repository. See also CDD/Repository.

directives: See preprocessor directives.

elements: Members of an array. See also aggregate.

enumerated type: A type defined (with the enum keyword) to have an ordered set of integer values. The integer values are associated with constant identifiers named in the declaration. Although enum variables are stored internally as integers, use them in programs as if they have a distinct data type named in the enum declaration.

equality operator: One of the operators equal to ( == ) or not equal to (!=). They are similar to the relational operators, but at the next lower level of precedence.

exponentiation operator: The C language does not have an exponentiation operator. Use the DEC C RTL function exp .

expression: A series of characters that the compiler can use to produce a value. Expressions have one or more operands and, usually, one or more operators. An identifier with no operator is an expression that yields a value directly. Operands are either identifiers (such as variable names) or other expressions, which are sometimes called subexpressions. See also operator and macro.

external storage class: A storage class that permits identifiers to have a link-time scope that can possibly span object modules. Identifiers of this storage class are defined outside of functions using no storage-class specifier, and are declared, optionally, throughout the program using the extern specifier. External variables provide a means other than argument passing for exchanging data between the functions that comprise a C program. See also link-time scope.

file descriptor: In the UNIX environment, the integer that identifies a file.

file specification: An identifier that specifies an existing file. There are two types of valid file specifications in DEC C: OpenVMS specifications and DEC/Shell specifications. DEC/Shell specifications are a subset of UNIX specifications.

floating type: One of the data types float or double , representing a single- or double-precision, floating-point number. There are two implementations of the data type double : D_floating and G_floating. The range of values for the D_floating variables is the same as that for float variables, but the precision is 16 decimal digits, as opposed to 7. Programs that use G_floating variables must use the /FLOAT=G_FLOAT (or /G_FLOAT) command-line qualifier. A G_floating variable has considerably greater range, but has less precision.

function: The primary unit from which C programs are constructed. A function definition begins with a name and parameter list, followed by the declarations of the parameters (if any) and the body of the function enclosed in braces ({ }). The function body consists of the declarations of any local variables and the set of statements that perform its action. Functions do not have to return a value to the caller. All C functions are external; that is, a function may not contain another function. See also function call.

function call: A primary expression, usually a function identifier followed by parentheses, that is used to invoke the function. The parentheses contain a (possibly empty) comma-separated list of expressions that are the arguments to the function. Any previously undeclared identifier followed immediately by parentheses is declared as a function returning int . Any function may call itself recursively.

function inline expansion: A replacement of a function call with code that performs the actions of the defined function. This process reduces execution time. By default, DEC C attempts to expand inline all functions. You can use the #pragma inline directive to provide inline expansion for functions that DEC C does not expand inline by default. See also pragma.

function unrolling: See function inline expansion.

fundamental type: The set of arithmetic data types plus pointers. In general, the fundamental types comprise those data types that can be represented naturally on a VAX processor; usually, this means integers and floating-point numbers of various machine-dependent sizes, and machine addresses.

global storage class: A storage class that permits identifiers to have a link-time scope that can possibly span object modules. Identifiers of this storage class are defined using the globaldef storage-class specifier, and are declared, optionally, throughout the program using the globalref specifier. You can use the globalvalue specifier to define a global symbol, or constant. Global variables provide a means other than argument passing for exchanging data between the functions that comprise a DEC C program. See also link-time scope.

identifier: A sequence of letters and digits, the first 255 of which must be unique. The underscore (_) and dollar sign ($) are letters in this context. The first character of an identifier must be a letter. Upper- and lowercase letters specify different identifiers in DEC C. However, all external names are converted to uppercase to be consistent with the OpenVMS environment and are only 31 characters in length.

initializer: The part of a declaration that gives the initial value(s) for the preceding declarator. An initializer consists of an equal sign (=) followed by either a single expression or a comma-separated list of one or more expressions in braces.

inline expansion: See function inline expansion.

integral type: One of the data types char or int (all sizes, signed or unsigned).

internal storage class: A storage class that permits identifiers declared inside of a function body to be recognized only from the declaration to the end of the immediately enclosing block. Identifiers of the internal storage class are declared using the auto and register storage-class specifiers. See also scope.

keyword: A character string that is reserved by the C language and cannot be used as an identifier. Keywords identify statements, storage classes, data types, and the like. Library function names are not C keywords; you may redefine function names.

lexical scope: The area in which the compiler recognizes a declared identifier within a given compilation unit. See also scope.

License Management Facility (LMF): A process by which you register and use some Digital software products. See your DEC C installation guide for more information.

lifetime: The length of time for which storage for a variable is allocated. See also external storage class, internal storage class, and program section (psect).

link libraries: The libraries searched by the OpenVMS Linker to resolve external references. Depending on the needs of your program, you have to specify certain libraries in a specific order so that your program links properly. For more information, see Chapter 1.

link-time scope: The area in which the OpenVMS Linker recognizes an identifier within a given program. See also scope.

literal: A constant whose value is written explicitly in the program. Literal values have type int or double , depending on their forms. Character constants have type int . Floating constants have type double . Character-string constants have type array of char .

local variable: A variable declared inside a function body. See also internal storage class.

logical expression: An expression made up of two or more operands separated by a logical operator. Each operand must be a fundamental type or must be a pointer or other address expression. Operands do not have to be the same type. Logical expressions always return 1 or 0 (type int ) to indicate a true or false value, respectively. Logical expressions are always evaluated from left to right, and the evaluation stops as soon as the result is known.

logical operator: One of the binary operators logical AND (&&) and logical OR (||).

loop: A construct that executes a single statement or a block repeatedly until a given expression evaluates to false. The single statement or block is called the loop body. The C language has three types of loops: one that evaluates the expression before executing the loop body (the while statement), one that evaluates the expression after executing the loop body (the do statement), and one that executes the loop body a specified number of times (the for statement).

lvalue: The address in memory that is the location of an object whose contents can be assigned or modified. In this guide, the term describes a category in C grammar. An expression evaluating to an lvalue is required on the left side of an assignment operator (hence its name) and as the operand of certain other operators, such as the increment (++) and decrement ( - - ) operators. A variable name is an example of an expression evaluating to an lvalue, since its address can be taken (with &), and values can be assigned to it. A constant is an example of an expression that is not an lvalue. See also rvalue.

macro: A text substitution that is defined with the #define preprocessor directive and can include a list of parameters. The parameters in the #define directive are replaced at compile time with the corresponding arguments from a macro reference encountered in the source text.

main_program option: A tag that can be placed on a separate line between the function parameter list and the rest of a function definition to tell the OpenVMS image activator to begin program execution with this function. You can use the main_program identifier when there is no function named main ; it is not a keyword; it can be spelled in upper- or lowercase; and it is specific to DEC C for OpenVMS Systems.

members: Segments of the aggregate data structures (arrays, structures, or unions) that are declared to be of either scalar or aggregate data type. See also aggregate.

module:


multiplication operator: An operator that performs multiplication (*), division (/), or modular arithmetic (%). If necessary, it performs the arithmetic conversions on its operands. The mod operator (%) yields the remainder of the first operand divided by the second.

null pointer: A pointer variable that has not been assigned an lvalue and whose value has been initialized to 0. If you use a null pointer in an expression that needs a value, the compiler will let you try to access memory location 0, which will cause the ACCVIO hardware error. The null macro can be used when comparing for a null pointer. It is defined in both the <stdio.h> and <stddef.h> header files as follows:


(void *) 0 

null character: The escape sequence (\0) that DEC C uses to terminate all character strings. The null macro can be used when comparing for null characters. It is defined in both the <stdio.h> and <stddef.h> header files as follows:


(void *) 0 

object: Data stored at a location in memory represented by an identifier. Objects are one of the basic elements that the language can manipulate; that is, the elements to which operators can be applied. In C, objects include data (such as integers, real numbers, or characters), data structures (arrays, structures, or unions), and functions.

occlude: In the Curses Screen Management package, when the area of one defined window overlaps the area of another defined window on the terminal screen. See also Curses.

operator: A character that performs an operation on one or more operands. In order of precedence (high to low), operators are classified as the primary-expression operators, unary operators, binary operators, the conditional operator, assignment operators, and the comma operator.


Previous Next Contents Index