summaryrefslogtreecommitdiff
path: root/usr/src/tools/cscope-fast
diff options
context:
space:
mode:
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
committerRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
commit23a1ccea6aac035f084a7a4cdc968687d1b02daf (patch)
tree6ed5e310ce6dd96f997b0c0f9735805d513d898a /usr/src/tools/cscope-fast
parent29c3196fe2acc65721d8b9b5ea708d3a87facde0 (diff)
downloadillumos-gate-23a1ccea6aac035f084a7a4cdc968687d1b02daf.tar.gz
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6960818 add get_nprocs(), getline(), strdupa(), strndup() to libc 6901783 strndup would be nice 6824404 libc should provide ffsl() & ffsll() 6793969 RFE: Add|stpcpy|to libc 6735446 Want a __progname symbol for BSD-style source compatibility 6421095 Solaris should provide strcasestr 6275498 Provide string compare functions wcscasecmp,wcsncasecmp in solaris like linux --HG-- rename : usr/src/lib/libc/port/gen/strcasecmp.c => usr/src/lib/libc/port/gen/ascii_strcasecmp.c rename : usr/src/lib/libc/port/gen/strncasecmp.c => usr/src/lib/libc/port/gen/ascii_strncasecmp.c rename : usr/src/lib/libc/sparc/gen/strcasecmp.s => usr/src/lib/libc/sparc/gen/ascii_strcasecmp.s rename : usr/src/lib/libc/sparcv9/gen/strcasecmp.s => usr/src/lib/libc/sparcv9/gen/ascii_strcasecmp.s
Diffstat (limited to 'usr/src/tools/cscope-fast')
-rw-r--r--usr/src/tools/cscope-fast/command.c28
-rw-r--r--usr/src/tools/cscope-fast/global.h20
-rw-r--r--usr/src/tools/cscope-fast/input.c16
3 files changed, 26 insertions, 38 deletions
diff --git a/usr/src/tools/cscope-fast/command.c b/usr/src/tools/cscope-fast/command.c
index 4744178d0e..4e19850705 100644
--- a/usr/src/tools/cscope-fast/command.c
+++ b/usr/src/tools/cscope-fast/command.c
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright (c) 1999 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1988 AT&T */
+/* All Rights Reserved */
/*
* cscope - interactive C symbol or text cross-reference
@@ -235,7 +231,7 @@ command(int commandc)
}
if (c != '\r' && c != '\n' && c != KEY_ENTER &&
c != KEY_BREAK &&
- getline(newpat, COLS - sizeof (appendprompt), c,
+ getaline(newpat, COLS - sizeof (appendprompt), c,
NO) > 0) {
shellpath(filename, sizeof (filename), newpat);
if ((file = fopen(filename, s)) == NULL) {
@@ -256,7 +252,7 @@ command(int commandc)
case '<': /* read lines from a file */
(void) move(PRLINE, 0);
(void) addstr(readprompt);
- if (getline(newpat, COLS - sizeof (readprompt), '\0',
+ if (getaline(newpat, COLS - sizeof (readprompt), '\0',
NO) > 0) {
clearprompt();
shellpath(filename, sizeof (filename), newpat);
@@ -278,7 +274,7 @@ command(int commandc)
/* get the shell command */
(void) move(PRLINE, 0);
(void) addstr(pipeprompt);
- if (getline(newpat,
+ if (getaline(newpat,
COLS - sizeof (pipeprompt), '\0', NO) == 0) {
clearprompt();
return (NO);
@@ -391,7 +387,7 @@ command(int commandc)
} else {
(void) move(PRLINE, 0);
(void) addstr(selectionprompt);
- if (getline(newpat,
+ if (getaline(newpat,
COLS - sizeof (selectionprompt), commandc,
NO) > 0 &&
(i = atoi(newpat)) > 0) {
@@ -402,7 +398,7 @@ command(int commandc)
} else if (isprint(commandc)) {
/* this is the start of a pattern */
ispat:
- if (getline(newpat, COLS - fldcolumn - 1, commandc,
+ if (getaline(newpat, COLS - fldcolumn - 1, commandc,
caseless) > 0) {
(void) strcpy(pattern, newpat);
resetcmd(); /* reset history */
@@ -412,7 +408,7 @@ repeat:
/* prompt for the new text */
(void) move(PRLINE, 0);
(void) addstr(toprompt);
- (void) getline(newpat,
+ (void) getaline(newpat,
COLS - sizeof (toprompt), '\0', NO);
}
/* search for the pattern */
@@ -594,7 +590,7 @@ changestring(void)
clearprompt();
(void) move(PRLINE, 0);
(void) addstr(selectionprompt);
- if (getline(buf,
+ if (getaline(buf,
COLS - sizeof (selectionprompt), c,
NO) > 0 &&
(i = atoi(buf)) > 0) {
diff --git a/usr/src/tools/cscope-fast/global.h b/usr/src/tools/cscope-fast/global.h
index 01ddae4dfb..2d963983f0 100644
--- a/usr/src/tools/cscope-fast/global.h
+++ b/usr/src/tools/cscope-fast/global.h
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -19,23 +18,20 @@
*
* CDDL HEADER END
*/
+
+/*
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
-
/*
* cscope - interactive C symbol cross-reference
*
* global type, data, and function definitions
*/
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <ctype.h> /* isalpha, isdigit, etc. */
#include <signal.h> /* SIGINT and SIGQUIT */
#include <stdio.h> /* standard I/O package */
@@ -273,7 +269,7 @@ HISTORY *nextcmd(void);
void catchint(int sig);
int ungetch(int c);
int mygetch(void);
-int getline(char s[], size_t size, int firstchar, BOOL iscaseless);
+int getaline(char s[], size_t size, int firstchar, BOOL iscaseless);
void askforchar(void);
void askforreturn(void);
void shellpath(char *out, int limit, char *in);
diff --git a/usr/src/tools/cscope-fast/input.c b/usr/src/tools/cscope-fast/input.c
index 63e0bb4e22..7d3f7f7946 100644
--- a/usr/src/tools/cscope-fast/input.c
+++ b/usr/src/tools/cscope-fast/input.c
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1988 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1988 AT&T */
+/* All Rights Reserved */
/*
* cscope - interactive C symbol cross-reference
@@ -91,7 +87,7 @@ mygetch(void)
/* get a line from the terminal in non-canonical mode */
int
-getline(char s[], size_t size, int firstchar, BOOL iscaseless)
+getaline(char s[], size_t size, int firstchar, BOOL iscaseless)
{
int c, i = 0;
int j;