![]() |
![]()
| ![]() |
![]()
NAMEdtdtsfile — format and location of desktop data type and action files SYNOPSISset DtDbVersion=version_number set VariableName=variable_value RecordType record_name { DESCRIPTIONThe XCDE data types database provides definitions for the data types and actions recognized by XCDE clients. The general syntax of the data types files is as described above in the SYNOPSIS section of this man page. The set of general constructs composing the database entries is as follows: CommentsAny line whose first non-space character is # is treated as a comment line, and is ignored during the reading of the database file. Database VersionThe database loader supports a version number, which indicates the version of the database syntax used by a particular database file. If a database version number is not specified, then the database loader assumes that the file uses the version 1.0 syntax, described here. If a database file specifies a version number, then it must be the first non-blank, non-comment line in the database file; if the version is specified anywhere else in the file, then an error message is generated, and the remainder of that database file is ignored. The database version number is specified using the following syntax: set DtDbVersion=version_number
String VariablesDatabase records can reference string variables that are set within the database file. The scope of a string variable is restricted to only those record definitions within the database file defining the string variable. A string variable is defined using the following syntax: set VariableName=variable_value String variables are referenced using either of the standard shell variable referencing syntaxes: $variable_name or ${ variable_name}. A variable name can be made up of any of the alphanumeric characters and the underscore. Environment VariablesDatabase records may refer to environment variables, using either of the standard shell variable referencing syntaxes: $environment_variable or ${environment_variable}. If the environment variable name conflicts with a string variable name, the string variable takes precedence. Line ContinuationAny field within a record can be continued onto another line by ending the line with a character. The and any <blank>s following the and preceding the newline are discarded; leading <blank>s on the following line are preserved in the continued field. Record NameThe first line of a record is made up of the record type, RecordType (one of: DATA_ATTRIBUTES, DATA_CRITERIA or ACTION), followed by the record name, record_name, which is henceforth used to identify this record. The record_name string must be coded in ASCII and must be uniquely named across the data attributes, data criteria and actions tables. Record DelimitersAfter the record name has been located, the set of corresponding fields is delimited by the { and } characters. Each of these characters must appear on a line by itself. FieldsThe fields are all of the non-comment lines found between the record delimiters. They are composed of keyword/value pairs. The FieldName string must be coded in ASCII. The field_value may be coded in additional, implementation-dependent, code sets, except that any literal string values shown in Data Criteria Format, below, string must be coded in ASCII. Record TypesThere are three recognized record types in database files used for data types (and actions):
These three kinds of database record can appear together in the same file or they can be segregated into separate files. See dtaction(1) for the file format of ACTION records. DATA_CRITERIA RECORDSThe first seven subsections of this section describe the FieldName s supported for data criteria records. The remaining subsections describe formatting and sorting information for data criteria records. NAME_PATTERN FieldA shell pattern-matching expression describing the file names that could match this data. See Pattern Matching Notation. The default is an empty string, which means to ignore file patterns in matching. If the data to be matched is in a buffer, rather than a file, the NAME_PATTERN expression is evaluated against the opt_name value given to DtDtsBufferToDataType(3) and related functions. PATH_PATTERN FieldA shell pattern-matching expression describing the absolute pathnames that could match this data. See Pattern Matching Notation. The default is an empty string, which means to ignore path patterns in matching. The PATH_PATTERN expression is used only for matching data in files; it does not affect matching of data in buffers. CONTENT FieldStrings that match on the contents of a file, buffer or directory: offset type value(s) The offset string is a positive decimal integer number of octets from the beginning of the file or buffer, where the first value is tested. The offset value is ignored for the filename type. The type string is one of the following:
The default CONTENT is an empty field, which means to ignore contents in matching. The CONTENT field applies to data in both files and buffers. Examples of two data criteria records with CONTENT fields are: DATA_CRITERIA PCL1 { MODE FieldA string of zero to four characters that match the mode field of a stat structure (see stat(2)). The first character indicates:
The first, or subsequent characters, can also be:
For example, the MODE field of frw matches any regular file that is readable or writable; x matches any file with any of its executable or search bits set. The default is an empty field, which means to ignore the mode in matching. If the data to be matched is in a buffer, rather than a file, the buffer is processed as if it had a mode of fr. LINK_NAME FieldA shell pattern-matching expression describing the filename component (basename) of the filename the symbolic link points to that could match this data. See Pattern Matching Notation. The default is an empty expression, which means to ignore symbolic link names in matching. LINK_NAME points to the file itself, not to the name of the file. The LINK_NAME expression is used only for matching data in files; it does not affect matching of data in buffers. LINK_PATH FieldA shell pattern-matching expression describing the absolute pathname of the file pointed to by the symbolic link that could match this data. See Pattern Matching Notation. The default is an empty expression, which means to ignore symbolic link name in matching. The LINK_PATH expression is used only for matching data in files; it does not affect matching of data in buffers. DATA_ATTRIBUTES_NAME FieldThe name of this type of data. This value is a record_name in the data attributes table. Pattern Matching NotationThe pattern-matching text field permits use of the shell pattern-matching characters *, ?, and []. The asterisk (*) matches any set of characters, the question mark (?) matches a single character, and the square brackets ([]) match any one of a set of characters enclosed in the square brackets. The full definition of shell pattern matching is in the X/Open CAE Specification, Commands and Utilities, Issue 4. Logical ExpressionsThe logical operators AND (&&), OR (|) and NOT (!) can be used in any of the data criteria fields, except for DATA_ATTRIBUTES_NAME, as shown in Data Criteria Format, below. The resultant expressions are evaluated from left to right. White SpaceWhite space is used to delimit tokens, as shown by the blanks and newline terminals in Data Criteria Format, below. Within the pattern terminal, however, leading and trailing white space not explicitly shown in the grammar is significant to the expression. For example, NAME_PATTERN abc | def
is matched by either `` abc '' (with a trailing <space>) or `` def'' (with a leading <space>). Escape CharacterShell pattern-matching and logical expression characters can be escaped and used as literal characters by preceding the character with a backslash (. For example, is interpreted as an asterisk, as a question mark and it with a backslash (\). Data Criteria FormatThe following pseudo-BNF describes the data criteria variable definition:
Data Criteria SortingThere may be multiple data criteria records that could match a file or data. This subsection describes the sorting process used by the XCDE data typing services. The more specific criteria are sorted toward the top of the list and the more general criteria toward the bottom. The data criteria record selected is the first match found on the resulting sorted list. The following sorting rules are applied in sequence to each possible pair of data criteria records. If a rule determines that one data criteria record is more specific than another, the two records are positioned in the list so that the more specific comes before the less specific; otherwise, the next rule in sequence is applied.
Two records still equal after executing the preceding rules are ordered in an unspecified sequence. DATA_ATTRIBUTES RECORDSThe following FieldNames are supported for data attribute records. Each of the FieldNames is identical to the corresponding name member string of a DtDtsAttribute structure; see Dt/Dts.h. DESCRIPTION FieldA textual description of the data that is suitable for presentation to a user requesting information about the data. The description should contain no formatting information such as tab or newline characters. The application that presents the information to the user formats the information. If this field is NULL or is not included in the data attribute record, the name of the data attribute should be used. ICON FieldThe name of the icon to use for this data. If this field is NULL or is not included in the data attribute record, a default value ( Dtactn for an executable file or Dtdata for other data) should be used. Icons are found by using the standard XCDE icon search path, so the value can be either an absolute pathname (for example, /foo/icons/myicon.bm), a relative pathname (for example, icons/myicon.bm) or a partial filename (for example, myicon). Partial filenames are preferred because they allow the XCDE icon search path to find the icon with the optimum size and depth for the current environment. INSTANCE_ICON FieldThe name of the icon to use for this instance of data. The contents of this field are as described in ICON Field, above. If INSTANCE_ICON is set, the application should use it instead of ICON. If this field is NULL or is not included in the data attribute record, the ICON field should be used. An example value of INSTANCE_ICON is %name%.icon, which would select an icon based on a specific filename, rather than on a generic data type. PROPERTIES FieldKeywords to indicate properties for this data. Valid values are visible and invisible. These provide guidance to an application such as a file manager about whether a file should be visibly displayed to the user. If this field is NULL or is not included in the data attribute record, the visible property should be assumed. ACTIONS FieldA comma-separated list of actions that can be performed on this data. This list refers to names in the action table for actions that can be performed on this data. If this field is NULL or is not included in the data attribute record, no action is available. NAME_TEMPLATE FieldA string used to create a new file for data of this type. The string is intended to be passed to sprintf(3) with the file name as the single argument. For example: %s.mif. The default is empty. (This field is contrasted with the NAME_PATTERN field of the data criteria table in that the template is used to create a specific file, such as %s.c, whereas the pattern is used to find files, such as *.c). IS_EXECUTABLE FieldA string-Boolean value that tells users of this data type that it can be executed as an application. If IS_EXECUTABLE is a true value (as determined by the DtDtsIsTrue function), the data is executable; if this field is NULL, is not included in the data attribute record or is not true, then the data is considered not executable. MOVE_TO_ACTION FieldThe name of an action to be invoked when an object is moved to the current object using a drag and drop operation. The MOVE_TO_ACTION, COPY_TO_ACTION and LINK_TO_ACTION fields cause an action to be invoked with the drop target as the first of the DtActionArg arguments to the DtActionInvoke function, and the drag sources as the remaining DtActionArg arguments. However, if the drop target is an action itself, it is omitted from the DtActionArg list. For example, using the syntax of the dtaction utility, if objects A and B are dropped onto non-action object C: dtaction action-name C A B If C is an action: dtaction action-name A B COPY_TO_ACTION FieldThe name of an action to be invoked when an object is copied to the current object using a drag and drop operation. LINK_TO_ACTION FieldThe name of an action to be invoked when an object is linked to the current object using a drag and drop operation. IS_TEXT FieldA string-Boolean value that tells users of this data type that it is suitable for manipulation (viewing or editing) in a text editor or text widget. The IS_TEXT field should be set to a true value (as determined by the DtDtsIsTrue function) if the data is textual in nature and if it should be presented to the user in textual form. Criteria for making this determination include whether the data:
If the IS_TEXT field is a true value, this indicates that the data is eligible to be displayed directly by an application. That is, the application can load the data directly into a text editing widget (for example, XmText) instead of invoking an action on the data. An example of this occurs in the XCDE mail services: if the first part of a multipart message has IS_TEXT true, then it is displayed in the text area of the message view window. Otherwise, the text area will contain only message headers and the first part of the message will be displayed as an icon in the attachment pane. It is immaterial whether the data can be loaded into an XmText widget--even binary data can be--but rather whether the data should be loaded into an XmText widget. Note that the IS_TEXT field differs from the text attribute of the MIME_TYPE field, which is the MIME content-type, as described in RFC 1341. The MIME content-type determines whether the data consists of textual characters or byte values. If the data consists of textual characters and is labelled as text/*, the IS_TEXT field determines whether it is appropriate for the data to be presented to users in textual form. Examples of common data types include recommendations of the appropriate value of IS_TEXT:
MIME_TYPE text/plain IS_TEXT true
MIME_TYPE text/plain; charset=XXX IS_TEXT true
MIME_TYPE text/plain IS_TEXT false
MIME_TYPE text/html IS_TEXT true
MIME_TYPE application/postscript IS_TEXT false
MIME_TYPE text/plain IS_TEXT true
MIME_TYPE text/plain IS_TEXT false
MIME_TYPE text/plain IS_TEXT false
MIME_TYPE text/plain IS_TEXT false
MIME_TYPE text/plain IS_TEXT false
MIME_TYPE text/plain IS_TEXT false MEDIA FieldThe names in the MEDIA name space describe the form of the data itself. MEDIA names are used as ICCCM selection targets; they are named in the MEDIA field of data type records; and they are used in the type parameter of ToolTalk Media Exchange messages. The MEDIA name space is a subset of the name space of selection target atoms as defined by the ICCCM. All selection targets that specify a data format are valid MEDIA names, and all valid MEDIA names can be used directly as selection targets. Some selection targets specify an attribute of the selection (for example, LIST_LENGTH) or a side effect to occur (for example, DELETE), rather than a data format. These attribute selection targets are not part of the MEDIA name space. MIME_TYPE FieldMEDIA is the XCDE internal, unique name for data types. However, other external naming authorities have also established name spaces. MIME (Multipurpose Internet Message Extensions), as described in the referenced MIME RFCs, is one of those external registries, and is the standard type name space for the XCDE mail system. X400_TYPE FieldX.400 types are similar in structure to the MEDIA type, but are formatted using different rules and have different naming authorities. DATA_HOST AttributeThe DATA_HOST attribute is not a field that can be added to the data attributes table when it is in a file, but it may be returned to an application reading attributes from the table. The data typing service adds this attribute automatically to indicate the host system from which the data type was loaded. If this field is NULL or is not included in the data attribute record, the data type was loaded from the local system. ModifiersThe following modifiers can be used in the values of the data attributes to modify the runtime values:
Strings enclosed in backquotes (`) are processed with the popen function and the output replaces the backquotes and string. Data Attributes FormatThe following pseudo-BNF describes the data attributes variable definition:
EXAMPLESThe following are examples of data attribute and data criteria entries in the data typing database: DATA_ATTRIBUTES C_SRC { DATA_CRITERIA C_SRC1 { DATA_ATTRIBUTES POSTSCRIPT { DATA_CRITERIA POSTSCRIPT1 { ERRORSErrors encountered when loading database files are written to the CDE errorlog file. Records containing errors are rejected. SEE ALSOdttypes(1), DtDtsIsTrue(3), dtdtfile(4), dtactionfile(4).
|