Ejemplo n.º 1
0
extern void DirDestroy( directive_t *directive )
//**********************************************
{
    dir_operand *dirop, *dirop_next;

    if( !directive ) return;
    dirop = directive->operand_list;
    while( dirop ) {
        dirop_next = dirop->next;
        DirOpDestroy( dirop );
        dirop = dirop_next;
    }
    dirFree( directive );
    lastDirective = NULL;
}
Ejemplo n.º 2
0
Boolean cur_init(String root_path, String cur_path, int options)
{
  DirPtr ret;

  if (rootdir)
    dirFree(rootdir);
  root_modified = cur_modified = cur_changed = True;
  shelf_modified = False;
  rootdir = dirCreate(root_path, NULL, options);
  if (!(curdir = dirSearchSubdir(rootdir, cur_path, &ret)))
    if (ret)
      curdir = ret;
    else
      curdir = rootdir;
  update_cur_path(dirName(curdir));
  if (!dirHasSubdirInfo(curdir))
    if (!dirReadSubdirInfo(curdir))
      return False;
  return dirReadFileInfo(curdir) != NULL;
}
Ejemplo n.º 3
0
Boolean shelf_init(String shelf_path, int options)
{
  char path[MAXPATHLEN+1];

  root_modified = cur_modified = cur_changed = False;
  shelf_modified = True;
  strcpy(save_shelf_path, shelf_path);
  save_shelf_options = options;
  if (shelfdir)
    dirFree(shelfdir);
  shelf_no = default_shelf;
  if (shelf_dir(shelf_no))
    pathname(path, shelf_path, shelf_dir(shelf_no));
  else if (shelf_label(shelf_no))
    pathname(path, shelf_path, shelf_label(shelf_no));
  else
    strcpy(path, shelf_path);
  update_shelf_path(path);
  shelfdir = dirCreate(path, NULL, options);
  return dirReadFileInfo(shelfdir) != NULL;
}
Ejemplo n.º 4
0
Boolean shelf_goto(int i)
{
  char path[MAXPATHLEN+1];

  root_modified = cur_modified = cur_changed = shelf_modified = False;
  if (i == shelf_no && dirIsReadable(shelfdir))
    return True;
  Wait();
  shelf_modified = True;
  dirFree(shelfdir);
  shelf_no = i;
  if (shelf_dir(shelf_no))
    pathname(path, save_shelf_path, shelf_dir(shelf_no));
  else if (shelf_label(shelf_no))
    pathname(path, save_shelf_path, shelf_label(shelf_no));
  else
    strcpy(path, save_shelf_path);
  update_shelf_path(path);
  shelfdir = dirCreate(path, NULL, save_shelf_options);
  Done();
  return dirReadFileInfo(shelfdir) != NULL;
}