aboutsummaryrefslogtreecommitdiffstats
path: root/README (follow)
AgeCommit message (Expand)AuthorFilesLines
2005-01-09[lcd4linux @ 2005-01-09 10:53:22 by reinelt]reinelt1-2/+2
2003-08-01[lcd4linux @ 2003-08-01 05:15:42 by reinelt]reinelt1-284/+3
2002-04-29[lcd4linux @ 2002-04-29 11:00:25 by reinelt]reinelt1-1/+8
2001-09-05[lcd4linux @ 2001-09-05 09:38:52 by reinelt]reinelt1-1/+12
2001-05-27[lcd4linux @ 2001-05-27 17:32:35 by reinelt]reinelt1-47/+50
2001-03-16[lcd4linux @ 2001-03-16 16:40:17 by ltoetsch]ltoetsch1-1/+6
2001-03-15[lcd4linux @ 2001-03-15 14:25:05 by ltoetsch]ltoetsch1-2/+12
2001-03-14[lcd4linux @ 2001-03-14 13:19:29 by ltoetsch]ltoetsch1-5/+20
2001-03-13[lcd4linux @ 2001-03-13 07:41:22 by reinelt]reinelt1-1/+3
2001-03-09[lcd4linux @ 2001-03-09 14:24:49 by ltoetsch]ltoetsch1-2/+3
2001-03-09[lcd4linux @ 2001-03-09 13:08:11 by ltoetsch]ltoetsch1-2/+13
2001-03-08[lcd4linux @ 2001-03-08 15:25:38 by ltoetsch]ltoetsch1-43/+62
2001-03-07[lcd4linux @ 2001-03-07 18:10:21 by ltoetsch]ltoetsch1-3/+23
2001-03-02[lcd4linux @ 2001-03-02 10:18:03 by ltoetsch]ltoetsch1-1/+4
2001-02-16[lcd4linux @ 2001-02-16 08:23:09 by reinelt]reinelt1-1/+2
2000-11-28[lcd4linux @ 2000-11-28 16:46:11 by reinelt]reinelt1-5/+5
2000-08-10[lcd4linux @ 2000-08-10 09:44:09 by reinelt]reinelt1-2/+2
2000-08-09[lcd4linux @ 2000-08-09 14:14:11 by reinelt]reinelt1-4/+5
2000-08-09[lcd4linux @ 2000-08-09 09:50:29 by reinelt]reinelt1-11/+30
2000-04-15[lcd4linux @ 2000-04-15 16:56:52 by reinelt]reinelt1-3/+6
2000-04-15[lcd4linux @ 2000-04-15 11:13:54 by reinelt]reinelt1-3/+4
2000-04-10[lcd4linux @ 2000-04-10 04:40:53 by reinelt]reinelt1-5/+13
2000-04-03[lcd4linux @ 2000-04-03 04:46:38 by reinelt]reinelt1-1/+16
2000-03-26[lcd4linux @ 2000-03-26 19:03:52 by reinelt]reinelt1-1/+3
2000-03-19[lcd4linux @ 2000-03-19 08:41:28 by reinelt]reinelt1-0/+130
he GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * LCD4Linux is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ /* * exported functions: * * int plugin_init_uname (void) * adds uname() functions * */ #include "config.h" #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/utsname.h> #include "debug.h" #include "plugin.h" static void my_uname(RESULT * result, RESULT * arg1) { struct utsname utsbuf; char *key, *value; key = R2S(arg1); if (uname(&utsbuf) != 0) { error("uname() failed: %s", strerror(errno)); SetResult(&result, R_STRING, ""); return; } if (strcasecmp(key, "sysname") == 0) { value = utsbuf.sysname; } else if (strcasecmp(key, "nodename") == 0) { value = utsbuf.nodename; } else if (strcasecmp(key, "release") == 0) { value = utsbuf.release; } else if (strcasecmp(key, "version") == 0) { value = utsbuf.version; } else if (strcasecmp(key, "machine") == 0) { value = utsbuf.machine; #if defined(_GNU_SOURCE) && ! defined(__APPLE__) } else if (strcasecmp(key, "domainname") == 0) { value = utsbuf.domainname; #endif } else { error("uname: unknown field '%s'", key); value = ""; } SetResult(&result, R_STRING, value); } int plugin_init_uname(void) { AddFunction("uname", 1, my_uname); return 0; } void plugin_exit_uname(void) { }