HDTenEightyP/NetNews huggingface dataset:
From: Duane Murphy <damurphy@wc.novell.com>
Subject: MPW VarArgs.h?
X-Xxdate: Fri, 22 Jan 93 16:53:41 GMT
Organization: Novell, Inc.
X-Useragent: Nuntius v1.1.1d12
Date: Fri, 22 Jan 1993 16:46:14 GMT


I am porting a program from the Unix world to the Macintosh.  At one 
point we had everything working pretty well in Think C.  We also would 
like to compile the program in MPW.  However, I have discovered that MPW 
does not support the (outdated) varargs.h file.  I am using the MPW from 
ETO 9 (C compiler 3.2.4).

Varags.h is (kind of) an older version of stdarg.h.  The varagrs 
mechanism is used in many places in the code and I would rather not 
change that (I would like to keep those code changes to a minimum).  I 
looked at Think C's stdarg.h and varargs.h, compared them to MPW's 
stdarg.h (which is slightly different) and I came up with this for 
VarArgs.h for MPW.

#ifndef __VARARGS__
#define __VARARGS__

#ifndef __va_list__
#define __va_list__
typedef char *va_list;
#endif

#define va_dcl				int va_alist;

#define va_start(ap) 		ap = (va_list) ((char *)&va_alist)
#define va_arg(ap, type) 	((type *)(ap += sizeof (type)))[-1]
#define va_end(ap)			/* do nothing */

#endif

Has any one else needed to do this?  Is this correct?  I am in the 
processes of trying it right now.  This is one of those things that is 
not easy to tell if this is going to work every time.

Thanks for any help,
...Duane

  +------------------------+--------------------------------------------+
  | Duane Murphy           | My opinions are mine, mine, and only mine; |
  | damurphy@wc.novell.com |      Except when they are also yours.      |
  | Macintosh Software QA  |                                            |
  +------------------------+--------------------------------------------+
From: mssmith@afterlife.ncsc.mil (M. Scott Smith)
Newsgroups: comp.sys.mac.programmer
Subject: Think Ref 2.0 printing bug?
Date: 22 Jan 93 11:07:50 GMT
Organization: The Great Beyond

Hi..  I received my Think Ref 2.0 upgrade, and it's a really awesome program..

But I've noticed that there seems to be a bug.  ("Seems to be" = I have not
thoroughly tested it out, but I'm fairly certain it's a result of Think Ref
and not something else.)

When I use "A5" as a search key, it jumps me to the "About Memory Management"
page.  From there, if I try to print, Think Reference unexpectedly prints
and the Finder says that it's damaged (Think Ref) and cannot print.

