File: main.c

package info (click to toggle)
ytree 1.64-4.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 532 kB
  • ctags: 766
  • sloc: ansic: 10,758; makefile: 116
file content (64 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/***************************************************************************
 *
 * $Header: /home/werner/ytree/RCS/main.c,v 1.10 1998/07/26 21:21:13 werner Rel $
 *
 * Hauptmodul
 *
 ***************************************************************************/


#include "ytree.h"



static char buffer[PATH_LENGTH+1];
static char path[PATH_LENGTH+1];



int main(int argc, char **argv)
{
  char *p;

  if (Init())
      exit(1);

  if( argc == 2 ) 
    p = argv[1]; 
  else 
    p = DEFAULT_TREE;

  if( *p != FILE_SEPARATOR_CHAR )
  {
    /* rel. Pfad */
    /*-----------*/

    (void) getcwd( buffer, sizeof( buffer ) - 2 );
    (void) strcat( buffer, FILE_SEPARATOR_STRING );
    (void) strcat( buffer, p );
    p = buffer;
  }

  /* Normalize path */

  NormPath( p, path );

  statistic.login_path[0] = '\0';
  statistic.path[0] = '0';

  if( LoginDisk( path ) == -1 )
  {
    endwin();
    exit( 1 );
  }

  while( 1 )
  {
    if( HandleDirWindow( statistic.tree, 
			 statistic.disp_begin_pos,
			 statistic.cursor_pos
		       ) == 'q' ) Quit();
  }
}