niscat.c revision 49e7ca4919cec3229f6fab9730bafc7cf24dab23
/*
* 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"
/*
* niscat.c
*
* nis+ table cat utility
*/
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
extern int optind;
extern char *optarg;
#define BINARY_STR "*BINARY*"
struct pl_data {
unsigned flags;
char ta_sep;
};
#define PL_BINARY 1
int
char *tab;
void *udata;
{
register int i;
int len;
for (i = 0; i < ncol; i++) {
if (i > 0)
if (len != 0) {
} else {
}
} else {
}
}
}
printf("\n");
return (0);
}
int
char *tab;
void *udata;
{
return (0);
}
#define F_HEADER 1
#define F_OBJECT 2
void
usage()
{
exit(1);
}
int
{
int c;
unsigned flags = 0;
char *name;
char tname[NIS_MAXNAMELEN];
int ncol, i;
int error = 0;
int bad_name;
/*
* By default, don't print binary data.
*/
switch (c) {
case 'L' :
break;
case 'P':
fpath = FOLLOW_PATH;
break;
case 'A':
break;
case 'M':
break;
case 'h':
break;
case 'v':
break;
case 'o':
break;
case 's':
"separator must be a single character\n");
exit(1);
}
break;
default:
usage();
}
}
usage();
if (*name == '[') {
print_object, 0);
error = 1;
goto loop;
}
} else {
error = 1;
goto loop;
}
}
goto loop;
}
/*
* Get the table object using expand name magic.
*/
error = 1;
goto loop;
}
/*
* Construct the name for the table that we found.
*/
>= sizeof (tname));
if (!bad_name &&
if (bad_name) {
error = 1;
goto loop;
}
/*
* Make sure it's a table object.
*/
error = 1;
goto loop;
}
/*
* Use the table's separator character when printing entries.
* Unless one was specified w/ -s
*/
}
/*
* Print column names if F_HEADER is set.
*/
printf("# ");
for (i = 0; i < ncol; i++) {
if (i > 0)
printf("%c", c);
printf("%s",
}
printf("\n");
}
/*
* Cat the table using a callback function.
*/
error = 1;
}
loop:
}
return (error);
}