src/findlib/attribs.c
void encode_stat(char *buf, struct stat *statp, int stat_size, int32_t LinkFI, int data_stream)
{
   char *p = buf;
   /*
    * We read the stat packet so make sure the caller's conception
    *  is the same as ours.  They can be different if LARGEFILE is not
    *  the same when compiling this library and the calling program.
    */
   ASSERT(stat_size == (int)sizeof(struct stat));

   /*
    *  Encode a stat packet.  I should have done this more intelligently
    *   with a length so that it could be easily expanded.
    */
    p += to_base64((int64_t)statp->st_dev, p);
   *p++ = ' ';                        /* separate fields with a space */
    p += to_base64((int64_t)statp->st_ino, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_mode, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_nlink, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_uid, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_gid, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_rdev, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_size, p);
   *p++ = ' ';
#ifndef HAVE_MINGW
    p += to_base64((int64_t)statp->st_blksize, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_blocks, p);
   *p++ = ' ';
#else
    p += to_base64((int64_t)0, p); /* output place holder */
   *p++ = ' ';
    p += to_base64((int64_t)0, p); /* output place holder */
   *p++ = ' ';
#endif
    p += to_base64((int64_t)statp->st_atime, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_mtime, p);
   *p++ = ' ';
   p += to_base64((int64_t)statp->st_ctime, p);
   *p++ = ' ';
    p += to_base64((int64_t)LinkFI, p);
   *p++ = ' ';

#ifdef HAVE_CHFLAGS
   /* FreeBSD function */
   p += to_base64((int64_t)statp->st_flags, p);  /* output st_flags */
#else
   p += to_base64((int64_t)0, p);     /* output place holder */
#endif
   *p++ = ' ';
   p += to_base64((int64_t)data_stream, p);
#ifdef HAVE_MINGW
   *p++ = ' ';
   p += to_base64((int64_t)statp->st_fattrs, p);
#endif
   *p = 0;
   return;
}
/*
 * Encode a stat structure into a base64 character string
 *   All systems must create such a structure.
 *   In addition, we tack on the LinkFI, which is non-zero in
 *   the case of a hard linked file that has no data.  This
 *   is a File Index pointing to the link that does have the
 *   data (always the first one encountered in a save).
 * You may piggyback attributes on this packet by encoding
 *   them in the encode_attribsEx() subroutine, but this is
 *   not recommended.
 */
Encode a stat structure into a base64 character string
All systems must create such a structure.
In addition, we tack on the LinkFI, which is non-zero in
the case of a hard linked file that has no data.  This
is a File Index pointing to the link that does have the
data (always the first one encountered in a save).
You may piggyback attributes on this packet by encoding
them in the encode_attribsEx() subroutine, but this is
not recommended.
Encode a stat structure into a base64 character string All systems must create such a structure . In addition we tack on the LinkFI which is non - zero in the case of a hard linked file that has no data . This is a File Index pointing to the link that does have the data ( always the first one encountered in a save ) . You may piggyback attributes on this packet by encoding them in the encode_attribsEx () subroutine but this is not recommended .
void encode_stat(char *buf, struct stat *statp, int stat_size, int32_t LinkFI, int data_stream)
{
   char *p = buf;
   ASSERT(stat_size == (int)sizeof(struct stat));
    p += to_base64((int64_t)statp->st_dev, p);
   *p++ = ' ';                        
    p += to_base64((int64_t)statp->st_ino, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_mode, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_nlink, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_uid, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_gid, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_rdev, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_size, p);
   *p++ = ' ';
#ifndef HAVE_MINGW
    p += to_base64((int64_t)statp->st_blksize, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_blocks, p);
   *p++ = ' ';
#else
    p += to_base64((int64_t)0, p); 
   *p++ = ' ';
    p += to_base64((int64_t)0, p); 
   *p++ = ' ';
#endif
    p += to_base64((int64_t)statp->st_atime, p);
   *p++ = ' ';
    p += to_base64((int64_t)statp->st_mtime, p);
   *p++ = ' ';
   p += to_base64((int64_t)statp->st_ctime, p);
   *p++ = ' ';
    p += to_base64((int64_t)LinkFI, p);
   *p++ = ' ';
#ifdef HAVE_CHFLAGS
   p += to_base64((int64_t)statp->st_flags, p);  
#else
   p += to_base64((int64_t)0, p);     
#endif
   *p++ = ' ';
   p += to_base64((int64_t)data_stream, p);
#ifdef HAVE_MINGW
   *p++ = ' ';
   p += to_base64((int64_t)statp->st_fattrs, p);
#endif
   *p = 0;
   return;
}
void encode_stat ( char * buf , struct stat * statp , int stat_size , int32_t LinkFI , int data_stream ) { char * p = buf ; ASSERT ( stat_size == ( int ) sizeof ( struct stat ) ) ; p += to_base64 ( ( int64_t ) statp -> st_dev , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_ino , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_mode , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_nlink , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_uid , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_gid , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_rdev , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_size , p ) ; * p ++ = ' ' ; #ifndef HAVE_MINGW p += to_base64 ( ( int64_t ) statp -> st_blksize , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_blocks , p ) ; * p ++ = ' ' ; #else p += to_base64 ( ( int64_t ) 0 , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) 0 , p ) ; * p ++ = ' ' ; #endif p += to_base64 ( ( int64_t ) statp -> st_atime , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_mtime , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_ctime , p ) ; * p ++ = ' ' ; p += to_base64 ( ( int64_t ) LinkFI , p ) ; * p ++ = ' ' ; #ifdef HAVE_CHFLAGS p += to_base64 ( ( int64_t ) statp -> st_flags , p ) ; #else p += to_base64 ( ( int64_t ) 0 , p ) ; #endif * p ++ = ' ' ; p += to_base64 ( ( int64_t ) data_stream , p ) ; #ifdef HAVE_MINGW * p ++ = ' ' ; p += to_base64 ( ( int64_t ) statp -> st_fattrs , p ) ; #endif * p = 0 ; return ; }
Encode a stat structure into a base64 character string
   All systems must create such a structure.
Encode a stat structure into a base64 character string All systems must create such a structure .
/*
    * We read the stat packet so make sure the caller's conception
    *  is the same as ours.  They can be different if LARGEFILE is not
    *  the same when compiling this library and the calling program.
    */ /*
    *  Encode a stat packet.  I should have done this more intelligently
    *   with a length so that it could be easily expanded.
    */ /* separate fields with a space */ /* output place holder */ /* output place holder */ /* FreeBSD function */ /* output st_flags */ /* output place holder */