# xroach



## chenly (May 16, 2002)

Does anyone know of a BSD+XDarwin port of xroach? How about Carbon or Cocoa?

Alternatively, is there a brave UNIX programmer out there that can walk this community through the porting/rehashing/recompiling/makeing (sic)/whatever of the source code? It's only 14k, so it can't be TOO much trouble. I've got the source code and will gladly e-mail it to anyone who wants it.


----------



## nkuvu (May 16, 2002)

Send me the source.  I'll see how it goes.


----------



## adambyte (May 16, 2002)

Hi.. excuse my lack of knowledge, but what IS xroach?


----------



## chenly (May 16, 2002)

...but then I'd have to kill you.


----------



## blb (May 16, 2002)

It's really easy to compile,

```
cc -o xroach xroach.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11
```
The problems are that you need to run XDarwin in _take over the screen_ mode, not rootless, and those roaches move *way* fast...


----------



## chenly (May 16, 2002)

It didn't like the -o option. 

Transcript:

Welcome to Darwin!
[prompt]% cc -o xroach xroach.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11

OK? wc -o xroach xroach.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11? yes
wc: illegal option -- o
usage: wc [-clw] [files]
[prompt]%


----------



## chenly (May 16, 2002)

How does one "install" Developer Tools? I have the Developer Tools disk...


----------



## chenly (May 16, 2002)

Never mind (I think). I'm downloading the ~220MB disk image of the December '01 Developer Tools right now. Getting ~260KB/second, too!


----------



## nkuvu (May 16, 2002)

There is an April 2002 version of the Developer tools...


----------



## chenly (May 16, 2002)

blb: sorry, I missed this before. As a linguist, I must request that you never, ever, ever use the phrase "It's really easy to compile" ever again; it's never true.

Transcript:

Welcome to Darwin!
[***-**-**-***-23:~] [username]% cd ~/desktop/xroach
[***-**-**-***-23:~/desktop/xroach] [username]% ls
Imakefile           roach045.xbm        roach195.xbm        roach345.xbm
Makefile            roach060.xbm        roach210.xbm        roachmap.h
Makefile.solaris    roach075.xbm        roach225.xbm        squish.xbm
README              roach090.xbm        roach240.xbm        xroach-4.0.lsm
README.solaris      roach105.xbm        roach255.xbm        xroach-4.0.spec
patchlevel.h        roach120.xbm        roach270.xbm        xroach.1
pkginfo             roach135.xbm        roach285.xbm        xroach.c
roach000.xbm        roach150.xbm        roach300.xbm
roach015.xbm        roach165.xbm        roach315.xbm
roach030.xbm        roach180.xbm        roach330.xbm
[***-**-**-***-23:~/desktop/xroach] [username]% 
cc -o xroach xroach.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11
[***-**-**-***-23:~/desktop/xroach] [username]% cc -o xroach xroach.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11
xroach.c:32: header file 'malloc.h' not found
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
[***-**-**-***-23:~/desktop/xroach] [username]%


----------



## chenly (May 16, 2002)

April, 2002 is beta, not final.


----------



## nkuvu (May 16, 2002)

True -- I forget these things, since I have had so little problems with beta software on the Mac (knock on anything)...


----------



## chenly (May 16, 2002)

What about the code? There's just the one error. What's a header?


----------



## nkuvu (May 16, 2002)

Discussion taken to IM.  I'll send chenly back here if I can't explain well enough...


----------



## lethe (May 16, 2002)

here is a thread describing the malloc.h problem

http://www.macosx.com/forums/showthread.php?threadid=4656&highlight=malloc.h


----------



## chenly (May 17, 2002)

lethe: I keyed that in and it seemed to take.

blb: I reran your command line and got partial success; everything but arguments 9 and 12 appears to have installed OK. These two had an "incompatible pointer type," whatever that means. Does anyone know how to get this thing going, now that it appears to have been installed? From what I understand, the compiler line that blb supplied specifies that 

xroach

be typed in at the command line to initiate the program, but the line you want to use is

xroach -squish

which lets you squish the little guys with a click. Neither of these did anything, tho'. Furthermore, Sherlock finds no files under search string "xroach" which are not part of the original tarball I downloaded from Debian's site (yes, I downloaded the binary). I don't think it was installed at all.


----------



## chenly (May 17, 2002)

If anyone is interested in installing xroach, here are the steps:

***Note: these instructions would not be possible without the assistance of nkuvu. Thanks, nkuvu!***

1.     Install XFree86. I used XDarwin, but XTools or any of the other X-windows solutions for OS X should work fine.

2.     Download and decompress the xroach-4.0 tarball binary from Debian's web site.

3.     Type in the command line supplied by lethe in post above. Thanks, lethe!

4.     Type in blb's compiling instructions above. Thanks, blb!

You can now run xroach from the folder which was created when you decompressed the tarball. Move this file to a permanent home (mine is in /Applications) and create a symbolic link in your /usr/local/bin folder by typing in the following command lines (these instructions assume that the folder which contains the xroach executible is in a folder called xroach-4.0 which you've moved to /Applications; make changes to fit your installation):

cd /usr/local/bin [hit return]

ln -s xroach /Applications/xroach-4.0/xroach [hit return]

You will now be able to run xroach (don't forget to add the -squish option!) directly from the command line available under XDarwin or whichever implementation of X-windows you choose! 

If there are any questions or problems relating to this post, feel free to post below; I will clarify as needed. Share and enjoy!


----------



## blb (May 17, 2002)

> _Originally posted by chenly _
> *blb: sorry, I missed this before. As a linguist, I must request that you never, ever, ever use the phrase "It's really easy to compile" ever again; it's never true.
> ...
> [***-**-**-***-23:~/desktop/xroach] [username]%
> ...


Oops, sorry about that; I've gotten to the point where I don't even think about malloc.h errors, and my fingers just automatically remove that include line...

(Later)


> _Originally posted by chenly _
> *...
> Does anyone know how to get this thing going, now that it appears to have been installed?
> ...
> *


If all you ran was the *cc* command, than using

```
./xroach
```
or

```
./xroach -squish
```
should run it; be sure to have XDarwin up and running first, and in full-screen mode.


----------



## chenly (May 17, 2002)

./xroach, with or without  -squish, would indeed run the program, but only if you changed the working directory to ~/desktop/xroach-4.0, the folder created when I decompressed the original tarball; in my infite wisdom, I managed to install the program there. As noted above, I moved that folder to /Applications, then created a symbolic link to /Applications/xroach-4.0/xroach in /usr/local/bin; now, when XDarwin is running in full-screen mode, I can just type xroach -squish at the command line.

I learned a lot about UNIX applications with this little project; if anyone has any problem with the instructions I posted above, just post below. Share and enjoy!


----------

