Back to index

lightning-sunbird  0.9+nobinonly
Functions
mar.c File Reference
#include <stdio.h>
#include "mar.h"
#include <unistd.h>

Go to the source code of this file.

Functions

static void print_usage ()
static int mar_test_callback (MarFile *mar, const MarItem *item, void *unused)
static int mar_test (const char *path)
int main (int argc, char **argv)
 The Xalan testcases app.

Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 72 of file mar.c.

                                {
  int command;

  if (argc < 3) {
    print_usage();
    return -1;
  }

  if (argv[1][1] == 'C') {
    chdir(argv[2]);
    argv += 2;
    argc -= 2;
  }

  switch (argv[1][1]) {
  case 'c':
    return mar_create(argv[2], argc - 3, argv + 3);
  case 't':
    return mar_test(argv[2]);
  case 'x':
    return mar_extract(argv[2]);
  default:
    print_usage();
    return -1;
  }

  return 0;
}

Here is the call graph for this function:

static int mar_test ( const char *  path) [static]

Definition at line 58 of file mar.c.

                                      {
  MarFile *mar;

  mar = mar_open(path);
  if (!mar)
    return -1;

  printf("SIZE\tMODE\tNAME\n");
  mar_enum_items(mar, mar_test_callback, NULL);

  mar_close(mar);
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int mar_test_callback ( MarFile *  mar,
const MarItem item,
void unused 
) [static]

Definition at line 53 of file mar.c.

                                                                              {
  printf("%u\t0%o\t%s\n", item->length, item->flags, item->name);
  return 0;
}

Here is the caller graph for this function:

static void print_usage ( void  ) [static]

Definition at line 49 of file mar.c.

                          {
    printf("usage: mar [-C dir] {-c|-x|-t} archive.mar [files...]\n");
}

Here is the caller graph for this function: