DatToDaT.sgm 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!-- $XConsortium: DatToDaT.sgm /main/6 1996/09/08 20:21:36 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.MAN30.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCDI.MAN30.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtDtsDataToDataType</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtDtsDataToDataType</Function></RefName>
  17. <RefPurpose>get the data type for a set of data
  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>*DtDtsDataToDataType</Function></FuncDef>
  30. <ParamDef>const char *<Parameter>filepath</Parameter></ParamDef>
  31. <ParamDef>const void *<Parameter>buffer</Parameter></ParamDef>
  32. <ParamDef>const int <Parameter>size</Parameter></ParamDef>
  33. <ParamDef>const struct stat *<Parameter>stat_buff</Parameter></ParamDef>
  34. <ParamDef>const char *<Parameter>link_path</Parameter></ParamDef>
  35. <ParamDef>const struct stat *<Parameter>link_stat_buff</Parameter></ParamDef>
  36. <ParamDef>const char *<Parameter>opt_name</Parameter></ParamDef>
  37. </FuncSynopsis>
  38. </RefSynopsisDiv>
  39. <RefSect1>
  40. <Title>DESCRIPTION</Title>
  41. <Para>The
  42. <Function>DtDtsDataToDataType</Function> function determines
  43. the data type of a set of data,
  44. based on the information given in the non-
  45. <SystemItem Class="Constant">NULL</SystemItem> pointer arguments to the function.
  46. The function gathers any additional information, if it is needed,
  47. to compensate for the
  48. <SystemItem Class="Constant">NULL</SystemItem> arguments.
  49. For example, if the
  50. <Emphasis>filepath</Emphasis> argument is given, but the
  51. <Emphasis>stat_buff</Emphasis> argument is
  52. <SystemItem Class="Constant">NULL</SystemItem> and a
  53. <Emphasis>stat_buff</Emphasis> value is required to determine the data type,
  54. <Function>DtDtsDataToDataType</Function> calls the
  55. <Function>stat</Function>(2) function to obtain the information.
  56. </Para>
  57. <Para>The
  58. <Emphasis>filepath</Emphasis> argument is the pathname of a file.
  59. </Para>
  60. <Para>The
  61. <Symbol Role="Variable">buffer</Symbol> argument
  62. is a pointer to the buffer of the data to be typed.
  63. </Para>
  64. <Para>The
  65. <Symbol Role="Variable">size</Symbol> argument
  66. is the size of the buffer in bytes.
  67. </Para>
  68. <Para>The
  69. <Emphasis>stat_buff</Emphasis> argument
  70. is the buffer returned from a
  71. <Function>stat</Function>(2) or
  72. <Function>fstat</Function>(3) call for use in typing.
  73. </Para>
  74. <Para>The
  75. <Emphasis>link_path</Emphasis> argument
  76. is the pathname of the target file pointed to by a symbolic link.
  77. </Para>
  78. <Para>The
  79. <Emphasis>link_stat_buff</Emphasis> argument
  80. is the buffer returned from an
  81. <Function>lstat</Function>(2) call for use in typing.
  82. </Para>
  83. <Para>The
  84. <Emphasis>opt_name</Emphasis> argument can be used to specify a name to be associated with the buffer.
  85. If the
  86. <Emphasis>opt_name</Emphasis> argument is not
  87. <SystemItem Class="Constant">NULL</SystemItem>, it is used as a pseudo file name in typing;
  88. otherwise, certain attributes may be returned as
  89. <SystemItem Class="Constant">NULL</SystemItem> because the filename components could not be determined.
  90. </Para>
  91. </RefSect1>
  92. <RefSect1>
  93. <Title>RETURN VALUE</Title>
  94. <Para>Upon successful completion, the
  95. <Function>DtDtsDataToDataType</Function> function returns a pointer to a data type string, or
  96. <SystemItem Class="Constant">NULL</SystemItem> if no value could be determined.
  97. </Para>
  98. </RefSect1>
  99. <RefSect1>
  100. <Title>APPLICATION USAGE</Title>
  101. <Para>The
  102. <Function>DtDtsDataToDataType</Function> function is generally used by applications such as file managers
  103. to improve performance.
  104. Typical applications should probably use
  105. &cdeman.DtDtsFileToDataType; or
  106. &cdeman.DtDtsBufferToDataType; instead.
  107. </Para>
  108. <Para>The
  109. <Emphasis>DtDtsBuffer</Emphasis>* functions assume that the buffer is readable and writable
  110. by the user, group and other file classes
  111. and select a type accordingly.
  112. An application requiring a type based on read-only
  113. permissions should use
  114. <Function>DtDtsDataToDataType</Function> with a
  115. <Emphasis>stat_buff</Emphasis> value created for this purpose:
  116. all fields should
  117. <SystemItem Class="Constant">NULL</SystemItem> except for the
  118. <Emphasis>st_mode</Emphasis> field,
  119. which should be set to:
  120. </Para>
  121. <InformalExample Remap="indent">
  122. <ProgramListing>S_IFREG | S_IROTH | S_IRGRP | S_IRUSR
  123. </ProgramListing>
  124. </InformalExample>
  125. </RefSect1>
  126. <RefSect1>
  127. <Title>SEE ALSO</Title>
  128. <Para><Filename Role="Header">Dt/Dts.h</Filename>, &cdeman.DtDtsLoadDataTypes;, &cdeman.DtDtsFileToDataType;, <![ %CDE.C.CDE; [&cdeman.DtDtsBufferToDataType;, <Function>fstat</Function>(3), <Function>lstat</Function>(2), <Function>stat</Function>(2). ]]><![ %CDE.C.XO; [&cdeman.DtDtsBufferToDataType;; <Function>fstat</Function>(3), <Function>lstat</Function>(2), <Function>stat</Function>(2) in the &str-ZK;.
  129. ]]></Para>
  130. </RefSect1>
  131. </RefEntry>
  132. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:18:47-->