dlist.c revision c719c59a5efa45b0a47db940384816b4ed77db7d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <fcntl.h>
#include <stdio.h>
#include <dirent.h>
#include "iso_spec.h"
#include "iso_impl.h"
/*
* crdlist_dno_iso: walk the iso dlist in breadth first order
* chain all directories together, and assinged directory
* record number in ascending order start with 1
* return the total number of directories in iso directory tree
*/
extern char *myname;
static int dno_iso = 1;
int
{
}
}
}
return (dno_iso-1);
}
/*
* crdlist_dno_unix: walk the unix dlist in breadth first order
* chain all directories together, and assinged directory
* record number in ascending order start with 1
* return the total number of directories in iso directory tree
*/
static int dno_unix = 1;
int
{
}
}
}
return (dno_unix-1);
}
/* mkdlist - creates a sorted list of all directories */
struct dlist *
char *path;
int prototype;
int extension;
{
/* assing record number for each directory */
/* required by the path table */
(void) crdlist_dno_iso(rootdp);
if (extension)
(void) crdlist_dno_unix(rootdp);
return (rootdp);
}
/*
* compare two dlist elements according to UNIX file name
* returns < == > if first element is < == > the second
*/
int
{
}
/*
* compare two dlist elements according to ISO file name
* returns < == > if first element is < == > the second
*/
int
{
}
void
int extension;
{
struct dlist **p;
int i;
int nodp;
nodp++;
/* no need to do sorting if number of dlist is less than 2 */
if (nodp < 1)
return;
else if (nodp == 1) {
return;
}
/* set up the list for sorting */
if (extension) {
/* do the UNIX sort */
for (i = 0; i < nodp - 1; i++)
}
/* do the ISO sort */
for (i = 0; i < nodp-1; i++)
}
void
int extension;
{
return;
}
void
char *path;
{
char s[1024];
path[0] = '\0';
}
}
int
int lbn;
int *fsize;
{
char buf[1024];
int count;
*fsize = 0;
return (lbn);
}
perror("bad lseek");
cleanup();
}
perror("bad write during creation of symbolic link");
cleanup();
}
}
int
int lbn;
int *fsize;
{
int fd;
int i, bsize;
int rsize;
char *buf;
if (fd < 0) {
*fsize = 0;
return (lbn);
}
*fsize = 0;
return (lbn);
}
/* do the copy */
perror("bad lseek");
cleanup();
}
for (i = 0; ; i++) {
break;
perror("bad write");
cleanup();
}
}
}
static void
{
}
static void
{
prntnchild(dp);
}
static void
{
prntuchild(dp);
}
static void
{
prntichild(dp);
}
static void
{
printf("**********\n");
printf("**********\n");
}
static void
{
}
static void
{
}
static void
{
printf("\tdno\tname\n");
printf("**********\n");
}