PDA

View Full Version : Unix API ?



Unregistered
02-13-2002, 05:59 PM
I have no clue where to start.
Im familiar w. C/C++

How would I go about this.
Using C or C++ to interact w. other windows/ programs.

ie:

If i wanted to create an irc bot.
Have a bot sit online in a chat room running *****X or xchat or any irc client. View each line sent to chat by others, and then responded accordingly.
How would I go about doing that?

I believe in Windows I would use the Win32 api calls such as FindWindowEx etc etc.
What about in Unix ?

Thank you

Deckard
02-13-2002, 06:26 PM
If you are interested in writing an IRC bot, I suggest downloading the Eggdrop IRC bot and reviewing the source code (try searching for it at freshmeat.net).

Cheers,

Unregistered
02-13-2002, 07:07 PM
My question was in general.

Using my program to deal w. other programs i/o.

starX
02-13-2002, 10:22 PM
You're going to have to read up on fork and exec (doing a man on either one will tell you something of what you need to know), and then you'll need to study interprocess communication.

Yes, it is do-able, but it can also be a bit tricky. Advanced Programming in the Unix Environment (Stevens) is probably one of the most detailed and in-depth guides you can find on these topics. Beginning Linux Programming (Wrox Press) also talks about it a little, if you're looking for a book. Ageneral lesson is a little too complicated to get in to here though.

starX
www.axisoftime.com

Salem
02-14-2002, 12:04 PM
This has some good stuff on unix programming
http://www.cs.cf.ac.uk/Dave/C/CE.html