[net.sources.mac] Fix to implement STR# in SUMacC's rmaker.

guido@boring.UUCP (06/25/85)

*** 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 <stdio.h>

--- 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 <stdio.h>
***************
*** 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.