Deleted Added
full compact
8,26c8,33
< | THIS MATERIAL IS PROVIDED "AS IS". THERE ARE
< | NO WARRANTIES OF ANY KIND WITH REGARD TO THIS
< | MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE
< | IMPLIED WARRANTIES OF MERCHANTABILITY AND
< | FITNESS FOR A PARTICULAR PURPOSE. Neither
< | Hewlett-Packard nor Hugh Mahon shall be liable
< | for errors contained herein, nor for
< | incidental or consequential damages in
< | connection with the furnishing, performance or
< | use of this material. Neither Hewlett-Packard
< | nor Hugh Mahon assumes any responsibility for
< | the use or reliability of this software or
< | documentation. This software and
< | documentation is totally UNSUPPORTED. There
< | is no support contract available. Hewlett-
< | Packard has done NO Quality Assurance on ANY
< | of the program or documentation. You may find
< | the quality of the materials inferior to
< | supported materials.
---
> | Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995, 2009 Hugh Mahon
> | All rights reserved.
> |
> | Redistribution and use in source and binary forms, with or without
> | modification, are permitted provided that the following conditions
> | are met:
> |
> | * Redistributions of source code must retain the above copyright
> | notice, this list of conditions and the following disclaimer.
> | * Redistributions in binary form must reproduce the above
> | copyright notice, this list of conditions and the following
> | disclaimer in the documentation and/or other materials provided
> | with the distribution.
> |
> | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
> | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
> | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
> | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
> | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> | POSSIBILITY OF SUCH DAMAGE.
28,37c35
< | This software is not a product of Hewlett-Packard, Co., or any
< | other company. No support is implied or offered with this software.
< | You've got the source, and you're on your own.
< |
< | This software may be distributed under the terms of Larry Wall's
< | Artistic license, a copy of which is included in this distribution.
< |
< | This notice must be included with this software and any derivatives.
< |
< | Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon
---
> |
40c38
< | $Header: /home/hugh/sources/old_ae/RCS/new_curse.c,v 1.50 2001/01/19 02:53:40 hugh Exp hugh $
---
> | $Header: /home/hugh/sources/old_ae/RCS/new_curse.c,v 1.54 2002/09/21 00:47:14 hugh Exp $
44c42
< char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995 Hugh Mahon",
---
> char *copyright_message[] = { "Copyright (c) 1986, 1987, 1988, 1991, 1992, 1993, 1994, 1995, 2009 Hugh Mahon",
47c45
< char * new_curse_name= "@(#) new_curse.c $Revision: 1.50 $";
---
> char * new_curse_name= "@(#) new_curse.c $Revision: 1.54 $";
503a502,505
> #if !defined(TERMCAP)
> #define TERMCAP "/etc/termcap"
> #endif
>
660a663,669
> char *terminfo_path[] = {
> "/usr/lib/terminfo",
> "/usr/share/lib/terminfo",
> "/usr/share/terminfo",
> NULL
> };
>
769a779
> int counter;
901a912,916
> if (Fildes == -1)
> {
> sprintf(Term_File_name, "%s/%x/%s", TERM_PATH, *TERMINAL_TYPE, TERMINAL_TYPE);
> Fildes = open(Term_File_name, O_RDONLY);
> }
903c918,919
< if (Fildes == -1)
---
> counter = 0;
> while ((Fildes == -1) && (terminfo_path[counter] != NULL))
905c921
< TERM_PATH = "/usr/lib/terminfo";
---
> TERM_PATH = terminfo_path[counter];
909a926,931
> if (Fildes == -1)
> {
> sprintf(Term_File_name, "%s/%x/%s", TERM_PATH, *TERMINAL_TYPE, TERMINAL_TYPE);
> Fildes = open(Term_File_name, O_RDONLY);
> }
> counter++;
913,928d934
< TERM_PATH = "/usr/share/lib/terminfo";
< Data_Line_len = 23 + strlen(TERM_PATH) + strlen(TERMINAL_TYPE);
< Term_File_name = malloc(Data_Line_len);
< sprintf(Term_File_name, "%s/%c/%s", TERM_PATH, *TERMINAL_TYPE, TERMINAL_TYPE);
< Fildes = open(Term_File_name, O_RDONLY);
< }
< if (Fildes == -1)
< {
< TERM_PATH = "/usr/share/terminfo";
< Data_Line_len = 23 + strlen(TERM_PATH) + strlen(TERMINAL_TYPE);
< Term_File_name = malloc(Data_Line_len);
< sprintf(Term_File_name, "%s/%c/%s", TERM_PATH, *TERMINAL_TYPE, TERMINAL_TYPE);
< Fildes = open(Term_File_name, O_RDONLY);
< }
< if (Fildes == -1)
< {
942c948
< Term_File_name = "/etc/termcap";
---
> Term_File_name = TERMCAP;
946c952
< Term_File_name = "/etc/termcap";
---
> Term_File_name = TERMCAP;
950c956
< printf("unable to open /etc/termcap file \n");
---
> printf("unable to open %s file \n", TERMCAP);
1108c1114
< if (((unsigned int) TERM_data_ptr) & 1) /* force alignment */
---
> if ((unsigned long)TERM_data_ptr & 1) /* force alignment */
1363c1369
< Ftemp = Name = malloc(strlen(TERMINAL_TYPE + 1) + 1);
---
> Ftemp = Name = malloc(strlen(TERMINAL_TYPE) + 2);
1471c1477
< tmp->attributes[i] = (char) NULL;
---
> tmp->attributes[i] = '\0';
1474,1477c1480,1483
< tmp->row[0] = (char) NULL;
< tmp->attributes[0] = (char) NULL;
< tmp->row[columns] = (char) NULL;
< tmp->attributes[columns] = (char) NULL;
---
> tmp->row[0] = '\0';
> tmp->attributes[0] = '\0';
> tmp->row[columns] = '\0';
> tmp->attributes[columns] = '\0';
1862c1868
< while (*Otemp != (char) NULL)
---
> while (*Otemp != '\0')
1880c1886
< while ((strncmp(Otemp, "%t", 2)) && (*Otemp != (char) NULL))
---
> while ((strncmp(Otemp, "%t", 2)) && (*Otemp != '\0'))
1908c1914
< while ((strncmp(Otemp, "%e", 2)) && (strncmp(Otemp, "%;", 2)) && (*Otemp != (char) NULL))
---
> while ((strncmp(Otemp, "%e", 2)) && (strncmp(Otemp, "%;", 2)) && (*Otemp != '\0'))
1913c1919
< if ((*Otemp != (char) NULL) && (!strncmp(Otemp, "%e", 2)))
---
> if ((*Otemp != '\0') && (!strncmp(Otemp, "%e", 2)))
1921c1927
< while ((*tchar != (char) NULL) && (strncmp(tchar, "%t", 2)) && (strncmp(tchar, "%;", 2)))
---
> while ((*tchar != '\0') && (strncmp(tchar, "%t", 2)) && (strncmp(tchar, "%;", 2)))
1926c1932
< if (*tchar == (char) NULL)
---
> if (*tchar == '\0')
1950c1956
< else if ((*Otemp != (char) NULL) && (!strncmp(Otemp, "%;", 2)))
---
> else if ((*Otemp != '\0') && (!strncmp(Otemp, "%;", 2)))
1970c1976
< while ((*Otemp != (char) NULL) && (strncmp(Otemp, "%;", 2)))
---
> while ((*Otemp != '\0') && (strncmp(Otemp, "%;", 2)))
1972c1978
< if (*Otemp != (char) NULL)
---
> if (*Otemp != '\0')
2041c2047
< line->attributes[j] = (char) NULL;
---
> line->attributes[j] = '\0';
2045,2046c2051,2052
< line->row[column] = (char) NULL;
< line->attributes[column] = (char) NULL;
---
> line->row[column] = '\0';
> line->attributes[column] = '\0';
2178c2184
< virtual_line->attributes[virt_col] = (char) NULL;
---
> virtual_line->attributes[virt_col] = '\0';
2185c2191
< if (virtual_line->row[virtual_line->last_char] == (char) NULL)
---
> if (virtual_line->row[virtual_line->last_char] == '\0')
2194c2200
< virtual_line->row[virtual_line->last_char] = (char) NULL;
---
> virtual_line->row[virtual_line->last_char] = '\0';
2339c2345
< string[Count] = (char) NULL;
---
> string[Count] = '\0';
2363c2369
< string[Count] = (char) NULL;
---
> string[Count] = '\0';
2449c2455
< tmpline->attributes[j] = (char) NULL;
---
> tmpline->attributes[j] = '\0';
2451,2452c2457,2458
< tmpline->row[column + 1] = (char) NULL;
< tmpline->attributes[column + 1] = (char) NULL;
---
> tmpline->row[column + 1] = '\0';
> tmpline->attributes[column + 1] = '\0';
2630c2636
< for (wstring = string; *wstring != (char) NULL; wstring++)
---
> for (wstring = string; *wstring != '\0'; wstring++)
2708c2714
< Terminal.c_cc[VEOL] = (char) NULL; /* EOL = 0 */
---
> Terminal.c_cc[VEOL] = '\0'; /* EOL = 0 */
2876c2882
< while (*fpoint != (char) NULL)
---
> while (*fpoint != '\0')
2953c2959
< while ((c1[i] != (char) NULL) && (c2[i] != (char) NULL) && (c1[i] == c2[i]) && (att1[i] == att2[i]))
---
> while ((c1[i] != '\0') && (c2[i] != '\0') && (c1[i] == c2[i]) && (att1[i] == att2[i]))
2956c2962
< if ((count1 == 1) && (c1[i] == (char) NULL) && (c2[i] == (char) NULL))
---
> if ((count1 == 1) && (c1[i] == '\0') && (c2[i] == '\0'))
2958c2964
< else if ((c1[i] == (char) NULL) && (c2[i] == (char) NULL))
---
> else if ((c1[i] == '\0') && (c2[i] == '\0'))
3111c3117
< tmp1->attributes[x] = (char) NULL;
---
> tmp1->attributes[x] = '\0';
3113c3119
< tmp1->row[column] = (char) NULL;
---
> tmp1->row[column] = '\0';
3155c3161
< while (((new_lin[end_new] != old_lin[end_old]) || (new_att[end_new] != old_att[end_old])) && (old_lin[end_old] != (char) NULL) && (new_lin[end_old] != (char) NULL))
---
> while (((new_lin[end_new] != old_lin[end_old]) || (new_att[end_new] != old_att[end_old])) && (old_lin[end_old] != '\0') && (new_lin[end_old] != '\0'))
3157c3163
< if (old_lin[end_old] != (char) NULL)
---
> if (old_lin[end_old] != '\0')
3160c3166
< while ((old_lin[end_old+k] == new_lin[end_new+k]) && (new_att[end_new+k] == old_att[end_old+k]) && (new_lin[end_new+k] != (char) NULL) && (old_lin[end_old+k] != (char) NULL) && (k < 10))
---
> while ((old_lin[end_old+k] == new_lin[end_new+k]) && (new_att[end_new+k] == old_att[end_old+k]) && (new_lin[end_new+k] != '\0') && (old_lin[end_old+k] != '\0') && (k < 10))
3162c3168
< if ((k > 8) || ((new_lin[end_new+k] == (char) NULL) && (k != 0)))
---
> if ((k > 8) || ((new_lin[end_new+k] == '\0') && (k != 0)))
3164c3170
< if (new_lin[end_new+k] == (char) NULL)
---
> if (new_lin[end_new+k] == '\0')
3172c3178
< while ((old_lin[offset] != (char) NULL) && (offset < COLS))
---
> while ((old_lin[offset] != '\0') && (offset < COLS))
3209c3215
< while (((new_lin[end_new] != old_lin[end_old]) || (new_att[end_new] != old_att[end_old])) && (new_lin[end_new] != (char) NULL) && (old_lin[end_new] != (char) NULL))
---
> while (((new_lin[end_new] != old_lin[end_old]) || (new_att[end_new] != old_att[end_old])) && (new_lin[end_new] != '\0') && (old_lin[end_new] != '\0'))
3211c3217
< if (new_lin[end_new] != (char) NULL)
---
> if (new_lin[end_new] != '\0')
3214c3220
< while ((old_lin[end_old+k] == new_lin[end_new+k]) && (old_att[end_old+k] == new_att[end_new+k]) && (new_lin[end_new+k] != (char) NULL) && (old_lin[end_old+k] != (char) NULL) && (k < 10))
---
> while ((old_lin[end_old+k] == new_lin[end_new+k]) && (old_att[end_old+k] == new_att[end_new+k]) && (new_lin[end_new+k] != '\0') && (old_lin[end_old+k] != '\0') && (k < 10))
3222c3228
< while ((old_lin[old_off] != (char) NULL) && (new_lin[old_off] != (char) NULL) && (old_lin[old_off] == new_lin[old_off]) && (old_att[old_off] == new_att[old_off]))
---
> while ((old_lin[old_off] != '\0') && (new_lin[old_off] != '\0') && (old_lin[old_off] == new_lin[old_off]) && (old_att[old_off] == new_att[old_off]))
3226c3232
< if ((!same) && ((k > 8) || ((new_lin[end_new+k] == (char) NULL) && (k != 0))))
---
> if ((!same) && ((k > 8) || ((new_lin[end_new+k] == '\0') && (k != 0))))
3243c3249
< while ((old_lin[offset] != (char) NULL) && (offset < COLS))
---
> while ((old_lin[offset] != '\0') && (offset < COLS))
3314c3320
< for (j = 0; (curr->row[j] != (char) NULL) && (j < curscr->Num_cols); j++)
---
> for (j = 0; (curr->row[j] != '\0') && (j < curscr->Num_cols); j++)
3536c3542
< (String_table[dc__]) && (curr->row[0] != (char) NULL) &&
---
> (String_table[dc__]) && (curr->row[0] != '\0') &&
3545c3551
< while ((vrt_lin[j] != (char) NULL) && (j < window->Num_cols))
---
> while ((vrt_lin[j] != '\0') && (j < window->Num_cols))
3549c3555
< while ((vrt_lin[j] == cur_lin[j]) && (vrt_att[j] == cur_att[j]) && (vrt_lin[j] != (char) NULL) && (vrt_att[j]))
---
> while ((vrt_lin[j] == cur_lin[j]) && (vrt_att[j] == cur_att[j]) && (vrt_lin[j] != '\0') && (vrt_att[j]))
3561c3567
< while ((vrt_lin[j] == cur_lin[j]) && (vrt_att[j] == cur_att[j]) && (vrt_lin[j] != (char) NULL))
---
> while ((vrt_lin[j] == cur_lin[j]) && (vrt_att[j] == cur_att[j]) && (vrt_lin[j] != '\0'))
3571c3577
< if (vrt_lin[j] != (char) NULL)
---
> if (vrt_lin[j] != '\0')
3589c3595
< if ((vrt_lin[j] == ' ') && (cur_lin[j] == (char) NULL) && (vrt_att[j] == cur_att[j]))
---
> if ((vrt_lin[j] == ' ') && (cur_lin[j] == '\0') && (vrt_att[j] == cur_att[j]))
3597c3603
< if ((vrt_lin[j] != (char) NULL))
---
> if ((vrt_lin[j] != '\0'))
3607c3613
< if ((vrt_lin[j] == (char) NULL) && (cur_lin[j] != (char) NULL))
---
> if ((vrt_lin[j] == '\0') && (cur_lin[j] != '\0'))
3620c3626
< while ((j < window->Num_cols) && (c2[j] != (char) NULL))
---
> while ((j < window->Num_cols) && (c2[j] != '\0'))
3622c3628
< while ((c1[j] == c2[j]) && (att1[j] == att2[j]) && (j < window->Num_cols) && (c2[j] != (char) NULL))
---
> while ((c1[j] == c2[j]) && (att1[j] == att2[j]) && (j < window->Num_cols) && (c2[j] != '\0'))
3634c3640
< if ((j < window->Num_cols) && (c2[j] != (char) NULL))
---
> if ((j < window->Num_cols) && (c2[j] != '\0'))
3639c3645
< for (j = begin_old; (c2[j] != (char) NULL) && (j < window->Num_cols); j++)
---
> for (j = begin_old; (c2[j] != '\0') && (j < window->Num_cols); j++)
3643c3649
< if ((c2[j] == (char) NULL) && (c1[j] != (char) NULL))
---
> if ((c2[j] == '\0') && (c1[j] != '\0'))
3699c3705
< for (one = offset, two = offset+1; (line[one] != (char) NULL) && (one < maxlen); one++, two++)
---
> for (one = offset, two = offset+1; (line[one] != '\0') && (one < maxlen); one++, two++)
3719c3725
< while ((line[one] != (char) NULL) && (one < (maxlen - 2)))
---
> while ((line[one] != '\0') && (one < (maxlen - 2)))