5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2006 - 2007 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
26 /* Returns the username of the user. */
28 char *silc_get_username()
37 pw = getpwuid(getuid());
39 return strdup("User");
41 logname = pw->pw_name;
44 return strdup(logname);
46 return strdup("Symbian");
50 /* Returns the real name of ther user. */
52 char *silc_get_real_name()
55 char *realname = NULL;
58 pw = getpwuid(getuid());
60 return strdup("No Name");
62 if (strchr(pw->pw_gecos, ','))
63 *strchr(pw->pw_gecos, ',') = 0;
65 if (!strlen(pw->pw_gecos))
66 return strdup("No Name");
68 realname = strdup(pw->pw_gecos);
72 return strdup("Lastname");
76 /* Return current time to struct timeval. */
78 int silc_gettimeofday(struct timeval *p)
80 return gettimeofday(p, NULL);
83 int silc_file_set_nonblock(int fd)
88 void silc_symbian_usleep(long microseconds)
90 User::After(microseconds / 1000);
93 void silc_symbian_debug(const char *function, int line, char *string)
95 fprintf(stderr, "%s:%d: %s\n", function, line, string);
96 // RDebug::Print(_L("%s:%d: %s"), function, line, string);