NetBSD Problem Report #3555

Received: (qmail-queue invoked from smtpd); 28 Apr 1997 15:50:03 -0000
Message-Id: <199704281549.KAA22685@lotharon.endicor.com>
Date: Mon, 28 Apr 1997 10:49:55 -0500 (CDT)
From: Ty Sarna <tsarna@endicor.com>
Reply-To: tsarna@endicor.com
To: gnats-bugs@gnats.netbsd.org
Subject: genassym.sh enhancements reduce typing
X-Send-Pr-Version: 3.95

>Number:         3555
>Category:       kern
>Synopsis:       genassym.sh enhancements reduce typing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 28 09:05:02 +0000 1997
>Closed-Date:    Wed Jun 25 03:09:12 +0000 1997
>Last-Modified:  Wed Jun 25 03:09:37 +0000 1997
>Originator:     Ty Sarna
>Release:        NetBSD-current 970415
>Organization:
	Endicor Technologies, Inc., San Antonio, Texas
>Environment:

System: NetBSD lotharon.endicor.com 1.2B NetBSD 1.2B (LOTHARON) #1: Thu Dec 12 12:09:19 CST 1996 tsarna@lotharon.endicor.com:/usr/src/sys/arch/sun3/compile/LOTHARON sun3

>Description:
	genassym.sh is pure genius. I even found another use for it. 
	But the input syntax can be somewhat tedious.
>How-To-Repeat:
	Get tired of typing "define REALLY_LONG_DEFINE REALLY_LONG_DEFINE",
	or equally tedius structure member offset definitions.
>Fix:
	The patch included below adds three new 'statements' to
genassym.sh's syntax:

	export X
		is a synonym for "define X X"
	struct X
		remembers X for "member" (see below) and
		does a "define X_SIZEOF sizeof(struct X)"
	member Y
		does a "define Y offsetof(last_X, Y)"

*** genassym.sh.orig	Fri Apr 25 09:54:26 1997
--- genassym.sh	Fri Apr 25 10:20:56 1997
***************
*** 75,80 ****
--- 75,96 ----
  	next;
  }

+ /^struct[ \t]/ {
+ 	structname = $2;
+ 	$0 = "define " structname "_SIZEOF sizeof(struct " structname ")";
+ 	/* fall through */
+ }
+ 
+ /^member[ \t]/ {
+ 	$0 = "define " $2 " offsetof(struct " structname ", " $2 ")";
+ 	/* fall through */
+ }
+ 
+ /^export[ \t]/ {
+ 	$0 = "define " $2 " " $2;
+ 	/* fall through */
+ }
+ 
  /^define[ \t]/ {
  	if (defining == 0) {
  		defining = 1;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: thorpej 
State-Changed-When: Tue Jun 24 20:09:12 PDT 1997 
State-Changed-Why:  
Applied.  Thanks! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.