Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/beos/beos.c  view on Meta::CPAN

    return;
}

#ifdef BEOS_USE_PRINTEXFIELD
static void printBeOSexfield( int isdir, uch *extra_field )
{
    uch *ptr       = extra_field;
    ush  id        = 0;
    ush  size      = 0;
    ulg  full_size = 0;
    uch  flags     = 0;

    /* Tell picky compilers to be quiet. */
    isdir = isdir;

    if( extra_field == NULL ) {
        return;
    }

    /* Collect the data from the buffer. */
    id        = makeword( ptr );    ptr += 2;
    size      = makeword( ptr );    ptr += 2;
    full_size = makelong( ptr );    ptr += 4;
    flags     = *ptr;               ptr++;

    if( id != EF_BEOS ) {
        /* not a 'Be' field */
        printf("\t*** Unknown field type (0x%04x, '%c%c')\n", id,
               (char)(id >> 8), (char)id);
    }

    if( flags & EB_BE_FL_BADBITS ) {
        /* corrupted or unsupported */
        printf("\t*** Corrupted BeOS extra field:\n");
        printf("\t*** unknown bits set in the flags\n");
        printf("\t*** (Possibly created by an old version of zip for BeOS.\n");
    }

    if( size <= EB_BEOS_HLEN ) {
        /* corrupted, unsupported, or truncated */
        printf("\t*** Corrupted BeOS extra field:\n");
        printf("\t*** size is %d, should be larger than %d\n", size,
               EB_BEOS_HLEN );
    }

    if( flags & EB_BE_FL_UNCMPR ) {
        /* Uncompressed data */
        printf("\tBeOS extra field data (uncompressed):\n");
        printf("\t\t%ld data bytes\n", full_size);
    } else {
        /* Compressed data */
        printf("\tBeOS extra field data (compressed):\n");
        printf("\t\t%d compressed bytes\n", size - EB_BEOS_HLEN);
        printf("\t\t%ld uncompressed bytes\n", full_size);
    }
}
#endif

#ifdef BEOS_ASSIGN_FILETYPE
/* Note: This will no longer be necessary in BeOS PR4; update_mime_info()    */
/* will be updated to build its own absolute pathname if it's not given one. */
static void assign_MIME( const char *file )
{
    char *fullname;
    char buff[PATH_MAX], cwd_buff[PATH_MAX];
    int retval;

    if( file[0] == '/' ) {
        fullname = (char *)file;
    } else {
        sprintf( buff, "%s/%s", getcwd( cwd_buff, PATH_MAX ), file );
        fullname = buff;
    }

    retval = update_mime_info( fullname, FALSE, TRUE, TRUE );
}
#endif



( run in 0.848 second using v1.01-cache-2.11-cpan-5511b514fd6 )