TweetFollow Us on Twitter

Chatter Box
Volume Number:5
Issue Number:2
Column Tag:Intermediate Mac'ing

Related Info: AppleTalk Mgr

AppleTalk Chatter Box

By Rob Hafernik, Austin, TX

Note: Source code files accompanying article are located on MacTech CD-ROM or source code disks.

A Chat Program for AppleTalk

(Rob Hafernik has been programming at one job or another for 10 years. Over the years, he’s been involved in a wide variety of programming projects; working with banks, hospitals, the Space Shuttle, robotics, graphics, and so on. He’s finally lucked out and now actually gets paid to program the Macintosh for Technology Works in Austin, Texas. He can be reached via e-mail on BIX or MacNet as user ID “rob42” )

From the first time I sat down to a Mac connected to AppleTalk, I wanted to write a program to let users on AppleTalk-connected Macs chat back and forth. The idea languished in the back of my mind for years until I recently found myself with a need to learn AppleTalk and a whole day free of other programming responsibilities. Thus Chatterbox was begun.

I had already spent a couple of hours studying Inside AppleTalk to get a feel for the various AppleTalk protocols and more time pouring over the various Inside Macintosh chapters that cover AppleTalk. From the start, I’d decided that the program would not be restricted to just two users talking back and forth. The program had to be able to let any user send a message to any subset of the rest of the users on the internet (or all of them). I also wanted to keep the program as simple and fool-proof as possible. From all of this I came to the decision that Chatterbox would use the Name Binding Protocol (NBP) to see who was available to talk to and the Datagram Delivery Protocol (DDP) to send and receive the actual messages.

AppleTalk Basics

First a few AppleTalk terms. Each device (such as your Mac or LaserWriter) on an AppleTalk network is called a node. Up to 32 devices can be connected together to form an AppleTalk network (up to 255 devices are allowed with Apple’s new release of AppleTalk). Several networks may be connected together (via special nodes called internet routers) to form a zone. The sum of all of the networks connected together are referred to as an internet. As each device boots up, it establishes contact with its network and comes up with a unique node id. Since more than one program may be running on a given node that wants to use the network, an addressing mechanism called sockets allows each node to have up to 254 separate addressable entities running at any one time. The low numbered sockets are reserved by Apple for the low-level protocols (such as the Name Binding Protocol we’ll discuss below), but sockets 128-254 are open for use by any Mac program. Each socket must have a socket listener. This is a piece of code that the DDP calls to handle incoming messages. Apple supplies a default socket listener that does the minimum - it copies incoming messages to the buffer you supply and sets a result field.

The Datagram Delivery Protocol is the simplest data transfer protocol of them all and the one that all of the higher-level protocols are based on: it doesn’t guarantee delivery and it doesn’t guarantee that packets will arrive intact. What does it do? Well, it provides for the “best effort” delivery of a packet of up to 586 bytes to a given network, node and socket on the internet. What more could a chat program ask for? One note: throughout this program I have used the “alternate interface”, as opposed to the “preferred interface”. The “preferred interface” (described in Inside Macintosh Volume V) is based on the same type of parameter-block calls as the low-level file system interface. Unfortunately, since the “preferred interface” provides no equivalent of the “DDPRead” function, a socket listener and read function must be provided by the programmer. For this simple application, the “alternate interface” proved best and easiest to understand.

The Name Binding Protocol provides a way for programs that will use AppleTalk (client programs) to register on the network. Each client program opens a socket, then registers a name and type with the NBP. A client program can also ask NBP for the names, types, and addresses of other clients in its zone. NBP provides a wild-card match scheme that allows, for example, a client to scan the zone for all other names of a given type. This is the mechanism that Chatterbox uses to find other users to talk to.

The Chatterbox Program

Now let’s look at the program. When Chatterbox first starts up, it asks the user for the name they wish to use during the session (figure 1). The name defaults to the Chooser name, but the user may override this and provide any name less than 32 characters long (the limit allowed by the NBP). After that, the program displays a window with several parts (figure 2). There is a scrollable area where the names of other Chatterbox users are displayed; an area for status messages (I like programs that let me know what they’re doing, especially ones like this whose actions are mostly invisible); a TextEdit field for messages you wish to send; and a read-only TextEdit field where incoming messages are displayed.

Figure 1.

To use the program, the user selects recipients from the list. Multiple selections are allowed, both continuous selections made with a shift-click and discontinuous selections made with a command-click. Messages entered in the edit-text field are transmitted by hitting the <return> key at the end of the message. As others send messages, they’re displayed in the area at the bottom. As more messages come in, the old ones scroll up and are eventually deleted as they scroll off the top.

Figure 2.

The flow of the program is pretty simple. Once the usual Mac stuff is initialized, the program opens a socket that will be used to receive messages. To keep things easy, I used the default, Apple-supplied, socket listener. Then the RegisterName routine allocates a parameter block, fills in the user’s name, type, zone, socket and a few other parameters and calls NBPRegister to do the work. The zone string is set to “*”, meaning “this zone” and the type string to “Chatterbox”. By using the “*” zone name, Chatterbox is limiting communications to a single zone (the one it’s in), but this simplifies the program considerably. Note that when the program quits, it must call NBPRemove to take this name out of the list - see the UnRegisterName routine.

After registering on the internet, the next thing the program does is send out a special greeting to all other Chatterboxes. Why? Well, it’s a long story. When I first wrote the program, I thought that it would periodically scan the zone for new users and add them to its display. This proved to be very cumbersome (it takes a second or two to do the lookup for one thing, a pretty big interruption if you’re doing anything) and I went through several schemes before I came up with another method: as Chatterbox gets incoming messages, it looks to see if they begin with the non-breaking space (option-space from the keyboard). If so, it’s a signal that the list of users in the zone has changed and it’s time to call CheckForUsers (discussed below). This means that the user is only interrupted when a new user comes along (or goes away, we’ll get to that later). So this special message that is sent out by a new Chatterbox coming along triggers all the other Chatterboxes to look around the zone for their fellows. Why go to all the trouble of a CheckForUsers and not just add the new user to the list? In a word, redundancy. This may take a little extra processor time, but it guarantees that the list of users is up-to-date, regardless of the whims and crashes of the network.

The CheckForUsers routine is a bit complicated. The current list of other Chatterboxes in the zone is displayed using the list manager. Whenever CheckForUsers scans the network for other users, it must add new Chatterboxes to the list and delete Chatterboxes no longer active from the list - all without disturbing the user’s selections in the list. It first calls NBPLookUp to get the names of all Chatterboxes, then it extracts one name at a time using NBPExtract. Each name is compared to those in the list; if there’s a match, that entry is marked as “found” and the next name is processed. If the name is not found in the list, it’s added. After all of the names have been extracted, any names not marked as “found” are deleted from the list. This would all be better handled by a custom LDEF, but I’ll save that for another day.

To receive messages with DDP, a program must first ask for them and provide a buffer to store them in. The AskForMessages routine takes care of this. It’s very simple, just a single call to DDPRead. In this case, DDPRead is called with the async parameter set to true, meaning that the program will go on with its business while it waits for a message to come in. Once DDPRead has been called, it’s the program’s responsibility to watch the abResult field of the InABRecord parameter block to go to zero or a negative value. DDPRead sets this field to a positive number - the socket listener will set it to zero (if everything is OK) or negative (the error code) when a message comes in. In Chatterbox, the abResult field is examined once each time a null event is received.

When a message has been detected, the ReadMessage routine is called to pull the message out of the buffer and display it in the incoming messages field. As soon as the message is dealt with, ReadMessage calls AskForMessage to get ready for the next message.

Sending messages is simple too. When the user hits <return> to send a message, it’s pulled out of the TextEdit field and put into a message buffer. The program then runs through the user list, building a parameter block for each user selected and calling DDPWrite to send the message. Sometimes the SendMessage routine must be called upon to send a message to everyone in the list, even if they aren’t selected (this happens during the start-up greeting, for example). In this case, the calling routine sets the toAll parameter true.

When the user quits the program, it again sends out a special message that starts with a non-breaking space. This time it’s an “adios” message. This message, like the greeting message, is used to tell all of the other Chatterbox programs in the zone to re-build their lists of users, since one has just quit.

