regcmp.c revision b55148877d473978f0b46d593fd6213fa526fcc5
/*
* 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 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <locale.h>
#include <libgen.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
int gotflg;
char ofile[64];
char a1[1024];
char a2[64];
int c;
int getnm(char);
int size(char *);
int
{
char *message;
int k, cflg = 0;
int status = 0;
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
cflg++;
++argv;
argc--;
} else cflg = 0;
while (--argc) {
++argv;
/* continues to next file, if any, but the */
/* exit status will indicate an error */
status = 1;
continue;
}
while (*++bp)
while (*--bp == '\0');
while (*bp == 0)
bp++;
else *cp++ = 'i';
*cp = '\0';
close(1);
exit(1);
}
gotflg = 0;
while (1) {
if (!gotflg)
(c == ' '));
else
gotflg = 0;
if (c == EOF) break;
*name++ = c;
(c != EOF) && (c != '\n'));
*--name = '\0';
if (c != '"') {
if (c == EOF) {
exit(1);
}
message =
gettext(" : remainder of line ignored\n");
continue;
}
gotflg = 0;
switch (c) {
case '"':
break;
case '\\':
case 't':
*str++ = '\011';
continue;
case 'n':
*str++ = '\012';
continue;
case 'r':
*str++ = '\015';
continue;
case 'b':
*str++ = '\010';
continue;
case '\\':
*str++ = '\\';
continue;
default:
if (c <= '7' && c >= '0')
else *str++ = c;
continue;
}
default:
*str++ = c;
}
if (c == '"') break;
}
if (c == EOF) {
exit(1);
}
if (c == '"') goto keeponl;
else {
gotflg++;
}
*str = '\0';
continue;
}
while (__i_size > 0) {
for (k = 0; k < 12; k++)
if (__i_size-- > 0)
printf("0%o, ", *v++);
printf("\n");
}
printf("0};\n");
}
}
return (status);
}
int
size(char *p)
{
int i;
char *q;
i = 0;
q = p;
while (*q++) i++;
return (i);
}
int
getnm(char j)
{
int i;
int k;
i = j - '0';
k = 1;
i = (i*8+(c-'0'));
if (k >= 4)
gotflg++;
return (i);
}