Can anyone try to reproduce this problem?  And, if it is a bug, is Symantec
aware of it?  (Note that I have successfully printed other pages.  About
Memory Management has graphics, and I haven't printed any pages with graphics,
so that might be what's causing it a problem if there is a problem.)

Also, here's another easter egg in Think Ref 2.0: If you have it running in
the background, and switch to it after it's been awhile, then the icon with
the guy sitting down animates briefly to show him waking up (or something).
Kind of neat..

Thanks for any help..

M. Scott Smith
  (mssmith@afterlife.ncsc.mil)
From: wstomv@wsinpa04.win.tue.nl (Tom Verhoeff)
Newsgroups: comp.sys.mac.programmer
Subject: Re: I hate THINK Pascal... (I happen to love it)
Summary: Has nothing to do with THINK Pascal
Date: 26 Jan 93 14:00:26 GMT
Reply-To: wstomv@win.tue.nl
Organization: Eindhoven Univ. of Technology, The Netherlands

In article <1993Jan24.005729.13045@fcom.cc.utah.edu> dmitry@chemistry.chem.utah.edu (Dmitry Boldyrev) writes:
>Hello,
>I really hate THINK Pascal now!! :( Because, whatever I do,
>all couse problems..

Well, I don't believe your problem has anything to do with THINK Pascal
as such.  I happen to love THINK Pascal and I find it a pity that you
say such harsh words about a wonderful product (which, of course, can
still be further improved :-).

>I'm working on Molecular Designer package and would like to write Floating
>palettes. Problem with Events, partcicularly with App4Evt, made me CRAZY!!
>If you have enought time, please take a look on this fragment of my code:
>
> [ code deleted, App4evt case not reached ]

Did you set up the SIZE resource appropriately?  If not, then your
application will simply not receive suspend & resume events (also not
in MPW, C, Fortran, Ada, etc. :-).  You can use such resources by putting
them in a file and mentioning this file in the RUN OPTIONS dialog as
the resource file.  Consult appropriate documentation, e.g. Inside Macintosh
volume VI.

	Tom
-- 
INTERNET: wstomv@win.tue.nl  /    Eindhoven University of Technology
VOICE: +31 40 47 41 25      /    Dept of Mathematics & Computing Science
FAX: +31 40 43 66 85       /    PO Box 513, NL-5600 MB Eindhoven, Netherlands
Newsgroups: comp.sys.mac.programmer
From: jmk3@crux2.cit.cornell.edu (Jay Krell)
Subject: Re: Why the Piracy? Here's why...
Organization: Cornell Information Technologies
Date: 27 Jan 93 18:34:42 GMT

>why aren't relatively unpiratable Sega/Nintendo cartridges cheaper?

The game systems are sold cheaply and Sega and Nintendo make money
primarily on the expensive cartridges.
 
 --Jay, jay.krell@cornell.edu
From: tjohnson@joule.elee.calpoly.edu (Todd Johnson)
Newsgroups: comp.sys.mac.programmer
Subject: Problems with sound (again)
Date: 24 Jan 93 19:28:48 GMT
Distribution: na
Organization: California Polytechnic State University, San Luis Obispo

Newsgroups: comp.sys.mac.programmer
Subject: Another sound problem
Summary: System 6 barfs
Followup-To: 
Distribution: na
Organization: California Polytechnic State University, San Luis Obispo
Keywords: snd, System 6

I use the following function to play sounds:

void play_sound(short res_id)
{
  SndChannelPtr  aChannel;
  OSErr          err;
  Handle         itsSound;

  itsSound = GetResource('snd ', res_id);
  if (itsSound != NULL)
  {
    aChannel = NULL;
    err = SndNewChannel(&aChannel, sampledSynth, initMono, NULL);
    if (err == noErr)
      SndPlay(aChannel, itsSound, FALSE);
    SndDisposeChannel(aChannel, FALSE);
    ReleaseResource(itsSound);
  }
}

  This works fine as long as I run it under System 7. However, when I
compile and run under System 6, it crashes the machine. Ideally, I
would like to have a function to play sounds that works under both
operating systems. What am I doing wrong?


Todd Johnson                         tjohnson@joule.elee.calpoly.edu
####################################################################
I love to go to the park and watch the kids run around and scream.
Of course, they don't know I'm using blanks.     Emo Phillips
From: mjr@zoo.bt.co.uk (Mark J Ridley)
Newsgroups: comp.sys.mac.programmer
Subject: Re: App icons won't stay changed!
Date: 27 Jan 93 08:16:00 GMT
Reply-To: mjr@zoo.bt.co.uk
Organization: BT Laboratories

In article 1jsto7INNlfv@gizmo.usc.edu, mharm@gizmo.usc.edu (Mike Harm) writes:
>Hi.  
>
>I've started writing mac programs with the help of David Mark's
>mac programming primer vol 1&2, and the hypercard IM's.  There
>is a section on changing app icons in the primer which says to 
>stick in a new icon in the resource file, make a BNDL and FREF
>resources, signature and the icon changes.  It does when I 
>rebuild my desktop... 
>
>If I then copy the app to a floppy, the correct (new) icon
>shows up when I stick it in my machine (whose desktop was rebuilt)
>but when I put it in another mac it shows the plain old vanilla
>application icon.
>
>I'm sure I don't really have to rebuild the desktop on each
>machine... how do I get all machines to recognize this icon?
>
>Any help greatly appreciated.  
>
>please email me at: mharm@gizmo.usc.edu
>
>Thanks for any help.
>
>Mike Harm
>Univ of Southern Calif.

If you are using System 7, all you have to do, is rebuild the desktop file on the floppy.
This is done by holding COMMAND+OPTION when inserting the disk. Hey presto, color icons everywhere!

Hope I've helped.

Mark Ridley.
mjr@zoo.bt.co.uk
From: Tommy.Brown@f204.n2603.z1.ieee.org (Tommy Brown)
Newsgroups: comp.sys.mac.programmer
Subject: Mac keyboard driver?
Date: 27 Jan 93 23:48:00 GMT
Organization: FidoNet node 1:2603/204 - Not Even Odd, Forest Hills NY

I don't believe that the Mac has a separate keyboard driver. The keyboard,

like the screen, is controlled by the system software itself, as an integral

part. Why do you need to go so low-level though? It sounds as if what you
need
 can be done by simply reading keyDown events. If you don't do it using
the
 events manager, your program will probably not work on a Mac Plus, and
may
 even be keyboard-dependent (ie not work on an Extended keyboard, or
whatever)
 but I'm not sure about the latter. It would definitely not work on
a Plus,
 however, which has no ADB. But you should be able to simply use the
event
 manager, no?


--  
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
 Tommy Brown - Internet: Tommy.Brown@f204.n2603.z1.ieee.org
Newsgroups: comp.sys.mac.programmer
From: precetti@timothy.ecn.purdue.edu (Cyrille J Precetti)
Subject: CMaster
Keywords: Beautifying code....
Organization: Purdue University Engineering Computer Network
Date: Thu, 28 Jan 1993 19:26:03 GMT

Could someone email me where to find CMaster.
Thanks
C.Precetti

Newsgroups: comp.sys.mac.programmer
From: mark@pokey.jsc.nasa.gov (Mark Manning)
Subject: Re: Reading numbers in TextEdit
Organization: NASA
Date: Mon, 25 Jan 1993 23:33:10 GMT

There is a wonderful program in the snippets directory at
ftp.apple.com.  It is called DialogBits and it addresses this
very problem.  Check there.  Don't remember the exact path name
of where it is, but I DO remember it is in the snippets' directory.
From: cpackard@bumetb.bu.edu (Charles Packard)
Newsgroups: comp.sys.mac.programmer
Subject: drag and drop example
Date: 22 Jan 93 20:17:29 GMT
Organization: Boston University
Originator: cpackard@bumetb.bu.edu

Howdy folks,

Could someone clue me in on what magic it takes to get the FINDER
to knonw that I've updated the FREF resource of my application to
add more filetypes to those I want to support drag and drop? I've
twice now written app's that drag and drop just the fine the 
filetypes I've added to the FREF first. But, now I can't get the
FINDER to pass on (with GetAppFiles) other filetypes. 

I would appreciate the help folks. Here is some simple code that works
with Think C v5. I've also got it working with SIOW and MPW, though
that was a LOT harder since it was my first time with SIOW!

--------------------------------------------start of code
#include <quickdraw.h>
#include <Files.h>
#include <standardfile.h>
#include <SegLoad.h>

#include <stdio.h>


char *Pascal2CString( unsigned char *pstr ) 
{
	register unsigned char *c, *n;
	unsigned char *end=pstr+pstr[0];
	
	for ( c=pstr, n=pstr+1 ; c < end ; *c++ = *n++ )
		;
		
	*c = '\0';
	return (char *)pstr;
}

void main ( void )
{
	short doWhat;       /* for CountAppFiles */
	short fileCnt;
	
	short index;        /* into files selected */
	
	AppFile fileStuff;
	char *cp = (char *) &fileStuff.fType;

	Str255 apName;      /* for GetAppParms */
	short resRefNum;
	Handle hParms;

	GetAppParms ( apName, &resRefNum, &hParms );
	printf("Application '%s'\n", Pascal2CString( apName ) );

	CountAppFiles( &doWhat, &fileCnt );

	if ( fileCnt > 0 ) {
		for ( index=1 ; index <= fileCnt ; index++ ) {
			printf("index: %d\n", 1);
			GetAppFiles( index, &fileStuff );
			
			printf("index: %d, Type: '%c%c%c%c', name: '%s'\n",
				index, cp[0], cp[1], cp[2], cp[3], 
				Pascal2CString( fileStuff.fName ) );
			ClrAppFiles( index );
		}
		
		if ( doWhat == appOpen ) {
			/*
			 * open up the files selected in Finder
			 */
		} else if ( doWhat == appPrint ) {
			/*
		 	 * print files selected in Finder
		 	 */
		 } else {
		 	/*
		 	 * not expecting any other value back from CountAppFiles
		 	 */
		 	exit (1);
		 }
	} else {
		printf("No files selected.\n");
	}
}
--------------------------------------------end of code

regards,
chuck packard
cpackard@mathwors.com        <-- if responding directly to me use this
                                 address as I will soon lose my BU feed, thanks
                                 
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Color animation in After Dark...HELP!
Organization: Kalamazoo College
Date: Thu, 21 Jan 1993 20:05:41 GMT

cantrell@lamar.ColoState.EDU (Carol Cantrell) writes:
>I'm writing an After Dark module that uses color table animation. ...
>I want to copy the GWorlds to the screen color index for color index--
>that is, color #1 in the GWorld is color [#1] on the screen, etc.
>The obvious way to do this is to OR the ctFlags field with $4000;

Not _that_ obvious;  it's hidden pretty well in IM VI, actually.  :-)

>however, this copies index numbers from the GWorld to index numbers
>in the current PALETTE.  After Dark doesn't draw into a WINDOW, and therefore
>DOESN'T HAVE A PALETTE!!!   Is there any way to do this?  Help!

Yep, there are three ways to get the Color Indices You Want up onto the
screen:
	(1) Set bit 14 in ctFlags;
	(2) Make the ctSeeds equal;
	(3) Write directly to the screen.

(1) won't work for you, as you say, because AD opens a port not a
palette.  (Actually, does it even do that?  Someone said it uses
SetStdProcs() to redirect QD calls to its own nefarious ends.  I don't
even want to think about that.)

(2) is probably your best bet in this case.  If the ctSeed in your
source pixmap's color table is equal to the ctSeed in your dest pixmap's
color table, CopyBits will take this to mean that the color tables are
in fact equal.  It will not run through them and check.  Consequently,
it will just copy the pixel values straight across, which has the effect
you want.  (And, as a side dish, it's also the fastest possible way that
CopyBits can operate.)

You can set the ctSeeds yourself, manually, if you like.  Normally,
that's not a good idea, but After Dark is such a snuggly, hand-holding
environment to work in, that I won't even give you the usual "now don't
do this" warning.  All you gotta do is drop a 'clut' in your module with
the appropriate resource ID, set a few flags, maybe check the screen
depth yourself, and you're guaranteed to have the screen you want, with
the colors you want.  So--do the checks, copy the screen's pixmap's
pmTable's ctSeed into your GWorld's pixmap's pmTable's ctSeed, and
CopyBits to your heart's content.

Alternatively, you can build a GWorld using the screen's pmTable.  But
I'm not too familiar with GWorlds, so you're on your own there.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "We enjoy a patent portfolio second to none in the computer industry,
  with some 30,000 patents worldwide and more than 9,000 in the U.S. alone,
  and growing." 				     - An IBM advertisement
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Subverting the Think C Editor
Organization: Kalamazoo College
Date: Wed, 27 Jan 1993 16:42:42 GMT

lind@ils.nwu.edu (Jeff Lind) writes:
>Well, perhaps I'm spoiled by having worked in MCL for a while now, but in
>playing with THINK C lately I've been consistently dissapointed off by the
>weak editor.

Are we using the same editor?

>It doesn't know anything about coding, really. I mean, it
>won't match parentheses,

Cmd-B.  Brackets and braces too.

>it hardly does any indentation,

Auto-indent, and cmd-[] to shift selected text left or right one tab.
(Did you want it to intelligently indent your text based on what you're
typing?  Personally I find that annoying as hell.  :-)

>it has very few
>searching commands,

OK, you can't search backwards, and you can't choose subsets of your
project's files very easily.  But it greps...

>it has no concept of a word or an expression, so you
>can't do nice things like control-rightarrow to skip an entire word or
>expression.

Cmd-rightarrow skips a word.

And as for skipping _expressions_...I'm glad it doesn't even try.  It
would have to all but compile the code to parse it well enough to figure
out where expressions start and stop.  With command, option, and
Balance, I can usually get anywhere in a line with four or five
keystrokes...

>It's basically teach-text.

To be sure, it's not great, but it's not _that_ bad...
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "I don't think people need optimization any more. ...  If you look at the
  history of programming-language design, almost every major screw-up is a
  consequence of people pandering to some optimization...."   - S. Wolfram
From: dpb@huelings.harvard.edu (David Baker)
Newsgroups: comp.sys.mac.programmer
Subject: Serial question
Date: 27 Jan 93 00:38:09 GMT
Article-I.D.: scws6.DPB.93Jan26163809
Distribution: comp
Organization: Department of Psychology, Harvard University

I tried to test out the serial port with the following porgram, and I got the
same problem I had had in the project I'm working on, which is that the
machine freezes during the FSWrite call.  When I enter MacsBug, I am in a loop
in _vSyncWait.  Does anyone know what I'm doing wrong?

main()
{
	int num,count=4,err;
	char duh[10];
	
	strcpy(duh,"ATZ\n");
	
	err=OpenDriver("\p.Aout",&num);
	printf("Open error: %d\n",err);
	err=FSWrite(num,&count,duh);
	printf("Write error: %d\n",err);
	err=CloseDriver(num);
	printf("Close error: %d\n",err);
}

Thanks,
David
Department of Psychology
Harvard University
--
--------------------------------------+----------------------------------------
David P. Baker			      | 
Work: dpb@huelings.harvard.edu	      | The only reason we think we're free is 
Home: baker4@husc.harvard.edu	      | that we cannot imagine the alternative.
Office: William James Hall 844	      |	
	Department of Psychology      | 
	Harvard University	      |	N.B.: If responding by mail, please
	(617) 495-3773		      |	      use my "Work" address above.
--------------------------------------+----------------------------------------
From: jlothian@castle.ed.ac.uk (J Lothian)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Prolog for Mac ?
Date: 21 Jan 93 13:45:41 GMT
Organization: Edinburgh University Computing Service

In article <Jim_Holt-180193172715@jolt.sps.mot.com>, Jim_Holt@aprdlgtr.sps.mot.com (Jim Holt) writes:
|> Does anyone know of a Prolog package for the Mac ?
|> 
|> -jh

The 'standard' one seems to be Logic Programming Associates' 
MacPROLOG, but seems to be *seriously* expensive. Various others
exist (SB-Prolog?), but I don't know much about them. It might
be worth asking around in comp.lang.prolog. LPA's address is:
Studio 4, Royal Victoria Patriotic Building, 
Trinity Road,
LONDON SW18 3SX
England
(at least, this address was correct in 1990.)

James
-- 

-------------------------------------------------------
James Lothian        |      "It's life, Jim, 
james@uk.ac.ed.caad  |   but not as we know it"
From: pnsf01dw@UMASSD.EDU (Dennis J. Wilkinson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Smalltalk/V users?
Date: 28 Jan 93 18:56:05 GMT
Reply-To: pnsf01dw@UMASSD.EDU
Organization: UMASS DARTMOUTH, NO. DARTMOUTH, MA.

In article <1k8rg1$604@DIALix.oz.au>, dent@DIALix.oz.au (Andrew Dent) writes:
>Hi
>
>I'm interested in the progress of Smalltalk/V for the Mac. Does it now have
>a runtime-only version or way of producing an executable?
>
>What's the support for colour in the interface?
>
The current release of ST/V for the Mac (1.2, although there was a quickie
release to fix a problem with Quadra caching) supports limited color
capabilities (eight colors only, I beleive) and does have a method for creating
standalone runtime modules (a fairly complex method involving the RuntimeCloner
class). 

Last contact that I had with Digitalk Tech Support indicated that the next
release (2.0?) brings the environment up to par with their DOS product (a better
seller for them) and makes it fully System-7 aware. It's due out first or second
quarter of this year.

-- Dennis
----------------------------------------------------
Dennis J. Wilkinson, II  (pnsf01dw@umassd.edu)
University of Massachusetts Dartmouth - Design/CS Project

The opinions reflected in this post are MINE!!!! ALL MINE!!!!!
Newsgroups: comp.sys.mac.programmer
From: zobkiw@world.std.com (Joe Zobkiw)
Subject: Re: Think Reference 2.0 Review
Organization: The World Public Access UNIX, Brookline, MA
Date: Sat, 23 Jan 1993 01:38:48 GMT

Actually, AutoDoubler compressed the files from about 7.1 megs down
to about 4 megs. It seems (when you open the data files with 
Resorcerer) that they are straight data, no compression built in.

Even using AutoDoubler, the boot time of THINK Ref 2.0 was not
much slower than it is by default...just a few seconds...on my
PowerBook 160.


-- 
-------------------------------------------------------------
joe zobkiw                               zobkiw@world.std.com
-------------------------------------------------------------
From: udmorrow@mcs.drexel.edu (Daniel Morrow)
Newsgroups: comp.sys.mac.programmer
Subject: how to send AppleEvent to remote machine without login dialog.
Date: 26 Jan 93 01:01:38 GMT
Distribution: usa
Organization: Drexel University

How can I send an Apple event to a program on a remote machine without
getting that damned 'login as a guest or registered user' dialog box.

I want to assume that guest access will always be allowed.

Both programs are background-only applications, btw, but I don't think
that makes a difference of why I can't get this to work.

Right now I am running the thing under Think C 5 under it's debugger.

-Dan.
udmorrow@mcs.drexel.edu
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Resources
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Mon, 25 Jan 1993 01:50:12 GMT

In article <rudolph.727824463@unixg.ubc.ca>, rudolph@unixg.ubc.ca
(Christopher E Rudolph) wrote:
> 
> Can anyone tell me if there is an quick way of opening an applications
> resource fork and then cycling through every resource in the application
> so that I can display them in a list.
> 
> ie) simaler to what resource editors do
> 
> I basically want to know what methods are available to read off every
> resource in an applications resource fork?
> 

I can think of two ways. One is the right way, but I don't know if it meets
your qualification of quick. The other way is definitely as quick as you'll
get, but it is also definitely the wrong way.

The right way is to go back to Inside Mac IV and read the descriptions of
the functions Get1IndType, Get1IndResource, Count1Types and
Count1Resources. You would then write a function sort of like the
following:

short numTypes, numResources, typeIndex, resIndex;
ResType type;
Handle resource;

numTypes = Count1Types();
for (typeIndex = 1; numIndex <= numTypes; ++typeIndex)
{
    Get1IndType(&type, typeIndex);
    numResources = Count1Resources(type);
    for (resIndex = 1; resIndex <= resTypes; ++resIndex)
    {
        resource = Get1IndResource(type, resIndex);
        MessWithResource(resource);
    }
}

I'm not going to tell you the wrong, fast way, but it too, amazingly, can
be figured out by reading Inside Macintosh.

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.