| United States-English |
|
|
|
![]() |
Common Desktop Environment: Programmer's Guide > Chapter 9 Accessing
the Data-Typing DatabaseData-Typing Functions |
|
To look up an attribute for a data object, you must first determine the type of the object and then ask for the appropriate attribute value for that type. The functions that you can use to query the database for data information are shown in Table 9-4 “Data-Typing Database Query Functions” Each of these functions has a man page in section 3. Refer to the appropriate man page for more information. Table 9-4 Data-Typing Database Query Functions
You can type data and retrieve attributes in one of three ways: simple, intermediate, or advanced. The simplest way to type data is to use the following functions:
When you use these functions, a file is typed and a single attribute, or the entire list, is retrieved. System calls are made, data is typed, and the attribute is retrieved. These functions call the intermediate data-typing functions.
Buffers are assumed to have a mode that matches regular files that have read/write permissions. See “Advanced Data Typing” to type read-only buffers. When you type data and retrieve attributes, the data-typing part of the process is the most expensive in terms of performance. You can type data in a second way that improves performance by separating the data-typing and attribute- retrieval functions. Use the following functions for intermediate data typing:
Use these functions if your application queries for more than a single attribute value. When you use these functions, an object is typed and then that type is used to retrieve one or more attributes from the attribute list. Using the intermediate data-typing functions is the recommended way to type data and retrieve attributes. These functions call the advanced data-typing functions and make the same assumptions about buffers as the simpler data typing. Advanced data typing separates system calls, data typing, and attribute retrieval even further. Advanced data typing is more complicated to code because it uses data from existing system calls, which are initialized in advance and are not included as part of the data-typing function. Use the following function for advanced data typing: DtDtsDataToDataType To type a read-only buffer, a stat structure should be passed that has the st_mode field set to S_IFREG | S_IROTH | S_IRGRP | S_IRUSR. For every action in a database a synthetic data type is generated when a database is loaded that allows actions to be typed. These data types may have two additional attributes:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||