[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] PilotID ?



> If you're trying to get the username and user ID from the Palm
> and feed those to conduits, I don't have any plans to add such a
> thing, but I suppose it might be useful, so feel free to add it. I
> don't think it should be too hard.
I modified ColdSync so it is writing headers :
PalmUserid: xxxxxxx
PalmUsername: yyyyyyyy
to conduit stdin.
Then my conduits are able to use this info.
It is really easy, Andrew is quite right.
2 modification required - in conduit.c and coldsync.c:
condiut.c :
add this line at top level:
extern struct Palm *palm;              /* AT added this for conduit headers  20010406 */
 
then inside conduit.c:
after this fragment
        ++last_header;
        headers[last_header].name = "OutputDB";
        headers[last_header].value = (char *) bakfname;
                                /* The cast is just to stop the compiler
                                 * from complaining. */
add this:
        /* AT start added 20010406  */
        ++last_header;
        headers[last_header].name = "UserId";
        sprintf(headers[last_header].value,"%lu",palm_userid(palm));
       
        ++last_header;
        headers[last_header].name = "UserName";
        headers[last_header].value = (char *)palm_username(palm);
        /* AT end added 20010406 */
 
coldsync.c:
move this line
struct Palm *palm;              /* AT moved to top level from inside for conduit access  20010406 */
to top level
That's it.
I should use diff, but I did too many changes ( and I don't quite familiar with diff :-(
Alex Tronin
at@urbis.net