Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Just gotten related information about setprogname and getprogname:: Page 1 of 2 (2 Items)
   
Just gotten related information about setprogname and getprogname:  
Dear  Eric and Boudreau:



We Just gotten related information about setprogname and getprogname.


And We change implement style for it.


Please see below codes and May We receive your reply of comment.


Regards,
Kengo Kinoshita.

________________________________________________

extern char *__progname;

void setprogname(const char *progname)
{
 __progname = strrchr(progname, '/');
 if (__progname == NULL)
  __progname = progname;
 else
  __progname++;
}


    or


#include <libgen.h>

void setprogname(const char *progname)
{
 basename( progname );
}


_________________________________
extern char *__progname;

char *getprogname(void)
{
 return __progname;
}