changeset 9:2027089f4c3a

cscope-fast getline conflicts with getline in illumos
author Andrew Stormont <andyjstormont@gmail.com>
date Wed, 29 Feb 2012 06:38:16 +0000
parents d2a803ab280b
children a38fd32682e4
files usr/src/tools/cscope-fast/command.c usr/src/tools/cscope-fast/global.h usr/src/tools/cscope-fast/input.c
diffstat 3 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/tools/cscope-fast/command.c	Tue Apr 13 20:07:00 2010 +0900
+++ b/usr/src/tools/cscope-fast/command.c	Wed Feb 29 06:38:16 2012 +0000
@@ -18,6 +18,8 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
+ *
+ * Copyright (c) 2012 Nexenta Systems, Inc.  All rights reserved.
  */
 /*	Copyright (c) 1988 AT&T	*/
 /*	  All Rights Reserved  	*/
@@ -235,7 +237,7 @@
 			}
 			if (c != '\r' && c != '\n' && c != KEY_ENTER &&
 			    c != KEY_BREAK &&
-			    getline(newpat, COLS - sizeof (appendprompt), c,
+			    mygetline(newpat, COLS - sizeof (appendprompt), c,
 			    NO) > 0) {
 				shellpath(filename, sizeof (filename), newpat);
 				if ((file = fopen(filename, s)) == NULL) {
@@ -256,7 +258,7 @@
 	case '<':	/* read lines from a file */
 		(void) move(PRLINE, 0);
 		(void) addstr(readprompt);
-		if (getline(newpat, COLS - sizeof (readprompt), '\0',
+		if (mygetline(newpat, COLS - sizeof (readprompt), '\0',
 		    NO) > 0) {
 			clearprompt();
 			shellpath(filename, sizeof (filename), newpat);
@@ -278,7 +280,7 @@
 		/* get the shell command */
 		(void) move(PRLINE, 0);
 		(void) addstr(pipeprompt);
-		if (getline(newpat,
+		if (mygetline(newpat,
 		    COLS - sizeof (pipeprompt), '\0', NO) == 0) {
 			clearprompt();
 			return (NO);
@@ -391,7 +393,7 @@
 			} else {
 				(void) move(PRLINE, 0);
 				(void) addstr(selectionprompt);
-				if (getline(newpat,
+				if (mygetline(newpat,
 				    COLS - sizeof (selectionprompt), commandc,
 				    NO) > 0 &&
 				    (i = atoi(newpat)) > 0) {
@@ -402,7 +404,7 @@
 		} else if (isprint(commandc)) {
 			/* this is the start of a pattern */
 ispat:
-			if (getline(newpat, COLS - fldcolumn - 1, commandc,
+			if (mygetline(newpat, COLS - fldcolumn - 1, commandc,
 			    caseless) > 0) {
 					(void) strcpy(pattern, newpat);
 					resetcmd();	/* reset history */
@@ -412,7 +414,7 @@
 					/* prompt for the new text */
 					(void) move(PRLINE, 0);
 					(void) addstr(toprompt);
-					(void) getline(newpat,
+					(void) mygetline(newpat,
 					    COLS - sizeof (toprompt), '\0', NO);
 				}
 				/* search for the pattern */
@@ -594,7 +596,7 @@
 					clearprompt();
 					(void) move(PRLINE, 0);
 					(void) addstr(selectionprompt);
-					if (getline(buf,
+					if (mygetline(buf,
 					    COLS - sizeof (selectionprompt), c,
 					    NO) > 0 &&
 					    (i = atoi(buf)) > 0) {
--- a/usr/src/tools/cscope-fast/global.h	Tue Apr 13 20:07:00 2010 +0900
+++ b/usr/src/tools/cscope-fast/global.h	Wed Feb 29 06:38:16 2012 +0000
@@ -18,6 +18,8 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
+ *
+ * Copyright (c) 2012 Nexenta Systems, Inc.  All rights reserved.
  */
 /*	Copyright (c) 1988 AT&T	*/
 /*	  All Rights Reserved  	*/
@@ -273,7 +275,7 @@
 void	catchint(int sig);
 int	ungetch(int c);
 int	mygetch(void);
-int	getline(char s[], size_t size, int firstchar, BOOL iscaseless);
+int	mygetline(char s[], size_t size, int firstchar, BOOL iscaseless);
 void	askforchar(void);
 void	askforreturn(void);
 void	shellpath(char *out, int limit, char *in);
--- a/usr/src/tools/cscope-fast/input.c	Tue Apr 13 20:07:00 2010 +0900
+++ b/usr/src/tools/cscope-fast/input.c	Wed Feb 29 06:38:16 2012 +0000
@@ -18,6 +18,8 @@
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
+ *
+ * Copyright (c) 2012 Nexenta Systems, Inc.  All rights reserved.
  */
 /*	Copyright (c) 1988 AT&T	*/
 /*	  All Rights Reserved  	*/
@@ -91,7 +93,7 @@
 /* get a line from the terminal in non-canonical mode */
 
 int
-getline(char s[], size_t size, int firstchar, BOOL iscaseless)
+mygetline(char s[], size_t size, int firstchar, BOOL iscaseless)
 {
 	int	c, i = 0;
 	int	j;