head 1.10; access; symbols OPENPKG_E1_MP_HEAD:1.10 OPENPKG_E1_MP:1.10 OPENPKG_E1_MP_2_STABLE:1.10.2.2 OPENPKG_E1_FP:1.10.2.2 OPENPKG_2_STABLE_MP:1.10 OPENPKG_2_STABLE_20061018:1.10.2.2 OPENPKG_2_STABLE:1.10.0.2 OPENPKG_CW_FP:1.8 OPENPKG_1_STABLE_MP:1.1; locks; strict; comment @# @; 1.10 date 2006.02.04.09.15.22; author rse; state Exp; branches 1.10.2.1; next 1.9; commitid csHUmvQ84c67kfkr; 1.9 date 2006.01.23.12.39.44; author rse; state Exp; branches; next 1.8; commitid rVaszHrkxZB9QIir; 1.8 date 2004.11.08.16.38.41; author ms; state Exp; branches; next 1.7; 1.7 date 2004.08.16.18.20.46; author rse; state Exp; branches; next 1.6; 1.6 date 2004.08.11.11.35.19; author tho; state Exp; branches; next 1.5; 1.5 date 2004.06.14.16.08.28; author ms; state Exp; branches; next 1.4; 1.4 date 2003.09.30.14.25.01; author ms; state Exp; branches; next 1.3; 1.3 date 2003.08.28.12.22.20; author mlelstv; state Exp; branches; next 1.2; 1.2 date 2003.08.14.13.52.33; author rse; state Exp; branches; next 1.1; 1.1 date 2003.07.17.10.26.17; author rse; state Exp; branches; next ; 1.10.2.1 date 2006.02.04.09.15.22; author rse; state dead; branches; next 1.10.2.2; commitid iZxwRSmmWscPXUQr; 1.10.2.2 date 2006.10.16.14.51.07; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.10 log @upgrading package: icewm 1.2.24 -> 1.2.25 @ text @Index: src/acpustatus.h --- src/acpustatus.h.orig 2006-02-03 07:24:27 +0100 +++ src/acpustatus.h 2006-02-04 10:09:54 +0100 @@@@ -1,7 +1,7 @@@@ #ifndef __CPUSTATUS_H #define __CPUSTATUS_H -#if defined(linux) || defined(HAVE_KSTAT_H) || defined(HAVE_SYSCTL_CP_TIME) +#if (defined(linux) || defined(HAVE_KSTAT_H) || defined(HAVE_SYSCTL_CP_TIME)) || defined (__FreeBSD__) #define IWM_USER (0) #define IWM_NICE (1) @@@@ -14,6 +14,10 @@@@ #include "ywindow.h" #include "ytimer.h" +#ifdef __FreeBSD__ +#include +#include +#endif class CPUStatus: public YWindow, public YTimerListener { public: @@@@ -35,6 +39,10 @@@@ unsigned long last_cpu[IWM_STATES]; YColor *color[IWM_STATES]; YTimer *fUpdateTimer; +#ifdef __FreeBSD__ + struct nlist namelist[2]; + kvm_t *kd; +#endif }; #else #undef CONFIG_APPLET_CPU_STATUS Index: src/wmclient.h --- src/wmclient.h.orig 2006-02-03 07:24:27 +0100 +++ src/wmclient.h 2006-02-04 10:09:54 +0100 @@@@ -6,6 +6,8 @@@@ #include "ymenu.h" #include "MwmUtil.h" +#include + class YFrameWindow; class WindowListItem; class YIcon; Index: src/ylocale.cc --- src/ylocale.cc.orig 2006-02-03 07:24:27 +0100 +++ src/ylocale.cc 2006-02-04 10:09:54 +0100 @@@@ -149,7 +149,8 @@@@ return NULL; YUChar * uStr(new YUChar[lLen + 1]); - char * inbuf((char *) lStr), * outbuf((char *) uStr); + const char * inbuf((char *) lStr); + char * outbuf((char *) uStr); size_t inlen(lLen), outlen(4 * lLen); if (0 > (int) iconv(instance->toUnicode, const_cast(&inbuf), &inlen, &outbuf, &outlen)) @ 1.10.2.1 log @file icewm.patch was added on branch OPENPKG_2_STABLE on 2006-10-16 14:51:07 +0000 @ text @d1 59 @ 1.10.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 59 Index: src/acpustatus.h --- src/acpustatus.h.orig 2006-02-03 07:24:27 +0100 +++ src/acpustatus.h 2006-02-04 10:09:54 +0100 @@@@ -1,7 +1,7 @@@@ #ifndef __CPUSTATUS_H #define __CPUSTATUS_H -#if defined(linux) || defined(HAVE_KSTAT_H) || defined(HAVE_SYSCTL_CP_TIME) +#if (defined(linux) || defined(HAVE_KSTAT_H) || defined(HAVE_SYSCTL_CP_TIME)) || defined (__FreeBSD__) #define IWM_USER (0) #define IWM_NICE (1) @@@@ -14,6 +14,10 @@@@ #include "ywindow.h" #include "ytimer.h" +#ifdef __FreeBSD__ +#include +#include +#endif class CPUStatus: public YWindow, public YTimerListener { public: @@@@ -35,6 +39,10 @@@@ unsigned long last_cpu[IWM_STATES]; YColor *color[IWM_STATES]; YTimer *fUpdateTimer; +#ifdef __FreeBSD__ + struct nlist namelist[2]; + kvm_t *kd; +#endif }; #else #undef CONFIG_APPLET_CPU_STATUS Index: src/wmclient.h --- src/wmclient.h.orig 2006-02-03 07:24:27 +0100 +++ src/wmclient.h 2006-02-04 10:09:54 +0100 @@@@ -6,6 +6,8 @@@@ #include "ymenu.h" #include "MwmUtil.h" +#include + class YFrameWindow; class WindowListItem; class YIcon; Index: src/ylocale.cc --- src/ylocale.cc.orig 2006-02-03 07:24:27 +0100 +++ src/ylocale.cc 2006-02-04 10:09:54 +0100 @@@@ -149,7 +149,8 @@@@ return NULL; YUChar * uStr(new YUChar[lLen + 1]); - char * inbuf((char *) lStr), * outbuf((char *) uStr); + const char * inbuf((char *) lStr); + char * outbuf((char *) uStr); size_t inlen(lLen), outlen(4 * lLen); if (0 > (int) iconv(instance->toUnicode, const_cast(&inbuf), &inlen, &outbuf, &outlen)) @ 1.9 log @upgrading package: icewm 1.2.23 -> 1.2.24 @ text @d2 2 a3 2 --- src/acpustatus.h.orig 2004-08-16 06:58:30 +0200 +++ src/acpustatus.h 2004-08-16 20:12:37 +0200 a34 13 Index: src/wmapp.cc --- src/wmapp.cc.orig 2004-08-16 06:58:30 +0200 +++ src/wmapp.cc 2004-08-16 20:12:37 +0200 @@@@ -1429,6 +1429,9 @@@@ #endif int main(int argc, char **argv) { +#ifdef __FreeBSD__ + setegid( getgid() ); +#endif YLocale locale; for (char ** arg = argv + 1; arg < argv + argc; ++arg) { d36 2 a37 2 --- src/wmclient.h.orig 2004-08-16 06:58:30 +0200 +++ src/wmclient.h 2004-08-16 20:12:37 +0200 d48 2 a49 2 --- src/ylocale.cc.orig 2004-08-16 06:58:31 +0200 +++ src/ylocale.cc 2004-08-16 20:12:37 +0200 d51 1 a51 1 return NULL; d59 1 a59 25 if (0 > (int) iconv(instance->toUnicode, &inbuf, &inlen, &outbuf, &outlen)) Index: src/wmapp.cc --- src/wmapp.cc.orig 2006-01-23 09:04:55 +0100 +++ src/wmapp.cc 2006-01-23 13:35:48 +0100 @@@@ -345,7 +345,7 @@@@ 0, PATH_MAX, False, XA_STRING, &r_type, &r_format, &count, &bytes_remain, - (char **) &icewmFontPath) == + (unsigned char **)&icewmFontPath) == Success && icewmFontPath) { if (r_type == XA_STRING && r_format == 8) { for (int n(ndirs - 1); n > 0; --n) // ---- remove death paths --- Index: src/yinput.cc --- src/yinput.cc.orig 2006-01-23 09:04:55 +0100 +++ src/yinput.cc 2006-01-23 13:36:20 +0100 @@@@ -418,7 +418,7 @@@@ selection.target, &type, &format, (unsigned long *)&nitems, (unsigned long *)&extra, - (char **)&data); + (unsigned char **)&data); if (nitems > 0 && data != NULL) { replaceSelection(data, nitems); @ 1.8 log @upgrading package: icewm 1.2.16 -> 1.2.17 @ text @d73 24 @ 1.7 log @upgrading package: icewm 1.2.15 -> 1.2.16 @ text @d38 1 a38 1 @@@@ -1450,6 +1450,9 @@@@ @ 1.6 log @upgrading package: icewm 1.2.14 -> 1.2.15 @ text @d2 2 a3 3 diff -Nau src/acpustatus.h.orig src/acpustatus.h --- src/acpustatus.h.orig 2004-05-23 08:18:19 +0200 --- src/acpustatus.h 2004-06-14 17:43:03 +0200 d36 2 a37 3 diff -Nau src/wmapp.cc.orig src/wmapp.cc --- src/wmapp.cc.orig 2004-05-23 08:18:19 +0200 --- src/wmapp.cc 2004-06-14 17:43:11 +0200 d49 2 a50 3 diff -Nau src/wmclient.h.orig src/wmclient.h --- src/wmclient.h.orig 2004-05-23 08:18:19 +0200 --- src/wmclient.h 2004-06-14 17:43:11 +0200 d61 2 a62 3 diff -Nau src/ylocale.cc.orig src/ylocale.cc --- src/ylocale.cc.orig 2004-05-23 08:18:19 +0200 --- src/ylocale.cc 2004-06-14 17:43:11 +0200 a72 30 Index: src/base.h --- src/base.h.orig 2004-08-11 10:45:05.000000000 +0200 +++ src/base.h 2004-08-11 11:32:42.867990000 +0200 @@@@ -172,7 +172,7 @@@@ unsigned strtoken(const char *str, const char *delim = " \t"); char const * strnxt(const char *str, const char *delim = " \t"); -char *my_basename(const char *filename); +char *my_basename(char *filename); bool strequal(const char *a, const char *b); int strnullcmp(const char *a, const char *b); Index: src/misc.cc --- src/misc.cc.orig 2004-08-11 10:44:48.000000000 +0200 +++ src/misc.cc 2004-08-11 11:33:55.638071000 +0200 @@@@ -453,12 +453,12 @@@@ } #ifndef HAVE_BASENAME -char *my_basename(const char *path) { +char *my_basename(char *path) { char *base = ::strrchr(path, DIR_DELIMINATOR); return (base ? base + 1 : path); } #else -char *my_basename(const char *path) { +char *my_basename(char *path) { return basename(path); } #endif @ 1.5 log @upgrading package: icewm 1.2.13 -> 1.2.14 @ text @a0 178 Index: configure diff -Nau configure.orig configure --- configure.orig 2004-05-23 08:18:27 +0200 --- configure 2004-06-14 17:43:11 +0200 @@@@ -2316,6 +2316,9 @@@@ echo "$as_me:$LINENO: checking whether the C compiler ($CC) understands C++" >&5 echo $ECHO_N "checking whether the C compiler ($CC) understands C++... $ECHO_C" >&6 +if test "${ice_prog_gxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat > conftest.C <&5 echo "${ECHO_T}$ice_prog_gxx" >&6 +fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' Index: configure.in diff -Nau configure.in.orig configure.in --- configure.in.orig 2004-05-23 08:18:18 +0200 --- configure.in 2004-06-14 17:43:11 +0200 @@@@ -21,54 +21,9 @@@@ dnl ---------- Checking for a C compiler in hope that it understands C++ too --- dnl -ICE_PROG_CXX_LIGHT AC_LANG_CPLUSPLUS AC_PROG_CXX -dnl ----------- If both CC and CXX are GNU compilers, it is better to use CC --- -dnl ---- for linking. -if test x"$ac_cv_prog_gxx" = x; then - AC_PROG_CC - if test x"$ac_cv_prog_gcc" = x; then - CXX_LINK=${CC} - fi -fi - -dnl ---------- Also check how to turn off RTTI and exception handling --- - -dnl --- SunONE C++ supports no-rtti flag only in compat=4 mode -if test -z "`${CXX} -V 2>&1 | grep Sun`"; then - ICE_CXX_FLAG_ACCEPT(no_rtti, -fno-rtti) -fi -dnl --- Intel C++ supports -fno-rtti, but doens't support -fno-*-exceptions -if test $(basename $CXX) != "icc"; then - if test -n "`${CXX} -V 2>&1 | grep Sun`"; then - dnl --- Sun ONE C++ syntax for "no exceptions" - ICE_CXX_FLAG_ACCEPT(no_exceptions, -features=no%except) - else - if test $(basename $CXX) = "g++" || - test $(basename $CXX) = "gcc"; then - ICE_CXX_FLAG_ACCEPT(no_exceptions, -fno-exceptions) - if test x"$no_exceptions_ok" = xno; then - ICE_CXX_FLAG_ACCEPT(no_exceptions, -fno-handle-exceptions) - fi - fi - fi -fi - -if test $(basename $CXX) = "g++" || - test $(basename $CXX) = "gcc" ; then - ICE_CXX_FLAG_ACCEPT(warn_xxx, -Wall -Wpointer-arith -Wconversion -Wwrite-strings -Winline -Woverloaded-virtual -W) - ICE_CXX_FLAG_ACCEPT(permissive, -fpermissive) -else - dnl --- Sun ONE doesn't support GCC -W* and -fpermissive - dnl --- Intel C++ doesn't supports lots of GCC -W* and -fpermissive - if test $(basename $CXX) = "icc"; then - dnl --- Using -w0 to avoid noisy "remark" messages - ICE_CXX_FLAG_ACCEPT(warn_xxx, -w0) - fi -fi - if test x"$CXX_LINK" = x; then CXX_LINK=$CXX fi Index: src/aapm.cc diff -Nau src/aapm.cc.orig src/aapm.cc --- src/aapm.cc.orig 2004-05-23 08:18:19 +0200 --- src/aapm.cc 2004-06-14 17:43:11 +0200 @@@@ -27,6 +27,13 @@@@ #include #include +#ifdef __FreeBSD__ +#include +#include +#include +#include +#endif + YColor *YApm::apmBg = 0; YColor *YApm::apmFg = 0; ref YApm::apmFont; @@@@ -48,8 +55,12 @@@@ void ApmStr(char *s, bool Tool) { +#ifdef __FreeBSD__ + struct apm_info ai; +#else char buf[80]; - int len, i, fd = open("/proc/apm", O_RDONLY); +#endif + int len, i, fd = open(APMDEV, O_RDONLY); char driver[16]; char apmver[16]; int apmflags; @@@@ -61,9 +72,31 @@@@ char units[16]; if (fd == -1) { + static int error = 0; + if (!error) + perror("Can't open the apm device"); + error = 1; return ; } +#ifdef __FreeBSD__ + if (ioctl(fd,APMIO_GETINFO, &ai) == -1) + { + static int error = 0; + if (!error) + perror("Can't ioctl the apm device"); + error = 1; + close(fd); + return; + } + close(fd); + sprintf(apmver, "%u.%u", ai.ai_major, ai.ai_minor); + ACstatus = ai.ai_acline; + BATflag = ai.ai_batt_stat == 3 ? 8 : 0; + BATlife = ai.ai_batt_life; + BATtime = ai.ai_batt_time == 0 ? -1 : ai.ai_batt_time; + strcpy(units, "sec"); +#else len = read(fd, buf, sizeof(buf) - 1); close(fd); @@@@ -77,10 +110,11 @@@@ static int error = 1; if (error) { error = 0; - warn(_("/proc/apm - unknown format (%d)"), i); + warn(_("%s - unknown format (%d)"), APMDEV, i); } return ; } +#endif if (BATlife == -1) BATlife = 0; Index: src/aapm.h diff -Nau src/aapm.h.orig src/aapm.h --- src/aapm.h.orig 2004-05-23 08:18:19 +0200 --- src/aapm.h 2004-06-14 17:43:11 +0200 @@@@ -1,7 +1,5 @@@@ -#ifndef linux -#undef CONFIG_APPLET_APM -#elif CONFIG_APPLET_APM +#if (defined(linux) || defined (__FreeBSD__)) && defined(i386) #include "ywindow.h" #include "ytimer.h" @@@@ -62,4 +60,6 @@@@ char *acpiACName; }; +#else +#undef CONFIG_APPLET_APM #endif a35 61 Index: src/acpustatus.cc diff -Nau src/apppstatus.cc.orig src/apppstatus.cc --- src/apppstatus.cc.orig 2004-05-23 08:18:19 +0200 --- src/apppstatus.cc 2004-06-14 17:43:03 +0200 @@@@ -358,6 +358,7 @@@@ return isUpIsdn(); #endif +#ifndef __FreeBSD__ char buffer[32 * sizeof(struct ifreq)]; struct ifconf ifc; struct ifreq *ifr; @@@@ -389,6 +390,38 @@@@ } close(s); + +#else // __FreeBSD__ + // FreeBSD code by Ronald Klop + struct ifmibdata ifmd; + size_t ifmd_size=sizeof(ifmibdata); + int nr_network_devs; + size_t int_size=sizeof(int); + int name[6]; + name[0] = CTL_NET; + name[1] = PF_LINK; + name[2] = NETLINK_GENERIC; + name[3] = IFMIB_IFDATA; + name[5] = IFDATA_GENERAL; + + if(sysctlbyname("net.link.generic.system.ifcount",&nr_network_devs, + &int_size,(void*)0,0) == -1) { + printf("%s@@%d: %s\n",__FILE__,__LINE__,strerror(errno)); + } else { + for(int i=1;i<=nr_network_devs;i++) { + name[4] = i; /* row of the ifmib table */ + + if(sysctl(name, 6, &ifmd, &ifmd_size, (void *)0, 0) == -1) { + printf(_("%s@@%d: %s\n"),__FILE__,__LINE__,strerror(errno)); + continue; + } + + if (strcmp(ifmd.ifmd_name, netDevice) == 0 && (ifmd.ifmd_flags & IFF_RUNNING)) { + return true; + } + } + } +#endif // __FreeBSD__ return false; } @@@@ -437,8 +470,7 @@@@ } #endif - - cur_ibytes = 0; +cur_ibytes = 0; cur_obytes = 0; d77 30 @ 1.4 log @upgrading package: icewm 1.2.12 -> 1.2.13 @ text @d1 86 a86 4 --- src/aapm.cc.orig Sat Jan 4 01:25:45 2003 +++ src/aapm.cc Mon Jan 6 19:00:50 2003 @@@@ -26,6 +26,13 @@@@ #include d88 1 d99 2 a100 2 YFont *YApm::apmFont = 0; @@@@ -47,8 +54,12 @@@@ d114 1 a114 1 @@@@ -60,9 +71,27 @@@@ a123 1 - d135 4 d140 2 a141 2 + ACstatus = ai.ai_acline ; + BATflag = ai.ai_batt_stat == 3 ? 8 : 0; d146 1 a146 1 @@@@ -76,10 +105,11 @@@@ d159 61 a219 4 --- src/apppstatus.cc.orig Sat Mar 17 00:17:37 2001 +++ src/apppstatus.cc Thu Apr 5 22:45:29 2001 @@@@ -270,6 +270,7 @@@@ return isUpIsdn(); d226 1 a226 1 @@@@ -301,6 +302,38 @@@@ a262 1 #endif // if 0 a263 29 --- src/sysdep.h.orig Tue Oct 9 23:54:03 2001 +++ src/sysdep.h Wed Feb 20 15:22:43 2002 @@@@ -57,7 +57,9 @@@@ #ifdef CONFIG_I18N #include +#if __FreeBSD__ >= 5 #include +#endif #endif #endif --- src/acpustatus.cc.orig Sun Mar 9 04:37:52 2003 +++ src/acpustatus.cc Thu Apr 24 05:09:50 2003 @@@@ -26,7 +26,16 @@@@ #include "intl.h" -#if (defined(linux) || defined(HAVE_KSTAT_H)) +#if (defined(linux) || defined(HAVE_KSTAT_H) || defined(__FreeBSD__)) + +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#include +#endif d265 1 a265 39 #define UPDATE_INTERVAL 500 @@@@ -49,13 +58,42 @@@@ color[IWM_SYS] = new YColor(clrCpuSys); color[IWM_IDLE] = *clrCpuIdle ? new YColor(clrCpuIdle) : NULL; - +#ifdef __FreeBSD__ + color[IWM_INTR] = new YColor(clrCpuIntr); + for (unsigned int i = 0; i < taskBarCPUSamples; i++) { + cpu[i][IWM_USER] = cpu[i][IWM_NICE] = + cpu[i][IWM_SYS] = cpu[i][IWM_INTR] = 0; + cpu[i][IWM_IDLE] = 1; + } + setSize(taskBarCPUSamples, 20); + last_cpu[IWM_USER] = last_cpu[IWM_NICE] = last_cpu[IWM_SYS] = + last_cpu[IWM_IDLE] = last_cpu[IWM_INTR] = 0; + if( setegid( 2 ) == 0 ) { + char errbuf[_POSIX2_LINE_MAX]; + kd = kvm_openfiles( NULL, NULL, NULL, O_RDONLY, errbuf ); + setegid( getgid() ); + if( kd == NULL ) + fprintf( stderr, "kvm_openfiles: %s\n", errbuf ); + else { + memset( namelist, 0, sizeof(namelist) ); + namelist[0].n_name = (char*)("_cp_time"); + if( kvm_nlist( kd, namelist ) != 0 ) { + kvm_close( kd ); + kd = NULL; + } + } + } else { + fprintf( stderr, "can't setegid(2), I'm not a setgid exec ?\n" ); + kd = NULL; + } +#else for (int i(0); i < taskBarCPUSamples; i++) { cpu[i][IWM_USER] = cpu[i][IWM_NICE] = cpu[i][IWM_SYS] = 0; cpu[i][IWM_IDLE] = 1; a266 33 setSize(taskBarCPUSamples, 20); last_cpu[IWM_USER] = last_cpu[IWM_NICE] = last_cpu[IWM_SYS] = last_cpu[IWM_IDLE] = 0; +#endif getStatus(); updateStatus(); updateToolTip(); @@@@ -70,6 +108,13 @@@@ delete color[IWM_NICE]; color[IWM_NICE] = 0; delete color[IWM_SYS]; color[IWM_SYS] = 0; delete color[IWM_IDLE]; color[IWM_IDLE] = 0; +#ifdef __FreeBSD__ + delete color[IWM_INTR]; color[IWM_INTR] = 0; + if( kd != NULL ) { + kvm_close( kd ); + kd = NULL; + } +#endif } void CPUStatus::paint(Graphics &g, const YRect &/*r*/) { @@@@ -80,13 +125,34 @@@@ int nice = cpu[i][IWM_NICE]; int sys = cpu[i][IWM_SYS]; int idle = cpu[i][IWM_IDLE]; +#ifdef __FreeBSD__ + int intr = cpu[i][IWM_INTR]; + int total = user + sys + intr + nice + idle; + int totald = total; +#else int total = user + sys + nice + idle; +#endif int y = height() - 1; a267 46 if (total > 0) { +#ifdef __FreeBSD__ + if (intr) { + totald -= intr; + n = (h * totald) / total; // check rounding + if (n >= y) n = y; + g.setColor(color[IWM_INTR]); + g.drawLine(i, y, i, n); + y = n - 1; + } +#endif if (sys) { +#ifdef __FreeBSD__ + totald -= nice; + n = (h * totald)/ total; +#else n = (h * (total - sys)) / total; // check rounding +#endif if (n >= y) n = y; g.setColor(color[IWM_SYS]); g.drawLine(i, y, i, n); @@@@ -102,7 +168,12 @@@@ } if (user) { +#ifdef __FreeBSD__ + totald -= user; + n = (h * totald)/ total; +#else n = (h * (total - sys - nice - user))/ total; +#endif if (n >= y) n = y; g.setColor(color[IWM_USER]); g.drawLine(i, y, i, n); @@@@ -152,6 +223,14 @@@@ sprintf(load, _("CPU Load: %3.2f %3.2f %3.2f, %d processes."), l1, l5, l15, sys.procs); setToolTip(load); +#elif defined(__FreeBSD__) + char load[31]; // enough for "CPU Load: 999.99 999.99 999.99\0" + double loadavg[3]; + if( kd != NULL && kvm_getloadavg( kd, loadavg, 3 ) != 3 ) + return; + snprintf(load, sizeof(load), "CPU Load: %3.2f %3.2f %3.2f", + loadavg[0], loadavg[1], loadavg[2]); + setToolTip(load); d269 4 a272 1 } a273 11 @@@@ -169,13 +248,43 @@@@ cpu[i - 1][IWM_NICE] = cpu[i][IWM_NICE]; cpu[i - 1][IWM_SYS] = cpu[i][IWM_SYS]; cpu[i - 1][IWM_IDLE] = cpu[i][IWM_IDLE]; +#ifdef __FreeBSD__ + cpu[i - 1][IWM_INTR] = cpu[i][IWM_INTR]; +#endif } getStatus(), repaint(); } d275 5 a279 109 void CPUStatus::getStatus() { -#ifdef linux +#ifdef __FreeBSD__ + + cpu[taskBarCPUSamples-1][IWM_USER] = 0; + cpu[taskBarCPUSamples-1][IWM_NICE] = 0; + cpu[taskBarCPUSamples-1][IWM_SYS] = 0; + cpu[taskBarCPUSamples-1][IWM_INTR] = 0; + cpu[taskBarCPUSamples-1][IWM_IDLE] = 0; + + if( kd == NULL ) return; + + long cp_time[CPUSTATES]; + int c = sizeof( cp_time ); + if (kvm_read(kd, namelist[0].n_value, &cp_time, c) != c) + return; + + long cur[IWM_STATES]; + cur[IWM_USER] = cp_time[CP_USER]; + cur[IWM_NICE] = cp_time[CP_NICE]; + cur[IWM_SYS] = cp_time[CP_SYS]; + cur[IWM_INTR] = cp_time[CP_INTR]; + cur[IWM_IDLE] = cp_time[CP_IDLE]; + + for (int i = 0; i < IWM_STATES; i++) { + cpu[taskBarCPUSamples-1][i] = cur[i] - last_cpu[i]; + last_cpu[i] = cur[i]; + } + +#elif defined(linux) char *p, buf[128]; long cur[IWM_STATES]; int len, fd = open("/proc/stat", O_RDONLY); @@@@ -209,8 +318,8 @@@@ cpu[taskBarCPUSamples-1][IWM_USER], cpu[taskBarCPUSamples-1][IWM_NICE], cpu[taskBarCPUSamples-1][IWM_SYS], cpu[taskBarCPUSamples-1][IDLE]); #endif -#endif /* linux */ -#ifdef HAVE_KSTAT_H + +#elif defined(HAVE_KSTAT_H) #ifdef HAVE_OLD_KSTAT #define ui32 ul #endif --- src/acpustatus.h.orig Sun Mar 9 04:37:52 2003 +++ src/acpustatus.h Sun Apr 13 12:02:47 2003 @@@@ -1,19 +1,29 @@@@ #ifndef __CPUSTATUS_H #define __CPUSTATUS_H -#if defined(linux) || defined(HAVE_KSTAT_H) +#if (defined(linux) || defined(HAVE_KSTAT_H)) || defined (__FreeBSD__) #ifdef HAVE_KSTAT_H #include #include #endif /* have_kstat_h */ +#ifdef __FreeBSD__ +#include +#include +#endif #define IWM_USER (0) #define IWM_NICE (1) #define IWM_SYS (2) +#ifdef __FreeBSD__ +#define IWM_INTR (3) +#define IWM_IDLE (4) +#define IWM_STATES (5) +#else #define IWM_IDLE (3) #define IWM_STATES (4) +#endif #include "ywindow.h" #include "ytimer.h" @@@@ -38,6 +48,10 @@@@ long last_cpu[IWM_STATES]; YColor *color[IWM_STATES]; YTimer *fUpdateTimer; +#ifdef __FreeBSD__ + struct nlist namelist[2]; + kvm_t *kd; +#endif }; #else #undef CONFIG_APPLET_CPU_STATUS --- src/default.h.orig Thu May 16 14:00:02 2002 +++ src/default.h Tue May 28 04:44:02 2002 @@@@ -455,6 +455,7 @@@@ XSV(const char *, clrLabelText, "rgb:00/00/00") XSV(const char *, clrCpuUser, "rgb:00/FF/00") XSV(const char *, clrCpuSys, "rgb:FF/00/00") +XSV(const char *, clrCpuIntr, "rgb:FF/FF/00") XSV(const char *, clrCpuNice, "rgb:00/00/FF") XSV(const char *, clrCpuIdle, "rgb:00/00/00") XSV(const char *, clrNetSend, "rgb:FF/FF/00") @@@@ -837,6 +838,7 @@@@ #ifdef CONFIG_APPLET_CPU_STATUS OSV("ColorCPUStatusUser", &clrCpuUser, "User load on the CPU monitor"), OSV("ColorCPUStatusSystem", &clrCpuSys, "System load on the CPU monitor"), + OSV("ColorCPUStatusInterrupts", &clrCpuIntr, "Interrupts on the CPU monitor"), OSV("ColorCPUStatusNice", &clrCpuNice, "Nice load on the CPU monitor"), OSV("ColorCPUStatusIdle", &clrCpuIdle, "Idle (non) load on the CPU monitor, leave empty to force transparency"), #endif --- src/wmapp.cc.orig Sun Mar 9 04:37:52 2003 +++ src/wmapp.cc Sun Apr 13 00:09:19 2003 @@@@ -1503,6 +1503,9 @@@@ d288 6 a293 4 #ifndef NO_CONFIGURE --- src/wmclient.h.orig Tue Mar 26 14:29:05 2002 +++ src/wmclient.h Tue Mar 26 14:29:13 2002 @@@@ -5,6 +5,8 @@@@ d301 13 d315 1 a315 10 --- src/icetray.cc.orig 2003-09-30 16:18:18.000000000 +0200 +++ src/icetray.cc 2003-09-30 16:19:00.000000000 +0200 @@@@ -6,6 +6,7 @@@@ #include "base.h" #include "debug.h" +#include #include #include @ 1.3 log @upgrading package: icewm 1.2.10 -> 1.2.12 @ text @d416 10 @ 1.2 log @upgrading package: icewm 1.2.9 -> 1.2.10 @ text @a121 67 --- src/ylocale.cc.orig Tue Oct 9 23:54:04 2001 +++ src/ylocale.cc Wed Feb 20 17:32:28 2002 @@@@ -18,7 +18,9 @@@@ #ifdef CONFIG_I18N #include +#if __FreeBSD__ >= 5 #include +#endif #include #include #include @@@@ -31,6 +33,41 @@@@ YLocale * YLocale::locale(NULL); #endif +#ifdef CONFIG_I18N +#if __FreeBSD__ < 5 +#undef CONFIG_NL_CODESETS +#define CONFIG_NL_CODESETS 0 +char* icewm_nl_langinfo(void* item) { + char* mylocale = setlocale(LC_ALL, ""); + + if( mylocale == NULL || *mylocale == '\0' ) + return NULL; + + if( strncmp(mylocale, "ja", strlen("ja")) == 0 ) { + return strdup("EUC-JP"); + } if( strncmp(mylocale, "zh_TW", strlen("zh_TW")) == 0 ) { + return strdup("BIG5"); + } if( strncmp(mylocale, "ko", strlen("ko")) == 0 ) { + return strdup("EUC-KR"); + } if( strncmp(mylocale, "ru", strlen("ru")) == 0 ) { + return "KOI8-R"; + } if( strncmp(mylocale, "ro", strlen("ro")) == 0 ) { + return "ISO-8859-2"; + } if( strncmp(mylocale, "hr", strlen("hr")) == 0 ) { + return "ISO-8859-2"; + } if( strncmp(mylocale, "hu", strlen("hu")) == 0 ) { + return "ISO-8859-2"; + } if( strncmp(mylocale, "pl", strlen("pl")) == 0 ) { + return "ISO-8859-2"; + } if( strncmp(mylocale, "lt", strlen("lt")) == 0 ) { + return "ISO-8859-13"; + } + + return NULL; +} +#endif +#endif /* CONFIG_I18N */ + #ifndef CONFIG_I18N YLocale::YLocale(char const * ) { #else @@@@ -45,8 +82,12 @@@@ char const * codeset(""); int const codesetItems[] = { CONFIG_NL_CODESETS }; +#if __FreeBSD__ >= 5 for (int const * csi(codesetItems); *csi && NULL != (codeset = nl_langinfo(*csi)) && '\0' == *codeset; ++csi); +#else + codeset = icewm_nl_langinfo(NULL); +#endif if (NULL == codeset || '\0' == *codeset) { warn(_("Failed to determinate the current locale's codeset. " a415 12 --- src/decorate.cc.orig Mon Aug 11 20:22:16 2003 +++ src/decorate.cc Thu Aug 14 15:48:23 2003 @@@@ -293,7 +293,9 @@@@ ShapeBounding, 0, 0, None, ShapeSet); } #endif +#ifdef CONFIG_SHAPE setShape(); +#endif } void YFrameWindow::configure(const YRect &r, const bool resized) { @ 1.1 log @new package: icewm 1.2.9 (ICE Window Manager) @ text @d483 12 @