funcs.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1996-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <locale.h>
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
extern int verbose;
/*
* Function used by -d option to display pathname
*/
int
{
return (0);
}
/*
* Function used by -p option to pack pathname
*/
int
{
int xx;
int len;
#ifdef DEBUG
} else {
printf("\n");
}
#endif /* DEBUG */
"cachefspack: file name too long - %s\n"),
pathnam);
return (-1);
}
#ifdef DEBUG
#endif /* DEBUG */
len--;
}
} else {
len = 0;
}
#ifdef DEBUG
printf("packfn: pack.p_name = %s pack.p_status = %x\n",
#endif /* DEBUG */
#ifdef DEBUG
#endif /* DEBUG */
if (xx) {
return (0);
}
return (0);
}
return (-1);
}
return (0);
}
/*
* Function used by -p option to unpack pathname
*/
int
{
int xx;
int len;
#ifdef DEBUG
} else {
printf("\n");
}
#endif /* DEBUG */
"cachefspack: file name too long - %s\n"), pathnam);
return (-1);
}
len--;
}
} else {
len = 0;
}
#ifdef DEBUG
printf("unpackfn: pack.p_name = %s pack.p_status = %x\n",
#endif /* DEBUG */
#ifdef DEBUG
printf("unpackfn: pack.p_name = %s pack.p_status = %x\n",
#endif /* DEBUG */
if (xx) {
return (0);
}
return (0);
}
return (-1);
}
return (0);
}
/*
* Function used by -i option to print status of pathname
*/
int
{
int xx;
int len;
#ifdef DEBUG
} else {
printf("\n");
}
#endif /* DEBUG */
gettext("cachefspack: file name too long - %s\n"),
pathnam);
return (-1);
}
len--;
}
} else {
len = 0;
}
#ifdef DEBUG
printf("inquirefn: pack.p_name = %s pack.p_status = %x\n",
#endif /* DEBUG */
#ifdef DEBUG
#endif /* DEBUG */
if (xx) {
#ifdef CFS_MSG
gettext("%s - is not in a cacheFS file system\n"),
pathnam);
#endif /* CFS_MSG */
return (-1);
}
return (-2);
}
if (verbose) {
"YES" : "NO");
}
return (0);
}