Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC840302); site boring.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!linus!philabs!cmcl2!seismo!mcvax!boring!guido
From: guido@boring.UUCP
Newsgroups: net.sources.mac
Subject: Fix to implement STR# in SUMacC's rmaker.
Message-ID: <6477@boring.UUCP>
Date: Mon, 24-Jun-85 19:07:12 EDT
Article-I.D.: boring.6477
Posted: Mon Jun 24 19:07:12 1985
Date-Received: Sat, 29-Jun-85 01:47:11 EDT
Reply-To: guido@boring.UUCP (Guido van Rossum)
Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam
Lines: 102
Apparently-To: rnews@mcvax.LOCAL

*** oldrmaker.c	Mon Jun 24 16:35:05 1985
--- rmaker.c	Mon Jun 24 16:46:36 1985
***************
*** 20,25
   * 09/18/84	Croft	Fixed fwrite bug for resource names.
   * 11/06/84	Croft	Added INIT and PACK.
   * 11/11/84   	Maio/Schilit no NULL in DRVR name if device driver.
   */
  
  #include 

--- 20,26 -----
   * 09/18/84	Croft	Fixed fwrite bug for resource names.
   * 11/06/84	Croft	Added INIT and PACK.
   * 11/11/84   	Maio/Schilit no NULL in DRVR name if device driver.
+  * 06/25/85	GvR	Added 'STR#'.
   */
  
  #include 
***************
*** 86,91
  char	*datap;			/* pointer to data area */
  
  /* type format handlers */
  extern	handstr(), handhexa(), handcode(), handdrvr();
  extern	handdlog(), handalrt(), handditl();
  extern	handwind(), handmenu(), handcntl(), handinit();

--- 87,93 -----
  char	*datap;			/* pointer to data area */
  
  /* type format handlers */
+ extern	handstrl();
  extern	handstr(), handhexa(), handcode(), handdrvr();
  extern	handdlog(), handalrt(), handditl();
  extern	handwind(), handmenu(), handcntl(), handinit();
***************
*** 94,99
  	char	th_type[8];	/* e.g. "CODE" */
  	int	(*th_handler)(); /* format handler function */
  } typehand[] = {
  	"STR ",	handstr,
  	"HEXA",	handhexa,
  	"CODE",	handcode,

--- 96,102 -----
  	char	th_type[8];	/* e.g. "CODE" */
  	int	(*th_handler)(); /* format handler function */
  } typehand[] = {
+ 	"STR#", handstrl,
  	"STR ",	handstr,
  	"HEXA",	handhexa,
  	"CODE",	handcode,
***************
*** 603,609
  		abort("missing string");
  	datastring(lp,1);
  }
! 	
  
  /*
   * Handle hexadecimal format data.

--- 606,643 -----
  		abort("missing string");
  	datastring(lp,1);
  }
! 
! 
! /*
!  * Handle string list format data.
!  */
! handstrl()
! {
! 	int count;
! 	char *backp= datap;
! 	int nbytes;
! 
! 	/* Pad for count */
! 	*datap++= 0;
! 	*datap++= 0;
! 	/* Process lines */
! 	for (count= 0;; ++count) {
! 		if (getline() == 0)
! 			break;
! 		datastring(lp,0);
! 	}
! 	if (count == 0)
! 		abort("empty STR# string list"); /* Is this really necessary? */
! 	/* Stuff count where it belongs */
! 	*backp++= count >> 8;
! 	*backp++ = count & 0xFF;
! 	/* Pad whole resource if odd byte count (assume this is necessary) */
! 	nbytes= datap - data;
! 	if (nbytes & 1)
! 		*datap++ = '\0';
! 
! }
! 
  
  /*
   * Handle hexadecimal format data.