#: 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.
|