TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Jim Peasley 72726,1153 (X)
from: Pete Lyall 76703,4230
date: 1991-01-22 23:56:48
subject: #9244-#`C` help

#: 9249 S3/Languages
    22-Jan-91  23:56:48
Sb: #9244-#'C' help
Fm: Pete Lyall 76703,4230
To: Jim Peasley 72726,1153 (X)

Jim -

Regarding multiple users... best technique (unix apps do this) is get the
user's ID, and then use that to do a getpwuid() [forget if that's exactly what
it's called... see the password(3) function of the Clib docs]. That will return
a pointer to a structure that is the user's password file entry broken down.
One of the members of the structure is a pointer to a string that is the name
of that user's home [login] directory.

Once you know that, your program can chd() there, and then open the dateck data
file. This way, every user inherently gets access to his own file, and the
program is automatically multi-user.

Re: independent screen positioning... you just discovered what termcap is for.
Termcap allows you to make generic calls that are used to manipulate any
terminal that's being used (assming it has been defined by an entry in the
/dd/sys/termcap file, and you know the name of the terminal the user is using.
Pop over to DL3 and snag the two man pages discussing termcap that I recently
uploaded. I'll be happy to answer questions after that. Consider it an
investment in the future too, as OSK uses termcap too.

Pete

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.