+2009-02-08
+ * Refactor top code, add top_time to sort by process cpu time (thanks
+ sohalt).
+
2008-12-20
* Add if_match object comparing strings, floats and ints
AC_ARG_ENABLE([nvidia],
AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
[want_nvidia="$enableval"], [want_nvidia=no])
-AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
if test x$want_nvidia = xyes; then
- AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
+ if test "x$want_x11" != "xyes"; then
+ # do nada
+ want_nvidia=no
+ else
+ AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
dnl ## am I Stupid ??
dnl ## it won't find the lib for some reason!?
- LIBS="$LIBS -lXNVCtrl"
- AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
+ LIBS="$LIBS -lXNVCtrl"
+ AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
+ fi
fi
+AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
dnl
dnl IMLIB2
{
struct text_object *obj;
+ /* for the OBJ_top* handler */
+ struct process **needed = 0;
+
#ifdef HAVE_ICONV
char buff_in[p_max_size];
buff_in[0] = 0;
iconv_converting = 0;
#endif
- /* for the OBJ_top* handler */
- struct process **needed;
-
p[0] = 0;
for (obj = root.next; obj && p_max_size > 0; obj = obj->next) {
* times, we have this special handler. */
break;
case OBJ_top:
- needed = cur->cpu;
+ if (!needed) needed = cur->cpu;
case OBJ_top_mem:
- needed = cur->memu;
+ if (!needed) needed = cur->memu;
case OBJ_top_time:
- needed = cur->time;
+ if (!needed) needed = cur->time;
{
char *timeval;
* ****************************************************************** */
void process_find_top(struct process **cpu, struct process **mem,
- struct process **time)
+ struct process **ptime)
{
struct sorted_process *spc_head = NULL, *spc_tail = NULL, *spc_cur = NULL;
struct sorted_process *spm_head = NULL, *spm_tail = NULL, *spm_cur = NULL;
if (top_mem)
sp_acopy(spm_head, mem, MAX_SP);
if (top_time)
- sp_acopy(spt_head, time, MAX_SP);
+ sp_acopy(spt_head, ptime, MAX_SP);
}