aboutsummaryrefslogtreecommitdiff
path: root/readline/examples/manexamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'readline/examples/manexamp.c')
-rw-r--r--readline/examples/manexamp.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/readline/examples/manexamp.c b/readline/examples/manexamp.c
index 3496efa..9c6cf2c 100644
--- a/readline/examples/manexamp.c
+++ b/readline/examples/manexamp.c
@@ -1,12 +1,31 @@
/* manexamp.c -- The examples which appear in the documentation are here. */
+/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
+
+ This file is part of the GNU Readline Library, a library for
+ reading lines of text with interactive input and history editing.
+
+ The GNU Readline Library is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2, or
+ (at your option) any later version.
+
+ The GNU Readline Library is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ The GNU General Public License is often shipped with GNU software, and
+ is generally kept in a file called COPYING or LICENSE. If you do not
+ have a copy of the license, write to the Free Software Foundation,
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+
#include <stdio.h>
#include <readline/readline.h>
-
/* **************************************************************** */
/* */
-* How to Emulate gets () */
+/* How to Emulate gets () */
/* */
/* **************************************************************** */
@@ -82,13 +101,12 @@ invert_case_line (count, key)
for (; start != end; start += direction)
{
- if (uppercase_p (rl_line_buffer[start]))
- rl_line_buffer[start] = to_lower (rl_line_buffer[start]);
- else if (lowercase_p (rl_line_buffer[start]))
- rl_line_buffer[start] = to_upper (rl_line_buffer[start]);
+ if (_rl_uppercase_p (rl_line_buffer[start]))
+ rl_line_buffer[start] = _rl_to_lower (rl_line_buffer[start]);
+ else if (_rl_lowercase_p (rl_line_buffer[start]))
+ rl_line_buffer[start] = _rl_to_upper (rl_line_buffer[start]);
}
/* Move point to on top of the last character changed. */
rl_point = end - direction;
}
-