Extras and Options

That’s the bulk of the program, but there are a few extras. There are two buttons in the window for frequently-used tasks. The Scan button just looks for Chatterboxes on the network. The user can press it if things seem a little screwy or out of sync - it’s really just a security blanket, it’s rarely needed. The Select All button selects all of the users in the list, something I found most users do often. There are also three optional behaviors that can be set or unset in the Options menu. The first sets a flag that tells the program to beep with each incoming message. This is in case a message comes in when the user isn’t watching or the window is in the background under MultiFinder. The second option allows the user to see the messages transmitted echoed in the incoming message field. The last option allows the user to have all new users that come along be automatically selected as recipients.

What next?

So how could this program be improved? Well, it would be nice if the program let you pick the zone you wanted to chat in, instead of just letting you chat in your own. The AppleTalk Zone Information Protocol could be used to get a list of zones on the internet. It would also be nice if the incoming messages that were deleted from the TextEdit field as they scrolled off the top could instead be scrolled back down with a scroll bar. A file transfer facility would be nice. No doubt all of you out there can come up with more improvements.

As you see, AppleTalk is easy to use. This simple, low-level approach, using DDP and NBP, could be used to implement games, e-mail, network copy protection schemes and so on. As more and more Macs are networked out there, network awareness becomes more and more a must for any application.

Listing:  Chatter.c

/* ======== Chatterbox ======= */

#include<AppleTalk.h>

/*** defines */
#define NULL0L
#define MAXUSERS 64
#define BUFSIZE  600
#define NONE0
#define REGISTER 1
#define WAITING  2
#define SCANNING 3
#define SENDING  4
#define RECEIVING5
#define MAXTEXT  32000L 
#define MAXMSG   50
#define DISPLINES8
#define RETURNKEY‘\015’
#define ENTERKEY ‘\003’

/*** data about a single user */
typedef struct UserRecord {
 AddrBlockaddr;
 int    found;
 } UserRecord;

/*** Globals */
intDoneFlag;
WindowPtr TheWindow; 
ControlHandle  ScanButton;
ControlHandle  SelectAllButton;    
ListHandleUserList;
TEHandleMyMessage; 
TEHandleInMessages;
MenuHandleAppleMenu; 
MenuHandleFileMenu;
MenuHandleEditMenu;
MenuHandleOptionMenu;
DDPProto**InABRecord;
UserRecordOtherUsers[MAXUSERS];
EntityNameMyEntityName;   
PtrMyNameBuf;    
Str255  MyName;  
intMySocketID;   
intNumOtherUsers;
intTheError;
intEchoFlag;
intBeepFlag;
intSelectFlag;   
char    RecBuffer[BUFSIZE];
Rect    StatusR; 
Rect    DragRect;
 
