The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

DtDataTyping (3)
  • >> DtDataTyping (3) ( Solaris man: Библиотечные вызовы )
  • 
    NAME
         DtDataTyping,    DtDtsLoadDataTypes,    DtDtsDataToDataType,
         DtDtsFileToDataType,               DtDtsFileToAttributeList,
         DtDtsFileToAttributeValue , DtDtsBufferToDataType, DtDtsBuf-
         ferToAttributeList,  DtDtsBufferToAttributeValue, DtDtsData-
         TypeToAttributeList,          DtDtsDataTypeToAttributeValue,
         DtDtsFreeDataType, DtDtsFreeAttributeList, DtDtsFreeAttribu-
         teValue, DtDtsRelease,  DtDtsDataTypeNames,  DtDtsFindAttri-
         bute,  DtDtsFreeDataTypeNames,  DtDtsSetDataType, DtDtsData-
         TypeIsAction - Data Typing operations
    
    SYNOPSIS
         #include <Dt/Dts.h>
    
    
         void      DtDtsLoadDataTypes(void);
         void      DtDtsRelease(void);
    
         char      *DtDtsDataToDataType(
                             const char          *filepath,
                             const void          *buffer,
                             const int      size,
                             const struct stat   *stat_buff,
                             const char          *link_path,
                             const struct stat   *link_stat_buff,
                             const char          *opt_name);
    
         char      *DtDtsFileToDataType(const char *filepath);
         char      *DtDtsFileToAttributeValue(
                             const char          *filepath,
                             const char          *attr_name);
         DtDtsAttribute **DtDtsFileToAttributeList(const char *filepath);
    
         char      *DtDtsBufferToDataType(
                             const void          *buffer,
                             const int      size,
                             const char          *opt_name);
         char      *DtDtsBufferToAttributeValue(
                             const void          *buffer,
                             const int      size,
                             const char          *attr_name,
                             const char          *opt_name);
         DtDtsAttribute **DtDtsBufferToAttributeList(
                             const void          *buffer,
                             const int      size,
                             const char          *opt_name);
    
         char      *DtDtsDataTypeToAttributeValue(
                             const char          *datatype,
                             const char          *attr_name,
                             const char          *opt_name);
         DtDtsAttribute **DtDtsDataTypeToAttributeList(
                             const char          *datatype,
                             const char          *opt_name);
    
         void      DtDtsFreeDataTypeNames(char **namelist);
         void      DtDtsFreeAttributeList(DtDtsAttribute **attr_list);
         void      DtDtsFreeAttributeValue(char *attr_value);
         void      DtDtsFreeDataType(char *datatype);
    
         char      **DtDtsDataTypeNames(void);
    
         char      **DtDtsFindAttribute(
                             const char          *attr_name,
                             const char          *attr_value);
    
         char      *DtDtsSetDataType(
                             const char          *filepath,
                             const char          *datatype,
                             const int      override);
    
         int       DtDtsDataTypeIsAction(const char *datatype);
    
         Where:
    
         filepath  the pathname of file.
         buffer         a pointer to the buffer of the data to be typed.
         size      the size of the buffer.
         stat_buff the buffer from stat/fstat call for use in typing.
         link_path the pathname of the original file that a link points to.
         link_stat_buff the buffer from lstat call for use in typing.
         opt_name  a name that may be associated with a buffer.
         datatype  a DataType
         attr_name a name of an attribute
         attr_list a list of attribute/value pairs defined by the DtDtsAttribute
                   structure.
         attr_value     a value of an attribute.
         namelist  a list of datatype names
         override  If false will not change the value if it is currently set.
    
         DtDtsAttribute is a structure with the following entries:
              char *name;
              char *value;
    
    
    
    AVAILABILITY
         _description-of-restriction_
    
    DESCRIPTION
         DtDtsDataToDataType,    DtDtsDataTypeToAttributeValue    and
         DtDtsDataTypeToAttributeList   are  the  primary  datatyping
         functions, the DtDtsFileTo* and DtDtsBufferTo* are  conveni-
         ence functions to these primary routines.
         DtDtsLoadDataTypes Initialize and loads the Database  fields
         for the DataTyping functions.
    
         DtDtsRelease Releases the data structures and  data  associ-
         ated  with  the  datatype database, generally in preparation
         for a reload.
    
    
         DtDtsFileToDataType Returns datatype name for a  given  file
         path.Note:  the  file  and  buffer functions are convenience
         functions for this routine and should probably be  used  for
         simplicity. Call DtDtsFreeDataType to release the memory for
         the value.
    
    
         DtDtsFileToAttributeValue returns a data attribute value for
         a  given  file path. Call DtDtsFreeAttributeValue to release
         the memory for the returned value
    
         DtDtsFileToAttributeList Returns a NULL terminated array  of
         pointers  of  *DtDtAttribute  for  a  given  file path. Call
         DtDtsFreeAttributeList  to  release  the  memory   for   the
         returned value
    
    
         DtDtsBufferToDataType Returns a data type name for  a  given
         byte  stream.  Call  DtDtsFreeDataType to release the memory
         for the returned value. If opt_name is not NULL it  will  be
         used as a psudeo file name in typing.
    
         DtDtsBufferToAttributeValue Returns a data  attribute  value
         for  a  given  byte  stream. Call DtDtsFreeAttributeValue to
         release the memory for the returned value.  If  opt_name  is
         NULL certain attributes will be returned as NULL because the
         "filename" components could not be determined.
    
         DtDtsBufferToAttributeList Returns a NULL  terminated  array
         of  pointers of *DtDtAttribute for a given byte stream. Call
         DtDtsFreeAttributeList  to  release  the  memory   for   the
         returned  value. If opt_name is NULL certain attributes will
         be returned as NULL because the "filename" components  could
         not be determined.
    
         DtDtsDataToDataType Returns data type for  a  given  set  of
         data.  Call  DtDtsFreeDataType to release the memory for the
         returned value. Pointer values may be passed as a NULL. If a
         pointer  value is NULL the system will try and determine the
         appropriate value for it only if it is  need  in  doing  the
         typing.
    
         DtDtsDataTypeToAttributeList Returns a NULL terminated array
         of  pointers  of  *DtDtAttribute  for a given datatype name.
         Call DtDtsFreeAttributeList to release the  memory  for  the
         returned  value. If opt_name is NULL certain attributes will
         be returned as NULL because the "filename" components  could
         not be determined.
    
         DtDtsDataTypeToAttributeValue  Returns  the  data  attribute
         value  for  a  given  datatype  name. Call DtDtsFreeAttribu-
         teValue to release the memory for  the  returned  value.  If
         opt_name is NULL certain attributes will be returned as NULL
         because the "filename" components could not be determined.
    
         DtDtsDataTypeNames Returns a list of all available datatypes
         that  is  currently loaded into the DataTypes database. Call
         DtDtsFreeDataTypeNames  to  release  the  memory   for   the
         returned value
    
         DtDtsFreeDataType Frees the memory of a datatype name.
    
         DtDtsFreeDataTypeNames Frees the memory of a list  of  data-
         type name.
    
         DtDtsFreeAttributeList Frees  the  memory  of  an  attribute
         list.
    
         DtDtsFreeAttributeValue Frees the  memory  of  an  attribute
         value.
    
         DtDtsFindAttribute Finds the list of datatypes that have the
         attribute  "name"  that  equal  "value". Call DtDtsFreeData-
         TypeNames to release the memory for the returned value
    
         DtDtsSetDataType Sets a datatype on a directory and  returns
         the  current  datatype  on  the  object. If unable to set or
         retrieve the datatype a NULL is returned.
    
         DtDtsDataTypeIsAction Check if the specified datatype is one
         loaded by the action tables.
    
    
    RETURN VALUES
         Pointer        See Description.
    
    
         NULL           If no value could be determined.
    
    EXAMPLES
      Simple-FileTyping
         This example takes a list of files as arguments  and  deter-
         mines the Description of that datatype.
    
              #include <Dt/Dts.h>
    
              #define   ATTRIBUTE "DESCRIPTION"
    
              main(int argc, char **argv)
              {
                   char *attribute;
    
                   /* load datatypes database */
                   DtDtsLoadDataTypes();
    
                   argv++;
                   while(*argv) {
                        /* get attribute for file */
                        attribute = DtDtsFileToAttributeValue(*argv, ATTRIBUTE);
    
                        if(attribute) {
                             printf("%s: %s0, *argv, attribute);
                        }
                        argv++;
                   }
                   DtDtsRelease();
                   exit(0);
              }
    
    
      Simple-DataTyping
         This example takes a list of files as arguments  and  deter-
         mines the Description and Actions of for that file.
    
              #include <Dt/Dts.h>
    
              #define   ATTRIBUTE1     "DESCRIPTION"
              #define   ATTRIBUTE2     "ACTIONS"
    
              main(int argc, char **argv)
              {
                   char *attribute;
                   char *datatype;
    
                   /* load datatypes database */
                   DtDtsLoadDataTypes();
    
                   argv++;
                   while(*argv) {
                        /* get datatype file file */
                        datatype = DtDtsFileToDataType(*argv);
    
                        /* get first attribute for datatype */
                        attribute = DtDtsDataTypeToAttributeValue(datatype,
                                       ATTRIBUTE1, *argv);
                        if(attribute) {
                             printf("%s for file %s is %s0,
                                  ATTRIBUTE1, *argv, attribute);
    
                        }
    
                        /* get second attribute for datatype */
                        attribute = DtDtsDataTypeToAttributeValue(datatype,
                                       ATTRIBUTE2, NULL);
                        if(attribute) {
                             printf("%s for file %s is %s0,
                                  ATTRIBUTE2, *argv, attribute);
                        }
                        argv++;
                   }
                   DtDtsRelease();
                   exit(0);
              }
    
    
    SEE ALSO
         DtActionLabel(3), DtActionDescription(3), DtActionExists(3),
         DtActionInvoke(3),     dtdtfile(3),    DtDndDropRegister(3),
         dtcreateaction(1), dttypes(1),
    
    
    
    


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру