pe_predefined_unit

Creates a table of predefined units

Usage syntax

PE_TABLE pe_predefined_unit (int *n);

Parameters
n The number of rows in the table is returned in this parameter
Description

This function returns a list of all units, which includes angular and linear ones. The table is an array of rows with the following structure: 

typedef struct pe_entry_t
{
     int code;
     char name[PE_NAME_MAX];
}  *PE_TABLE;

If PEOBJEDITHOME is set, the table includes user-defined unit objects. Free the table with pe_table_del.

Returns

On success, returns the table; on failure, returns a null pointer

Examples 

PE_TABLE units;
int n, i;
units = pe_predefined_unit(&n);
for ( i=0; i<n; i++ )
{
   printf("%d %s\n", units[i].code, units[i].name);
}