Back to index

plt-scheme  4.2.1
Functions
Net.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int wxGetHostName (char *buf, int sz)
int wxGetEmailAddress (char *buf, int sz)
int wxGetUserId (char *buf, int sz)
int wxGetUserName (char *buf, int sz)

Function Documentation

int wxGetEmailAddress ( char *  buf,
int  sz 
)

Definition at line 55 of file Net.c.

{
  char host[65];
  char user[65];
  char tmp[130];

  if (wxGetHostName(host, 64) == 0)
    return 0;
  if (wxGetUserId(user, 64) == 0)
    return 0;

  strcpy(tmp, user);
  strcat(tmp, "@");
  strcat(tmp, host);
  strncpy(address, tmp, maxSize - 1);
  address[maxSize-1] = '\0';
  return 1;
}

Here is the call graph for this function:

int wxGetHostName ( char *  buf,
int  sz 
)

Definition at line 40 of file Net.c.

{
#ifndef WX_USE_GETHOSTBYNAME
  return (sysinfo(SI_HOSTNAME, buf, sz - 1) != -1);
#else /* BSD Sockets */
  char name[255];
  /* Get hostname */
  if ((gethostname(name, sizeof(name)/sizeof(char)-1)) == -1)
    return 0;
  strncpy(buf, name, sz-1);
  buf[sz-1] = 0;
  return 1;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

int wxGetUserId ( char *  buf,
int  sz 
)

Definition at line 74 of file Net.c.

{
  struct passwd *who;
  
  if ((who = getpwuid(getuid ())) != NULL) {
    strncpy (buf, who->pw_name, sz-1);
    buf[sz - 1]= 0;
    return 1;
  }
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int wxGetUserName ( char *  buf,
int  sz 
)

Definition at line 86 of file Net.c.

{
  struct passwd *who;
  
  if ((who = getpwuid (getuid ())) != NULL) {
    strncpy (buf, who->pw_gecos, sz - 1);
    buf[sz - 1]= 0;
    return 1;
  }
  return 0;
}

Here is the call graph for this function: