"Fossies" - the Fresh Open Source Software Archive

Member "radmind-1.15.3/radmind-/applefile.c" (30 Nov 2020, 1419 Bytes) of package /linux/privat/radmind-1.15.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * Copyright (c) 2003 Regents of The University of Michigan.
    3  * All Rights Reserved.  See COPYRIGHT.
    4  */
    5 
    6 #include "config.h"
    7 #include "applefile.h"
    8 #include <arpa/inet.h>
    9 #include <stdio.h>
   10 
   11 #ifdef __APPLE__
   12 #include <sys/attr.h>
   13 
   14 struct attrlist     getalist = {
   15     ATTR_BIT_MAP_COUNT,
   16     0,
   17     ATTR_CMN_FNDRINFO,
   18     0,
   19     0,
   20     ATTR_FILE_RSRCLENGTH,
   21     0,
   22 };
   23 
   24 struct attrlist     getdiralist = {
   25     ATTR_BIT_MAP_COUNT,
   26     0,
   27     ATTR_CMN_FNDRINFO,
   28     0,
   29     0,
   30     0,
   31     0,
   32 };
   33 
   34 struct attrlist     setalist = {
   35     ATTR_BIT_MAP_COUNT,
   36     0,
   37     ATTR_CMN_FNDRINFO,
   38     0,
   39     0,
   40     0,
   41     0,
   42 };
   43 #endif /* __APPLE__ */
   44 
   45 struct as_header        as_header = {
   46     AS_MAGIC,
   47     AS_VERSION,
   48     {
   49     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   50     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   51     },
   52     AS_NENTRIES,
   53 };
   54 
   55 extern struct as_header as_header;
   56 
   57 /* endian handlers for x86 Macs */
   58     void
   59 as_entry_netswap( struct as_entry *e )
   60 {
   61 #ifdef __BIG_ENDIAN__
   62     return;
   63 #else /* __BIG_ENDIAN__ */
   64      e->ae_id = htonl( e->ae_id );
   65      e->ae_offset = htonl( e->ae_offset );
   66      e->ae_length = htonl( e->ae_length );
   67 #endif /* __BIG_ENDIAN__ */
   68 }
   69 
   70     void
   71 as_entry_hostswap( struct as_entry *e )
   72 {
   73 #ifdef __BIG_ENDIAN__
   74     return;
   75 #else /* __BIG_ENDIAN__ */
   76      e->ae_id = ntohl( e->ae_id );
   77      e->ae_offset = ntohl( e->ae_offset );
   78      e->ae_length = ntohl( e->ae_length );
   79 #endif /* __BIG_ENDIAN__ */
   80 }