DaTToAtV.sgm 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!-- $XConsortium: DaTToAtV.sgm /main/6 1996/09/08 20:21:27 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCDI.MAN34.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCDI.MAN34.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtDtsDataTypeToAttributeValue</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtDtsDataTypeToAttributeValue</Function></RefName>
  17. <RefPurpose>get an attribute value for a specified data type
  18. </RefPurpose>
  19. </RefNameDiv>
  20. <!-- CDE Common Source Format, Version 1.0.0-->
  21. <!-- (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
  22. <!-- (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
  23. <!-- (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
  24. <!-- (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
  25. <RefSynopsisDiv>
  26. <FuncSynopsis Remap="ANSI">
  27. <FuncSynopsisInfo>#include &lt;Dt/Dts.h>
  28. </FuncSynopsisInfo>
  29. <FuncDef>char <Function>*DtDtsDataTypeToAttributeValue</Function></FuncDef>
  30. <ParamDef>const char *<Parameter>datatype</Parameter></ParamDef>
  31. <ParamDef>const char *<Parameter>attr_name</Parameter></ParamDef>
  32. <ParamDef>const char *<Parameter>opt_name</Parameter></ParamDef>
  33. </FuncSynopsis>
  34. </RefSynopsisDiv>
  35. <RefSect1>
  36. <Title>DESCRIPTION</Title>
  37. <Para>The
  38. <Function>DtDtsDataTypeToAttributeValue</Function> returns an attribute value for the specified data type name.
  39. </Para>
  40. <Para>The
  41. <Emphasis>datatype</Emphasis> argument is a pointer to a data type name string.
  42. </Para>
  43. <Para>The
  44. <Emphasis>attr_name</Emphasis> argument is a name of the attribute.
  45. </Para>
  46. <Para>The
  47. <Emphasis>opt_name</Emphasis> argument can be used to specify a name to be associated with the
  48. data type.
  49. If the
  50. <Emphasis>opt_name</Emphasis> argument is not
  51. <SystemItem Class="Constant">NULL</SystemItem>, it is used as a pseudo file name in typing;
  52. otherwise, certain attributes may be returned as
  53. <SystemItem Class="Constant">NULL</SystemItem> because the filename components could not be determined.
  54. </Para>
  55. </RefSect1>
  56. <RefSect1>
  57. <Title>RETURN VALUE</Title>
  58. <Para>Upon successful completion, the
  59. <Function>DtDtsDataTypeToAttributeValue</Function> function returns a pointer to a data attribute value string, or
  60. <SystemItem Class="Constant">NULL</SystemItem> if no value could be determined.
  61. </Para>
  62. </RefSect1>
  63. <RefSect1>
  64. <Title>APPLICATION USAGE</Title>
  65. <Para>The application should use the
  66. &cdeman.DtDtsFreeAttributeValue; function to release the memory for the returned value.
  67. </Para>
  68. <Para>The
  69. <Emphasis>opt_name</Emphasis> argument is useful when the attribute being returned
  70. contains a modifier string that depends on having
  71. a file name included.
  72. For example, if the
  73. <SystemItem Class="Constant">INSTANCE_ICON</SystemItem> attribute had the value
  74. <Literal>%name%.icon</Literal>, <Emphasis>opt_name</Emphasis> would be used to derive the
  75. <Literal>%name%</Literal> portion of the attribute value.
  76. See
  77. <![ %CDE.C.CDE; [&cdeman.dtdtsfile;. ]]><![ %CDE.C.XO; [<XRef Linkend="XCDI.M4DTS.anch.6" Role="4">. ]]></Para>
  78. </RefSect1>
  79. <RefSect1>
  80. <Title>EXAMPLES</Title>
  81. <Para>The following takes a list of files as arguments
  82. and determines the description and actions for each file:
  83. </Para>
  84. <InformalExample>
  85. <ProgramListing>#include &lt;Dt/Dts.h>
  86. #define ATTRIBUTE1 "DESCRIPTION"
  87. #define ATTRIBUTE2 "ACTIONS"
  88. main (int argc, char **argv)
  89. {
  90. char *attribute;
  91. char *datatype;
  92. /* load data types database */
  93. DtDtsLoadDataTypes();
  94. argv++;
  95. while (*argv) {
  96. /* get data type file file */
  97. datatype = DtDtsFileToDataType(*argv);
  98. /* get first attribute for datatype */
  99. attribute = DtDtsDataTypeToAttributeValue(datatype,
  100. ATTRIBUTE1, *argv);
  101. if (attribute)
  102. printf("%s for file %s is %s&bsol;n",
  103. ATTRIBUTE1, *argv, attribute);
  104. /* get second attribute for datatype */
  105. attribute = DtDtsDataTypeToAttributeValue(datatype,
  106. ATTRIBUTE2, NULL);
  107. if (attribute)
  108. printf("%s for file %s is %s&bsol;n",
  109. ATTRIBUTE2, *argv, attribute);
  110. argv++;
  111. }
  112. DtDtsRelease();
  113. exit(0);
  114. }
  115. </ProgramListing>
  116. </InformalExample>
  117. </RefSect1>
  118. <RefSect1>
  119. <Title>SEE ALSO</Title>
  120. <Para><Filename Role="Header">Dt/Dts.h</Filename>, &cdeman.DtDtsFileToDataType;, &cdeman.DtDtsLoadDataTypes;, &cdeman.DtDtsRelease;, &cdeman.DtDtsFreeAttributeValue;.</Para>
  121. </RefSect1>
  122. </RefEntry>
  123. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:18:47-->