1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Having a local `string.h' is just asking for trouble. As is having a

`struct string'.  Rename the struct and effectively rename the header
to `mystring.h'
This commit is contained in:
David E. O'Brien 2000-10-26 10:00:52 +00:00
parent cc66bbda3c
commit e218b63212
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67606
13 changed files with 46 additions and 24 deletions

View File

@ -1,4 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
PROG= window
SRCS= char.c cmd.c cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \
@ -14,8 +15,17 @@ SRCS= char.c cmd.c cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \
wwredrawwin.c wwrint.c wwscroll.c wwsize.c wwspawn.c wwsuspend.c \
wwterminfo.c wwtty.c wwunframe.c wwupdate.c wwwrite.c xx.c xxflush.c \
compress.c
SRCS+= mystring.h
MAN= window.1
CFLAGS+= -I.
DPADD= ${LIBTERMCAP}
LDADD= -ltermcap
mystring.h: string.h
ln -sf ${.ALLSRC} ${.TARGET}
CLEANFILES+= mystring.h
.include <bsd.prog.mk>

View File

@ -36,10 +36,11 @@
#ifndef lint
static char sccsid[] = "@(#)cmd3.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "defs.h"
#include "string.h"
#include "mystring.h"
setescape(esc)
register char *esc;

View File

@ -36,10 +36,11 @@
#ifndef lint
static char sccsid[] = "@(#)cmd6.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "defs.h"
#include "string.h"
#include "mystring.h"
#include "char.h"
/*
@ -87,7 +88,7 @@ c_debug()
debug_str()
{
register struct ww *w;
struct string *s;
struct mystring *s;
if ((w = openiwin(wwnrow - 3, "Allocated Strings")) == 0) {
error("Can't open string window: %s.", wwerror());

View File

@ -36,11 +36,12 @@
#ifndef lint
static char sccsid[] = "@(#)cmd7.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include <stdlib.h>
#include "defs.h"
#include "string.h"
#include "mystring.h"
/*
* Window size.

View File

@ -36,10 +36,11 @@
#ifndef lint
static char sccsid[] = "@(#)context.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "value.h"
#include "string.h"
#include "mystring.h"
#include "context.h"
#include <fcntl.h>

View File

@ -36,11 +36,12 @@
#ifndef lint
static char sccsid[] = "@(#)lcmd1.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "defs.h"
#include <string.h> /* System string definitions. */
#include "string.h" /* Local string definitions. */
#include "mystring.h" /* Local string definitions. */
#include "value.h"
#include "lcmd.h"
#include "var.h"

View File

@ -36,11 +36,12 @@
#ifndef lint
static char sccsid[] = "@(#)lcmd2.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "defs.h"
#include <string.h> /* System string definitions. */
#include "string.h" /* Local string definitions. */
#include "mystring.h" /* Local string definitions. */
#include "value.h"
#include "var.h"
#include "lcmd.h"

View File

@ -42,6 +42,7 @@ char copyright[] =
#ifndef lint
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/2/94";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "defs.h"
@ -49,7 +50,7 @@ static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/2/94";
#include <locale.h>
#include <stdio.h>
#include <string.h> /* System string definitions. */
#include "string.h" /* Local string definitions. */
#include "mystring.h" /* Local string definitions. */
#include "char.h"
#include "local.h"

View File

@ -34,6 +34,7 @@
* SUCH DAMAGE.
*
* @(#)string.h 8.1 (Berkeley) 6/6/93
* $FreeBSD$
*/
#define STR_DEBUG
@ -46,16 +47,16 @@ char *str_itoa();
#define str_cmp(a, b) strcmp(a, b)
#ifdef STR_DEBUG
struct string {
struct string *s_forw;
struct string *s_back;
struct mystring {
struct mystring *s_forw;
struct mystring *s_back;
char s_data[1];
};
struct string str_head;
struct mystring str_head;
#define str_offset ((unsigned)str_head.s_data - (unsigned)&str_head)
#define str_stos(s) ((struct string *)((unsigned)(s) - str_offset))
#define str_stos(s) ((struct mystring *)((unsigned)(s) - str_offset))
char *str_alloc();
int str_free();

View File

@ -34,12 +34,13 @@
* SUCH DAMAGE.
*
* @(#)parser.h 8.1 (Berkeley) 6/6/93
* $FreeBSD$
*/
#include "value.h"
#include "context.h"
#include "token.h"
#include "string.h"
#include "mystring.h"
#define p_erred() (cx.x_erred)
#define p_synerred() (cx.x_synerred)

View File

@ -36,10 +36,11 @@
#ifndef lint
static char sccsid[] = "@(#)string.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include <string.h> /* System string definitions. */
#include "string.h" /* Local string definitions. */
#include "mystring.h" /* Local string definitions. */
char *malloc();
@ -123,9 +124,9 @@ char *
str_alloc(l)
int l;
{
register struct string *s;
register struct mystring *s;
s = (struct string *) malloc((unsigned)l + str_offset);
s = (struct mystring *) malloc((unsigned)l + str_offset);
if (s == 0)
return 0;
if (str_head.s_forw == 0)
@ -140,7 +141,7 @@ int l;
str_free(str)
char *str;
{
register struct string *s;
register struct mystring *s;
for (s = str_head.s_forw; s != &str_head && s->s_data != str;
s = s->s_forw)

View File

@ -34,6 +34,7 @@
* SUCH DAMAGE.
*
* @(#)string.h 8.1 (Berkeley) 6/6/93
* $FreeBSD$
*/
#define STR_DEBUG
@ -46,16 +47,16 @@ char *str_itoa();
#define str_cmp(a, b) strcmp(a, b)
#ifdef STR_DEBUG
struct string {
struct string *s_forw;
struct string *s_back;
struct mystring {
struct mystring *s_forw;
struct mystring *s_back;
char s_data[1];
};
struct string str_head;
struct mystring str_head;
#define str_offset ((unsigned)str_head.s_data - (unsigned)&str_head)
#define str_stos(s) ((struct string *)((unsigned)(s) - str_offset))
#define str_stos(s) ((struct mystring *)((unsigned)(s) - str_offset))
char *str_alloc();
int str_free();

View File

@ -36,11 +36,12 @@
#ifndef lint
static char sccsid[] = "@(#)var.c 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include "value.h"
#include "var.h"
#include "string.h"
#include "mystring.h"
char *malloc();