pintos/src/lib/ustar.c File Reference

#include <ustar.h>
#include <limits.h>
#include <packed.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  ustar_header

Functions

static unsigned int calculate_chksum (const struct ustar_header *h)
static const char * strip_antisocial_prefixes (const char *file_name)
bool ustar_make_header (const char *file_name, enum ustar_type type, int size, char header[USTAR_HEADER_SIZE])
static bool parse_octal_field (const char *s, size_t size, unsigned long int *value)
static bool is_all_zeros (const char *block, size_t cnt)
const char * ustar_parse_header (const char header[USTAR_HEADER_SIZE], const char **file_name, enum ustar_type *type, int *size)

Variables

struct ustar_header PACKED


Function Documentation

static unsigned int calculate_chksum ( const struct ustar_header h  )  [static]

Definition at line 38 of file ustar.c.

References ustar_header::chksum, offsetof, and USTAR_HEADER_SIZE.

Referenced by ustar_make_header(), and ustar_parse_header().

static bool is_all_zeros ( const char *  block,
size_t  cnt 
) [static]

Definition at line 168 of file ustar.c.

Referenced by ustar_parse_header().

static bool parse_octal_field ( const char *  s,
size_t  size,
unsigned long int *  value 
) [static]

Definition at line 131 of file ustar.c.

References ULONG_MAX.

Referenced by ustar_parse_header().

static const char* strip_antisocial_prefixes ( const char *  file_name  )  [static]

Definition at line 67 of file ustar.c.

References memcmp(), strchr(), and strcmp().

Referenced by ustar_make_header(), and ustar_parse_header().

bool ustar_make_header ( const char *  file_name,
enum ustar_type  type,
int  size,
char  header[USTAR_HEADER_SIZE] 
)

const char* ustar_parse_header ( const char  header[USTAR_HEADER_SIZE],
const char **  file_name,
enum ustar_type type,
int *  size 
)


Variable Documentation


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6