/*====================*/
main()
 {
 EventRecordevent;
 WindowPtrwhichWindow;
 char   key;

 Initialize ();
 while ( !DoneFlag ) {

 GetNextEvent ( everyEvent, &event );
 switch ( event.what ) {
 case activateEvt:
 whichWindow = (WindowPtr)event.message;
 if ( whichWindow == TheWindow ) { 
 if ( event.modifiers & activeFlag ) {
 TEActivate ( MyMessage );
 LActivate ( true, UserList );
 ShowControl ( ScanButton );
 ShowControl( SelectAllButton);
 }
 else {
 TEDeactivate ( MyMessage );
 LActivate ( false, UserList );
 HideControl ( ScanButton );
 HideControl ( SelectAllButton );
 }
 }
 break;
 case updateEvt:
 whichWindow = (WindowPtr)event.message;
 if ( whichWindow == TheWindow ) {
 BeginUpdate ( TheWindow );
 DoUpdate ( );
 EndUpdate ( TheWindow );
 }
 break;
 case mouseDown:
 switch ( FindWindow ( event.where,
 &whichWindow ) ) {
 case inMenuBar:
 DoMenu (MenuSelect(event.where));
 break;
 case inSysWindow:
 SystemClick (&event,whichWindow);
 break;
 case inDrag:
 if ( whichWindow == TheWindow )
 DragWindow ( TheWindow,
 event.where, &DragRect );
 break;
 case inContent:
 if ( whichWindow == TheWindow ) {
 if (TheWindow != FrontWindow())
 SelectWindow ( TheWindow );
 else DoMouseDown ( event.where,
 event.modifiers );
 }
 break;
 }
 break;
 case autoKey:
 case keyDown:
 key = (char) (event.message & charCodeMask);
 if ( event.modifiers & cmdKey ) 
 DoMenu ( MenuKey ( key ) );
 else if ( key == RETURNKEY || key == ENTERKEY ) 
 SendMessage ( false );
 else {
 ForeColor ( greenColor );
 TEKey ( key, MyMessage );
 if ((*MyMessage)->teLength > MAXMSG){
 TESetSelect ( (long) MAXMSG,
 MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }
 ForeColor ( blackColor );
 }
 break;
 case nullEvent:
 if ( MySocketID == 0 ) StartAT ( );
 else {
 ShowStatus ( WAITING );
 if ( (*InABRecord)->abResult <= 0 ) 
 ReadMessage ( );
 TEIdle ( MyMessage );
 }
 break;
 }
 }

 ByeBye ( );
 }

/*===== initialize the Mac and my globals */
Initialize ()
 {
 EventRecordevent;
 Handle h;
 
 /*** init the mac rom stuff */
 InitGraf ( &thePort );
 InitFonts ();
 InitWindows ();
 InitMenus ();
 TEInit ();
 InitDialogs ( 0L );
 InitCursor ();
 FlushEvents ( everyEvent, 0 );
 
 /*** set up a few globals ... */
 EchoFlag = BeepFlag = SelectFlag = true;
 DoneFlag = false;
 MyNameBuf = 0L;
 InABRecord = (DDPProto **) 
 NewHandle ( sizeof ( DDPProto ) );
 MoveHHi ( InABRecord );
 HLock ( InABRecord );
 DragRect = screenBits.bounds;
 MySocketID = 0;
 NumOtherUsers = 0;
 
 /*** read in the menus */
 AppleMenu = GetMenu ( 1000 );
 InsertMenu ( AppleMenu, 0 );
 AddResMenu ( AppleMenu, ‘DRVR’ );
 FileMenu = GetMenu ( 1001 );
 InsertMenu ( FileMenu, 0 );
 EditMenu = GetMenu ( 1002 );
 InsertMenu ( EditMenu, 0 );
 OptionMenu = GetMenu ( 1003 );
 InsertMenu ( OptionMenu, 0 );
 DrawMenuBar ();

 /*** make sure appletalk is available */
 if ( (TheError = MPPOpen ()) != noErr ) 
 ErrorAlert (“\PCan’t start AppleTalk, error:”, TheError);

 /*** get user’s name */
 h = (Handle) GetString ( -16096 );
 if ( h != NULL ) 
 BlockMove ( *h, MyName, ((long) **h) + 1L );
 else MyName[0] = 0;
 ReleaseResource ( h );
 NameDlog ( );
 
 /*** open our window & init */
 InitTheWindow ( );
 }

/*===== process menu picks */
DoMenu ( mResult )
 long mResult;
 {
 int    theMenu, theItem, i;
 Str255 daname;
 DialogPtraboutdlog;
 GrafPtrcurport;
 TEHandle te;
 
 theItem = LoWord ( mResult );
 theMenu = HiWord ( mResult );
 switch ( theMenu ) {
 case 1000:
 if ( theItem == 1 ) {
 aboutdlog = GetNewDialog ( 2000, NULL, -1L );
 i = 0;
 while ( !i ) ModalDialog ( NULL, &i );
 DisposDialog ( aboutdlog );
 }
 else {
 GetItem ( AppleMenu, theItem, daname );
 GetPort ( &curport );
 OpenDeskAcc ( daname );
 SetPort ( curport );
 }
 break;
 case 1001:
 if ( theItem == 1 ) DoneFlag = true;
 break;
 case 1002:
 ForeColor ( greenColor );
 switch ( theItem ) {
 case 3:
 TECut ( MyMessage );
 break;
 case 4:
 TECopy ( MyMessage );
 break;
 case 5:
 TEPaste ( MyMessage );
 if ((*MyMessage)->teLength > MAXMSG){
 TESetSelect ( (long) MAXMSG, 
 MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }
 break;
 }
 ForeColor ( blackColor );
 break;
 case 1003:
 switch ( theItem ) {
 case 1:
 if ( BeepFlag ) { 
 BeepFlag = false; 
 CheckItem (OptionMenu, 1, false );
 }
 else {
 BeepFlag = true;
 CheckItem (OptionMenu, 1, true );
 }
 break;
 case 2:
 if ( EchoFlag ) {
 EchoFlag = false;
 CheckItem (OptionMenu, 2, false );
 }
 else {
 EchoFlag = true;
 CheckItem (OptionMenu, 2, true );
 }
 break;
 case 3:
 if ( SelectFlag ) {
 SelectFlag = false;
 CheckItem (OptionMenu, 3, false );
 }
 else {
 SelectFlag = true;
 CheckItem (OptionMenu, 3, true );
 }
 break;
 }
 break;
 }

 HiliteMenu(0);
 }

/*===== get the name the user wants to go by */
NameDlog ( )
 {
 DialogPtrdlog;
 int    itype, item;
 Handle h, namefield;
 Rect   r;
 Str255 astr;

 /*** do the dialog */
 dlog = GetNewDialog ( 1000, 0L, -1L );
 GetDItem ( dlog, 4, &itype, &namefield, &r );
 SetIText ( namefield, MyName );
 SelIText ( dlog, 4, 0, 255 );
 item = 0;
 while ( item != 1 ) ModalDialog ( 0L, &item );

 /*** save off the name, 32 chars max */
   GetIText ( namefield, &MyName );
 if ( ((int) *MyName) > 31 ) *MyName =(char) 31;
 
 CloseDialog ( dlog );
 }

/*===== initialize AppleTalk stuff */
StartAT ( )
 {
 /*** open a socket, use defalut listener */
 if ( 
 (TheError = DDPOpenSocket (&MySocketID,NULL)) != noErr ) 
 ErrorAlert (  “\PDDPOpenSocket ( ) returned:”, TheError );
 
 RegisterName ( );
 CheckForUsers ( );
 SendGreeting ( );
 
 /*** listen for messages */
 AskForMessage ( );
 }

/*=== Register MyName as a “Chatterbox”  via AppleTalk NBP */
RegisterName ( )
 {
 int    len;
 NBPProto **myABRecNBP;
 
 /*** show some feedback */
 ShowStatus ( REGISTER );

 /*** make up a handle for registering */
 myABRecNBP = (NBPProto **) 
 NewHandle ( sizeof ( NBPProto ) );
 HLock ( myABRecNBP );

 /*** set up our entity name */
 BlockMove ( MyName, MyEntityName.objStr, 
 ((long) *MyName) + 1L );
 BlockMove ( “\PChatterbox”,
 MyEntityName.typeStr, 11L );
 BlockMove ( “\P*”, MyEntityName.zoneStr, 2L );
 
 /*** set up a buffer for NBP’s internal use */
 len = ((int) *MyName) + 26;
 MyNameBuf = NewPtr ( (long) len );
 
 /*** fill in the record & register */
 (*myABRecNBP)->abOpcode = tNBPRegister;
 (*myABRecNBP)->abUserReference = 0L;
 (*myABRecNBP)->nbpEntityPtr = &MyEntityName;
 (*myABRecNBP)->nbpBufPtr = MyNameBuf;
 (*myABRecNBP)->nbpBufSize = len;
 (*myABRecNBP)->nbpAddress.aSocket = (Byte)
 MySocketID;
 (*myABRecNBP)->nbpRetransmitInfo.
 retransInterval = 8;
 (*myABRecNBP)->nbpRetransmitInfo.retransCount = 2;
 if ( (TheError = NBPRegister(myABRecNBP, false)) != noErr ) 
 ErrorAlert ( “\PNBPRegister ( )  returned:”, TheError );
 
 HUnlock ( myABRecNBP );
 DisposHandle ( myABRecNBP );
 }

/*===== remove the name from NBP */
UnRegisterName ( )
 {
 if ( (TheError = NBPRemove(&MyEntityName )) != noErr ) 
 ErrorAlert ( “\PNBPRemove ( )  returned:”, TheError );
 DisposPtr ( MyNameBuf );
 }

/*===== check for other users on the net. */
CheckForUsers ( )
 {
 int    j, r, i, numFound, found, removed;
 Point  c;
 EntityName otherEntity;
 NBPProto **otherABRecNBP;
 AddrBlockaddblock;
 
 /*** show some feedback */
 ShowStatus ( SCANNING );

 /*** mark them all as “not found” */
 for ( i = 0; i < NumOtherUsers; ++i ) 
 OtherUsers[i].found = false;

 /*** now scan for other users */
 BlockMove ( “\P=”, otherEntity.objStr, 2L );
 BlockMove ( “\PChatterbox”, otherEntity.typeStr, 11L );
 BlockMove ( “\P*”, otherEntity.zoneStr, 2L );
 otherABRecNBP = (NBPProto **) 
 NewHandle ( sizeof ( NBPProto ) );
 HLock ( otherABRecNBP );
 (*otherABRecNBP)->abOpcode = tNBPLookup;
 (*otherABRecNBP)->abUserReference = 0L;
 (*otherABRecNBP)->nbpEntityPtr = &otherEntity;
 (*otherABRecNBP)->nbpBufPtr = NewPtr ( 4096 );
 (*otherABRecNBP)->nbpBufSize = 4096;
 (*otherABRecNBP)->nbpDataField = 40;
 (*otherABRecNBP)->nbpRetransmitInfo.
 retransInterval = 8;
 (*otherABRecNBP)->nbpRetransmitInfo.
 retransCount = 1;
 if ((TheError = NBPLookup(otherABRecNBP, false)) != noErr) 
 ErrorAlert ( “\PNBPLookup ( )  returned:”, TheError );
 
 /*** if we found any, check for them in the
 list, else empty the list */
 numFound = (*otherABRecNBP)->nbpDataField;
 if ( numFound <= 0 ) {
 j = (*UserList)->dataBounds.bottom;
 if ( j > 0 ) LDelRow ( j, 0, UserList );
 NumOtherUsers = 0;
 }
 else {
 for ( i = 0; i < numFound; ++i ) {
 
 /*** extract it */
 if ( (TheError = NBPExtract (
 (*otherABRecNBP)->nbpBufPtr, 
 numFound, i+1, &otherEntity,
 &addblock )) == noErr ) {
 
 /*** see if it’s in the list */
 found = false;
 for ( j = 0; j < NumOtherUsers; ++j ) {
 if ( OtherUsers[j].addr.aSocket ==
 addblock.aSocket &&
 OtherUsers[j].addr.aNode ==
 addblock.aNode &&
 OtherUsers[j].addr.aNet ==
 addblock.aNet ) { 
 found = true;
 break;
 }
 }

 /*** if it is, mark it */
 if ( found ) OtherUsers[j].found=true;
 
 /***else add it, select it if auto-select is on */
 else {
 c.h = 0;
 c.v = NumOtherUsers;
 OtherUsers[NumOtherUsers].addr =
 addblock;
 OtherUsers[NumOtherUsers].found =
 true;
 LAddRow ( 1,NumOtherUsers,UserList );
 LSetCell ( &otherEntity.objStr[1],
 (int) otherEntity.objStr[0], c, UserList );
 if ( SelectFlag ) 
 LSetSelect ( true, c, UserList );
 ++NumOtherUsers;
 }
 
 /*** don’t overflow */
 if ( NumOtherUsers >= MAXUSERS ) break;
 }
 }

 /**delete any that were not found (they’ve logged off) */
 for ( j = NumOtherUsers-1; j >= 0; --j ) {
 if ( !OtherUsers[j].found ) {
 --NumOtherUsers;
 BlockMove ( &OtherUsers[j+1],
 &OtherUsers[j],
 (long) ((NumOtherUsers-j)
 *sizeof(UserRecord)) );
 LDelRow ( 1, j, UserList );
 }
 }
 }

 DisposPtr ( (*otherABRecNBP)->nbpBufPtr );
 HUnlock ( otherABRecNBP );
 DisposHandle ( otherABRecNBP );
 }

/*===== tell DDP we’re waiting for a msg */
AskForMessage ( )
 {
 (*InABRecord)->abOpcode = tDDPRead;
 (*InABRecord)->abResult = 0;
 (*InABRecord)->abUserReference = 0L;
 (*InABRecord)->ddpType = 5;
 (*InABRecord)->ddpSocket = MySocketID;
 (*InABRecord)->ddpReqCount = BUFSIZE;
 (*InABRecord)->ddpDataPtr = RecBuffer;
 if ( (TheError = DDPRead ( InABRecord, true,
 true)) != noErr )
 ErrorAlert ( “\PDDPRead ( )  returned:”, TheError );
 }

/*===== read a message from the socket */
ReadMessage ( )
 {
 Rect   r;
 Cell   c;
 Str255 othername;
 int    i, namelen, nlines, fromnode;
 
 /*** make sure there’s really a message */
 if ( (*InABRecord)->ddpActCount > 0 ) {
 
 /*** show some feedback */
 ShowStatus ( RECEIVING );
 
 /*** check for users if it’s a special
 message (ie, has option-space) */
 if ( RecBuffer[0] == ‘ ’ ) CheckForUsers ();

 /*** see who it’s from */
 namelen = 0;
 fromnode = (*InABRecord)->ddpAddress.aNode;
 for ( i = 0; i < NumOtherUsers; ++i ) 
 if ( fromnode == 
 OtherUsers[i].addr.aNode ) break;
 if ( i < NumOtherUsers ) {
 c.h = 0;
 c.v = i;
 namelen = 32;
 LGetCell ( othername, &namelen, c, UserList );
 }

 /*** put the message in the display */
 ForeColor ( blueColor );
 TESetSelect ( MAXTEXT, MAXTEXT, InMessages );
 TEInsert ( RecBuffer, (long) (*InABRecord)->ddpActCount,
 InMessages );
 TEInsert ( “ (“, 2L, InMessages );
 TEInsert ( othername, (long) namelen, InMessages );
 TEInsert ( “)\015”, 2L, InMessages );
 nlines = (*InMessages)->nLines;
 for ( i = DISPLINES; i < nlines; ++i )
 DeleteFirstLine ( InMessages );
 ForeColor ( blackColor );
 
 if ( BeepFlag ) SysBeep ( 1 );
 }
 else ErrorAlert ( “\PError in recieved packet.”, 0 );
 
 AskForMessage ( );
 }

/*===== send the message out.  If toAll is true,
 send to all, else send to selected. */
SendMessage ( toAll )
 int    toAll;
 {
 DDPProto **outABRecord;
 Handle thetext;
 int    i, nlines, textlen, msgSent;
 Cell   c;
 char   xmitBuffer[BUFSIZE];
 
 /*** only if there is something to say */
 if ( (*MyMessage)->teLength <= 0 ) return;
 
 /*** get a record */
 outABRecord = (DDPProto **) 
 NewHandle ( sizeof ( DDPProto ) );
 HLock ( outABRecord );

 /*** copy the text to the out buffer, empty 
 TextEdit record */
 thetext = (Handle) TEGetText ( MyMessage );
 HLock ( thetext );
 textlen = (*MyMessage)->teLength;
 BlockMove ( *thetext, xmitBuffer, textlen );
 HUnlock ( thetext );
 
 /*** send the message to appropriate users */
 for(msgSent=false,i=0; i<NumOtherUsers; ++i) {
 c.h = 0;
 c.v = i;
 if ( toAll ||
 LGetSelect ( false, &c, UserList ) ) {
 ShowStatus ( SENDING );
 (*outABRecord)->abOpcode = tDDPWrite;
 (*outABRecord)->abUserReference = 0L;
 (*outABRecord)->ddpType = 5;
 (*outABRecord)->ddpSocket = MySocketID;
 (*outABRecord)->ddpAddress = 
 OtherUsers[i].addr;
 (*outABRecord)->ddpDataPtr = xmitBuffer;
 (*outABRecord)->ddpReqCount = textlen;
 if ( (TheError = DDPWrite ( outABRecord, 
 false, false )) != noErr )
 ErrorAlert ( “\PDDPWrite ( )  returned:”, TheError );
 msgSent = true;
 }
 }

 if ( msgSent ) {
 TESetSelect ( 0L, MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 TESetSelect ( 0L, 0L, MyMessage );
 
 if ( EchoFlag ) {
 ForeColor ( blueColor );
 TESetSelect (MAXTEXT,MAXTEXT,InMessages);
 TEInsert ( “«”, 1L, InMessages );
 TEInsert ( xmitBuffer, (long) textlen, InMessages );
 TEInsert ( “»\015”, 2L, InMessages );
 nlines = (*InMessages)->nLines;
 for ( i = DISPLINES; i < nlines; ++i ) 
 DeleteFirstLine ( InMessages );
 ForeColor ( blackColor );
 }
 }

 HUnlock ( outABRecord );
 DisposHandle ( outABRecord );
 }

/*===== say hello to existing users */
SendGreeting ( ) 
 {
 Str255 greeting;
 
 /*** send log-on messge (has option-space) */
 greeting[0] = ‘\0’;
 Pstrcat ( greeting, “\P  Hello Everyone!” );
 TESetSelect ( 0L, 0L, MyMessage );
 TEInsert ( &greeting[1], (long) greeting[0], MyMessage );
 SendMessage ( true );
 TESetSelect ( 0L, MAXTEXT, MyMessage );
 TEDelete ( MyMessage );
 }

/*===== pick up our toys and go home */
ByeBye ( ) 
 {
 Str255 adios;
 
 /*** send logoff message (has option-space) */
 adios[0] = ‘\0’;
 Pstrcat ( adios, “\P  ” );
 Pstrcat ( adios, MyName );
 Pstrcat ( adios, “\P is off!” );
 TESetSelect ( 0L, 0L, MyMessage );
 TEInsert ( &adios[1], (long) adios[0], MyMessage );
 SendMessage ( true );

 /*** close everything */
 UnRegisterName ( );
 DDPCloseSocket ( (Byte) MySocketID );
 CloseWindow ( TheWindow );
 }

/*===== delete the first line from the given TEhandle */
DeleteFirstLine ( te )
 TEHandle te;
 {
 Handle h;
 int    charsinline = 0;
 char   *cp;
 
 h = TEGetText ( te );
 HLock ( h );
 cp = *h;
 while ( *cp != ‘\015’ ) { 
 ++cp; 
 ++charsinline;
 }
 ++charsinline;
 TESetSelect ( 0L, (long) charsinline, te );
 TEDelete ( te );
 }

/*===== open and initialize the window */
InitTheWindow ( )
 {
 Rect   r, dbr, view, dest;
 Point  csize;
 char   title[80];
 
 TheWindow = GetNewWindow ( 1000, 0L, -1L );
 title[0] = ‘\0’;
 Pstrcat ( title, “\PChatterbox - “ );
 Pstrcat ( title, MyName );
 SetWTitle ( TheWindow, title );
 SetPort ( TheWindow );
 TextFont ( 4 );
 TextSize ( 9 );
 TextFace ( 0 );

 /*** add in the controls */
 ScanButton = GetNewControl ( 1000, TheWindow );
 SelectAllButton = 
 GetNewControl ( 2000, TheWindow );
 
 /*** add in the user list */
 SetRect ( &r, 20, 22, 164, 94 );
 SetRect ( &dbr, 0, 0, 1, 0 );
 csize.v = 12;
 csize.h = 300;
 UserList = LNew ( &r, &dbr, csize, 0, 
 TheWindow, true, false, false, true );
 
 /*** add in the outgoing message field */
 SetRect ( &view, 21, 114, 339, 128 );
 SetRect ( &dest, 22, 115, 338, 270 );
 MyMessage = TENew ( &dest, &view );
 TESetSelect ( 0L, 0L, MyMessage );
 
 /*** set up the incomming message area */
 SetRect ( &view, 21, 148, 339, 238 );
 SetRect ( &dest, 22, 149, 338, 270 );
 InMessages = TENew ( &dest, &view );
 TESetSelect ( 0L, 0L, InMessages );

 /*** set up the status area */
 SetRect ( &StatusR, 196, 21, 340, 65 );
 }

/*===== handle update events for our main (and only) window */
 DoUpdate ( )
 {
 Rect   r;
 RgnHandlevis;
 
 /*** do the controls */
 SetPort ( TheWindow );
 DrawControls ( TheWindow );
 
 /*** show the user list */
 r = (*UserList)->rView;
 InsetRect ( &r, -1, -1 );
 FrameRect ( &r );
 MoveTo ( r.left, r.top-4 );
 DrawString ( “\PSelect Recipients:” );
 vis = TheWindow->visRgn;
 HandToHand ( &vis );
 LUpdate ( vis, UserList );
 DisposHandle ( vis );
 
 /*** show the MyMessage field */
 r = (*MyMessage)->viewRect;
 MoveTo ( r.left-1, r.top-6 );
 DrawString ( “\PType a message, <return> to send:” );
 EraseRect ( &r );
 InsetRect ( &r, -2, -2 );
 FrameRect ( &r );
 ForeColor ( greenColor );
 TEUpdate ( &r, MyMessage );
 ForeColor ( blackColor );

 /*** show the incomming message field */
 r = (*InMessages)->viewRect;
 MoveTo ( r.left-1, r.top-6 );
 DrawString ( “\PReceived Messages:” );
 EraseRect ( &r );
 InsetRect ( &r, -2, -2 );
 FrameRect ( &r );
 ForeColor ( blueColor );
 TEUpdate ( &r, InMessages );
 ForeColor ( blackColor );
 
 /*** show the status area */
 MoveTo ( StatusR.left, StatusR.top-4 );
 DrawString ( “\PStatus:” );
 FrameRect ( &StatusR );
 ShowStatus ( NONE );
 }

/*===== display the status notice */
ShowStatus ( status )
 int    status;
 {
 Rect   r;
 char   *cp;
 static int oldstatus;  
 
 if ( status != oldstatus ) {
 InsetRect ( &StatusR, 2, 2 );
 EraseRect ( &StatusR );
 ForeColor ( redColor );
 cp = NULL;
 switch ( status ) {
 case NONE:
 break;
 case REGISTER:
 cp = “\PRegistering on the network.”;
 break;
 case WAITING:
 cp = “\PListening ”;
 break;
 case SCANNING:
 cp = “\PScanning for other users.”;
 break; 
 case SENDING:
 cp = “\PSending message.”;
 break; 
 case RECEIVING:
 cp = “\PReceiving message.”;
 break; 
 }
 if ( cp != NULL ) 
 TextBox ( (cp + 1), (long) *cp, &StatusR, teJustLeft );
 ForeColor ( blackColor );
 InsetRect ( &StatusR, -2, -2 );
 oldstatus = status;
 }
 }

/*===== handle mouse-downs in our window */
DoMouseDown ( thePt, mods )
 Point  thePt;
 int    mods;
 {
 Rect   r;
 Point  localPt, c;
 ControlHandle   chan;
 
 /*** get the local point */
 localPt = thePt;
 GlobalToLocal ( &localPt );
 
 /*** in UserList or it’s scroll bars? */
 r = (*UserList)->rView;
 r.right += 16;
 if ( PtInRect ( localPt, &r ) && 
 ( NumOtherUsers > 0 ) ) {
 LClick ( localPt, mods, UserList );
 return;
 }

 /*** in MyMessage ? */
 r = (*MyMessage)->viewRect;
 if ( PtInRect ( localPt, &r ) ) {
 TEClick ( localPt, 
 ((mods & shiftKey) == shiftKey),
 MyMessage );
 return;
 }
 
 /*** in the controls */
 if (FindControl(localPt, TheWindow, &chan)) {
 if ( TrackControl ( chan, localPt, NULL ) ) {
 if ( chan == ScanButton ) CheckForUsers();
 if ( chan == SelectAllButton ) {
 for ( c.h = 0, c.v = (*UserList)->dataBounds.top;
 c.v < (*UserList)->dataBounds.bottom; ++c.v )
 LSetSelect ( true, c, UserList );
 }
 }
 }
 }

/*===== catenate the second pascal string to the first */
Pstrcat ( str1, str2 )
 char *str1, *str2;
 {
 char *str1len, *str1end;
 
 str1len = str1;
 str1end = str1 + (int) *str1len + 1;
 BlockMove ((str2 + 1), str1end, (long) *str2);
 *str1len += (int) *str2;
 }

/*=== alert the user to an error, optionally exit to shell */
ErrorAlert ( where, errorNum )
 char *where;
 int  errorNum;
 {
 Str255 idstr;

 /*** give the alert */
 NumToString ( (long) errorNum, idstr );
 ParamText ( where, idstr, “\P”, “\P” );
 if ( Alert ( 666, 0L ) == 1 ) {
 UnRegisterName ( );
 DDPCloseSocket ( (Byte) MySocketID );
 ExitToShell ();
 }
 }
Listing:  Chatter.r

resource ‘BNDL’ (128) {
 ‘chat’,
 0,
 { /* array TypeArray: 2 elements */
 /* [1] */
 ‘ICN#’,
 { /* array IDArray: 2 elements */
 /* [1] */
 0, 128,
 /* [2] */
 1, 129
 },
 /* [2] */
 ‘FREF’,
 { /* array IDArray: 2 elements */
 /* [1] */
 0, 128,
 /* [2] */
 1, 129
 }
 }
};

data ‘chat’ (0) {
$”15 43 68 61 74 74 65 72 62 6F 78 20 31 2E 30 20" 
$”62 79 20 52 6F 62 0D”};

resource ‘ICN#’ (128) {
 { /* array: 2 elements */
 /* [1] */
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 9D C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8",
/* [2] */
$”1F FF FF F8 3F FF FF FC 7F FF FF FE FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF 7F FF FF FE 3F FF FF FC 1F FF FF F8"
 }
};

resource ‘WIND’ (1000, “Chatterbox”) {
 {46, 16, 300, 376},
 documentProc,
 visible,
 noGoAway,
 0x0,
 “Chatterbox”
};

resource ‘MENU’ (1000, “Apple”) {
 1000,
 textMenuProc,
 0x7FFFFFFD,
 enabled,
 apple,
 { /* array: 2 elements */
 /* [1] */
“About Chatterbox ”, noIcon, noKey, noMark, plain,
 /* [2] */
“-”, noIcon, noKey, noMark, plain
 }
};

resource ‘MENU’ (1001, “File”) {
 1001,
 textMenuProc,
 allEnabled,
 enabled,
 “File”,
 { /* array: 1 elements */
 /* [1] */
 “Quit”, noIcon, “Q”, noMark, plain
 }
};

resource ‘MENU’ (1002, “Edit”) {
 1002,
 textMenuProc,
 0x7FFFFFFC,
 enabled,
 “Edit”,
 { /* array: 5 elements */
 /* [1] */
 “Undo”, noIcon, “Z”, noMark, plain,
 /* [2] */
 “-”, noIcon, noKey, noMark, plain,
 /* [3] */
 “Cut”, noIcon, “X”, noMark, plain,
 /* [4] */
 “Copy”, noIcon, “C”, noMark, plain,
 /* [5] */
 “Paste”, noIcon, “V”, noMark, plain
 }
};

resource ‘MENU’ (1003, “Options”) {
 1003,
 textMenuProc,
 allEnabled,
 enabled,
 “Options”,
 { /* array: 3 elements */
 /* [1] */
“Beep On Receipt”, noIcon, noKey, check, plain,
 /* [2] */
“Echo My Transmissions”,noIcon,noKey,check,plain,
 /* [3] */
“Auto-select New Users”,noIcon,noKey,check,plain
 }
};

resource ‘ALRT’ (666, “Error Alert”) {
 {162, 90, 330, 398},
 666,
 { /* array: 4 elements */
 /* [1] */
 OK, visible, sound1,
 /* [2] */
 OK, visible, sound1,
 /* [3] */
 OK, visible, sound1,
 /* [4] */
 OK, visible, sound1
 }
};

resource ‘cicn’ (1000) {
 16,
 {0, 0, 32, 32},
 0,
 unpacked,
 0,
 0x480000,
 0x480000,
 chunky,
 4,
 1,
 4,
 0,
 0,
 4,
 {0, 0, 32, 32},
 4,
 {0, 0, 32, 32},
$”1F FF FF F8 3F FF FF FC 7F FF FF FE FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF”
$”FF FF FF FF 7F FF FF FE 3F FF FF FC 1F FF FF 8F”,
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 DD C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8"
,0x0, 0,
 { /* array ColorSpec: 5 elements */
 /* [1] */
 0, 65535, 65535, 65535,
 /* [2] */
 1, 0, 0, 0,
 /* [3] */
 2, 8856, 65535, 6900,
 /* [4] */
 3, 7652, 8260, 65535,
 /* [5] */
 4, 65535, 9758, 8505
 },
$”00 01 11 11 11 11 11 11 11 11 11 11 11 11 10 00"
$”00 10 00 01 33 33 33 33 33 33 33 33 33 33 31 00"
$”01 00 00 01 33 33 33 33 33 33 33 33 33 33 33 10"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 00 00 00 33 33 33 31"
$”10 00 10 01 33 33 33 33 00 00 00 00 00 33 33 31"
$”10 01 10 01 33 33 33 30 00 00 00 00 00 03 33 31"
$”10 00 10 01 33 33 33 00 00 00 00 00 00 00 33 31"
$”10 00 00 01 33 33 30 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 30 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 13 33 00 04 44 04 44 04 44 00 00 31"
$”10 00 00 00 13 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 04 44 40 44 04 04 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 01 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 00 13 33 00 04 44 04 04 44 00 00 00 31”
$”10 00 01 11 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 00 31"
$”10 00 00 01 33 33 00 04 44 40 44 40 44 00 00 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 03 31"
$”10 00 00 01 33 33 00 00 00 00 00 00 00 00 33 31"
$”10 00 01 13 33 30 00 00 00 00 00 00 00 03 33 31"
$”10 00 13 33 30 00 00 00 00 00 00 00 03 33 33 31"
$”10 00 01 13 33 33 33 33 33 33 33 33 33 33 33 31"
$”10 00 00 01 33 33 33 33 33 33 33 33 33 33 33 31"
$”01 00 00 01 33 33 33 33 33 33 33 33 33 33 33 10"
$”00 10 00 01 33 33 33 33 33 33 33 33 33 33 31 00"
$”00 01 11 11 11 11 11 11 11 11 11 11 11 11 10 00"
};

resource ‘DITL’ (1000) {
 { /* array DITLarray: 4 elements */
 /* [1] */
 {80, 52, 100, 112},
 Button {
 enabled,
 “OK”
 },
 /* [2] */
 {8, 8, 40, 40},
 Icon {
 disabled,
 1000
 },
 /* [3] */
 {16, 52, 36, 288},
 StaticText {
 enabled,
 “Enter the name you want to go by:”
 },
 /* [4] */
 {48, 56, 64, 256},
 EditText {
 enabled,
 “”
 }
 }
};

resource ‘DITL’ (666) {
 { /* array DITLarray: 6 elements */
 /* [1] */
 {128, 16, 152, 128},
 Button {
 enabled,
 “Exit To Shell”
 },
 /* [2] */
 {128, 168, 152, 296},
 Button {
 enabled,
 “OK, Keep Going”
 },
 /* [3] */
 {8, 8, 40, 40},
 Icon {
 disabled,
 1000
 },
 /* [4] */
 {16, 48, 40, 296},
 StaticText {
 disabled,
 “Oops!  Something bad has happened:”
 },
 /* [5] */
 {48, 48, 80, 296},
 StaticText {
 disabled,
 “^0”
 },
 /* [6] */
 {88, 48, 112, 296},
 StaticText {
 disabled,
 “^1”
 }
 }
};

resource ‘DITL’ (2000) {
 { /* array DITLarray: 1 elements */
 /* [1] */
 {2, 8, 98, 313},
 Picture {
 enabled,
 2000
 }
 }
};

resource ‘ICON’ (1000, purgeable) {
$”1F FF FF F8 21 FF FF FC 41 FF FF FE 81 FF FF FF”
$”81 FF FF FF 81 FF C0 FF 89 FF 00 3F 99 FE 00 1F”
$”89 FC 00 0F 81 F8 00 07 81 F8 00 07 81 F0 00 03"
$”80 F1 DD C3 80 F0 00 03 80 70 00 03 80 71 DD 43"
$”80 70 00 03 80 70 00 03 80 F1 D7 03 87 F0 00 03"
$”81 F0 00 03 81 F1 EE C3 81 F0 00 07 81 F0 00 07"
$”81 F0 00 0F 87 E0 00 1F 8F 80 00 7F 87 FF FF FF”
$”81 FF FF FF 41 FF FF FE 21 FF FF FC 1F FF FF F8"
};

resource ‘DLOG’ (1000, “Get Name”) {
 {66, 40, 178, 360},
 altDBoxProc,
 visible,
 goAway,
 0x0,
 1000,
 “What’s your name?”
};

resource ‘DLOG’ (2000, “About...”) {
 {40, 40, 140, 360},
 dBoxProc,
 visible,
 goAway,
 0x0,
 2000,
 “New Dialog”
};

resource ‘FREF’ (128) {
 ‘APPL’,
 0,
 “”
};

resource ‘CNTL’ (1000, “Scan”) {
 {75, 274, 95, 340},
 0,
 visible,
 1,
 0,
 pushButProc,
 0,
 “Scan”
};

resource ‘CNTL’ (2000, “Select All”) {
 {75, 196, 95, 264},
 0,
 visible,
 1,
 0,
 pushButProc,
 0,
 “Select All”
};

resource ‘vers’ (2) {
 0x1,
 0x0,
 0x0,
 0x0,
 verUs,
 “1.0”,
 “  by Rob Hafernik”
};

resource ‘vers’ (1) {
 0x1,
 0x0,
 0x0,
 0x0,
 verUs,
 “1.0”,
 “1.0”
};

resource ‘PICT’ (2000) {
 {191, 81, 287, 386},
 VersionOne {
 { /* array OpCodes: 4 elements */
 /* [1] */
 shortComment {
 130
 },
 /* [2] */
 clipRgn {
 {0, 0, 720, 576},
 $””
 },
 /* [3] */
 packBitsRect {
 40,
 {191, 80, 287, 392},
 {191, 81, 287, 386},
 {191, 81, 287, 386},
 srcCopy,
$”02 D9 00 02 D9 00 02 D9 00 08 00 01 F1 FF 00 80"
$”EB 00 09 01 02 1F F2 FF 00 C0 EB 00 09 01 04 1F”
$”F2 FF 00 E0 EB 00 09 01 08 1F F2 FF 00 F0 EB 00"
$”09 01 08 1F F2 FF 00 F0 EB 00 0B 02 08 1F FC F4"
$”00 01 0F F0 EB 00 0B 02 08 9F F0 F4 00 01 03 F0"
$”EB 00 0B 02 09 9F E0 F4 00 01 01 F0 EB 00 0A 02"
$”08 9F C0 F3 00 00 F0 EB 00 0A 02 08 1F 80 F3 00"
$”00 70 EB 00 0A 02 08 1F 80 F3 00 00 70 EB 00 26"
$”08 08 1F 00 7F C6 00 00 0C 0C FE 00 00 C0 FD 00"
$”0E 30 1F F8 00 00 1F F8 00 18 00 03 01 80 00 78"
$”FD 00 00 C6 FE 00 26 08 08 0F 00 C0 66 00 00 0C”
$”0C FE 00 00 C0 FD 00 0E 30 18 0C 00 00 18 0C 00"
$”18 00 03 01 80 00 C0 FD 00 00 06 FE 00 29 25 08"
$”0F 00 C0 07 F8 7F 1F 9F 8F E3 FE FF 0F E3 06 00"
$”30 18 0C C1 80 18 0C 7F 1F E0 03 01 8F E3 F8 FE”
$”3F EF F1 C6 18 FF 00 29 25 08 07 00 C0 06 0C C1"
$”8C 0C 18 33 80 C1 98 31 8C 00 30 18 0C C1 80 18"
$”0C C1 98 30 03 01 98 30 C1 83 38 0E 18 C6 30 FF”
$”00 29 25 08 07 00 C0 06 0C 01 8C 0C 18 33 00 C1"
$”98 30 D8 00 30 1F F8 C1 80 1F F8 C1 98 30 03 FF”
$”80 30 C1 83 30 0C 18 C6 60 FF 00 29 25 08 07 00"
$”C0 06 0C 7F 8C 0C 1F F3 00 C1 98 30 70 00 30 18"
$”0C C1 80 18 C0 C1 98 30 03 01 8F F0 C1 FF 30 0C”
$”18 C7 C0 FF 00 29 25 08 07 00 C0 06 0C C1 8C 0C”
$”18 03 00 C1 98 30 70 00 30 18 0C C1 80 18 60 C1"
$”98 30 03 01 98 30 C1 80 30 0C 18 C6 60 FF 00 29"
$”25 08 0F 00 C0 06 0C C1 8C 0C 18 03 00 C1 98 30"
$”D8 00 30 18 0C C1 80 18 30 C1 98 30 03 01 98 30"
$”C1 80 30 0C 18 C6 30 FF 00 29 25 08 7F 00 C0 66"
$”0C C1 8C 0C 18 33 00 C1 98 31 8C 00 30 18 0C C1"
$”80 18 18 C1 98 30 03 01 98 30 C1 83 30 0C 18 C6"
$”18 FF 00 29 25 08 1F 00 7F C6 0C 7F 87 87 8F E3"
$”00 FF 0F E3 06 00 30 1F F8 7F 80 18 0C 7F 1F E0"
$”03 01 8F F0 C0 FE 30 0C 18 C6 0C FF 00 0D 01 08"
$”1F F2 00 04 30 00 00 01 80 EF 00 0D 01 08 1F F2"
$”00 04 70 00 00 C1 80 EF 00 0C 01 08 1F F2 00 03"
$”70 00 00 7F EE 00 09 01 08 1F F2 00 00 F0 EB 00"
$”0A 01 08 7E F3 00 01 01 F0 EB 00 0A 01 08 F8 F3"
$”00 01 07 F0 EB 00 09 01 08 7F F2 FF 00 F0 EB 00"
$”09 01 08 1F F2 FF 00 F0 EB 00 09 01 04 1F F2 FF”
$”00 E0 EB 00 09 01 02 1F F2 FF 00 C0 EB 00 08 00"
$”01 F1 FF 00 80 EB 00 02 D9 00 02 D9 00 02 D9 00"
$”02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02"
$”D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9"
$”00 0D 09 04 04 88 80 02 00 03 00 00 18 E3 00 0D”
$”09 04 04 08 80 02 00 01 00 00 20 E3 00 10 0C 04"
$”05 9E FC 03 F1 F1 3F 00 FA F3 E7 B9 E6 00 10 0C”
$”04 04 88 82 02 0A 09 20 80 23 04 14 44 E6 00 10"
$”0C 04 44 88 82 02 0A 09 20 80 22 04 14 44 E6 00"
$”10 0C 04 A4 88 82 02 0B F9 20 80 22 04 14 44 E6"
$”00 10 0C 05 14 88 82 02 0A 01 20 80 22 04 14 44"
$”E6 00 10 0C 06 0C 88 82 02 0A 09 20 80 22 04 14"
$”44 E6 00 10 0C 04 04 86 82 02 09 F1 3F 00 22 03"
$”E4 45 E6 00 06 FA 00 00 20 E1 00 06 FA 00 00 20"
$”E1 00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 02 D9"
$”00 25 06 04 04 00 02 00 01 02 FE 00 0C 20 40 04"
$”40 00 00 20 20 00 10 00 0F E0 FC 00 03 01 FC 20"
$”08 FD 00 00 80 FE 00 25 06 06 0C 00 02 00 01 04"
$”FE 00 0C 20 80 04 40 00 00 30 60 00 10 00 08 10"
$”FC 00 03 01 02 00 08 FD 00 00 80 FE 00 28 24 05"
$”14 F9 7A 10 01 08 3E 5E 00 21 07 CF 7E 41 00 28"
$”A7 CB D0 80 08 0A 09 F2 F2 F1 F0 01 01 65 E8 40"
$”1F 2F 1F 80 FE 00 28 24 04 A5 05 82 20 01 10 41"
$”61 00 22 08 24 41 41 00 25 28 2C 11 00 08 0A 0A”
$”0B 0B 0A 08 01 01 26 08 80 20 B0 A0 80 FE 00 28"
$”17 04 44 05 02 40 01 F0 41 41 00 3E 00 24 41 41"
$”00 22 20 28 12 00 08 0A 08 FE 0A 09 08 01 01 24"
$”09 00 00 A0 A0 80 FE 00 28 24 04 04 FD 03 C0 01"
$”08 7F 41 00 21 07 E4 41 41 00 20 27 E8 1E 00 08"
$”0A 09 FA 0A 0B F8 01 01 24 0F 00 1F A0 A0 80 FE”
$”00 26 15 04 05 05 02 20 01 04 40 41 00 20 88 24"
$”41 41 00 20 28 28 11 00 08 FC 0A 09 00 01 01 24"
$”08 80 20 A0 A0 80 FE 00 28 17 04 05 05 02 10 01"
$”02 41 41 00 20 48 24 41 41 00 20 28 28 10 80 08"
$”12 1A FE 0A 09 08 01 02 24 08 40 20 A0 A0 80 FE”
$”00 28 24 04 04 FD 02 09 01 01 3E 41 20 20 27 E3"
$”41 3F 20 20 27 E8 10 48 0F E1 E9 FA 0A 09 F1 01"
$”FC 24 08 20 1F A0 9F 80 FE 00 17 FD 00 00 01 FD”
$”00 00 20 FD 00 01 01 20 FD 00 00 08 FB 00 00 01"
$”F5 00 17 FD 00 00 02 FD 00 00 40 FD 00 01 41 40"
$”FD 00 00 10 FB 00 00 02 F5 00 06 F3 00 00 3E E8"
$”00 02 D9 00 02 D9 00 02 D9 00 02 D9 00 1D 12 07"
$”FD 00 00 07 F8 00 00 80 00 10 1F F8 00 00 C0 00"
$”00 1C FD 00 03 30 30 00 03 F4 00 1D 12 00 41 00"
$”00 04 04 00 00 80 00 10 01 80 00 00 C0 00 00 0C”
$”FD 00 03 30 30 00 03 F4 00 20 1C 00 41 F8 F8 04"
$”04 F8 F9 E0 1F 3C 01 81 F8 FC FE 7F 1F 8C 7E 3F”
$”B0 C0 30 33 F3 FB 18 FC F6 00 20 1C 00 41 05 04"
$”04 05 05 04 80 20 90 01 83 0D 86 C3 71 B0 CC C3"
$”61 B0 C0 30 36 1B 83 31 86 F6 00 20 1C 00 41 05"
$”04 07 F9 05 00 80 00 90 01 83 0D 80 C3 61 B0 CC”
$”C3 61 B0 C0 33 36 1B 03 61 80 F6 00 20 1C 00 41"
$”05 FC 04 21 FC FC 80 1F 90 01 83 FD 80 C3 61 B0"
$”CC C3 61 B0 C0 37 B6 1B 03 E0 FE F6 00 20 1C 00"
$”41 05 00 04 11 00 04 80 20 90 01 83 01 80 C3 61"
$”B0 CC C3 61 B0 C0 3C F6 1B 03 30 06 F6 00 20 1C”
$”00 41 05 04 04 09 05 04 80 20 90 01 83 0D 86 C3"
$”61 B0 CC C3 61 B0 C0 38 76 1B 03 19 86 F6 00 20"
$”1C 00 41 04 F8 04 04 F8 F8 60 1F 8C 01 81 F8 FC”
$”C3 61 9F 8C 7E 3F 9F C0 30 33 F3 03 0C FC F6 00"
$”08 ED 00 02 01 80 C0 F0 00 08 ED 00 02 61 B0 C0"
$”F0 00 08 ED 00 02 3F 1F 80 F0 00 02 D9 00 02 D9"
$”00 02 D9 00"
 },
 /* [4] */
 shortComment {
 131
 }
 }
 }
};

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Tor Browser 12.5.5 - Anonymize Web brows...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Malwarebytes 4.21.9.5141 - Adware remova...
Malwarebytes (was AdwareMedic) helps you get your Mac experience back. Malwarebytes scans for and removes code that degrades system performance or attacks your system. Making your Mac once again your... Read more
TinkerTool 9.5 - Expanded preference set...
TinkerTool is an application that gives you access to additional preference settings Apple has built into Mac OS X. This allows to activate hidden features in the operating system and in some of the... Read more
Paragon NTFS 15.11.839 - Provides full r...
Paragon NTFS breaks down the barriers between Windows and macOS. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS. Write, edit, copy, move, delete files on... Read more
Apple Safari 17 - Apple's Web brows...
Apple Safari is Apple's web browser that comes bundled with the most recent macOS. Safari is faster and more energy efficient than other browsers, so sites are more responsive and your notebook... Read more
Firefox 118.0 - Fast, safe Web browser.
Firefox offers a fast, safe Web browsing experience. Browse quickly, securely, and effortlessly. With its industry-leading features, Firefox is the choice of Web development professionals and casual... Read more
ClamXAV 3.6.1 - Virus checker based on C...
ClamXAV is a popular virus checker for OS X. Time to take control ClamXAV keeps threats at bay and puts you firmly in charge of your Mac’s security. Scan a specific file or your entire hard drive.... Read more
SuperDuper! 3.8 - Advanced disk cloning/...
SuperDuper! is an advanced, yet easy to use disk copying program. It can, of course, make a straight copy, or "clone" - useful when you want to move all your data from one machine to another, or do a... Read more
Alfred 5.1.3 - Quick launcher for apps a...
Alfred is an award-winning productivity application for OS X. Alfred saves you time when you search for files online or on your Mac. Be more productive with hotkeys, keywords, and file actions at... Read more
Sketch 98.3 - Design app for UX/UI for i...
Sketch is an innovative and fresh look at vector drawing. Its intentionally minimalist design is based upon a drawing space of unlimited size and layers, free of palettes, panels, menus, windows, and... Read more

Latest Forum Discussions

See All

Listener Emails and the iPhone 15! – The...
In this week’s episode of The TouchArcade Show we finally get to a backlog of emails that have been hanging out in our inbox for, oh, about a month or so. We love getting emails as they always lead to interesting discussion about a variety of topics... | Read more »
TouchArcade Game of the Week: ‘Cypher 00...
This doesn’t happen too often, but occasionally there will be an Apple Arcade game that I adore so much I just have to pick it as the Game of the Week. Well, here we are, and Cypher 007 is one of those games. The big key point here is that Cypher... | Read more »
SwitchArcade Round-Up: ‘EA Sports FC 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 29th, 2023. In today’s article, we’ve got a ton of news to go over. Just a lot going on today, I suppose. After that, there are quite a few new releases to look at... | Read more »
‘Storyteller’ Mobile Review – Perfect fo...
I first played Daniel Benmergui’s Storyteller (Free) through its Nintendo Switch and Steam releases. Read my original review of it here. Since then, a lot of friends who played the game enjoyed it, but thought it was overpriced given the short... | Read more »
An Interview with the Legendary Yu Suzuk...
One of the cool things about my job is that every once in a while, I get to talk to the people behind the games. It’s always a pleasure. Well, today we have a really special one for you, dear friends. Mr. Yu Suzuki of Ys Net, the force behind such... | Read more »
New ‘Marvel Snap’ Update Has Balance Adj...
As we wait for the information on the new season to drop, we shall have to content ourselves with looking at the latest update to Marvel Snap (Free). It’s just a balance update, but it makes some very big changes that combined with the arrival of... | Read more »
‘Honkai Star Rail’ Version 1.4 Update Re...
At Sony’s recently-aired presentation, HoYoverse announced the Honkai Star Rail (Free) PS5 release date. Most people speculated that the next major update would arrive alongside the PS5 release. | Read more »
‘Omniheroes’ Major Update “Tide’s Cadenc...
What secrets do the depths of the sea hold? Omniheroes is revealing the mysteries of the deep with its latest “Tide’s Cadence" update, where you can look forward to scoring a free Valkyrie and limited skin among other login rewards like the 2nd... | Read more »
Recruit yourself some run-and-gun royalt...
It is always nice to see the return of a series that has lost a bit of its global staying power, and thanks to Lilith Games' latest collaboration, Warpath will be playing host the the run-and-gun legend that is Metal Slug 3. [Read more] | Read more »
‘The Elder Scrolls: Castles’ Is Availabl...
Back when Fallout Shelter (Free) released on mobile, and eventually hit consoles and PC, I didn’t think it would lead to something similar for The Elder Scrolls, but here we are. The Elder Scrolls: Castles is a new simulation game from Bethesda... | Read more »

Price Scanner via MacPrices.net

Clearance M1 Max Mac Studio available today a...
Apple has clearance M1 Max Mac Studios available in their Certified Refurbished store for $270 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Apple continues to offer 24-inch iMacs for up...
Apple has a full range of 24-inch M1 iMacs available today in their Certified Refurbished store. Models are available starting at only $1099 and range up to $260 off original MSRP. Each iMac is in... Read more
Final weekend for Apple’s 2023 Back to School...
This is the final weekend for Apple’s Back to School Promotion 2023. It remains active until Monday, October 2nd. Education customers receive a free $150 Apple Gift Card with the purchase of a new... Read more
Apple drops prices on refurbished 13-inch M2...
Apple has dropped prices on standard-configuration 13″ M2 MacBook Pros, Certified Refurbished, to as low as $1099 and ranging up to $230 off MSRP. These are the cheapest 13″ M2 MacBook Pros for sale... Read more
14-inch M2 Max MacBook Pro on sale for $300 o...
B&H Photo has the Space Gray 14″ 30-Core GPU M2 Max MacBook Pro in stock and on sale today for $2799 including free 1-2 day shipping. Their price is $300 off Apple’s MSRP, and it’s the lowest... Read more
Apple is now selling Certified Refurbished M2...
Apple has added a full line of standard-configuration M2 Max and M2 Ultra Mac Studios available in their Certified Refurbished section starting at only $1699 and ranging up to $600 off MSRP. Each Mac... Read more
New sale: 13-inch M2 MacBook Airs starting at...
B&H Photo has 13″ MacBook Airs with M2 CPUs in stock today and on sale for $200 off Apple’s MSRP with prices available starting at only $899. Free 1-2 day delivery is available to most US... Read more
Apple has all 15-inch M2 MacBook Airs in stoc...
Apple has Certified Refurbished 15″ M2 MacBook Airs in stock today starting at only $1099 and ranging up to $230 off MSRP. These are the cheapest M2-powered 15″ MacBook Airs for sale today at Apple.... Read more
In stock: Clearance M1 Ultra Mac Studios for...
Apple has clearance M1 Ultra Mac Studios available in their Certified Refurbished store for $540 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Back on sale: Apple’s M2 Mac minis for $100 o...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 –... Read more

Jobs Board

Licensed Dental Hygienist - *Apple* River -...
Park Dental Apple River in Somerset, WI is seeking a compassionate, professional Dental Hygienist to join our team-oriented practice. COMPETITIVE PAY AND SIGN-ON Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Sep 30, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
*Apple* / Mac Administrator - JAMF - Amentum...
Amentum is seeking an ** Apple / Mac Administrator - JAMF** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Child Care Teacher - Glenda Drive/ *Apple* V...
Child Care Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.