htop-2.1.0/0000755000175000001440000000000013235655643007475 500000000000000htop-2.1.0/LoadAverageMeter.h0000644000175000001440000000073013153324652012725 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_LoadAverageMeter #define HEADER_LoadAverageMeter /* htop - LoadAverageMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int LoadAverageMeter_attributes[]; extern int LoadMeter_attributes[]; extern MeterClass LoadAverageMeter_class; extern MeterClass LoadMeter_class; #endif htop-2.1.0/Hashtable.c0000644000175000001440000001030013233625355011441 00000000000000/* htop - Hashtable.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Hashtable.h" #include "XAlloc.h" #include #include /*{ #include typedef struct Hashtable_ Hashtable; typedef void(*Hashtable_PairFunction)(int, void*, void*); typedef struct HashtableItem { unsigned int key; void* value; struct HashtableItem* next; } HashtableItem; struct Hashtable_ { int size; HashtableItem** buckets; int items; bool owner; }; }*/ #ifdef DEBUG static bool Hashtable_isConsistent(Hashtable* this) { int items = 0; for (int i = 0; i < this->size; i++) { HashtableItem* bucket = this->buckets[i]; while (bucket) { items++; bucket = bucket->next; } } return items == this->items; } int Hashtable_count(Hashtable* this) { int items = 0; for (int i = 0; i < this->size; i++) { HashtableItem* bucket = this->buckets[i]; while (bucket) { items++; bucket = bucket->next; } } assert(items == this->items); return items; } #endif static HashtableItem* HashtableItem_new(unsigned int key, void* value) { HashtableItem* this; this = xMalloc(sizeof(HashtableItem)); this->key = key; this->value = value; this->next = NULL; return this; } Hashtable* Hashtable_new(int size, bool owner) { Hashtable* this; this = xMalloc(sizeof(Hashtable)); this->items = 0; this->size = size; this->buckets = (HashtableItem**) xCalloc(size, sizeof(HashtableItem*)); this->owner = owner; assert(Hashtable_isConsistent(this)); return this; } void Hashtable_delete(Hashtable* this) { assert(Hashtable_isConsistent(this)); for (int i = 0; i < this->size; i++) { HashtableItem* walk = this->buckets[i]; while (walk != NULL) { if (this->owner) free(walk->value); HashtableItem* savedWalk = walk; walk = savedWalk->next; free(savedWalk); } } free(this->buckets); free(this); } void Hashtable_put(Hashtable* this, unsigned int key, void* value) { unsigned int index = key % this->size; HashtableItem** bucketPtr = &(this->buckets[index]); while (true) if (*bucketPtr == NULL) { *bucketPtr = HashtableItem_new(key, value); this->items++; break; } else if ((*bucketPtr)->key == key) { if (this->owner) free((*bucketPtr)->value); (*bucketPtr)->value = value; break; } else bucketPtr = &((*bucketPtr)->next); assert(Hashtable_isConsistent(this)); } void* Hashtable_remove(Hashtable* this, unsigned int key) { unsigned int index = key % this->size; assert(Hashtable_isConsistent(this)); HashtableItem** bucket; for (bucket = &(this->buckets[index]); *bucket; bucket = &((*bucket)->next) ) { if ((*bucket)->key == key) { void* value = (*bucket)->value; HashtableItem* next = (*bucket)->next; free(*bucket); (*bucket) = next; this->items--; if (this->owner) { free(value); assert(Hashtable_isConsistent(this)); return NULL; } else { assert(Hashtable_isConsistent(this)); return value; } } } assert(Hashtable_isConsistent(this)); return NULL; } inline void* Hashtable_get(Hashtable* this, unsigned int key) { unsigned int index = key % this->size; HashtableItem* bucketPtr = this->buckets[index]; while (true) { if (bucketPtr == NULL) { assert(Hashtable_isConsistent(this)); return NULL; } else if (bucketPtr->key == key) { assert(Hashtable_isConsistent(this)); return bucketPtr->value; } else bucketPtr = bucketPtr->next; } } void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData) { assert(Hashtable_isConsistent(this)); for (int i = 0; i < this->size; i++) { HashtableItem* walk = this->buckets[i]; while (walk != NULL) { f(walk->key, walk->value, userData); walk = walk->next; } } assert(Hashtable_isConsistent(this)); } htop-2.1.0/ChangeLog0000644000175000001440000004660713235655556011207 00000000000000 What's new in version 2.1.0 * Linux: Delay accounting metrics (thanks to André Carvalho) * DragonFlyBSD support (thanks to Diederik de Groot) * Support for real-time signals (thanks to Kang-Che Sung) * 'c' key now works with threads as well * Session column renamed from SESN to SID (thanks to Kamyar Rasta) * Improved UI for meter style selection (thanks to Kang-Che Sung) * Improved code for constructing process tree (thanks to wangqr) * Compile-time option to disable setuid * Error checking of various standard library operations * Replacement of sprintf with snprintf (thanks to Tomasz Kramkowski) * Linux: performance improvements in battery meter * Linux: update process TTY device * Linux: add support for sorting TASK_IDLE (thanks to Vladimir Panteleev) * Linux: add upper-bound to running process counter (thanks to Lucas Correia Villa Real) * BUGFIX: avoid crash when battery is removed (thanks to Jan Chren) * BUGFIX: macOS: fix infinite loop in tree view (thanks to Wataru Ashihara) What's new in version 2.0.2 * Mac OS X: stop trying when task_for_pid fails for a process, stops spamming logs with errors. * Add Ctrl+A and Ctrl+E to go to beginning and end of line * FreeBSD: fixes for CPU calculation (thanks to Tim Creech, Andy Pilate) * Usability: auto-follow process after a search. * Use Linux backend on GNU Hurd * Improvement for reproducible builds. * BUGFIX: Fix behavior of Alt-key combinations (thanks to Kang-Che Sung) * Various code tweaks and cleanups (thanks to Kang-Che Sung) What's new in version 2.0.1 * OpenBSD: Various fixes and improvements (thanks to Michael McConville and Juan Francisco Cantero Hurtado) * FreeBSD: fix CPU and memory readings (thanks to Tim Creech, Hung-Yi Chen, Bernard Spil, Greg V) * FreeBSD: add battery support (thanks to Greg V) * Linux: Retain last-obtained name of a zombie process * Mac OS X: Improve portability for OS X versions (thanks to Michael Klein) * Mac OS X: Fix reading command-line arguments and basename * Mac OS X: Fix process state information * Mac OS X: Fix tree view collapsing/expanding * Mac OS X: Fix tree organization * Mac OS X: Fix memory accounting * Fix crash when emptying a column of meters * Make Esc key more responsive What's new in version 2.0.0 * Platform abstraction layer * Initial FreeBSD support * Initial Mac OS X support (thanks to David Hunt) * Swap meter for Mac OSX (thanks to Ștefan Rusu) * OpenBSD port (thanks to Michael McConville) * FreeBSD support improvements (thanks to Martin Misuth) * Support for NCurses 6 ABI, including mouse wheel support * Much improved mouse responsiveness * Process environment variables screen (thanks to Michael Klein) * Higher-resolution UTF-8 based Graph mode (Thanks to James Hall from vtop for the idea!) * Show program path settings (thanks to Tobias Geerinckx-Rice) * BUGFIX: Fix crash when scrolling an empty filtered list. * Use dynamic units for text display, and several fixes (thanks to Christian Hesse) * BUGFIX: fix error caused by overflow in usertime calculation. (thanks to Patrick Marlier) * Catch all memory allocation errors (thanks to Michael McConville for the push) * Several tweaks and bugfixes (See the Git log for details and contributors!) What's new in version 1.0.3 * Tag all children ('c' key) * Fixes in accounting of guest time when using virtualization (thanks to Patrick Marlier) * Performance improvements (thanks to Jann Horn) * Further performance improvements due to conditional parsing of IO data depending on selected fields. * Better consistency in coloring. * Increase limit of buffer when tracing a deep nested process tree. * Display pagefault stats. * BUGFIX: Fix crash when adding meters and toggling detailed CPU time. (thanks to Dawid Gajownik) * Add column to track the OOM-killer score of processes (thanks to Leigh Simpson) What's new in version 1.0.2 * Add IO priority support ('i' key) * Avoid deleting .htoprc if it is a symlink * Fail gracefully when /proc is not mounted (thanks to Philipp Hagemeister) * Option to update process names on every refresh (thanks to Rob Hoelz) * BUGFIX: Fix crashes when process list is empty What's new in version 1.0.1 * Move .htoprc to XDG-compliant path ~/.config/htop/htoprc, respecting $XDG_CONFIG_HOME (thanks to Hadzhimurad Ustarkhan for the suggestion.) * Safer behavior on the kill screen, to make it harder to kill the wrong process. * Fix for building in FreeBSD 8.2 (thanks to Trond Endrestol) * BUGFIX: behavior of 'F' (follow) key was broken, also affecting the persistence of mouse selections. * BUGFIX: keep main panel up-to-date when running the screen manager, to fix crash when processes die while on the F9/Kill screen. What's new in version 1.0 * Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels. * Support for UTF-8 tree drawing (thanks to Bin Guo) * Option for counting CPUs from zero (thanks to Sean Noonan) * Meters update in every screen (no longer halting while on Setup, etc.) * Stricter checks for command-line options (thanks to Sebastian Pipping) * Incremental filtering (thanks to Seth Heeren for the idea and initial implementation) * Try harder to find the ncurses header (thanks to Moritz Barsnick) * Man page updates (thanks to Vincent Launchbury) * BUGFIX: Support larger numbers for process times. (thanks to Tristan Nakagawa for the report.) * BUGFIX: Segfault in BarMeterMode_draw() for small terminal widths (patch by Sebastian Pipping) What's new in version 0.9 * Add support for "steal"/guest CPU time measurement in virtualization environments * Expand and collapse subtrees using '+' and '-' when in tree-view * Support for cgroups (thanks to Guillaume Zitta and Daniel Lezcano) * Show custom thread names (thanks to Anders Torger) * Add support for STARTTIME field * Upgrade PLPA to version 1.3.2 * Fix license terms with regard to PLPA (thanks to Tom Callaway) * getopt-based long options and --no-color (thanks to Vincent Launchbury) * BUGFIX: Fix display of nan% in CPU meters (thanks to Steven Hampson) * BUGFIX: Fix memory leak (thanks to Pavol Rusnak) * Add Bash/emacs style navigation keys (thanks to Daniel Schuler) * Improve battery meter support (thanks to Richard W.) * BUGFIX: Fix IO-wait color in "Black on White" scheme * BUGFIX: Fix search by process name when list is filtered by user. (thanks to Sergej Pupykin for the report.) * BUGFIX: Fix alignment for display of memory values above 100G (sign of the times!) (thanks to Jan van Haarst for the report.) What's new in version 0.8.3 * BUGFIX: Fix crash on F6 key (thanks to Rainer Suhm) * BUGFIX: Fix a minor bug which affected the build process. What's new in version 0.8.2 * Integrated lsof (press 'l') * Fix display of gigabyte-sized values (thanks to Andika Triwidada) * Option to display hostname in the meters area * Rename VEID to CTID in OpenVZ systems (thanks to Thorsten Schifferdecker) * Corrections to the desktop entry file (thanks by Samuli Suominen) * BUGFIX: Correct page size calculation for FreeBSD systems (thanks to Andrew Paulsen) * Allow compilation without PLPA on systems that don't support it (thanks to Timothy Redaelli) * BUGFIX: Fix missing tree view when userland threads are hidden (thanks to Josh Stone) * BUGFIX: Fix for VPID on OpenVZ systems (thanks to Wolfgang Frisch) What's new in version 0.8.1 * Linux-VServer support (thanks to Jonathan Sambrook and Benedikt Bohm) * Battery meter (thanks to Ian Page Hands) * BUGFIX: Fix collection of IO stats in multithreaded processes (thanks to Gerhard Heift) * Remove assertion that fails on hardened kernels (thanks to Wolfram Schlich for the report) What's new in version 0.8 * Ability to change sort column with the mouse by clicking column titles (click again to invert order) * Add support for Linux per-process IO statistics, enabled with the --enable-taskstats flag, which requires a kernel compiled with taskstats support. (thanks to Tobias Oetiker) * Add Unicode support, enabled with the --enable-unicode flag, which requires libncursesw. (thanks to Sergej Pupykin) * BUGFIX: Fix display of CPU count for threaded processes. When user threads are hidden, process now shows the sum of processor usage for all processors. When user threads are displayed, each thread shows its own processor usage, including the root thread. (thanks to Bert Wesarg for the report) * BUGFIX: avoid crashing when using many meters (thanks to David Cho for the report) What's new in version 0.7 * CPU affinity configuration ('a' key) * Improve display of tree view, properly nesting threads of the same app based on TGID. * IO-wait time now counts as idle time, which is a more accurate description. It is still available in split time, now called detailed CPU time. (thanks to Samuel Thibault for the report) * BUGFIX: Correct display of TPGID field * Add TGID field * BUGFIX: Don't crash with invalid command-line flags (thanks to Nico Golde for the report) * Fix GCC 4.3 compilation issues (thanks to Martin Michlmayr for the report) * OpenVZ support, enabled at compile-time with the --enable-openvz flag. (thanks to Sergey Lychko) What's new in version 0.6.6 * Add support of NLWP field (thanks to Bert Wesarg) * BUGFIX: Fix use of configurable /proc location (thanks to Florent Thoumie) * Fix memory percentage calculation and make it saner (thanks to Olev Kartau for the report) * Added display of DRS, DT, LRS and TRS (thanks to Matthias Lederhofer) * BUGFIX: LRS and DRS memory values were flipped (thanks to Matthias Lederhofer) * BUGFIX: Don't crash on very high UIDs (thanks to Egmont Koblinger) What's new in version 0.6.5 * Add hardened-debug flags for debugging with Hardened GCC * BUGFIX: Handle error condition when a directory vanishes from /proc * BUGFIX: Fix leak of process command line * BUGFIX: Collect orphaned items when arranging the tree view. (thanks to Wolfram Schlich for assistance with debugging) * Separate proc and memory debugging into separate #defines. * BUGFIX: Fix message when configure fails due to missing libraries (thanks to Jon) * BUGFIX: Don't truncate value when displaying a very large process (thanks to Bo Liu) What's new in version 0.6.4 * Add an option to split the display of kernel time in the CPU meter into system, IO-wait, IRQ and soft-IRQ. (thanks to Philipp Richter) * --sort-key flag in the command-line, overriding the saved setting in .htoprc for the session. (thanks to Rodolfo Borges) * BUGFIX: Fixed string overflow on uptime display. (thanks to Marc Cahalan) What's new in version 0.6.3 * Performance improvements: uses much less CPU than the previous release with the default setup. * Use 64-bit values when storing processor times to avoid overflow. * Memory consumption improvements, compensating storage of 64-bit values. * Internal change: rename TypedVector to Vector and ListBox (and related classes) to Panel. * Have configure actually fail when needed libraries or headers are not found. * Horizontally scroll in larger increments when on the Linux console because of slow update of unaccelerated fb * No longer untag processes after sending a signal (useful for when SIGTERM fails and one wants to try again with SIGKILL). All processes can be untagged at once with 'U'. (thanks to A. Costa for the suggestion) What's new in version 0.6.2 * BUGFIX: Fixed crash when using some .htoprc files from 0.6 (thanks to Wolfram Schlich and John Thomas for the reports) * BUGFIX: Ensure changes to color scheme are saved * BUGFIX: Make configure behave correctly with --with-proc * Minor addition to .desktop file. What's new in version 0.6.1 * New meter type: "All CPUs", which dynamically adjusts to the number of CPUs present in the machine. Note that because of this, older versions of htop may crash when using an .htoprc file modified my the newer version. * Accept --with-proc= in configure, to specify alternative procfs locations (making htop friendlier to the Linux compatibility layer in FreeBSD) * Included icon .desktop and desktop entry (thanks to Peter Hyman) * Added a check to make sure that a root-user htop closes when its parent non-root terminal is closed. (thanks to Ilya Evseev for the report) * BUGFIX: does not crash anymore when $HOME is not set (thanks to Henning Schild for the report) * Wait for strace child process to die properly. (thanks to Marcus Fritzsch) * Support $HTOPRC (thanks to Luis Limon) What's new in version 0.6 * Configuration of columns merged into the Setup screen * Integrated strace (press 's') (thanks to Marinho Barcellos for the help) * BUGFIX: some fixes, aided by Valgrind (thanks to Wolfram Schlich for the report) * BUGFIX: fixed bug when switching meter modes (thanks to Eduardo Righes for the report) * Show processes of a single user * "SortBy" function now menu-based * Improved mouse handling * ...and on top of that reduced memory consumption! What's new in version 0.5.4 * Color schemes * -d flag, to configure delay between updates. Note that the delay value is saved in ~/.htoprc. * BUGFIX: Update of meters was halting after help screen. (thanks to Matt Moore) * BUGFIX: No longer display incorrect information in first frame. * BUGFIX: Fix auto-detection of /proc/stat, correcting CPU usage information on multiprocessor systems. What's new in version 0.5.3 * Read new field "steal" on newer /proc/stat files * Auto-detects format of /proc/stat, to cope with patched 2.4 kernels which display 2.6-style information (most notably those on RHEL 3) (thanks to Fernando Dotta for the report) * Support $HOME_ETC initiative (see http://www.pld-linux.org/Docs/home-etc) (thanks to Roman Barczynski for the tip) * The configure script now tests for /proc, so that it fails early on unsupported platforms instead of during compilation/execution. * Made presentation of the function keys in the status bar consistent across views (thanks to David Mathog for the report) * Minor changes to make the codebase more friendly to possible future ports (thanks to Jari Aalto and David Mathog for the reports) What's new in version 0.5.2 * BUGFIX: Correct display of user field (thanks to Marcin Miroslaw for the report) * Keyboard support improvements (thanks to Aury Fink Filho for the report) What's new in version 0.5.1 * BUGFIX: Correctly displays NPTL threads from /proc//task subdirectories (thanks to Mike Pot for the report) * BUGFIX: Fixes key handling on Signals listbox (thanks to Ondrej Vlach) * Renicing no longer displays temporary illegal values (thanks to Ondrej Vlach) * 'Hide userland threads' feature for NPTL threads What's new in version 0.5 * Tree view * New column, TIME (user + system time, like in top, 'T' switches to "sort by time") * Major reorganization of the underlying code of the setup screen, to manage setup pages * New setup page: Display options * Hide kernel threads ('K' key) * Colorized memory numbers * Vastly improved support for monochromatic terminals * Shadow processes that do not belong to user ('U' key) * Header margin configuration accessible via setup screen * Visual feedback on failing incremental search * BUGFIX: fixed keyboard input issues on 64-bit machines * BUGFIX: hopefully fixed the incorrect values that show on status bars in some systems * BUGFIX: doesn't mess with fields list anymore when canceling after changing the number of items * Uptime meter no longer says "1 days" ;) What's new in version 0.4.1 * BUGFIX: compiles on 64-bit architectures again (thanks to Bartosz Fenski for the report) * BUGFIX: multi-processor support fixed on kernels 2.6 (thanks to Wolfram Schlich for the report) What's new in version 0.4 * Support for multiple processors! * Basic mouse support * Modular header based on configurable meters; supports 4 view modes: bar, text, LED, graph * Uptime, load average meters (thanks to Marc Calahan) * Meters setup screen; should eventually evolve into a general setup screen, with column setup, keybindings, etc. * Thread hiding toggleable (press 'T' to hide the nonstandard dotfiles in /proc) * BUGFIX: Do not flicker screen on column configuration screen * Clock and load average meters (thanks to Marc Calahan) * BUGFIX: numeric swap indicator was printing bogus value * BUGFIX: internal fixes on Panel widget * Clear the bottom line when exiting * Press "F3" during search to walk through the results * Improved navigation on column configuration screen * BUGFIX: fix segfault on kernels with restricted /proc enabled * BUGFIX: a few last-minute bugfixes in the setup UI (thanks to Gaspare Bruno for the reports) What's new in version 0.3.3 * Saves column and sorting configuration in ~/.htoprc * Displays "hidden" threads on RedHat 9 (Thanks to Leonardo Godinho) * BUGFIX: supports process names with spaces (Thanks to Marc Calahan) * BUGFIX: ...and parentheses :) * BUGFIX: long process names overflowed RichString (Thanks to Marc Calahan) What's new in version 0.3.2 * Performance and memory usage improvements, aided by gprof * BUGFIX: quite a few fixes, aided by Valgrind * Header preview on column configuration screen (Thanks to Marc Calahan) What's new in version 0.3.1 * BUGFIX: crash fixes related to process list handling (thanks to Marc Calahan) * Man page (thanks to Bartosz Fenski) * Tag processes with the space bar * Kill multiple process based on tag * BUGFIX: corrected processing order of updates in list * Screen refresh function on Ctrl-L * Large numbers are shown in MB/GB notation in order to fit screen (thanks to Marc Calahan) * Realtime priority is correctly displayed (thanks to Marc Calahan) * Preliminary support for configurable columns, with 'C' (thanks to Marc Calahan) -- not all columns display properly yet What's new in version 0.3 * BUGFIX: no dirt left on screen on horizontal scrolling * Signal selection on "kill" command * Color-coding for users, nice and process status * "Follow" function * Fully selectable sort order * Function bar on last line * Build system now uses autotools What's new in version 0.2.1 * Sorting by process or memory usage ('P' and 'M', like top) * Quicker default update (1.5 second, not yet configurable) * Now the order of the elements in the process list stay 'locked' for a while after you move the cursor to ease selecting a process * Corrected the installation instructions in README (Thanks to Jeremy Eglen) * Should now compile cleanly on Conectiva 9 and similar systems (Thanks to Adriano Frare for the report) * Friendlier Makefile * Help screen ('h') What's new in version 0.2 * Memory indicators in header now show used and total, in MB * Preliminary support for sorting (CPU% only) * Memory percentage field (resident memory / used memory) * BUGFIX: identified source of spurious crashes * Can search names containing numbers (Thanks to Rafael Jeffman) * Correctly calculates memory page size (Thanks to Rafael Jeffman) What's new in version 0.13 * Handles terminal resize * Display all user names (not only those in /etc/passwd) (Thanks to Julio Biason) What's new in version 0.12 * Support for 2.6 kernels * Uses terminal default colors as a background What's new in version 0.11 * BUGFIX: does not crash when UID is not in /etc/passwd What's new in version 0.1 * Everything! htop-2.1.0/Settings.h0000644000175000001440000000250213235653611011356 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Settings #define HEADER_Settings /* htop - Settings.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #define DEFAULT_DELAY 15 #include "Process.h" #include typedef struct { int len; char** names; int* modes; } MeterColumnSettings; typedef struct Settings_ { char* filename; MeterColumnSettings columns[2]; ProcessField* fields; int flags; int colorScheme; int delay; int cpuCount; int direction; ProcessField sortKey; bool countCPUsFromZero; bool detailedCPUTime; bool treeView; bool showProgramPath; bool hideThreads; bool shadowOtherUsers; bool showThreadNames; bool hideKernelThreads; bool hideUserlandThreads; bool highlightBaseName; bool highlightMegabytes; bool highlightThreads; bool updateProcessNames; bool accountGuestInCPUMeter; bool headerMargin; bool changed; } Settings; #ifndef Settings_cpuId #define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromZero ? (cpu) : (cpu)+1) #endif void Settings_delete(Settings* this); bool Settings_write(Settings* this); Settings* Settings_new(int cpuCount); void Settings_invertSortOrder(Settings* this); #endif htop-2.1.0/SwapMeter.h0000644000175000001440000000055513153324652011472 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_SwapMeter #define HEADER_SwapMeter /* htop - SwapMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int SwapMeter_attributes[]; extern MeterClass SwapMeter_class; #endif htop-2.1.0/StringUtils.h0000644000175000001440000000165413153324652012053 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_StringUtils #define HEADER_StringUtils /* htop - StringUtils.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include #define String_startsWith(s, match) (strncmp((s),(match),strlen(match)) == 0) #define String_contains_i(s1, s2) (strcasestr(s1, s2) != NULL) /* * String_startsWith gives better performance if strlen(match) can be computed * at compile time (e.g. when they are immutable string literals). :) */ char* String_cat(const char* s1, const char* s2); char* String_trim(const char* in); extern int String_eq(const char* s1, const char* s2); char** String_split(const char* s, char sep, int* n); void String_freeArray(char** s); char* String_getToken(const char* line, const unsigned short int numMatch); char* String_readLine(FILE* fd); #endif htop-2.1.0/ListItem.c0000644000175000001440000000366613235653611011317 00000000000000/* htop - ListItem.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ListItem.h" #include "CRT.h" #include "StringUtils.h" #include "RichString.h" #include #include #include /*{ #include "Object.h" typedef struct ListItem_ { Object super; char* value; int key; bool moving; } ListItem; }*/ static void ListItem_delete(Object* cast) { ListItem* this = (ListItem*)cast; free(this->value); free(this); } static void ListItem_display(Object* cast, RichString* out) { ListItem* const this = (ListItem*)cast; assert (this != NULL); /* int len = strlen(this->value)+1; char buffer[len+1]; xSnprintf(buffer, len, "%s", this->value); */ if (this->moving) { RichString_write(out, CRT_colors[DEFAULT_COLOR], #ifdef HAVE_LIBNCURSESW CRT_utf8 ? "↕ " : #endif "+ "); } else { RichString_prune(out); } RichString_append(out, CRT_colors[DEFAULT_COLOR], this->value/*buffer*/); } ObjectClass ListItem_class = { .display = ListItem_display, .delete = ListItem_delete, .compare = ListItem_compare }; ListItem* ListItem_new(const char* value, int key) { ListItem* this = AllocThis(ListItem); this->value = xStrdup(value); this->key = key; this->moving = false; return this; } void ListItem_append(ListItem* this, const char* text) { int oldLen = strlen(this->value); int textLen = strlen(text); int newLen = strlen(this->value) + textLen; this->value = xRealloc(this->value, newLen + 1); memcpy(this->value + oldLen, text, textLen); this->value[newLen] = '\0'; } const char* ListItem_getRef(ListItem* this) { return this->value; } long ListItem_compare(const void* cast1, const void* cast2) { ListItem* obj1 = (ListItem*) cast1; ListItem* obj2 = (ListItem*) cast2; return strcmp(obj1->value, obj2->value); } htop-2.1.0/AffinityPanel.c0000644000175000001440000000355513152362772012316 00000000000000/* htop - AffinityPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "AffinityPanel.h" #include "CRT.h" #include "CheckItem.h" #include #include /*{ #include "Panel.h" #include "Affinity.h" #include "ProcessList.h" #include "ListItem.h" }*/ static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { CheckItem* selected = (CheckItem*) Panel_getSelected(this); switch(ch) { case KEY_MOUSE: case KEY_RECLICK: case ' ': CheckItem_set(selected, ! (CheckItem_get(selected)) ); return HANDLED; case 0x0a: case 0x0d: case KEY_ENTER: return BREAK_LOOP; } return IGNORED; } PanelClass AffinityPanel_class = { .super = { .extends = Class(Panel), .delete = Panel_delete }, .eventHandler = AffinityPanel_eventHandler }; Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) { Panel* this = Panel_new(1, 1, 1, 1, true, Class(CheckItem), FunctionBar_newEnterEsc("Set ", "Cancel ")); Object_setClass(this, Class(AffinityPanel)); Panel_setHeader(this, "Use CPUs:"); int curCpu = 0; for (int i = 0; i < pl->cpuCount; i++) { char number[10]; xSnprintf(number, 9, "%d", Settings_cpuId(pl->settings, i)); bool mode; if (curCpu < affinity->used && affinity->cpus[curCpu] == i) { mode = true; curCpu++; } else { mode = false; } Panel_add(this, (Object*) CheckItem_newByVal(xStrdup(number), mode)); } return this; } Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl) { Affinity* affinity = Affinity_new(pl); int size = Panel_size(this); for (int i = 0; i < size; i++) { if (CheckItem_get((CheckItem*)Panel_get(this, i))) Affinity_add(affinity, i); } return affinity; } htop-2.1.0/EnvScreen.h0000644000175000001440000000063413153324652011451 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_EnvScreen #define HEADER_EnvScreen #include "InfoScreen.h" typedef struct EnvScreen_ { InfoScreen super; } EnvScreen; extern InfoScreenClass EnvScreen_class; EnvScreen* EnvScreen_new(Process* process); void EnvScreen_delete(Object* this); void EnvScreen_draw(InfoScreen* this); void EnvScreen_scan(InfoScreen* this); #endif htop-2.1.0/configure.ac0000644000175000001440000002675513235655551011720 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) AC_INIT([htop],[2.1.0],[hisham@gobolinux.org]) SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" year=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u "+%Y") AC_CONFIG_SRCDIR([htop.c]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # Required by hwloc scripts AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.11]) # Checks for programs. # ---------------------------------------------------------------------- AC_PROG_CC AM_PROG_CC_C_O # Required by hwloc scripts AC_USE_SYSTEM_EXTENSIONS # Checks for platform. # ---------------------------------------------------------------------- case "$target_os" in linux*|gnu*) my_htop_platform=linux ;; freebsd*|kfreebsd*) my_htop_platform=freebsd ;; openbsd*) my_htop_platform=openbsd ;; dragonfly*) my_htop_platform=dragonflybsd ;; darwin*) my_htop_platform=darwin ;; *) my_htop_platform=unsupported ;; esac # Checks for libraries. # ---------------------------------------------------------------------- AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"]) # Checks for header files. # ---------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[ missing_headers="$missing_headers $ac_header" ]) AC_CHECK_HEADERS([execinfo.h],[:],[:]) # Checks for typedefs, structures, and compiler characteristics. # ---------------------------------------------------------------------- AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_PID_T AC_TYPE_UID_T # Checks for library functions and compiler features. # ---------------------------------------------------------------------- AC_FUNC_CLOSEDIR_VOID AC_TYPE_SIGNAL AC_FUNC_STAT AC_CHECK_FUNCS([memmove strncasecmp strstr strdup]) save_cflags="${CFLAGS}" CFLAGS="${CFLAGS} -std=c99" AC_MSG_CHECKING([whether gcc -std=c99 option works]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[char *a; a = strdup("foo"); int i = 0; i++; // C99]])], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([htop is written in C99. A newer version of gcc is required.])]) CFLAGS="$save_cflags" save_cflags="${CFLAGS}" CFLAGS="$CFLAGS -Wextra" AC_MSG_CHECKING([if compiler supports -Wextra]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],[ wextra_flag=-Wextra AC_MSG_RESULT([yes]) ],[ wextra_flag= AC_MSG_RESULT([no]) ]) CFLAGS="$save_cflags" AC_SUBST(wextra_flag) # Checks for features and flags. # ---------------------------------------------------------------------- PROCDIR=/proc AC_ARG_ENABLE(proc, [AS_HELP_STRING([--enable-proc], [use Linux-compatible proc filesystem])], enable_proc="yes", enable_proc="no") if test "x$enable_proc" = xyes; then # An enabled proc assumes we're emulating Linux. my_htop_platform=linux AC_DEFINE(HAVE_PROC, 1, [Define if using a Linux-compatible proc filesystem.]) fi AC_ARG_WITH(proc, [AS_HELP_STRING([--with-proc=DIR], [Location of a Linux-compatible proc filesystem (default=/proc).])], if test -n "$withval"; then AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem]) PROCDIR="$withval" fi, AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem])) if test "x$cross_compiling" = xno; then if test "x$enable_proc" = xyes; then AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find $PROCDIR/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.)) AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find $PROCDIR/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.)) fi fi AC_ARG_ENABLE(openvz, [AS_HELP_STRING([--enable-openvz], [enable OpenVZ support])], ,enable_openvz="no") if test "x$enable_openvz" = xyes; then AC_DEFINE(HAVE_OPENVZ, 1, [Define if openvz support enabled.]) fi AC_ARG_ENABLE(cgroup, [AS_HELP_STRING([--enable-cgroup], [enable cgroups support])], ,enable_cgroup="no") if test "x$enable_cgroup" = xyes; then AC_DEFINE(HAVE_CGROUP, 1, [Define if cgroup support enabled.]) fi AC_ARG_ENABLE(vserver, [AS_HELP_STRING([--enable-vserver], [enable VServer support])], ,enable_vserver="no") if test "x$enable_vserver" = xyes; then AC_DEFINE(HAVE_VSERVER, 1, [Define if vserver support enabled.]) fi AC_ARG_ENABLE(ancient_vserver, [AS_HELP_STRING([--enable-ancient-vserver], [enable ancient VServer support (implies --enable-vserver)])], ,enable_ancient_vserver="no") if test "x$enable_ancient_vserver" = xyes; then AC_DEFINE(HAVE_VSERVER, 1, [Define if vserver support enabled.]) AC_DEFINE(HAVE_ANCIENT_VSERVER, 1, [Define if ancient vserver support enabled.]) fi AC_ARG_ENABLE(taskstats, [AS_HELP_STRING([--enable-taskstats], [enable per-task IO Stats (taskstats kernel sup required)])], ,enable_taskstats="yes") if test "x$enable_taskstats" = xyes; then AC_DEFINE(HAVE_TASKSTATS, 1, [Define if taskstats support enabled.]) fi # HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART) m4_define([HTOP_CHECK_SCRIPT], [ if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null) else htop_config_script=$([$4] --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" AC_CHECK_LIB([$1], [$2], [ AC_DEFINE([$3], 1, [The library is present.]) LIBS="$htop_config_script $LIBS " htop_script_success=yes ], []) LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then [$5] fi ]) # HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART) m4_define([HTOP_CHECK_LIB], [ AC_CHECK_LIB([$1], [$2], [ AC_DEFINE([$3], 1, [The library is present.]) LIBS="-l[$1] $LIBS " ], [$4]) ]) AC_ARG_ENABLE(unicode, [AS_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes") if test "x$enable_unicode" = xyes; then HTOP_CHECK_SCRIPT([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", HTOP_CHECK_SCRIPT([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", HTOP_CHECK_SCRIPT([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw5-config", HTOP_CHECK_SCRIPT([ncurses], [addnwstr], [HAVE_LIBNCURSESW], "ncurses5-config", HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW], missing_libraries="$missing_libraries libncursesw" AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.]) ))))))) AC_CHECK_HEADERS([ncursesw/curses.h],[:], [AC_CHECK_HEADERS([ncurses/ncurses.h],[:], [AC_CHECK_HEADERS([ncurses/curses.h],[:], [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])]) else HTOP_CHECK_SCRIPT([ncurses6], [refresh], [HAVE_LIBNCURSES], "ncurses6-config", HTOP_CHECK_SCRIPT([ncurses], [refresh], [HAVE_LIBNCURSES], "ncurses5-config", HTOP_CHECK_LIB([ncurses6], [refresh], [HAVE_LIBNCURSES], HTOP_CHECK_LIB([ncurses], [refresh], [HAVE_LIBNCURSES], missing_libraries="$missing_libraries libncurses" )))) AC_CHECK_HEADERS([curses.h],[:], [AC_CHECK_HEADERS([ncurses/curses.h],[:], [AC_CHECK_HEADERS([ncurses/ncurses.h],[:], [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])]) fi if test "$my_htop_platform" = "freebsd"; then AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"]) fi if test "$my_htop_platform" = "openbsd"; then AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"]) fi AC_ARG_ENABLE(linux_affinity, [AS_HELP_STRING([--enable-linux-affinity], [enable Linux sched_setaffinity and sched_getaffinity for affinity support, disables hwloc])], ,enable_linux_affinity="yes") if test "x$enable_linux_affinity" = xyes -a "x$cross_compiling" = xno; then AC_MSG_CHECKING([for usable sched_setaffinity]) AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #include #include static cpu_set_t cpuset; ]], [[ CPU_ZERO(&cpuset); sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); if (errno == ENOSYS) return 1; ]])], [AC_MSG_RESULT([yes])], [enable_linux_affinity=no AC_MSG_RESULT([no])]) fi if test "x$enable_linux_affinity" = xyes; then AC_DEFINE(HAVE_LINUX_AFFINITY, 1, [Define if Linux sched_setaffinity and sched_getaffinity are to be used.]) fi AC_ARG_ENABLE(hwloc, [AS_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, enable_hwloc="no") if test "x$enable_hwloc" = xyes then AC_CHECK_LIB([hwloc], [hwloc_get_proc_cpubind], [], [missing_libraries="$missing_libraries libhwloc"]) AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"]) fi AC_ARG_ENABLE(setuid, [AS_HELP_STRING([--enable-setuid], [enable setuid support for platforms that need it])],, enable_setuid="no") if test "x$enable_setuid" = xyes then AC_DEFINE(HAVE_SETUID_ENABLED, 1, [Define if setuid support should be enabled.]) fi AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable linux delay accounting])],, enable_delayacct="no") if test "x$enable_delayacct" = xyes then PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"]) PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"]) CFLAGS+=" $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" LIBS+=" $LIBNL3_LIBS $LIBNL3GENL_LIBS" AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.]) fi # Bail out on errors. # ---------------------------------------------------------------------- if test ! -z "$missing_libraries"; then AC_MSG_ERROR([missing libraries: $missing_libraries]) fi if test ! -z "$missing_headers"; then AC_MSG_ERROR([missing headers: $missing_headers]) fi AC_DEFINE_UNQUOTED(COPYRIGHT, "(C) 2004-$year Hisham Muhammad", [Copyright message.]) # We're done, let's go! # ---------------------------------------------------------------------- AM_CONDITIONAL([HTOP_LINUX], [test "$my_htop_platform" = linux]) AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd]) AM_CONDITIONAL([HTOP_DRAGONFLYBSD], [test "$my_htop_platform" = dragonflybsd]) AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd]) AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin]) AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported]) AC_SUBST(my_htop_platform) AC_CONFIG_FILES([Makefile htop.1]) AC_OUTPUT if test "$my_htop_platform" = "unsupported" then echo "" echo "****************************************************************" echo "WARNING! This platform is not currently supported by htop." echo "" echo "The code will build, but it will produce a dummy version of htop" echo "which shows no processes, using the files from the unsupported/" echo "directory. This is meant to be a skeleton, to be used as a" echo "starting point if you are porting htop to a new platform." echo "****************************************************************" echo "" fi htop-2.1.0/IncSet.c0000644000175000001440000001434713235653611010750 00000000000000/* htop - IncSet.c (C) 2005-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "IncSet.h" #include "StringUtils.h" #include "Panel.h" #include "ListItem.h" #include "CRT.h" #include #include /*{ #include "FunctionBar.h" #include "Panel.h" #include #define INCMODE_MAX 40 typedef enum { INC_SEARCH = 0, INC_FILTER = 1 } IncType; #define IncSet_filter(inc_) (inc_->filtering ? inc_->modes[INC_FILTER].buffer : NULL) typedef struct IncMode_ { char buffer[INCMODE_MAX+1]; int index; FunctionBar* bar; bool isFilter; } IncMode; typedef struct IncSet_ { IncMode modes[2]; IncMode* active; FunctionBar* defaultBar; bool filtering; bool found; } IncSet; typedef const char* (*IncMode_GetPanelValue)(Panel*, int); }*/ static void IncMode_reset(IncMode* mode) { mode->index = 0; mode->buffer[0] = 0; } static const char* const searchFunctions[] = {"Next ", "Cancel ", " Search: ", NULL}; static const char* const searchKeys[] = {"F3", "Esc", " "}; static int searchEvents[] = {KEY_F(3), 27, ERR}; static inline void IncMode_initSearch(IncMode* search) { memset(search, 0, sizeof(IncMode)); search->bar = FunctionBar_new(searchFunctions, searchKeys, searchEvents); search->isFilter = false; } static const char* const filterFunctions[] = {"Done ", "Clear ", " Filter: ", NULL}; static const char* const filterKeys[] = {"Enter", "Esc", " "}; static int filterEvents[] = {13, 27, ERR}; static inline void IncMode_initFilter(IncMode* filter) { memset(filter, 0, sizeof(IncMode)); filter->bar = FunctionBar_new(filterFunctions, filterKeys, filterEvents); filter->isFilter = true; } static inline void IncMode_done(IncMode* mode) { FunctionBar_delete(mode->bar); } IncSet* IncSet_new(FunctionBar* bar) { IncSet* this = xCalloc(1, sizeof(IncSet)); IncMode_initSearch(&(this->modes[INC_SEARCH])); IncMode_initFilter(&(this->modes[INC_FILTER])); this->active = NULL; this->filtering = false; this->defaultBar = bar; return this; } void IncSet_delete(IncSet* this) { IncMode_done(&(this->modes[0])); IncMode_done(&(this->modes[1])); free(this); } static void updateWeakPanel(IncSet* this, Panel* panel, Vector* lines) { Object* selected = Panel_getSelected(panel); Panel_prune(panel); if (this->filtering) { int n = 0; const char* incFilter = this->modes[INC_FILTER].buffer; for (int i = 0; i < Vector_size(lines); i++) { ListItem* line = (ListItem*)Vector_get(lines, i); if (String_contains_i(line->value, incFilter)) { Panel_add(panel, (Object*)line); if (selected == (Object*)line) Panel_setSelected(panel, n); n++; } } } else { for (int i = 0; i < Vector_size(lines); i++) { Object* line = Vector_get(lines, i); Panel_add(panel, line); if (selected == line) Panel_setSelected(panel, i); } } } static bool search(IncMode* mode, Panel* panel, IncMode_GetPanelValue getPanelValue) { int size = Panel_size(panel); bool found = false; for (int i = 0; i < size; i++) { if (String_contains_i(getPanelValue(panel, i), mode->buffer)) { Panel_setSelected(panel, i); found = true; break; } } if (found) FunctionBar_draw(mode->bar, mode->buffer); else FunctionBar_drawAttr(mode->bar, mode->buffer, CRT_colors[FAILED_SEARCH]); return found; } bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines) { if (ch == ERR) return true; IncMode* mode = this->active; int size = Panel_size(panel); bool filterChanged = false; bool doSearch = true; if (ch == KEY_F(3)) { if (size == 0) return true; int here = Panel_getSelectedIndex(panel); int i = here; for(;;) { i++; if (i == size) i = 0; if (i == here) break; if (String_contains_i(getPanelValue(panel, i), mode->buffer)) { Panel_setSelected(panel, i); break; } } doSearch = false; } else if (ch < 255 && isprint((char)ch)) { if (mode->index < INCMODE_MAX) { mode->buffer[mode->index] = ch; mode->index++; mode->buffer[mode->index] = 0; if (mode->isFilter) { filterChanged = true; if (mode->index == 1) this->filtering = true; } } } else if ((ch == KEY_BACKSPACE || ch == 127)) { if (mode->index > 0) { mode->index--; mode->buffer[mode->index] = 0; if (mode->isFilter) { filterChanged = true; if (mode->index == 0) { this->filtering = false; IncMode_reset(mode); } } } else { doSearch = false; } } else if (ch == KEY_RESIZE) { Panel_resize(panel, COLS, LINES-panel->y-1); } else { if (mode->isFilter) { filterChanged = true; if (ch == 27) { this->filtering = false; IncMode_reset(mode); } } else { IncMode_reset(mode); } this->active = NULL; Panel_setDefaultBar(panel); FunctionBar_draw(this->defaultBar, NULL); doSearch = false; } if (doSearch) { this->found = search(mode, panel, getPanelValue); } if (filterChanged && lines) { updateWeakPanel(this, panel, lines); } return filterChanged; } const char* IncSet_getListItemValue(Panel* panel, int i) { ListItem* l = (ListItem*) Panel_get(panel, i); if (l) return l->value; return ""; } void IncSet_activate(IncSet* this, IncType type, Panel* panel) { this->active = &(this->modes[type]); FunctionBar_draw(this->active->bar, this->active->buffer); panel->currentBar = this->active->bar; } void IncSet_drawBar(IncSet* this) { if (this->active) { FunctionBar_draw(this->active->bar, this->active->buffer); } else { FunctionBar_draw(this->defaultBar, NULL); } } int IncSet_synthesizeEvent(IncSet* this, int x) { if (this->active) { return FunctionBar_synthesizeEvent(this->active->bar, x); } else { return FunctionBar_synthesizeEvent(this->defaultBar, x); } } htop-2.1.0/install-sh0000755000175000001440000003452313235540777011431 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: htop-2.1.0/aclocal.m40000644000175000001440000014624713235655576011300 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR htop-2.1.0/BatteryMeter.c0000644000175000001440000000336613152362772012174 00000000000000/* htop - BatteryMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #include "BatteryMeter.h" #include "Battery.h" #include "ProcessList.h" #include "CRT.h" #include "StringUtils.h" #include "Platform.h" #include #include /*{ #include "Meter.h" typedef enum ACPresence_ { AC_ABSENT, AC_PRESENT, AC_ERROR } ACPresence; }*/ int BatteryMeter_attributes[] = { BATTERY }; static void BatteryMeter_updateValues(Meter * this, char *buffer, int len) { ACPresence isOnAC; double percent; Battery_getData(&percent, &isOnAC); if (percent == -1) { this->values[0] = 0; xSnprintf(buffer, len, "n/a"); return; } this->values[0] = percent; const char *onAcText, *onBatteryText, *unknownText; unknownText = "%.1f%%"; if (this->mode == TEXT_METERMODE) { onAcText = "%.1f%% (Running on A/C)"; onBatteryText = "%.1f%% (Running on battery)"; } else { onAcText = "%.1f%%(A/C)"; onBatteryText = "%.1f%%(bat)"; } if (isOnAC == AC_PRESENT) { xSnprintf(buffer, len, onAcText, percent); } else if (isOnAC == AC_ABSENT) { xSnprintf(buffer, len, onBatteryText, percent); } else { xSnprintf(buffer, len, unknownText, percent); } return; } MeterClass BatteryMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete }, .updateValues = BatteryMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 1, .total = 100.0, .attributes = BatteryMeter_attributes, .name = "Battery", .uiName = "Battery", .caption = "Battery: " }; htop-2.1.0/ProcessList.c0000644000175000001440000002606513235653611012035 00000000000000/* htop - ProcessList.c (C) 2004,2005 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "Platform.h" #include "CRT.h" #include "StringUtils.h" #include #include /*{ #include "Vector.h" #include "Hashtable.h" #include "UsersTable.h" #include "Panel.h" #include "Process.h" #include "Settings.h" #ifdef HAVE_LIBHWLOC #include #endif #ifndef MAX_NAME #define MAX_NAME 128 #endif #ifndef MAX_READ #define MAX_READ 2048 #endif typedef struct ProcessList_ { Settings* settings; Vector* processes; Vector* processes2; Hashtable* processTable; UsersTable* usersTable; Panel* panel; int following; uid_t userId; const char* incFilter; Hashtable* pidWhiteList; #ifdef HAVE_LIBHWLOC hwloc_topology_t topology; bool topologyOk; #endif int totalTasks; int runningTasks; int userlandThreads; int kernelThreads; unsigned long long int totalMem; unsigned long long int usedMem; unsigned long long int freeMem; unsigned long long int sharedMem; unsigned long long int buffersMem; unsigned long long int cachedMem; unsigned long long int totalSwap; unsigned long long int usedSwap; unsigned long long int freeSwap; int cpuCount; } ProcessList; ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* pl); void ProcessList_goThroughEntries(ProcessList* pl); }*/ ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { this->processes = Vector_new(klass, true, DEFAULT_SIZE); this->processTable = Hashtable_new(140, false); this->usersTable = usersTable; this->pidWhiteList = pidWhiteList; this->userId = userId; // tree-view auxiliary buffer this->processes2 = Vector_new(klass, true, DEFAULT_SIZE); // set later by platform-specific code this->cpuCount = 0; #ifdef HAVE_LIBHWLOC this->topologyOk = false; int topoErr = hwloc_topology_init(&this->topology); if (topoErr == 0) { topoErr = hwloc_topology_load(this->topology); } if (topoErr == 0) { this->topologyOk = true; } #endif this->following = -1; return this; } void ProcessList_done(ProcessList* this) { #ifdef HAVE_LIBHWLOC if (this->topologyOk) { hwloc_topology_destroy(this->topology); } #endif Hashtable_delete(this->processTable); Vector_delete(this->processes); Vector_delete(this->processes2); } void ProcessList_setPanel(ProcessList* this, Panel* panel) { this->panel = panel; } void ProcessList_printHeader(ProcessList* this, RichString* header) { RichString_prune(header); ProcessField* fields = this->settings->fields; for (int i = 0; fields[i]; i++) { const char* field = Process_fields[fields[i]].title; if (!field) field = "- "; if (!this->settings->treeView && this->settings->sortKey == fields[i]) RichString_append(header, CRT_colors[PANEL_SELECTION_FOCUS], field); else RichString_append(header, CRT_colors[PANEL_HEADER_FOCUS], field); } } void ProcessList_add(ProcessList* this, Process* p) { assert(Vector_indexOf(this->processes, p, Process_pidCompare) == -1); assert(Hashtable_get(this->processTable, p->pid) == NULL); Vector_add(this->processes, p); Hashtable_put(this->processTable, p->pid, p); assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1); assert(Hashtable_get(this->processTable, p->pid) != NULL); assert(Hashtable_count(this->processTable) == Vector_count(this->processes)); } void ProcessList_remove(ProcessList* this, Process* p) { assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1); assert(Hashtable_get(this->processTable, p->pid) != NULL); Process* pp = Hashtable_remove(this->processTable, p->pid); assert(pp == p); (void)pp; unsigned int pid = p->pid; int idx = Vector_indexOf(this->processes, p, Process_pidCompare); assert(idx != -1); if (idx >= 0) Vector_remove(this->processes, idx); assert(Hashtable_get(this->processTable, pid) == NULL); (void)pid; assert(Hashtable_count(this->processTable) == Vector_count(this->processes)); } Process* ProcessList_get(ProcessList* this, int idx) { return (Process*) (Vector_get(this->processes, idx)); } int ProcessList_size(ProcessList* this) { return (Vector_size(this->processes)); } static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int indent, int direction, bool show) { Vector* children = Vector_new(Class(Process), false, DEFAULT_SIZE); for (int i = Vector_size(this->processes) - 1; i >= 0; i--) { Process* process = (Process*) (Vector_get(this->processes, i)); if (process->show && Process_isChildOf(process, pid)) { process = (Process*) (Vector_take(this->processes, i)); Vector_add(children, process); } } int size = Vector_size(children); for (int i = 0; i < size; i++) { Process* process = (Process*) (Vector_get(children, i)); if (!show) process->show = false; int s = this->processes2->items; if (direction == 1) Vector_add(this->processes2, process); else Vector_insert(this->processes2, 0, process); assert(this->processes2->items == s+1); (void)s; int nextIndent = indent | (1 << level); ProcessList_buildTree(this, process->pid, level+1, (i < size - 1) ? nextIndent : indent, direction, show ? process->showChildren : false); if (i == size - 1) process->indent = -nextIndent; else process->indent = nextIndent; } Vector_delete(children); } void ProcessList_sort(ProcessList* this) { if (!this->settings->treeView) { Vector_insertionSort(this->processes); } else { // Save settings int direction = this->settings->direction; int sortKey = this->settings->sortKey; // Sort by PID this->settings->sortKey = PID; this->settings->direction = 1; Vector_quickSort(this->processes); // Restore settings this->settings->sortKey = sortKey; this->settings->direction = direction; int vsize = Vector_size(this->processes); // Find all processes whose parent is not visible int size; while ((size = Vector_size(this->processes))) { int i; for (i = 0; i < size; i++) { Process* process = (Process*)(Vector_get(this->processes, i)); // Immediately consume not shown processes if (!process->show) { process = (Process*)(Vector_take(this->processes, i)); process->indent = 0; Vector_add(this->processes2, process); ProcessList_buildTree(this, process->pid, 0, 0, direction, false); break; } pid_t ppid = process->tgid == process->pid ? process->ppid : process->tgid; // Bisect the process vector to find parent int l = 0, r = size; // If PID corresponds with PPID (e.g. "kernel_task" (PID:0, PPID:0) // on Mac OS X 10.11.6) cancel bisecting and regard this process as // root. if (process->pid == ppid) r = 0; while (l < r) { int c = (l + r) / 2; pid_t pid = ((Process*)(Vector_get(this->processes, c)))->pid; if (ppid == pid) { break; } else if (ppid < pid) { r = c; } else { l = c + 1; } } // If parent not found, then construct the tree with this root if (l >= r) { process = (Process*)(Vector_take(this->processes, i)); process->indent = 0; Vector_add(this->processes2, process); ProcessList_buildTree(this, process->pid, 0, 0, direction, process->showChildren); break; } } // There should be no loop in the process tree assert(i < size); } assert(Vector_size(this->processes2) == vsize); (void)vsize; assert(Vector_size(this->processes) == 0); // Swap listings around Vector* t = this->processes; this->processes = this->processes2; this->processes2 = t; } } ProcessField ProcessList_keyAt(ProcessList* this, int at) { int x = 0; ProcessField* fields = this->settings->fields; ProcessField field; for (int i = 0; (field = fields[i]); i++) { const char* title = Process_fields[field].title; if (!title) title = "- "; int len = strlen(title); if (at >= x && at <= x + len) { return field; } x += len; } return COMM; } void ProcessList_expandTree(ProcessList* this) { int size = Vector_size(this->processes); for (int i = 0; i < size; i++) { Process* process = (Process*) Vector_get(this->processes, i); process->showChildren = true; } } void ProcessList_rebuildPanel(ProcessList* this) { const char* incFilter = this->incFilter; int currPos = Panel_getSelectedIndex(this->panel); pid_t currPid = this->following != -1 ? this->following : 0; int currScrollV = this->panel->scrollV; Panel_prune(this->panel); int size = ProcessList_size(this); int idx = 0; for (int i = 0; i < size; i++) { bool hidden = false; Process* p = ProcessList_get(this, i); if ( (!p->show) || (this->userId != (uid_t) -1 && (p->st_uid != this->userId)) || (incFilter && !(String_contains_i(p->comm, incFilter))) || (this->pidWhiteList && !Hashtable_get(this->pidWhiteList, p->tgid)) ) hidden = true; if (!hidden) { Panel_set(this->panel, idx, (Object*)p); if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) { Panel_setSelected(this->panel, idx); this->panel->scrollV = currScrollV; } idx++; } } } Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor) { Process* proc = (Process*) Hashtable_get(this->processTable, pid); *preExisting = proc; if (proc) { assert(Vector_indexOf(this->processes, proc, Process_pidCompare) != -1); assert(proc->pid == pid); } else { proc = constructor(this->settings); assert(proc->comm == NULL); proc->pid = pid; } return proc; } void ProcessList_scan(ProcessList* this) { // mark all process as "dirty" for (int i = 0; i < Vector_size(this->processes); i++) { Process* p = (Process*) Vector_get(this->processes, i); p->updated = false; p->show = true; } this->totalTasks = 0; this->userlandThreads = 0; this->kernelThreads = 0; this->runningTasks = 0; ProcessList_goThroughEntries(this); for (int i = Vector_size(this->processes) - 1; i >= 0; i--) { Process* p = (Process*) Vector_get(this->processes, i); if (p->updated == false) ProcessList_remove(this, p); else p->updated = false; } } htop-2.1.0/ScreenManager.h0000644000175000001440000000235613235653611012277 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ScreenManager #define HEADER_ScreenManager /* htop - ScreenManager.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "FunctionBar.h" #include "Vector.h" #include "Header.h" #include "Settings.h" #include "Panel.h" typedef enum Orientation_ { VERTICAL, HORIZONTAL } Orientation; typedef struct ScreenManager_ { int x1; int y1; int x2; int y2; Orientation orientation; Vector* panels; int panelCount; const Header* header; const Settings* settings; bool owner; bool allowFocusChange; } ScreenManager; ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner); void ScreenManager_delete(ScreenManager* this); extern int ScreenManager_size(ScreenManager* this); void ScreenManager_add(ScreenManager* this, Panel* item, int size); Panel* ScreenManager_remove(ScreenManager* this, int idx); void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2); void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey); #endif htop-2.1.0/UptimeMeter.c0000644000175000001440000000272313235536357012025 00000000000000/* htop - UptimeMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "UptimeMeter.h" #include "Platform.h" #include "CRT.h" /*{ #include "Meter.h" }*/ int UptimeMeter_attributes[] = { UPTIME }; static void UptimeMeter_updateValues(Meter* this, char* buffer, int len) { int totalseconds = Platform_getUptime(); if (totalseconds == -1) { xSnprintf(buffer, len, "(unknown)"); return; } int seconds = totalseconds % 60; int minutes = (totalseconds/60) % 60; int hours = (totalseconds/3600) % 24; int days = (totalseconds/86400); this->values[0] = days; if (days > this->total) { this->total = days; } char daysbuf[32]; if (days > 100) { xSnprintf(daysbuf, sizeof(daysbuf), "%d days(!), ", days); } else if (days > 1) { xSnprintf(daysbuf, sizeof(daysbuf), "%d days, ", days); } else if (days == 1) { xSnprintf(daysbuf, sizeof(daysbuf), "1 day, "); } else { daysbuf[0] = '\0'; } xSnprintf(buffer, len, "%s%02d:%02d:%02d", daysbuf, hours, minutes, seconds); } MeterClass UptimeMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete }, .updateValues = UptimeMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 1, .total = 100.0, .attributes = UptimeMeter_attributes, .name = "Uptime", .uiName = "Uptime", .caption = "Uptime: " }; htop-2.1.0/IncSet.h0000644000175000001440000000231013235653611010740 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_IncSet #define HEADER_IncSet /* htop - IncSet.h (C) 2005-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "FunctionBar.h" #include "Panel.h" #include #define INCMODE_MAX 40 typedef enum { INC_SEARCH = 0, INC_FILTER = 1 } IncType; #define IncSet_filter(inc_) (inc_->filtering ? inc_->modes[INC_FILTER].buffer : NULL) typedef struct IncMode_ { char buffer[INCMODE_MAX+1]; int index; FunctionBar* bar; bool isFilter; } IncMode; typedef struct IncSet_ { IncMode modes[2]; IncMode* active; FunctionBar* defaultBar; bool filtering; bool found; } IncSet; typedef const char* (*IncMode_GetPanelValue)(Panel*, int); IncSet* IncSet_new(FunctionBar* bar); void IncSet_delete(IncSet* this); bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue getPanelValue, Vector* lines); const char* IncSet_getListItemValue(Panel* panel, int i); void IncSet_activate(IncSet* this, IncType type, Panel* panel); void IncSet_drawBar(IncSet* this); int IncSet_synthesizeEvent(IncSet* this, int x); #endif htop-2.1.0/AvailableColumnsPanel.h0000644000175000001440000000104213235624301013747 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_AvailableColumnsPanel #define HEADER_AvailableColumnsPanel /* htop - AvailableColumnsPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" typedef struct AvailableColumnsPanel_ { Panel super; Panel* columns; } AvailableColumnsPanel; extern PanelClass AvailableColumnsPanel_class; AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns); #endif htop-2.1.0/SignalsPanel.c0000644000175000001440000000273713152362772012146 00000000000000/* htop - SignalsPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "SignalsPanel.h" #include "Platform.h" #include "ListItem.h" #include "RichString.h" #include #include #include #include /*{ typedef struct SignalItem_ { const char* name; int number; } SignalItem; }*/ Panel* SignalsPanel_new() { Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem), FunctionBar_newEnterEsc("Send ", "Cancel ")); const int defaultSignal = SIGTERM; int defaultPosition = 15; unsigned int i; for (i = 0; i < Platform_numberOfSignals; i++) { Panel_set(this, i, (Object*) ListItem_new(Platform_signals[i].name, Platform_signals[i].number)); // signal 15 is not always the 15th signal in the table if (Platform_signals[i].number == defaultSignal) { defaultPosition = i; } } #if (defined(SIGRTMIN) && defined(SIGRTMAX)) if (SIGRTMAX - SIGRTMIN <= 100) { static char buf[15]; for (int sig = SIGRTMIN; sig <= SIGRTMAX; i++, sig++) { int n = sig - SIGRTMIN; xSnprintf(buf, 15, "%2d SIGRTMIN%-+3d", sig, n); if (n == 0) { buf[11] = '\0'; } Panel_set(this, i, (Object*) ListItem_new(buf, sig)); } } #endif Panel_setHeader(this, "Send signal:"); Panel_setSelected(this, defaultPosition); return this; } htop-2.1.0/NEWS0000644000175000001440000000020413152362772010104 00000000000000 See the commit history for news of the past. See the bug tracker for news of the future. Run the program for news of the present. htop-2.1.0/INSTALL0000644000175000001440000003661013235540777010455 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command `./configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. htop-2.1.0/TasksMeter.h0000644000175000001440000000056213153324652011643 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_TasksMeter #define HEADER_TasksMeter /* htop - TasksMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int TasksMeter_attributes[]; extern MeterClass TasksMeter_class; #endif htop-2.1.0/HostnameMeter.c0000644000175000001440000000142413152362772012331 00000000000000/* htop - HostnameMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "HostnameMeter.h" #include "CRT.h" #include /*{ #include "Meter.h" }*/ int HostnameMeter_attributes[] = { HOSTNAME }; static void HostnameMeter_updateValues(Meter* this, char* buffer, int size) { (void) this; gethostname(buffer, size-1); } MeterClass HostnameMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete }, .updateValues = HostnameMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 0, .total = 100.0, .attributes = HostnameMeter_attributes, .name = "Hostname", .uiName = "Hostname", .caption = "Hostname: ", }; htop-2.1.0/htop.png0000644000175000001440000000711113152362772011071 00000000000000PNG  IHDR>abKGDf: pHYs  tIME9"j IDATx]K&j4?dq /LFfz ˲l!03e2X*QcPGM3tGD+ԩSN:uԩSN:\+ OK_Oy^<#L{s=@n]{i=?|]ݏ}_%1?_~Yay^u=U,ЕVҜP+}$]6XAuyn Y^jg\$ZFrWZ|ð-9.n]2xQ#I^h S-< %>욂,y2B5U`xHs˓vrsa҃6-Q/r`=úVJ/9!lK!YPX^Y&ug;&nn*أJ]>|@OP+6NUu;,4 "h5|PC!tXBجmKq^@Ph#RԊ-ĹfTU4>աЪCuzKo<5iߘ0Ҡet,,sĨܻN(TN0QhqJtSY`fO:4ujVMC̐ԟLi; o"k?s uF#]I+>8Ź ߚ t# r֡K'"ݞ0JmKt%f* ?w5=XkC΍#?B+1Tc\DRb>e @GbN&"oh|&3010y :u4>'{Hy';6-8n[ecH]ЏYL=;kr|7& QeDe>f]`nH!egU&?ŔQfH$ׅf:nѸ EBJ|i[ yiUIOF1uEHP^!,J}I01anJ`_*GAF>F1bpP-O!U@02N/8B2AzN&Y1Zln|.vLƻ8h"߃m[@T:׬s2(].;7G;ebUaD Mj'JcK9vҨ_Ssvje{rqgN&a(oӤM ?v‡9NMߛf^A' >|BߟŤD>RVN'+'88}OקNR*49Bo8׏Eҭnj۫ WN5?WMyBn(>Gz6̣j%.2p#{ sts }M&hC+W('~?:)tvmYm!tMZxm[ L8Zȳ`} F2#qղqBpFW۶zChׯaǚM Hz<ǿ~?k7/ɨ#3מԩSN:<S}_$N`'?G?f}.Kx?+5nv~R~yn}plY' p1c H$ qp;?9EXm`0To ?L$'Sg*SCp;?cf 8yU0#f 9up;?(Cx·& 'Ӯ >>uH&i8:?5{27/ 'Ch)d'qv~X]ֻ2-JN`燋x|v~8{ Gu3|4O)^p2'p;?-=lLH'Tqp;?z:4O`20O fsxaWp;? ~vb#p;?|GҳσeiCDAaLxYN` uAp;?g%/P@A8:?Xa\a8VP}o޶S(p;? ~48<&Ra8*?.jDeE < EN`<͙=@x4) 'j`` 0̥v~f.v!`4\eN.5 K745H8E..FN`'Rh' VL]n I Ljz+c,IXN`xsAM^թSN:u}qO)t|RDJn:{w'0j4\>iojԓ\TI4;.Z-@'Z>s֢%lo!%pC糿||>(ΌrH4s%u=Hg䳮)3/⫅ .H4-٠Joi8xH|Āf'jVp$8DH%hZ@8?MS)<}+Tt(pa+@$RHHr! y f}_$bR^G>ñSfA& K>ǣ]dp%p W%hֆpzdeM VcA@|u!&2Mp O J Pdnh0Gp4LjWYba8x @|G?pxc&oL4i8x<0>"@Eq7"q%,ǿ}@ (d| J݃<py8T90ǻ炥,e^,$/9HY| aV{ZÝ:uԩS+Gυ၃IENDB`htop-2.1.0/OpenFilesScreen.h0000644000175000001440000000172513153324652012607 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_OpenFilesScreen #define HEADER_OpenFilesScreen /* htop - OpenFilesScreen.h (C) 2005-2006 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "InfoScreen.h" typedef struct OpenFiles_Data_ { char* data[256]; } OpenFiles_Data; typedef struct OpenFiles_ProcessData_ { OpenFiles_Data data; int error; struct OpenFiles_FileData_* files; } OpenFiles_ProcessData; typedef struct OpenFiles_FileData_ { OpenFiles_Data data; struct OpenFiles_FileData_* next; } OpenFiles_FileData; typedef struct OpenFilesScreen_ { InfoScreen super; pid_t pid; } OpenFilesScreen; extern InfoScreenClass OpenFilesScreen_class; OpenFilesScreen* OpenFilesScreen_new(Process* process); void OpenFilesScreen_delete(Object* this); void OpenFilesScreen_draw(InfoScreen* this); void OpenFilesScreen_scan(InfoScreen* this); #endif htop-2.1.0/MemoryMeter.h0000644000175000001440000000056713153324652012033 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_MemoryMeter #define HEADER_MemoryMeter /* htop - MemoryMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int MemoryMeter_attributes[]; extern MeterClass MemoryMeter_class; #endif htop-2.1.0/ListItem.h0000644000175000001440000000121013235653611011303 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ListItem #define HEADER_ListItem /* htop - ListItem.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" typedef struct ListItem_ { Object super; char* value; int key; bool moving; } ListItem; extern ObjectClass ListItem_class; ListItem* ListItem_new(const char* value, int key); void ListItem_append(ListItem* this, const char* text); const char* ListItem_getRef(ListItem* this); long ListItem_compare(const void* cast1, const void* cast2); #endif htop-2.1.0/ColumnsPanel.h0000644000175000001440000000115113235653611012155 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ColumnsPanel #define HEADER_ColumnsPanel /* htop - ColumnsPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Settings.h" typedef struct ColumnsPanel_ { Panel super; Settings* settings; bool moving; } ColumnsPanel; extern PanelClass ColumnsPanel_class; ColumnsPanel* ColumnsPanel_new(Settings* settings); int ColumnsPanel_fieldNameToIndex(const char* name); void ColumnsPanel_update(Panel* super); #endif htop-2.1.0/UsersTable.h0000644000175000001440000000112213153324652011623 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_UsersTable #define HEADER_UsersTable /* htop - UsersTable.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Hashtable.h" typedef struct UsersTable_ { Hashtable* users; } UsersTable; UsersTable* UsersTable_new(); void UsersTable_delete(UsersTable* this); char* UsersTable_getRef(UsersTable* this, unsigned int uid); extern void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData); #endif htop-2.1.0/AvailableMetersPanel.c0000644000175000001440000001002613152362772013574 00000000000000/* htop - AvailableMetersPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "AvailableMetersPanel.h" #include "MetersPanel.h" #include "CPUMeter.h" #include "Header.h" #include "ListItem.h" #include "Platform.h" #include #include /*{ #include "Settings.h" #include "Panel.h" #include "ScreenManager.h" #include "ProcessList.h" typedef struct AvailableMetersPanel_ { Panel super; ScreenManager* scr; Settings* settings; Header* header; Panel* leftPanel; Panel* rightPanel; } AvailableMetersPanel; }*/ static void AvailableMetersPanel_delete(Object* object) { Panel* super = (Panel*) object; AvailableMetersPanel* this = (AvailableMetersPanel*) object; Panel_done(super); free(this); } static inline void AvailableMetersPanel_addMeter(Header* header, Panel* panel, MeterClass* type, int param, int column) { Meter* meter = (Meter*) Header_addMeterByClass(header, type, param, column); Panel_add(panel, (Object*) Meter_toListItem(meter, false)); Panel_setSelected(panel, Panel_size(panel) - 1); MetersPanel_setMoving((MetersPanel*)panel, true); FunctionBar_draw(panel->currentBar, NULL); } static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) { AvailableMetersPanel* this = (AvailableMetersPanel*) super; Header* header = this->header; ListItem* selected = (ListItem*) Panel_getSelected(super); int param = selected->key & 0xff; int type = selected->key >> 16; HandlerResult result = IGNORED; bool update = false; switch(ch) { case KEY_F(5): case 'l': case 'L': { AvailableMetersPanel_addMeter(header, this->leftPanel, Platform_meterTypes[type], param, 0); result = HANDLED; update = true; break; } case 0x0a: case 0x0d: case KEY_ENTER: case KEY_F(6): case 'r': case 'R': { AvailableMetersPanel_addMeter(header, this->rightPanel, Platform_meterTypes[type], param, 1); result = (KEY_LEFT << 16) | SYNTH_KEY; update = true; break; } } if (update) { this->settings->changed = true; Header_calculateHeight(header); Header_draw(header); ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); } return result; } PanelClass AvailableMetersPanel_class = { .super = { .extends = Class(Panel), .delete = AvailableMetersPanel_delete }, .eventHandler = AvailableMetersPanel_eventHandler }; AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl) { AvailableMetersPanel* this = AllocThis(AvailableMetersPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_newEnterEsc("Add ", "Done "); Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); this->settings = settings; this->header = header; this->leftPanel = leftMeters; this->rightPanel = rightMeters; this->scr = scr; Panel_setHeader(super, "Available meters"); // Platform_meterTypes[0] should be always (&CPUMeter_class), which we will // handle separately in the code below. for (int i = 1; Platform_meterTypes[i]; i++) { MeterClass* type = Platform_meterTypes[i]; assert(type != &CPUMeter_class); const char* label = type->description ? type->description : type->uiName; Panel_add(super, (Object*) ListItem_new(label, i << 16)); } // Handle (&CPUMeter_class) MeterClass* type = &CPUMeter_class; int cpus = pl->cpuCount; if (cpus > 1) { Panel_add(super, (Object*) ListItem_new("CPU average", 0)); for (int i = 1; i <= cpus; i++) { char buffer[50]; xSnprintf(buffer, 50, "%s %d", type->uiName, i); Panel_add(super, (Object*) ListItem_new(buffer, i)); } } else { Panel_add(super, (Object*) ListItem_new("CPU", 1)); } return this; } htop-2.1.0/dragonflybsd/0000755000175000001440000000000013235655643012153 500000000000000htop-2.1.0/dragonflybsd/DragonFlyBSDProcessList.c0000644000175000001440000004616513152362772016660 00000000000000/* htop - DragonFlyBSDProcessList.c (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "DragonFlyBSDProcessList.h" #include "DragonFlyBSDProcess.h" #include #include #include #include #include #include #include #include #include #include /*{ #include #include #include #include #include #include #include #include #include "Hashtable.h" #include "DragonFlyBSDProcess.h" #define JAIL_ERRMSGLEN 1024 char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; } CPUData; typedef struct DragonFlyBSDProcessList_ { ProcessList super; kvm_t* kd; unsigned long long int memWire; unsigned long long int memActive; unsigned long long int memInactive; unsigned long long int memFree; CPUData* cpus; unsigned long *cp_time_o; unsigned long *cp_time_n; unsigned long *cp_times_o; unsigned long *cp_times_n; Hashtable *jails; } DragonFlyBSDProcessList; }*/ #define _UNUSED_ __attribute__((unused)) static int MIB_hw_physmem[2]; static int MIB_vm_stats_vm_v_page_count[4]; static int pageSize; static int pageSizeKb; static int MIB_vm_stats_vm_v_wire_count[4]; static int MIB_vm_stats_vm_v_active_count[4]; static int MIB_vm_stats_vm_v_cache_count[4]; static int MIB_vm_stats_vm_v_inactive_count[4]; static int MIB_vm_stats_vm_v_free_count[4]; static int MIB_vfs_bufspace[2]; static int MIB_kern_cp_time[2]; static int MIB_kern_cp_times[2]; static int kernelFScale; ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { size_t len; char errbuf[_POSIX2_LINE_MAX]; DragonFlyBSDProcessList* dfpl = xCalloc(1, sizeof(DragonFlyBSDProcessList)); ProcessList* pl = (ProcessList*) dfpl; ProcessList_init(pl, Class(DragonFlyBSDProcess), usersTable, pidWhiteList, userId); // physical memory in system: hw.physmem // physical page size: hw.pagesize // usable pagesize : vm.stats.vm.v_page_size len = 2; sysctlnametomib("hw.physmem", MIB_hw_physmem, &len); len = sizeof(pageSize); if (sysctlbyname("vm.stats.vm.v_page_size", &pageSize, &len, NULL, 0) == -1) { pageSize = PAGE_SIZE; pageSizeKb = PAGE_SIZE_KB; } else { pageSizeKb = pageSize / ONE_K; } // usable page count vm.stats.vm.v_page_count // actually usable memory : vm.stats.vm.v_page_count * vm.stats.vm.v_page_size len = 4; sysctlnametomib("vm.stats.vm.v_page_count", MIB_vm_stats_vm_v_page_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_wire_count", MIB_vm_stats_vm_v_wire_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_active_count", MIB_vm_stats_vm_v_active_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_cache_count", MIB_vm_stats_vm_v_cache_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_inactive_count", MIB_vm_stats_vm_v_inactive_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_free_count", MIB_vm_stats_vm_v_free_count, &len); len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len); int cpus = 1; len = sizeof(cpus); if (sysctlbyname("hw.ncpu", &cpus, &len, NULL, 0) != 0) { cpus = 1; } size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len); dfpl->cp_time_o = xCalloc(cpus, sizeof_cp_time_array); dfpl->cp_time_n = xCalloc(cpus, sizeof_cp_time_array); len = sizeof_cp_time_array; // fetch initial single (or average) CPU clicks from kernel sysctl(MIB_kern_cp_time, 2, dfpl->cp_time_o, &len, NULL, 0); // on smp box, fetch rest of initial CPU's clicks if (cpus > 1) { len = 2; sysctlnametomib("kern.cp_times", MIB_kern_cp_times, &len); dfpl->cp_times_o = xCalloc(cpus, sizeof_cp_time_array); dfpl->cp_times_n = xCalloc(cpus, sizeof_cp_time_array); len = cpus * sizeof_cp_time_array; sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_o, &len, NULL, 0); } pl->cpuCount = MAX(cpus, 1); if (cpus == 1 ) { dfpl->cpus = xRealloc(dfpl->cpus, sizeof(CPUData)); } else { // on smp we need CPUs + 1 to store averages too (as kernel kindly provides that as well) dfpl->cpus = xRealloc(dfpl->cpus, (pl->cpuCount + 1) * sizeof(CPUData)); } len = sizeof(kernelFScale); if (sysctlbyname("kern.fscale", &kernelFScale, &len, NULL, 0) == -1) { //sane default for kernel provided CPU percentage scaling, at least on x86 machines, in case this sysctl call failed kernelFScale = 2048; } dfpl->kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, errbuf); if (dfpl->kd == NULL) { errx(1, "kvm_open: %s", errbuf); } return pl; } void ProcessList_delete(ProcessList* this) { const DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) this; if (dfpl->kd) kvm_close(dfpl->kd); if (dfpl->jails) { Hashtable_delete(dfpl->jails); } free(dfpl->cp_time_o); free(dfpl->cp_time_n); free(dfpl->cp_times_o); free(dfpl->cp_times_n); free(dfpl->cpus); ProcessList_done(this); free(this); } static inline void DragonFlyBSDProcessList_scanCPUTime(ProcessList* pl) { const DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) pl; int cpus = pl->cpuCount; // actual CPU count int maxcpu = cpus; // max iteration (in case we have average + smp) int cp_times_offset; assert(cpus > 0); size_t sizeof_cp_time_array; unsigned long *cp_time_n; // old clicks state unsigned long *cp_time_o; // current clicks state unsigned long cp_time_d[CPUSTATES]; double cp_time_p[CPUSTATES]; // get averages or single CPU clicks sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; sysctl(MIB_kern_cp_time, 2, dfpl->cp_time_n, &sizeof_cp_time_array, NULL, 0); // get rest of CPUs if (cpus > 1) { // on smp systems DragonFlyBSD kernel concats all CPU states into one long array in // kern.cp_times sysctl OID // we store averages in dfpl->cpus[0], and actual cores after that maxcpu = cpus + 1; sizeof_cp_time_array = cpus * sizeof(unsigned long) * CPUSTATES; sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_n, &sizeof_cp_time_array, NULL, 0); } for (int i = 0; i < maxcpu; i++) { if (cpus == 1) { // single CPU box cp_time_n = dfpl->cp_time_n; cp_time_o = dfpl->cp_time_o; } else { if (i == 0 ) { // average cp_time_n = dfpl->cp_time_n; cp_time_o = dfpl->cp_time_o; } else { // specific smp cores cp_times_offset = i - 1; cp_time_n = dfpl->cp_times_n + (cp_times_offset * CPUSTATES); cp_time_o = dfpl->cp_times_o + (cp_times_offset * CPUSTATES); } } // diff old vs new unsigned long long total_o = 0; unsigned long long total_n = 0; unsigned long long total_d = 0; for (int s = 0; s < CPUSTATES; s++) { cp_time_d[s] = cp_time_n[s] - cp_time_o[s]; total_o += cp_time_o[s]; total_n += cp_time_n[s]; } // totals total_d = total_n - total_o; if (total_d < 1 ) total_d = 1; // save current state as old and calc percentages for (int s = 0; s < CPUSTATES; ++s) { cp_time_o[s] = cp_time_n[s]; cp_time_p[s] = ((double)cp_time_d[s]) / ((double)total_d) * 100; } CPUData* cpuData = &(dfpl->cpus[i]); cpuData->userPercent = cp_time_p[CP_USER]; cpuData->nicePercent = cp_time_p[CP_NICE]; cpuData->systemPercent = cp_time_p[CP_SYS]; cpuData->irqPercent = cp_time_p[CP_INTR]; cpuData->systemAllPercent = cp_time_p[CP_SYS] + cp_time_p[CP_INTR]; // this one is not really used, but we store it anyway cpuData->idlePercent = cp_time_p[CP_IDLE]; } } static inline void DragonFlyBSDProcessList_scanMemoryInfo(ProcessList* pl) { DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) pl; // @etosan: // memory counter relationships seem to be these: // total = active + wired + inactive + cache + free // htop_used (unavail to anybody) = active + wired // htop_cache (for cache meter) = buffers + cache // user_free (avail to procs) = buffers + inactive + cache + free size_t len = sizeof(pl->totalMem); //disabled for now, as it is always smaller than phycal amount of memory... //...to avoid "where is my memory?" questions //sysctl(MIB_vm_stats_vm_v_page_count, 4, &(pl->totalMem), &len, NULL, 0); //pl->totalMem *= pageSizeKb; sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0); pl->totalMem /= 1024; sysctl(MIB_vm_stats_vm_v_active_count, 4, &(dfpl->memActive), &len, NULL, 0); dfpl->memActive *= pageSizeKb; sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(dfpl->memWire), &len, NULL, 0); dfpl->memWire *= pageSizeKb; sysctl(MIB_vfs_bufspace, 2, &(pl->buffersMem), &len, NULL, 0); pl->buffersMem /= 1024; sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0); pl->cachedMem *= pageSizeKb; pl->usedMem = dfpl->memActive + dfpl->memWire; //currently unused, same as with arc, custom meter perhaps //sysctl(MIB_vm_stats_vm_v_inactive_count, 4, &(dfpl->memInactive), &len, NULL, 0); //sysctl(MIB_vm_stats_vm_v_free_count, 4, &(dfpl->memFree), &len, NULL, 0); //pl->freeMem = dfpl->memInactive + dfpl->memFree; //pl->freeMem *= pageSizeKb; struct kvm_swap swap[16]; int nswap = kvm_getswapinfo(dfpl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0); pl->totalSwap = 0; pl->usedSwap = 0; for (int i = 0; i < nswap; i++) { pl->totalSwap += swap[i].ksw_total; pl->usedSwap += swap[i].ksw_used; } pl->totalSwap *= pageSizeKb; pl->usedSwap *= pageSizeKb; pl->sharedMem = 0; // currently unused } char* DragonFlyBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd) { char** argv = kvm_getargv(kd, kproc, 0); if (!argv) { return xStrdup(kproc->kp_comm); } int len = 0; for (int i = 0; argv[i]; i++) { len += strlen(argv[i]) + 1; } char* comm = xMalloc(len); char* at = comm; *basenameEnd = 0; for (int i = 0; argv[i]; i++) { at = stpcpy(at, argv[i]); if (!*basenameEnd) { *basenameEnd = at - comm; } *at = ' '; at++; } at--; *at = '\0'; return comm; } static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* dfpl) { size_t len; char *jls; /* Jail list */ char *curpos; char *nextpos; if (sysctlbyname("jail.list", NULL, &len, NULL, 0) == -1) { fprintf(stderr, "initial sysctlbyname / jail.list failed\n"); exit(3); } retry: if (len == 0) return; jls = xMalloc(len); if (jls == NULL) { fprintf(stderr, "xMalloc failed\n"); exit(4); } if (sysctlbyname("jail.list", jls, &len, NULL, 0) == -1) { if (errno == ENOMEM) { free(jls); goto retry; } fprintf(stderr, "sysctlbyname / jail.list failed\n"); exit(5); } if (dfpl->jails) { Hashtable_delete(dfpl->jails); } dfpl->jails = Hashtable_new(20, true); curpos = jls; while (curpos) { int jailid; char *str_hostname; nextpos = strchr(curpos, '\n'); if (nextpos) *nextpos++ = 0; jailid = atoi(strtok(curpos, " ")); str_hostname = strtok(NULL, " "); char *jname = (char *) (Hashtable_get(dfpl->jails, jailid)); if (jname == NULL) { jname = xStrdup(str_hostname); Hashtable_put(dfpl->jails, jailid, jname); } curpos = nextpos; } free(jls); } char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int jailid) { char* hostname; char* jname; if (jailid != 0 && dfpl->jails && (hostname = (char *)Hashtable_get(dfpl->jails, jailid))) { jname = xStrdup(hostname); } else { jname = xStrdup("-"); } return jname; } void ProcessList_goThroughEntries(ProcessList* this) { DragonFlyBSDProcessList* dfpl = (DragonFlyBSDProcessList*) this; Settings* settings = this->settings; bool hideKernelThreads = settings->hideKernelThreads; bool hideUserlandThreads = settings->hideUserlandThreads; DragonFlyBSDProcessList_scanMemoryInfo(this); DragonFlyBSDProcessList_scanCPUTime(this); DragonFlyBSDProcessList_scanJails(dfpl); int count = 0; // TODO Kernel Threads seem to be skipped, need to figure out the correct flag struct kinfo_proc* kprocs = kvm_getprocs(dfpl->kd, KERN_PROC_ALL | (!hideUserlandThreads ? KERN_PROC_FLAG_LWP : 0), 0, &count); for (int i = 0; i < count; i++) { struct kinfo_proc* kproc = &kprocs[i]; bool preExisting = false; bool _UNUSED_ isIdleProcess = false; // note: dragonflybsd kernel processes all have the same pid, so we misuse the kernel thread address to give them a unique identifier Process* proc = ProcessList_getProcess(this, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, (Process_New) DragonFlyBSDProcess_new); DragonFlyBSDProcess* dfp = (DragonFlyBSDProcess*) proc; proc->show = ! ((hideKernelThreads && Process_isKernelThread(dfp)) || (hideUserlandThreads && Process_isUserlandThread(proc))); if (!preExisting) { dfp->jid = kproc->kp_jailid; if (kproc->kp_ktaddr && kproc->kp_flags & P_SYSTEM) { // dfb kernel threads all have the same pid, so we misuse the kernel thread address to give them a unique identifier proc->pid = (pid_t)kproc->kp_ktaddr; dfp->kernel = 1; } else { proc->pid = kproc->kp_pid; // process ID dfp->kernel = 0; } proc->ppid = kproc->kp_ppid; // parent process id proc->tpgid = kproc->kp_tpgid; // tty process group id //proc->tgid = kproc->kp_lwp.kl_tid; // thread group id proc->tgid = kproc->kp_pid; // thread group id proc->pgrp = kproc->kp_pgid; // process group id proc->session = kproc->kp_sid; proc->tty_nr = kproc->kp_tdev; // control terminal device number proc->st_uid = kproc->kp_uid; // user ID proc->processor = kproc->kp_lwp.kl_origcpu; proc->starttime_ctime = kproc->kp_start.tv_sec; proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); ProcessList_add((ProcessList*)this, proc); proc->comm = DragonFlyBSDProcessList_readProcessName(dfpl->kd, kproc, &proc->basenameOffset); dfp->jname = DragonFlyBSDProcessList_readJailName(dfpl, kproc->kp_jailid); } else { proc->processor = kproc->kp_lwp.kl_cpuid; if(dfp->jid != kproc->kp_jailid) { // process can enter jail anytime dfp->jid = kproc->kp_jailid; free(dfp->jname); dfp->jname = DragonFlyBSDProcessList_readJailName(dfpl, kproc->kp_jailid); } if (proc->ppid != kproc->kp_ppid) { // if there are reapers in the system, process can get reparented anytime proc->ppid = kproc->kp_ppid; } if(proc->st_uid != kproc->kp_uid) { // some processes change users (eg. to lower privs) proc->st_uid = kproc->kp_uid; proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); } if (settings->updateProcessNames) { free(proc->comm); proc->comm = DragonFlyBSDProcessList_readProcessName(dfpl->kd, kproc, &proc->basenameOffset); } } proc->m_size = kproc->kp_vm_map_size / 1024 / pageSizeKb; proc->m_resident = kproc->kp_vm_rssize; proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0; proc->nlwp = kproc->kp_nthreads; // number of lwp thread proc->time = (kproc->kp_swtime + 5000) / 10000; proc->percent_cpu = 100.0 * ((double)kproc->kp_lwp.kl_pctcpu / (double)kernelFScale); proc->percent_mem = 100.0 * (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem); if (proc->percent_cpu > 0.1) { // system idle process should own all CPU time left regardless of CPU count if ( strcmp("idle", kproc->kp_comm) == 0 ) { isIdleProcess = true; } } if (kproc->kp_lwp.kl_pid != -1) proc->priority = kproc->kp_lwp.kl_prio; else proc->priority = -kproc->kp_lwp.kl_tdprio; switch(kproc->kp_lwp.kl_rtprio.type) { case RTP_PRIO_REALTIME: proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX + kproc->kp_lwp.kl_rtprio.prio; break; case RTP_PRIO_IDLE: proc->nice = PRIO_MAX + 1 + kproc->kp_lwp.kl_rtprio.prio; break; case RTP_PRIO_THREAD: proc->nice = PRIO_MIN - 1 - RTP_PRIO_MAX - kproc->kp_lwp.kl_rtprio.prio; break; default: proc->nice = kproc->kp_nice; break; } // would be nice if we could store multiple states in proc->state (as enum) and have writeField render them switch (kproc->kp_stat) { case SIDL: proc->state = 'I'; isIdleProcess = true; break; case SACTIVE: switch (kproc->kp_lwp.kl_stat) { case LSSLEEP: if (kproc->kp_lwp.kl_flags & LWP_SINTR) // interruptable wait short/long if (kproc->kp_lwp.kl_slptime >= MAXSLP) { proc->state = 'I'; isIdleProcess = true; } else { proc->state = 'S'; } else if (kproc->kp_lwp.kl_tdflags & TDF_SINTR) // interruptable lwkt wait proc->state = 'S'; else if (kproc->kp_paddr) // uninterruptable wait proc->state = 'D'; else // uninterruptable lwkt wait proc->state = 'B'; break; case LSRUN: if (kproc->kp_lwp.kl_stat == LSRUN) { if (!(kproc->kp_lwp.kl_tdflags & (TDF_RUNNING | TDF_RUNQ))) proc->state = 'Q'; else proc->state = 'R'; } break; case LSSTOP: proc->state = 'T'; break; default: proc->state = 'A'; break; } break; case SSTOP: proc->state = 'T'; break; case SZOMB: proc->state = 'Z'; break; case SCORE: proc->state = 'C'; break; default: proc->state = '?'; } if (kproc->kp_flags & P_SWAPPEDOUT) { proc->state = 'W'; } if (kproc->kp_flags & P_TRACED) { proc->state = 'T'; } if (kproc->kp_flags & P_JAILED) { proc->state = 'J'; } if (Process_isKernelThread(dfp)) { this->kernelThreads++; } this->totalTasks++; if (proc->state == 'R') this->runningTasks++; proc->updated = true; } } htop-2.1.0/dragonflybsd/Battery.h0000644000175000001440000000055013152362772013652 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery /* htop - dragonflybsd/Battery.h (C) 2015 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/dragonflybsd/DragonFlyBSDProcess.h0000644000175000001440000000254513152362772016023 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DragonFlyBSDProcess #define HEADER_DragonFlyBSDProcess /* htop - dragonflybsd/DragonFlyBSDProcess.h (C) 2015 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ typedef enum DragonFlyBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } DragonFlyBSDProcessField; typedef struct DragonFlyBSDProcess_ { Process super; int kernel; int jid; char* jname; } DragonFlyBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) #endif #ifndef Process_isUserlandThread //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->nlwp > 1) #endif extern ProcessClass DragonFlyBSDProcess_class; extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; DragonFlyBSDProcess* DragonFlyBSDProcess_new(Settings* settings); void Process_delete(Object* cast); void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField field); long DragonFlyBSDProcess_compare(const void* v1, const void* v2); bool Process_isThread(Process* this); #endif htop-2.1.0/dragonflybsd/DragonFlyBSDCRT.h0000644000175000001440000000061013152362772015024 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DragonFlyBSDCRT #define HEADER_DragonFlyBSDCRT /* htop - dragonflybsd/DragonFlyBSDCRT.h (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #ifdef HAVE_EXECINFO_H #endif void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/dragonflybsd/DragonFlyBSDProcess.c0000644000175000001440000001611413152362772016013 00000000000000/* htop - dragonflybsd/DragonFlyBSDProcess.c (C) 2015 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "ProcessList.h" #include "DragonFlyBSDProcess.h" #include "Platform.h" #include "CRT.h" #include #include #include #include /*{ typedef enum DragonFlyBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } DragonFlyBSDProcessField; typedef struct DragonFlyBSDProcess_ { Process super; int kernel; int jid; char* jname; } DragonFlyBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) #endif #ifndef Process_isUserlandThread //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->nlwp > 1) #endif }*/ ProcessClass DragonFlyBSDProcess_class = { .super = { .extends = Class(Process), .display = Process_display, .delete = Process_delete, .compare = DragonFlyBSDProcess_compare }, .writeField = (Process_WriteField) DragonFlyBSDProcess_writeField, }; ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping (<20s), I Idle, Q Queued for Run, R running, D disk, Z zombie, T traced, W paging, B Blocked, A AskedPage, C Core, J Jailed)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SID ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, [JID] = { .name = "JID", .title = " JID ", .description = "Jail prison ID", .flags = 0, }, [JAIL] = { .name = "JAIL", .title = "JAIL ", .description = "Jail prison name", .flags = 0, }, [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; ProcessPidColumn Process_pidColumns[] = { { .id = JID, .label = "JID" }, { .id = PID, .label = "PID" }, { .id = PPID, .label = "PPID" }, { .id = TPGID, .label = "TPGID" }, { .id = TGID, .label = "TGID" }, { .id = PGRP, .label = "PGRP" }, { .id = SESSION, .label = "SID" }, { .id = 0, .label = NULL }, }; DragonFlyBSDProcess* DragonFlyBSDProcess_new(Settings* settings) { DragonFlyBSDProcess* this = xCalloc(1, sizeof(DragonFlyBSDProcess)); Object_setClass(this, Class(DragonFlyBSDProcess)); Process_init(&this->super, settings); return this; } void Process_delete(Object* cast) { DragonFlyBSDProcess* this = (DragonFlyBSDProcess*) cast; Process_done((Process*)cast); free(this->jname); free(this); } void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { DragonFlyBSDProcess* fp = (DragonFlyBSDProcess*) this; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; int n = sizeof(buffer) - 1; switch ((int) field) { // add Platform-specific fields here case PID: xSnprintf(buffer, n, Process_pidFormat, (fp->kernel ? -1 : this->pid)); break; case JID: xSnprintf(buffer, n, Process_pidFormat, fp->jid); break; case JAIL:{ xSnprintf(buffer, n, "%-11s ", fp->jname); break; if (buffer[11] != '\0') { buffer[11] = ' '; buffer[12] = '\0'; } break; } default: Process_writeField(this, str, field); return; } RichString_append(str, attr, buffer); } long DragonFlyBSDProcess_compare(const void* v1, const void* v2) { DragonFlyBSDProcess *p1, *p2; Settings *settings = ((Process*)v1)->settings; if (settings->direction == 1) { p1 = (DragonFlyBSDProcess*)v1; p2 = (DragonFlyBSDProcess*)v2; } else { p2 = (DragonFlyBSDProcess*)v1; p1 = (DragonFlyBSDProcess*)v2; } switch ((int) settings->sortKey) { // add Platform-specific fields here case JID: return (p1->jid - p2->jid); case JAIL: return strcmp(p1->jname ? p1->jname : "", p2->jname ? p2->jname : ""); default: return Process_compare(v1, v2); } } bool Process_isThread(Process* this) { DragonFlyBSDProcess* fp = (DragonFlyBSDProcess*) this; if (fp->kernel == 1 ) return 1; else return (Process_isUserlandThread(this)); } htop-2.1.0/dragonflybsd/DragonFlyBSDCRT.c0000644000175000001440000000236113152362772015024 00000000000000/* htop - dragonflybsd/DragonFlyBSDCRT.c (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include #ifdef HAVE_EXECINFO_H #include #endif void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n"); #ifdef HAVE_EXECINFO_H size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); fprintf(stderr, "\n Please include in your report the following backtrace: \n"); backtrace_symbols_fd(backtraceArray, size, 2); fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); #else fprintf(stderr, "\nPlease contact your DragonFlyBSD package maintainer!\n\n"); #endif abort(); } htop-2.1.0/dragonflybsd/DragonFlyBSDProcessList.h0000644000175000001440000000320113152362772016645 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DragonFlyBSDProcessList #define HEADER_DragonFlyBSDProcessList /* htop - DragonFlyBSDProcessList.h (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include #include #include #include #include #include #include #include #include "Hashtable.h" #include "DragonFlyBSDProcess.h" #define JAIL_ERRMSGLEN 1024 char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; } CPUData; typedef struct DragonFlyBSDProcessList_ { ProcessList super; kvm_t* kd; unsigned long long int memWire; unsigned long long int memActive; unsigned long long int memInactive; unsigned long long int memFree; CPUData* cpus; unsigned long *cp_time_o; unsigned long *cp_time_n; unsigned long *cp_times_o; unsigned long *cp_times_n; Hashtable *jails; } DragonFlyBSDProcessList; #define _UNUSED_ __attribute__((unused)) ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); char* DragonFlyBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int jailid); void ProcessList_goThroughEntries(ProcessList* this); #endif htop-2.1.0/dragonflybsd/Battery.c0000644000175000001440000000126313152362772013647 00000000000000/* htop - dragonflybsd/Battery.c (C) 2015 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "BatteryMeter.h" #include void Battery_getData(double* level, ACPresence* isOnAC) { int life; size_t life_len = sizeof(life); if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) *level = -1; else *level = life; int acline; size_t acline_len = sizeof(acline); if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) *isOnAC = AC_ERROR; else *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; } htop-2.1.0/dragonflybsd/Platform.h0000644000175000001440000000217013152362772014024 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - dragonflybsd/Platform.h (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); void Platform_setSwapValues(Meter* this); void Platform_setTasksValues(Meter* this); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/dragonflybsd/Platform.c0000644000175000001440000001334113204565055014016 00000000000000/* htop - dragonflybsd/Platform.c (C) 2014 Hisham H. Muhammad (C) 2017 Diederik de Groot Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "Meter.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "UptimeMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "DragonFlyBSDProcess.h" #include "DragonFlyBSDProcessList.h" #include #include #include #include #include #include #include /*{ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; }*/ #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; int Platform_numberOfFields = LAST_PROCESSFIELD; const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, { .name = " 2 SIGINT", .number = 2 }, { .name = " 3 SIGQUIT", .number = 3 }, { .name = " 4 SIGILL", .number = 4 }, { .name = " 5 SIGTRAP", .number = 5 }, { .name = " 6 SIGABRT", .number = 6 }, { .name = " 7 SIGEMT", .number = 7 }, { .name = " 8 SIGFPE", .number = 8 }, { .name = " 9 SIGKILL", .number = 9 }, { .name = "10 SIGBUS", .number = 10 }, { .name = "11 SIGSEGV", .number = 11 }, { .name = "12 SIGSYS", .number = 12 }, { .name = "13 SIGPIPE", .number = 13 }, { .name = "14 SIGALRM", .number = 14 }, { .name = "15 SIGTERM", .number = 15 }, { .name = "16 SIGURG", .number = 16 }, { .name = "17 SIGSTOP", .number = 17 }, { .name = "18 SIGTSTP", .number = 18 }, { .name = "19 SIGCONT", .number = 19 }, { .name = "20 SIGCHLD", .number = 20 }, { .name = "21 SIGTTIN", .number = 21 }, { .name = "22 SIGTTOU", .number = 22 }, { .name = "23 SIGIO", .number = 23 }, { .name = "24 SIGXCPU", .number = 24 }, { .name = "25 SIGXFSZ", .number = 25 }, { .name = "26 SIGVTALRM", .number = 26 }, { .name = "27 SIGPROF", .number = 27 }, { .name = "28 SIGWINCH", .number = 28 }, { .name = "29 SIGINFO", .number = 29 }, { .name = "30 SIGUSR1", .number = 30 }, { .name = "31 SIGUSR2", .number = 31 }, { .name = "32 SIGTHR", .number = 32 }, { .name = "33 SIGLIBRT", .number = 33 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); void Platform_setBindings(Htop_Action* keys) { (void) keys; } MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &UptimeMeter_class, &BatteryMeter_class, &HostnameMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; int Platform_getUptime() { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); if (err) { return -1; } gettimeofday(&currTime, NULL); return (int) difftime(currTime.tv_sec, bootTime.tv_sec); } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { struct loadavg loadAverage; int mib[2] = { CTL_VM, VM_LOADAVG }; size_t size = sizeof(loadAverage); int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); if (err) { *one = 0; *five = 0; *fifteen = 0; return; } *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } int Platform_getMaxPid() { int maxPid; size_t size = sizeof(maxPid); int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); if (err) { return 999999; } return maxPid; } double Platform_setCPUValues(Meter* this, int cpu) { DragonFlyBSDProcessList* fpl = (DragonFlyBSDProcessList*) this->pl; int cpus = this->pl->cpuCount; CPUData* cpuData; if (cpus == 1) { // single CPU box has everything in fpl->cpus[0] cpuData = &(fpl->cpus[0]); } else { cpuData = &(fpl->cpus[cpu]); } double percent; double* v = this->values; v[CPU_METER_NICE] = cpuData->nicePercent; v[CPU_METER_NORMAL] = cpuData->userPercent; if (this->pl->settings->detailedCPUTime) { v[CPU_METER_KERNEL] = cpuData->systemPercent; v[CPU_METER_IRQ] = cpuData->irqPercent; Meter_setItems(this, 4); percent = v[0]+v[1]+v[2]+v[3]; } else { v[2] = cpuData->systemAllPercent; Meter_setItems(this, 3); percent = v[0]+v[1]+v[2]; } percent = CLAMP(percent, 0.0, 100.0); if (isnan(percent)) percent = 0.0; return percent; } void Platform_setMemoryValues(Meter* this) { // TODO ProcessList* pl = (ProcessList*) this->pl; this->total = pl->totalMem; this->values[0] = pl->usedMem; this->values[1] = pl->buffersMem; this->values[2] = pl->cachedMem; } void Platform_setSwapValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; this->total = pl->totalSwap; this->values[0] = pl->usedSwap; } void Platform_setTasksValues(Meter* this) { // TODO (void)this; // prevent unused warning } char* Platform_getProcessEnv(pid_t pid) { // TODO (void)pid; // prevent unused warning return NULL; } htop-2.1.0/Vector.c0000644000175000001440000001772413152362772011032 00000000000000/* htop - Vector.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Vector.h" #include #include #include #include /*{ #include "Object.h" #define swap(a_,x_,y_) do{ void* tmp_ = a_[x_]; a_[x_] = a_[y_]; a_[y_] = tmp_; }while(0) #ifndef DEFAULT_SIZE #define DEFAULT_SIZE -1 #endif typedef struct Vector_ { Object **array; ObjectClass* type; int arraySize; int growthRate; int items; bool owner; } Vector; }*/ Vector* Vector_new(ObjectClass* type, bool owner, int size) { Vector* this; if (size == DEFAULT_SIZE) size = 10; this = xMalloc(sizeof(Vector)); this->growthRate = size; this->array = (Object**) xCalloc(size, sizeof(Object*)); this->arraySize = size; this->items = 0; this->type = type; this->owner = owner; return this; } void Vector_delete(Vector* this) { if (this->owner) { for (int i = 0; i < this->items; i++) if (this->array[i]) Object_delete(this->array[i]); } free(this->array); free(this); } #ifdef DEBUG static inline bool Vector_isConsistent(Vector* this) { assert(this->items <= this->arraySize); if (this->owner) { for (int i = 0; i < this->items; i++) if (this->array[i] && !Object_isA(this->array[i], this->type)) return false; return true; } else { return true; } } int Vector_count(Vector* this) { int items = 0; for (int i = 0; i < this->items; i++) { if (this->array[i]) items++; } assert(items == this->items); return items; } #endif void Vector_prune(Vector* this) { assert(Vector_isConsistent(this)); if (this->owner) { for (int i = 0; i < this->items; i++) if (this->array[i]) { Object_delete(this->array[i]); //this->array[i] = NULL; } } this->items = 0; } static int comparisons = 0; static int partition(Object** array, int left, int right, int pivotIndex, Object_Compare compare) { void* pivotValue = array[pivotIndex]; swap(array, pivotIndex, right); int storeIndex = left; for (int i = left; i < right; i++) { comparisons++; if (compare(array[i], pivotValue) <= 0) { swap(array, i, storeIndex); storeIndex++; } } swap(array, storeIndex, right); return storeIndex; } static void quickSort(Object** array, int left, int right, Object_Compare compare) { if (left >= right) return; int pivotIndex = (left+right) / 2; int pivotNewIndex = partition(array, left, right, pivotIndex, compare); quickSort(array, left, pivotNewIndex - 1, compare); quickSort(array, pivotNewIndex + 1, right, compare); } // If I were to use only one sorting algorithm for both cases, it would probably be this one: /* static void combSort(Object** array, int left, int right, Object_Compare compare) { int gap = right - left; bool swapped = true; while ((gap > 1) || swapped) { if (gap > 1) { gap = (int)((double)gap / 1.247330950103979); } swapped = false; for (int i = left; gap + i <= right; i++) { comparisons++; if (compare(array[i], array[i+gap]) > 0) { swap(array, i, i+gap); swapped = true; } } } } */ static void insertionSort(Object** array, int left, int right, Object_Compare compare) { for (int i = left+1; i <= right; i++) { void* t = array[i]; int j = i - 1; while (j >= left) { comparisons++; if (compare(array[j], t) <= 0) break; array[j+1] = array[j]; j--; } array[j+1] = t; } } void Vector_quickSort(Vector* this) { assert(this->type->compare); assert(Vector_isConsistent(this)); quickSort(this->array, 0, this->items - 1, this->type->compare); assert(Vector_isConsistent(this)); } void Vector_insertionSort(Vector* this) { assert(this->type->compare); assert(Vector_isConsistent(this)); insertionSort(this->array, 0, this->items - 1, this->type->compare); assert(Vector_isConsistent(this)); } static void Vector_checkArraySize(Vector* this) { assert(Vector_isConsistent(this)); if (this->items >= this->arraySize) { //int i; //i = this->arraySize; this->arraySize = this->items + this->growthRate; this->array = (Object**) xRealloc(this->array, sizeof(Object*) * this->arraySize); //for (; i < this->arraySize; i++) // this->array[i] = NULL; } assert(Vector_isConsistent(this)); } void Vector_insert(Vector* this, int idx, void* data_) { Object* data = data_; assert(idx >= 0); assert(Object_isA(data, this->type)); assert(Vector_isConsistent(this)); if (idx > this->items) { idx = this->items; } Vector_checkArraySize(this); //assert(this->array[this->items] == NULL); for (int i = this->items; i > idx; i--) { this->array[i] = this->array[i-1]; } this->array[idx] = data; this->items++; assert(Vector_isConsistent(this)); } Object* Vector_take(Vector* this, int idx) { assert(idx >= 0 && idx < this->items); assert(Vector_isConsistent(this)); Object* removed = this->array[idx]; //assert (removed != NULL); this->items--; for (int i = idx; i < this->items; i++) this->array[i] = this->array[i+1]; //this->array[this->items] = NULL; assert(Vector_isConsistent(this)); return removed; } Object* Vector_remove(Vector* this, int idx) { Object* removed = Vector_take(this, idx); if (this->owner) { Object_delete(removed); return NULL; } else return removed; } void Vector_moveUp(Vector* this, int idx) { assert(idx >= 0 && idx < this->items); assert(Vector_isConsistent(this)); if (idx == 0) return; Object* temp = this->array[idx]; this->array[idx] = this->array[idx - 1]; this->array[idx - 1] = temp; } void Vector_moveDown(Vector* this, int idx) { assert(idx >= 0 && idx < this->items); assert(Vector_isConsistent(this)); if (idx == this->items - 1) return; Object* temp = this->array[idx]; this->array[idx] = this->array[idx + 1]; this->array[idx + 1] = temp; } void Vector_set(Vector* this, int idx, void* data_) { Object* data = data_; assert(idx >= 0); assert(Object_isA((Object*)data, this->type)); assert(Vector_isConsistent(this)); Vector_checkArraySize(this); if (idx >= this->items) { this->items = idx+1; } else { if (this->owner) { Object* removed = this->array[idx]; assert (removed != NULL); if (this->owner) { Object_delete(removed); } } } this->array[idx] = data; assert(Vector_isConsistent(this)); } #ifdef DEBUG inline Object* Vector_get(Vector* this, int idx) { assert(idx < this->items); assert(Vector_isConsistent(this)); return this->array[idx]; } #else #define Vector_get(v_, idx_) ((v_)->array[idx_]) #endif inline int Vector_size(Vector* this) { assert(Vector_isConsistent(this)); return this->items; } /* static void Vector_merge(Vector* this, Vector* v2) { int i; assert(Vector_isConsistent(this)); for (i = 0; i < v2->items; i++) Vector_add(this, v2->array[i]); v2->items = 0; Vector_delete(v2); assert(Vector_isConsistent(this)); } */ void Vector_add(Vector* this, void* data_) { Object* data = data_; assert(Object_isA((Object*)data, this->type)); assert(Vector_isConsistent(this)); int i = this->items; Vector_set(this, this->items, data); assert(this->items == i+1); (void)(i); assert(Vector_isConsistent(this)); } inline int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) { Object* search = search_; assert(Object_isA((Object*)search, this->type)); assert(compare); assert(Vector_isConsistent(this)); for (int i = 0; i < this->items; i++) { Object* o = (Object*)this->array[i]; assert(o); if (compare(search, o) == 0) return i; } return -1; } htop-2.1.0/InfoScreen.h0000644000175000001440000000312613153324652011613 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_InfoScreen #define HEADER_InfoScreen #include "Process.h" #include "Panel.h" #include "FunctionBar.h" #include "IncSet.h" typedef struct InfoScreen_ InfoScreen; typedef void(*InfoScreen_Scan)(InfoScreen*); typedef void(*InfoScreen_Draw)(InfoScreen*); typedef void(*InfoScreen_OnErr)(InfoScreen*); typedef bool(*InfoScreen_OnKey)(InfoScreen*, int); typedef struct InfoScreenClass_ { ObjectClass super; const InfoScreen_Scan scan; const InfoScreen_Draw draw; const InfoScreen_OnErr onErr; const InfoScreen_OnKey onKey; } InfoScreenClass; #define As_InfoScreen(this_) ((InfoScreenClass*)(((InfoScreen*)(this_))->super.klass)) #define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_)) #define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_)) #define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_)) #define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_) struct InfoScreen_ { Object super; Process* process; Panel* display; FunctionBar* bar; IncSet* inc; Vector* lines; }; InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader); InfoScreen* InfoScreen_done(InfoScreen* this); void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...); void InfoScreen_addLine(InfoScreen* this, const char* line); void InfoScreen_appendLine(InfoScreen* this, const char* line); void InfoScreen_run(InfoScreen* this); #endif htop-2.1.0/Header.c0000644000175000001440000001334713235653611010752 00000000000000/* htop - Header.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Header.h" #include "CRT.h" #include "StringUtils.h" #include "Platform.h" #include #include #include #include /*{ #include "Meter.h" #include "Settings.h" #include "Vector.h" typedef struct Header_ { Vector** columns; Settings* settings; struct ProcessList_* pl; int nrColumns; int pad; int height; } Header; }*/ #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef Header_forEachColumn #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_)) #endif Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns) { Header* this = xCalloc(1, sizeof(Header)); this->columns = xCalloc(nrColumns, sizeof(Vector*)); this->settings = settings; this->pl = pl; this->nrColumns = nrColumns; Header_forEachColumn(this, i) { this->columns[i] = Vector_new(Class(Meter), true, DEFAULT_SIZE); } return this; } void Header_delete(Header* this) { Header_forEachColumn(this, i) { Vector_delete(this->columns[i]); } free(this->columns); free(this); } void Header_populateFromSettings(Header* this) { Header_forEachColumn(this, col) { MeterColumnSettings* colSettings = &this->settings->columns[col]; for (int i = 0; i < colSettings->len; i++) { Header_addMeterByName(this, colSettings->names[i], col); if (colSettings->modes[i] != 0) { Header_setMode(this, i, colSettings->modes[i], col); } } } Header_calculateHeight(this); } void Header_writeBackToSettings(const Header* this) { Header_forEachColumn(this, col) { MeterColumnSettings* colSettings = &this->settings->columns[col]; String_freeArray(colSettings->names); free(colSettings->modes); Vector* vec = this->columns[col]; int len = Vector_size(vec); colSettings->names = xCalloc(len+1, sizeof(char*)); colSettings->modes = xCalloc(len, sizeof(int)); colSettings->len = len; for (int i = 0; i < len; i++) { Meter* meter = (Meter*) Vector_get(vec, i); char* name = xCalloc(64, sizeof(char)); if (meter->param) { xSnprintf(name, 63, "%s(%d)", As_Meter(meter)->name, meter->param); } else { xSnprintf(name, 63, "%s", As_Meter(meter)->name); } colSettings->names[i] = name; colSettings->modes[i] = meter->mode; } } } MeterModeId Header_addMeterByName(Header* this, char* name, int column) { Vector* meters = this->columns[column]; char* paren = strchr(name, '('); int param = 0; if (paren) { int ok = sscanf(paren, "(%10d)", ¶m); if (!ok) param = 0; *paren = '\0'; } MeterModeId mode = TEXT_METERMODE; for (MeterClass** type = Platform_meterTypes; *type; type++) { if (String_eq(name, (*type)->name)) { Meter* meter = Meter_new(this->pl, param, *type); Vector_add(meters, meter); mode = meter->mode; break; } } return mode; } void Header_setMode(Header* this, int i, MeterModeId mode, int column) { Vector* meters = this->columns[column]; if (i >= Vector_size(meters)) return; Meter* meter = (Meter*) Vector_get(meters, i); Meter_setMode(meter, mode); } Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column) { Vector* meters = this->columns[column]; Meter* meter = Meter_new(this->pl, param, type); Vector_add(meters, meter); return meter; } int Header_size(Header* this, int column) { Vector* meters = this->columns[column]; return Vector_size(meters); } char* Header_readMeterName(Header* this, int i, int column) { Vector* meters = this->columns[column]; Meter* meter = (Meter*) Vector_get(meters, i); int nameLen = strlen(Meter_name(meter)); int len = nameLen + 100; char* name = xMalloc(len); strncpy(name, Meter_name(meter), nameLen); name[nameLen] = '\0'; if (meter->param) xSnprintf(name + nameLen, len - nameLen, "(%d)", meter->param); return name; } MeterModeId Header_readMeterMode(Header* this, int i, int column) { Vector* meters = this->columns[column]; Meter* meter = (Meter*) Vector_get(meters, i); return meter->mode; } void Header_reinit(Header* this) { Header_forEachColumn(this, col) { for (int i = 0; i < Vector_size(this->columns[col]); i++) { Meter* meter = (Meter*) Vector_get(this->columns[col], i); if (Meter_initFn(meter)) Meter_init(meter); } } } void Header_draw(const Header* this) { int height = this->height; int pad = this->pad; attrset(CRT_colors[RESET_COLOR]); for (int y = 0; y < height; y++) { mvhline(y, 0, ' ', COLS); } int width = COLS / this->nrColumns - (pad * this->nrColumns - 1) - 1; int x = pad; Header_forEachColumn(this, col) { Vector* meters = this->columns[col]; for (int y = (pad / 2), i = 0; i < Vector_size(meters); i++) { Meter* meter = (Meter*) Vector_get(meters, i); meter->draw(meter, x, y, width); y += meter->h; } x += width + pad; } } int Header_calculateHeight(Header* this) { int pad = this->settings->headerMargin ? 2 : 0; int maxHeight = pad; Header_forEachColumn(this, col) { Vector* meters = this->columns[col]; int height = pad; for (int i = 0; i < Vector_size(meters); i++) { Meter* meter = (Meter*) Vector_get(meters, i); height += meter->h; } maxHeight = MAX(maxHeight, height); } this->height = maxHeight; this->pad = pad; return maxHeight; } htop-2.1.0/MetersPanel.h0000644000175000001440000000213413153324652011775 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_MetersPanel #define HEADER_MetersPanel /* htop - MetersPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct MetersPanel_ MetersPanel; struct MetersPanel_ { Panel super; Settings* settings; Vector* meters; ScreenManager* scr; MetersPanel* leftNeighbor; MetersPanel* rightNeighbor; bool moving; }; // Note: In code the meters are known to have bar/text/graph "Modes", but in UI // we call them "Styles". // We avoid UTF-8 arrows ← → here as they might display full-width on Chinese // terminals, breaking our aligning. // In , arrows (U+2019..U+2199) are // considered "Ambiguous characters". void MetersPanel_setMoving(MetersPanel* this, bool moving); extern PanelClass MetersPanel_class; MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr); #endif htop-2.1.0/Settings.c0000644000175000001440000003361013235653611011355 00000000000000/* htop - Settings.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Settings.h" #include "Platform.h" #include "StringUtils.h" #include "Vector.h" #include "CRT.h" #include #include #include #include #define DEFAULT_DELAY 15 /*{ #include "Process.h" #include typedef struct { int len; char** names; int* modes; } MeterColumnSettings; typedef struct Settings_ { char* filename; MeterColumnSettings columns[2]; ProcessField* fields; int flags; int colorScheme; int delay; int cpuCount; int direction; ProcessField sortKey; bool countCPUsFromZero; bool detailedCPUTime; bool treeView; bool showProgramPath; bool hideThreads; bool shadowOtherUsers; bool showThreadNames; bool hideKernelThreads; bool hideUserlandThreads; bool highlightBaseName; bool highlightMegabytes; bool highlightThreads; bool updateProcessNames; bool accountGuestInCPUMeter; bool headerMargin; bool changed; } Settings; #ifndef Settings_cpuId #define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromZero ? (cpu) : (cpu)+1) #endif }*/ void Settings_delete(Settings* this) { free(this->filename); free(this->fields); for (unsigned int i = 0; i < (sizeof(this->columns)/sizeof(MeterColumnSettings)); i++) { String_freeArray(this->columns[i].names); free(this->columns[i].modes); } free(this); } static void Settings_readMeters(Settings* this, char* line, int column) { char* trim = String_trim(line); int nIds; char** ids = String_split(trim, ' ', &nIds); free(trim); this->columns[column].names = ids; } static void Settings_readMeterModes(Settings* this, char* line, int column) { char* trim = String_trim(line); int nIds; char** ids = String_split(trim, ' ', &nIds); free(trim); int len = 0; for (int i = 0; ids[i]; i++) { len++; } this->columns[column].len = len; int* modes = xCalloc(len, sizeof(int)); for (int i = 0; i < len; i++) { modes[i] = atoi(ids[i]); } String_freeArray(ids); this->columns[column].modes = modes; } static void Settings_defaultMeters(Settings* this) { int sizes[] = { 3, 3 }; if (this->cpuCount > 4) { sizes[1]++; } for (int i = 0; i < 2; i++) { this->columns[i].names = xCalloc(sizes[i] + 1, sizeof(char*)); this->columns[i].modes = xCalloc(sizes[i], sizeof(int)); this->columns[i].len = sizes[i]; } int r = 0; if (this->cpuCount > 8) { this->columns[0].names[0] = xStrdup("LeftCPUs2"); this->columns[0].modes[0] = BAR_METERMODE; this->columns[1].names[r] = xStrdup("RightCPUs2"); this->columns[1].modes[r++] = BAR_METERMODE; } else if (this->cpuCount > 4) { this->columns[0].names[0] = xStrdup("LeftCPUs"); this->columns[0].modes[0] = BAR_METERMODE; this->columns[1].names[r] = xStrdup("RightCPUs"); this->columns[1].modes[r++] = BAR_METERMODE; } else { this->columns[0].names[0] = xStrdup("AllCPUs"); this->columns[0].modes[0] = BAR_METERMODE; } this->columns[0].names[1] = xStrdup("Memory"); this->columns[0].modes[1] = BAR_METERMODE; this->columns[0].names[2] = xStrdup("Swap"); this->columns[0].modes[2] = BAR_METERMODE; this->columns[1].names[r] = xStrdup("Tasks"); this->columns[1].modes[r++] = TEXT_METERMODE; this->columns[1].names[r] = xStrdup("LoadAverage"); this->columns[1].modes[r++] = TEXT_METERMODE; this->columns[1].names[r] = xStrdup("Uptime"); this->columns[1].modes[r++] = TEXT_METERMODE; } static void readFields(ProcessField* fields, int* flags, const char* line) { char* trim = String_trim(line); int nIds; char** ids = String_split(trim, ' ', &nIds); free(trim); int i, j; *flags = 0; for (j = 0, i = 0; i < Platform_numberOfFields && ids[i]; i++) { // This "+1" is for compatibility with the older enum format. int id = atoi(ids[i]) + 1; if (id > 0 && Process_fields[id].name && id < Platform_numberOfFields) { fields[j] = id; *flags |= Process_fields[id].flags; j++; } } fields[j] = NULL_PROCESSFIELD; String_freeArray(ids); } static bool Settings_read(Settings* this, const char* fileName) { FILE* fd; CRT_dropPrivileges(); fd = fopen(fileName, "r"); CRT_restorePrivileges(); if (!fd) return false; bool readMeters = false; for (;;) { char* line = String_readLine(fd); if (!line) { break; } int nOptions; char** option = String_split(line, '=', &nOptions); free (line); if (nOptions < 2) { String_freeArray(option); continue; } if (String_eq(option[0], "fields")) { readFields(this->fields, &(this->flags), option[1]); } else if (String_eq(option[0], "sort_key")) { // This "+1" is for compatibility with the older enum format. this->sortKey = atoi(option[1]) + 1; } else if (String_eq(option[0], "sort_direction")) { this->direction = atoi(option[1]); } else if (String_eq(option[0], "tree_view")) { this->treeView = atoi(option[1]); } else if (String_eq(option[0], "hide_threads")) { this->hideThreads = atoi(option[1]); } else if (String_eq(option[0], "hide_kernel_threads")) { this->hideKernelThreads = atoi(option[1]); } else if (String_eq(option[0], "hide_userland_threads")) { this->hideUserlandThreads = atoi(option[1]); } else if (String_eq(option[0], "shadow_other_users")) { this->shadowOtherUsers = atoi(option[1]); } else if (String_eq(option[0], "show_thread_names")) { this->showThreadNames = atoi(option[1]); } else if (String_eq(option[0], "show_program_path")) { this->showProgramPath = atoi(option[1]); } else if (String_eq(option[0], "highlight_base_name")) { this->highlightBaseName = atoi(option[1]); } else if (String_eq(option[0], "highlight_megabytes")) { this->highlightMegabytes = atoi(option[1]); } else if (String_eq(option[0], "highlight_threads")) { this->highlightThreads = atoi(option[1]); } else if (String_eq(option[0], "header_margin")) { this->headerMargin = atoi(option[1]); } else if (String_eq(option[0], "expand_system_time")) { // Compatibility option. this->detailedCPUTime = atoi(option[1]); } else if (String_eq(option[0], "detailed_cpu_time")) { this->detailedCPUTime = atoi(option[1]); } else if (String_eq(option[0], "cpu_count_from_zero")) { this->countCPUsFromZero = atoi(option[1]); } else if (String_eq(option[0], "update_process_names")) { this->updateProcessNames = atoi(option[1]); } else if (String_eq(option[0], "account_guest_in_cpu_meter")) { this->accountGuestInCPUMeter = atoi(option[1]); } else if (String_eq(option[0], "delay")) { this->delay = atoi(option[1]); } else if (String_eq(option[0], "color_scheme")) { this->colorScheme = atoi(option[1]); if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) this->colorScheme = 0; } else if (String_eq(option[0], "left_meters")) { Settings_readMeters(this, option[1], 0); readMeters = true; } else if (String_eq(option[0], "right_meters")) { Settings_readMeters(this, option[1], 1); readMeters = true; } else if (String_eq(option[0], "left_meter_modes")) { Settings_readMeterModes(this, option[1], 0); readMeters = true; } else if (String_eq(option[0], "right_meter_modes")) { Settings_readMeterModes(this, option[1], 1); readMeters = true; } String_freeArray(option); } fclose(fd); if (!readMeters) { Settings_defaultMeters(this); } return true; } static void writeFields(FILE* fd, ProcessField* fields, const char* name) { fprintf(fd, "%s=", name); const char* sep = ""; for (int i = 0; fields[i]; i++) { // This "-1" is for compatibility with the older enum format. fprintf(fd, "%s%d", sep, (int) fields[i]-1); sep = " "; } fprintf(fd, "\n"); } static void writeMeters(Settings* this, FILE* fd, int column) { const char* sep = ""; for (int i = 0; i < this->columns[column].len; i++) { fprintf(fd, "%s%s", sep, this->columns[column].names[i]); sep = " "; } fprintf(fd, "\n"); } static void writeMeterModes(Settings* this, FILE* fd, int column) { const char* sep = ""; for (int i = 0; i < this->columns[column].len; i++) { fprintf(fd, "%s%d", sep, this->columns[column].modes[i]); sep = " "; } fprintf(fd, "\n"); } bool Settings_write(Settings* this) { FILE* fd; CRT_dropPrivileges(); fd = fopen(this->filename, "w"); CRT_restorePrivileges(); if (fd == NULL) { return false; } fprintf(fd, "# Beware! This file is rewritten by htop when settings are changed in the interface.\n"); fprintf(fd, "# The parser is also very primitive, and not human-friendly.\n"); writeFields(fd, this->fields, "fields"); // This "-1" is for compatibility with the older enum format. fprintf(fd, "sort_key=%d\n", (int) this->sortKey-1); fprintf(fd, "sort_direction=%d\n", (int) this->direction); fprintf(fd, "hide_threads=%d\n", (int) this->hideThreads); fprintf(fd, "hide_kernel_threads=%d\n", (int) this->hideKernelThreads); fprintf(fd, "hide_userland_threads=%d\n", (int) this->hideUserlandThreads); fprintf(fd, "shadow_other_users=%d\n", (int) this->shadowOtherUsers); fprintf(fd, "show_thread_names=%d\n", (int) this->showThreadNames); fprintf(fd, "show_program_path=%d\n", (int) this->showProgramPath); fprintf(fd, "highlight_base_name=%d\n", (int) this->highlightBaseName); fprintf(fd, "highlight_megabytes=%d\n", (int) this->highlightMegabytes); fprintf(fd, "highlight_threads=%d\n", (int) this->highlightThreads); fprintf(fd, "tree_view=%d\n", (int) this->treeView); fprintf(fd, "header_margin=%d\n", (int) this->headerMargin); fprintf(fd, "detailed_cpu_time=%d\n", (int) this->detailedCPUTime); fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->countCPUsFromZero); fprintf(fd, "update_process_names=%d\n", (int) this->updateProcessNames); fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->accountGuestInCPUMeter); fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme); fprintf(fd, "delay=%d\n", (int) this->delay); fprintf(fd, "left_meters="); writeMeters(this, fd, 0); fprintf(fd, "left_meter_modes="); writeMeterModes(this, fd, 0); fprintf(fd, "right_meters="); writeMeters(this, fd, 1); fprintf(fd, "right_meter_modes="); writeMeterModes(this, fd, 1); fclose(fd); return true; } Settings* Settings_new(int cpuCount) { Settings* this = xCalloc(1, sizeof(Settings)); this->sortKey = PERCENT_CPU; this->direction = 1; this->hideThreads = false; this->shadowOtherUsers = false; this->showThreadNames = false; this->hideKernelThreads = false; this->hideUserlandThreads = false; this->treeView = false; this->highlightBaseName = false; this->highlightMegabytes = false; this->detailedCPUTime = false; this->countCPUsFromZero = false; this->updateProcessNames = false; this->cpuCount = cpuCount; this->showProgramPath = true; this->highlightThreads = true; this->fields = xCalloc(Platform_numberOfFields+1, sizeof(ProcessField)); // TODO: turn 'fields' into a Vector, // (and ProcessFields into proper objects). this->flags = 0; ProcessField* defaults = Platform_defaultFields; for (int i = 0; defaults[i]; i++) { this->fields[i] = defaults[i]; this->flags |= Process_fields[defaults[i]].flags; } char* legacyDotfile = NULL; char* rcfile = getenv("HTOPRC"); if (rcfile) { this->filename = xStrdup(rcfile); } else { const char* home = getenv("HOME"); if (!home) home = ""; const char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); char* configDir = NULL; char* htopDir = NULL; if (xdgConfigHome) { this->filename = String_cat(xdgConfigHome, "/htop/htoprc"); configDir = xStrdup(xdgConfigHome); htopDir = String_cat(xdgConfigHome, "/htop"); } else { this->filename = String_cat(home, "/.config/htop/htoprc"); configDir = String_cat(home, "/.config"); htopDir = String_cat(home, "/.config/htop"); } legacyDotfile = String_cat(home, "/.htoprc"); CRT_dropPrivileges(); (void) mkdir(configDir, 0700); (void) mkdir(htopDir, 0700); free(htopDir); free(configDir); struct stat st; if (lstat(legacyDotfile, &st) != 0) { st.st_mode = 0; } if (access(legacyDotfile, R_OK) != 0 || S_ISLNK(st.st_mode)) { free(legacyDotfile); legacyDotfile = NULL; } CRT_restorePrivileges(); } this->colorScheme = 0; this->changed = false; this->delay = DEFAULT_DELAY; bool ok = Settings_read(this, legacyDotfile ? legacyDotfile : this->filename); if (ok) { if (legacyDotfile) { // Transition to new location and delete old configuration file if (Settings_write(this)) unlink(legacyDotfile); } } else { this->changed = true; // TODO: how to get SYSCONFDIR correctly through Autoconf? char* systemSettings = String_cat(SYSCONFDIR, "/htoprc"); ok = Settings_read(this, systemSettings); free(systemSettings); if (!ok) { Settings_defaultMeters(this); this->hideKernelThreads = true; this->highlightMegabytes = true; this->highlightThreads = true; this->headerMargin = true; } } free(legacyDotfile); return this; } void Settings_invertSortOrder(Settings* this) { if (this->direction == 1) this->direction = -1; else this->direction = 1; } htop-2.1.0/config.h.in0000644000175000001440000001310313235655643011436 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* Copyright message. */ #undef COPYRIGHT /* Define if ancient vserver support enabled. */ #undef HAVE_ANCIENT_VSERVER /* Define if cgroup support enabled. */ #undef HAVE_CGROUP /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define if delay accounting support should be enabled. */ #undef HAVE_DELAYACCT /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_HWLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `hwloc' library (-lhwloc). */ #undef HAVE_LIBHWLOC /* Define to 1 if you have the `kvm' library (-lkvm). */ #undef HAVE_LIBKVM /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* The library is present. */ #undef HAVE_LIBNCURSES /* The library is present. */ #undef HAVE_LIBNCURSESW /* Define if Linux sched_setaffinity and sched_getaffinity are to be used. */ #undef HAVE_LINUX_AFFINITY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSESW_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_NCURSES_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define if openvz support enabled. */ #undef HAVE_OPENVZ /* Define if using a Linux-compatible proc filesystem. */ #undef HAVE_PROC /* Define if setuid support should be enabled. */ #undef HAVE_SETUID_ENABLED /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if taskstats support enabled. */ #undef HAVE_TASKSTATS /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if vserver support enabled. */ #undef HAVE_VSERVER /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Path of proc filesystem */ #undef PROCDIR /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `int' if doesn't define. */ #undef uid_t htop-2.1.0/AvailableMetersPanel.h0000644000175000001440000000143613153324652013602 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_AvailableMetersPanel #define HEADER_AvailableMetersPanel /* htop - AvailableMetersPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Settings.h" #include "Panel.h" #include "ScreenManager.h" #include "ProcessList.h" typedef struct AvailableMetersPanel_ { Panel super; ScreenManager* scr; Settings* settings; Header* header; Panel* leftPanel; Panel* rightPanel; } AvailableMetersPanel; extern PanelClass AvailableMetersPanel_class; AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl); #endif htop-2.1.0/MetersPanel.c0000644000175000001440000001535513235624301011774 00000000000000/* htop - MetersPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "MetersPanel.h" #include #include #include "CRT.h" /*{ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct MetersPanel_ MetersPanel; struct MetersPanel_ { Panel super; Settings* settings; Vector* meters; ScreenManager* scr; MetersPanel* leftNeighbor; MetersPanel* rightNeighbor; bool moving; }; }*/ // Note: In code the meters are known to have bar/text/graph "Modes", but in UI // we call them "Styles". static const char* const MetersFunctions[] = {"Style ", "Move ", " ", "Delete", "Done ", NULL}; static const char* const MetersKeys[] = {"Space", "Enter", " ", "Del", "F10"}; static int MetersEvents[] = {' ', 13, ERR, KEY_DC, KEY_F(10)}; // We avoid UTF-8 arrows ← → here as they might display full-width on Chinese // terminals, breaking our aligning. // In , arrows (U+2019..U+2199) are // considered "Ambiguous characters". static const char* const MetersMovingFunctions[] = {"Style ", "Lock ", "Up ", "Down ", "Left ", "Right ", " ", "Delete", "Done ", NULL}; static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-", "->", " ", "Del", "F10"}; static int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)}; static FunctionBar* Meters_movingBar = NULL; static void MetersPanel_delete(Object* object) { Panel* super = (Panel*) object; MetersPanel* this = (MetersPanel*) object; Panel_done(super); free(this); } void MetersPanel_setMoving(MetersPanel* this, bool moving) { Panel* super = (Panel*) this; this->moving = moving; ListItem* selected = (ListItem*)Panel_getSelected(super); if (selected) { selected->moving = moving; } if (!moving) { Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOCUS]); Panel_setDefaultBar(super); } else { Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOLLOW]); super->currentBar = Meters_movingBar; } FunctionBar_draw(this->super.currentBar, NULL); } static inline bool moveToNeighbor(MetersPanel* this, MetersPanel* neighbor, int selected) { Panel* super = (Panel*) this; if (this->moving) { if (neighbor) { if (selected < Vector_size(this->meters)) { MetersPanel_setMoving(this, false); Meter* meter = (Meter*) Vector_take(this->meters, selected); Panel_remove(super, selected); Vector_insert(neighbor->meters, selected, meter); Panel_insert(&(neighbor->super), selected, (Object*) Meter_toListItem(meter, false)); Panel_setSelected(&(neighbor->super), selected); MetersPanel_setMoving(neighbor, true); return true; } } } return false; } static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) { MetersPanel* this = (MetersPanel*) super; int selected = Panel_getSelectedIndex(super); HandlerResult result = IGNORED; bool sideMove = false; switch(ch) { case 0x0a: case 0x0d: case KEY_ENTER: { if (!Vector_size(this->meters)) break; MetersPanel_setMoving(this, !(this->moving)); result = HANDLED; break; } case ' ': case KEY_F(4): case 't': { if (!Vector_size(this->meters)) break; Meter* meter = (Meter*) Vector_get(this->meters, selected); int mode = meter->mode + 1; if (mode == LAST_METERMODE) mode = 1; Meter_setMode(meter, mode); Panel_set(super, selected, (Object*) Meter_toListItem(meter, this->moving)); result = HANDLED; break; } case KEY_UP: { if (!this->moving) { break; } } /* else fallthrough */ case KEY_F(7): case '[': case '-': { Vector_moveUp(this->meters, selected); Panel_moveSelectedUp(super); result = HANDLED; break; } case KEY_DOWN: { if (!this->moving) { break; } } /* else fallthrough */ case KEY_F(8): case ']': case '+': { Vector_moveDown(this->meters, selected); Panel_moveSelectedDown(super); result = HANDLED; break; } case KEY_RIGHT: { sideMove = moveToNeighbor(this, this->rightNeighbor, selected); if (this->moving && !sideMove) { // lock user here until it exits positioning-mode result = HANDLED; } // if user is free, don't set HANDLED; // let ScreenManager handle focus. break; } case KEY_LEFT: { sideMove = moveToNeighbor(this, this->leftNeighbor, selected); if (this->moving && !sideMove) { result = HANDLED; } break; } case KEY_F(9): case KEY_DC: { if (!Vector_size(this->meters)) break; if (selected < Vector_size(this->meters)) { Vector_remove(this->meters, selected); Panel_remove(super, selected); } MetersPanel_setMoving(this, false); result = HANDLED; break; } } if (result == HANDLED || sideMove) { Header* header = (Header*) this->scr->header; this->settings->changed = true; Header_calculateHeight(header); Header_draw(header); ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); } return result; } PanelClass MetersPanel_class = { .super = { .extends = Class(Panel), .delete = MetersPanel_delete }, .eventHandler = MetersPanel_eventHandler }; MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr) { MetersPanel* this = AllocThis(MetersPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(MetersFunctions, MetersKeys, MetersEvents); if (!Meters_movingBar) { Meters_movingBar = FunctionBar_new(MetersMovingFunctions, MetersMovingKeys, MetersMovingEvents); } Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); this->settings = settings; this->meters = meters; this->scr = scr; this->moving = false; this->rightNeighbor = NULL; this->leftNeighbor = NULL; Panel_setHeader(super, header); for (int i = 0; i < Vector_size(meters); i++) { Meter* meter = (Meter*) Vector_get(meters, i); Panel_add(super, (Object*) Meter_toListItem(meter, false)); } return this; } htop-2.1.0/config.h0000644000175000001440000001400113235655643011027 00000000000000/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if the `closedir' function returns void instead of `int'. */ /* #undef CLOSEDIR_VOID */ /* Copyright message. */ #define COPYRIGHT "(C) 2004-2018 Hisham Muhammad" /* Define if ancient vserver support enabled. */ /* #undef HAVE_ANCIENT_VSERVER */ /* Define if cgroup support enabled. */ /* #undef HAVE_CGROUP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_CURSES_H */ /* Define if delay accounting support should be enabled. */ /* #undef HAVE_DELAYACCT */ /* Define to 1 if you have the header file, and it defines `DIR'. */ #define HAVE_DIRENT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_EXECINFO_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_HWLOC_H */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `hwloc' library (-lhwloc). */ /* #undef HAVE_LIBHWLOC */ /* Define to 1 if you have the `kvm' library (-lkvm). */ /* #undef HAVE_LIBKVM */ /* Define to 1 if you have the `m' library (-lm). */ #define HAVE_LIBM 1 /* The library is present. */ /* #undef HAVE_LIBNCURSES */ /* The library is present. */ #define HAVE_LIBNCURSESW 1 /* Define if Linux sched_setaffinity and sched_getaffinity are to be used. */ #define HAVE_LINUX_AFFINITY 1 /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NCURSESW_CURSES_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_NCURSES_CURSES_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_NCURSES_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_NCURSES_NCURSES_H */ /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ /* Define if openvz support enabled. */ /* #undef HAVE_OPENVZ */ /* Define if using a Linux-compatible proc filesystem. */ /* #undef HAVE_PROC */ /* Define if setuid support should be enabled. */ /* #undef HAVE_SETUID_ENABLED */ /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ /* #undef HAVE_STAT_EMPTY_STRING_BUG */ /* Define to 1 if stdbool.h conforms to C99. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strncasecmp' function. */ #define HAVE_STRNCASECMP 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_DIR_H */ /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if taskstats support enabled. */ #define HAVE_TASKSTATS 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define if vserver support enabled. */ /* #undef HAVE_VSERVER */ /* Define to 1 if the system has the type `_Bool'. */ #define HAVE__BOOL 1 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 /* Name of package */ #define PACKAGE "htop" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "hisham@gobolinux.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "htop" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "htop 2.1.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "htop" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ #define PACKAGE_VERSION "2.1.0" /* Path of proc filesystem */ #define PROCDIR "/proc" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # define _TANDEM_SOURCE 1 #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 #endif /* Version number of package */ #define VERSION "2.1.0" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `int' if doesn't define. */ /* #undef gid_t */ /* Define to `int' if does not define. */ /* #undef pid_t */ /* Define to `int' if doesn't define. */ /* #undef uid_t */ htop-2.1.0/htop.10000644000175000001440000003040213235655640010445 00000000000000.TH "HTOP" "1" "2015" "htop 2.1.0" "Utils" .SH "NAME" htop \- interactive process viewer .SH "SYNOPSIS" .LP .B htop [\fI\-dChusv\fR] .SH "DESCRIPTION" .LP Htop is a free (GPL) ncurses-based process viewer for Linux. .LP It is similar to top, but allows you to scroll vertically and horizontally, so you can see all the processes running on the system, along with their full command lines, as well as viewing them as a process tree, selecting multiple processes and acting on them all at once. .LP Tasks related to processes (killing, renicing) can be done without entering their PIDs. .br .SH "COMMAND-LINE OPTIONS" .LP Mandatory arguments to long options are mandatory for short options too. .LP .TP \fB\-d \-\-delay=DELAY\fR Delay between updates, in tenths of seconds .TP \fB\-C \-\-no-color \-\-no-colour\fR Start htop in monochrome mode .TP \fB\-h \-\-help Display a help message and exit .TP \fB\-p \-\-pid=PID,PID...\fR Show only the given PIDs .TP \fB\-s \-\-sort\-key COLUMN\fR Sort by this column (use \-\-sort\-key help for a column list) .TP \fB\-u \-\-user=USERNAME\fR Show only the processes of a given user .TP \fB\-v \-\-version Output version information and exit .PP .br .SH "INTERACTIVE COMMANDS" .LP The following commands are supported while in htop: .LP .TP 5 .B Up, Alt-k Select (highlight) the previous process in the process list. Scroll the list if necessary. .TP .B Down, Alt-j Select (highlight) the next process in the process list. Scroll the list if necessary. .TP .B Left, Alt-h Scroll the process list left. .TP .B Right, Alt-l Scroll the process list right. .TP .B PgUp, PgDn Scroll the process list up or down one window. .TP .B Home Scroll to the top of the process list and select the first process. .TP .B End Scroll to the bottom of the process list and select the last process. .TP .B Ctrl-A, ^ Scroll left to the beginning of the process entry (i.e. beginning of line). .TP .B Ctrl-E, $ Scroll right to the end of the process entry (i.e. end of line). .TP .B Space Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of tagged processes, instead of the currently highlighted one. .TP .B U Untag all processes (remove all tags added with the Space key). .TP .B s Trace process system calls: if strace(1) is installed, pressing this key will attach it to the currently selected process, presenting a live update of system calls issued by the process. .TP .B l Display open files for a process: if lsof(1) is installed, pressing this key will display the list of file descriptors opened by the process. .TP .B F1, h, ? Go to the help screen .TP .B F2, S Go to the setup screen, where you can configure the meters displayed at the top of the screen, set various display options, choose among color schemes, and select which columns are displayed, in which order. .TP .B F3, / Incrementally search the command lines of all the displayed processes. The currently selected (highlighted) command will update as you type. While in search mode, pressing F3 will cycle through matching occurrences. .TP .B F4, \\\\ Incremental process filtering: type in part of a process command line and only processes whose names match will be shown. To cancel filtering, enter the Filter option again and press Esc. .TP .B F5, t Tree view: organize processes by parenthood, and layout the relations between them as a tree. Toggling the key will switch between tree and your previously selected sort view. Selecting a sort view will exit tree view. .TP .B F6 On sorted view, select a field for sorting, also accessible through < and >. The current sort field is indicated by a highlight in the header. On tree view, expand or collapse the current subtree. A "+" indicator in the tree node indicates that it is collapsed. .TP .B F7, ] Increase the selected process's priority (subtract from 'nice' value). This can only be done by the superuser. .TP .B F8, [ Decrease the selected process's priority (add to 'nice' value) .TP .B F9, k "Kill" process: sends a signal which is selected in a menu, to one or a group of processes. If processes were tagged, sends the signal to all tagged processes. If none is tagged, sends to the currently selected process. .TP .B F10, q Quit .TP .B I Invert the sort order: if sort order is increasing, switch to decreasing, and vice-versa. .TP .B +, \- When in tree view mode, expand or collapse subtree. When a subtree is collapsed a "+" sign shows to the left of the process name. .TP .B a (on multiprocessor machines) Set CPU affinity: mark which CPUs a process is allowed to use. .TP .B u Show only processes owned by a specified user. .TP .B M Sort by memory usage (top compatibility key). .TP .B P Sort by processor usage (top compatibility key). .TP .B T Sort by time (top compatibility key). .TP .B F "Follow" process: if the sort order causes the currently selected process to move in the list, make the selection bar follow it. This is useful for monitoring a process: this way, you can keep a process always visible on screen. When a movement key is used, "follow" loses effect. .TP .B K Hide kernel threads: prevent the threads belonging the kernel to be displayed in the process list. (This is a toggle key.) .TP .B H Hide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.) .TP .B p Show full paths to running programs, where applicable. (This is a toggle key.) .TP .B Ctrl-L Refresh: redraw screen and recalculate values. .TP .B Numbers PID search: type in process ID and the selection highlight will be moved to it. .PD .SH "COLUMNS" .LP The following columns can display data about each process. A value of '\-' in all the rows indicates that a column is unsupported on your system, or currently unimplemented in htop. The names below are the ones used in the "Available Columns" section of the setup screen. If a different name is shown in htop's main screen, it is shown below in parenthesis. .LP .TP 5 .B Command The full command line of the process (i.e. program name and arguments). .TP .B PID The process ID. .TP .B STATE (S) The state of the process: \fBS\fR for sleeping (idle) \fBR\fR for running \fBD\fR for disk sleep (uninterruptible) \fBZ\fR for zombie (waiting for parent to read its exit status) \fBT\fR for traced or suspended (e.g by SIGTSTP) \fBW\fR for paging .TP .B PPID The parent process ID. .TP .B PGRP The process's group ID. .TP .B SESSION (SID) The process's session ID. .TP .B TTY_NR (TTY) The controlling terminal of the process. .TP .B TPGID The process ID of the foreground process group of the controlling terminal. .TP .B MINFLT The number of page faults happening in the main memory. .TP .B CMINFLT The number of minor faults for the process's waited-for children (see MINFLT above). .TP .B MAJFLT The number of page faults happening out of the main memory. .TP .B CMAJFLT The number of major faults for the process's waited-for children (see MAJFLT above). .TP .B UTIME (UTIME+) The user CPU time, which is the amount of time the process has spent executing on the CPU in user mode (i.e. everything but system calls), measured in clock ticks. .TP .B STIME (STIME+) The system CPU time, which is the amount of time the kernel has spent executing system calls on behalf of the process, measured in clock ticks. .TP .B CUTIME (CUTIME+) The children's user CPU time, which is the amount of time the process's waited-for children have spent executing in user mode (see UTIME above). .TP .B CSTIME (CSTIME+) The children's system CPU time, which is the amount of time the kernel has spent executing system calls on behalf of all the process's waited-for children (see STIME above). .TP .B PRIORITY (PRI) The kernel's internal priority for the process, usually just its nice value plus twenty. Different for real-time processes. .TP .B NICE (NI) The nice value of a process, from 19 (low priority) to -20 (high priority). A high value means the process is being nice, letting others have a higher relative priority. The usual OS permission restrictions for adjusting priority apply. .TP .B STARTTIME (START) The time the process was started. .TP .B PROCESSOR (CPU) The ID of the CPU the process last executed on. .TP .B M_SIZE (VIRT) The size of the virtual memory of the process. .TP .B M_RESIDENT (RES) The resident set size (text + data + stack) of the process (i.e. the size of the process's used physical memory). .TP .B M_SHARE (SHR) The size of the process's shared pages. .TP .B M_TRS (CODE) The text resident set size of the process (i.e. the size of the process's executable instructions). .TP .B M_DRS (DATA) The data resident set size (data + stack) of the process (i.e. the size of anything except the process's executable instructions). .TP .B M_LRS (LIB) The library size of the process. .TP .B M_DT (DIRTY) The size of the dirty pages of the process. .TP .B ST_UID (UID) The user ID of the process owner. .TP .B PERCENT_CPU (CPU%) The percentage of the CPU time that the process is currently using. .TP .B PERCENT_MEM (MEM%) The percentage of memory the process is currently using (based on the process's resident memory size, see M_RESIDENT above). .TP .B USER The username of the process owner, or the user ID if the name can't be determined. .TP .B TIME (TIME+) The time, measured in clock ticks that the process has spent in user and system time (see UTIME, STIME above). .TP .B NLWP The number of threads in the process. .TP .B TGID The thread group ID. .TP .B CTID OpenVZ container ID, a.k.a virtual environment ID. .TP .B VPID OpenVZ process ID. .TP .B VXID VServer process ID. .TP .B RCHAR (RD_CHAR) The number of bytes the process has read. .TP .B WCHAR (WR_CHAR) The number of bytes the process has written. .TP .B SYSCR (RD_SYSC) The number of read(2) syscalls for the process. .TP .B SYSCW (WR_SYSC) The number of write(2) syscalls for the process. .TP .B RBYTES (IO_RBYTES) Bytes of read(2) I/O for the process. .TP .B WBYTES (IO_WBYTES) Bytes of write(2) I/O for the process. .TP .B CNCLWB (IO_CANCEL) Bytes of cancelled write(2) I/O. .TP .B IO_READ_RATE (DISK READ) The I/O rate of read(2) in bytes per second, for the process. .TP .B IO_WRITE_RATE (DISK WRITE) The I/O rate of write(2) in bytes per second, for the process. .TP .B IO_RATE (DISK R/W) The I/O rate, IO_READ_RATE + IO_WRITE_RATE (see above). .TP .B CGROUP Which cgroup the process is in. .TP .B OOM OOM killer score. .TP .B IO_PRIORITY (IO) The I/O scheduling class followed by the priority if the class supports it: \fBR\fR for Realtime \fBB\fR for Best-effort \fBid\fR for Idle .TP .B PERCENT_CPU_DELAY (CPUD%) The percentage of time spent waiting for a CPU (while runnable). Requires CAP_NET_ADMIN. .TP .B PERCENT_IO_DELAY (IOD%) The percentage of time spent waiting for the completion of synchronous block I/O. Requires CAP_NET_ADMIN. .TP .B PERCENT_SWAP_DELAY (SWAPD%) The percentage of time spent swapping in pages. Requires CAP_NET_ADMIN. .TP .B All other flags Currently unsupported (always displays '-'). .SH "CONFIG FILE" .LP By default htop reads its configuration from the XDG-compliant path ~/.config/htop/htoprc -- the configuration file is overwritten by htop's in-program Setup configuration, so it should not be hand-edited. If no user configuration exists htop tries to read the system-wide configuration from ${prefix}/etc/htoprc and as a last resort, falls back to its hard coded defaults. .LP You may override the location of the configuration file using the $HTOPRC environment variable (so you can have multiple configurations for different machines that share the same home directory, for example). .SH "MEMORY SIZES" .LP Memory sizes in htop are displayed as they are in tools from the GNU Coreutils (when ran with the --human-readable option). This means that sizes are printed in powers of 1024. (e.g., 1023M = 1072693248 Bytes) .LP The decision to use this convention was made in order to conserve screen space and make memory size representations consistent throughout htop. .SH "SEE ALSO" proc(5), top(1), free(1), ps(1), uptime(1), limits.conf(5) .SH "AUTHORS" .LP htop is developed by Hisham Muhammad . .LP This man page was written by Bartosz Fenski for the Debian GNU/Linux distribution (but it may be used by others). It was updated by Hisham Muhammad, and later by Vincent Launchbury, who wrote the 'Columns' section. htop-2.1.0/Header.h0000644000175000001440000000260013234227500010736 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Header #define HEADER_Header /* htop - Header.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" #include "Settings.h" #include "Vector.h" typedef struct Header_ { Vector** columns; Settings* settings; struct ProcessList_* pl; int nrColumns; int pad; int height; } Header; #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef Header_forEachColumn #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_)) #endif Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); void Header_delete(Header* this); void Header_populateFromSettings(Header* this); void Header_writeBackToSettings(const Header* this); MeterModeId Header_addMeterByName(Header* this, char* name, int column); void Header_setMode(Header* this, int i, MeterModeId mode, int column); Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column); int Header_size(Header* this, int column); char* Header_readMeterName(Header* this, int i, int column); MeterModeId Header_readMeterMode(Header* this, int i, int column); void Header_reinit(Header* this); void Header_draw(const Header* this); int Header_calculateHeight(Header* this); #endif htop-2.1.0/DisplayOptionsPanel.h0000644000175000001440000000116713153324652013524 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DisplayOptionsPanel #define HEADER_DisplayOptionsPanel /* htop - DisplayOptionsPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct DisplayOptionsPanel_ { Panel super; Settings* settings; ScreenManager* scr; } DisplayOptionsPanel; extern PanelClass DisplayOptionsPanel_class; DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); #endif htop-2.1.0/CRT.c0000644000175000001440000005723113235653611010212 00000000000000/* htop - CRT.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include "StringUtils.h" #include "RichString.h" #include #include #include #include #include #include #include #if HAVE_SETUID_ENABLED #include #include #endif #define ColorIndex(i,j) ((7-i)*8+j) #define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j)) #define Black COLOR_BLACK #define Red COLOR_RED #define Green COLOR_GREEN #define Yellow COLOR_YELLOW #define Blue COLOR_BLUE #define Magenta COLOR_MAGENTA #define Cyan COLOR_CYAN #define White COLOR_WHITE #define ColorPairGrayBlack ColorPair(Magenta,Magenta) #define KEY_WHEELUP KEY_F(20) #define KEY_WHEELDOWN KEY_F(21) #define KEY_RECLICK KEY_F(22) //#link curses /*{ #include typedef enum TreeStr_ { TREE_STR_HORZ, TREE_STR_VERT, TREE_STR_RTEE, TREE_STR_BEND, TREE_STR_TEND, TREE_STR_OPEN, TREE_STR_SHUT, TREE_STR_COUNT } TreeStr; typedef enum ColorSchemes_ { COLORSCHEME_DEFAULT = 0, COLORSCHEME_MONOCHROME = 1, COLORSCHEME_BLACKONWHITE = 2, COLORSCHEME_LIGHTTERMINAL = 3, COLORSCHEME_MIDNIGHT = 4, COLORSCHEME_BLACKNIGHT = 5, COLORSCHEME_BROKENGRAY = 6, LAST_COLORSCHEME = 7, } ColorSchemes; typedef enum ColorElements_ { RESET_COLOR, DEFAULT_COLOR, FUNCTION_BAR, FUNCTION_KEY, FAILED_SEARCH, PANEL_HEADER_FOCUS, PANEL_HEADER_UNFOCUS, PANEL_SELECTION_FOCUS, PANEL_SELECTION_FOLLOW, PANEL_SELECTION_UNFOCUS, LARGE_NUMBER, METER_TEXT, METER_VALUE, LED_COLOR, UPTIME, BATTERY, TASKS_RUNNING, SWAP, PROCESS, PROCESS_SHADOW, PROCESS_TAG, PROCESS_MEGABYTES, PROCESS_TREE, PROCESS_R_STATE, PROCESS_D_STATE, PROCESS_BASENAME, PROCESS_HIGH_PRIORITY, PROCESS_LOW_PRIORITY, PROCESS_THREAD, PROCESS_THREAD_BASENAME, BAR_BORDER, BAR_SHADOW, GRAPH_1, GRAPH_2, MEMORY_USED, MEMORY_BUFFERS, MEMORY_BUFFERS_TEXT, MEMORY_CACHE, LOAD, LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE, CHECK_BOX, CHECK_MARK, CHECK_TEXT, CLOCK, HELP_BOLD, HOSTNAME, CPU_NICE, CPU_NICE_TEXT, CPU_NORMAL, CPU_KERNEL, CPU_IOWAIT, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, LAST_COLORELEMENT } ColorElements; void CRT_fatalError(const char* note) __attribute__ ((noreturn)); void CRT_handleSIGSEGV(int sgn); #define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) }*/ const char *CRT_treeStrAscii[TREE_STR_COUNT] = { "-", // TREE_STR_HORZ "|", // TREE_STR_VERT "`", // TREE_STR_RTEE "`", // TREE_STR_BEND ",", // TREE_STR_TEND "+", // TREE_STR_OPEN "-", // TREE_STR_SHUT }; #ifdef HAVE_LIBNCURSESW const char *CRT_treeStrUtf8[TREE_STR_COUNT] = { "\xe2\x94\x80", // TREE_STR_HORZ ─ "\xe2\x94\x82", // TREE_STR_VERT │ "\xe2\x94\x9c", // TREE_STR_RTEE ├ "\xe2\x94\x94", // TREE_STR_BEND └ "\xe2\x94\x8c", // TREE_STR_TEND ┌ "+", // TREE_STR_OPEN + "\xe2\x94\x80", // TREE_STR_SHUT ─ }; bool CRT_utf8 = false; #endif const char **CRT_treeStr = CRT_treeStrAscii; static bool CRT_hasColors; int CRT_delay = 0; int* CRT_colors; int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [COLORSCHEME_DEFAULT] = { [RESET_COLOR] = ColorPair(White,Black), [DEFAULT_COLOR] = ColorPair(White,Black), [FUNCTION_BAR] = ColorPair(Black,Cyan), [FUNCTION_KEY] = ColorPair(White,Black), [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White), [FAILED_SEARCH] = ColorPair(Red,Cyan), [UPTIME] = A_BOLD | ColorPair(Cyan,Black), [BATTERY] = A_BOLD | ColorPair(Cyan,Black), [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black), [METER_TEXT] = ColorPair(Cyan,Black), [METER_VALUE] = A_BOLD | ColorPair(Cyan,Black), [LED_COLOR] = ColorPair(Green,Black), [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black), [PROCESS] = A_NORMAL, [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black), [PROCESS_MEGABYTES] = ColorPair(Cyan,Black), [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black), [PROCESS_TREE] = ColorPair(Cyan,Black), [PROCESS_R_STATE] = ColorPair(Green,Black), [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), [PROCESS_THREAD] = ColorPair(Green,Black), [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black), [BAR_BORDER] = A_BOLD, [BAR_SHADOW] = A_BOLD | ColorPairGrayBlack, [SWAP] = ColorPair(Red,Black), [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black), [GRAPH_2] = ColorPair(Cyan,Black), [MEMORY_USED] = ColorPair(Green,Black), [MEMORY_BUFFERS] = ColorPair(Blue,Black), [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black), [MEMORY_CACHE] = ColorPair(Yellow,Black), [LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan,Black), [LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan,Black), [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Black), [LOAD] = A_BOLD, [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black), [CLOCK] = A_BOLD, [CHECK_BOX] = ColorPair(Cyan,Black), [CHECK_MARK] = A_BOLD, [CHECK_TEXT] = A_NORMAL, [HOSTNAME] = A_BOLD, [CPU_NICE] = ColorPair(Blue,Black), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), [CPU_NORMAL] = ColorPair(Green,Black), [CPU_KERNEL] = ColorPair(Red,Black), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black), [CPU_IRQ] = ColorPair(Yellow,Black), [CPU_SOFTIRQ] = ColorPair(Magenta,Black), [CPU_STEAL] = ColorPair(Cyan,Black), [CPU_GUEST] = ColorPair(Cyan,Black), }, [COLORSCHEME_MONOCHROME] = { [RESET_COLOR] = A_NORMAL, [DEFAULT_COLOR] = A_NORMAL, [FUNCTION_BAR] = A_REVERSE, [FUNCTION_KEY] = A_NORMAL, [PANEL_HEADER_FOCUS] = A_REVERSE, [PANEL_HEADER_UNFOCUS] = A_REVERSE, [PANEL_SELECTION_FOCUS] = A_REVERSE, [PANEL_SELECTION_FOLLOW] = A_REVERSE, [PANEL_SELECTION_UNFOCUS] = A_BOLD, [FAILED_SEARCH] = A_REVERSE | A_BOLD, [UPTIME] = A_BOLD, [BATTERY] = A_BOLD, [LARGE_NUMBER] = A_BOLD, [METER_TEXT] = A_NORMAL, [METER_VALUE] = A_BOLD, [LED_COLOR] = A_NORMAL, [TASKS_RUNNING] = A_BOLD, [PROCESS] = A_NORMAL, [PROCESS_SHADOW] = A_DIM, [PROCESS_TAG] = A_BOLD, [PROCESS_MEGABYTES] = A_BOLD, [PROCESS_BASENAME] = A_BOLD, [PROCESS_TREE] = A_BOLD, [PROCESS_R_STATE] = A_BOLD, [PROCESS_D_STATE] = A_BOLD, [PROCESS_HIGH_PRIORITY] = A_BOLD, [PROCESS_LOW_PRIORITY] = A_DIM, [PROCESS_THREAD] = A_BOLD, [PROCESS_THREAD_BASENAME] = A_REVERSE, [BAR_BORDER] = A_BOLD, [BAR_SHADOW] = A_DIM, [SWAP] = A_BOLD, [GRAPH_1] = A_BOLD, [GRAPH_2] = A_NORMAL, [MEMORY_USED] = A_BOLD, [MEMORY_BUFFERS] = A_NORMAL, [MEMORY_BUFFERS_TEXT] = A_NORMAL, [MEMORY_CACHE] = A_NORMAL, [LOAD_AVERAGE_FIFTEEN] = A_DIM, [LOAD_AVERAGE_FIVE] = A_NORMAL, [LOAD_AVERAGE_ONE] = A_BOLD, [LOAD] = A_BOLD, [HELP_BOLD] = A_BOLD, [CLOCK] = A_BOLD, [CHECK_BOX] = A_BOLD, [CHECK_MARK] = A_NORMAL, [CHECK_TEXT] = A_NORMAL, [HOSTNAME] = A_BOLD, [CPU_NICE] = A_NORMAL, [CPU_NICE_TEXT] = A_NORMAL, [CPU_NORMAL] = A_BOLD, [CPU_KERNEL] = A_BOLD, [CPU_IOWAIT] = A_NORMAL, [CPU_IRQ] = A_BOLD, [CPU_SOFTIRQ] = A_BOLD, [CPU_STEAL] = A_REVERSE, [CPU_GUEST] = A_REVERSE, }, [COLORSCHEME_BLACKONWHITE] = { [RESET_COLOR] = ColorPair(Black,White), [DEFAULT_COLOR] = ColorPair(Black,White), [FUNCTION_BAR] = ColorPair(Black,Cyan), [FUNCTION_KEY] = ColorPair(Black,White), [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,White), [FAILED_SEARCH] = ColorPair(Red,Cyan), [UPTIME] = ColorPair(Yellow,White), [BATTERY] = ColorPair(Yellow,White), [LARGE_NUMBER] = ColorPair(Red,White), [METER_TEXT] = ColorPair(Blue,White), [METER_VALUE] = ColorPair(Black,White), [LED_COLOR] = ColorPair(Green,White), [TASKS_RUNNING] = ColorPair(Green,White), [PROCESS] = ColorPair(Black,White), [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White), [PROCESS_TAG] = ColorPair(White,Blue), [PROCESS_MEGABYTES] = ColorPair(Blue,White), [PROCESS_BASENAME] = ColorPair(Blue,White), [PROCESS_TREE] = ColorPair(Green,White), [PROCESS_R_STATE] = ColorPair(Green,White), [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,White), [PROCESS_HIGH_PRIORITY] = ColorPair(Red,White), [PROCESS_LOW_PRIORITY] = ColorPair(Green,White), [PROCESS_THREAD] = ColorPair(Blue,White), [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,White), [BAR_BORDER] = ColorPair(Blue,White), [BAR_SHADOW] = ColorPair(Black,White), [SWAP] = ColorPair(Red,White), [GRAPH_1] = A_BOLD | ColorPair(Blue,White), [GRAPH_2] = ColorPair(Blue,White), [MEMORY_USED] = ColorPair(Green,White), [MEMORY_BUFFERS] = ColorPair(Cyan,White), [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,White), [MEMORY_CACHE] = ColorPair(Yellow,White), [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,White), [LOAD_AVERAGE_FIVE] = ColorPair(Black,White), [LOAD_AVERAGE_ONE] = ColorPair(Black,White), [LOAD] = ColorPair(Black,White), [HELP_BOLD] = ColorPair(Blue,White), [CLOCK] = ColorPair(Black,White), [CHECK_BOX] = ColorPair(Blue,White), [CHECK_MARK] = ColorPair(Black,White), [CHECK_TEXT] = ColorPair(Black,White), [HOSTNAME] = ColorPair(Black,White), [CPU_NICE] = ColorPair(Cyan,White), [CPU_NICE_TEXT] = ColorPair(Cyan,White), [CPU_NORMAL] = ColorPair(Green,White), [CPU_KERNEL] = ColorPair(Red,White), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, White), [CPU_IRQ] = ColorPair(Blue,White), [CPU_SOFTIRQ] = ColorPair(Blue,White), [CPU_STEAL] = ColorPair(Cyan,White), [CPU_GUEST] = ColorPair(Cyan,White), }, [COLORSCHEME_LIGHTTERMINAL] = { [RESET_COLOR] = ColorPair(Black,Black), [DEFAULT_COLOR] = ColorPair(Black,Black), [FUNCTION_BAR] = ColorPair(Black,Cyan), [FUNCTION_KEY] = ColorPair(Black,Black), [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,Black), [FAILED_SEARCH] = ColorPair(Red,Cyan), [UPTIME] = ColorPair(Yellow,Black), [BATTERY] = ColorPair(Yellow,Black), [LARGE_NUMBER] = ColorPair(Red,Black), [METER_TEXT] = ColorPair(Blue,Black), [METER_VALUE] = ColorPair(Black,Black), [LED_COLOR] = ColorPair(Green,Black), [TASKS_RUNNING] = ColorPair(Green,Black), [PROCESS] = ColorPair(Black,Black), [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, [PROCESS_TAG] = ColorPair(White,Blue), [PROCESS_MEGABYTES] = ColorPair(Blue,Black), [PROCESS_BASENAME] = ColorPair(Green,Black), [PROCESS_TREE] = ColorPair(Blue,Black), [PROCESS_R_STATE] = ColorPair(Green,Black), [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), [PROCESS_THREAD] = ColorPair(Blue,Black), [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black), [BAR_BORDER] = ColorPair(Blue,Black), [BAR_SHADOW] = ColorPairGrayBlack, [SWAP] = ColorPair(Red,Black), [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black), [GRAPH_2] = ColorPair(Cyan,Black), [MEMORY_USED] = ColorPair(Green,Black), [MEMORY_BUFFERS] = ColorPair(Cyan,Black), [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,Black), [MEMORY_CACHE] = ColorPair(Yellow,Black), [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,Black), [LOAD_AVERAGE_FIVE] = ColorPair(Black,Black), [LOAD_AVERAGE_ONE] = ColorPair(Black,Black), [LOAD] = ColorPair(White,Black), [HELP_BOLD] = ColorPair(Blue,Black), [CLOCK] = ColorPair(White,Black), [CHECK_BOX] = ColorPair(Blue,Black), [CHECK_MARK] = ColorPair(Black,Black), [CHECK_TEXT] = ColorPair(Black,Black), [HOSTNAME] = ColorPair(White,Black), [CPU_NICE] = ColorPair(Cyan,Black), [CPU_NICE_TEXT] = ColorPair(Cyan,Black), [CPU_NORMAL] = ColorPair(Green,Black), [CPU_KERNEL] = ColorPair(Red,Black), [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black), [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), [CPU_SOFTIRQ] = ColorPair(Blue,Black), [CPU_STEAL] = ColorPair(Black,Black), [CPU_GUEST] = ColorPair(Black,Black), }, [COLORSCHEME_MIDNIGHT] = { [RESET_COLOR] = ColorPair(White,Blue), [DEFAULT_COLOR] = ColorPair(White,Blue), [FUNCTION_BAR] = ColorPair(Black,Cyan), [FUNCTION_KEY] = A_NORMAL, [PANEL_HEADER_FOCUS] = ColorPair(Black,Cyan), [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Cyan), [PANEL_SELECTION_FOCUS] = ColorPair(Black,White), [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), [PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow,Blue), [FAILED_SEARCH] = ColorPair(Red,Cyan), [UPTIME] = A_BOLD | ColorPair(Yellow,Blue), [BATTERY] = A_BOLD | ColorPair(Yellow,Blue), [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Blue), [METER_TEXT] = ColorPair(Cyan,Blue), [METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue), [LED_COLOR] = ColorPair(Green,Blue), [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue), [PROCESS] = ColorPair(White,Blue), [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue), [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue), [PROCESS_MEGABYTES] = ColorPair(Cyan,Blue), [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Blue), [PROCESS_TREE] = ColorPair(Cyan,Blue), [PROCESS_R_STATE] = ColorPair(Green,Blue), [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Blue), [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Blue), [PROCESS_LOW_PRIORITY] = ColorPair(Green,Blue), [PROCESS_THREAD] = ColorPair(Green,Blue), [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Blue), [BAR_BORDER] = A_BOLD | ColorPair(Yellow,Blue), [BAR_SHADOW] = ColorPair(Cyan,Blue), [SWAP] = ColorPair(Red,Blue), [GRAPH_1] = A_BOLD | ColorPair(Cyan,Blue), [GRAPH_2] = ColorPair(Cyan,Blue), [MEMORY_USED] = A_BOLD | ColorPair(Green,Blue), [MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan,Blue), [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan,Blue), [MEMORY_CACHE] = A_BOLD | ColorPair(Yellow,Blue), [LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Blue), [LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White,Blue), [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Blue), [LOAD] = A_BOLD | ColorPair(White,Blue), [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Blue), [CLOCK] = ColorPair(White,Blue), [CHECK_BOX] = ColorPair(Cyan,Blue), [CHECK_MARK] = A_BOLD | ColorPair(White,Blue), [CHECK_TEXT] = A_NORMAL | ColorPair(White,Blue), [HOSTNAME] = ColorPair(White,Blue), [CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan,Blue), [CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue), [CPU_KERNEL] = A_BOLD | ColorPair(Red,Blue), [CPU_IOWAIT] = A_BOLD | ColorPair(Blue,Blue), [CPU_IRQ] = A_BOLD | ColorPair(Black,Blue), [CPU_SOFTIRQ] = ColorPair(Black,Blue), [CPU_STEAL] = ColorPair(White,Blue), [CPU_GUEST] = ColorPair(White,Blue), }, [COLORSCHEME_BLACKNIGHT] = { [RESET_COLOR] = ColorPair(Cyan,Black), [DEFAULT_COLOR] = ColorPair(Cyan,Black), [FUNCTION_BAR] = ColorPair(Black,Green), [FUNCTION_KEY] = ColorPair(Cyan,Black), [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White), [FAILED_SEARCH] = ColorPair(Red,Cyan), [UPTIME] = ColorPair(Green,Black), [BATTERY] = ColorPair(Green,Black), [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black), [METER_TEXT] = ColorPair(Cyan,Black), [METER_VALUE] = ColorPair(Green,Black), [LED_COLOR] = ColorPair(Green,Black), [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black), [PROCESS] = ColorPair(Cyan,Black), [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black), [PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green,Black), [PROCESS_BASENAME] = A_BOLD | ColorPair(Green,Black), [PROCESS_TREE] = ColorPair(Cyan,Black), [PROCESS_THREAD] = ColorPair(Green,Black), [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black), [PROCESS_R_STATE] = ColorPair(Green,Black), [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), [BAR_BORDER] = A_BOLD | ColorPair(Green,Black), [BAR_SHADOW] = ColorPair(Cyan,Black), [SWAP] = ColorPair(Red,Black), [GRAPH_1] = A_BOLD | ColorPair(Green,Black), [GRAPH_2] = ColorPair(Green,Black), [MEMORY_USED] = ColorPair(Green,Black), [MEMORY_BUFFERS] = ColorPair(Blue,Black), [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black), [MEMORY_CACHE] = ColorPair(Yellow,Black), [LOAD_AVERAGE_FIFTEEN] = ColorPair(Green,Black), [LOAD_AVERAGE_FIVE] = ColorPair(Green,Black), [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green,Black), [LOAD] = A_BOLD, [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black), [CLOCK] = ColorPair(Green,Black), [CHECK_BOX] = ColorPair(Green,Black), [CHECK_MARK] = A_BOLD | ColorPair(Green,Black), [CHECK_TEXT] = ColorPair(Cyan,Black), [HOSTNAME] = ColorPair(Green,Black), [CPU_NICE] = ColorPair(Blue,Black), [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), [CPU_NORMAL] = ColorPair(Green,Black), [CPU_KERNEL] = ColorPair(Red,Black), [CPU_IOWAIT] = ColorPair(Yellow,Black), [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), [CPU_SOFTIRQ] = ColorPair(Blue,Black), [CPU_STEAL] = ColorPair(Cyan,Black), [CPU_GUEST] = ColorPair(Cyan,Black), }, [COLORSCHEME_BROKENGRAY] = { 0 } // dynamically generated. }; int CRT_cursorX = 0; int CRT_scrollHAmount = 5; int CRT_scrollWheelVAmount = 10; char* CRT_termType; // TODO move color scheme to Settings, perhaps? int CRT_colorScheme = 0; void *backtraceArray[128]; static void CRT_handleSIGTERM(int sgn) { (void) sgn; CRT_done(); exit(0); } #if HAVE_SETUID_ENABLED static int CRT_euid = -1; static int CRT_egid = -1; #define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0) void CRT_dropPrivileges() { CRT_egid = getegid(); CRT_euid = geteuid(); if (setegid(getgid()) == -1) { DIE("Fatal error: failed dropping group privileges.\n"); } if (seteuid(getuid()) == -1) { DIE("Fatal error: failed dropping user privileges.\n"); } } void CRT_restorePrivileges() { if (CRT_egid == -1 || CRT_euid == -1) { DIE("Fatal error: internal inconsistency.\n"); } if (setegid(CRT_egid) == -1) { DIE("Fatal error: failed restoring group privileges.\n"); } if (seteuid(CRT_euid) == -1) { DIE("Fatal error: failed restoring user privileges.\n"); } } #else /* Turn setuid operations into NOPs */ #ifndef CRT_dropPrivileges #define CRT_dropPrivileges() #define CRT_restorePrivileges() #endif #endif // TODO: pass an instance of Settings instead. void CRT_init(int delay, int colorScheme) { initscr(); noecho(); CRT_delay = delay; if (CRT_delay == 0) { CRT_delay = 1; } CRT_colors = CRT_colorSchemes[colorScheme]; CRT_colorScheme = colorScheme; for (int i = 0; i < LAST_COLORELEMENT; i++) { unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i]; CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White,Black) : color; } halfdelay(CRT_delay); nonl(); intrflush(stdscr, false); keypad(stdscr, true); mouseinterval(0); curs_set(0); if (has_colors()) { start_color(); CRT_hasColors = true; } else { CRT_hasColors = false; } CRT_termType = getenv("TERM"); if (String_eq(CRT_termType, "linux")) CRT_scrollHAmount = 20; else CRT_scrollHAmount = 5; if (String_startsWith(CRT_termType, "xterm") || String_eq(CRT_termType, "vt220")) { define_key("\033[H", KEY_HOME); define_key("\033[F", KEY_END); define_key("\033[7~", KEY_HOME); define_key("\033[8~", KEY_END); define_key("\033OP", KEY_F(1)); define_key("\033OQ", KEY_F(2)); define_key("\033OR", KEY_F(3)); define_key("\033OS", KEY_F(4)); define_key("\033[11~", KEY_F(1)); define_key("\033[12~", KEY_F(2)); define_key("\033[13~", KEY_F(3)); define_key("\033[14~", KEY_F(4)); define_key("\033[17;2~", KEY_F(18)); char sequence[3] = "\033a"; for (char c = 'a'; c <= 'z'; c++) { sequence[1] = c; define_key(sequence, KEY_ALT('A' + (c - 'a'))); } } #ifndef DEBUG signal(11, CRT_handleSIGSEGV); #endif signal(SIGTERM, CRT_handleSIGTERM); signal(SIGQUIT, CRT_handleSIGTERM); use_default_colors(); if (!has_colors()) CRT_colorScheme = 1; CRT_setColors(CRT_colorScheme); /* initialize locale */ setlocale(LC_CTYPE, ""); #ifdef HAVE_LIBNCURSESW if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0) CRT_utf8 = true; else CRT_utf8 = false; #endif CRT_treeStr = #ifdef HAVE_LIBNCURSESW CRT_utf8 ? CRT_treeStrUtf8 : #endif CRT_treeStrAscii; #if NCURSES_MOUSE_VERSION > 1 mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL); #else mousemask(BUTTON1_RELEASED, NULL); #endif } void CRT_done() { curs_set(1); endwin(); } void CRT_fatalError(const char* note) { char* sysMsg = strerror(errno); CRT_done(); fprintf(stderr, "%s: %s\n", note, sysMsg); exit(2); } int CRT_readKey() { nocbreak(); cbreak(); nodelay(stdscr, FALSE); int ret = getch(); halfdelay(CRT_delay); return ret; } void CRT_disableDelay() { nocbreak(); cbreak(); nodelay(stdscr, TRUE); } void CRT_enableDelay() { halfdelay(CRT_delay); } void CRT_setColors(int colorScheme) { CRT_colorScheme = colorScheme; if (colorScheme == COLORSCHEME_BLACKNIGHT) { for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) { if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) { init_pair(ColorIndex(i,j), i, j); } } init_pair(ColorIndex(Magenta,Magenta), 8, 0); } else { for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) { if (ColorIndex(i,j) != ColorIndex(Magenta,Magenta)) { init_pair(ColorIndex(i,j), i, (j==0?-1:j)); } } init_pair(ColorIndex(Magenta,Magenta), 8, -1); } CRT_colors = CRT_colorSchemes[colorScheme]; } htop-2.1.0/Affinity.c0000644000175000001440000000535313152362772011334 00000000000000/* htop - Affinity.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Affinity.h" #include #ifdef HAVE_LIBHWLOC #include #if __linux__ #define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_THREAD #else #define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS #endif #elif HAVE_LINUX_AFFINITY #include #endif /*{ #include "Process.h" #include "ProcessList.h" typedef struct Affinity_ { ProcessList* pl; int size; int used; int* cpus; } Affinity; }*/ Affinity* Affinity_new(ProcessList* pl) { Affinity* this = xCalloc(1, sizeof(Affinity)); this->size = 8; this->cpus = xCalloc(this->size, sizeof(int)); this->pl = pl; return this; } void Affinity_delete(Affinity* this) { free(this->cpus); free(this); } void Affinity_add(Affinity* this, int id) { if (this->used == this->size) { this->size *= 2; this->cpus = xRealloc(this->cpus, sizeof(int) * this->size); } this->cpus[this->used] = id; this->used++; } #ifdef HAVE_LIBHWLOC Affinity* Affinity_get(Process* proc, ProcessList* pl) { hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); bool ok = (hwloc_get_proc_cpubind(pl->topology, proc->pid, cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0); Affinity* affinity = NULL; if (ok) { affinity = Affinity_new(pl); if (hwloc_bitmap_last(cpuset) == -1) { for (int i = 0; i < pl->cpuCount; i++) { Affinity_add(affinity, i); } } else { unsigned int id; hwloc_bitmap_foreach_begin(id, cpuset); Affinity_add(affinity, id); hwloc_bitmap_foreach_end(); } } hwloc_bitmap_free(cpuset); return affinity; } bool Affinity_set(Process* proc, Affinity* this) { hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); for (int i = 0; i < this->used; i++) { hwloc_bitmap_set(cpuset, this->cpus[i]); } bool ok = (hwloc_set_proc_cpubind(this->pl->topology, proc->pid, cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0); hwloc_bitmap_free(cpuset); return ok; } #elif HAVE_LINUX_AFFINITY Affinity* Affinity_get(Process* proc, ProcessList* pl) { cpu_set_t cpuset; bool ok = (sched_getaffinity(proc->pid, sizeof(cpu_set_t), &cpuset) == 0); if (!ok) return NULL; Affinity* affinity = Affinity_new(pl); for (int i = 0; i < pl->cpuCount; i++) { if (CPU_ISSET(i, &cpuset)) Affinity_add(affinity, i); } return affinity; } bool Affinity_set(Process* proc, Affinity* this) { cpu_set_t cpuset; CPU_ZERO(&cpuset); for (int i = 0; i < this->used; i++) { CPU_SET(this->cpus[i], &cpuset); } bool ok = (sched_setaffinity(proc->pid, sizeof(unsigned long), &cpuset) == 0); return ok; } #endif htop-2.1.0/AvailableColumnsPanel.c0000644000175000001440000000502113235624301013743 00000000000000/* htop - AvailableColumnsPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "AvailableColumnsPanel.h" #include "Platform.h" #include "Header.h" #include "ColumnsPanel.h" #include #include #include #include /*{ #include "Panel.h" typedef struct AvailableColumnsPanel_ { Panel super; Panel* columns; } AvailableColumnsPanel; }*/ static const char* const AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL}; static void AvailableColumnsPanel_delete(Object* object) { Panel* super = (Panel*) object; AvailableColumnsPanel* this = (AvailableColumnsPanel*) object; Panel_done(super); free(this); } static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) { AvailableColumnsPanel* this = (AvailableColumnsPanel*) super; int key = ((ListItem*) Panel_getSelected(super))->key; HandlerResult result = IGNORED; switch(ch) { case 13: case KEY_ENTER: case KEY_F(5): { int at = Panel_getSelectedIndex(this->columns); Panel_insert(this->columns, at, (Object*) ListItem_new(Process_fields[key].name, key)); Panel_setSelected(this->columns, at+1); ColumnsPanel_update(this->columns); result = HANDLED; break; } default: { if (ch < 255 && isalpha(ch)) result = Panel_selectByTyping(super, ch); break; } } return result; } PanelClass AvailableColumnsPanel_class = { .super = { .extends = Class(Panel), .delete = AvailableColumnsPanel_delete }, .eventHandler = AvailableColumnsPanel_eventHandler }; AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns) { AvailableColumnsPanel* this = AllocThis(AvailableColumnsPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(AvailableColumnsFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); Panel_setHeader(super, "Available Columns"); for (int i = 1; i < Platform_numberOfFields; i++) { if (i != COMM && Process_fields[i].description) { char description[256]; xSnprintf(description, sizeof(description), "%s - %s", Process_fields[i].name, Process_fields[i].description); Panel_add(super, (Object*) ListItem_new(description, i)); } } this->columns = columns; return this; } htop-2.1.0/OpenFilesScreen.c0000644000175000001440000001050713152362772012604 00000000000000/* htop - OpenFilesScreen.c (C) 2005-2006 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "OpenFilesScreen.h" #include "CRT.h" #include "ProcessList.h" #include "IncSet.h" #include "StringUtils.h" #include "FunctionBar.h" #include #include #include #include #include #include #include #include #include /*{ #include "InfoScreen.h" typedef struct OpenFiles_Data_ { char* data[256]; } OpenFiles_Data; typedef struct OpenFiles_ProcessData_ { OpenFiles_Data data; int error; struct OpenFiles_FileData_* files; } OpenFiles_ProcessData; typedef struct OpenFiles_FileData_ { OpenFiles_Data data; struct OpenFiles_FileData_* next; } OpenFiles_FileData; typedef struct OpenFilesScreen_ { InfoScreen super; pid_t pid; } OpenFilesScreen; }*/ InfoScreenClass OpenFilesScreen_class = { .super = { .extends = Class(Object), .delete = OpenFilesScreen_delete }, .scan = OpenFilesScreen_scan, .draw = OpenFilesScreen_draw }; OpenFilesScreen* OpenFilesScreen_new(Process* process) { OpenFilesScreen* this = xMalloc(sizeof(OpenFilesScreen)); Object_setClass(this, Class(OpenFilesScreen)); if (Process_isThread(process)) this->pid = process->tgid; else this->pid = process->pid; return (OpenFilesScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " FD TYPE DEVICE SIZE NODE NAME"); } void OpenFilesScreen_delete(Object* this) { free(InfoScreen_done((InfoScreen*)this)); } void OpenFilesScreen_draw(InfoScreen* this) { InfoScreen_drawTitled(this, "Snapshot of files open in process %d - %s", ((OpenFilesScreen*)this)->pid, this->process->comm); } static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { char command[1025]; xSnprintf(command, 1024, "lsof -P -p %d -F 2> /dev/null", pid); FILE* fd = popen(command, "r"); OpenFiles_ProcessData* pdata = xCalloc(1, sizeof(OpenFiles_ProcessData)); OpenFiles_FileData* fdata = NULL; OpenFiles_Data* item = &(pdata->data); if (!fd) { pdata->error = 127; return pdata; } for (;;) { char* line = String_readLine(fd); if (!line) { break; } unsigned char cmd = line[0]; if (cmd == 'f') { OpenFiles_FileData* nextFile = xCalloc(1, sizeof(OpenFiles_FileData)); if (fdata == NULL) { pdata->files = nextFile; } else { fdata->next = nextFile; } fdata = nextFile; item = &(fdata->data); } item->data[cmd] = xStrdup(line + 1); free(line); } pdata->error = pclose(fd); return pdata; } static inline void OpenFiles_Data_clear(OpenFiles_Data* data) { for (int i = 0; i < 255; i++) if (data->data[i]) free(data->data[i]); } void OpenFilesScreen_scan(InfoScreen* this) { Panel* panel = this->display; int idx = Panel_getSelectedIndex(panel); Panel_prune(panel); OpenFiles_ProcessData* pdata = OpenFilesScreen_getProcessData(((OpenFilesScreen*)this)->pid); if (pdata->error == 127) { InfoScreen_addLine(this, "Could not execute 'lsof'. Please make sure it is available in your $PATH."); } else if (pdata->error == 1) { InfoScreen_addLine(this, "Failed listing open files."); } else { OpenFiles_FileData* fdata = pdata->files; while (fdata) { char** data = fdata->data.data; int lenN = data['n'] ? strlen(data['n']) : 0; int sizeEntry = 5 + 7 + 10 + 10 + 10 + lenN + 5 /*spaces*/ + 1 /*null*/; char* entry = xMalloc(sizeEntry); xSnprintf(entry, sizeEntry, "%5.5s %7.7s %10.10s %10.10s %10.10s %s", data['f'] ? data['f'] : "", data['t'] ? data['t'] : "", data['D'] ? data['D'] : "", data['s'] ? data['s'] : "", data['i'] ? data['i'] : "", data['n'] ? data['n'] : ""); InfoScreen_addLine(this, entry); OpenFiles_Data_clear(&fdata->data); OpenFiles_FileData* old = fdata; fdata = fdata->next; free(old); } OpenFiles_Data_clear(&pdata->data); } free(pdata); Vector_insertionSort(this->lines); Vector_insertionSort(panel->items); Panel_setSelected(panel, idx); } htop-2.1.0/scripts/0000755000175000001440000000000013235655643011164 500000000000000htop-2.1.0/scripts/MakeHeader.py0000755000175000001440000000513113235653611013440 00000000000000#!/usr/bin/env python import os, sys, string try: from cStringIO import StringIO except ImportError: try: from StringIO import StringIO except ImportError: from io import StringIO ANY=1 COPY=2 SKIP=3 SKIPONE=4 state = ANY static = 0 file = open(sys.argv[1]) name = sys.argv[1][:-2] out = StringIO() selfheader = '#include "' + name + '.h"' out.write( "/* Do not edit this file. It was automatically generated. */\n" ) out.write( "\n" ) out.write( "#ifndef HEADER_" + os.path.basename(name) + "\n") out.write( "#define HEADER_" + os.path.basename(name) + "\n") is_blank = False for line in file.readlines(): line = line[:-1] if state == ANY: if line == '/*{': state = COPY elif line == selfheader: pass elif line.find("#include") == 0: pass elif line.find("htop - ") == 0 and line[-2:] == ".c": out.write(line[:-2] + ".h\n") elif line.find("static ") != -1: if line[-1] == "{": state = SKIP static = 1 else: state = SKIPONE elif len(line) > 1: static = 0 equals = line.find(" = ") if line[-3:] == "= {": out.write( "extern " + line[:-4] + ";\n" ) state = SKIP elif equals != -1: out.write("extern " + line[:equals] + ";\n" ) elif line.startswith("typedef struct"): state = SKIP elif line[-1] == "{": out.write( line[:-2].replace("inline", "extern") + ";\n" ) state = SKIP else: out.write( line + "\n") is_blank = False elif line == "": if not is_blank: out.write( line + "\n") is_blank = True else: out.write( line + "\n") is_blank = False elif state == COPY: is_blank = False if line == "}*/": state = ANY else: out.write( line + "\n") elif state == SKIP: is_blank = False if len(line) >= 1 and line[0] == "}": if static == 1: state = SKIPONE else: state = ANY static = 0 elif state == SKIPONE: is_blank = False state = ANY out.write( "\n" ) out.write( "#endif\n" ) # only write a new .h file if something changed. # This prevents a lot of recompilation during development out.seek(0) try: with open(name + ".h", "r") as orig: origcontents = orig.readlines() except: origcontents = "" if origcontents != out.readlines(): with open(name + ".h", "w") as new: print("Writing "+name+".h") new.write(out.getvalue()) out.close() htop-2.1.0/configure0000755000175000001440000072207413235655576011345 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for htop 2.1.0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: hisham@gobolinux.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='htop' PACKAGE_TARNAME='htop' PACKAGE_VERSION='2.1.0' PACKAGE_STRING='htop 2.1.0' PACKAGE_BUGREPORT='hisham@gobolinux.org' PACKAGE_URL='' ac_unique_file="htop.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS my_htop_platform HTOP_UNSUPPORTED_FALSE HTOP_UNSUPPORTED_TRUE HTOP_DARWIN_FALSE HTOP_DARWIN_TRUE HTOP_OPENBSD_FALSE HTOP_OPENBSD_TRUE HTOP_DRAGONFLYBSD_FALSE HTOP_DRAGONFLYBSD_TRUE HTOP_FREEBSD_FALSE HTOP_FREEBSD_TRUE HTOP_LINUX_FALSE HTOP_LINUX_TRUE LIBNL3GENL_LIBS LIBNL3GENL_CFLAGS LIBNL3_LIBS LIBNL3_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG wextra_flag LIBOBJS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_proc with_proc enable_openvz enable_cgroup enable_vserver enable_ancient_vserver enable_taskstats enable_unicode enable_linux_affinity enable_hwloc enable_setuid enable_delayacct ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBNL3_CFLAGS LIBNL3_LIBS LIBNL3GENL_CFLAGS LIBNL3GENL_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures htop 2.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/htop] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of htop 2.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-proc use Linux-compatible proc filesystem --enable-openvz enable OpenVZ support --enable-cgroup enable cgroups support --enable-vserver enable VServer support --enable-ancient-vserver enable ancient VServer support (implies --enable-vserver) --enable-taskstats enable per-task IO Stats (taskstats kernel sup required) --enable-unicode enable Unicode support --enable-linux-affinity enable Linux sched_setaffinity and sched_getaffinity for affinity support, disables hwloc --enable-hwloc enable hwloc support for CPU affinity --enable-setuid enable setuid support for platforms that need it --enable-delayacct enable linux delay accounting Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-proc=DIR Location of a Linux-compatible proc filesystem (default=/proc). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBNL3_CFLAGS C compiler flags for LIBNL3, overriding pkg-config LIBNL3_LIBS linker flags for LIBNL3, overriding pkg-config LIBNL3GENL_CFLAGS C compiler flags for LIBNL3GENL, overriding pkg-config LIBNL3GENL_LIBS linker flags for LIBNL3GENL, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF htop configure 2.1.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ----------------------------------- ## ## Report this to hisham@gobolinux.org ## ## ----------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by htop $as_me 2.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" year=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u "+%Y") ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" # Required by hwloc scripts # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='htop' VERSION='2.1.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Checks for programs. # ---------------------------------------------------------------------- ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Required by hwloc scripts ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # Checks for platform. # ---------------------------------------------------------------------- case "$target_os" in linux*|gnu*) my_htop_platform=linux ;; freebsd*|kfreebsd*) my_htop_platform=freebsd ;; openbsd*) my_htop_platform=openbsd ;; dragonfly*) my_htop_platform=dragonflybsd ;; darwin*) my_htop_platform=darwin ;; *) my_htop_platform=unsupported ;; esac # Checks for libraries. # ---------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5 $as_echo_n "checking for ceil in -lm... " >&6; } if ${ac_cv_lib_m_ceil+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ceil (); int main () { return ceil (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_ceil=yes else ac_cv_lib_m_ceil=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_ceil" >&5 $as_echo "$ac_cv_lib_m_ceil" >&6; } if test "x$ac_cv_lib_m_ceil" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else missing_libraries="$missing_libraries libm" fi # Checks for header files. # ---------------------------------------------------------------------- ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF : else missing_headers="$missing_headers $ac_header" fi done for ac_header in execinfo.h do : ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" if test "x$ac_cv_header_execinfo_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EXECINFO_H 1 _ACEOF : else : fi done # Checks for typedefs, structures, and compiler characteristics. # ---------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi # Checks for library functions and compiler features. # ---------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 $as_echo_n "checking whether closedir returns void... " >&6; } if ${ac_cv_func_closedir_void+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_closedir_void=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include <$ac_header_dirent> #ifndef __cplusplus int closedir (); #endif int main () { return closedir (opendir (".")) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_closedir_void=no else ac_cv_func_closedir_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 $as_echo "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then $as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if ${ac_cv_func_stat_empty_string_bug+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_stat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_func in memmove strncasecmp strstr strdup do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done save_cflags="${CFLAGS}" CFLAGS="${CFLAGS} -std=c99" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc -std=c99 option works" >&5 $as_echo_n "checking whether gcc -std=c99 option works... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char *a; a = strdup("foo"); int i = 0; i++; // C99 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "htop is written in C99. A newer version of gcc is required." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_cflags" save_cflags="${CFLAGS}" CFLAGS="$CFLAGS -Wextra" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Wextra" >&5 $as_echo_n "checking if compiler supports -Wextra... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : wextra_flag=-Wextra { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else wextra_flag= { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_cflags" # Checks for features and flags. # ---------------------------------------------------------------------- PROCDIR=/proc # Check whether --enable-proc was given. if test "${enable_proc+set}" = set; then : enableval=$enable_proc; enable_proc="yes" else enable_proc="no" fi if test "x$enable_proc" = xyes; then # An enabled proc assumes we're emulating Linux. my_htop_platform=linux $as_echo "#define HAVE_PROC 1" >>confdefs.h fi # Check whether --with-proc was given. if test "${with_proc+set}" = set; then : withval=$with_proc; if test -n "$withval"; then cat >>confdefs.h <<_ACEOF #define PROCDIR "$withval" _ACEOF PROCDIR="$withval" fi else $as_echo "#define PROCDIR \"/proc\"" >>confdefs.h fi if test "x$cross_compiling" = xno; then if test "x$enable_proc" = xyes; then as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/stat" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/stat" >&5 $as_echo_n "checking for $PROCDIR/stat... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$PROCDIR/stat"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : else as_fn_error $? "Cannot find $PROCDIR/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5 fi as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/meminfo" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/meminfo" >&5 $as_echo_n "checking for $PROCDIR/meminfo... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$PROCDIR/meminfo"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : else as_fn_error $? "Cannot find $PROCDIR/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5 fi fi fi # Check whether --enable-openvz was given. if test "${enable_openvz+set}" = set; then : enableval=$enable_openvz; else enable_openvz="no" fi if test "x$enable_openvz" = xyes; then $as_echo "#define HAVE_OPENVZ 1" >>confdefs.h fi # Check whether --enable-cgroup was given. if test "${enable_cgroup+set}" = set; then : enableval=$enable_cgroup; else enable_cgroup="no" fi if test "x$enable_cgroup" = xyes; then $as_echo "#define HAVE_CGROUP 1" >>confdefs.h fi # Check whether --enable-vserver was given. if test "${enable_vserver+set}" = set; then : enableval=$enable_vserver; else enable_vserver="no" fi if test "x$enable_vserver" = xyes; then $as_echo "#define HAVE_VSERVER 1" >>confdefs.h fi # Check whether --enable-ancient_vserver was given. if test "${enable_ancient_vserver+set}" = set; then : enableval=$enable_ancient_vserver; else enable_ancient_vserver="no" fi if test "x$enable_ancient_vserver" = xyes; then $as_echo "#define HAVE_VSERVER 1" >>confdefs.h $as_echo "#define HAVE_ANCIENT_VSERVER 1" >>confdefs.h fi # Check whether --enable-taskstats was given. if test "${enable_taskstats+set}" = set; then : enableval=$enable_taskstats; else enable_taskstats="yes" fi if test "x$enable_taskstats" = xyes; then $as_echo "#define HAVE_TASKSTATS 1" >>confdefs.h fi # HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART) # HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART) # Check whether --enable-unicode was given. if test "${enable_unicode+set}" = set; then : enableval=$enable_unicode; else enable_unicode="yes" fi if test "x$enable_unicode" = xyes; then if test ! -z "$HTOP_NCURSESW6_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSESW6_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncursesw6-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw6" >&5 $as_echo_n "checking for addnwstr in -lncursesw6... " >&6; } if ${ac_cv_lib_ncursesw6_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw6 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncursesw6_addnwstr=yes else ac_cv_lib_ncursesw6_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw6_addnwstr" >&5 $as_echo "$ac_cv_lib_ncursesw6_addnwstr" >&6; } if test "x$ac_cv_lib_ncursesw6_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then if test ! -z "$HTOP_NCURSESW_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSESW_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncursesw6-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5 $as_echo_n "checking for addnwstr in -lncursesw... " >&6; } if ${ac_cv_lib_ncursesw_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncursesw_addnwstr=yes else ac_cv_lib_ncursesw_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5 $as_echo "$ac_cv_lib_ncursesw_addnwstr" >&6; } if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then if test ! -z "$HTOP_NCURSESW_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSESW_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncursesw5-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5 $as_echo_n "checking for addnwstr in -lncursesw... " >&6; } if ${ac_cv_lib_ncursesw_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncursesw_addnwstr=yes else ac_cv_lib_ncursesw_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5 $as_echo "$ac_cv_lib_ncursesw_addnwstr" >&6; } if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then if test ! -z "$HTOP_NCURSES_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSES_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncurses5-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncurses" >&5 $as_echo_n "checking for addnwstr in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_addnwstr=yes else ac_cv_lib_ncurses_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_addnwstr" >&5 $as_echo "$ac_cv_lib_ncurses_addnwstr" >&6; } if test "x$ac_cv_lib_ncurses_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw6" >&5 $as_echo_n "checking for addnwstr in -lncursesw6... " >&6; } if ${ac_cv_lib_ncursesw6_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw6 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncursesw6_addnwstr=yes else ac_cv_lib_ncursesw6_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw6_addnwstr" >&5 $as_echo "$ac_cv_lib_ncursesw6_addnwstr" >&6; } if test "x$ac_cv_lib_ncursesw6_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="-lncursesw6 $LIBS " else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5 $as_echo_n "checking for addnwstr in -lncursesw... " >&6; } if ${ac_cv_lib_ncursesw_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncursesw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncursesw_addnwstr=yes else ac_cv_lib_ncursesw_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5 $as_echo "$ac_cv_lib_ncursesw_addnwstr" >&6; } if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="-lncursesw $LIBS " else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncurses" >&5 $as_echo_n "checking for addnwstr in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_addnwstr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char addnwstr (); int main () { return addnwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_addnwstr=yes else ac_cv_lib_ncurses_addnwstr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_addnwstr" >&5 $as_echo "$ac_cv_lib_ncurses_addnwstr" >&6; } if test "x$ac_cv_lib_ncurses_addnwstr" = xyes; then : $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h LIBS="-lncurses $LIBS " else missing_libraries="$missing_libraries libncursesw" as_fn_error $? "You may want to use --disable-unicode or install libncursesw." "$LINENO" 5 fi fi fi fi fi fi fi for ac_header in ncursesw/curses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncursesw/curses.h" "ac_cv_header_ncursesw_curses_h" "$ac_includes_default" if test "x$ac_cv_header_ncursesw_curses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSESW_CURSES_H 1 _ACEOF : else for ac_header in ncurses/ncurses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_NCURSES_H 1 _ACEOF : else for ac_header in ncurses/curses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses/curses.h" "ac_cv_header_ncurses_curses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_curses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_CURSES_H 1 _ACEOF : else for ac_header in ncurses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_H 1 _ACEOF : else missing_headers="$missing_headers $ac_header" fi done fi done fi done fi done else if test ! -z "$HTOP_NCURSES6_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSES6_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncurses6-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses6" >&5 $as_echo_n "checking for refresh in -lncurses6... " >&6; } if ${ac_cv_lib_ncurses6_refresh+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses6 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char refresh (); int main () { return refresh (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses6_refresh=yes else ac_cv_lib_ncurses6_refresh=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses6_refresh" >&5 $as_echo "$ac_cv_lib_ncurses6_refresh" >&6; } if test "x$ac_cv_lib_ncurses6_refresh" = xyes; then : $as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then if test ! -z "$HTOP_NCURSES_CONFIG_SCRIPT"; then # to be used to set the path to ncurses*-config when cross-compiling htop_config_script=$($HTOP_NCURSES_CONFIG_SCRIPT --libs 2> /dev/null) else htop_config_script=$("ncurses5-config" --libs 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" if test ! "x$htop_config_script" = x; then LDFLAGS="$htop_config_script $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses" >&5 $as_echo_n "checking for refresh in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_refresh+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char refresh (); int main () { return refresh (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_refresh=yes else ac_cv_lib_ncurses_refresh=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_refresh" >&5 $as_echo "$ac_cv_lib_ncurses_refresh" >&6; } if test "x$ac_cv_lib_ncurses_refresh" = xyes; then : $as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h LIBS="$htop_config_script $LIBS " htop_script_success=yes fi LDFLAGS="$save_LDFLAGS" fi if test "x$htop_script_success" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses6" >&5 $as_echo_n "checking for refresh in -lncurses6... " >&6; } if ${ac_cv_lib_ncurses6_refresh+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses6 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char refresh (); int main () { return refresh (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses6_refresh=yes else ac_cv_lib_ncurses6_refresh=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses6_refresh" >&5 $as_echo "$ac_cv_lib_ncurses6_refresh" >&6; } if test "x$ac_cv_lib_ncurses6_refresh" = xyes; then : $as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h LIBS="-lncurses6 $LIBS " else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses" >&5 $as_echo_n "checking for refresh in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_refresh+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char refresh (); int main () { return refresh (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_refresh=yes else ac_cv_lib_ncurses_refresh=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_refresh" >&5 $as_echo "$ac_cv_lib_ncurses_refresh" >&6; } if test "x$ac_cv_lib_ncurses_refresh" = xyes; then : $as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h LIBS="-lncurses $LIBS " else missing_libraries="$missing_libraries libncurses" fi fi fi fi for ac_header in curses.h do : ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CURSES_H 1 _ACEOF : else for ac_header in ncurses/curses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses/curses.h" "ac_cv_header_ncurses_curses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_curses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_CURSES_H 1 _ACEOF : else for ac_header in ncurses/ncurses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_NCURSES_H 1 _ACEOF : else for ac_header in ncurses.h do : ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_H 1 _ACEOF : else missing_headers="$missing_headers $ac_header" fi done fi done fi done fi done fi if test "$my_htop_platform" = "freebsd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 $as_echo_n "checking for kvm_open in -lkvm... " >&6; } if ${ac_cv_lib_kvm_kvm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kvm_open (); int main () { return kvm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvm_kvm_open=yes else ac_cv_lib_kvm_kvm_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKVM 1 _ACEOF LIBS="-lkvm $LIBS" else missing_libraries="$missing_libraries libkvm" fi fi if test "$my_htop_platform" = "openbsd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 $as_echo_n "checking for kvm_open in -lkvm... " >&6; } if ${ac_cv_lib_kvm_kvm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kvm_open (); int main () { return kvm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvm_kvm_open=yes else ac_cv_lib_kvm_kvm_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKVM 1 _ACEOF LIBS="-lkvm $LIBS" else missing_libraries="$missing_libraries libkvm" fi fi # Check whether --enable-linux_affinity was given. if test "${enable_linux_affinity+set}" = set; then : enableval=$enable_linux_affinity; else enable_linux_affinity="yes" fi if test "x$enable_linux_affinity" = xyes -a "x$cross_compiling" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable sched_setaffinity" >&5 $as_echo_n "checking for usable sched_setaffinity... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include static cpu_set_t cpuset; int main () { CPU_ZERO(&cpuset); sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); if (errno == ENOSYS) return 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else enable_linux_affinity=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test "x$enable_linux_affinity" = xyes; then $as_echo "#define HAVE_LINUX_AFFINITY 1" >>confdefs.h fi # Check whether --enable-hwloc was given. if test "${enable_hwloc+set}" = set; then : enableval=$enable_hwloc; else enable_hwloc="no" fi if test "x$enable_hwloc" = xyes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hwloc_get_proc_cpubind in -lhwloc" >&5 $as_echo_n "checking for hwloc_get_proc_cpubind in -lhwloc... " >&6; } if ${ac_cv_lib_hwloc_hwloc_get_proc_cpubind+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhwloc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char hwloc_get_proc_cpubind (); int main () { return hwloc_get_proc_cpubind (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hwloc_hwloc_get_proc_cpubind=yes else ac_cv_lib_hwloc_hwloc_get_proc_cpubind=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hwloc_hwloc_get_proc_cpubind" >&5 $as_echo "$ac_cv_lib_hwloc_hwloc_get_proc_cpubind" >&6; } if test "x$ac_cv_lib_hwloc_hwloc_get_proc_cpubind" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBHWLOC 1 _ACEOF LIBS="-lhwloc $LIBS" else missing_libraries="$missing_libraries libhwloc" fi for ac_header in hwloc.h do : ac_fn_c_check_header_mongrel "$LINENO" "hwloc.h" "ac_cv_header_hwloc_h" "$ac_includes_default" if test "x$ac_cv_header_hwloc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_HWLOC_H 1 _ACEOF : else missing_headers="$missing_headers $ac_header" fi done fi # Check whether --enable-setuid was given. if test "${enable_setuid+set}" = set; then : enableval=$enable_setuid; else enable_setuid="no" fi if test "x$enable_setuid" = xyes then $as_echo "#define HAVE_SETUID_ENABLED 1" >>confdefs.h fi # Check whether --enable-delayacct was given. if test "${enable_delayacct+set}" = set; then : enableval=$enable_delayacct; else enable_delayacct="no" fi if test "x$enable_delayacct" = xyes then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL3" >&5 $as_echo_n "checking for LIBNL3... " >&6; } if test -n "$LIBNL3_CFLAGS"; then pkg_cv_LIBNL3_CFLAGS="$LIBNL3_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnl-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNL3_CFLAGS=`$PKG_CONFIG --cflags "libnl-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBNL3_LIBS"; then pkg_cv_LIBNL3_LIBS="$LIBNL3_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnl-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNL3_LIBS=`$PKG_CONFIG --libs "libnl-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBNL3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnl-3.0" 2>&1` else LIBNL3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnl-3.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBNL3_PKG_ERRORS" >&5 missing_libraries="$missing_libraries libnl-3" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } missing_libraries="$missing_libraries libnl-3" else LIBNL3_CFLAGS=$pkg_cv_LIBNL3_CFLAGS LIBNL3_LIBS=$pkg_cv_LIBNL3_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL3GENL" >&5 $as_echo_n "checking for LIBNL3GENL... " >&6; } if test -n "$LIBNL3GENL_CFLAGS"; then pkg_cv_LIBNL3GENL_CFLAGS="$LIBNL3GENL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-genl-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnl-genl-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNL3GENL_CFLAGS=`$PKG_CONFIG --cflags "libnl-genl-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBNL3GENL_LIBS"; then pkg_cv_LIBNL3GENL_LIBS="$LIBNL3GENL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-genl-3.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libnl-genl-3.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBNL3GENL_LIBS=`$PKG_CONFIG --libs "libnl-genl-3.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBNL3GENL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnl-genl-3.0" 2>&1` else LIBNL3GENL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnl-genl-3.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBNL3GENL_PKG_ERRORS" >&5 missing_libraries="$missing_libraries libnl-genl-3" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } missing_libraries="$missing_libraries libnl-genl-3" else LIBNL3GENL_CFLAGS=$pkg_cv_LIBNL3GENL_CFLAGS LIBNL3GENL_LIBS=$pkg_cv_LIBNL3GENL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi CFLAGS+=" $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" LIBS+=" $LIBNL3_LIBS $LIBNL3GENL_LIBS" $as_echo "#define HAVE_DELAYACCT 1" >>confdefs.h fi # Bail out on errors. # ---------------------------------------------------------------------- if test ! -z "$missing_libraries"; then as_fn_error $? "missing libraries: $missing_libraries" "$LINENO" 5 fi if test ! -z "$missing_headers"; then as_fn_error $? "missing headers: $missing_headers" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define COPYRIGHT "(C) 2004-$year Hisham Muhammad" _ACEOF # We're done, let's go! # ---------------------------------------------------------------------- if test "$my_htop_platform" = linux; then HTOP_LINUX_TRUE= HTOP_LINUX_FALSE='#' else HTOP_LINUX_TRUE='#' HTOP_LINUX_FALSE= fi if test "$my_htop_platform" = freebsd; then HTOP_FREEBSD_TRUE= HTOP_FREEBSD_FALSE='#' else HTOP_FREEBSD_TRUE='#' HTOP_FREEBSD_FALSE= fi if test "$my_htop_platform" = dragonflybsd; then HTOP_DRAGONFLYBSD_TRUE= HTOP_DRAGONFLYBSD_FALSE='#' else HTOP_DRAGONFLYBSD_TRUE='#' HTOP_DRAGONFLYBSD_FALSE= fi if test "$my_htop_platform" = openbsd; then HTOP_OPENBSD_TRUE= HTOP_OPENBSD_FALSE='#' else HTOP_OPENBSD_TRUE='#' HTOP_OPENBSD_FALSE= fi if test "$my_htop_platform" = darwin; then HTOP_DARWIN_TRUE= HTOP_DARWIN_FALSE='#' else HTOP_DARWIN_TRUE='#' HTOP_DARWIN_FALSE= fi if test "$my_htop_platform" = unsupported; then HTOP_UNSUPPORTED_TRUE= HTOP_UNSUPPORTED_FALSE='#' else HTOP_UNSUPPORTED_TRUE='#' HTOP_UNSUPPORTED_FALSE= fi ac_config_files="$ac_config_files Makefile htop.1" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_LINUX_TRUE}" && test -z "${HTOP_LINUX_FALSE}"; then as_fn_error $? "conditional \"HTOP_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_FREEBSD_TRUE}" && test -z "${HTOP_FREEBSD_FALSE}"; then as_fn_error $? "conditional \"HTOP_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_DRAGONFLYBSD_TRUE}" && test -z "${HTOP_DRAGONFLYBSD_FALSE}"; then as_fn_error $? "conditional \"HTOP_DRAGONFLYBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_OPENBSD_TRUE}" && test -z "${HTOP_OPENBSD_FALSE}"; then as_fn_error $? "conditional \"HTOP_OPENBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_DARWIN_TRUE}" && test -z "${HTOP_DARWIN_FALSE}"; then as_fn_error $? "conditional \"HTOP_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HTOP_UNSUPPORTED_TRUE}" && test -z "${HTOP_UNSUPPORTED_FALSE}"; then as_fn_error $? "conditional \"HTOP_UNSUPPORTED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by htop $as_me 2.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ htop config.status 2.1.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "htop.1") CONFIG_FILES="$CONFIG_FILES htop.1" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test "$my_htop_platform" = "unsupported" then echo "" echo "****************************************************************" echo "WARNING! This platform is not currently supported by htop." echo "" echo "The code will build, but it will produce a dummy version of htop" echo "which shows no processes, using the files from the unsupported/" echo "directory. This is meant to be a skeleton, to be used as a" echo "starting point if you are porting htop to a new platform." echo "****************************************************************" echo "" fi htop-2.1.0/ColorsPanel.c0000644000175000001440000000602413152362772012000 00000000000000/* htop - ColorsPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ColorsPanel.h" #include "CRT.h" #include "CheckItem.h" #include #include #include // TO ADD A NEW SCHEME: // * Increment the size of bool check in ColorsPanel.h // * Add the entry in the ColorSchemeNames array below in the file // * Add a define in CRT.h that matches the order of the array // * Add the colors in CRT_setColors /*{ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct ColorsPanel_ { Panel super; Settings* settings; ScreenManager* scr; } ColorsPanel; }*/ static const char* const ColorsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; static const char* const ColorSchemeNames[] = { "Default", "Monochromatic", "Black on White", "Light Terminal", "MC", "Black Night", "Broken Gray", NULL }; static void ColorsPanel_delete(Object* object) { Panel* super = (Panel*) object; ColorsPanel* this = (ColorsPanel*) object; Panel_done(super); free(this); } static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) { ColorsPanel* this = (ColorsPanel*) super; HandlerResult result = IGNORED; int mark = Panel_getSelectedIndex(super); switch(ch) { case 0x0a: case 0x0d: case KEY_ENTER: case KEY_MOUSE: case KEY_RECLICK: case ' ': for (int i = 0; ColorSchemeNames[i] != NULL; i++) CheckItem_set((CheckItem*)Panel_get(super, i), false); CheckItem_set((CheckItem*)Panel_get(super, mark), true); this->settings->colorScheme = mark; result = HANDLED; } if (result == HANDLED) { this->settings->changed = true; const Header* header = this->scr->header; CRT_setColors(mark); Panel* menu = (Panel*) Vector_get(this->scr->panels, 0); Header_draw(header); RichString_setAttr(&(super->header), CRT_colors[PANEL_HEADER_FOCUS]); RichString_setAttr(&(menu->header), CRT_colors[PANEL_HEADER_UNFOCUS]); ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); } return result; } PanelClass ColorsPanel_class = { .super = { .extends = Class(Panel), .delete = ColorsPanel_delete }, .eventHandler = ColorsPanel_eventHandler }; ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) { ColorsPanel* this = AllocThis(ColorsPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(ColorsFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar); this->settings = settings; this->scr = scr; Panel_setHeader(super, "Colors"); for (int i = 0; ColorSchemeNames[i] != NULL; i++) { Panel_add(super, (Object*) CheckItem_newByVal(xStrdup(ColorSchemeNames[i]), false)); } CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true); return this; } htop-2.1.0/EnvScreen.c0000644000175000001440000000277513152362772011460 00000000000000#include "EnvScreen.h" #include "config.h" #include "CRT.h" #include "IncSet.h" #include "ListItem.h" #include "Platform.h" #include "StringUtils.h" #include #include #include /*{ #include "InfoScreen.h" typedef struct EnvScreen_ { InfoScreen super; } EnvScreen; }*/ InfoScreenClass EnvScreen_class = { .super = { .extends = Class(Object), .delete = EnvScreen_delete }, .scan = EnvScreen_scan, .draw = EnvScreen_draw }; EnvScreen* EnvScreen_new(Process* process) { EnvScreen* this = xMalloc(sizeof(EnvScreen)); Object_setClass(this, Class(EnvScreen)); return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " "); } void EnvScreen_delete(Object* this) { free(InfoScreen_done((InfoScreen*)this)); } void EnvScreen_draw(InfoScreen* this) { InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, this->process->comm); } void EnvScreen_scan(InfoScreen* this) { Panel* panel = this->display; int idx = MAX(Panel_getSelectedIndex(panel), 0); Panel_prune(panel); CRT_dropPrivileges(); char* env = Platform_getProcessEnv(this->process->pid); CRT_restorePrivileges(); if (env) { for (char *p = env; *p; p = strrchr(p, 0)+1) InfoScreen_addLine(this, p); free(env); } else { InfoScreen_addLine(this, "Could not read process environment."); } Vector_insertionSort(this->lines); Vector_insertionSort(panel->items); Panel_setSelected(panel, idx); } htop-2.1.0/LoadAverageMeter.c0000644000175000001440000000513313152362772012726 00000000000000/* htop - LoadAverageMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "LoadAverageMeter.h" #include "CRT.h" #include "Platform.h" /*{ #include "Meter.h" }*/ int LoadAverageMeter_attributes[] = { LOAD_AVERAGE_ONE, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_FIFTEEN }; int LoadMeter_attributes[] = { LOAD }; static void LoadAverageMeter_updateValues(Meter* this, char* buffer, int size) { Platform_getLoadAverage(&this->values[0], &this->values[1], &this->values[2]); xSnprintf(buffer, size, "%.2f/%.2f/%.2f", this->values[0], this->values[1], this->values[2]); } static void LoadAverageMeter_display(Object* cast, RichString* out) { Meter* this = (Meter*)cast; char buffer[20]; xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[0]); RichString_write(out, CRT_colors[LOAD_AVERAGE_ONE], buffer); xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[1]); RichString_append(out, CRT_colors[LOAD_AVERAGE_FIVE], buffer); xSnprintf(buffer, sizeof(buffer), "%.2f ", this->values[2]); RichString_append(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer); } static void LoadMeter_updateValues(Meter* this, char* buffer, int size) { double five, fifteen; Platform_getLoadAverage(&this->values[0], &five, &fifteen); if (this->values[0] > this->total) { this->total = this->values[0]; } xSnprintf(buffer, size, "%.2f", this->values[0]); } static void LoadMeter_display(Object* cast, RichString* out) { Meter* this = (Meter*)cast; char buffer[20]; xSnprintf(buffer, sizeof(buffer), "%.2f ", ((Meter*)this)->values[0]); RichString_write(out, CRT_colors[LOAD], buffer); } MeterClass LoadAverageMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = LoadAverageMeter_display, }, .updateValues = LoadAverageMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 3, .total = 100.0, .attributes = LoadAverageMeter_attributes, .name = "LoadAverage", .uiName = "Load average", .description = "Load averages: 1 minute, 5 minutes, 15 minutes", .caption = "Load average: " }; MeterClass LoadMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = LoadMeter_display, }, .updateValues = LoadMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 1, .total = 100.0, .attributes = LoadMeter_attributes, .name = "Load", .uiName = "Load", .description = "Load: average of ready processes in the last minute", .caption = "Load: " }; htop-2.1.0/compile0000755000175000001440000001624513235540777011004 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: htop-2.1.0/Vector.h0000644000175000001440000000300113153324652011012 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Vector #define HEADER_Vector /* htop - Vector.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" #define swap(a_,x_,y_) do{ void* tmp_ = a_[x_]; a_[x_] = a_[y_]; a_[y_] = tmp_; }while(0) #ifndef DEFAULT_SIZE #define DEFAULT_SIZE -1 #endif typedef struct Vector_ { Object **array; ObjectClass* type; int arraySize; int growthRate; int items; bool owner; } Vector; Vector* Vector_new(ObjectClass* type, bool owner, int size); void Vector_delete(Vector* this); #ifdef DEBUG int Vector_count(Vector* this); #endif void Vector_prune(Vector* this); // If I were to use only one sorting algorithm for both cases, it would probably be this one: /* */ void Vector_quickSort(Vector* this); void Vector_insertionSort(Vector* this); void Vector_insert(Vector* this, int idx, void* data_); Object* Vector_take(Vector* this, int idx); Object* Vector_remove(Vector* this, int idx); void Vector_moveUp(Vector* this, int idx); void Vector_moveDown(Vector* this, int idx); void Vector_set(Vector* this, int idx, void* data_); #ifdef DEBUG extern Object* Vector_get(Vector* this, int idx); #else #define Vector_get(v_, idx_) ((v_)->array[idx_]) #endif extern int Vector_size(Vector* this); /* */ void Vector_add(Vector* this, void* data_); extern int Vector_indexOf(Vector* this, void* search_, Object_Compare compare); #endif htop-2.1.0/Action.c0000644000175000001440000004632113235653611010775 00000000000000/* htop - Action.c (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "Action.h" #include "Affinity.h" #include "AffinityPanel.h" #include "CategoriesPanel.h" #include "CRT.h" #include "EnvScreen.h" #include "MainPanel.h" #include "OpenFilesScreen.h" #include "Process.h" #include "ScreenManager.h" #include "SignalsPanel.h" #include "StringUtils.h" #include "TraceScreen.h" #include "Platform.h" #include #include #include #include #include #include #include /*{ #include "IncSet.h" #include "Settings.h" #include "Header.h" #include "UsersTable.h" #include "ProcessList.h" #include "Panel.h" typedef enum { HTOP_OK = 0x00, HTOP_REFRESH = 0x01, HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH HTOP_SAVE_SETTINGS = 0x04, HTOP_KEEP_FOLLOWING = 0x08, HTOP_QUIT = 0x10, HTOP_REDRAW_BAR = 0x20, HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH } Htop_Reaction; typedef Htop_Reaction (*Htop_Action)(); typedef struct State_ { Settings* settings; UsersTable* ut; ProcessList* pl; Panel* panel; Header* header; } State; }*/ Object* Action_pickFromVector(State* st, Panel* list, int x) { Panel* panel = st->panel; Header* header = st->header; Settings* settings = st->settings; int y = panel->y; ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, false); scr->allowFocusChange = false; ScreenManager_add(scr, list, x - 1); ScreenManager_add(scr, panel, -1); Panel* panelFocus; int ch; bool unfollow = false; int pid = MainPanel_selectedPid((MainPanel*)panel); if (header->pl->following == -1) { header->pl->following = pid; unfollow = true; } ScreenManager_run(scr, &panelFocus, &ch); if (unfollow) { header->pl->following = -1; } ScreenManager_delete(scr); Panel_move(panel, 0, y); Panel_resize(panel, COLS, LINES-y-1); if (panelFocus == list && ch == 13) { Process* selected = (Process*)Panel_getSelected(panel); if (selected && selected->pid == pid) return Panel_getSelected(list); else beep(); } return NULL; } // ---------------------------------------- static void Action_runSetup(Settings* settings, const Header* header, ProcessList* pl) { ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, true); CategoriesPanel* panelCategories = CategoriesPanel_new(scr, settings, (Header*) header, pl); ScreenManager_add(scr, (Panel*) panelCategories, 16); CategoriesPanel_makeMetersPage(panelCategories); Panel* panelFocus; int ch; ScreenManager_run(scr, &panelFocus, &ch); ScreenManager_delete(scr); if (settings->changed) { Header_writeBackToSettings(header); } } static bool changePriority(MainPanel* panel, int delta) { bool anyTagged; bool ok = MainPanel_foreachProcess(panel, (MainPanel_ForeachProcessFn) Process_changePriorityBy, delta, &anyTagged); if (!ok) beep(); return anyTagged; } static void addUserToVector(int key, void* userCast, void* panelCast) { char* user = (char*) userCast; Panel* panel = (Panel*) panelCast; Panel_add(panel, (Object*) ListItem_new(user, key)); } bool Action_setUserOnly(const char* userName, uid_t* userId) { struct passwd* user = getpwnam(userName); if (user) { *userId = user->pw_uid; return true; } *userId = -1; return false; } static void tagAllChildren(Panel* panel, Process* parent) { parent->tag = true; pid_t ppid = parent->pid; for (int i = 0; i < Panel_size(panel); i++) { Process* p = (Process*) Panel_get(panel, i); if (!p->tag && Process_isChildOf(p, ppid)) { tagAllChildren(panel, p); } } } static bool expandCollapse(Panel* panel) { Process* p = (Process*) Panel_getSelected(panel); if (!p) return false; p->showChildren = !p->showChildren; return true; } Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) { settings->sortKey = sortKey; settings->direction = 1; settings->treeView = false; return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_UPDATE_PANELHDR | HTOP_KEEP_FOLLOWING; } static Htop_Reaction sortBy(State* st) { Htop_Reaction reaction = HTOP_OK; Panel* sortPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem), FunctionBar_newEnterEsc("Sort ", "Cancel ")); Panel_setHeader(sortPanel, "Sort by"); ProcessField* fields = st->settings->fields; for (int i = 0; fields[i]; i++) { char* name = String_trim(Process_fields[fields[i]].name); Panel_add(sortPanel, (Object*) ListItem_new(name, fields[i])); if (fields[i] == st->settings->sortKey) Panel_setSelected(sortPanel, i); free(name); } ListItem* field = (ListItem*) Action_pickFromVector(st, sortPanel, 15); if (field) { reaction |= Action_setSortKey(st->settings, field->key); } Object_delete(sortPanel); return reaction | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } // ---------------------------------------- static Htop_Reaction actionResize(State* st) { Panel_resize(st->panel, COLS, LINES-(st->panel->y)-1); return HTOP_REDRAW_BAR; } static Htop_Reaction actionSortByMemory(State* st) { return Action_setSortKey(st->settings, PERCENT_MEM); } static Htop_Reaction actionSortByCPU(State* st) { return Action_setSortKey(st->settings, PERCENT_CPU); } static Htop_Reaction actionSortByTime(State* st) { return Action_setSortKey(st->settings, TIME); } static Htop_Reaction actionToggleKernelThreads(State* st) { st->settings->hideKernelThreads = !st->settings->hideKernelThreads; return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS; } static Htop_Reaction actionToggleUserlandThreads(State* st) { st->settings->hideUserlandThreads = !st->settings->hideUserlandThreads; st->settings->hideThreads = st->settings->hideUserlandThreads; return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS; } static Htop_Reaction actionToggleProgramPath(State* st) { st->settings->showProgramPath = !st->settings->showProgramPath; return HTOP_REFRESH | HTOP_SAVE_SETTINGS; } static Htop_Reaction actionToggleTreeView(State* st) { st->settings->treeView = !st->settings->treeView; if (st->settings->treeView) st->settings->direction = 1; ProcessList_expandTree(st->pl); return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } static Htop_Reaction actionIncFilter(State* st) { IncSet* inc = ((MainPanel*)st->panel)->inc; IncSet_activate(inc, INC_FILTER, st->panel); st->pl->incFilter = IncSet_filter(inc); return HTOP_REFRESH | HTOP_KEEP_FOLLOWING; } static Htop_Reaction actionIncSearch(State* st) { IncSet_activate(((MainPanel*)st->panel)->inc, INC_SEARCH, st->panel); return HTOP_REFRESH | HTOP_KEEP_FOLLOWING; } static Htop_Reaction actionHigherPriority(State* st) { bool changed = changePriority((MainPanel*)st->panel, -1); return changed ? HTOP_REFRESH : HTOP_OK; } static Htop_Reaction actionLowerPriority(State* st) { bool changed = changePriority((MainPanel*)st->panel, 1); return changed ? HTOP_REFRESH : HTOP_OK; } static Htop_Reaction actionInvertSortOrder(State* st) { Settings_invertSortOrder(st->settings); return HTOP_REFRESH | HTOP_SAVE_SETTINGS; } static Htop_Reaction actionSetSortColumn(State* st) { return sortBy(st); } static Htop_Reaction actionExpandOrCollapse(State* st) { bool changed = expandCollapse(st->panel); return changed ? HTOP_RECALCULATE : HTOP_OK; } static Htop_Reaction actionExpandCollapseOrSortColumn(State* st) { return st->settings->treeView ? actionExpandOrCollapse(st) : actionSetSortColumn(st); } static Htop_Reaction actionQuit() { return HTOP_QUIT; } static Htop_Reaction actionSetAffinity(State* st) { if (st->pl->cpuCount == 1) return HTOP_OK; #if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY) Panel* panel = st->panel; Process* p = (Process*) Panel_getSelected(panel); if (!p) return HTOP_OK; Affinity* affinity = Affinity_get(p, st->pl); if (!affinity) return HTOP_OK; Panel* affinityPanel = AffinityPanel_new(st->pl, affinity); Affinity_delete(affinity); void* set = Action_pickFromVector(st, affinityPanel, 15); if (set) { Affinity* affinity = AffinityPanel_getAffinity(affinityPanel, st->pl); bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) Affinity_set, (size_t) affinity, NULL); if (!ok) beep(); Affinity_delete(affinity); } Panel_delete((Object*)affinityPanel); #endif return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } static Htop_Reaction actionKill(State* st) { Panel* signalsPanel = (Panel*) SignalsPanel_new(); ListItem* sgn = (ListItem*) Action_pickFromVector(st, signalsPanel, 15); if (sgn) { if (sgn->key != 0) { Panel_setHeader(st->panel, "Sending..."); Panel_draw(st->panel, true); refresh(); MainPanel_foreachProcess((MainPanel*)st->panel, (MainPanel_ForeachProcessFn) Process_sendSignal, (size_t) sgn->key, NULL); napms(500); } } Panel_delete((Object*)signalsPanel); return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } static Htop_Reaction actionFilterByUser(State* st) { Panel* usersPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem), FunctionBar_newEnterEsc("Show ", "Cancel ")); Panel_setHeader(usersPanel, "Show processes of:"); UsersTable_foreach(st->ut, addUserToVector, usersPanel); Vector_insertionSort(usersPanel->items); ListItem* allUsers = ListItem_new("All users", -1); Panel_insert(usersPanel, 0, (Object*) allUsers); ListItem* picked = (ListItem*) Action_pickFromVector(st, usersPanel, 20); if (picked) { if (picked == allUsers) { st->pl->userId = -1; } else { Action_setUserOnly(ListItem_getRef(picked), &(st->pl->userId)); } } Panel_delete((Object*)usersPanel); return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } Htop_Reaction Action_follow(State* st) { st->pl->following = MainPanel_selectedPid((MainPanel*)st->panel); Panel_setSelectionColor(st->panel, CRT_colors[PANEL_SELECTION_FOLLOW]); return HTOP_KEEP_FOLLOWING; } static Htop_Reaction actionSetup(State* st) { Action_runSetup(st->settings, st->header, st->pl); // TODO: shouldn't need this, colors should be dynamic int headerHeight = Header_calculateHeight(st->header); Panel_move(st->panel, 0, headerHeight); Panel_resize(st->panel, COLS, LINES-headerHeight-1); return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } static Htop_Reaction actionLsof(State* st) { Process* p = (Process*) Panel_getSelected(st->panel); if (!p) return HTOP_OK; OpenFilesScreen* ofs = OpenFilesScreen_new(p); InfoScreen_run((InfoScreen*)ofs); OpenFilesScreen_delete((Object*)ofs); clear(); CRT_enableDelay(); return HTOP_REFRESH | HTOP_REDRAW_BAR; } static Htop_Reaction actionStrace(State* st) { Process* p = (Process*) Panel_getSelected(st->panel); if (!p) return HTOP_OK; TraceScreen* ts = TraceScreen_new(p); bool ok = TraceScreen_forkTracer(ts); if (ok) { InfoScreen_run((InfoScreen*)ts); } TraceScreen_delete((Object*)ts); clear(); CRT_enableDelay(); return HTOP_REFRESH | HTOP_REDRAW_BAR; } static Htop_Reaction actionTag(State* st) { Process* p = (Process*) Panel_getSelected(st->panel); if (!p) return HTOP_OK; Process_toggleTag(p); Panel_onKey(st->panel, KEY_DOWN); return HTOP_OK; } static Htop_Reaction actionRedraw() { clear(); return HTOP_REFRESH | HTOP_REDRAW_BAR; } static const struct { const char* key; const char* info; } helpLeft[] = { { .key = " Arrows: ", .info = "scroll process list" }, { .key = " Digits: ", .info = "incremental PID search" }, { .key = " F3 /: ", .info = "incremental name search" }, { .key = " F4 \\: ",.info = "incremental name filtering" }, { .key = " F5 t: ", .info = "tree view" }, { .key = " p: ", .info = "toggle program path" }, { .key = " u: ", .info = "show processes of a single user" }, { .key = " H: ", .info = "hide/show user process threads" }, { .key = " K: ", .info = "hide/show kernel threads" }, { .key = " F: ", .info = "cursor follows process" }, { .key = " F6 + -: ", .info = "expand/collapse tree" }, { .key = " P M T: ", .info = "sort by CPU%, MEM% or TIME" }, { .key = " I: ", .info = "invert sort order" }, { .key = " F6 > .: ", .info = "select sort column" }, { .key = NULL, .info = NULL } }; static const struct { const char* key; const char* info; } helpRight[] = { { .key = " Space: ", .info = "tag process" }, { .key = " c: ", .info = "tag process and its children" }, { .key = " U: ", .info = "untag all processes" }, { .key = " F9 k: ", .info = "kill process/tagged processes" }, { .key = " F7 ]: ", .info = "higher priority (root only)" }, { .key = " F8 [: ", .info = "lower priority (+ nice)" }, #if (HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY) { .key = " a: ", .info = "set CPU affinity" }, #endif { .key = " e: ", .info = "show process environment" }, { .key = " i: ", .info = "set IO priority" }, { .key = " l: ", .info = "list open files with lsof" }, { .key = " s: ", .info = "trace syscalls with strace" }, { .key = " ", .info = "" }, { .key = " F2 C S: ", .info = "setup" }, { .key = " F1 h: ", .info = "show this help screen" }, { .key = " F10 q: ", .info = "quit" }, { .key = NULL, .info = NULL } }; static Htop_Reaction actionHelp(State* st) { Settings* settings = st->settings; clear(); attrset(CRT_colors[HELP_BOLD]); for (int i = 0; i < LINES-1; i++) mvhline(i, 0, ' ', COLS); mvaddstr(0, 0, "htop " VERSION " - " COPYRIGHT); mvaddstr(1, 0, "Released under the GNU GPL. See 'man' page for more info."); attrset(CRT_colors[DEFAULT_COLOR]); mvaddstr(3, 0, "CPU usage bar: "); #define addattrstr(a,s) attrset(a);addstr(s) addattrstr(CRT_colors[BAR_BORDER], "["); if (settings->detailedCPUTime) { addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/"); addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/"); addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/"); addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/"); addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/"); addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/"); addattrstr(CRT_colors[CPU_GUEST], "guest"); addstr("/"); addattrstr(CRT_colors[CPU_IOWAIT], "io-wait"); addattrstr(CRT_colors[BAR_SHADOW], " used%"); } else { addattrstr(CRT_colors[CPU_NICE_TEXT], "low-priority"); addstr("/"); addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/"); addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/"); addattrstr(CRT_colors[CPU_STEAL], "virtualiz"); addattrstr(CRT_colors[BAR_SHADOW], " used%"); } addattrstr(CRT_colors[BAR_BORDER], "]"); attrset(CRT_colors[DEFAULT_COLOR]); mvaddstr(4, 0, "Memory bar: "); addattrstr(CRT_colors[BAR_BORDER], "["); addattrstr(CRT_colors[MEMORY_USED], "used"); addstr("/"); addattrstr(CRT_colors[MEMORY_BUFFERS_TEXT], "buffers"); addstr("/"); addattrstr(CRT_colors[MEMORY_CACHE], "cache"); addattrstr(CRT_colors[BAR_SHADOW], " used/total"); addattrstr(CRT_colors[BAR_BORDER], "]"); attrset(CRT_colors[DEFAULT_COLOR]); mvaddstr(5, 0, "Swap bar: "); addattrstr(CRT_colors[BAR_BORDER], "["); addattrstr(CRT_colors[SWAP], "used"); addattrstr(CRT_colors[BAR_SHADOW], " used/total"); addattrstr(CRT_colors[BAR_BORDER], "]"); attrset(CRT_colors[DEFAULT_COLOR]); mvaddstr(6,0, "Type and layout of header meters are configurable in the setup screen."); if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { mvaddstr(7, 0, "In monochrome, meters display as different chars, in order: |#*@$%&."); } mvaddstr( 8, 0, " Status: R: running; S: sleeping; T: traced/stopped; Z: zombie; D: disk sleep"); for (int i = 0; helpLeft[i].info; i++) { mvaddstr(9+i, 9, helpLeft[i].info); } for (int i = 0; helpRight[i].info; i++) { mvaddstr(9+i, 49, helpRight[i].info); } attrset(CRT_colors[HELP_BOLD]); for (int i = 0; helpLeft[i].key; i++) { mvaddstr(9+i, 0, helpLeft[i].key); } for (int i = 0; helpRight[i].key; i++) { mvaddstr(9+i, 40, helpRight[i].key); } attrset(CRT_colors[PROCESS_THREAD]); mvaddstr(16, 32, "threads"); mvaddstr(17, 26, "threads"); attrset(CRT_colors[DEFAULT_COLOR]); attrset(CRT_colors[HELP_BOLD]); mvaddstr(23,0, "Press any key to return."); attrset(CRT_colors[DEFAULT_COLOR]); refresh(); CRT_readKey(); clear(); return HTOP_RECALCULATE | HTOP_REDRAW_BAR; } static Htop_Reaction actionUntagAll(State* st) { for (int i = 0; i < Panel_size(st->panel); i++) { Process* p = (Process*) Panel_get(st->panel, i); p->tag = false; } return HTOP_REFRESH; } static Htop_Reaction actionTagAllChildren(State* st) { Process* p = (Process*) Panel_getSelected(st->panel); if (!p) return HTOP_OK; tagAllChildren(st->panel, p); return HTOP_OK; } static Htop_Reaction actionShowEnvScreen(State* st) { Process* p = (Process*) Panel_getSelected(st->panel); if (!p) return HTOP_OK; EnvScreen* es = EnvScreen_new(p); InfoScreen_run((InfoScreen*)es); EnvScreen_delete((Object*)es); clear(); CRT_enableDelay(); return HTOP_REFRESH | HTOP_REDRAW_BAR; } void Action_setBindings(Htop_Action* keys) { keys[KEY_RESIZE] = actionResize; keys['M'] = actionSortByMemory; keys['T'] = actionSortByTime; keys['P'] = actionSortByCPU; keys['H'] = actionToggleUserlandThreads; keys['K'] = actionToggleKernelThreads; keys['p'] = actionToggleProgramPath; keys['t'] = actionToggleTreeView; keys[KEY_F(5)] = actionToggleTreeView; keys[KEY_F(4)] = actionIncFilter; keys['\\'] = actionIncFilter; keys[KEY_F(3)] = actionIncSearch; keys['/'] = actionIncSearch; keys[']'] = actionHigherPriority; keys[KEY_F(7)] = actionHigherPriority; keys['['] = actionLowerPriority; keys[KEY_F(8)] = actionLowerPriority; keys['I'] = actionInvertSortOrder; keys[KEY_F(6)] = actionExpandCollapseOrSortColumn; keys[KEY_F(18)] = actionExpandCollapseOrSortColumn; keys['<'] = actionSetSortColumn; keys[','] = actionSetSortColumn; keys['>'] = actionSetSortColumn; keys['.'] = actionSetSortColumn; keys[KEY_F(10)] = actionQuit; keys['q'] = actionQuit; keys['a'] = actionSetAffinity; keys[KEY_F(9)] = actionKill; keys['k'] = actionKill; keys[KEY_RECLICK] = actionExpandOrCollapse; keys['+'] = actionExpandOrCollapse; keys['='] = actionExpandOrCollapse; keys['-'] = actionExpandOrCollapse; keys['u'] = actionFilterByUser; keys['F'] = Action_follow; keys['S'] = actionSetup; keys['C'] = actionSetup; keys[KEY_F(2)] = actionSetup; keys['l'] = actionLsof; keys['s'] = actionStrace; keys[' '] = actionTag; keys['\014'] = actionRedraw; // Ctrl+L keys[KEY_F(1)] = actionHelp; keys['h'] = actionHelp; keys['?'] = actionHelp; keys['U'] = actionUntagAll; keys['c'] = actionTagAllChildren; keys['e'] = actionShowEnvScreen; } htop-2.1.0/InfoScreen.c0000644000175000001440000001234713235653611011614 00000000000000#include "InfoScreen.h" #include "config.h" #include "Object.h" #include "CRT.h" #include "IncSet.h" #include "ListItem.h" #include "Platform.h" #include "StringUtils.h" #include #include #include #include /*{ #include "Process.h" #include "Panel.h" #include "FunctionBar.h" #include "IncSet.h" typedef struct InfoScreen_ InfoScreen; typedef void(*InfoScreen_Scan)(InfoScreen*); typedef void(*InfoScreen_Draw)(InfoScreen*); typedef void(*InfoScreen_OnErr)(InfoScreen*); typedef bool(*InfoScreen_OnKey)(InfoScreen*, int); typedef struct InfoScreenClass_ { ObjectClass super; const InfoScreen_Scan scan; const InfoScreen_Draw draw; const InfoScreen_OnErr onErr; const InfoScreen_OnKey onKey; } InfoScreenClass; #define As_InfoScreen(this_) ((InfoScreenClass*)(((InfoScreen*)(this_))->super.klass)) #define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_)) #define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_)) #define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_)) #define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_) struct InfoScreen_ { Object super; Process* process; Panel* display; FunctionBar* bar; IncSet* inc; Vector* lines; }; }*/ static const char* const InfoScreenFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL}; static const char* const InfoScreenKeys[] = {"F3", "F4", "F5", "Esc"}; static int InfoScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27}; InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader) { this->process = process; if (!bar) { bar = FunctionBar_new(InfoScreenFunctions, InfoScreenKeys, InfoScreenEvents); } this->display = Panel_new(0, 1, COLS, height, false, Class(ListItem), bar); this->inc = IncSet_new(bar); this->lines = Vector_new(this->display->items->type, true, DEFAULT_SIZE); Panel_setHeader(this->display, panelHeader); return this; } InfoScreen* InfoScreen_done(InfoScreen* this) { Panel_delete((Object*)this->display); IncSet_delete(this->inc); Vector_delete(this->lines); return this; } void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...) { va_list ap; va_start(ap, fmt); attrset(CRT_colors[METER_TEXT]); mvhline(0, 0, ' ', COLS); wmove(stdscr, 0, 0); vw_printw(stdscr, fmt, ap); attrset(CRT_colors[DEFAULT_COLOR]); this->display->needsRedraw = true; Panel_draw(this->display, true); IncSet_drawBar(this->inc); va_end(ap); } void InfoScreen_addLine(InfoScreen* this, const char* line) { Vector_add(this->lines, (Object*) ListItem_new(line, 0)); const char* incFilter = IncSet_filter(this->inc); if (!incFilter || String_contains_i(line, incFilter)) Panel_add(this->display, (Object*)Vector_get(this->lines, Vector_size(this->lines)-1)); } void InfoScreen_appendLine(InfoScreen* this, const char* line) { ListItem* last = (ListItem*)Vector_get(this->lines, Vector_size(this->lines)-1); ListItem_append(last, line); const char* incFilter = IncSet_filter(this->inc); if (incFilter && Panel_get(this->display, Panel_size(this->display)-1) != (Object*)last && String_contains_i(line, incFilter)) Panel_add(this->display, (Object*)last); } void InfoScreen_run(InfoScreen* this) { Panel* panel = this->display; if (As_InfoScreen(this)->scan) InfoScreen_scan(this); InfoScreen_draw(this); bool looping = true; while (looping) { Panel_draw(panel, true); if (this->inc->active) move(LINES-1, CRT_cursorX); set_escdelay(25); int ch = getch(); if (ch == ERR) { if (As_InfoScreen(this)->onErr) { InfoScreen_onErr(this); continue; } } if (ch == KEY_MOUSE) { MEVENT mevent; int ok = getmouse(&mevent); if (ok == OK) if (mevent.y >= panel->y && mevent.y < LINES - 1) { Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV); ch = 0; } if (mevent.y == LINES - 1) ch = IncSet_synthesizeEvent(this->inc, mevent.x); } if (this->inc->active) { IncSet_handleKey(this->inc, ch, panel, IncSet_getListItemValue, this->lines); continue; } switch(ch) { case ERR: continue; case KEY_F(3): case '/': IncSet_activate(this->inc, INC_SEARCH, panel); break; case KEY_F(4): case '\\': IncSet_activate(this->inc, INC_FILTER, panel); break; case KEY_F(5): clear(); if (As_InfoScreen(this)->scan) InfoScreen_scan(this); InfoScreen_draw(this); break; case '\014': // Ctrl+L clear(); InfoScreen_draw(this); break; case 'q': case 27: case KEY_F(10): looping = false; break; case KEY_RESIZE: Panel_resize(panel, COLS, LINES-2); InfoScreen_draw(this); break; default: if (As_InfoScreen(this)->onKey && InfoScreen_onKey(this, ch)) { continue; } Panel_onKey(panel, ch); } } } htop-2.1.0/XAlloc.h0000644000175000001440000000171013235624301010732 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_XAlloc #define HEADER_XAlloc #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include void* xMalloc(size_t size); void* xCalloc(size_t nmemb, size_t size); void* xRealloc(void* ptr, size_t size); #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) #undef xStrdup #undef xStrdup_ #ifdef NDEBUG # define xStrdup_ xStrdup #else # define xStrdup(str_) (assert(str_), xStrdup_(str_)) #endif #ifndef __has_attribute // Clang's macro # define __has_attribute(x) 0 #endif #if (__has_attribute(nonnull) || \ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) char* xStrdup_(const char* str) __attribute__((nonnull)); #endif // __has_attribute(nonnull) || GNU C 3.3 or later char* xStrdup_(const char* str); #endif htop-2.1.0/freebsd/0000755000175000001440000000000013235655643011107 500000000000000htop-2.1.0/freebsd/FreeBSDProcess.c0000644000175000001440000001526313235624301013736 00000000000000/* htop - FreeBSDProcess.c (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "ProcessList.h" #include "FreeBSDProcess.h" #include "Platform.h" #include "CRT.h" #include #include #include #include /*{ typedef enum FreeBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } FreeBSDProcessField; typedef struct FreeBSDProcess_ { Process super; int kernel; int jid; char* jname; } FreeBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif }*/ ProcessClass FreeBSDProcess_class = { .super = { .extends = Class(Process), .display = Process_display, .delete = Process_delete, .compare = FreeBSDProcess_compare }, .writeField = (Process_WriteField) FreeBSDProcess_writeField, }; ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SID ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, [JID] = { .name = "JID", .title = " JID ", .description = "Jail prison ID", .flags = 0, }, [JAIL] = { .name = "JAIL", .title = "JAIL ", .description = "Jail prison name", .flags = 0, }, [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; ProcessPidColumn Process_pidColumns[] = { { .id = JID, .label = "JID" }, { .id = PID, .label = "PID" }, { .id = PPID, .label = "PPID" }, { .id = TPGID, .label = "TPGID" }, { .id = TGID, .label = "TGID" }, { .id = PGRP, .label = "PGRP" }, { .id = SESSION, .label = "SID" }, { .id = 0, .label = NULL }, }; FreeBSDProcess* FreeBSDProcess_new(Settings* settings) { FreeBSDProcess* this = xCalloc(1, sizeof(FreeBSDProcess)); Object_setClass(this, Class(FreeBSDProcess)); Process_init(&this->super, settings); return this; } void Process_delete(Object* cast) { FreeBSDProcess* this = (FreeBSDProcess*) cast; Process_done((Process*)cast); free(this->jname); free(this); } void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { FreeBSDProcess* fp = (FreeBSDProcess*) this; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; int n = sizeof(buffer) - 1; switch ((int) field) { // add FreeBSD-specific fields here case JID: xSnprintf(buffer, n, Process_pidFormat, fp->jid); break; case JAIL:{ xSnprintf(buffer, n, "%-11s ", fp->jname); break; if (buffer[11] != '\0') { buffer[11] = ' '; buffer[12] = '\0'; } break; } default: Process_writeField(this, str, field); return; } RichString_append(str, attr, buffer); } long FreeBSDProcess_compare(const void* v1, const void* v2) { FreeBSDProcess *p1, *p2; Settings *settings = ((Process*)v1)->settings; if (settings->direction == 1) { p1 = (FreeBSDProcess*)v1; p2 = (FreeBSDProcess*)v2; } else { p2 = (FreeBSDProcess*)v1; p1 = (FreeBSDProcess*)v2; } switch ((int) settings->sortKey) { // add FreeBSD-specific fields here case JID: return (p1->jid - p2->jid); case JAIL: return strcmp(p1->jname ? p1->jname : "", p2->jname ? p2->jname : ""); default: return Process_compare(v1, v2); } } bool Process_isThread(Process* this) { FreeBSDProcess* fp = (FreeBSDProcess*) this; if (fp->kernel == 1 ) return 1; else return (Process_isUserlandThread(this)); } htop-2.1.0/freebsd/FreeBSDProcess.h0000644000175000001440000000227713235624301013744 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_FreeBSDProcess #define HEADER_FreeBSDProcess /* htop - FreeBSDProcess.h (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ typedef enum FreeBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } FreeBSDProcessField; typedef struct FreeBSDProcess_ { Process super; int kernel; int jid; char* jname; } FreeBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif extern ProcessClass FreeBSDProcess_class; extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; FreeBSDProcess* FreeBSDProcess_new(Settings* settings); void Process_delete(Object* cast); void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field); long FreeBSDProcess_compare(const void* v1, const void* v2); bool Process_isThread(Process* this); #endif htop-2.1.0/freebsd/FreeBSDProcessList.c0000644000175000001440000004233013235624301014565 00000000000000/* htop - FreeBSDProcessList.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "FreeBSDProcessList.h" #include "FreeBSDProcess.h" #include #include #include #include #include #include #include #include #include /*{ #include #include #include #include #include #define JAIL_ERRMSGLEN 1024 char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; } CPUData; typedef struct FreeBSDProcessList_ { ProcessList super; kvm_t* kd; int zfsArcEnabled; unsigned long long int memWire; unsigned long long int memActive; unsigned long long int memInactive; unsigned long long int memFree; unsigned long long int memZfsArc; CPUData* cpus; unsigned long *cp_time_o; unsigned long *cp_time_n; unsigned long *cp_times_o; unsigned long *cp_times_n; } FreeBSDProcessList; }*/ static int MIB_hw_physmem[2]; static int MIB_vm_stats_vm_v_page_count[4]; static int pageSize; static int pageSizeKb; static int MIB_vm_stats_vm_v_wire_count[4]; static int MIB_vm_stats_vm_v_active_count[4]; static int MIB_vm_stats_vm_v_cache_count[4]; static int MIB_vm_stats_vm_v_inactive_count[4]; static int MIB_vm_stats_vm_v_free_count[4]; static int MIB_vfs_bufspace[2]; static int MIB_kstat_zfs_misc_arcstats_size[5]; static int MIB_kern_cp_time[2]; static int MIB_kern_cp_times[2]; static int kernelFScale; ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { size_t len; char errbuf[_POSIX2_LINE_MAX]; FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList)); ProcessList* pl = (ProcessList*) fpl; ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidWhiteList, userId); // physical memory in system: hw.physmem // physical page size: hw.pagesize // usable pagesize : vm.stats.vm.v_page_size len = 2; sysctlnametomib("hw.physmem", MIB_hw_physmem, &len); len = sizeof(pageSize); if (sysctlbyname("vm.stats.vm.v_page_size", &pageSize, &len, NULL, 0) == -1) { pageSize = PAGE_SIZE; pageSizeKb = PAGE_SIZE_KB; } else { pageSizeKb = pageSize / ONE_K; } // usable page count vm.stats.vm.v_page_count // actually usable memory : vm.stats.vm.v_page_count * vm.stats.vm.v_page_size len = 4; sysctlnametomib("vm.stats.vm.v_page_count", MIB_vm_stats_vm_v_page_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_wire_count", MIB_vm_stats_vm_v_wire_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_active_count", MIB_vm_stats_vm_v_active_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_cache_count", MIB_vm_stats_vm_v_cache_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_inactive_count", MIB_vm_stats_vm_v_inactive_count, &len); len = 4; sysctlnametomib("vm.stats.vm.v_free_count", MIB_vm_stats_vm_v_free_count, &len); len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len); len = sizeof(fpl->memZfsArc); if (sysctlbyname("kstat.zfs.misc.arcstats.size", &fpl->memZfsArc, &len, NULL, 0) == 0 && fpl->memZfsArc != 0) { sysctlnametomib("kstat.zfs.misc.arcstats.size", MIB_kstat_zfs_misc_arcstats_size, &len); fpl->zfsArcEnabled = 1; } else { fpl->zfsArcEnabled = 0; } int smp = 0; len = sizeof(smp); if (sysctlbyname("kern.smp.active", &smp, &len, NULL, 0) != 0 || len != sizeof(smp)) { smp = 0; } int cpus = 1; len = sizeof(cpus); if (smp) { int err = sysctlbyname("kern.smp.cpus", &cpus, &len, NULL, 0); if (err) cpus = 1; } else { cpus = 1; } size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len); fpl->cp_time_o = xCalloc(cpus, sizeof_cp_time_array); fpl->cp_time_n = xCalloc(cpus, sizeof_cp_time_array); len = sizeof_cp_time_array; // fetch initial single (or average) CPU clicks from kernel sysctl(MIB_kern_cp_time, 2, fpl->cp_time_o, &len, NULL, 0); // on smp box, fetch rest of initial CPU's clicks if (cpus > 1) { len = 2; sysctlnametomib("kern.cp_times", MIB_kern_cp_times, &len); fpl->cp_times_o = xCalloc(cpus, sizeof_cp_time_array); fpl->cp_times_n = xCalloc(cpus, sizeof_cp_time_array); len = cpus * sizeof_cp_time_array; sysctl(MIB_kern_cp_times, 2, fpl->cp_times_o, &len, NULL, 0); } pl->cpuCount = MAX(cpus, 1); if (cpus == 1 ) { fpl->cpus = xRealloc(fpl->cpus, sizeof(CPUData)); } else { // on smp we need CPUs + 1 to store averages too (as kernel kindly provides that as well) fpl->cpus = xRealloc(fpl->cpus, (pl->cpuCount + 1) * sizeof(CPUData)); } len = sizeof(kernelFScale); if (sysctlbyname("kern.fscale", &kernelFScale, &len, NULL, 0) == -1) { //sane default for kernel provided CPU percentage scaling, at least on x86 machines, in case this sysctl call failed kernelFScale = 2048; } fpl->kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, errbuf); if (fpl->kd == NULL) { errx(1, "kvm_open: %s", errbuf); } return pl; } void ProcessList_delete(ProcessList* this) { const FreeBSDProcessList* fpl = (FreeBSDProcessList*) this; if (fpl->kd) kvm_close(fpl->kd); free(fpl->cp_time_o); free(fpl->cp_time_n); free(fpl->cp_times_o); free(fpl->cp_times_n); free(fpl->cpus); ProcessList_done(this); free(this); } static inline void FreeBSDProcessList_scanCPUTime(ProcessList* pl) { const FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl; int cpus = pl->cpuCount; // actual CPU count int maxcpu = cpus; // max iteration (in case we have average + smp) int cp_times_offset; assert(cpus > 0); size_t sizeof_cp_time_array; unsigned long *cp_time_n; // old clicks state unsigned long *cp_time_o; // current clicks state unsigned long cp_time_d[CPUSTATES]; double cp_time_p[CPUSTATES]; // get averages or single CPU clicks sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES; sysctl(MIB_kern_cp_time, 2, fpl->cp_time_n, &sizeof_cp_time_array, NULL, 0); // get rest of CPUs if (cpus > 1) { // on smp systems FreeBSD kernel concats all CPU states into one long array in // kern.cp_times sysctl OID // we store averages in fpl->cpus[0], and actual cores after that maxcpu = cpus + 1; sizeof_cp_time_array = cpus * sizeof(unsigned long) * CPUSTATES; sysctl(MIB_kern_cp_times, 2, fpl->cp_times_n, &sizeof_cp_time_array, NULL, 0); } for (int i = 0; i < maxcpu; i++) { if (cpus == 1) { // single CPU box cp_time_n = fpl->cp_time_n; cp_time_o = fpl->cp_time_o; } else { if (i == 0 ) { // average cp_time_n = fpl->cp_time_n; cp_time_o = fpl->cp_time_o; } else { // specific smp cores cp_times_offset = i - 1; cp_time_n = fpl->cp_times_n + (cp_times_offset * CPUSTATES); cp_time_o = fpl->cp_times_o + (cp_times_offset * CPUSTATES); } } // diff old vs new unsigned long long total_o = 0; unsigned long long total_n = 0; unsigned long long total_d = 0; for (int s = 0; s < CPUSTATES; s++) { cp_time_d[s] = cp_time_n[s] - cp_time_o[s]; total_o += cp_time_o[s]; total_n += cp_time_n[s]; } // totals total_d = total_n - total_o; if (total_d < 1 ) total_d = 1; // save current state as old and calc percentages for (int s = 0; s < CPUSTATES; ++s) { cp_time_o[s] = cp_time_n[s]; cp_time_p[s] = ((double)cp_time_d[s]) / ((double)total_d) * 100; } CPUData* cpuData = &(fpl->cpus[i]); cpuData->userPercent = cp_time_p[CP_USER]; cpuData->nicePercent = cp_time_p[CP_NICE]; cpuData->systemPercent = cp_time_p[CP_SYS]; cpuData->irqPercent = cp_time_p[CP_INTR]; cpuData->systemAllPercent = cp_time_p[CP_SYS] + cp_time_p[CP_INTR]; // this one is not really used, but we store it anyway cpuData->idlePercent = cp_time_p[CP_IDLE]; } } static inline void FreeBSDProcessList_scanMemoryInfo(ProcessList* pl) { FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl; // @etosan: // memory counter relationships seem to be these: // total = active + wired + inactive + cache + free // htop_used (unavail to anybody) = active + wired // htop_cache (for cache meter) = buffers + cache // user_free (avail to procs) = buffers + inactive + cache + free // // with ZFS ARC situation becomes bit muddled, as ARC behaves like "user_free" // and belongs into cache, but is reported as wired by kernel // // htop_used = active + (wired - arc) // htop_cache = buffers + cache + arc size_t len = sizeof(pl->totalMem); //disabled for now, as it is always smaller than phycal amount of memory... //...to avoid "where is my memory?" questions //sysctl(MIB_vm_stats_vm_v_page_count, 4, &(pl->totalMem), &len, NULL, 0); //pl->totalMem *= pageSizeKb; sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0); pl->totalMem /= 1024; sysctl(MIB_vm_stats_vm_v_active_count, 4, &(fpl->memActive), &len, NULL, 0); fpl->memActive *= pageSizeKb; sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(fpl->memWire), &len, NULL, 0); fpl->memWire *= pageSizeKb; sysctl(MIB_vfs_bufspace, 2, &(pl->buffersMem), &len, NULL, 0); pl->buffersMem /= 1024; sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0); pl->cachedMem *= pageSizeKb; if (fpl->zfsArcEnabled) { len = sizeof(fpl->memZfsArc); sysctl(MIB_kstat_zfs_misc_arcstats_size, 5, &(fpl->memZfsArc), &len , NULL, 0); fpl->memZfsArc /= 1024; fpl->memWire -= fpl->memZfsArc; pl->cachedMem += fpl->memZfsArc; // maybe when we learn how to make custom memory meter // we could do custom arc breakdown? } pl->usedMem = fpl->memActive + fpl->memWire; //currently unused, same as with arc, custom meter perhaps //sysctl(MIB_vm_stats_vm_v_inactive_count, 4, &(fpl->memInactive), &len, NULL, 0); //sysctl(MIB_vm_stats_vm_v_free_count, 4, &(fpl->memFree), &len, NULL, 0); //pl->freeMem = fpl->memInactive + fpl->memFree; //pl->freeMem *= pageSizeKb; struct kvm_swap swap[16]; int nswap = kvm_getswapinfo(fpl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0); pl->totalSwap = 0; pl->usedSwap = 0; for (int i = 0; i < nswap; i++) { pl->totalSwap += swap[i].ksw_total; pl->usedSwap += swap[i].ksw_used; } pl->totalSwap *= pageSizeKb; pl->usedSwap *= pageSizeKb; pl->sharedMem = 0; // currently unused } char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd) { char** argv = kvm_getargv(kd, kproc, 0); if (!argv) { return xStrdup(kproc->ki_comm); } int len = 0; for (int i = 0; argv[i]; i++) { len += strlen(argv[i]) + 1; } char* comm = xMalloc(len); char* at = comm; *basenameEnd = 0; for (int i = 0; argv[i]; i++) { at = stpcpy(at, argv[i]); if (!*basenameEnd) { *basenameEnd = at - comm; } *at = ' '; at++; } at--; *at = '\0'; return comm; } char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc) { int jid; struct iovec jiov[6]; char* jname; char jnamebuf[MAXHOSTNAMELEN]; if (kproc->ki_jid != 0 ){ memset(jnamebuf, 0, sizeof(jnamebuf)); *(const void **)&jiov[0].iov_base = "jid"; jiov[0].iov_len = sizeof("jid"); jiov[1].iov_base = &kproc->ki_jid; jiov[1].iov_len = sizeof(kproc->ki_jid); *(const void **)&jiov[2].iov_base = "name"; jiov[2].iov_len = sizeof("name"); jiov[3].iov_base = jnamebuf; jiov[3].iov_len = sizeof(jnamebuf); *(const void **)&jiov[4].iov_base = "errmsg"; jiov[4].iov_len = sizeof("errmsg"); jiov[5].iov_base = jail_errmsg; jiov[5].iov_len = JAIL_ERRMSGLEN; jail_errmsg[0] = 0; jid = jail_get(jiov, 6, 0); if (jid < 0) { if (!jail_errmsg[0]) xSnprintf(jail_errmsg, JAIL_ERRMSGLEN, "jail_get: %s", strerror(errno)); return NULL; } else if (jid == kproc->ki_jid) { jname = xStrdup(jnamebuf); if (jname == NULL) strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN); return jname; } else { return NULL; } } else { jnamebuf[0]='-'; jnamebuf[1]='\0'; jname = xStrdup(jnamebuf); } return jname; } void ProcessList_goThroughEntries(ProcessList* this) { FreeBSDProcessList* fpl = (FreeBSDProcessList*) this; Settings* settings = this->settings; bool hideKernelThreads = settings->hideKernelThreads; bool hideUserlandThreads = settings->hideUserlandThreads; FreeBSDProcessList_scanMemoryInfo(this); FreeBSDProcessList_scanCPUTime(this); int cpus = this->cpuCount; int count = 0; struct kinfo_proc* kprocs = kvm_getprocs(fpl->kd, KERN_PROC_PROC, 0, &count); for (int i = 0; i < count; i++) { struct kinfo_proc* kproc = &kprocs[i]; bool preExisting = false; bool isIdleProcess = false; Process* proc = ProcessList_getProcess(this, kproc->ki_pid, &preExisting, (Process_New) FreeBSDProcess_new); FreeBSDProcess* fp = (FreeBSDProcess*) proc; proc->show = ! ((hideKernelThreads && Process_isKernelThread(fp)) || (hideUserlandThreads && Process_isUserlandThread(proc))); if (!preExisting) { fp->jid = kproc->ki_jid; proc->pid = kproc->ki_pid; if ( ! ((kproc->ki_pid == 0) || (kproc->ki_pid == 1) ) && kproc->ki_flag & P_SYSTEM) fp->kernel = 1; else fp->kernel = 0; proc->ppid = kproc->ki_ppid; proc->tpgid = kproc->ki_tpgid; proc->tgid = kproc->ki_pid; proc->session = kproc->ki_sid; proc->tty_nr = kproc->ki_tdev; proc->pgrp = kproc->ki_pgid; proc->st_uid = kproc->ki_uid; proc->starttime_ctime = kproc->ki_start.tv_sec; proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); ProcessList_add((ProcessList*)this, proc); proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset); fp->jname = FreeBSDProcessList_readJailName(kproc); } else { if(fp->jid != kproc->ki_jid) { // process can enter jail anytime fp->jid = kproc->ki_jid; free(fp->jname); fp->jname = FreeBSDProcessList_readJailName(kproc); } if (proc->ppid != kproc->ki_ppid) { // if there are reapers in the system, process can get reparented anytime proc->ppid = kproc->ki_ppid; } if(proc->st_uid != kproc->ki_uid) { // some processes change users (eg. to lower privs) proc->st_uid = kproc->ki_uid; proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); } if (settings->updateProcessNames) { free(proc->comm); proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset); } } // from FreeBSD source /src/usr.bin/top/machine.c proc->m_size = kproc->ki_size / 1024 / pageSizeKb; proc->m_resident = kproc->ki_rssize; proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0; proc->nlwp = kproc->ki_numthreads; proc->time = (kproc->ki_runtime + 5000) / 10000; proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale); proc->percent_mem = 100.0 * (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem); if (proc->percent_cpu > 0.1) { // system idle process should own all CPU time left regardless of CPU count if ( strcmp("idle", kproc->ki_comm) == 0 ) { isIdleProcess = true; } } proc->priority = kproc->ki_pri.pri_level - PZERO; if (strcmp("intr", kproc->ki_comm) == 0 && kproc->ki_flag & P_SYSTEM) { proc->nice = 0; //@etosan: intr kernel process (not thread) has weird nice value } else if (kproc->ki_pri.pri_class == PRI_TIMESHARE) { proc->nice = kproc->ki_nice - NZERO; } else if (PRI_IS_REALTIME(kproc->ki_pri.pri_class)) { proc->nice = PRIO_MIN - 1 - (PRI_MAX_REALTIME - kproc->ki_pri.pri_level); } else { proc->nice = PRIO_MAX + 1 + kproc->ki_pri.pri_level - PRI_MIN_IDLE; } switch (kproc->ki_stat) { case SIDL: proc->state = 'I'; break; case SRUN: proc->state = 'R'; break; case SSLEEP: proc->state = 'S'; break; case SSTOP: proc->state = 'T'; break; case SZOMB: proc->state = 'Z'; break; case SWAIT: proc->state = 'D'; break; case SLOCK: proc->state = 'L'; break; default: proc->state = '?'; } if (Process_isKernelThread(fp)) { this->kernelThreads++; } this->totalTasks++; if (proc->state == 'R') this->runningTasks++; proc->updated = true; } } htop-2.1.0/freebsd/FreeBSDCRT.c0000644000175000001440000000102213152362772012745 00000000000000/* htop - UnsupportedCRT.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); abort(); } htop-2.1.0/freebsd/Battery.h0000644000175000001440000000051013152362772012602 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery /* htop - freebsd/Battery.h (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/freebsd/FreeBSDProcessList.h0000644000175000001440000000266713235624301014603 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_FreeBSDProcessList #define HEADER_FreeBSDProcessList /* htop - FreeBSDProcessList.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include #include #include #include #include #define JAIL_ERRMSGLEN 1024 char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; } CPUData; typedef struct FreeBSDProcessList_ { ProcessList super; kvm_t* kd; int zfsArcEnabled; unsigned long long int memWire; unsigned long long int memActive; unsigned long long int memInactive; unsigned long long int memFree; unsigned long long int memZfsArc; CPUData* cpus; unsigned long *cp_time_o; unsigned long *cp_time_n; unsigned long *cp_times_o; unsigned long *cp_times_n; } FreeBSDProcessList; ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc); void ProcessList_goThroughEntries(ProcessList* this); #endif htop-2.1.0/freebsd/Battery.c0000644000175000001440000000122313152362772012577 00000000000000/* htop - freebsd/Battery.c (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "BatteryMeter.h" #include void Battery_getData(double* level, ACPresence* isOnAC) { int life; size_t life_len = sizeof(life); if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) *level = -1; else *level = life; int acline; size_t acline_len = sizeof(acline); if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) *isOnAC = AC_ERROR; else *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; } htop-2.1.0/freebsd/Platform.h0000644000175000001440000000213013152362772012754 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - freebsd/Platform.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); void Platform_setSwapValues(Meter* this); void Platform_setTasksValues(Meter* this); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/freebsd/FreeBSDCRT.h0000644000175000001440000000046613152362772012765 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_FreeBSDCRT #define HEADER_FreeBSDCRT /* htop - UnsupportedCRT.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/freebsd/Platform.c0000644000175000001440000001313313152362772012754 00000000000000/* htop - freebsd/Platform.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "Meter.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "UptimeMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "FreeBSDProcess.h" #include "FreeBSDProcessList.h" #include #include #include #include #include #include #include /*{ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; }*/ #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; int Platform_numberOfFields = LAST_PROCESSFIELD; const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, { .name = " 2 SIGINT", .number = 2 }, { .name = " 3 SIGQUIT", .number = 3 }, { .name = " 4 SIGILL", .number = 4 }, { .name = " 5 SIGTRAP", .number = 5 }, { .name = " 6 SIGABRT", .number = 6 }, { .name = " 7 SIGEMT", .number = 7 }, { .name = " 8 SIGFPE", .number = 8 }, { .name = " 9 SIGKILL", .number = 9 }, { .name = "10 SIGBUS", .number = 10 }, { .name = "11 SIGSEGV", .number = 11 }, { .name = "12 SIGSYS", .number = 12 }, { .name = "13 SIGPIPE", .number = 13 }, { .name = "14 SIGALRM", .number = 14 }, { .name = "15 SIGTERM", .number = 15 }, { .name = "16 SIGURG", .number = 16 }, { .name = "17 SIGSTOP", .number = 17 }, { .name = "18 SIGTSTP", .number = 18 }, { .name = "19 SIGCONT", .number = 19 }, { .name = "20 SIGCHLD", .number = 20 }, { .name = "21 SIGTTIN", .number = 21 }, { .name = "22 SIGTTOU", .number = 22 }, { .name = "23 SIGIO", .number = 23 }, { .name = "24 SIGXCPU", .number = 24 }, { .name = "25 SIGXFSZ", .number = 25 }, { .name = "26 SIGVTALRM", .number = 26 }, { .name = "27 SIGPROF", .number = 27 }, { .name = "28 SIGWINCH", .number = 28 }, { .name = "29 SIGINFO", .number = 29 }, { .name = "30 SIGUSR1", .number = 30 }, { .name = "31 SIGUSR2", .number = 31 }, { .name = "32 SIGTHR", .number = 32 }, { .name = "33 SIGLIBRT", .number = 33 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); void Platform_setBindings(Htop_Action* keys) { (void) keys; } MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &UptimeMeter_class, &BatteryMeter_class, &HostnameMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; int Platform_getUptime() { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); if (err) { return -1; } gettimeofday(&currTime, NULL); return (int) difftime(currTime.tv_sec, bootTime.tv_sec); } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { struct loadavg loadAverage; int mib[2] = { CTL_VM, VM_LOADAVG }; size_t size = sizeof(loadAverage); int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); if (err) { *one = 0; *five = 0; *fifteen = 0; return; } *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } int Platform_getMaxPid() { int maxPid; size_t size = sizeof(maxPid); int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); if (err) { return 99999; } return maxPid; } double Platform_setCPUValues(Meter* this, int cpu) { FreeBSDProcessList* fpl = (FreeBSDProcessList*) this->pl; int cpus = this->pl->cpuCount; CPUData* cpuData; if (cpus == 1) { // single CPU box has everything in fpl->cpus[0] cpuData = &(fpl->cpus[0]); } else { cpuData = &(fpl->cpus[cpu]); } double percent; double* v = this->values; v[CPU_METER_NICE] = cpuData->nicePercent; v[CPU_METER_NORMAL] = cpuData->userPercent; if (this->pl->settings->detailedCPUTime) { v[CPU_METER_KERNEL] = cpuData->systemPercent; v[CPU_METER_IRQ] = cpuData->irqPercent; Meter_setItems(this, 4); percent = v[0]+v[1]+v[2]+v[3]; } else { v[2] = cpuData->systemAllPercent; Meter_setItems(this, 3); percent = v[0]+v[1]+v[2]; } percent = CLAMP(percent, 0.0, 100.0); if (isnan(percent)) percent = 0.0; return percent; } void Platform_setMemoryValues(Meter* this) { // TODO ProcessList* pl = (ProcessList*) this->pl; this->total = pl->totalMem; this->values[0] = pl->usedMem; this->values[1] = pl->buffersMem; this->values[2] = pl->cachedMem; } void Platform_setSwapValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; this->total = pl->totalSwap; this->values[0] = pl->usedSwap; } void Platform_setTasksValues(Meter* this) { // TODO } char* Platform_getProcessEnv(pid_t pid) { // TODO return NULL; } htop-2.1.0/UsersTable.c0000644000175000001440000000225213152362772011627 00000000000000/* htop - UsersTable.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "UsersTable.h" #include "XAlloc.h" #include "config.h" #include #include #include #include #include #include #include /*{ #include "Hashtable.h" typedef struct UsersTable_ { Hashtable* users; } UsersTable; }*/ UsersTable* UsersTable_new() { UsersTable* this; this = xMalloc(sizeof(UsersTable)); this->users = Hashtable_new(20, true); return this; } void UsersTable_delete(UsersTable* this) { Hashtable_delete(this->users); free(this); } char* UsersTable_getRef(UsersTable* this, unsigned int uid) { char* name = (char*) (Hashtable_get(this->users, uid)); if (name == NULL) { struct passwd* userData = getpwuid(uid); if (userData != NULL) { name = xStrdup(userData->pw_name); Hashtable_put(this->users, uid, name); } } return name; } inline void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction f, void* userData) { Hashtable_foreach(this->users, f, userData); } htop-2.1.0/CheckItem.h0000644000175000001440000000117213153324652011413 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_CheckItem #define HEADER_CheckItem /* htop - CheckItem.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" typedef struct CheckItem_ { Object super; char* text; bool* ref; bool value; } CheckItem; extern ObjectClass CheckItem_class; CheckItem* CheckItem_newByRef(char* text, bool* ref); CheckItem* CheckItem_newByVal(char* text, bool value); void CheckItem_set(CheckItem* this, bool value); bool CheckItem_get(CheckItem* this); #endif htop-2.1.0/AUTHORS0000644000175000001440000000002313152362772010454 00000000000000Hisham H. Muhammad htop-2.1.0/CheckItem.c0000644000175000001440000000324413152362772011414 00000000000000/* htop - CheckItem.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "CheckItem.h" #include "CRT.h" #include #include /*{ #include "Object.h" typedef struct CheckItem_ { Object super; char* text; bool* ref; bool value; } CheckItem; }*/ static void CheckItem_delete(Object* cast) { CheckItem* this = (CheckItem*)cast; assert (this != NULL); free(this->text); free(this); } static void CheckItem_display(Object* cast, RichString* out) { CheckItem* this = (CheckItem*)cast; assert (this != NULL); RichString_write(out, CRT_colors[CHECK_BOX], "["); if (CheckItem_get(this)) RichString_append(out, CRT_colors[CHECK_MARK], "x"); else RichString_append(out, CRT_colors[CHECK_MARK], " "); RichString_append(out, CRT_colors[CHECK_BOX], "] "); RichString_append(out, CRT_colors[CHECK_TEXT], this->text); } ObjectClass CheckItem_class = { .display = CheckItem_display, .delete = CheckItem_delete }; CheckItem* CheckItem_newByRef(char* text, bool* ref) { CheckItem* this = AllocThis(CheckItem); this->text = text; this->value = false; this->ref = ref; return this; } CheckItem* CheckItem_newByVal(char* text, bool value) { CheckItem* this = AllocThis(CheckItem); this->text = text; this->value = value; this->ref = NULL; return this; } void CheckItem_set(CheckItem* this, bool value) { if (this->ref) *(this->ref) = value; else this->value = value; } bool CheckItem_get(CheckItem* this) { if (this->ref) return *(this->ref); else return this->value; } htop-2.1.0/FunctionBar.h0000644000175000001440000000166113235653611011775 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_FunctionBar #define HEADER_FunctionBar /* htop - FunctionBar.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include typedef struct FunctionBar_ { int size; char** functions; char** keys; int* events; bool staticData; } FunctionBar; FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); void FunctionBar_delete(FunctionBar* this); void FunctionBar_setLabel(FunctionBar* this, int event, const char* text); void FunctionBar_draw(const FunctionBar* this, char* buffer); void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr); int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos); #endif htop-2.1.0/htop.1.in0000644000175000001440000003040713235627610011053 00000000000000.TH "HTOP" "1" "2015" "@PACKAGE_STRING@" "Utils" .SH "NAME" htop \- interactive process viewer .SH "SYNOPSIS" .LP .B htop [\fI\-dChusv\fR] .SH "DESCRIPTION" .LP Htop is a free (GPL) ncurses-based process viewer for Linux. .LP It is similar to top, but allows you to scroll vertically and horizontally, so you can see all the processes running on the system, along with their full command lines, as well as viewing them as a process tree, selecting multiple processes and acting on them all at once. .LP Tasks related to processes (killing, renicing) can be done without entering their PIDs. .br .SH "COMMAND-LINE OPTIONS" .LP Mandatory arguments to long options are mandatory for short options too. .LP .TP \fB\-d \-\-delay=DELAY\fR Delay between updates, in tenths of seconds .TP \fB\-C \-\-no-color \-\-no-colour\fR Start htop in monochrome mode .TP \fB\-h \-\-help Display a help message and exit .TP \fB\-p \-\-pid=PID,PID...\fR Show only the given PIDs .TP \fB\-s \-\-sort\-key COLUMN\fR Sort by this column (use \-\-sort\-key help for a column list) .TP \fB\-u \-\-user=USERNAME\fR Show only the processes of a given user .TP \fB\-v \-\-version Output version information and exit .PP .br .SH "INTERACTIVE COMMANDS" .LP The following commands are supported while in htop: .LP .TP 5 .B Up, Alt-k Select (highlight) the previous process in the process list. Scroll the list if necessary. .TP .B Down, Alt-j Select (highlight) the next process in the process list. Scroll the list if necessary. .TP .B Left, Alt-h Scroll the process list left. .TP .B Right, Alt-l Scroll the process list right. .TP .B PgUp, PgDn Scroll the process list up or down one window. .TP .B Home Scroll to the top of the process list and select the first process. .TP .B End Scroll to the bottom of the process list and select the last process. .TP .B Ctrl-A, ^ Scroll left to the beginning of the process entry (i.e. beginning of line). .TP .B Ctrl-E, $ Scroll right to the end of the process entry (i.e. end of line). .TP .B Space Tag or untag a process. Commands that can operate on multiple processes, like "kill", will then apply over the list of tagged processes, instead of the currently highlighted one. .TP .B U Untag all processes (remove all tags added with the Space key). .TP .B s Trace process system calls: if strace(1) is installed, pressing this key will attach it to the currently selected process, presenting a live update of system calls issued by the process. .TP .B l Display open files for a process: if lsof(1) is installed, pressing this key will display the list of file descriptors opened by the process. .TP .B F1, h, ? Go to the help screen .TP .B F2, S Go to the setup screen, where you can configure the meters displayed at the top of the screen, set various display options, choose among color schemes, and select which columns are displayed, in which order. .TP .B F3, / Incrementally search the command lines of all the displayed processes. The currently selected (highlighted) command will update as you type. While in search mode, pressing F3 will cycle through matching occurrences. .TP .B F4, \\\\ Incremental process filtering: type in part of a process command line and only processes whose names match will be shown. To cancel filtering, enter the Filter option again and press Esc. .TP .B F5, t Tree view: organize processes by parenthood, and layout the relations between them as a tree. Toggling the key will switch between tree and your previously selected sort view. Selecting a sort view will exit tree view. .TP .B F6 On sorted view, select a field for sorting, also accessible through < and >. The current sort field is indicated by a highlight in the header. On tree view, expand or collapse the current subtree. A "+" indicator in the tree node indicates that it is collapsed. .TP .B F7, ] Increase the selected process's priority (subtract from 'nice' value). This can only be done by the superuser. .TP .B F8, [ Decrease the selected process's priority (add to 'nice' value) .TP .B F9, k "Kill" process: sends a signal which is selected in a menu, to one or a group of processes. If processes were tagged, sends the signal to all tagged processes. If none is tagged, sends to the currently selected process. .TP .B F10, q Quit .TP .B I Invert the sort order: if sort order is increasing, switch to decreasing, and vice-versa. .TP .B +, \- When in tree view mode, expand or collapse subtree. When a subtree is collapsed a "+" sign shows to the left of the process name. .TP .B a (on multiprocessor machines) Set CPU affinity: mark which CPUs a process is allowed to use. .TP .B u Show only processes owned by a specified user. .TP .B M Sort by memory usage (top compatibility key). .TP .B P Sort by processor usage (top compatibility key). .TP .B T Sort by time (top compatibility key). .TP .B F "Follow" process: if the sort order causes the currently selected process to move in the list, make the selection bar follow it. This is useful for monitoring a process: this way, you can keep a process always visible on screen. When a movement key is used, "follow" loses effect. .TP .B K Hide kernel threads: prevent the threads belonging the kernel to be displayed in the process list. (This is a toggle key.) .TP .B H Hide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.) .TP .B p Show full paths to running programs, where applicable. (This is a toggle key.) .TP .B Ctrl-L Refresh: redraw screen and recalculate values. .TP .B Numbers PID search: type in process ID and the selection highlight will be moved to it. .PD .SH "COLUMNS" .LP The following columns can display data about each process. A value of '\-' in all the rows indicates that a column is unsupported on your system, or currently unimplemented in htop. The names below are the ones used in the "Available Columns" section of the setup screen. If a different name is shown in htop's main screen, it is shown below in parenthesis. .LP .TP 5 .B Command The full command line of the process (i.e. program name and arguments). .TP .B PID The process ID. .TP .B STATE (S) The state of the process: \fBS\fR for sleeping (idle) \fBR\fR for running \fBD\fR for disk sleep (uninterruptible) \fBZ\fR for zombie (waiting for parent to read its exit status) \fBT\fR for traced or suspended (e.g by SIGTSTP) \fBW\fR for paging .TP .B PPID The parent process ID. .TP .B PGRP The process's group ID. .TP .B SESSION (SID) The process's session ID. .TP .B TTY_NR (TTY) The controlling terminal of the process. .TP .B TPGID The process ID of the foreground process group of the controlling terminal. .TP .B MINFLT The number of page faults happening in the main memory. .TP .B CMINFLT The number of minor faults for the process's waited-for children (see MINFLT above). .TP .B MAJFLT The number of page faults happening out of the main memory. .TP .B CMAJFLT The number of major faults for the process's waited-for children (see MAJFLT above). .TP .B UTIME (UTIME+) The user CPU time, which is the amount of time the process has spent executing on the CPU in user mode (i.e. everything but system calls), measured in clock ticks. .TP .B STIME (STIME+) The system CPU time, which is the amount of time the kernel has spent executing system calls on behalf of the process, measured in clock ticks. .TP .B CUTIME (CUTIME+) The children's user CPU time, which is the amount of time the process's waited-for children have spent executing in user mode (see UTIME above). .TP .B CSTIME (CSTIME+) The children's system CPU time, which is the amount of time the kernel has spent executing system calls on behalf of all the process's waited-for children (see STIME above). .TP .B PRIORITY (PRI) The kernel's internal priority for the process, usually just its nice value plus twenty. Different for real-time processes. .TP .B NICE (NI) The nice value of a process, from 19 (low priority) to -20 (high priority). A high value means the process is being nice, letting others have a higher relative priority. The usual OS permission restrictions for adjusting priority apply. .TP .B STARTTIME (START) The time the process was started. .TP .B PROCESSOR (CPU) The ID of the CPU the process last executed on. .TP .B M_SIZE (VIRT) The size of the virtual memory of the process. .TP .B M_RESIDENT (RES) The resident set size (text + data + stack) of the process (i.e. the size of the process's used physical memory). .TP .B M_SHARE (SHR) The size of the process's shared pages. .TP .B M_TRS (CODE) The text resident set size of the process (i.e. the size of the process's executable instructions). .TP .B M_DRS (DATA) The data resident set size (data + stack) of the process (i.e. the size of anything except the process's executable instructions). .TP .B M_LRS (LIB) The library size of the process. .TP .B M_DT (DIRTY) The size of the dirty pages of the process. .TP .B ST_UID (UID) The user ID of the process owner. .TP .B PERCENT_CPU (CPU%) The percentage of the CPU time that the process is currently using. .TP .B PERCENT_MEM (MEM%) The percentage of memory the process is currently using (based on the process's resident memory size, see M_RESIDENT above). .TP .B USER The username of the process owner, or the user ID if the name can't be determined. .TP .B TIME (TIME+) The time, measured in clock ticks that the process has spent in user and system time (see UTIME, STIME above). .TP .B NLWP The number of threads in the process. .TP .B TGID The thread group ID. .TP .B CTID OpenVZ container ID, a.k.a virtual environment ID. .TP .B VPID OpenVZ process ID. .TP .B VXID VServer process ID. .TP .B RCHAR (RD_CHAR) The number of bytes the process has read. .TP .B WCHAR (WR_CHAR) The number of bytes the process has written. .TP .B SYSCR (RD_SYSC) The number of read(2) syscalls for the process. .TP .B SYSCW (WR_SYSC) The number of write(2) syscalls for the process. .TP .B RBYTES (IO_RBYTES) Bytes of read(2) I/O for the process. .TP .B WBYTES (IO_WBYTES) Bytes of write(2) I/O for the process. .TP .B CNCLWB (IO_CANCEL) Bytes of cancelled write(2) I/O. .TP .B IO_READ_RATE (DISK READ) The I/O rate of read(2) in bytes per second, for the process. .TP .B IO_WRITE_RATE (DISK WRITE) The I/O rate of write(2) in bytes per second, for the process. .TP .B IO_RATE (DISK R/W) The I/O rate, IO_READ_RATE + IO_WRITE_RATE (see above). .TP .B CGROUP Which cgroup the process is in. .TP .B OOM OOM killer score. .TP .B IO_PRIORITY (IO) The I/O scheduling class followed by the priority if the class supports it: \fBR\fR for Realtime \fBB\fR for Best-effort \fBid\fR for Idle .TP .B PERCENT_CPU_DELAY (CPUD%) The percentage of time spent waiting for a CPU (while runnable). Requires CAP_NET_ADMIN. .TP .B PERCENT_IO_DELAY (IOD%) The percentage of time spent waiting for the completion of synchronous block I/O. Requires CAP_NET_ADMIN. .TP .B PERCENT_SWAP_DELAY (SWAPD%) The percentage of time spent swapping in pages. Requires CAP_NET_ADMIN. .TP .B All other flags Currently unsupported (always displays '-'). .SH "CONFIG FILE" .LP By default htop reads its configuration from the XDG-compliant path ~/.config/htop/htoprc -- the configuration file is overwritten by htop's in-program Setup configuration, so it should not be hand-edited. If no user configuration exists htop tries to read the system-wide configuration from @sysconfdir@/htoprc and as a last resort, falls back to its hard coded defaults. .LP You may override the location of the configuration file using the $HTOPRC environment variable (so you can have multiple configurations for different machines that share the same home directory, for example). .SH "MEMORY SIZES" .LP Memory sizes in htop are displayed as they are in tools from the GNU Coreutils (when ran with the --human-readable option). This means that sizes are printed in powers of 1024. (e.g., 1023M = 1072693248 Bytes) .LP The decision to use this convention was made in order to conserve screen space and make memory size representations consistent throughout htop. .SH "SEE ALSO" proc(5), top(1), free(1), ps(1), uptime(1), limits.conf(5) .SH "AUTHORS" .LP htop is developed by Hisham Muhammad . .LP This man page was written by Bartosz Fenski for the Debian GNU/Linux distribution (but it may be used by others). It was updated by Hisham Muhammad, and later by Vincent Launchbury, who wrote the 'Columns' section. htop-2.1.0/ClockMeter.h0000644000175000001440000000056213153324652011611 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ClockMeter #define HEADER_ClockMeter /* htop - ClockMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int ClockMeter_attributes[]; extern MeterClass ClockMeter_class; #endif htop-2.1.0/Meter.c0000644000175000001440000003446513235627610010642 00000000000000/* htop - Meter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" #include "RichString.h" #include "Object.h" #include "CRT.h" #include "StringUtils.h" #include "ListItem.h" #include "Settings.h" #include #include #include #include #include #include #define METER_BUFFER_LEN 256 #define GRAPH_DELAY (DEFAULT_DELAY/2) #define GRAPH_HEIGHT 4 /* Unit: rows (lines) */ /*{ #include "ListItem.h" #include typedef struct Meter_ Meter; typedef void(*Meter_Init)(Meter*); typedef void(*Meter_Done)(Meter*); typedef void(*Meter_UpdateMode)(Meter*, int); typedef void(*Meter_UpdateValues)(Meter*, char*, int); typedef void(*Meter_Draw)(Meter*, int, int, int); typedef struct MeterClass_ { ObjectClass super; const Meter_Init init; const Meter_Done done; const Meter_UpdateMode updateMode; const Meter_Draw draw; const Meter_UpdateValues updateValues; const int defaultMode; const double total; const int* attributes; const char* name; const char* uiName; const char* caption; const char* description; const char maxItems; char curItems; } MeterClass; #define As_Meter(this_) ((MeterClass*)((this_)->super.klass)) #define Meter_initFn(this_) As_Meter(this_)->init #define Meter_init(this_) As_Meter(this_)->init((Meter*)(this_)) #define Meter_done(this_) As_Meter(this_)->done((Meter*)(this_)) #define Meter_updateModeFn(this_) As_Meter(this_)->updateMode #define Meter_updateMode(this_, m_) As_Meter(this_)->updateMode((Meter*)(this_), m_) #define Meter_drawFn(this_) As_Meter(this_)->draw #define Meter_doneFn(this_) As_Meter(this_)->done #define Meter_updateValues(this_, buf_, sz_) \ As_Meter(this_)->updateValues((Meter*)(this_), buf_, sz_) #define Meter_defaultMode(this_) As_Meter(this_)->defaultMode #define Meter_getItems(this_) As_Meter(this_)->curItems #define Meter_setItems(this_, n_) As_Meter(this_)->curItems = (n_) #define Meter_attributes(this_) As_Meter(this_)->attributes #define Meter_name(this_) As_Meter(this_)->name #define Meter_uiName(this_) As_Meter(this_)->uiName struct Meter_ { Object super; Meter_Draw draw; char* caption; int mode; int param; void* drawData; int h; struct ProcessList_* pl; double* values; double total; }; typedef struct MeterMode_ { Meter_Draw draw; const char* uiName; int h; } MeterMode; typedef enum { CUSTOM_METERMODE = 0, BAR_METERMODE, TEXT_METERMODE, GRAPH_METERMODE, LED_METERMODE, LAST_METERMODE } MeterModeId; typedef struct GraphData_ { struct timeval time; double values[METER_BUFFER_LEN]; } GraphData; }*/ #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif MeterClass Meter_class = { .super = { .extends = Class(Object) } }; Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type) { Meter* this = xCalloc(1, sizeof(Meter)); Object_setClass(this, type); this->h = 1; this->param = param; this->pl = pl; type->curItems = type->maxItems; this->values = xCalloc(type->maxItems, sizeof(double)); this->total = type->total; this->caption = xStrdup(type->caption); if (Meter_initFn(this)) Meter_init(this); Meter_setMode(this, type->defaultMode); return this; } int Meter_humanUnit(char* buffer, unsigned long int value, int size) { const char * prefix = "KMGTPEZY"; unsigned long int powi = 1; unsigned int written, powj = 1, precision = 2; for(;;) { if (value / 1024 < powi) break; if (prefix[1] == '\0') break; powi *= 1024; ++prefix; } if (*prefix == 'K') precision = 0; for (; precision > 0; precision--) { powj *= 10; if (value / powi < powj) break; } written = snprintf(buffer, size, "%.*f%c", precision, (double) value / powi, *prefix); return written; } void Meter_delete(Object* cast) { if (!cast) return; Meter* this = (Meter*) cast; if (Meter_doneFn(this)) { Meter_done(this); } free(this->drawData); free(this->caption); free(this->values); free(this); } void Meter_setCaption(Meter* this, const char* caption) { free(this->caption); this->caption = xStrdup(caption); } static inline void Meter_displayBuffer(Meter* this, char* buffer, RichString* out) { if (Object_displayFn(this)) { Object_display(this, out); } else { RichString_write(out, CRT_colors[Meter_attributes(this)[0]], buffer); } } void Meter_setMode(Meter* this, int modeIndex) { if (modeIndex > 0 && modeIndex == this->mode) return; if (!modeIndex) modeIndex = 1; assert(modeIndex < LAST_METERMODE); if (Meter_defaultMode(this) == CUSTOM_METERMODE) { this->draw = Meter_drawFn(this); if (Meter_updateModeFn(this)) Meter_updateMode(this, modeIndex); } else { assert(modeIndex >= 1); free(this->drawData); this->drawData = NULL; MeterMode* mode = Meter_modes[modeIndex]; this->draw = mode->draw; this->h = mode->h; } this->mode = modeIndex; } ListItem* Meter_toListItem(Meter* this, bool moving) { char mode[21]; if (this->mode) xSnprintf(mode, 20, " [%s]", Meter_modes[this->mode]->uiName); else mode[0] = '\0'; char number[11]; if (this->param > 0) xSnprintf(number, 10, " %d", this->param); else number[0] = '\0'; char buffer[51]; xSnprintf(buffer, 50, "%s%s%s", Meter_uiName(this), number, mode); ListItem* li = ListItem_new(buffer, 0); li->moving = moving; return li; } /* ---------- TextMeterMode ---------- */ static void TextMeterMode_draw(Meter* this, int x, int y, int w) { char buffer[METER_BUFFER_LEN]; Meter_updateValues(this, buffer, METER_BUFFER_LEN - 1); (void) w; attrset(CRT_colors[METER_TEXT]); mvaddstr(y, x, this->caption); int captionLen = strlen(this->caption); x += captionLen; attrset(CRT_colors[RESET_COLOR]); RichString_begin(out); Meter_displayBuffer(this, buffer, &out); RichString_printVal(out, y, x); RichString_end(out); } /* ---------- BarMeterMode ---------- */ static const char BarMeterMode_characters[] = "|#*@$%&."; static void BarMeterMode_draw(Meter* this, int x, int y, int w) { char buffer[METER_BUFFER_LEN]; Meter_updateValues(this, buffer, METER_BUFFER_LEN - 1); w -= 2; attrset(CRT_colors[METER_TEXT]); int captionLen = 3; mvaddnstr(y, x, this->caption, captionLen); x += captionLen; w -= captionLen; attrset(CRT_colors[BAR_BORDER]); mvaddch(y, x, '['); mvaddch(y, x + w, ']'); w--; x++; if (w < 1) { attrset(CRT_colors[RESET_COLOR]); return; } char bar[w + 1]; int blockSizes[10]; xSnprintf(bar, w + 1, "%*s", w, buffer); // First draw in the bar[] buffer... int offset = 0; int items = Meter_getItems(this); for (int i = 0; i < items; i++) { double value = this->values[i]; value = CLAMP(value, 0.0, this->total); if (value > 0) { blockSizes[i] = ceil((value/this->total) * w); } else { blockSizes[i] = 0; } int nextOffset = offset + blockSizes[i]; // (Control against invalid values) nextOffset = CLAMP(nextOffset, 0, w); for (int j = offset; j < nextOffset; j++) if (bar[j] == ' ') { if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { bar[j] = BarMeterMode_characters[i]; } else { bar[j] = '|'; } } offset = nextOffset; } // ...then print the buffer. offset = 0; for (int i = 0; i < items; i++) { attrset(CRT_colors[Meter_attributes(this)[i]]); mvaddnstr(y, x + offset, bar + offset, blockSizes[i]); offset += blockSizes[i]; offset = CLAMP(offset, 0, w); } if (offset < w) { attrset(CRT_colors[BAR_SHADOW]); mvaddnstr(y, x + offset, bar + offset, w - offset); } move(y, x + w + 1); attrset(CRT_colors[RESET_COLOR]); } /* ---------- GraphMeterMode ---------- */ #ifdef HAVE_LIBNCURSESW #define PIXPERROW_UTF8 4 static const char* const GraphMeterMode_dotsUtf8[] = { /*00*/" ", /*01*/"⢀", /*02*/"⢠", /*03*/"⢰", /*04*/ "⢸", /*10*/"⡀", /*11*/"⣀", /*12*/"⣠", /*13*/"⣰", /*14*/ "⣸", /*20*/"⡄", /*21*/"⣄", /*22*/"⣤", /*23*/"⣴", /*24*/ "⣼", /*30*/"⡆", /*31*/"⣆", /*32*/"⣦", /*33*/"⣶", /*34*/ "⣾", /*40*/"⡇", /*41*/"⣇", /*42*/"⣧", /*43*/"⣷", /*44*/ "⣿" }; #endif #define PIXPERROW_ASCII 2 static const char* const GraphMeterMode_dotsAscii[] = { /*00*/" ", /*01*/".", /*02*/":", /*10*/".", /*11*/".", /*12*/":", /*20*/":", /*21*/":", /*22*/":" }; static const char* const* GraphMeterMode_dots; static int GraphMeterMode_pixPerRow; static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData)); GraphData* data = (GraphData*) this->drawData; const int nValues = METER_BUFFER_LEN; #ifdef HAVE_LIBNCURSESW if (CRT_utf8) { GraphMeterMode_dots = GraphMeterMode_dotsUtf8; GraphMeterMode_pixPerRow = PIXPERROW_UTF8; } else #endif { GraphMeterMode_dots = GraphMeterMode_dotsAscii; GraphMeterMode_pixPerRow = PIXPERROW_ASCII; } attrset(CRT_colors[METER_TEXT]); int captionLen = 3; mvaddnstr(y, x, this->caption, captionLen); x += captionLen; w -= captionLen; struct timeval now; gettimeofday(&now, NULL); if (!timercmp(&now, &(data->time), <)) { struct timeval delay = { .tv_sec = (int)(CRT_delay/10), .tv_usec = (CRT_delay-((int)(CRT_delay/10)*10)) * 100000 }; timeradd(&now, &delay, &(data->time)); for (int i = 0; i < nValues - 1; i++) data->values[i] = data->values[i+1]; char buffer[nValues]; Meter_updateValues(this, buffer, nValues - 1); double value = 0.0; int items = Meter_getItems(this); for (int i = 0; i < items; i++) value += this->values[i]; value /= this->total; data->values[nValues - 1] = value; } int i = nValues - (w*2) + 2, k = 0; if (i < 0) { k = -i/2; i = 0; } for (; i < nValues; i+=2, k++) { int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT; int v1 = CLAMP((int) lround(data->values[i] * pix), 1, pix); int v2 = CLAMP((int) lround(data->values[i+1] * pix), 1, pix); int colorIdx = GRAPH_1; for (int line = 0; line < GRAPH_HEIGHT; line++) { int line1 = CLAMP(v1 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow); int line2 = CLAMP(v2 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow); attrset(CRT_colors[colorIdx]); mvaddstr(y+line, x+k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]); colorIdx = GRAPH_2; } } attrset(CRT_colors[RESET_COLOR]); } /* ---------- LEDMeterMode ---------- */ static const char* const LEDMeterMode_digitsAscii[] = { " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ ", "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|", "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|" }; #ifdef HAVE_LIBNCURSESW static const char* const LEDMeterMode_digitsUtf8[] = { "┌──┐"," ┐ ","╶──┐","╶──┐","╷ ╷","┌──╴","┌──╴","╶──┐","┌──┐","┌──┐", "│ │"," │ ","┌──┘"," ──┤","└──┤","└──┐","├──┐"," │","├──┤","└──┤", "└──┘"," ╵ ","└──╴","╶──┘"," ╵","╶──┘","└──┘"," ╵","└──┘"," ──┘" }; #endif static const char* const* LEDMeterMode_digits; static void LEDMeterMode_drawDigit(int x, int y, int n) { for (int i = 0; i < 3; i++) mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]); } static void LEDMeterMode_draw(Meter* this, int x, int y, int w) { (void) w; #ifdef HAVE_LIBNCURSESW if (CRT_utf8) LEDMeterMode_digits = LEDMeterMode_digitsUtf8; else #endif LEDMeterMode_digits = LEDMeterMode_digitsAscii; char buffer[METER_BUFFER_LEN]; Meter_updateValues(this, buffer, METER_BUFFER_LEN - 1); RichString_begin(out); Meter_displayBuffer(this, buffer, &out); int yText = #ifdef HAVE_LIBNCURSESW CRT_utf8 ? y+1 : #endif y+2; attrset(CRT_colors[LED_COLOR]); mvaddstr(yText, x, this->caption); int xx = x + strlen(this->caption); int len = RichString_sizeVal(out); for (int i = 0; i < len; i++) { char c = RichString_getCharVal(out, i); if (c >= '0' && c <= '9') { LEDMeterMode_drawDigit(xx, y, c-48); xx += 4; } else { mvaddch(yText, xx, c); xx += 1; } } attrset(CRT_colors[RESET_COLOR]); RichString_end(out); } static MeterMode BarMeterMode = { .uiName = "Bar", .h = 1, .draw = BarMeterMode_draw, }; static MeterMode TextMeterMode = { .uiName = "Text", .h = 1, .draw = TextMeterMode_draw, }; static MeterMode GraphMeterMode = { .uiName = "Graph", .h = GRAPH_HEIGHT, .draw = GraphMeterMode_draw, }; static MeterMode LEDMeterMode = { .uiName = "LED", .h = 3, .draw = LEDMeterMode_draw, }; MeterMode* Meter_modes[] = { NULL, &BarMeterMode, &TextMeterMode, &GraphMeterMode, &LEDMeterMode, NULL }; /* Blank meter */ static void BlankMeter_updateValues(Meter* this, char* buffer, int size) { (void) this; (void) buffer; (void) size; } static void BlankMeter_display(Object* cast, RichString* out) { (void) cast; RichString_prune(out); } int BlankMeter_attributes[] = { DEFAULT_COLOR }; MeterClass BlankMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = BlankMeter_display, }, .updateValues = BlankMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 0, .total = 100.0, .attributes = BlankMeter_attributes, .name = "Blank", .uiName = "Blank", .caption = "" }; htop-2.1.0/Action.h0000644000175000001440000000232613153324652010776 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Action #define HEADER_Action /* htop - Action.h (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "IncSet.h" #include "Settings.h" #include "Header.h" #include "UsersTable.h" #include "ProcessList.h" #include "Panel.h" typedef enum { HTOP_OK = 0x00, HTOP_REFRESH = 0x01, HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH HTOP_SAVE_SETTINGS = 0x04, HTOP_KEEP_FOLLOWING = 0x08, HTOP_QUIT = 0x10, HTOP_REDRAW_BAR = 0x20, HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH } Htop_Reaction; typedef Htop_Reaction (*Htop_Action)(); typedef struct State_ { Settings* settings; UsersTable* ut; ProcessList* pl; Panel* panel; Header* header; } State; Object* Action_pickFromVector(State* st, Panel* list, int x); // ---------------------------------------- bool Action_setUserOnly(const char* userName, uid_t* userId); Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); // ---------------------------------------- Htop_Reaction Action_follow(State* st); void Action_setBindings(Htop_Action* keys); #endif htop-2.1.0/config.sub0000755000175000001440000010622313235540777011405 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-12-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: htop-2.1.0/unsupported/0000755000175000001440000000000013235655643012065 500000000000000htop-2.1.0/unsupported/UnsupportedProcessList.c0000644000175000001440000000331513152362772016672 00000000000000/* htop - UnsupportedProcessList.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "UnsupportedProcess.h" #include #include /*{ }*/ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { ProcessList* this = xCalloc(1, sizeof(ProcessList)); ProcessList_init(this, Class(Process), usersTable, pidWhiteList, userId); return this; } void ProcessList_delete(ProcessList* this) { ProcessList_done(this); free(this); } void ProcessList_goThroughEntries(ProcessList* super) { bool preExisting = true; Process *proc; proc = ProcessList_getProcess(super, 1, &preExisting, UnsupportedProcess_new); /* Empty values */ proc->time = proc->time + 10; proc->pid = 1; proc->ppid = 1; proc->tgid = 0; proc->comm = ""; proc->basenameOffset = 0; proc->updated = true; proc->state = 'R'; proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */ proc->pgrp = 0; proc->session = 0; proc->tty_nr = 0; proc->tpgid = 0; proc->st_uid = 0; proc->flags = 0; proc->processor = 0; proc->percent_cpu = 2.5; proc->percent_mem = 2.5; proc->user = "nobody"; proc->priority = 0; proc->nice = 0; proc->nlwp = 1; strncpy(proc->starttime_show, "Jun 01 ", sizeof(proc->starttime_show)); proc->starttime_ctime = 1433116800; // Jun 01, 2015 proc->m_size = 100; proc->m_resident = 100; proc->minflt = 20; proc->majflt = 20; } void UnsupportedProcessList_scan(ProcessList* this) { (void) this; // stub! } htop-2.1.0/unsupported/UnsupportedCRT.c0000644000175000001440000000102213152362772015041 00000000000000/* htop - UnsupportedCRT.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); abort(); } htop-2.1.0/unsupported/Battery.h0000644000175000001440000000025713152362772013570 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/unsupported/UnsupportedProcess.h0000644000175000001440000000072713152362772016047 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_UnsupportedProcess #define HEADER_UnsupportedProcess /* htop - UnsupportedProcess.h (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Settings.h" #define Process_delete UnsupportedProcess_delete Process* UnsupportedProcess_new(Settings* settings); void UnsupportedProcess_delete(Object* cast); #endif htop-2.1.0/unsupported/UnsupportedProcess.c0000644000175000001440000000132713152362772016037 00000000000000/* htop - UnsupportedProcess.c (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "UnsupportedProcess.h" #include /*{ #include "Settings.h" #define Process_delete UnsupportedProcess_delete }*/ Process* UnsupportedProcess_new(Settings* settings) { Process* this = xCalloc(1, sizeof(Process)); Object_setClass(this, Class(Process)); Process_init(this, settings); return this; } void UnsupportedProcess_delete(Object* cast) { Process* this = (Process*) cast; Object_setClass(this, Class(Process)); Process_done((Process*)cast); // free platform-specific fields here free(this); } htop-2.1.0/unsupported/UnsupportedProcessList.h0000644000175000001440000000105613152362772016677 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_UnsupportedProcessList #define HEADER_UnsupportedProcessList /* htop - UnsupportedProcessList.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); void ProcessList_goThroughEntries(ProcessList* super); void UnsupportedProcessList_scan(ProcessList* this); #endif htop-2.1.0/unsupported/Battery.c0000644000175000001440000000020013152362772013547 00000000000000 #include "BatteryMeter.h" void Battery_getData(double* level, ACPresence* isOnAC) { *level = -1; *isOnAC = AC_ERROR; } htop-2.1.0/unsupported/Platform.h0000644000175000001440000000220213152362772013732 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - unsupported/Platform.h (C) 2014 Hisham H. Muhammad (C) 2015 David C. Hunt Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" #include "UnsupportedProcess.h" extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; extern ProcessField Platform_defaultFields[]; extern ProcessFieldData Process_fields[]; extern MeterClass* Platform_meterTypes[]; void Platform_setBindings(Htop_Action* keys); extern int Platform_numberOfFields; extern char Process_pidFormat[20]; extern ProcessPidColumn Process_pidColumns[]; int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); void Platform_setSwapValues(Meter* this); bool Process_isThread(Process* this); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/unsupported/UnsupportedCRT.h0000644000175000001440000000047613152362772015062 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_UnsupportedCRT #define HEADER_UnsupportedCRT /* htop - UnsupportedCRT.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/unsupported/Platform.c0000644000175000001440000001241313152362772013732 00000000000000/* htop - unsupported/Platform.c (C) 2014 Hisham H. Muhammad (C) 2015 David C. Hunt Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "UptimeMeter.h" /*{ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" #include "UnsupportedProcess.h" }*/ const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SID ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, [100] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &BatteryMeter_class, &HostnameMeter_class, &UptimeMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; void Platform_setBindings(Htop_Action* keys) { (void) keys; } int Platform_numberOfFields = 100; extern char Process_pidFormat[20]; ProcessPidColumn Process_pidColumns[] = { { .id = 0, .label = NULL }, }; int Platform_getUptime() { return 0; } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *one = 0; *five = 0; *fifteen = 0; } int Platform_getMaxPid() { return 1; } double Platform_setCPUValues(Meter* this, int cpu) { (void) this; (void) cpu; return 0.0; } void Platform_setMemoryValues(Meter* this) { (void) this; } void Platform_setSwapValues(Meter* this) { (void) this; } bool Process_isThread(Process* this) { (void) this; return false; } char* Platform_getProcessEnv(pid_t pid) { (void) pid; return NULL; } htop-2.1.0/linux/0000755000175000001440000000000013235655643010634 500000000000000htop-2.1.0/linux/IOPriorityPanel.c0000644000175000001440000000306613152362772013752 00000000000000/* htop - IOPriorityPanel.c (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "IOPriorityPanel.h" /*{ #include "Panel.h" #include "IOPriority.h" #include "ListItem.h" }*/ Panel* IOPriorityPanel_new(IOPriority currPrio) { Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem), FunctionBar_newEnterEsc("Set ", "Cancel ")); Panel_setHeader(this, "IO Priority:"); Panel_add(this, (Object*) ListItem_new("None (based on nice)", IOPriority_None)); if (currPrio == IOPriority_None) Panel_setSelected(this, 0); static const struct { int klass; const char* name; } classes[] = { { .klass = IOPRIO_CLASS_RT, .name = "Realtime" }, { .klass = IOPRIO_CLASS_BE, .name = "Best-effort" }, { .klass = 0, .name = NULL } }; for (int c = 0; classes[c].name; c++) { for (int i = 0; i < 8; i++) { char name[50]; xSnprintf(name, sizeof(name)-1, "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : "")); IOPriority ioprio = IOPriority_tuple(classes[c].klass, i); Panel_add(this, (Object*) ListItem_new(name, ioprio)); if (currPrio == ioprio) Panel_setSelected(this, Panel_size(this) - 1); } } Panel_add(this, (Object*) ListItem_new("Idle", IOPriority_Idle)); if (currPrio == IOPriority_Idle) Panel_setSelected(this, Panel_size(this) - 1); return this; } IOPriority IOPriorityPanel_getIOPriority(Panel* this) { return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key ); } htop-2.1.0/linux/LinuxProcess.c0000644000175000001440000005246013235653611013356 00000000000000/* htop - LinuxProcess.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "ProcessList.h" #include "LinuxProcess.h" #include "Platform.h" #include "CRT.h" #include #include #include #include /*{ #define PROCESS_FLAG_LINUX_IOPRIO 0x0100 #define PROCESS_FLAG_LINUX_OPENVZ 0x0200 #define PROCESS_FLAG_LINUX_VSERVER 0x0400 #define PROCESS_FLAG_LINUX_CGROUP 0x0800 #define PROCESS_FLAG_LINUX_OOM 0x1000 typedef enum UnsupportedProcessFields { FLAGS = 9, ITREALVALUE = 20, VSIZE = 22, RSS = 23, RLIM = 24, STARTCODE = 25, ENDCODE = 26, STARTSTACK = 27, KSTKESP = 28, KSTKEIP = 29, SIGNAL = 30, BLOCKED = 31, SSIGIGNORE = 32, SIGCATCH = 33, WCHAN = 34, NSWAP = 35, CNSWAP = 36, EXIT_SIGNAL = 37, } UnsupportedProcessField; typedef enum LinuxProcessFields { CMINFLT = 11, CMAJFLT = 13, UTIME = 14, STIME = 15, CUTIME = 16, CSTIME = 17, M_SHARE = 41, M_TRS = 42, M_DRS = 43, M_LRS = 44, M_DT = 45, #ifdef HAVE_OPENVZ CTID = 100, VPID = 101, #endif #ifdef HAVE_VSERVER VXID = 102, #endif #ifdef HAVE_TASKSTATS RCHAR = 103, WCHAR = 104, SYSCR = 105, SYSCW = 106, RBYTES = 107, WBYTES = 108, CNCLWB = 109, IO_READ_RATE = 110, IO_WRITE_RATE = 111, IO_RATE = 112, #endif #ifdef HAVE_CGROUP CGROUP = 113, #endif OOM = 114, IO_PRIORITY = 115, #ifdef HAVE_DELAYACCT PERCENT_CPU_DELAY = 116, PERCENT_IO_DELAY = 117, PERCENT_SWAP_DELAY = 118, #endif LAST_PROCESSFIELD = 119, } LinuxProcessField; #include "IOPriority.h" typedef struct LinuxProcess_ { Process super; IOPriority ioPriority; unsigned long int cminflt; unsigned long int cmajflt; unsigned long long int utime; unsigned long long int stime; unsigned long long int cutime; unsigned long long int cstime; long m_share; long m_trs; long m_drs; long m_lrs; long m_dt; #ifdef HAVE_TASKSTATS unsigned long long io_rchar; unsigned long long io_wchar; unsigned long long io_syscr; unsigned long long io_syscw; unsigned long long io_read_bytes; unsigned long long io_write_bytes; unsigned long long io_cancelled_write_bytes; unsigned long long io_rate_read_time; unsigned long long io_rate_write_time; double io_rate_read_bps; double io_rate_write_bps; #endif #ifdef HAVE_OPENVZ unsigned int ctid; unsigned int vpid; #endif #ifdef HAVE_VSERVER unsigned int vxid; #endif #ifdef HAVE_CGROUP char* cgroup; #endif unsigned int oom; char* ttyDevice; #ifdef HAVE_DELAYACCT unsigned long long int delay_read_time; unsigned long long cpu_delay_total; unsigned long long blkio_delay_total; unsigned long long swapin_delay_total; float cpu_delay_percent; float blkio_delay_percent; float swapin_delay_percent; #endif } LinuxProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif }*/ ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging, I idle)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SID ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = "TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [FLAGS] = { .name = "FLAGS", .title = NULL, .description = NULL, .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [CMINFLT] = { .name = "CMINFLT", .title = " CMINFLT ", .description = "Children processes' minor faults", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [CMAJFLT] = { .name = "CMAJFLT", .title = " CMAJFLT ", .description = "Children processes' major faults", .flags = 0, }, [UTIME] = { .name = "UTIME", .title = " UTIME+ ", .description = "User CPU time - time the process spent executing in user mode", .flags = 0, }, [STIME] = { .name = "STIME", .title = " STIME+ ", .description = "System CPU time - time the kernel spent running system calls for this process", .flags = 0, }, [CUTIME] = { .name = "CUTIME", .title = " CUTIME+ ", .description = "Children processes' user CPU time", .flags = 0, }, [CSTIME] = { .name = "CSTIME", .title = " CSTIME+ ", .description = "Children processes' system CPU time", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [ITREALVALUE] = { .name = "ITREALVALUE", .title = NULL, .description = NULL, .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [VSIZE] = { .name = "VSIZE", .title = NULL, .description = NULL, .flags = 0, }, [RSS] = { .name = "RSS", .title = NULL, .description = NULL, .flags = 0, }, [RLIM] = { .name = "RLIM", .title = NULL, .description = NULL, .flags = 0, }, [STARTCODE] = { .name = "STARTCODE", .title = NULL, .description = NULL, .flags = 0, }, [ENDCODE] = { .name = "ENDCODE", .title = NULL, .description = NULL, .flags = 0, }, [STARTSTACK] = { .name = "STARTSTACK", .title = NULL, .description = NULL, .flags = 0, }, [KSTKESP] = { .name = "KSTKESP", .title = NULL, .description = NULL, .flags = 0, }, [KSTKEIP] = { .name = "KSTKEIP", .title = NULL, .description = NULL, .flags = 0, }, [SIGNAL] = { .name = "SIGNAL", .title = NULL, .description = NULL, .flags = 0, }, [BLOCKED] = { .name = "BLOCKED", .title = NULL, .description = NULL, .flags = 0, }, [SSIGIGNORE] = { .name = "SIGIGNORE", .title = NULL, .description = NULL, .flags = 0, }, [SIGCATCH] = { .name = "SIGCATCH", .title = NULL, .description = NULL, .flags = 0, }, [WCHAN] = { .name = "WCHAN", .title = NULL, .description = NULL, .flags = 0, }, [NSWAP] = { .name = "NSWAP", .title = NULL, .description = NULL, .flags = 0, }, [CNSWAP] = { .name = "CNSWAP", .title = NULL, .description = NULL, .flags = 0, }, [EXIT_SIGNAL] = { .name = "EXIT_SIGNAL", .title = NULL, .description = NULL, .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [M_SHARE] = { .name = "M_SHARE", .title = " SHR ", .description = "Size of the process's shared pages", .flags = 0, }, [M_TRS] = { .name = "M_TRS", .title = " CODE ", .description = "Size of the text segment of the process", .flags = 0, }, [M_DRS] = { .name = "M_DRS", .title = " DATA ", .description = "Size of the data segment plus stack usage of the process", .flags = 0, }, [M_LRS] = { .name = "M_LRS", .title = " LIB ", .description = "The library size of the process", .flags = 0, }, [M_DT] = { .name = "M_DT", .title = " DIRTY ", .description = "Size of the dirty pages of the process", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, #ifdef HAVE_OPENVZ [CTID] = { .name = "CTID", .title = " CTID ", .description = "OpenVZ container ID (a.k.a. virtual environment ID)", .flags = PROCESS_FLAG_LINUX_OPENVZ, }, [VPID] = { .name = "VPID", .title = " VPID ", .description = "OpenVZ process ID", .flags = PROCESS_FLAG_LINUX_OPENVZ, }, #endif #ifdef HAVE_VSERVER [VXID] = { .name = "VXID", .title = " VXID ", .description = "VServer process ID", .flags = PROCESS_FLAG_LINUX_VSERVER, }, #endif #ifdef HAVE_TASKSTATS [RCHAR] = { .name = "RCHAR", .title = " RD_CHAR ", .description = "Number of bytes the process has read", .flags = PROCESS_FLAG_IO, }, [WCHAR] = { .name = "WCHAR", .title = " WR_CHAR ", .description = "Number of bytes the process has written", .flags = PROCESS_FLAG_IO, }, [SYSCR] = { .name = "SYSCR", .title = " RD_SYSC ", .description = "Number of read(2) syscalls for the process", .flags = PROCESS_FLAG_IO, }, [SYSCW] = { .name = "SYSCW", .title = " WR_SYSC ", .description = "Number of write(2) syscalls for the process", .flags = PROCESS_FLAG_IO, }, [RBYTES] = { .name = "RBYTES", .title = " IO_RBYTES ", .description = "Bytes of read(2) I/O for the process", .flags = PROCESS_FLAG_IO, }, [WBYTES] = { .name = "WBYTES", .title = " IO_WBYTES ", .description = "Bytes of write(2) I/O for the process", .flags = PROCESS_FLAG_IO, }, [CNCLWB] = { .name = "CNCLWB", .title = " IO_CANCEL ", .description = "Bytes of cancelled write(2) I/O", .flags = PROCESS_FLAG_IO, }, [IO_READ_RATE] = { .name = "IO_READ_RATE", .title = " DISK READ ", .description = "The I/O rate of read(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, }, [IO_WRITE_RATE] = { .name = "IO_WRITE_RATE", .title = " DISK WRITE ", .description = "The I/O rate of write(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, }, [IO_RATE] = { .name = "IO_RATE", .title = " DISK R/W ", .description = "Total I/O rate in bytes per second", .flags = PROCESS_FLAG_IO, }, #endif #ifdef HAVE_CGROUP [CGROUP] = { .name = "CGROUP", .title = " CGROUP ", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, }, #endif [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, }, [IO_PRIORITY] = { .name = "IO_PRIORITY", .title = "IO ", .description = "I/O priority", .flags = PROCESS_FLAG_LINUX_IOPRIO, }, #ifdef HAVE_DELAYACCT [PERCENT_CPU_DELAY] = { .name = "PERCENT_CPU_DELAY", .title = "CPUD% ", .description = "CPU delay %", .flags = 0, }, [PERCENT_IO_DELAY] = { .name = "PERCENT_IO_DELAY", .title = "IOD% ", .description = "Block I/O delay %", .flags = 0, }, [PERCENT_SWAP_DELAY] = { .name = "PERCENT_SWAP_DELAY", .title = "SWAPD% ", .description = "Swapin delay %", .flags = 0, }, #endif [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; ProcessPidColumn Process_pidColumns[] = { { .id = PID, .label = "PID" }, { .id = PPID, .label = "PPID" }, #ifdef HAVE_OPENVZ { .id = VPID, .label = "VPID" }, #endif { .id = TPGID, .label = "TPGID" }, { .id = TGID, .label = "TGID" }, { .id = PGRP, .label = "PGRP" }, { .id = SESSION, .label = "SID" }, { .id = OOM, .label = "OOM" }, { .id = 0, .label = NULL }, }; ProcessClass LinuxProcess_class = { .super = { .extends = Class(Process), .display = Process_display, .delete = Process_delete, .compare = LinuxProcess_compare }, .writeField = (Process_WriteField) LinuxProcess_writeField, }; LinuxProcess* LinuxProcess_new(Settings* settings) { LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess)); Object_setClass(this, Class(LinuxProcess)); Process_init(&this->super, settings); return this; } void Process_delete(Object* cast) { LinuxProcess* this = (LinuxProcess*) cast; Process_done((Process*)cast); #ifdef HAVE_CGROUP free(this->cgroup); #endif free(this->ttyDevice); free(this); } /* [1] Note that before kernel 2.6.26 a process that has not asked for an io priority formally uses "none" as scheduling class, but the io scheduler will treat such processes as if it were in the best effort class. The priority within the best effort class will be dynamically derived from the cpu nice level of the process: io_priority = (cpu_nice + 20) / 5. -- From ionice(1) man page */ #define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority) IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this) { IOPriority ioprio = 0; // Other OSes masquerading as Linux (NetBSD?) don't have this syscall #ifdef SYS_ioprio_get ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->super.pid); #endif this->ioPriority = ioprio; return ioprio; } bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio) { // Other OSes masquerading as Linux (NetBSD?) don't have this syscall #ifdef SYS_ioprio_set syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->super.pid, ioprio); #endif return (LinuxProcess_updateIOPriority(this) == ioprio); } #ifdef HAVE_DELAYACCT void LinuxProcess_printDelay(float delay_percent, char* buffer, int n) { if (delay_percent == -1LL) { xSnprintf(buffer, n, " N/A "); } else { xSnprintf(buffer, n, "%4.1f ", delay_percent); } } #endif void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field) { LinuxProcess* lp = (LinuxProcess*) this; bool coloring = this->settings->highlightMegabytes; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; int n = sizeof(buffer) - 1; switch ((int)field) { case TTY_NR: { if (lp->ttyDevice) { xSnprintf(buffer, n, "%-9s", lp->ttyDevice + 5 /* skip "/dev/" */); } else { attr = CRT_colors[PROCESS_SHADOW]; xSnprintf(buffer, n, "? "); } break; } case CMINFLT: Process_colorNumber(str, lp->cminflt, coloring); return; case CMAJFLT: Process_colorNumber(str, lp->cmajflt, coloring); return; case M_DRS: Process_humanNumber(str, lp->m_drs * PAGE_SIZE_KB, coloring); return; case M_DT: Process_humanNumber(str, lp->m_dt * PAGE_SIZE_KB, coloring); return; case M_LRS: Process_humanNumber(str, lp->m_lrs * PAGE_SIZE_KB, coloring); return; case M_TRS: Process_humanNumber(str, lp->m_trs * PAGE_SIZE_KB, coloring); return; case M_SHARE: Process_humanNumber(str, lp->m_share * PAGE_SIZE_KB, coloring); return; case UTIME: Process_printTime(str, lp->utime); return; case STIME: Process_printTime(str, lp->stime); return; case CUTIME: Process_printTime(str, lp->cutime); return; case CSTIME: Process_printTime(str, lp->cstime); return; #ifdef HAVE_TASKSTATS case RCHAR: Process_colorNumber(str, lp->io_rchar, coloring); return; case WCHAR: Process_colorNumber(str, lp->io_wchar, coloring); return; case SYSCR: Process_colorNumber(str, lp->io_syscr, coloring); return; case SYSCW: Process_colorNumber(str, lp->io_syscw, coloring); return; case RBYTES: Process_colorNumber(str, lp->io_read_bytes, coloring); return; case WBYTES: Process_colorNumber(str, lp->io_write_bytes, coloring); return; case CNCLWB: Process_colorNumber(str, lp->io_cancelled_write_bytes, coloring); return; case IO_READ_RATE: Process_outputRate(str, buffer, n, lp->io_rate_read_bps, coloring); return; case IO_WRITE_RATE: Process_outputRate(str, buffer, n, lp->io_rate_write_bps, coloring); return; case IO_RATE: { double totalRate = (lp->io_rate_read_bps != -1) ? (lp->io_rate_read_bps + lp->io_rate_write_bps) : -1; Process_outputRate(str, buffer, n, totalRate, coloring); return; } #endif #ifdef HAVE_OPENVZ case CTID: xSnprintf(buffer, n, "%7u ", lp->ctid); break; case VPID: xSnprintf(buffer, n, Process_pidFormat, lp->vpid); break; #endif #ifdef HAVE_VSERVER case VXID: xSnprintf(buffer, n, "%5u ", lp->vxid); break; #endif #ifdef HAVE_CGROUP case CGROUP: xSnprintf(buffer, n, "%-10s ", lp->cgroup); break; #endif case OOM: xSnprintf(buffer, n, Process_pidFormat, lp->oom); break; case IO_PRIORITY: { int klass = IOPriority_class(lp->ioPriority); if (klass == IOPRIO_CLASS_NONE) { // see note [1] above xSnprintf(buffer, n, "B%1d ", (int) (this->nice + 20) / 5); } else if (klass == IOPRIO_CLASS_BE) { xSnprintf(buffer, n, "B%1d ", IOPriority_data(lp->ioPriority)); } else if (klass == IOPRIO_CLASS_RT) { attr = CRT_colors[PROCESS_HIGH_PRIORITY]; xSnprintf(buffer, n, "R%1d ", IOPriority_data(lp->ioPriority)); } else if (klass == IOPRIO_CLASS_IDLE) { attr = CRT_colors[PROCESS_LOW_PRIORITY]; xSnprintf(buffer, n, "id "); } else { xSnprintf(buffer, n, "?? "); } break; } #ifdef HAVE_DELAYACCT case PERCENT_CPU_DELAY: LinuxProcess_printDelay(lp->cpu_delay_percent, buffer, n); break; case PERCENT_IO_DELAY: LinuxProcess_printDelay(lp->blkio_delay_percent, buffer, n); break; case PERCENT_SWAP_DELAY: LinuxProcess_printDelay(lp->swapin_delay_percent, buffer, n); break; #endif default: Process_writeField((Process*)this, str, field); return; } RichString_append(str, attr, buffer); } long LinuxProcess_compare(const void* v1, const void* v2) { LinuxProcess *p1, *p2; Settings *settings = ((Process*)v1)->settings; if (settings->direction == 1) { p1 = (LinuxProcess*)v1; p2 = (LinuxProcess*)v2; } else { p2 = (LinuxProcess*)v1; p1 = (LinuxProcess*)v2; } long long diff; switch ((int)settings->sortKey) { case M_DRS: return (p2->m_drs - p1->m_drs); case M_DT: return (p2->m_dt - p1->m_dt); case M_LRS: return (p2->m_lrs - p1->m_lrs); case M_TRS: return (p2->m_trs - p1->m_trs); case M_SHARE: return (p2->m_share - p1->m_share); case UTIME: diff = p2->utime - p1->utime; goto test_diff; case CUTIME: diff = p2->cutime - p1->cutime; goto test_diff; case STIME: diff = p2->stime - p1->stime; goto test_diff; case CSTIME: diff = p2->cstime - p1->cstime; goto test_diff; #ifdef HAVE_TASKSTATS case RCHAR: diff = p2->io_rchar - p1->io_rchar; goto test_diff; case WCHAR: diff = p2->io_wchar - p1->io_wchar; goto test_diff; case SYSCR: diff = p2->io_syscr - p1->io_syscr; goto test_diff; case SYSCW: diff = p2->io_syscw - p1->io_syscw; goto test_diff; case RBYTES: diff = p2->io_read_bytes - p1->io_read_bytes; goto test_diff; case WBYTES: diff = p2->io_write_bytes - p1->io_write_bytes; goto test_diff; case CNCLWB: diff = p2->io_cancelled_write_bytes - p1->io_cancelled_write_bytes; goto test_diff; case IO_READ_RATE: diff = p2->io_rate_read_bps - p1->io_rate_read_bps; goto test_diff; case IO_WRITE_RATE: diff = p2->io_rate_write_bps - p1->io_rate_write_bps; goto test_diff; case IO_RATE: diff = (p2->io_rate_read_bps + p2->io_rate_write_bps) - (p1->io_rate_read_bps + p1->io_rate_write_bps); goto test_diff; #endif #ifdef HAVE_OPENVZ case CTID: return (p2->ctid - p1->ctid); case VPID: return (p2->vpid - p1->vpid); #endif #ifdef HAVE_VSERVER case VXID: return (p2->vxid - p1->vxid); #endif #ifdef HAVE_CGROUP case CGROUP: return strcmp(p1->cgroup ? p1->cgroup : "", p2->cgroup ? p2->cgroup : ""); #endif case OOM: return (p2->oom - p1->oom); #ifdef HAVE_DELAYACCT case PERCENT_CPU_DELAY: return (p2->cpu_delay_percent > p1->cpu_delay_percent ? 1 : -1); case PERCENT_IO_DELAY: return (p2->blkio_delay_percent > p1->blkio_delay_percent ? 1 : -1); case PERCENT_SWAP_DELAY: return (p2->swapin_delay_percent > p1->swapin_delay_percent ? 1 : -1); #endif case IO_PRIORITY: return LinuxProcess_effectiveIOPriority(p1) - LinuxProcess_effectiveIOPriority(p2); default: return Process_compare(v1, v2); } test_diff: return (diff > 0) ? 1 : (diff < 0 ? -1 : 0); } bool Process_isThread(Process* this) { return (Process_isUserlandThread(this) || Process_isKernelThread(this)); } htop-2.1.0/linux/LinuxProcessList.h0000644000175000001440000000464413235653611014220 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_LinuxProcessList #define HEADER_LinuxProcessList /* htop - LinuxProcessList.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #ifdef HAVE_DELAYACCT #endif #include "ProcessList.h" typedef struct CPUData_ { unsigned long long int totalTime; unsigned long long int userTime; unsigned long long int systemTime; unsigned long long int systemAllTime; unsigned long long int idleAllTime; unsigned long long int idleTime; unsigned long long int niceTime; unsigned long long int ioWaitTime; unsigned long long int irqTime; unsigned long long int softIrqTime; unsigned long long int stealTime; unsigned long long int guestTime; unsigned long long int totalPeriod; unsigned long long int userPeriod; unsigned long long int systemPeriod; unsigned long long int systemAllPeriod; unsigned long long int idleAllPeriod; unsigned long long int idlePeriod; unsigned long long int nicePeriod; unsigned long long int ioWaitPeriod; unsigned long long int irqPeriod; unsigned long long int softIrqPeriod; unsigned long long int stealPeriod; unsigned long long int guestPeriod; } CPUData; typedef struct TtyDriver_ { char* path; unsigned int major; unsigned int minorFrom; unsigned int minorTo; } TtyDriver; typedef struct LinuxProcessList_ { ProcessList super; CPUData* cpus; TtyDriver* ttyDrivers; #ifdef HAVE_DELAYACCT struct nl_sock *netlink_socket; int netlink_family; #endif } LinuxProcessList; #ifndef PROCDIR #define PROCDIR "/proc" #endif #ifndef PROCSTATFILE #define PROCSTATFILE PROCDIR "/stat" #endif #ifndef PROCMEMINFOFILE #define PROCMEMINFOFILE PROCDIR "/meminfo" #endif #ifndef PROCTTYDRIVERSFILE #define PROCTTYDRIVERSFILE PROCDIR "/tty/drivers" #endif #ifndef PROC_LINE_LENGTH #define PROC_LINE_LENGTH 512 #endif #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif #ifdef HAVE_DELAYACCT #endif ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* pl); #ifdef HAVE_TASKSTATS #endif #ifdef HAVE_OPENVZ #endif #ifdef HAVE_CGROUP #endif #ifdef HAVE_VSERVER #endif #ifdef HAVE_DELAYACCT #endif void ProcessList_goThroughEntries(ProcessList* super); #endif htop-2.1.0/linux/LinuxProcessList.c0000644000175000001440000010113313235653611014202 00000000000000/* htop - LinuxProcessList.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "LinuxProcessList.h" #include "LinuxProcess.h" #include "CRT.h" #include "StringUtils.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_DELAYACCT #include #include #include #include #include #include #include #endif /*{ #include "ProcessList.h" typedef struct CPUData_ { unsigned long long int totalTime; unsigned long long int userTime; unsigned long long int systemTime; unsigned long long int systemAllTime; unsigned long long int idleAllTime; unsigned long long int idleTime; unsigned long long int niceTime; unsigned long long int ioWaitTime; unsigned long long int irqTime; unsigned long long int softIrqTime; unsigned long long int stealTime; unsigned long long int guestTime; unsigned long long int totalPeriod; unsigned long long int userPeriod; unsigned long long int systemPeriod; unsigned long long int systemAllPeriod; unsigned long long int idleAllPeriod; unsigned long long int idlePeriod; unsigned long long int nicePeriod; unsigned long long int ioWaitPeriod; unsigned long long int irqPeriod; unsigned long long int softIrqPeriod; unsigned long long int stealPeriod; unsigned long long int guestPeriod; } CPUData; typedef struct TtyDriver_ { char* path; unsigned int major; unsigned int minorFrom; unsigned int minorTo; } TtyDriver; typedef struct LinuxProcessList_ { ProcessList super; CPUData* cpus; TtyDriver* ttyDrivers; #ifdef HAVE_DELAYACCT struct nl_sock *netlink_socket; int netlink_family; #endif } LinuxProcessList; #ifndef PROCDIR #define PROCDIR "/proc" #endif #ifndef PROCSTATFILE #define PROCSTATFILE PROCDIR "/stat" #endif #ifndef PROCMEMINFOFILE #define PROCMEMINFOFILE PROCDIR "/meminfo" #endif #ifndef PROCTTYDRIVERSFILE #define PROCTTYDRIVERSFILE PROCDIR "/tty/drivers" #endif #ifndef PROC_LINE_LENGTH #define PROC_LINE_LENGTH 512 #endif }*/ #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif static ssize_t xread(int fd, void *buf, size_t count) { // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested. size_t alreadyRead = 0; for(;;) { ssize_t res = read(fd, buf, count); if (res == -1 && errno == EINTR) continue; if (res > 0) { buf = ((char*)buf)+res; count -= res; alreadyRead += res; } if (res == -1) return -1; if (count == 0 || res == 0) return alreadyRead; } } static int sortTtyDrivers(const void* va, const void* vb) { TtyDriver* a = (TtyDriver*) va; TtyDriver* b = (TtyDriver*) vb; return (a->major == b->major) ? (a->minorFrom - b->minorFrom) : (a->major - b->major); } static void LinuxProcessList_initTtyDrivers(LinuxProcessList* this) { TtyDriver* ttyDrivers; int fd = open(PROCTTYDRIVERSFILE, O_RDONLY); if (fd == -1) return; char* buf = NULL; int bufSize = MAX_READ; int bufLen = 0; for(;;) { buf = realloc(buf, bufSize); int size = xread(fd, buf + bufLen, MAX_READ); if (size <= 0) { buf[bufLen] = '\0'; close(fd); break; } bufLen += size; bufSize += MAX_READ; } if (bufLen == 0) { free(buf); return; } int numDrivers = 0; int allocd = 10; ttyDrivers = malloc(sizeof(TtyDriver) * allocd); char* at = buf; while (*at != '\0') { at = strchr(at, ' '); // skip first token while (*at == ' ') at++; // skip spaces char* token = at; // mark beginning of path at = strchr(at, ' '); // find end of path *at = '\0'; at++; // clear and skip ttyDrivers[numDrivers].path = strdup(token); // save while (*at == ' ') at++; // skip spaces token = at; // mark beginning of major at = strchr(at, ' '); // find end of major *at = '\0'; at++; // clear and skip ttyDrivers[numDrivers].major = atoi(token); // save while (*at == ' ') at++; // skip spaces token = at; // mark beginning of minorFrom while (*at >= '0' && *at <= '9') at++; //find end of minorFrom if (*at == '-') { // if has range *at = '\0'; at++; // clear and skip ttyDrivers[numDrivers].minorFrom = atoi(token); // save token = at; // mark beginning of minorTo at = strchr(at, ' '); // find end of minorTo *at = '\0'; at++; // clear and skip ttyDrivers[numDrivers].minorTo = atoi(token); // save } else { // no range *at = '\0'; at++; // clear and skip ttyDrivers[numDrivers].minorFrom = atoi(token); // save ttyDrivers[numDrivers].minorTo = atoi(token); // save } at = strchr(at, '\n'); // go to end of line at++; // skip numDrivers++; if (numDrivers == allocd) { allocd += 10; ttyDrivers = realloc(ttyDrivers, sizeof(TtyDriver) * allocd); } } free(buf); numDrivers++; ttyDrivers = realloc(ttyDrivers, sizeof(TtyDriver) * numDrivers); ttyDrivers[numDrivers - 1].path = NULL; qsort(ttyDrivers, numDrivers - 1, sizeof(TtyDriver), sortTtyDrivers); this->ttyDrivers = ttyDrivers; } #ifdef HAVE_DELAYACCT static void LinuxProcessList_initNetlinkSocket(LinuxProcessList* this) { this->netlink_socket = nl_socket_alloc(); if (this->netlink_socket == NULL) { return; } if (nl_connect(this->netlink_socket, NETLINK_GENERIC) < 0) { return; } this->netlink_family = genl_ctrl_resolve(this->netlink_socket, TASKSTATS_GENL_NAME); } #endif ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { LinuxProcessList* this = xCalloc(1, sizeof(LinuxProcessList)); ProcessList* pl = &(this->super); ProcessList_init(pl, Class(LinuxProcess), usersTable, pidWhiteList, userId); LinuxProcessList_initTtyDrivers(this); #ifdef HAVE_DELAYACCT LinuxProcessList_initNetlinkSocket(this); #endif // Update CPU count: FILE* file = fopen(PROCSTATFILE, "r"); if (file == NULL) { CRT_fatalError("Cannot open " PROCSTATFILE); } char buffer[PROC_LINE_LENGTH + 1]; int cpus = -1; do { cpus++; char * s = fgets(buffer, PROC_LINE_LENGTH, file); (void) s; } while (String_startsWith(buffer, "cpu")); fclose(file); pl->cpuCount = MAX(cpus - 1, 1); this->cpus = xCalloc(cpus, sizeof(CPUData)); for (int i = 0; i < cpus; i++) { this->cpus[i].totalTime = 1; this->cpus[i].totalPeriod = 1; } return pl; } void ProcessList_delete(ProcessList* pl) { LinuxProcessList* this = (LinuxProcessList*) pl; ProcessList_done(pl); free(this->cpus); if (this->ttyDrivers) { for(int i = 0; this->ttyDrivers[i].path; i++) { free(this->ttyDrivers[i].path); } free(this->ttyDrivers); } #ifdef HAVE_DELAYACCT if (this->netlink_socket) { nl_close(this->netlink_socket); nl_socket_free(this->netlink_socket); } #endif free(this); } static double jiffy = 0.0; static inline unsigned long long LinuxProcess_adjustTime(unsigned long long t) { if(jiffy == 0.0) jiffy = sysconf(_SC_CLK_TCK); double jiffytime = 1.0 / jiffy; return (unsigned long long) t * jiffytime * 100; } static bool LinuxProcessList_readStatFile(Process *process, const char* dirname, const char* name, char* command, int* commLen) { LinuxProcess* lp = (LinuxProcess*) process; char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name); int fd = open(filename, O_RDONLY); if (fd == -1) return false; static char buf[MAX_READ+1]; int size = xread(fd, buf, MAX_READ); close(fd); if (size <= 0) return false; buf[size] = '\0'; assert(process->pid == atoi(buf)); char *location = strchr(buf, ' '); if (!location) return false; location += 2; char *end = strrchr(location, ')'); if (!end) return false; int commsize = end - location; memcpy(command, location, commsize); command[commsize] = '\0'; *commLen = commsize; location = end + 2; process->state = location[0]; location += 2; process->ppid = strtol(location, &location, 10); location += 1; process->pgrp = strtoul(location, &location, 10); location += 1; process->session = strtoul(location, &location, 10); location += 1; process->tty_nr = strtoul(location, &location, 10); location += 1; process->tpgid = strtol(location, &location, 10); location += 1; process->flags = strtoul(location, &location, 10); location += 1; process->minflt = strtoull(location, &location, 10); location += 1; lp->cminflt = strtoull(location, &location, 10); location += 1; process->majflt = strtoull(location, &location, 10); location += 1; lp->cmajflt = strtoull(location, &location, 10); location += 1; lp->utime = LinuxProcess_adjustTime(strtoull(location, &location, 10)); location += 1; lp->stime = LinuxProcess_adjustTime(strtoull(location, &location, 10)); location += 1; lp->cutime = LinuxProcess_adjustTime(strtoull(location, &location, 10)); location += 1; lp->cstime = LinuxProcess_adjustTime(strtoull(location, &location, 10)); location += 1; process->priority = strtol(location, &location, 10); location += 1; process->nice = strtol(location, &location, 10); location += 1; process->nlwp = strtol(location, &location, 10); location += 1; for (int i=0; i<17; i++) location = strchr(location, ' ')+1; process->exit_signal = strtol(location, &location, 10); location += 1; assert(location != NULL); process->processor = strtol(location, &location, 10); process->time = lp->utime + lp->stime; return true; } static bool LinuxProcessList_statProcessDir(Process* process, const char* dirname, char* name, time_t curTime) { char filename[MAX_NAME+1]; filename[MAX_NAME] = '\0'; xSnprintf(filename, MAX_NAME, "%s/%s", dirname, name); struct stat sstat; int statok = stat(filename, &sstat); if (statok == -1) return false; process->st_uid = sstat.st_uid; struct tm date; time_t ctime = sstat.st_ctime; process->starttime_ctime = ctime; (void) localtime_r((time_t*) &ctime, &date); strftime(process->starttime_show, 7, ((ctime > curTime - 86400) ? "%R " : "%b%d "), &date); return true; } #ifdef HAVE_TASKSTATS static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirname, char* name, unsigned long long now) { char filename[MAX_NAME+1]; filename[MAX_NAME] = '\0'; xSnprintf(filename, MAX_NAME, "%s/%s/io", dirname, name); int fd = open(filename, O_RDONLY); if (fd == -1) { process->io_rate_read_bps = -1; process->io_rate_write_bps = -1; process->io_rchar = -1LL; process->io_wchar = -1LL; process->io_syscr = -1LL; process->io_syscw = -1LL; process->io_read_bytes = -1LL; process->io_write_bytes = -1LL; process->io_cancelled_write_bytes = -1LL; process->io_rate_read_time = -1LL; process->io_rate_write_time = -1LL; return; } char buffer[1024]; ssize_t buflen = xread(fd, buffer, 1023); close(fd); if (buflen < 1) return; buffer[buflen] = '\0'; unsigned long long last_read = process->io_read_bytes; unsigned long long last_write = process->io_write_bytes; char *buf = buffer; char *line = NULL; while ((line = strsep(&buf, "\n")) != NULL) { switch (line[0]) { case 'r': if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0) process->io_rchar = strtoull(line+7, NULL, 10); else if (strncmp(line+1, "ead_bytes: ", 11) == 0) { process->io_read_bytes = strtoull(line+12, NULL, 10); process->io_rate_read_bps = ((double)(process->io_read_bytes - last_read))/(((double)(now - process->io_rate_read_time))/1000); process->io_rate_read_time = now; } break; case 'w': if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0) process->io_wchar = strtoull(line+7, NULL, 10); else if (strncmp(line+1, "rite_bytes: ", 12) == 0) { process->io_write_bytes = strtoull(line+13, NULL, 10); process->io_rate_write_bps = ((double)(process->io_write_bytes - last_write))/(((double)(now - process->io_rate_write_time))/1000); process->io_rate_write_time = now; } break; case 's': if (line[5] == 'r' && strncmp(line+1, "yscr: ", 6) == 0) { process->io_syscr = strtoull(line+7, NULL, 10); } else if (strncmp(line+1, "yscw: ", 6) == 0) { process->io_syscw = strtoull(line+7, NULL, 10); } break; case 'c': if (strncmp(line+1, "ancelled_write_bytes: ", 22) == 0) { process->io_cancelled_write_bytes = strtoull(line+23, NULL, 10); } } } } #endif static bool LinuxProcessList_readStatmFile(LinuxProcess* process, const char* dirname, const char* name) { char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/statm", dirname, name); int fd = open(filename, O_RDONLY); if (fd == -1) return false; char buf[PROC_LINE_LENGTH + 1]; ssize_t rres = xread(fd, buf, PROC_LINE_LENGTH); close(fd); if (rres < 1) return false; char *p = buf; errno = 0; process->super.m_size = strtol(p, &p, 10); if (*p == ' ') p++; process->super.m_resident = strtol(p, &p, 10); if (*p == ' ') p++; process->m_share = strtol(p, &p, 10); if (*p == ' ') p++; process->m_trs = strtol(p, &p, 10); if (*p == ' ') p++; process->m_lrs = strtol(p, &p, 10); if (*p == ' ') p++; process->m_drs = strtol(p, &p, 10); if (*p == ' ') p++; process->m_dt = strtol(p, &p, 10); return (errno == 0); } #ifdef HAVE_OPENVZ static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* dirname, const char* name) { if ( (access("/proc/vz", R_OK) != 0)) { process->vpid = process->super.pid; process->ctid = 0; return; } char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name); FILE* file = fopen(filename, "r"); if (!file) return; (void) fscanf(file, "%*32u %*32s %*1c %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %*32u %*32u %*32u %*32u %*32u " "%*32u %*32u %32u %32u", &process->vpid, &process->ctid); fclose(file); return; } #endif #ifdef HAVE_CGROUP static void LinuxProcessList_readCGroupFile(LinuxProcess* process, const char* dirname, const char* name) { char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/cgroup", dirname, name); FILE* file = fopen(filename, "r"); if (!file) { process->cgroup = xStrdup(""); return; } char output[PROC_LINE_LENGTH + 1]; output[0] = '\0'; char* at = output; int left = PROC_LINE_LENGTH; while (!feof(file) && left > 0) { char buffer[PROC_LINE_LENGTH + 1]; char *ok = fgets(buffer, PROC_LINE_LENGTH, file); if (!ok) break; char* group = strchr(buffer, ':'); if (!group) break; if (at != output) { *at = ';'; at++; left--; } int wrote = snprintf(at, left, "%s", group); left -= wrote; } fclose(file); free(process->cgroup); process->cgroup = xStrdup(output); } #endif #ifdef HAVE_VSERVER static void LinuxProcessList_readVServerData(LinuxProcess* process, const char* dirname, const char* name) { char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/status", dirname, name); FILE* file = fopen(filename, "r"); if (!file) return; char buffer[PROC_LINE_LENGTH + 1]; process->vxid = 0; while (fgets(buffer, PROC_LINE_LENGTH, file)) { if (String_startsWith(buffer, "VxID:")) { int vxid; int ok = sscanf(buffer, "VxID:\t%32d", &vxid); if (ok >= 1) { process->vxid = vxid; } } #if defined HAVE_ANCIENT_VSERVER else if (String_startsWith(buffer, "s_context:")) { int vxid; int ok = sscanf(buffer, "s_context:\t%32d", &vxid); if (ok >= 1) { process->vxid = vxid; } } #endif } fclose(file); } #endif static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirname, const char* name) { char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/oom_score", dirname, name); FILE* file = fopen(filename, "r"); if (!file) { return; } char buffer[PROC_LINE_LENGTH + 1]; if (fgets(buffer, PROC_LINE_LENGTH, file)) { unsigned int oom; int ok = sscanf(buffer, "%32u", &oom); if (ok >= 1) { process->oom = oom; } } fclose(file); } #ifdef HAVE_DELAYACCT static int handleNetlinkMsg(struct nl_msg *nlmsg, void *linuxProcess) { struct nlmsghdr *nlhdr; struct nlattr *nlattrs[TASKSTATS_TYPE_MAX + 1]; struct nlattr *nlattr; struct taskstats *stats; int rem; unsigned long long int timeDelta; LinuxProcess* lp = (LinuxProcess*) linuxProcess; nlhdr = nlmsg_hdr(nlmsg); if (genlmsg_parse(nlhdr, 0, nlattrs, TASKSTATS_TYPE_MAX, NULL) < 0) { return NL_SKIP; } if ((nlattr = nlattrs[TASKSTATS_TYPE_AGGR_PID]) || (nlattr = nlattrs[TASKSTATS_TYPE_NULL])) { stats = nla_data(nla_next(nla_data(nlattr), &rem)); assert(lp->super.pid == stats->ac_pid); timeDelta = (stats->ac_etime*1000 - lp->delay_read_time); #define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x; #define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100); lp->cpu_delay_percent = DELTAPERC(stats->cpu_delay_total, lp->cpu_delay_total); lp->blkio_delay_percent = DELTAPERC(stats->blkio_delay_total, lp->blkio_delay_total); lp->swapin_delay_percent = DELTAPERC(stats->swapin_delay_total, lp->swapin_delay_total); #undef DELTAPERC #undef BOUNDS lp->swapin_delay_total = stats->swapin_delay_total; lp->blkio_delay_total = stats->blkio_delay_total; lp->cpu_delay_total = stats->cpu_delay_total; lp->delay_read_time = stats->ac_etime*1000; } return NL_OK; } static void LinuxProcessList_readDelayAcctData(LinuxProcessList* this, LinuxProcess* process) { struct nl_msg *msg; if (nl_socket_modify_cb(this->netlink_socket, NL_CB_VALID, NL_CB_CUSTOM, handleNetlinkMsg, process) < 0) { return; } if (! (msg = nlmsg_alloc())) { return; } if (! genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, this->netlink_family, 0, NLM_F_REQUEST, TASKSTATS_CMD_GET, TASKSTATS_VERSION)) { nlmsg_free(msg); } if (nla_put_u32(msg, TASKSTATS_CMD_ATTR_PID, process->super.pid) < 0) { nlmsg_free(msg); } if (nl_send_sync(this->netlink_socket, msg) < 0) { process->swapin_delay_percent = -1LL; process->blkio_delay_percent = -1LL; process->cpu_delay_percent = -1LL; return; } if (nl_recvmsgs_default(this->netlink_socket) < 0) { return; } } #endif static void setCommand(Process* process, const char* command, int len) { if (process->comm && process->commLen >= len) { strncpy(process->comm, command, len + 1); } else { free(process->comm); process->comm = xStrdup(command); } process->commLen = len; } static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirname, const char* name) { if (Process_isKernelThread(process)) return true; char filename[MAX_NAME+1]; xSnprintf(filename, MAX_NAME, "%s/%s/cmdline", dirname, name); int fd = open(filename, O_RDONLY); if (fd == -1) return false; char command[4096+1]; // max cmdline length on Linux int amtRead = xread(fd, command, sizeof(command) - 1); close(fd); int tokenEnd = 0; int lastChar = 0; if (amtRead <= 0) { return false; } for (int i = 0; i < amtRead; i++) { if (command[i] == '\0' || command[i] == '\n') { if (tokenEnd == 0) { tokenEnd = i; } command[i] = ' '; } else { lastChar = i; } } if (tokenEnd == 0) { tokenEnd = amtRead; } command[lastChar + 1] = '\0'; process->basenameOffset = tokenEnd; setCommand(process, command, lastChar); return true; } static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned int tty_nr) { unsigned int maj = major(tty_nr); unsigned int min = minor(tty_nr); int i = -1; for (;;) { i++; if ((!ttyDrivers[i].path) || maj < ttyDrivers[i].major) { break; } if (maj > ttyDrivers[i].major) { continue; } if (min < ttyDrivers[i].minorFrom) { break; } if (min > ttyDrivers[i].minorTo) { continue; } unsigned int idx = min - ttyDrivers[i].minorFrom; struct stat sstat; char* fullPath; for(;;) { asprintf(&fullPath, "%s/%d", ttyDrivers[i].path, idx); int err = stat(fullPath, &sstat); if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath; free(fullPath); asprintf(&fullPath, "%s%d", ttyDrivers[i].path, idx); err = stat(fullPath, &sstat); if (err == 0 && major(sstat.st_rdev) == maj && minor(sstat.st_rdev) == min) return fullPath; free(fullPath); if (idx == min) break; idx = min; } int err = stat(ttyDrivers[i].path, &sstat); if (err == 0 && tty_nr == sstat.st_rdev) return strdup(ttyDrivers[i].path); } char* out; asprintf(&out, "/dev/%u:%u", maj, min); return out; } static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char* dirname, Process* parent, double period, struct timeval tv) { ProcessList* pl = (ProcessList*) this; DIR* dir; struct dirent* entry; Settings* settings = pl->settings; time_t curTime = tv.tv_sec; #ifdef HAVE_TASKSTATS unsigned long long now = tv.tv_sec*1000LL+tv.tv_usec/1000LL; #endif dir = opendir(dirname); if (!dir) return false; int cpus = pl->cpuCount; bool hideKernelThreads = settings->hideKernelThreads; bool hideUserlandThreads = settings->hideUserlandThreads; while ((entry = readdir(dir)) != NULL) { char* name = entry->d_name; // The RedHat kernel hides threads with a dot. // I believe this is non-standard. if ((!settings->hideThreads) && name[0] == '.') { name++; } // Just skip all non-number directories. if (name[0] < '0' || name[0] > '9') { continue; } // filename is a number: process directory int pid = atoi(name); if (parent && pid == parent->pid) continue; if (pid <= 0) continue; bool preExisting = false; Process* proc = ProcessList_getProcess(pl, pid, &preExisting, (Process_New) LinuxProcess_new); proc->tgid = parent ? parent->pid : pid; LinuxProcess* lp = (LinuxProcess*) proc; char subdirname[MAX_NAME+1]; xSnprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name); LinuxProcessList_recurseProcTree(this, subdirname, proc, period, tv); #ifdef HAVE_TASKSTATS if (settings->flags & PROCESS_FLAG_IO) LinuxProcessList_readIoFile(lp, dirname, name, now); #endif if (! LinuxProcessList_readStatmFile(lp, dirname, name)) goto errorReadingProcess; proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); char command[MAX_NAME+1]; unsigned long long int lasttimes = (lp->utime + lp->stime); int commLen = 0; unsigned int tty_nr = proc->tty_nr; if (! LinuxProcessList_readStatFile(proc, dirname, name, command, &commLen)) goto errorReadingProcess; if (tty_nr != proc->tty_nr && this->ttyDrivers) { free(lp->ttyDevice); lp->ttyDevice = LinuxProcessList_updateTtyDevice(this->ttyDrivers, proc->tty_nr); } if (settings->flags & PROCESS_FLAG_LINUX_IOPRIO) LinuxProcess_updateIOPriority(lp); float percent_cpu = (lp->utime + lp->stime - lasttimes) / period * 100.0; proc->percent_cpu = CLAMP(percent_cpu, 0.0, cpus * 100.0); if (isnan(proc->percent_cpu)) proc->percent_cpu = 0.0; proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(pl->totalMem) * 100.0; if(!preExisting) { if (! LinuxProcessList_statProcessDir(proc, dirname, name, curTime)) goto errorReadingProcess; proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid); #ifdef HAVE_OPENVZ if (settings->flags & PROCESS_FLAG_LINUX_OPENVZ) { LinuxProcessList_readOpenVZData(lp, dirname, name); } #endif #ifdef HAVE_VSERVER if (settings->flags & PROCESS_FLAG_LINUX_VSERVER) { LinuxProcessList_readVServerData(lp, dirname, name); } #endif if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) { goto errorReadingProcess; } ProcessList_add(pl, proc); } else { if (settings->updateProcessNames && proc->state != 'Z') { if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) { goto errorReadingProcess; } } } #ifdef HAVE_DELAYACCT LinuxProcessList_readDelayAcctData(this, lp); #endif #ifdef HAVE_CGROUP if (settings->flags & PROCESS_FLAG_LINUX_CGROUP) LinuxProcessList_readCGroupFile(lp, dirname, name); #endif if (settings->flags & PROCESS_FLAG_LINUX_OOM) LinuxProcessList_readOomData(lp, dirname, name); if (proc->state == 'Z' && (proc->basenameOffset == 0)) { proc->basenameOffset = -1; setCommand(proc, command, commLen); } else if (Process_isThread(proc)) { if (settings->showThreadNames || Process_isKernelThread(proc) || (proc->state == 'Z' && proc->basenameOffset == 0)) { proc->basenameOffset = -1; setCommand(proc, command, commLen); } else if (settings->showThreadNames) { if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) goto errorReadingProcess; } if (Process_isKernelThread(proc)) { pl->kernelThreads++; } else { pl->userlandThreads++; } } pl->totalTasks++; if (proc->state == 'R') pl->runningTasks++; proc->updated = true; continue; // Exception handler. errorReadingProcess: { if (preExisting) { ProcessList_remove(pl, proc); } else { Process_delete((Object*)proc); } } } closedir(dir); return true; } static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { unsigned long long int swapFree = 0; unsigned long long int shmem = 0; unsigned long long int sreclaimable = 0; FILE* file = fopen(PROCMEMINFOFILE, "r"); if (file == NULL) { CRT_fatalError("Cannot open " PROCMEMINFOFILE); } char buffer[128]; while (fgets(buffer, 128, file)) { #define tryRead(label, variable) (String_startsWith(buffer, label) && sscanf(buffer + strlen(label), " %32llu kB", variable)) switch (buffer[0]) { case 'M': if (tryRead("MemTotal:", &this->totalMem)) {} else if (tryRead("MemFree:", &this->freeMem)) {} else if (tryRead("MemShared:", &this->sharedMem)) {} break; case 'B': if (tryRead("Buffers:", &this->buffersMem)) {} break; case 'C': if (tryRead("Cached:", &this->cachedMem)) {} break; case 'S': switch (buffer[1]) { case 'w': if (tryRead("SwapTotal:", &this->totalSwap)) {} else if (tryRead("SwapFree:", &swapFree)) {} break; case 'h': if (tryRead("Shmem:", &shmem)) {} break; case 'R': if (tryRead("SReclaimable:", &sreclaimable)) {} break; } break; } #undef tryRead } this->usedMem = this->totalMem - this->freeMem; this->cachedMem = this->cachedMem + sreclaimable - shmem; this->usedSwap = this->totalSwap - swapFree; fclose(file); } static inline double LinuxProcessList_scanCPUTime(LinuxProcessList* this) { FILE* file = fopen(PROCSTATFILE, "r"); if (file == NULL) { CRT_fatalError("Cannot open " PROCSTATFILE); } int cpus = this->super.cpuCount; assert(cpus > 0); for (int i = 0; i <= cpus; i++) { char buffer[PROC_LINE_LENGTH + 1]; unsigned long long int usertime, nicetime, systemtime, idletime; unsigned long long int ioWait, irq, softIrq, steal, guest, guestnice; ioWait = irq = softIrq = steal = guest = guestnice = 0; // Depending on your kernel version, // 5, 7, 8 or 9 of these fields will be set. // The rest will remain at zero. char* ok = fgets(buffer, PROC_LINE_LENGTH, file); if (!ok) buffer[0] = '\0'; if (i == 0) sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice); else { int cpuid; sscanf(buffer, "cpu%4d %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &cpuid, &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice); assert(cpuid == i - 1); } // Guest time is already accounted in usertime usertime = usertime - guest; nicetime = nicetime - guestnice; // Fields existing on kernels >= 2.6 // (and RHEL's patched kernel 2.4...) unsigned long long int idlealltime = idletime + ioWait; unsigned long long int systemalltime = systemtime + irq + softIrq; unsigned long long int virtalltime = guest + guestnice; unsigned long long int totaltime = usertime + nicetime + systemalltime + idlealltime + steal + virtalltime; CPUData* cpuData = &(this->cpus[i]); // Since we do a subtraction (usertime - guest) and cputime64_to_clock_t() // used in /proc/stat rounds down numbers, it can lead to a case where the // integer overflow. #define WRAP_SUBTRACT(a,b) (a > b) ? a - b : 0 cpuData->userPeriod = WRAP_SUBTRACT(usertime, cpuData->userTime); cpuData->nicePeriod = WRAP_SUBTRACT(nicetime, cpuData->niceTime); cpuData->systemPeriod = WRAP_SUBTRACT(systemtime, cpuData->systemTime); cpuData->systemAllPeriod = WRAP_SUBTRACT(systemalltime, cpuData->systemAllTime); cpuData->idleAllPeriod = WRAP_SUBTRACT(idlealltime, cpuData->idleAllTime); cpuData->idlePeriod = WRAP_SUBTRACT(idletime, cpuData->idleTime); cpuData->ioWaitPeriod = WRAP_SUBTRACT(ioWait, cpuData->ioWaitTime); cpuData->irqPeriod = WRAP_SUBTRACT(irq, cpuData->irqTime); cpuData->softIrqPeriod = WRAP_SUBTRACT(softIrq, cpuData->softIrqTime); cpuData->stealPeriod = WRAP_SUBTRACT(steal, cpuData->stealTime); cpuData->guestPeriod = WRAP_SUBTRACT(virtalltime, cpuData->guestTime); cpuData->totalPeriod = WRAP_SUBTRACT(totaltime, cpuData->totalTime); #undef WRAP_SUBTRACT cpuData->userTime = usertime; cpuData->niceTime = nicetime; cpuData->systemTime = systemtime; cpuData->systemAllTime = systemalltime; cpuData->idleAllTime = idlealltime; cpuData->idleTime = idletime; cpuData->ioWaitTime = ioWait; cpuData->irqTime = irq; cpuData->softIrqTime = softIrq; cpuData->stealTime = steal; cpuData->guestTime = virtalltime; cpuData->totalTime = totaltime; } double period = (double)this->cpus[0].totalPeriod / cpus; fclose(file); return period; } void ProcessList_goThroughEntries(ProcessList* super) { LinuxProcessList* this = (LinuxProcessList*) super; LinuxProcessList_scanMemoryInfo(super); double period = LinuxProcessList_scanCPUTime(this); struct timeval tv; gettimeofday(&tv, NULL); LinuxProcessList_recurseProcTree(this, PROCDIR, NULL, period, tv); } htop-2.1.0/linux/Battery.h0000644000175000001440000000165013152362772012335 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery /* htop - linux/Battery.h (C) 2004-2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #define SYS_POWERSUPPLY_DIR "/sys/class/power_supply" // ---------------------------------------- // READ FROM /proc // ---------------------------------------- // This implementation reading from from /proc/acpi is really inefficient, // but I think this is on the way out so I did not rewrite it. // The /sys implementation below does things the right way. // ---------------------------------------- // READ FROM /sys // ---------------------------------------- void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/linux/LinuxCRT.c0000644000175000001440000000245713152362772012374 00000000000000/* htop - LinuxCRT.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include #ifdef HAVE_EXECINFO_H #include #endif void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); #ifdef __linux fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n"); #ifdef HAVE_EXECINFO_H size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); fprintf(stderr, "\n Please include in your report the following backtrace: \n"); backtrace_symbols_fd(backtraceArray, size, 2); fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump"); fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report."); fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); #endif #else fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); #endif abort(); } htop-2.1.0/linux/IOPriorityPanel.h0000644000175000001440000000072013152362772013751 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_IOPriorityPanel #define HEADER_IOPriorityPanel /* htop - IOPriorityPanel.h (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "IOPriority.h" #include "ListItem.h" Panel* IOPriorityPanel_new(IOPriority currPrio); IOPriority IOPriorityPanel_getIOPriority(Panel* this); #endif htop-2.1.0/linux/LinuxProcess.h0000644000175000001440000001043013235653611013352 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_LinuxProcess #define HEADER_LinuxProcess /* htop - LinuxProcess.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #define PROCESS_FLAG_LINUX_IOPRIO 0x0100 #define PROCESS_FLAG_LINUX_OPENVZ 0x0200 #define PROCESS_FLAG_LINUX_VSERVER 0x0400 #define PROCESS_FLAG_LINUX_CGROUP 0x0800 #define PROCESS_FLAG_LINUX_OOM 0x1000 typedef enum UnsupportedProcessFields { FLAGS = 9, ITREALVALUE = 20, VSIZE = 22, RSS = 23, RLIM = 24, STARTCODE = 25, ENDCODE = 26, STARTSTACK = 27, KSTKESP = 28, KSTKEIP = 29, SIGNAL = 30, BLOCKED = 31, SSIGIGNORE = 32, SIGCATCH = 33, WCHAN = 34, NSWAP = 35, CNSWAP = 36, EXIT_SIGNAL = 37, } UnsupportedProcessField; typedef enum LinuxProcessFields { CMINFLT = 11, CMAJFLT = 13, UTIME = 14, STIME = 15, CUTIME = 16, CSTIME = 17, M_SHARE = 41, M_TRS = 42, M_DRS = 43, M_LRS = 44, M_DT = 45, #ifdef HAVE_OPENVZ CTID = 100, VPID = 101, #endif #ifdef HAVE_VSERVER VXID = 102, #endif #ifdef HAVE_TASKSTATS RCHAR = 103, WCHAR = 104, SYSCR = 105, SYSCW = 106, RBYTES = 107, WBYTES = 108, CNCLWB = 109, IO_READ_RATE = 110, IO_WRITE_RATE = 111, IO_RATE = 112, #endif #ifdef HAVE_CGROUP CGROUP = 113, #endif OOM = 114, IO_PRIORITY = 115, #ifdef HAVE_DELAYACCT PERCENT_CPU_DELAY = 116, PERCENT_IO_DELAY = 117, PERCENT_SWAP_DELAY = 118, #endif LAST_PROCESSFIELD = 119, } LinuxProcessField; #include "IOPriority.h" typedef struct LinuxProcess_ { Process super; IOPriority ioPriority; unsigned long int cminflt; unsigned long int cmajflt; unsigned long long int utime; unsigned long long int stime; unsigned long long int cutime; unsigned long long int cstime; long m_share; long m_trs; long m_drs; long m_lrs; long m_dt; #ifdef HAVE_TASKSTATS unsigned long long io_rchar; unsigned long long io_wchar; unsigned long long io_syscr; unsigned long long io_syscw; unsigned long long io_read_bytes; unsigned long long io_write_bytes; unsigned long long io_cancelled_write_bytes; unsigned long long io_rate_read_time; unsigned long long io_rate_write_time; double io_rate_read_bps; double io_rate_write_bps; #endif #ifdef HAVE_OPENVZ unsigned int ctid; unsigned int vpid; #endif #ifdef HAVE_VSERVER unsigned int vxid; #endif #ifdef HAVE_CGROUP char* cgroup; #endif unsigned int oom; char* ttyDevice; #ifdef HAVE_DELAYACCT unsigned long long int delay_read_time; unsigned long long cpu_delay_total; unsigned long long blkio_delay_total; unsigned long long swapin_delay_total; float cpu_delay_percent; float blkio_delay_percent; float swapin_delay_percent; #endif } LinuxProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; extern ProcessClass LinuxProcess_class; LinuxProcess* LinuxProcess_new(Settings* settings); void Process_delete(Object* cast); /* [1] Note that before kernel 2.6.26 a process that has not asked for an io priority formally uses "none" as scheduling class, but the io scheduler will treat such processes as if it were in the best effort class. The priority within the best effort class will be dynamically derived from the cpu nice level of the process: extern io_priority; */ #define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority) IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this); bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio); #ifdef HAVE_DELAYACCT void LinuxProcess_printDelay(float delay_percent, char* buffer, int n); #endif void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field); long LinuxProcess_compare(const void* v1, const void* v2); bool Process_isThread(Process* this); #endif htop-2.1.0/linux/LinuxCRT.h0000644000175000001440000000051213152362772012367 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_LinuxCRT #define HEADER_LinuxCRT /* htop - LinuxCRT.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #ifdef HAVE_EXECINFO_H #endif void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/linux/IOPriority.c0000644000175000001440000000170513152362772012770 00000000000000/* htop - IOPriority.c (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. Based on ionice, Copyright (C) 2005 Jens Axboe Released under the terms of the GNU General Public License version 2 */ #include "IOPriority.h" /*{ enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, }; #define IOPRIO_WHO_PROCESS 1 #define IOPRIO_CLASS_SHIFT (13) #define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) #define IOPriority_class(ioprio_) ((int) ((ioprio_) >> IOPRIO_CLASS_SHIFT) ) #define IOPriority_data(ioprio_) ((int) ((ioprio_) & IOPRIO_PRIO_MASK) ) typedef int IOPriority; #define IOPriority_tuple(class_, data_) (((class_) << IOPRIO_CLASS_SHIFT) | data_) #define IOPriority_error 0xffffffff #define IOPriority_None IOPriority_tuple(IOPRIO_CLASS_NONE, 0) #define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7) }*/ htop-2.1.0/linux/Battery.c0000644000175000001440000002037113235627610012326 00000000000000/* htop - linux/Battery.c (C) 2004-2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include #include "BatteryMeter.h" #include "StringUtils.h" #define SYS_POWERSUPPLY_DIR "/sys/class/power_supply" // ---------------------------------------- // READ FROM /proc // ---------------------------------------- // This implementation reading from from /proc/acpi is really inefficient, // but I think this is on the way out so I did not rewrite it. // The /sys implementation below does things the right way. static unsigned long int parseBatInfo(const char *fileName, const unsigned short int lineNum, const unsigned short int wordNum) { const char batteryPath[] = PROCDIR "/acpi/battery/"; DIR* batteryDir = opendir(batteryPath); if (!batteryDir) return 0; #define MAX_BATTERIES 64 char* batteries[MAX_BATTERIES]; unsigned int nBatteries = 0; memset(batteries, 0, MAX_BATTERIES * sizeof(char*)); while (nBatteries < MAX_BATTERIES) { struct dirent* dirEntry = readdir(batteryDir); if (!dirEntry) break; char* entryName = dirEntry->d_name; if (strncmp(entryName, "BAT", 3)) continue; batteries[nBatteries] = xStrdup(entryName); nBatteries++; } closedir(batteryDir); unsigned long int total = 0; for (unsigned int i = 0; i < nBatteries; i++) { char infoPath[30]; xSnprintf(infoPath, sizeof infoPath, "%s%s/%s", batteryPath, batteries[i], fileName); FILE* file = fopen(infoPath, "r"); if (!file) { break; } char* line = NULL; for (unsigned short int i = 0; i < lineNum; i++) { free(line); line = String_readLine(file); if (!line) break; } fclose(file); if (!line) break; char *foundNumStr = String_getToken(line, wordNum); const unsigned long int foundNum = atoi(foundNumStr); free(foundNumStr); free(line); total += foundNum; } for (unsigned int i = 0; i < nBatteries; i++) { free(batteries[i]); } return total; } static ACPresence procAcpiCheck() { ACPresence isOn = AC_ERROR; const char *power_supplyPath = PROCDIR "/acpi/ac_adapter"; DIR *dir = opendir(power_supplyPath); if (!dir) { return AC_ERROR; } for (;;) { struct dirent* dirEntry = readdir((DIR *) dir); if (!dirEntry) break; char* entryName = (char *) dirEntry->d_name; if (entryName[0] != 'A') continue; char statePath[50]; xSnprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName); FILE* file = fopen(statePath, "r"); if (!file) { isOn = AC_ERROR; continue; } char* line = String_readLine(file); if (!line) continue; fclose(file); const char *isOnline = String_getToken(line, 2); free(line); if (strcmp(isOnline, "on-line") == 0) { isOn = AC_PRESENT; } else { isOn = AC_ABSENT; } free((char *) isOnline); if (isOn == AC_PRESENT) { break; } } if (dir) closedir(dir); return isOn; } static double Battery_getProcBatData() { const unsigned long int totalFull = parseBatInfo("info", 3, 4); if (totalFull == 0) return 0; const unsigned long int totalRemain = parseBatInfo("state", 5, 3); if (totalRemain == 0) return 0; return totalRemain * 100.0 / (double) totalFull; } static void Battery_getProcData(double* level, ACPresence* isOnAC) { *level = Battery_getProcBatData(); *isOnAC = procAcpiCheck(); } // ---------------------------------------- // READ FROM /sys // ---------------------------------------- static inline ssize_t xread(int fd, void *buf, size_t count) { // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested. size_t alreadyRead = 0; for(;;) { ssize_t res = read(fd, buf, count); if (res == -1 && errno == EINTR) continue; if (res > 0) { buf = ((char*)buf)+res; count -= res; alreadyRead += res; } if (res == -1) return -1; if (count == 0 || res == 0) return alreadyRead; } } static void Battery_getSysData(double* level, ACPresence* isOnAC) { *level = 0; *isOnAC = AC_ERROR; DIR *dir = opendir(SYS_POWERSUPPLY_DIR); if (!dir) return; unsigned long int totalFull = 0; unsigned long int totalRemain = 0; for (;;) { struct dirent* dirEntry = readdir((DIR *) dir); if (!dirEntry) break; char* entryName = (char *) dirEntry->d_name; const char filePath[50]; if (entryName[0] == 'B' && entryName[1] == 'A' && entryName[2] == 'T') { xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName); int fd = open(filePath, O_RDONLY); if (fd == -1) { closedir(dir); return; } char buffer[1024]; ssize_t buflen = xread(fd, buffer, 1023); close(fd); if (buflen < 1) { closedir(dir); return; } buffer[buflen] = '\0'; char *buf = buffer; char *line = NULL; bool full = false; bool now = false; while ((line = strsep(&buf, "\n")) != NULL) { #define match(str,prefix) \ (String_startsWith(str,prefix) ? (str) + strlen(prefix) : NULL) const char* ps = match(line, "POWER_SUPPLY_"); if (!ps) { continue; } const char* energy = match(ps, "ENERGY_"); if (!energy) { energy = match(ps, "CHARGE_"); } if (!energy) { continue; } const char* value = (!full) ? match(energy, "FULL=") : NULL; if (value) { totalFull += atoi(value); full = true; if (now) break; continue; } value = (!now) ? match(energy, "NOW=") : NULL; if (value) { totalRemain += atoi(value); now = true; if (full) break; continue; } } #undef match } else if (entryName[0] == 'A') { if (*isOnAC != AC_ERROR) { continue; } xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName); int fd = open(filePath, O_RDONLY); if (fd == -1) { closedir(dir); return; } char buffer[2] = ""; for(;;) { ssize_t res = read(fd, buffer, 1); if (res == -1 && errno == EINTR) continue; break; } close(fd); if (buffer[0] == '0') { *isOnAC = AC_ABSENT; } else if (buffer[0] == '1') { *isOnAC = AC_PRESENT; } } } closedir(dir); *level = totalFull > 0 ? ((double) totalRemain * 100) / (double) totalFull : 0; } static enum { BAT_PROC, BAT_SYS, BAT_ERR } Battery_method = BAT_PROC; static time_t Battery_cacheTime = 0; static double Battery_cacheLevel = 0; static ACPresence Battery_cacheIsOnAC = 0; void Battery_getData(double* level, ACPresence* isOnAC) { time_t now = time(NULL); // update battery reading is slow. Update it each 10 seconds only. if (now < Battery_cacheTime + 10) { *level = Battery_cacheLevel; *isOnAC = Battery_cacheIsOnAC; return; } if (Battery_method == BAT_PROC) { Battery_getProcData(level, isOnAC); if (*level == 0) { Battery_method = BAT_SYS; } } if (Battery_method == BAT_SYS) { Battery_getSysData(level, isOnAC); if (*level == 0) { Battery_method = BAT_ERR; } } if (Battery_method == BAT_ERR) { *level = -1; *isOnAC = AC_ERROR; } if (*level > 100.0) { *level = 100.0; } Battery_cacheLevel = *level; Battery_cacheIsOnAC = *isOnAC; Battery_cacheTime = now; } htop-2.1.0/linux/IOPriority.h0000644000175000001440000000203613152362772012773 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_IOPriority #define HEADER_IOPriority /* htop - IOPriority.h (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. Based on ionice, Copyright (C) 2005 Jens Axboe Released under the terms of the GNU General Public License version 2 */ enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, }; #define IOPRIO_WHO_PROCESS 1 #define IOPRIO_CLASS_SHIFT (13) #define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1) #define IOPriority_class(ioprio_) ((int) ((ioprio_) >> IOPRIO_CLASS_SHIFT) ) #define IOPriority_data(ioprio_) ((int) ((ioprio_) & IOPRIO_PRIO_MASK) ) typedef int IOPriority; #define IOPriority_tuple(class_, data_) (((class_) << IOPRIO_CLASS_SHIFT) | data_) #define IOPriority_error 0xffffffff #define IOPriority_None IOPriority_tuple(IOPRIO_CLASS_NONE, 0) #define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7) #endif htop-2.1.0/linux/Platform.h0000644000175000001440000000205713234203026012474 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - linux/Platform.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "MainPanel.h" #include "BatteryMeter.h" #include "LinuxProcess.h" #include "SignalsPanel.h" #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); void Platform_setSwapValues(Meter* this); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/linux/Platform.c0000644000175000001440000001663613235653611012511 00000000000000/* htop - linux/Platform.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "IOPriority.h" #include "IOPriorityPanel.h" #include "LinuxProcess.h" #include "LinuxProcessList.h" #include "Battery.h" #include "Meter.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "UptimeMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "LinuxProcess.h" #include #include #include #include #include /*{ #include "Action.h" #include "MainPanel.h" #include "BatteryMeter.h" #include "LinuxProcess.h" #include "SignalsPanel.h" }*/ #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; //static ProcessField defaultIoFields[] = { PID, IO_PRIORITY, USER, IO_READ_RATE, IO_WRITE_RATE, IO_RATE, COMM, 0 }; int Platform_numberOfFields = LAST_PROCESSFIELD; const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, { .name = " 2 SIGINT", .number = 2 }, { .name = " 3 SIGQUIT", .number = 3 }, { .name = " 4 SIGILL", .number = 4 }, { .name = " 5 SIGTRAP", .number = 5 }, { .name = " 6 SIGABRT", .number = 6 }, { .name = " 6 SIGIOT", .number = 6 }, { .name = " 7 SIGBUS", .number = 7 }, { .name = " 8 SIGFPE", .number = 8 }, { .name = " 9 SIGKILL", .number = 9 }, { .name = "10 SIGUSR1", .number = 10 }, { .name = "11 SIGSEGV", .number = 11 }, { .name = "12 SIGUSR2", .number = 12 }, { .name = "13 SIGPIPE", .number = 13 }, { .name = "14 SIGALRM", .number = 14 }, { .name = "15 SIGTERM", .number = 15 }, { .name = "16 SIGSTKFLT", .number = 16 }, { .name = "17 SIGCHLD", .number = 17 }, { .name = "18 SIGCONT", .number = 18 }, { .name = "19 SIGSTOP", .number = 19 }, { .name = "20 SIGTSTP", .number = 20 }, { .name = "21 SIGTTIN", .number = 21 }, { .name = "22 SIGTTOU", .number = 22 }, { .name = "23 SIGURG", .number = 23 }, { .name = "24 SIGXCPU", .number = 24 }, { .name = "25 SIGXFSZ", .number = 25 }, { .name = "26 SIGVTALRM", .number = 26 }, { .name = "27 SIGPROF", .number = 27 }, { .name = "28 SIGWINCH", .number = 28 }, { .name = "29 SIGIO", .number = 29 }, { .name = "29 SIGPOLL", .number = 29 }, { .name = "30 SIGPWR", .number = 30 }, { .name = "31 SIGSYS", .number = 31 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); static Htop_Reaction Platform_actionSetIOPriority(State* st) { Panel* panel = st->panel; LinuxProcess* p = (LinuxProcess*) Panel_getSelected(panel); if (!p) return HTOP_OK; IOPriority ioprio = p->ioPriority; Panel* ioprioPanel = IOPriorityPanel_new(ioprio); void* set = Action_pickFromVector(st, ioprioPanel, 21); if (set) { IOPriority ioprio = IOPriorityPanel_getIOPriority(ioprioPanel); bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) LinuxProcess_setIOPriority, (size_t) ioprio, NULL); if (!ok) beep(); } Panel_delete((Object*)ioprioPanel); return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } void Platform_setBindings(Htop_Action* keys) { keys['i'] = Platform_actionSetIOPriority; } MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &UptimeMeter_class, &BatteryMeter_class, &HostnameMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; int Platform_getUptime() { double uptime = 0; FILE* fd = fopen(PROCDIR "/uptime", "r"); if (fd) { int n = fscanf(fd, "%64lf", &uptime); fclose(fd); if (n <= 0) return 0; } return (int) floor(uptime); } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { int activeProcs, totalProcs, lastProc; *one = 0; *five = 0; *fifteen = 0; FILE *fd = fopen(PROCDIR "/loadavg", "r"); if (fd) { int total = fscanf(fd, "%32lf %32lf %32lf %32d/%32d %32d", one, five, fifteen, &activeProcs, &totalProcs, &lastProc); (void) total; assert(total == 6); fclose(fd); } } int Platform_getMaxPid() { FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r"); if (!file) return -1; int maxPid = 4194303; int match = fscanf(file, "%32d", &maxPid); (void) match; fclose(file); return maxPid; } double Platform_setCPUValues(Meter* this, int cpu) { LinuxProcessList* pl = (LinuxProcessList*) this->pl; CPUData* cpuData = &(pl->cpus[cpu]); double total = (double) ( cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod); double percent; double* v = this->values; v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0; v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0; if (this->pl->settings->detailedCPUTime) { v[CPU_METER_KERNEL] = cpuData->systemPeriod / total * 100.0; v[CPU_METER_IRQ] = cpuData->irqPeriod / total * 100.0; v[CPU_METER_SOFTIRQ] = cpuData->softIrqPeriod / total * 100.0; v[CPU_METER_STEAL] = cpuData->stealPeriod / total * 100.0; v[CPU_METER_GUEST] = cpuData->guestPeriod / total * 100.0; v[CPU_METER_IOWAIT] = cpuData->ioWaitPeriod / total * 100.0; Meter_setItems(this, 8); if (this->pl->settings->accountGuestInCPUMeter) { percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6]; } else { percent = v[0]+v[1]+v[2]+v[3]+v[4]; } } else { v[2] = cpuData->systemAllPeriod / total * 100.0; v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0; Meter_setItems(this, 4); percent = v[0]+v[1]+v[2]+v[3]; } percent = CLAMP(percent, 0.0, 100.0); if (isnan(percent)) percent = 0.0; return percent; } void Platform_setMemoryValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; long int usedMem = pl->usedMem; long int buffersMem = pl->buffersMem; long int cachedMem = pl->cachedMem; usedMem -= buffersMem + cachedMem; this->total = pl->totalMem; this->values[0] = usedMem; this->values[1] = buffersMem; this->values[2] = cachedMem; } void Platform_setSwapValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; this->total = pl->totalSwap; this->values[0] = pl->usedSwap; } char* Platform_getProcessEnv(pid_t pid) { char procname[32+1]; xSnprintf(procname, 32, "/proc/%d/environ", pid); FILE* fd = fopen(procname, "r"); char *env = NULL; if (fd) { size_t capacity = 4096, size = 0, bytes; env = xMalloc(capacity); while (env && (bytes = fread(env+size, 1, capacity-size, fd)) > 0) { size += bytes; capacity *= 2; env = xRealloc(env, capacity); } fclose(fd); if (size < 2 || env[size-1] || env[size-2]) { if (size + 2 < capacity) { env = xRealloc(env, capacity+2); } env[size] = 0; env[size+1] = 0; } } return env; } htop-2.1.0/MemoryMeter.c0000644000175000001440000000363613152362772012032 00000000000000/* htop - MemoryMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "MemoryMeter.h" #include "CRT.h" #include "Platform.h" #include #include #include #include #include /*{ #include "Meter.h" }*/ int MemoryMeter_attributes[] = { MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE }; static void MemoryMeter_updateValues(Meter* this, char* buffer, int size) { int written; Platform_setMemoryValues(this); written = Meter_humanUnit(buffer, this->values[0], size); buffer += written; if ((size -= written) > 0) { *buffer++ = '/'; size--; Meter_humanUnit(buffer, this->total, size); } } static void MemoryMeter_display(Object* cast, RichString* out) { char buffer[50]; Meter* this = (Meter*)cast; RichString_write(out, CRT_colors[METER_TEXT], ":"); Meter_humanUnit(buffer, this->total, 50); RichString_append(out, CRT_colors[METER_VALUE], buffer); Meter_humanUnit(buffer, this->values[0], 50); RichString_append(out, CRT_colors[METER_TEXT], " used:"); RichString_append(out, CRT_colors[MEMORY_USED], buffer); Meter_humanUnit(buffer, this->values[1], 50); RichString_append(out, CRT_colors[METER_TEXT], " buffers:"); RichString_append(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer); Meter_humanUnit(buffer, this->values[2], 50); RichString_append(out, CRT_colors[METER_TEXT], " cache:"); RichString_append(out, CRT_colors[MEMORY_CACHE], buffer); } MeterClass MemoryMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = MemoryMeter_display, }, .updateValues = MemoryMeter_updateValues, .defaultMode = BAR_METERMODE, .maxItems = 3, .total = 100.0, .attributes = MemoryMeter_attributes, .name = "Memory", .uiName = "Memory", .caption = "Mem" }; htop-2.1.0/TraceScreen.h0000644000175000001440000000145713153324652011763 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_TraceScreen #define HEADER_TraceScreen /* htop - TraceScreen.h (C) 2005-2006 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "InfoScreen.h" typedef struct TraceScreen_ { InfoScreen super; bool tracing; int fdpair[2]; int child; FILE* strace; int fd_strace; bool contLine; bool follow; } TraceScreen; extern InfoScreenClass TraceScreen_class; TraceScreen* TraceScreen_new(Process* process); void TraceScreen_delete(Object* cast); void TraceScreen_draw(InfoScreen* this); bool TraceScreen_forkTracer(TraceScreen* this); void TraceScreen_updateTrace(InfoScreen* super); bool TraceScreen_onKey(InfoScreen* super, int ch); #endif htop-2.1.0/openbsd/0000755000175000001440000000000013235655643011127 500000000000000htop-2.1.0/openbsd/Battery.h0000644000175000001440000000054513152362772012632 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery /* htop - openbsd/Battery.h (C) 2015 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/openbsd/OpenBSDCRT.h0000644000175000001440000000052213152362772013016 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_OpenBSDCRT #define HEADER_OpenBSDCRT /* htop - UnsupportedCRT.h (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/openbsd/OpenBSDCRT.c0000644000175000001440000000105613152362772013014 00000000000000/* htop - UnsupportedCRT.c (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); fprintf(stderr, "\n\nhtop " VERSION " aborting.\n"); fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); abort(); } htop-2.1.0/openbsd/OpenBSDProcessList.h0000644000175000001440000000235713152362772014650 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_OpenBSDProcessList #define HEADER_OpenBSDProcessList /* htop - OpenBSDProcessList.h (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include typedef struct CPUData_ { unsigned long long int totalTime; unsigned long long int totalPeriod; } CPUData; typedef struct OpenBSDProcessList_ { ProcessList super; kvm_t* kd; CPUData* cpus; } OpenBSDProcessList; /* * avoid relying on or conflicting with MIN() and MAX() in sys/param.h */ #ifndef MINIMUM #define MINIMUM(x, y) ((x) > (y) ? (y) : (x)) #endif #ifndef MAXIMUM #define MAXIMUM(x, y) ((x) > (y) ? (x) : (y)) #endif #ifndef CLAMP #define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low)) #endif ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); /* * Taken from OpenBSD's ps(1). */ double getpcpu(const struct kinfo_proc *kp); void ProcessList_goThroughEntries(ProcessList* this); #endif htop-2.1.0/openbsd/OpenBSDProcess.c0000644000175000001440000001470713235624301014000 00000000000000/* htop - OpenBSDProcess.c (C) 2015 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "ProcessList.h" #include "OpenBSDProcess.h" #include "Platform.h" #include "CRT.h" #include #include #include /*{ typedef enum OpenBSDProcessFields { // Add platform-specific fields here, with ids >= 100 LAST_PROCESSFIELD = 100, } OpenBSDProcessField; typedef struct OpenBSDProcess_ { Process super; } OpenBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif }*/ ProcessClass OpenBSDProcess_class = { .super = { .extends = Class(Process), .display = Process_display, .delete = Process_delete, .compare = OpenBSDProcess_compare }, .writeField = (Process_WriteField) OpenBSDProcess_writeField, }; ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SESN ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; ProcessPidColumn Process_pidColumns[] = { { .id = PID, .label = "PID" }, { .id = PPID, .label = "PPID" }, { .id = TPGID, .label = "TPGID" }, { .id = TGID, .label = "TGID" }, { .id = PGRP, .label = "PGRP" }, { .id = SESSION, .label = "SESN" }, { .id = 0, .label = NULL }, }; OpenBSDProcess* OpenBSDProcess_new(Settings* settings) { OpenBSDProcess* this = xCalloc(sizeof(OpenBSDProcess), 1); Object_setClass(this, Class(OpenBSDProcess)); Process_init(&this->super, settings); return this; } void Process_delete(Object* cast) { OpenBSDProcess* this = (OpenBSDProcess*) cast; Process_done((Process*)cast); free(this); } void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field) { //OpenBSDProcess* fp = (OpenBSDProcess*) this; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; //int n = sizeof(buffer) - 1; switch (field) { // add OpenBSD-specific fields here default: Process_writeField(this, str, field); return; } RichString_append(str, attr, buffer); } long OpenBSDProcess_compare(const void* v1, const void* v2) { OpenBSDProcess *p1, *p2; Settings *settings = ((Process*)v1)->settings; if (settings->direction == 1) { p1 = (OpenBSDProcess*)v1; p2 = (OpenBSDProcess*)v2; } else { p2 = (OpenBSDProcess*)v1; p1 = (OpenBSDProcess*)v2; } switch (settings->sortKey) { // add OpenBSD-specific fields here default: return Process_compare(v1, v2); } } bool Process_isThread(Process* this) { return (Process_isKernelThread(this)); } htop-2.1.0/openbsd/OpenBSDProcess.h0000644000175000001440000000221013235624301013767 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_OpenBSDProcess #define HEADER_OpenBSDProcess /* htop - OpenBSDProcess.h (C) 2015 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ typedef enum OpenBSDProcessFields { // Add platform-specific fields here, with ids >= 100 LAST_PROCESSFIELD = 100, } OpenBSDProcessField; typedef struct OpenBSDProcess_ { Process super; } OpenBSDProcess; #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) #endif #ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #endif extern ProcessClass OpenBSDProcess_class; extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; OpenBSDProcess* OpenBSDProcess_new(Settings* settings); void Process_delete(Object* cast); void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field); long OpenBSDProcess_compare(const void* v1, const void* v2); bool Process_isThread(Process* this); #endif htop-2.1.0/openbsd/Battery.c0000644000175000001440000000050113152362772012615 00000000000000/* htop - openbsd/Battery.c (C) 2015 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "BatteryMeter.h" void Battery_getData(double* level, ACPresence* isOnAC) { // TODO *level = -1; *isOnAC = AC_ERROR; } htop-2.1.0/openbsd/Platform.h0000644000175000001440000000356113152362772013005 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - openbsd/Platform.h (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; #define MAXCPU 256 // XXX: probably should be a struct member /* * Copyright (c) 1984, 1989, William LeFebvre, Rice University * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University * * Taken directly from OpenBSD's top(1). * * percentages(cnt, out, new, old, diffs) - calculate percentage change * between array "old" and "new", putting the percentages in "out". * "cnt" is size of each array and "diffs" is used for scratch space. * The array "old" is updated on each call. * The routine assumes modulo arithmetic. This function is especially * useful on BSD machines for calculating cpu state percentages. */ extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; /* * See /usr/include/sys/signal.h */ extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; // preserved from FreeBSD port int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); /* * Copyright (c) 1994 Thorsten Lockert * All rights reserved. * * Taken almost directly from OpenBSD's top(1) */ void Platform_setSwapValues(Meter* this); void Platform_setTasksValues(Meter* this); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/openbsd/OpenBSDProcessList.c0000644000175000001440000002073413152362772014642 00000000000000/* htop - OpenBSDProcessList.c (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "OpenBSDProcessList.h" #include "OpenBSDProcess.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*{ #include typedef struct CPUData_ { unsigned long long int totalTime; unsigned long long int totalPeriod; } CPUData; typedef struct OpenBSDProcessList_ { ProcessList super; kvm_t* kd; CPUData* cpus; } OpenBSDProcessList; }*/ /* * avoid relying on or conflicting with MIN() and MAX() in sys/param.h */ #ifndef MINIMUM #define MINIMUM(x, y) ((x) > (y) ? (y) : (x)) #endif #ifndef MAXIMUM #define MAXIMUM(x, y) ((x) > (y) ? (x) : (y)) #endif #ifndef CLAMP #define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low)) #endif static long fscale; ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { int mib[] = { CTL_HW, HW_NCPU }; int fmib[] = { CTL_KERN, KERN_FSCALE }; int i, e; OpenBSDProcessList* opl; ProcessList* pl; size_t size; char errbuf[_POSIX2_LINE_MAX]; opl = xCalloc(1, sizeof(OpenBSDProcessList)); pl = (ProcessList*) opl; size = sizeof(pl->cpuCount); ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidWhiteList, userId); e = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0); if (e == -1 || pl->cpuCount < 1) { pl->cpuCount = 1; } opl->cpus = xRealloc(opl->cpus, pl->cpuCount * sizeof(CPUData)); size = sizeof(fscale); if (sysctl(fmib, 2, &fscale, &size, NULL, 0) < 0) { err(1, "fscale sysctl call failed"); } for (i = 0; i < pl->cpuCount; i++) { opl->cpus[i].totalTime = 1; opl->cpus[i].totalPeriod = 1; } opl->kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (opl->kd == NULL) { errx(1, "kvm_open: %s", errbuf); } return pl; } void ProcessList_delete(ProcessList* this) { const OpenBSDProcessList* opl = (OpenBSDProcessList*) this; if (opl->kd) { kvm_close(opl->kd); } free(opl->cpus); ProcessList_done(this); free(this); } static inline void OpenBSDProcessList_scanMemoryInfo(ProcessList* pl) { static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP}; struct uvmexp uvmexp; size_t size_uvmexp = sizeof(uvmexp); if (sysctl(uvmexp_mib, 2, &uvmexp, &size_uvmexp, NULL, 0) < 0) { err(1, "uvmexp sysctl call failed"); } pl->totalMem = uvmexp.npages * PAGE_SIZE_KB; // Taken from OpenBSD systat/iostat.c, top/machine.c and uvm_sysctl(9) static int bcache_mib[] = {CTL_VFS, VFS_GENERIC, VFS_BCACHESTAT}; struct bcachestats bcstats; size_t size_bcstats = sizeof(bcstats); if (sysctl(bcache_mib, 3, &bcstats, &size_bcstats, NULL, 0) < 0) { err(1, "cannot get vfs.bcachestat"); } pl->cachedMem = bcstats.numbufpages * PAGE_SIZE_KB; pl->freeMem = uvmexp.free * PAGE_SIZE_KB; pl->usedMem = (uvmexp.npages - uvmexp.free - uvmexp.paging) * PAGE_SIZE_KB; /* const OpenBSDProcessList* opl = (OpenBSDProcessList*) pl; size_t len = sizeof(pl->totalMem); sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0); pl->totalMem /= 1024; sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(pl->usedMem), &len, NULL, 0); pl->usedMem *= PAGE_SIZE_KB; pl->freeMem = pl->totalMem - pl->usedMem; sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0); pl->cachedMem *= PAGE_SIZE_KB; struct kvm_swap swap[16]; int nswap = kvm_getswapinfo(opl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0); pl->totalSwap = 0; pl->usedSwap = 0; for (int i = 0; i < nswap; i++) { pl->totalSwap += swap[i].ksw_total; pl->usedSwap += swap[i].ksw_used; } pl->totalSwap *= PAGE_SIZE_KB; pl->usedSwap *= PAGE_SIZE_KB; pl->sharedMem = 0; // currently unused pl->buffersMem = 0; // not exposed to userspace */ } char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd) { char *s, **arg; size_t len = 0, n; int i; /* * Like OpenBSD's top(1), we try to fall back to the command name * (argv[0]) if we fail to construct the full command. */ arg = kvm_getargv(kd, kproc, 500); if (arg == NULL || *arg == NULL) { *basenameEnd = strlen(kproc->p_comm); return xStrdup(kproc->p_comm); } for (i = 0; arg[i] != NULL; i++) { len += strlen(arg[i]) + 1; /* room for arg and trailing space or NUL */ } /* don't use xMalloc here - we want to handle huge argv's gracefully */ if ((s = malloc(len)) == NULL) { *basenameEnd = strlen(kproc->p_comm); return xStrdup(kproc->p_comm); } *s = '\0'; for (i = 0; arg[i] != NULL; i++) { n = strlcat(s, arg[i], len); if (i == 0) { /* TODO: rename all basenameEnd to basenameLen, make size_t */ *basenameEnd = MINIMUM(n, len-1); } /* the trailing space should get truncated anyway */ strlcat(s, " ", len); } return s; } /* * Taken from OpenBSD's ps(1). */ double getpcpu(const struct kinfo_proc *kp) { if (fscale == 0) return (0.0); #define fxtofl(fixpt) ((double)(fixpt) / fscale) return (100.0 * fxtofl(kp->p_pctcpu)); } void ProcessList_goThroughEntries(ProcessList* this) { OpenBSDProcessList* opl = (OpenBSDProcessList*) this; Settings* settings = this->settings; bool hideKernelThreads = settings->hideKernelThreads; bool hideUserlandThreads = settings->hideUserlandThreads; struct kinfo_proc* kproc; bool preExisting; Process* proc; OpenBSDProcess* fp; int count = 0; int i; OpenBSDProcessList_scanMemoryInfo(this); // use KERN_PROC_KTHREAD to also include kernel threads struct kinfo_proc* kprocs = kvm_getprocs(opl->kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count); //struct kinfo_proc* kprocs = getprocs(KERN_PROC_ALL, 0, &count); for (i = 0; i < count; i++) { kproc = &kprocs[i]; preExisting = false; proc = ProcessList_getProcess(this, kproc->p_pid, &preExisting, (Process_New) OpenBSDProcess_new); fp = (OpenBSDProcess*) proc; proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc))); if (!preExisting) { proc->ppid = kproc->p_ppid; proc->tpgid = kproc->p_tpgid; proc->tgid = kproc->p_pid; proc->session = kproc->p_sid; proc->tty_nr = kproc->p_tdev; proc->pgrp = kproc->p__pgid; proc->st_uid = kproc->p_uid; proc->starttime_ctime = kproc->p_ustart_sec; proc->user = UsersTable_getRef(this->usersTable, proc->st_uid); ProcessList_add((ProcessList*)this, proc); proc->comm = OpenBSDProcessList_readProcessName(opl->kd, kproc, &proc->basenameOffset); } else { if (settings->updateProcessNames) { free(proc->comm); proc->comm = OpenBSDProcessList_readProcessName(opl->kd, kproc, &proc->basenameOffset); } } proc->m_size = kproc->p_vm_dsize; proc->m_resident = kproc->p_vm_rssize; proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0; proc->percent_cpu = CLAMP(getpcpu(kproc), 0.0, this->cpuCount*100.0); //proc->nlwp = kproc->p_numthreads; //proc->time = kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 10); proc->nice = kproc->p_nice - 20; proc->time = kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 1000000); proc->time *= 100; proc->priority = kproc->p_priority - PZERO; switch (kproc->p_stat) { case SIDL: proc->state = 'I'; break; case SRUN: proc->state = 'R'; break; case SSLEEP: proc->state = 'S'; break; case SSTOP: proc->state = 'T'; break; case SZOMB: proc->state = 'Z'; break; case SDEAD: proc->state = 'D'; break; case SONPROC: proc->state = 'P'; break; default: proc->state = '?'; } if (Process_isKernelThread(proc)) { this->kernelThreads++; } this->totalTasks++; // SRUN ('R') means runnable, not running if (proc->state == 'P') { this->runningTasks++; } proc->updated = true; } } htop-2.1.0/openbsd/Platform.c0000644000175000001440000002005213152362772012772 00000000000000/* htop - openbsd/Platform.c (C) 2014 Hisham H. Muhammad (C) 2015 Michael McConville Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "Meter.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "UptimeMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "SignalsPanel.h" #include "OpenBSDProcess.h" #include "OpenBSDProcessList.h" #include #include #include #include #include #include #include #include #include #include #include #include #include /*{ #include "Action.h" #include "BatteryMeter.h" #include "SignalsPanel.h" extern ProcessFieldData Process_fields[]; }*/ #define MAXCPU 256 // XXX: probably should be a struct member static int64_t old_v[MAXCPU][5]; /* * Copyright (c) 1984, 1989, William LeFebvre, Rice University * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University * * Taken directly from OpenBSD's top(1). * * percentages(cnt, out, new, old, diffs) - calculate percentage change * between array "old" and "new", putting the percentages in "out". * "cnt" is size of each array and "diffs" is used for scratch space. * The array "old" is updated on each call. * The routine assumes modulo arithmetic. This function is especially * useful on BSD machines for calculating cpu state percentages. */ static int percentages(int cnt, int64_t *out, int64_t *new, int64_t *old, int64_t *diffs) { int64_t change, total_change, *dp, half_total; int i; /* initialization */ total_change = 0; dp = diffs; /* calculate changes for each state and the overall change */ for (i = 0; i < cnt; i++) { if ((change = *new - *old) < 0) { /* this only happens when the counter wraps */ change = INT64_MAX - *old + *new; } total_change += (*dp++ = change); *old++ = *new++; } /* avoid divide by zero potential */ if (total_change == 0) total_change = 1; /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; for (i = 0; i < cnt; i++) *out++ = ((*diffs++ * 1000 + half_total) / total_change); /* return the total in case the caller wants to use it */ return (total_change); } ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; int Platform_numberOfFields = LAST_PROCESSFIELD; /* * See /usr/include/sys/signal.h */ const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, { .name = " 2 SIGINT", .number = 2 }, { .name = " 3 SIGQUIT", .number = 3 }, { .name = " 4 SIGILL", .number = 4 }, { .name = " 5 SIGTRAP", .number = 5 }, { .name = " 6 SIGABRT", .number = 6 }, { .name = " 6 SIGIOT", .number = 6 }, { .name = " 7 SIGEMT", .number = 7 }, { .name = " 8 SIGFPE", .number = 8 }, { .name = " 9 SIGKILL", .number = 9 }, { .name = "10 SIGBUS", .number = 10 }, { .name = "11 SIGSEGV", .number = 11 }, { .name = "12 SIGSYS", .number = 12 }, { .name = "13 SIGPIPE", .number = 13 }, { .name = "14 SIGALRM", .number = 14 }, { .name = "15 SIGTERM", .number = 15 }, { .name = "16 SIGURG", .number = 16 }, { .name = "17 SIGSTOP", .number = 17 }, { .name = "18 SIGTSTP", .number = 18 }, { .name = "19 SIGCONT", .number = 19 }, { .name = "20 SIGCHLD", .number = 20 }, { .name = "21 SIGTTIN", .number = 21 }, { .name = "22 SIGTTOU", .number = 22 }, { .name = "23 SIGIO", .number = 23 }, { .name = "24 SIGXCPU", .number = 24 }, { .name = "25 SIGXFSZ", .number = 25 }, { .name = "26 SIGVTALRM", .number = 26 }, { .name = "27 SIGPROF", .number = 27 }, { .name = "28 SIGWINCH", .number = 28 }, { .name = "29 SIGINFO", .number = 29 }, { .name = "30 SIGUSR1", .number = 30 }, { .name = "31 SIGUSR2", .number = 31 }, { .name = "32 SIGTHR", .number = 32 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); void Platform_setBindings(Htop_Action* keys) { (void) keys; } MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &UptimeMeter_class, &BatteryMeter_class, &HostnameMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; // preserved from FreeBSD port int Platform_getUptime() { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); if (err) { return -1; } gettimeofday(&currTime, NULL); return (int) difftime(currTime.tv_sec, bootTime.tv_sec); } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { struct loadavg loadAverage; int mib[2] = { CTL_VM, VM_LOADAVG }; size_t size = sizeof(loadAverage); int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0); if (err) { *one = 0; *five = 0; *fifteen = 0; return; } *one = (double) loadAverage.ldavg[0] / loadAverage.fscale; *five = (double) loadAverage.ldavg[1] / loadAverage.fscale; *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } int Platform_getMaxPid() { // this is hard-coded in sys/sys/proc.h - no sysctl exists return 32766; } double Platform_setCPUValues(Meter* this, int cpu) { int i; double perc; OpenBSDProcessList* pl = (OpenBSDProcessList*) this->pl; CPUData* cpuData = &(pl->cpus[cpu]); int64_t new_v[CPUSTATES], diff_v[CPUSTATES], scratch_v[CPUSTATES]; double *v = this->values; size_t size = sizeof(double) * CPUSTATES; int mib[] = { CTL_KERN, KERN_CPTIME2, cpu-1 }; if (sysctl(mib, 3, new_v, &size, NULL, 0) == -1) { return 0.; } // XXX: why? cpuData->totalPeriod = 1; percentages(CPUSTATES, diff_v, new_v, (int64_t *)old_v[cpu-1], scratch_v); for (i = 0; i < CPUSTATES; i++) { old_v[cpu-1][i] = new_v[i]; v[i] = diff_v[i] / 10.; } Meter_setItems(this, 4); perc = v[0] + v[1] + v[2] + v[3]; if (perc <= 100. && perc >= 0.) { return perc; } else { return 0.; } } void Platform_setMemoryValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; long int usedMem = pl->usedMem; long int buffersMem = pl->buffersMem; long int cachedMem = pl->cachedMem; usedMem -= buffersMem + cachedMem; this->total = pl->totalMem; this->values[0] = usedMem; this->values[1] = buffersMem; this->values[2] = cachedMem; } /* * Copyright (c) 1994 Thorsten Lockert * All rights reserved. * * Taken almost directly from OpenBSD's top(1) */ void Platform_setSwapValues(Meter* this) { ProcessList* pl = (ProcessList*) this->pl; struct swapent *swdev; unsigned long long int total, used; int nswap, rnswap, i; nswap = swapctl(SWAP_NSWAP, 0, 0); if (nswap == 0) { return; } swdev = xCalloc(nswap, sizeof(*swdev)); rnswap = swapctl(SWAP_STATS, swdev, nswap); if (rnswap == -1) { free(swdev); return; } // if rnswap != nswap, then what? /* Total things up */ total = used = 0; for (i = 0; i < nswap; i++) { if (swdev[i].se_flags & SWF_ENABLE) { used += (swdev[i].se_inuse / (1024 / DEV_BSIZE)); total += (swdev[i].se_nblks / (1024 / DEV_BSIZE)); } } this->total = pl->totalSwap = total; this->values[0] = pl->usedSwap = used; free(swdev); } void Platform_setTasksValues(Meter* this) { // TODO } char* Platform_getProcessEnv(pid_t pid) { // TODO return NULL; } htop-2.1.0/MainPanel.h0000644000175000001440000000211413153324652011420 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_MainPanel #define HEADER_MainPanel /* htop - ColumnsPanel.h (C) 2004-2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Action.h" #include "Settings.h" typedef struct MainPanel_ { Panel super; State* state; IncSet* inc; Htop_Action *keys; pid_t pidSearch; } MainPanel; typedef bool(*MainPanel_ForeachProcessFn)(Process*, size_t); #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) void MainPanel_updateTreeFunctions(MainPanel* this, bool mode); void MainPanel_pidSearch(MainPanel* this, int ch); int MainPanel_selectedPid(MainPanel* this); const char* MainPanel_getValue(MainPanel* this, int i); bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, size_t arg, bool* wasAnyTagged); extern PanelClass MainPanel_class; MainPanel* MainPanel_new(); void MainPanel_setState(MainPanel* this, State* state); void MainPanel_delete(Object* object); #endif htop-2.1.0/CPUMeter.c0000644000175000001440000002435313152362772011210 00000000000000/* htop - CPUMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "CPUMeter.h" #include "CRT.h" #include "Settings.h" #include "Platform.h" #include #include #include #include /*{ #include "Meter.h" typedef enum { CPU_METER_NICE = 0, CPU_METER_NORMAL = 1, CPU_METER_KERNEL = 2, CPU_METER_IRQ = 3, CPU_METER_SOFTIRQ = 4, CPU_METER_STEAL = 5, CPU_METER_GUEST = 6, CPU_METER_IOWAIT = 7, CPU_METER_ITEMCOUNT = 8, // number of entries in this enum } CPUMeterValues; }*/ int CPUMeter_attributes[] = { CPU_NICE, CPU_NORMAL, CPU_KERNEL, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, CPU_IOWAIT }; #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif static void CPUMeter_init(Meter* this) { int cpu = this->param; if (this->pl->cpuCount > 1) { char caption[10]; xSnprintf(caption, sizeof(caption), "%-3d", Settings_cpuId(this->pl->settings, cpu - 1)); Meter_setCaption(this, caption); } if (this->param == 0) Meter_setCaption(this, "Avg"); } static void CPUMeter_updateValues(Meter* this, char* buffer, int size) { int cpu = this->param; if (cpu > this->pl->cpuCount) { xSnprintf(buffer, size, "absent"); return; } memset(this->values, 0, sizeof(double) * CPU_METER_ITEMCOUNT); double percent = Platform_setCPUValues(this, cpu); xSnprintf(buffer, size, "%5.1f%%", percent); } static void CPUMeter_display(Object* cast, RichString* out) { char buffer[50]; Meter* this = (Meter*)cast; RichString_prune(out); if (this->param > this->pl->cpuCount) { RichString_append(out, CRT_colors[METER_TEXT], "absent"); return; } xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NORMAL]); RichString_append(out, CRT_colors[METER_TEXT], ":"); RichString_append(out, CRT_colors[CPU_NORMAL], buffer); if (this->pl->settings->detailedCPUTime) { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); RichString_append(out, CRT_colors[METER_TEXT], "sy:"); RichString_append(out, CRT_colors[CPU_KERNEL], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); RichString_append(out, CRT_colors[METER_TEXT], "ni:"); RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]); RichString_append(out, CRT_colors[METER_TEXT], "hi:"); RichString_append(out, CRT_colors[CPU_IRQ], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_SOFTIRQ]); RichString_append(out, CRT_colors[METER_TEXT], "si:"); RichString_append(out, CRT_colors[CPU_SOFTIRQ], buffer); if (this->values[CPU_METER_STEAL]) { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_STEAL]); RichString_append(out, CRT_colors[METER_TEXT], "st:"); RichString_append(out, CRT_colors[CPU_STEAL], buffer); } if (this->values[CPU_METER_GUEST]) { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_GUEST]); RichString_append(out, CRT_colors[METER_TEXT], "gu:"); RichString_append(out, CRT_colors[CPU_GUEST], buffer); } xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IOWAIT]); RichString_append(out, CRT_colors[METER_TEXT], "wa:"); RichString_append(out, CRT_colors[CPU_IOWAIT], buffer); } else { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]); RichString_append(out, CRT_colors[METER_TEXT], "sys:"); RichString_append(out, CRT_colors[CPU_KERNEL], buffer); xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]); RichString_append(out, CRT_colors[METER_TEXT], "low:"); RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer); if (this->values[CPU_METER_IRQ]) { xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]); RichString_append(out, CRT_colors[METER_TEXT], "vir:"); RichString_append(out, CRT_colors[CPU_GUEST], buffer); } } } static void AllCPUsMeter_getRange(Meter* this, int* start, int* count) { int cpus = this->pl->cpuCount; switch(Meter_name(this)[0]) { default: case 'A': // All *start = 0; *count = cpus; break; case 'L': // First Half *start = 0; *count = (cpus+1) / 2; break; case 'R': // Second Half *start = (cpus+1) / 2; *count = cpus / 2; break; } } static void AllCPUsMeter_init(Meter* this) { int cpus = this->pl->cpuCount; if (!this->drawData) this->drawData = xCalloc(cpus, sizeof(Meter*)); Meter** meters = (Meter**) this->drawData; int start, count; AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) { if (!meters[i]) meters[i] = Meter_new(this->pl, start+i+1, (MeterClass*) Class(CPUMeter)); Meter_init(meters[i]); } if (this->mode == 0) this->mode = BAR_METERMODE; int h = Meter_modes[this->mode]->h; if (strchr(Meter_name(this), '2')) this->h = h * ((count+1) / 2); else this->h = h * count; } static void AllCPUsMeter_done(Meter* this) { Meter** meters = (Meter**) this->drawData; int start, count; AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) Meter_delete((Object*)meters[i]); } static void AllCPUsMeter_updateMode(Meter* this, int mode) { Meter** meters = (Meter**) this->drawData; this->mode = mode; int h = Meter_modes[mode]->h; int start, count; AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) { Meter_setMode(meters[i], mode); } if (strchr(Meter_name(this), '2')) this->h = h * ((count+1) / 2); else this->h = h * count; } static void DualColCPUsMeter_draw(Meter* this, int x, int y, int w) { Meter** meters = (Meter**) this->drawData; int start, count; int pad = this->pl->settings->headerMargin ? 2 : 0; AllCPUsMeter_getRange(this, &start, &count); int height = (count+1)/2; int startY = y; for (int i = 0; i < height; i++) { meters[i]->draw(meters[i], x, y, (w-pad)/2); y += meters[i]->h; } y = startY; for (int i = height; i < count; i++) { meters[i]->draw(meters[i], x+(w-1)/2+1+(pad/2), y, (w-pad)/2); y += meters[i]->h; } } static void SingleColCPUsMeter_draw(Meter* this, int x, int y, int w) { Meter** meters = (Meter**) this->drawData; int start, count; AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) { meters[i]->draw(meters[i], x, y, w); y += meters[i]->h; } } MeterClass CPUMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .updateValues = CPUMeter_updateValues, .defaultMode = BAR_METERMODE, .maxItems = CPU_METER_ITEMCOUNT, .total = 100.0, .attributes = CPUMeter_attributes, .name = "CPU", .uiName = "CPU", .caption = "CPU", .init = CPUMeter_init }; MeterClass AllCPUsMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "AllCPUs", .uiName = "CPUs (1/1)", .description = "CPUs (1/1): all CPUs", .caption = "CPU", .draw = SingleColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; MeterClass AllCPUs2Meter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "AllCPUs2", .uiName = "CPUs (1&2/2)", .description = "CPUs (1&2/2): all CPUs in 2 shorter columns", .caption = "CPU", .draw = DualColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; MeterClass LeftCPUsMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "LeftCPUs", .uiName = "CPUs (1/2)", .description = "CPUs (1/2): first half of list", .caption = "CPU", .draw = SingleColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; MeterClass RightCPUsMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "RightCPUs", .uiName = "CPUs (2/2)", .description = "CPUs (2/2): second half of list", .caption = "CPU", .draw = SingleColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; MeterClass LeftCPUs2Meter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "LeftCPUs2", .uiName = "CPUs (1&2/4)", .description = "CPUs (1&2/4): first half in 2 shorter columns", .caption = "CPU", .draw = DualColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; MeterClass RightCPUs2Meter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = CPUMeter_display }, .defaultMode = CUSTOM_METERMODE, .total = 100.0, .attributes = CPUMeter_attributes, .name = "RightCPUs2", .uiName = "CPUs (3&4/4)", .description = "CPUs (3&4/4): second half in 2 shorter columns", .caption = "CPU", .draw = DualColCPUsMeter_draw, .init = AllCPUsMeter_init, .updateMode = AllCPUsMeter_updateMode, .done = AllCPUsMeter_done }; htop-2.1.0/DisplayOptionsPanel.c0000644000175000001440000000773313235653611013525 00000000000000/* htop - DisplayOptionsPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "DisplayOptionsPanel.h" #include "CheckItem.h" #include "CRT.h" #include #include #include /*{ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct DisplayOptionsPanel_ { Panel super; Settings* settings; ScreenManager* scr; } DisplayOptionsPanel; }*/ static const char* const DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; static void DisplayOptionsPanel_delete(Object* object) { Panel* super = (Panel*) object; DisplayOptionsPanel* this = (DisplayOptionsPanel*) object; Panel_done(super); free(this); } static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { DisplayOptionsPanel* this = (DisplayOptionsPanel*) super; HandlerResult result = IGNORED; CheckItem* selected = (CheckItem*) Panel_getSelected(super); switch(ch) { case 0x0a: case 0x0d: case KEY_ENTER: case KEY_MOUSE: case KEY_RECLICK: case ' ': CheckItem_set(selected, ! (CheckItem_get(selected)) ); result = HANDLED; } if (result == HANDLED) { this->settings->changed = true; const Header* header = this->scr->header; Header_calculateHeight((Header*) header); Header_reinit((Header*) header); Header_draw(header); ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); } return result; } PanelClass DisplayOptionsPanel_class = { .super = { .extends = Class(Panel), .delete = DisplayOptionsPanel_delete }, .eventHandler = DisplayOptionsPanel_eventHandler }; DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar); this->settings = settings; this->scr = scr; Panel_setHeader(super, "Display options"); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Tree view"), &(settings->treeView))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Shadow other users' processes"), &(settings->shadowOtherUsers))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Hide kernel threads"), &(settings->hideKernelThreads))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Hide userland process threads"), &(settings->hideUserlandThreads))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Display threads in a different color"), &(settings->highlightThreads))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Show custom thread names"), &(settings->showThreadNames))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Show program path"), &(settings->showProgramPath))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Highlight program \"basename\""), &(settings->highlightBaseName))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Highlight large numbers in memory counters"), &(settings->highlightMegabytes))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Leave a margin around header"), &(settings->headerMargin))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->detailedCPUTime))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Count CPUs from 0 instead of 1"), &(settings->countCPUsFromZero))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Update process names on every refresh"), &(settings->updateProcessNames))); Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Add guest time in CPU meter percentage"), &(settings->accountGuestInCPUMeter))); return this; } htop-2.1.0/ColumnsPanel.c0000644000175000001440000001010213235653611012144 00000000000000/* htop - ColumnsPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ColumnsPanel.h" #include "Platform.h" #include "StringUtils.h" #include "ListItem.h" #include "CRT.h" #include #include #include /*{ #include "Panel.h" #include "Settings.h" typedef struct ColumnsPanel_ { Panel super; Settings* settings; bool moving; } ColumnsPanel; }*/ static const char* const ColumnsFunctions[] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL}; static void ColumnsPanel_delete(Object* object) { Panel* super = (Panel*) object; ColumnsPanel* this = (ColumnsPanel*) object; Panel_done(super); free(this); } static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) { ColumnsPanel* const this = (ColumnsPanel*) super; int selected = Panel_getSelectedIndex(super); HandlerResult result = IGNORED; int size = Panel_size(super); switch(ch) { case 0x0a: case 0x0d: case KEY_ENTER: case KEY_MOUSE: case KEY_RECLICK: { if (selected < size - 1) { this->moving = !(this->moving); Panel_setSelectionColor(super, this->moving ? CRT_colors[PANEL_SELECTION_FOLLOW] : CRT_colors[PANEL_SELECTION_FOCUS]); ((ListItem*)Panel_getSelected(super))->moving = this->moving; result = HANDLED; } break; } case KEY_UP: { if (!this->moving) { break; } } /* else fallthrough */ case KEY_F(7): case '[': case '-': { if (selected < size - 1) Panel_moveSelectedUp(super); result = HANDLED; break; } case KEY_DOWN: { if (!this->moving) { break; } } /* else fallthrough */ case KEY_F(8): case ']': case '+': { if (selected < size - 2) Panel_moveSelectedDown(super); result = HANDLED; break; } case KEY_F(9): case KEY_DC: { if (selected < size - 1) { Panel_remove(super, selected); } result = HANDLED; break; } default: { if (ch < 255 && isalpha(ch)) result = Panel_selectByTyping(super, ch); if (result == BREAK_LOOP) result = IGNORED; break; } } if (result == HANDLED) ColumnsPanel_update(super); return result; } PanelClass ColumnsPanel_class = { .super = { .extends = Class(Panel), .delete = ColumnsPanel_delete }, .eventHandler = ColumnsPanel_eventHandler }; ColumnsPanel* ColumnsPanel_new(Settings* settings) { ColumnsPanel* this = AllocThis(ColumnsPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(ColumnsFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); this->settings = settings; this->moving = false; Panel_setHeader(super, "Active Columns"); ProcessField* fields = this->settings->fields; for (; *fields; fields++) { if (Process_fields[*fields].name) { Panel_add(super, (Object*) ListItem_new(Process_fields[*fields].name, *fields)); } } return this; } int ColumnsPanel_fieldNameToIndex(const char* name) { for (int j = 1; j <= Platform_numberOfFields; j++) { if (String_eq(name, Process_fields[j].name)) { return j; } } return -1; } void ColumnsPanel_update(Panel* super) { ColumnsPanel* this = (ColumnsPanel*) super; int size = Panel_size(super); this->settings->changed = true; this->settings->fields = xRealloc(this->settings->fields, sizeof(ProcessField) * (size+1)); this->settings->flags = 0; for (int i = 0; i < size; i++) { int key = ((ListItem*) Panel_get(super, i))->key; this->settings->fields[i] = key; this->settings->flags |= Process_fields[key].flags; } this->settings->fields[size] = 0; } htop-2.1.0/Makefile.am0000644000175000001440000001070313235653611011443 00000000000000 ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = htop dist_man_MANS = htop.1 EXTRA_DIST = $(dist_man_MANS) htop.desktop htop.png scripts/MakeHeader.py \ install-sh autogen.sh missing applicationsdir = $(datadir)/applications applications_DATA = htop.desktop pixmapdir = $(datadir)/pixmaps pixmap_DATA = htop.png htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)" htop_LDFLAGS = AM_CPPFLAGS = -DNDEBUG myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \ ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \ DisplayOptionsPanel.c FunctionBar.c Hashtable.c Header.c htop.c ListItem.c \ LoadAverageMeter.c MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \ BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \ SignalsPanel.c StringUtils.c SwapMeter.c TasksMeter.c UptimeMeter.c \ TraceScreen.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \ HostnameMeter.c OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \ InfoScreen.c XAlloc.c myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \ CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \ CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \ Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \ BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \ ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \ TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \ EnvScreen.h InfoScreen.h XAlloc.h if HTOP_LINUX htop_CFLAGS += -rdynamic myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \ linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \ linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h endif if HTOP_FREEBSD myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \ freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h endif if HTOP_DRAGONFLYBSD htop_LDFLAGS += -lkvm -lkinfo -lexecinfo myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c myhtopplatheaders = dragonflybsd/Platform.h dragonflybsd/DragonFlyBSDProcessList.h \ dragonflybsd/DragonFlyBSDProcess.h dragonflybsd/DragonFlyBSDCRT.h dragonflybsd/Battery.h endif if HTOP_OPENBSD myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \ openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c myhtopplatheaders = openbsd/Platform.h openbsd/OpenBSDProcessList.h \ openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h openbsd/Battery.h endif if HTOP_DARWIN htop_LDFLAGS += -framework IOKit -framework CoreFoundation myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \ darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c myhtopplatheaders = darwin/Platform.h darwin/DarwinProcess.h \ darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h endif if HTOP_UNSUPPORTED myhtopplatsources = unsupported/Platform.c \ unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \ unsupported/UnsupportedCRT.c unsupported/Battery.c myhtopplatheaders = unsupported/Platform.h \ unsupported/UnsupportedProcess.h unsupported/UnsupportedProcessList.h \ unsupported/UnsupportedCRT.h unsupported/Battery.h endif SUFFIXES = .h BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders) htop_SOURCES = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h target: echo $(htop_SOURCES) profile: $(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG" debug: $(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG" coverage: $(MAKE) all CFLAGS="" AM_CPPFLAGS="-fprofile-arcs -ftest-coverage -DDEBUG" LDFLAGS="-lgcov" .c.h: @srcdir@/scripts/MakeHeader.py $< cppcheck: cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS .PHONY: lcov lcov: mkdir -p lcov lcov --capture --directory . --output-file coverage.info genhtml coverage.info --output-directory lcov htop-2.1.0/autogen.sh0000755000175000001440000000006313235624301011400 00000000000000#!/bin/sh mkdir -p m4 autoreconf --install --force htop-2.1.0/Panel.c0000644000175000001440000003067713235653611010626 00000000000000/* htop - Panel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "CRT.h" #include "RichString.h" #include "ListItem.h" #include "StringUtils.h" #include #include #include #include #include #include //#link curses /*{ #include "Object.h" #include "Vector.h" #include "FunctionBar.h" typedef struct Panel_ Panel; typedef enum HandlerResult_ { HANDLED = 0x01, IGNORED = 0x02, BREAK_LOOP = 0x04, REDRAW = 0x08, RESCAN = 0x10, SYNTH_KEY = 0x20, } HandlerResult; #define EVENT_SET_SELECTED -1 #define EVENT_HEADER_CLICK(x_) (-10000 + x_) #define EVENT_IS_HEADER_CLICK(ev_) (ev_ >= -10000 && ev_ <= -9000) #define EVENT_HEADER_CLICK_GET_X(ev_) (ev_ + 10000) typedef HandlerResult(*Panel_EventHandler)(Panel*, int); typedef struct PanelClass_ { const ObjectClass super; const Panel_EventHandler eventHandler; } PanelClass; #define As_Panel(this_) ((PanelClass*)((this_)->super.klass)) #define Panel_eventHandlerFn(this_) As_Panel(this_)->eventHandler #define Panel_eventHandler(this_, ev_) As_Panel(this_)->eventHandler((Panel*)(this_), ev_) struct Panel_ { Object super; int x, y, w, h; WINDOW* window; Vector* items; int selected; int oldSelected; int selectedLen; void* eventHandlerState; int scrollV; short scrollH; bool needsRedraw; FunctionBar* currentBar; FunctionBar* defaultBar; RichString header; int selectionColor; }; #define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0) }*/ #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #define KEY_CTRL(l) ((l)-'A'+1) PanelClass Panel_class = { .super = { .extends = Class(Object), .delete = Panel_delete }, .eventHandler = Panel_selectByTyping, }; Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar) { Panel* this; this = xMalloc(sizeof(Panel)); Object_setClass(this, Class(Panel)); Panel_init(this, x, y, w, h, type, owner, fuBar); return this; } void Panel_delete(Object* cast) { Panel* this = (Panel*)cast; Panel_done(this); free(this); } void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar) { this->x = x; this->y = y; this->w = w; this->h = h; this->eventHandlerState = NULL; this->items = Vector_new(type, owner, DEFAULT_SIZE); this->scrollV = 0; this->scrollH = 0; this->selected = 0; this->oldSelected = 0; this->needsRedraw = true; RichString_beginAllocated(this->header); this->defaultBar = fuBar; this->currentBar = fuBar; this->selectionColor = CRT_colors[PANEL_SELECTION_FOCUS]; } void Panel_done(Panel* this) { assert (this != NULL); free(this->eventHandlerState); Vector_delete(this->items); FunctionBar_delete(this->defaultBar); RichString_end(this->header); } void Panel_setSelectionColor(Panel* this, int color) { this->selectionColor = color; } RichString* Panel_getHeader(Panel* this) { assert (this != NULL); this->needsRedraw = true; return &(this->header); } inline void Panel_setHeader(Panel* this, const char* header) { RichString_write(&(this->header), CRT_colors[PANEL_HEADER_FOCUS], header); this->needsRedraw = true; } void Panel_move(Panel* this, int x, int y) { assert (this != NULL); this->x = x; this->y = y; this->needsRedraw = true; } void Panel_resize(Panel* this, int w, int h) { assert (this != NULL); if (RichString_sizeVal(this->header) > 0) h--; this->w = w; this->h = h; this->needsRedraw = true; } void Panel_prune(Panel* this) { assert (this != NULL); Vector_prune(this->items); this->scrollV = 0; this->selected = 0; this->oldSelected = 0; this->needsRedraw = true; } void Panel_add(Panel* this, Object* o) { assert (this != NULL); Vector_add(this->items, o); this->needsRedraw = true; } void Panel_insert(Panel* this, int i, Object* o) { assert (this != NULL); Vector_insert(this->items, i, o); this->needsRedraw = true; } void Panel_set(Panel* this, int i, Object* o) { assert (this != NULL); Vector_set(this->items, i, o); } Object* Panel_get(Panel* this, int i) { assert (this != NULL); return Vector_get(this->items, i); } Object* Panel_remove(Panel* this, int i) { assert (this != NULL); this->needsRedraw = true; Object* removed = Vector_remove(this->items, i); if (this->selected > 0 && this->selected >= Vector_size(this->items)) this->selected--; return removed; } Object* Panel_getSelected(Panel* this) { assert (this != NULL); if (Vector_size(this->items) > 0) return Vector_get(this->items, this->selected); else return NULL; } void Panel_moveSelectedUp(Panel* this) { assert (this != NULL); Vector_moveUp(this->items, this->selected); if (this->selected > 0) this->selected--; } void Panel_moveSelectedDown(Panel* this) { assert (this != NULL); Vector_moveDown(this->items, this->selected); if (this->selected + 1 < Vector_size(this->items)) this->selected++; } int Panel_getSelectedIndex(Panel* this) { assert (this != NULL); return this->selected; } int Panel_size(Panel* this) { assert (this != NULL); return Vector_size(this->items); } void Panel_setSelected(Panel* this, int selected) { assert (this != NULL); int size = Vector_size(this->items); if (selected >= size) { selected = size - 1; } if (selected < 0) selected = 0; this->selected = selected; if (Panel_eventHandlerFn(this)) { Panel_eventHandler(this, EVENT_SET_SELECTED); } } void Panel_draw(Panel* this, bool focus) { assert (this != NULL); int size = Vector_size(this->items); int scrollH = this->scrollH; int y = this->y; int x = this->x; int h = this->h; int headerLen = RichString_sizeVal(this->header); if (headerLen > 0) { int attr = focus ? CRT_colors[PANEL_HEADER_FOCUS] : CRT_colors[PANEL_HEADER_UNFOCUS]; attrset(attr); mvhline(y, x, ' ', this->w); if (scrollH < headerLen) { RichString_printoffnVal(this->header, y, x, scrollH, MIN(headerLen - scrollH, this->w)); } attrset(CRT_colors[RESET_COLOR]); y++; } // ensure scroll area is on screen if (this->scrollV < 0) { this->scrollV = 0; this->needsRedraw = true; } else if (this->scrollV >= size) { this->scrollV = MAX(size - 1, 0); this->needsRedraw = true; } // ensure selection is on screen if (this->selected < this->scrollV) { this->scrollV = this->selected; this->needsRedraw = true; } else if (this->selected >= this->scrollV + h) { this->scrollV = this->selected - h + 1; this->needsRedraw = true; } int first = this->scrollV; int upTo = MIN(first + h, size); int selectionColor = focus ? this->selectionColor : CRT_colors[PANEL_SELECTION_UNFOCUS]; if (this->needsRedraw) { int line = 0; for(int i = first; line < h && i < upTo; i++) { Object* itemObj = Vector_get(this->items, i); assert(itemObj); if(!itemObj) continue; RichString_begin(item); Object_display(itemObj, &item); int itemLen = RichString_sizeVal(item); int amt = MIN(itemLen - scrollH, this->w); bool selected = (i == this->selected); if (selected) { attrset(selectionColor); RichString_setAttr(&item, selectionColor); this->selectedLen = itemLen; } mvhline(y + line, x, ' ', this->w); if (amt > 0) RichString_printoffnVal(item, y + line, x, scrollH, amt); if (selected) attrset(CRT_colors[RESET_COLOR]); RichString_end(item); line++; } while (line < h) { mvhline(y + line, x, ' ', this->w); line++; } this->needsRedraw = false; } else { Object* oldObj = Vector_get(this->items, this->oldSelected); assert(oldObj); RichString_begin(old); Object_display(oldObj, &old); int oldLen = RichString_sizeVal(old); Object* newObj = Vector_get(this->items, this->selected); RichString_begin(new); Object_display(newObj, &new); int newLen = RichString_sizeVal(new); this->selectedLen = newLen; mvhline(y+ this->oldSelected - first, x+0, ' ', this->w); if (scrollH < oldLen) RichString_printoffnVal(old, y+this->oldSelected - first, x, scrollH, MIN(oldLen - scrollH, this->w)); attrset(selectionColor); mvhline(y+this->selected - first, x+0, ' ', this->w); RichString_setAttr(&new, selectionColor); if (scrollH < newLen) RichString_printoffnVal(new, y+this->selected - first, x, scrollH, MIN(newLen - scrollH, this->w)); attrset(CRT_colors[RESET_COLOR]); RichString_end(new); RichString_end(old); } this->oldSelected = this->selected; move(0, 0); } bool Panel_onKey(Panel* this, int key) { assert (this != NULL); int size = Vector_size(this->items); switch (key) { case KEY_DOWN: case KEY_CTRL('N'): this->selected++; break; case KEY_UP: case KEY_CTRL('P'): this->selected--; break; #ifdef KEY_C_DOWN case KEY_C_DOWN: this->selected++; break; #endif #ifdef KEY_C_UP case KEY_C_UP: this->selected--; break; #endif case KEY_LEFT: case KEY_CTRL('B'): if (this->scrollH > 0) { this->scrollH -= MAX(CRT_scrollHAmount, 0); this->needsRedraw = true; } break; case KEY_RIGHT: case KEY_CTRL('F'): this->scrollH += CRT_scrollHAmount; this->needsRedraw = true; break; case KEY_PPAGE: this->selected -= (this->h - 1); this->scrollV = MAX(0, this->scrollV - this->h + 1); this->needsRedraw = true; break; case KEY_NPAGE: this->selected += (this->h - 1); this->scrollV = MAX(0, MIN(Vector_size(this->items) - this->h, this->scrollV + this->h - 1)); this->needsRedraw = true; break; case KEY_WHEELUP: this->selected -= CRT_scrollWheelVAmount; this->scrollV -= CRT_scrollWheelVAmount; this->needsRedraw = true; break; case KEY_WHEELDOWN: { this->selected += CRT_scrollWheelVAmount; this->scrollV += CRT_scrollWheelVAmount; if (this->scrollV > Vector_size(this->items) - this->h) { this->scrollV = Vector_size(this->items) - this->h; } this->needsRedraw = true; break; } case KEY_HOME: this->selected = 0; break; case KEY_END: this->selected = size - 1; break; case KEY_CTRL('A'): case '^': this->scrollH = 0; this->needsRedraw = true; break; case KEY_CTRL('E'): case '$': this->scrollH = MAX(this->selectedLen - this->w, 0); this->needsRedraw = true; break; default: return false; } // ensure selection within bounds if (this->selected < 0 || size == 0) { this->selected = 0; this->needsRedraw = true; } else if (this->selected >= size) { this->selected = size - 1; this->needsRedraw = true; } return true; } HandlerResult Panel_selectByTyping(Panel* this, int ch) { int size = Panel_size(this); if (!this->eventHandlerState) this->eventHandlerState = xCalloc(100, sizeof(char)); char* buffer = this->eventHandlerState; if (ch < 255 && isalnum(ch)) { int len = strlen(buffer); if (len < 99) { buffer[len] = ch; buffer[len+1] = '\0'; } for (int try = 0; try < 2; try++) { len = strlen(buffer); for (int i = 0; i < size; i++) { char* cur = ((ListItem*) Panel_get(this, i))->value; while (*cur == ' ') cur++; if (strncasecmp(cur, buffer, len) == 0) { Panel_setSelected(this, i); return HANDLED; } } // if current word did not match, // retry considering the character the start of a new word. buffer[0] = ch; buffer[1] = '\0'; } return HANDLED; } else if (ch != ERR) { buffer[0] = '\0'; } if (ch == 13) { return BREAK_LOOP; } return IGNORED; } htop-2.1.0/CategoriesPanel.c0000644000175000001440000001127613235653611012626 00000000000000/* htop - CategoriesPanel.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "CategoriesPanel.h" #include "AvailableMetersPanel.h" #include "MetersPanel.h" #include "DisplayOptionsPanel.h" #include "ColumnsPanel.h" #include "ColorsPanel.h" #include "AvailableColumnsPanel.h" #include #include /*{ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" #include "ProcessList.h" typedef struct CategoriesPanel_ { Panel super; ScreenManager* scr; Settings* settings; Header* header; ProcessList* pl; } CategoriesPanel; }*/ static const char* const CategoriesFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; static void CategoriesPanel_delete(Object* object) { Panel* super = (Panel*) object; CategoriesPanel* this = (CategoriesPanel*) object; Panel_done(super); free(this); } void CategoriesPanel_makeMetersPage(CategoriesPanel* this) { MetersPanel* leftMeters = MetersPanel_new(this->settings, "Left column", this->header->columns[0], this->scr); MetersPanel* rightMeters = MetersPanel_new(this->settings, "Right column", this->header->columns[1], this->scr); leftMeters->rightNeighbor = rightMeters; rightMeters->leftNeighbor = leftMeters; Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, this->header, (Panel*) leftMeters, (Panel*) rightMeters, this->scr, this->pl); ScreenManager_add(this->scr, (Panel*) leftMeters, 20); ScreenManager_add(this->scr, (Panel*) rightMeters, 20); ScreenManager_add(this->scr, availableMeters, -1); } static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) { Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr); ScreenManager_add(this->scr, displayOptions, -1); } static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) { Panel* colors = (Panel*) ColorsPanel_new(this->settings, this->scr); ScreenManager_add(this->scr, colors, -1); } static void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) { Panel* columns = (Panel*) ColumnsPanel_new(this->settings); Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(columns); ScreenManager_add(this->scr, columns, 20); ScreenManager_add(this->scr, availableColumns, -1); } static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) { CategoriesPanel* this = (CategoriesPanel*) super; HandlerResult result = IGNORED; int selected = Panel_getSelectedIndex(super); switch (ch) { case EVENT_SET_SELECTED: result = HANDLED; break; case KEY_UP: case KEY_CTRL('P'): case KEY_DOWN: case KEY_CTRL('N'): case KEY_NPAGE: case KEY_PPAGE: case KEY_HOME: case KEY_END: { int previous = selected; Panel_onKey(super, ch); selected = Panel_getSelectedIndex(super); if (previous != selected) result = HANDLED; break; } default: if (ch < 255 && isalpha(ch)) result = Panel_selectByTyping(super, ch); if (result == BREAK_LOOP) result = IGNORED; break; } if (result == HANDLED) { int size = ScreenManager_size(this->scr); for (int i = 1; i < size; i++) ScreenManager_remove(this->scr, 1); switch (selected) { case 0: CategoriesPanel_makeMetersPage(this); break; case 1: CategoriesPanel_makeDisplayOptionsPage(this); break; case 2: CategoriesPanel_makeColorsPage(this); break; case 3: CategoriesPanel_makeColumnsPage(this); break; } } return result; } PanelClass CategoriesPanel_class = { .super = { .extends = Class(Panel), .delete = CategoriesPanel_delete }, .eventHandler = CategoriesPanel_eventHandler }; CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl) { CategoriesPanel* this = AllocThis(CategoriesPanel); Panel* super = (Panel*) this; FunctionBar* fuBar = FunctionBar_new(CategoriesFunctions, NULL, NULL); Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar); this->scr = scr; this->settings = settings; this->header = header; this->pl = pl; Panel_setHeader(super, "Setup"); Panel_add(super, (Object*) ListItem_new("Meters", 0)); Panel_add(super, (Object*) ListItem_new("Display options", 0)); Panel_add(super, (Object*) ListItem_new("Colors", 0)); Panel_add(super, (Object*) ListItem_new("Columns", 0)); return this; } htop-2.1.0/Affinity.h0000644000175000001440000000175513153324652011337 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Affinity #define HEADER_Affinity /* htop - Affinity.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #ifdef HAVE_LIBHWLOC #if __linux__ #define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_THREAD #else #define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS #endif #elif HAVE_LINUX_AFFINITY #endif #include "Process.h" #include "ProcessList.h" typedef struct Affinity_ { ProcessList* pl; int size; int used; int* cpus; } Affinity; Affinity* Affinity_new(ProcessList* pl); void Affinity_delete(Affinity* this); void Affinity_add(Affinity* this, int id); #ifdef HAVE_LIBHWLOC Affinity* Affinity_get(Process* proc, ProcessList* pl); bool Affinity_set(Process* proc, Affinity* this); #elif HAVE_LINUX_AFFINITY Affinity* Affinity_get(Process* proc, ProcessList* pl); bool Affinity_set(Process* proc, Affinity* this); #endif #endif htop-2.1.0/RichString.h0000644000175000001440000000541213153324652011634 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_RichString #define HEADER_RichString /* htop - RichString.h (C) 2004,2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #define RICHSTRING_MAXLEN 350 #include "config.h" #include #include #ifdef HAVE_NCURSESW_CURSES_H #include #elif HAVE_NCURSES_NCURSES_H #include #elif HAVE_NCURSES_CURSES_H #include #elif HAVE_NCURSES_H #include #elif HAVE_CURSES_H #include #endif #ifdef HAVE_LIBNCURSESW #include #endif #define RichString_size(this) ((this)->chlen) #define RichString_sizeVal(this) ((this).chlen) #define RichString_begin(this) RichString (this); memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr; #define RichString_beginAllocated(this) memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr; #define RichString_end(this) RichString_prune(&(this)); #ifdef HAVE_LIBNCURSESW #define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + off, n) #define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255) #define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while(0) #define CharType cchar_t #else #define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + off, n) #define RichString_getCharVal(this, i) ((this).chptr[i]) #define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = ch; } while(0) #define CharType chtype #endif typedef struct RichString_ { int chlen; CharType* chptr; CharType chstr[RICHSTRING_MAXLEN+1]; } RichString; #define charBytes(n) (sizeof(CharType) * (n)) #define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0) #ifdef HAVE_LIBNCURSESW extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish); int RichString_findChar(RichString* this, char c, int start); #else void RichString_setAttrn(RichString* this, int attrs, int start, int finish); int RichString_findChar(RichString* this, char c, int start); #endif void RichString_prune(RichString* this); void RichString_setAttr(RichString* this, int attrs); void RichString_append(RichString* this, int attrs, const char* data); void RichString_appendn(RichString* this, int attrs, const char* data, int len); void RichString_write(RichString* this, int attrs, const char* data); #endif htop-2.1.0/SignalsPanel.h0000644000175000001440000000061013153324652012133 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_SignalsPanel #define HEADER_SignalsPanel /* htop - SignalsPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ typedef struct SignalItem_ { const char* name; int number; } SignalItem; Panel* SignalsPanel_new(); #endif htop-2.1.0/TraceScreen.c0000644000175000001440000001162313235653611011753 00000000000000/* htop - TraceScreen.c (C) 2005-2006 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "TraceScreen.h" #include "CRT.h" #include "InfoScreen.h" #include "ProcessList.h" #include "ListItem.h" #include "IncSet.h" #include "StringUtils.h" #include "FunctionBar.h" #include #include #include #include #include #include #include #include #include #include #include /*{ #include "InfoScreen.h" typedef struct TraceScreen_ { InfoScreen super; bool tracing; int fdpair[2]; int child; FILE* strace; int fd_strace; bool contLine; bool follow; } TraceScreen; }*/ static const char* const TraceScreenFunctions[] = {"Search ", "Filter ", "AutoScroll ", "Stop Tracing ", "Done ", NULL}; static const char* const TraceScreenKeys[] = {"F3", "F4", "F8", "F9", "Esc"}; static int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27}; InfoScreenClass TraceScreen_class = { .super = { .extends = Class(Object), .delete = TraceScreen_delete }, .draw = TraceScreen_draw, .onErr = TraceScreen_updateTrace, .onKey = TraceScreen_onKey, }; TraceScreen* TraceScreen_new(Process* process) { TraceScreen* this = xMalloc(sizeof(TraceScreen)); Object_setClass(this, Class(TraceScreen)); this->tracing = true; this->contLine = false; this->follow = false; FunctionBar* fuBar = FunctionBar_new(TraceScreenFunctions, TraceScreenKeys, TraceScreenEvents); CRT_disableDelay(); return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES-2, ""); } void TraceScreen_delete(Object* cast) { TraceScreen* this = (TraceScreen*) cast; if (this->child > 0) { kill(this->child, SIGTERM); waitpid(this->child, NULL, 0); fclose(this->strace); } CRT_enableDelay(); free(InfoScreen_done((InfoScreen*)cast)); } void TraceScreen_draw(InfoScreen* this) { attrset(CRT_colors[PANEL_HEADER_FOCUS]); mvhline(0, 0, ' ', COLS); mvprintw(0, 0, "Trace of process %d - %s", this->process->pid, this->process->comm); attrset(CRT_colors[DEFAULT_COLOR]); IncSet_drawBar(this->inc); } bool TraceScreen_forkTracer(TraceScreen* this) { char buffer[1001]; int error = pipe(this->fdpair); if (error == -1) return false; this->child = fork(); if (this->child == -1) return false; if (this->child == 0) { CRT_dropPrivileges(); dup2(this->fdpair[1], STDERR_FILENO); int ok = fcntl(this->fdpair[1], F_SETFL, O_NONBLOCK); if (ok != -1) { xSnprintf(buffer, sizeof(buffer), "%d", this->super.process->pid); execlp("strace", "strace", "-p", buffer, NULL); } const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; ssize_t written = write(this->fdpair[1], message, strlen(message)); (void) written; exit(1); } fcntl(this->fdpair[0], F_SETFL, O_NONBLOCK); this->strace = fdopen(this->fdpair[0], "r"); this->fd_strace = fileno(this->strace); return true; } void TraceScreen_updateTrace(InfoScreen* super) { TraceScreen* this = (TraceScreen*) super; char buffer[1001]; fd_set fds; FD_ZERO(&fds); // FD_SET(STDIN_FILENO, &fds); FD_SET(this->fd_strace, &fds); struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 500; int ready = select(this->fd_strace+1, &fds, NULL, NULL, &tv); int nread = 0; if (ready > 0 && FD_ISSET(this->fd_strace, &fds)) nread = fread(buffer, 1, 1000, this->strace); if (nread && this->tracing) { char* line = buffer; buffer[nread] = '\0'; for (int i = 0; i < nread; i++) { if (buffer[i] == '\n') { buffer[i] = '\0'; if (this->contLine) { InfoScreen_appendLine(&this->super, line); this->contLine = false; } else { InfoScreen_addLine(&this->super, line); } line = buffer+i+1; } } if (line < buffer+nread) { InfoScreen_addLine(&this->super, line); buffer[nread] = '\0'; this->contLine = true; } if (this->follow) Panel_setSelected(this->super.display, Panel_size(this->super.display)-1); } } bool TraceScreen_onKey(InfoScreen* super, int ch) { TraceScreen* this = (TraceScreen*) super; switch(ch) { case 'f': case KEY_F(8): this->follow = !(this->follow); if (this->follow) Panel_setSelected(super->display, Panel_size(super->display)-1); return true; case 't': case KEY_F(9): this->tracing = !this->tracing; FunctionBar_setLabel(super->display->defaultBar, KEY_F(9), this->tracing?"Stop Tracing ":"Resume Tracing "); InfoScreen_draw(this); return true; } this->follow = false; return false; } htop-2.1.0/htop.c0000644000175000001440000001561713235653611010536 00000000000000/* htop - htop.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "FunctionBar.h" #include "Hashtable.h" #include "ColumnsPanel.h" #include "CRT.h" #include "MainPanel.h" #include "ProcessList.h" #include "ScreenManager.h" #include "Settings.h" #include "UsersTable.h" #include "Platform.h" #include #include #include #include #include #include #include //#link m static void printVersionFlag() { fputs("htop " VERSION " - " COPYRIGHT "\n" "Released under the GNU GPL.\n\n", stdout); exit(0); } static void printHelpFlag() { fputs("htop " VERSION " - " COPYRIGHT "\n" "Released under the GNU GPL.\n\n" "-C --no-color Use a monochrome color scheme\n" "-d --delay=DELAY Set the delay between updates, in tenths of seconds\n" "-h --help Print this help screen\n" "-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)\n" "-u --user=USERNAME Show only processes of a given user\n" "-p --pid=PID,[,PID,PID...] Show only the given PIDs\n" "-v --version Print version info\n" "\n" "Long options may be passed with a single dash.\n\n" "Press F1 inside htop for online help.\n" "See 'man htop' for more information.\n", stdout); exit(0); } // ---------------------------------------- typedef struct CommandLineSettings_ { Hashtable* pidWhiteList; uid_t userId; int sortKey; int delay; bool useColors; } CommandLineSettings; static CommandLineSettings parseArguments(int argc, char** argv) { CommandLineSettings flags = { .pidWhiteList = NULL, .userId = -1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2)) .sortKey = 0, .delay = -1, .useColors = true, }; static struct option long_opts[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"delay", required_argument, 0, 'd'}, {"sort-key", required_argument, 0, 's'}, {"user", required_argument, 0, 'u'}, {"no-color", no_argument, 0, 'C'}, {"no-colour",no_argument, 0, 'C'}, {"pid", required_argument, 0, 'p'}, {"io", no_argument, 0, 'i'}, {0,0,0,0} }; int opt, opti=0; /* Parse arguments */ while ((opt = getopt_long(argc, argv, "hvCs:d:u:p:i", long_opts, &opti))) { if (opt == EOF) break; switch (opt) { case 'h': printHelpFlag(); break; case 'v': printVersionFlag(); break; case 's': if (strcmp(optarg, "help") == 0) { for (int j = 1; j < Platform_numberOfFields; j++) { const char* name = Process_fields[j].name; if (name) printf ("%s\n", name); } exit(0); } flags.sortKey = ColumnsPanel_fieldNameToIndex(optarg); if (flags.sortKey == -1) { fprintf(stderr, "Error: invalid column \"%s\".\n", optarg); } break; case 'd': if (sscanf(optarg, "%16d", &(flags.delay)) == 1) { if (flags.delay < 1) flags.delay = 1; if (flags.delay > 100) flags.delay = 100; } else { fprintf(stderr, "Error: invalid delay value \"%s\".\n", optarg); } break; case 'u': if (!Action_setUserOnly(optarg, &(flags.userId))) { fprintf(stderr, "Error: invalid user \"%s\".\n", optarg); } break; case 'C': flags.useColors = false; break; case 'p': { char* argCopy = xStrdup(optarg); char* saveptr; char* pid = strtok_r(argCopy, ",", &saveptr); if(!flags.pidWhiteList) { flags.pidWhiteList = Hashtable_new(8, false); } while(pid) { unsigned int num_pid = atoi(pid); Hashtable_put(flags.pidWhiteList, num_pid, (void *) 1); pid = strtok_r(NULL, ",", &saveptr); } free(argCopy); break; } default: exit(1); } } return flags; } static void millisleep(unsigned long millisec) { struct timespec req = { .tv_sec = 0, .tv_nsec = millisec * 1000000L }; while(nanosleep(&req,&req)==-1) { continue; } } int main(int argc, char** argv) { char *lc_ctype = getenv("LC_CTYPE"); if(lc_ctype != NULL) setlocale(LC_CTYPE, lc_ctype); else if ((lc_ctype = getenv("LC_ALL"))) setlocale(LC_CTYPE, lc_ctype); else setlocale(LC_CTYPE, ""); CommandLineSettings flags = parseArguments(argc, argv); // may exit() #ifdef HAVE_PROC if (access(PROCDIR, R_OK) != 0) { fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR); exit(1); } #endif Process_setupColumnWidths(); UsersTable* ut = UsersTable_new(); ProcessList* pl = ProcessList_new(ut, flags.pidWhiteList, flags.userId); Settings* settings = Settings_new(pl->cpuCount); pl->settings = settings; Header* header = Header_new(pl, settings, 2); Header_populateFromSettings(header); if (flags.delay != -1) settings->delay = flags.delay; if (!flags.useColors) settings->colorScheme = COLORSCHEME_MONOCHROME; CRT_init(settings->delay, settings->colorScheme); MainPanel* panel = MainPanel_new(); ProcessList_setPanel(pl, (Panel*) panel); MainPanel_updateTreeFunctions(panel, settings->treeView); if (flags.sortKey > 0) { settings->sortKey = flags.sortKey; settings->treeView = false; settings->direction = 1; } ProcessList_printHeader(pl, Panel_getHeader((Panel*)panel)); State state = { .settings = settings, .ut = ut, .pl = pl, .panel = (Panel*) panel, .header = header, }; MainPanel_setState(panel, &state); ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, true); ScreenManager_add(scr, (Panel*) panel, -1); ProcessList_scan(pl); millisleep(75); ProcessList_scan(pl); ScreenManager_run(scr, NULL, NULL); attron(CRT_colors[RESET_COLOR]); mvhline(LINES-1, 0, ' ', COLS); attroff(CRT_colors[RESET_COLOR]); refresh(); CRT_done(); if (settings->changed) Settings_write(settings); Header_delete(header); ProcessList_delete(pl); ScreenManager_delete(scr); UsersTable_delete(ut); Settings_delete(settings); if(flags.pidWhiteList) { Hashtable_delete(flags.pidWhiteList); } return 0; } htop-2.1.0/ProcessList.h0000644000175000001440000000453513235624301012032 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ProcessList #define HEADER_ProcessList /* htop - ProcessList.h (C) 2004,2005 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Vector.h" #include "Hashtable.h" #include "UsersTable.h" #include "Panel.h" #include "Process.h" #include "Settings.h" #ifdef HAVE_LIBHWLOC #include #endif #ifndef MAX_NAME #define MAX_NAME 128 #endif #ifndef MAX_READ #define MAX_READ 2048 #endif typedef struct ProcessList_ { Settings* settings; Vector* processes; Vector* processes2; Hashtable* processTable; UsersTable* usersTable; Panel* panel; int following; uid_t userId; const char* incFilter; Hashtable* pidWhiteList; #ifdef HAVE_LIBHWLOC hwloc_topology_t topology; bool topologyOk; #endif int totalTasks; int runningTasks; int userlandThreads; int kernelThreads; unsigned long long int totalMem; unsigned long long int usedMem; unsigned long long int freeMem; unsigned long long int sharedMem; unsigned long long int buffersMem; unsigned long long int cachedMem; unsigned long long int totalSwap; unsigned long long int usedSwap; unsigned long long int freeSwap; int cpuCount; } ProcessList; ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* pl); void ProcessList_goThroughEntries(ProcessList* pl); ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_done(ProcessList* this); void ProcessList_setPanel(ProcessList* this, Panel* panel); void ProcessList_printHeader(ProcessList* this, RichString* header); void ProcessList_add(ProcessList* this, Process* p); void ProcessList_remove(ProcessList* this, Process* p); Process* ProcessList_get(ProcessList* this, int idx); int ProcessList_size(ProcessList* this); void ProcessList_sort(ProcessList* this); ProcessField ProcessList_keyAt(ProcessList* this, int at); void ProcessList_expandTree(ProcessList* this); void ProcessList_rebuildPanel(ProcessList* this); Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); void ProcessList_scan(ProcessList* this); #endif htop-2.1.0/ColorsPanel.h0000644000175000001440000000145613153324652012005 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_ColorsPanel #define HEADER_ColorsPanel /* htop - ColorsPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ // TO ADD A NEW SCHEME: // * Increment the size of bool check in ColorsPanel.h // * Add the entry in the ColorSchemeNames array below in the file // * Add a define in CRT.h that matches the order of the array // * Add the colors in CRT_setColors #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" typedef struct ColorsPanel_ { Panel super; Settings* settings; ScreenManager* scr; } ColorsPanel; extern PanelClass ColorsPanel_class; ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr); #endif htop-2.1.0/RichString.c0000644000175000001440000001210713152362772011632 00000000000000/* htop - RichString.c (C) 2004,2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "RichString.h" #include "XAlloc.h" #include #include #define RICHSTRING_MAXLEN 350 /*{ #include "config.h" #include #include #ifdef HAVE_NCURSESW_CURSES_H #include #elif HAVE_NCURSES_NCURSES_H #include #elif HAVE_NCURSES_CURSES_H #include #elif HAVE_NCURSES_H #include #elif HAVE_CURSES_H #include #endif #ifdef HAVE_LIBNCURSESW #include #endif #define RichString_size(this) ((this)->chlen) #define RichString_sizeVal(this) ((this).chlen) #define RichString_begin(this) RichString (this); memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr; #define RichString_beginAllocated(this) memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr; #define RichString_end(this) RichString_prune(&(this)); #ifdef HAVE_LIBNCURSESW #define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + off, n) #define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255) #define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while(0) #define CharType cchar_t #else #define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr) #define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + off, n) #define RichString_getCharVal(this, i) ((this).chptr[i]) #define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = ch; } while(0) #define CharType chtype #endif typedef struct RichString_ { int chlen; CharType* chptr; CharType chstr[RICHSTRING_MAXLEN+1]; } RichString; }*/ #define charBytes(n) (sizeof(CharType) * (n)) static void RichString_extendLen(RichString* this, int len) { if (this->chlen <= RICHSTRING_MAXLEN) { if (len > RICHSTRING_MAXLEN) { this->chptr = xMalloc(charBytes(len + 1)); memcpy(this->chptr, this->chstr, charBytes(this->chlen)); } } else { if (len <= RICHSTRING_MAXLEN) { memcpy(this->chstr, this->chptr, charBytes(len)); free(this->chptr); this->chptr = this->chstr; } else { this->chptr = xRealloc(this->chptr, charBytes(len + 1)); } } RichString_setChar(this, len, 0); this->chlen = len; } #define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0) #ifdef HAVE_LIBNCURSESW static inline void RichString_writeFrom(RichString* this, int attrs, const char* data_c, int from, int len) { wchar_t data[len+1]; len = mbstowcs(data, data_c, len); if (len < 0) return; int newLen = from + len; RichString_setLen(this, newLen); for (int i = from, j = 0; i < newLen; i++, j++) { this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (iswprint(data[j]) ? data[j] : '?') } }; } } inline void RichString_setAttrn(RichString* this, int attrs, int start, int finish) { cchar_t* ch = this->chptr + start; for (int i = start; i <= finish; i++) { ch->attr = attrs; ch++; } } int RichString_findChar(RichString* this, char c, int start) { wchar_t wc = btowc(c); cchar_t* ch = this->chptr + start; for (int i = start; i < this->chlen; i++) { if (ch->chars[0] == wc) return i; ch++; } return -1; } #else static inline void RichString_writeFrom(RichString* this, int attrs, const char* data_c, int from, int len) { int newLen = from + len; RichString_setLen(this, newLen); for (int i = from, j = 0; i < newLen; i++, j++) this->chptr[i] = (data_c[j] >= 32 ? data_c[j] : '?') | attrs; this->chptr[newLen] = 0; } void RichString_setAttrn(RichString* this, int attrs, int start, int finish) { chtype* ch = this->chptr + start; for (int i = start; i <= finish; i++) { *ch = (*ch & 0xff) | attrs; ch++; } } int RichString_findChar(RichString* this, char c, int start) { chtype* ch = this->chptr + start; for (int i = start; i < this->chlen; i++) { if ((*ch & 0xff) == (chtype) c) return i; ch++; } return -1; } #endif void RichString_prune(RichString* this) { if (this->chlen > RICHSTRING_MAXLEN) free(this->chptr); memset(this, 0, sizeof(RichString)); this->chptr = this->chstr; } void RichString_setAttr(RichString* this, int attrs) { RichString_setAttrn(this, attrs, 0, this->chlen - 1); } void RichString_append(RichString* this, int attrs, const char* data) { RichString_writeFrom(this, attrs, data, this->chlen, strlen(data)); } void RichString_appendn(RichString* this, int attrs, const char* data, int len) { RichString_writeFrom(this, attrs, data, this->chlen, len); } void RichString_write(RichString* this, int attrs, const char* data) { RichString_writeFrom(this, attrs, data, 0, strlen(data)); } htop-2.1.0/XAlloc.c0000644000175000001440000000261513235624301010732 00000000000000 #include "XAlloc.h" #include "RichString.h" #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include /*{ #include #include #include }*/ static inline void fail() { curs_set(1); endwin(); err(1, NULL); } void* xMalloc(size_t size) { void* data = malloc(size); if (!data && size > 0) { fail(); } return data; } void* xCalloc(size_t nmemb, size_t size) { void* data = calloc(nmemb, size); if (!data && nmemb > 0 && size > 0) { fail(); } return data; } void* xRealloc(void* ptr, size_t size) { void* data = realloc(ptr, size); if (!data && size > 0) { fail(); } return data; } #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) #undef xStrdup #undef xStrdup_ #ifdef NDEBUG # define xStrdup_ xStrdup #else # define xStrdup(str_) (assert(str_), xStrdup_(str_)) #endif #ifndef __has_attribute // Clang's macro # define __has_attribute(x) 0 #endif #if (__has_attribute(nonnull) || \ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) char* xStrdup_(const char* str) __attribute__((nonnull)); #endif // __has_attribute(nonnull) || GNU C 3.3 or later char* xStrdup_(const char* str) { char* data = strdup(str); if (!data) { fail(); } return data; } htop-2.1.0/htop.desktop0000644000175000001440000000463513152362772011766 00000000000000[Desktop Entry] Version=1.0 Name=Htop Type=Application Comment=Show System Processes Comment[ca]=Mostra els processos del sistema Comment[de]=Systemprozesse anzeigen Comment[en_GB]=Show System Processes Comment[es]=Mostrar procesos del sistema Comment[fi]=Katsele järjestelmän prosesseja Comment[fr]=Affiche les processus système Comment[gl]=Mostrar os procesos do sistema. Comment[it]=Mostra processi di sistema Comment[ko]=시스템 프로세스 보기 Comment[nb]=Vis systemprosesser Comment[nl]=Systeemprocessen tonen Comment[nn]=Vis systemprosessar Comment[pl]=Pokaż procesy systemowe Comment[pt]=Mostrar os Processos do Sistema Comment[pt_BR]=Mostra os processos do sistema Comment[ru]=Просмотр списка процессов в системе Comment[sk]=Zobraziť systémové procesy Comment[sl]=Prikaz sistemskih opravil Comment[sr]=Приказ системских процеса Comment[sr@ijekavian]=Приказ системских процеса Comment[sr@ijekavianlatin]=Prikaz sistemskih procesa Comment[sr@latin]=Prikaz sistemskih procesa Comment[sv]=Visa systemprocesser Comment[tr]=Sistem Süreçlerini Göster Comment[uk]=Перегляд системних процесів Comment[zh_CN]=显示系统进程 Comment[zh_TW]=顯示系統行程 Terminal=true Exec=htop Icon=htop Categories=ConsoleOnly;System; GenericName=Process Viewer GenericName[ca]=Visor de processos GenericName[de]=Prozessanzeige GenericName[en_GB]=Process Viewer GenericName[es]=Visor de procesos GenericName[fi]=Prosessikatselin GenericName[fr]=Visualiseur de processus GenericName[gl]=Visor de procesos GenericName[it]=Visore dei processi GenericName[ko]=프로세스 뷰어 GenericName[nb]=Prosessviser GenericName[nl]=Viewer van processen GenericName[nn]=Prosessvisar GenericName[pl]=Przeglądarka procesów GenericName[pt]=Visualizador de Processos GenericName[pt_BR]=Visualizador de processos GenericName[ru]=Монитор процессов GenericName[sk]=Prehliadač procesov GenericName[sl]=Pregledovalnik opravil GenericName[sr]=Приказивач процеса GenericName[sr@ijekavian]=Приказивач процеса GenericName[sr@ijekavianlatin]=Prikazivač procesa GenericName[sr@latin]=Prikazivač procesa GenericName[sv]=Processvisning GenericName[tr]=Süreç Görüntüleyici GenericName[uk]=Перегляд процесів GenericName[zh_CN]=进程查看器 GenericName[zh_TW]=行程檢視器 Keywords=system;process;task htop-2.1.0/htop.h0000644000175000001440000000053513235624301010526 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_htop #define HEADER_htop /* htop - htop.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ //#link m // ---------------------------------------- int main(int argc, char** argv); #endif htop-2.1.0/darwin/0000755000175000001440000000000013235655643010761 500000000000000htop-2.1.0/darwin/DarwinProcess.h0000644000175000001440000000244113152362772013632 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DarwinProcess #define HEADER_DarwinProcess /* htop - DarwinProcess.h (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Settings.h" #include "DarwinProcessList.h" #include typedef struct DarwinProcess_ { Process super; uint64_t utime; uint64_t stime; bool taskAccess; } DarwinProcess; extern ProcessClass DarwinProcess_class; DarwinProcess* DarwinProcess_new(Settings* settings); void Process_delete(Object* cast); bool Process_isThread(Process* this); void DarwinProcess_setStartTime(Process *proc, struct extern_proc *ep, time_t now); char *DarwinProcess_getCmdLine(struct kinfo_proc* k, int* basenameOffset); void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, time_t now, bool exists); void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList *dpl); /* * Scan threads for process state information. * Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread * and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c */ void DarwinProcess_scanThreads(DarwinProcess *dp); #endif htop-2.1.0/darwin/DarwinProcessList.c0000644000175000001440000001255213235627054014464 00000000000000/* htop - DarwinProcessList.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include "DarwinProcess.h" #include "DarwinProcessList.h" #include "CRT.h" #include #include #include #include #include #include #include #include /*{ #include "ProcessList.h" #include #include typedef struct DarwinProcessList_ { ProcessList super; host_basic_info_data_t host_info; vm_statistics_data_t vm_stats; processor_cpu_load_info_t prev_load; processor_cpu_load_info_t curr_load; uint64_t kernel_threads; uint64_t user_threads; uint64_t global_diff; } DarwinProcessList; }*/ void ProcessList_getHostInfo(host_basic_info_data_t *p) { mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT; if(0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) { CRT_fatalError("Unable to retrieve host info\n"); } } void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p) { if(NULL != p && NULL != *p) { if(0 != munmap(*p, vm_page_size)) { CRT_fatalError("Unable to free old CPU load information\n"); } } *p = NULL; } unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) { mach_msg_type_number_t info_size = sizeof(processor_cpu_load_info_t); unsigned cpu_count; // TODO Improving the accuracy of the load counts woule help a lot. if(0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t *)p, &info_size)) { CRT_fatalError("Unable to retrieve CPU info\n"); } return cpu_count; } void ProcessList_getVMStats(vm_statistics_t p) { mach_msg_type_number_t info_size = HOST_VM_INFO_COUNT; if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)p, &info_size) != 0) CRT_fatalError("Unable to retrieve VM statistics\n"); } struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; struct kinfo_proc *processes = NULL; /* Note the two calls to sysctl(). One to get length and one to get the * data. This -does- mean that the second call could end up with a missing * process entry or two. */ *count = 0; if (sysctl(mib, 4, NULL, count, NULL, 0) < 0) CRT_fatalError("Unable to get size of kproc_infos"); processes = xMalloc(*count); if (processes == NULL) CRT_fatalError("Out of memory for kproc_infos"); if (sysctl(mib, 4, processes, count, NULL, 0) < 0) CRT_fatalError("Unable to get kinfo_procs"); *count = *count / sizeof(struct kinfo_proc); return processes; } ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList)); ProcessList_init(&this->super, Class(Process), usersTable, pidWhiteList, userId); /* Initialize the CPU information */ this->super.cpuCount = ProcessList_allocateCPULoadInfo(&this->prev_load); ProcessList_getHostInfo(&this->host_info); ProcessList_allocateCPULoadInfo(&this->curr_load); /* Initialize the VM statistics */ ProcessList_getVMStats(&this->vm_stats); this->super.kernelThreads = 0; this->super.userlandThreads = 0; this->super.totalTasks = 0; this->super.runningTasks = 0; return &this->super; } void ProcessList_delete(ProcessList* this) { ProcessList_done(this); free(this); } void ProcessList_goThroughEntries(ProcessList* super) { DarwinProcessList *dpl = (DarwinProcessList *)super; bool preExisting = true; struct kinfo_proc *ps; size_t count; DarwinProcess *proc; struct timeval tv; gettimeofday(&tv, NULL); /* Start processing time */ /* Update the global data (CPU times and VM stats) */ ProcessList_freeCPULoadInfo(&dpl->prev_load); dpl->prev_load = dpl->curr_load; ProcessList_allocateCPULoadInfo(&dpl->curr_load); ProcessList_getVMStats(&dpl->vm_stats); /* Get the time difference */ dpl->global_diff = 0; for(int i = 0; i < dpl->super.cpuCount; ++i) { for(size_t j = 0; j < CPU_STATE_MAX; ++j) { dpl->global_diff += dpl->curr_load[i].cpu_ticks[j] - dpl->prev_load[i].cpu_ticks[j]; } } /* Clear the thread counts */ super->kernelThreads = 0; super->userlandThreads = 0; super->totalTasks = 0; super->runningTasks = 0; /* We use kinfo_procs for initial data since : * * 1) They always succeed. * 2) The contain the basic information. * * We attempt to fill-in additional information with libproc. */ ps = ProcessList_getKInfoProcs(&count); for(size_t i = 0; i < count; ++i) { proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, (Process_New)DarwinProcess_new); DarwinProcess_setFromKInfoProc(&proc->super, &ps[i], tv.tv_sec, preExisting); DarwinProcess_setFromLibprocPidinfo(proc, dpl); // Disabled due to bug in macOS High Sierra // DarwinProcess_scanThreads(proc); super->totalTasks += 1; if(!preExisting) { proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid); ProcessList_add(super, &proc->super); } } free(ps); } htop-2.1.0/darwin/DarwinCRT.c0000644000175000001440000000242113152362772012635 00000000000000/* htop - DarwinCRT.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "config.h" #include "CRT.h" #include #include #include void CRT_handleSIGSEGV(int sgn) { (void) sgn; CRT_done(); #ifdef __APPLE__ fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n"); #ifdef HAVE_EXECINFO_H size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *)); fprintf(stderr, "\n Please include in your report the following backtrace: \n"); backtrace_symbols_fd(backtraceArray, size, 2); fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,"); fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:"); fprintf(stderr, "\n\n otool -tvV `which htop` > ~/htop.otool"); fprintf(stderr, "\n\nand then attach the file ~/htop.otool to your bug report."); fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n"); #endif #else fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!"); fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n"); #endif abort(); } htop-2.1.0/darwin/DarwinCRT.h0000644000175000001440000000045713152362772012651 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DarwinCRT #define HEADER_DarwinCRT /* htop - DarwinCRT.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ void CRT_handleSIGSEGV(int sgn); #endif htop-2.1.0/darwin/Battery.h0000644000175000001440000000025713152362772012464 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Battery #define HEADER_Battery void Battery_getData(double* level, ACPresence* isOnAC); #endif htop-2.1.0/darwin/DarwinProcess.c0000644000175000001440000002357113235624301013623 00000000000000/* htop - DarwinProcess.c (C) 2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "DarwinProcess.h" #include #include #include #include #include /*{ #include "Settings.h" #include "DarwinProcessList.h" #include typedef struct DarwinProcess_ { Process super; uint64_t utime; uint64_t stime; bool taskAccess; } DarwinProcess; }*/ ProcessClass DarwinProcess_class = { .super = { .extends = Class(Process), .display = Process_display, .delete = Process_delete, .compare = Process_compare }, .writeField = Process_writeField, }; DarwinProcess* DarwinProcess_new(Settings* settings) { DarwinProcess* this = xCalloc(1, sizeof(DarwinProcess)); Object_setClass(this, Class(DarwinProcess)); Process_init(&this->super, settings); this->utime = 0; this->stime = 0; this->taskAccess = true; return this; } void Process_delete(Object* cast) { DarwinProcess* this = (DarwinProcess*) cast; Process_done(&this->super); // free platform-specific fields here free(this); } bool Process_isThread(Process* this) { (void) this; return false; } void DarwinProcess_setStartTime(Process *proc, struct extern_proc *ep, time_t now) { struct tm date; proc->starttime_ctime = ep->p_starttime.tv_sec; (void) localtime_r(&proc->starttime_ctime, &date); strftime(proc->starttime_show, 7, ((proc->starttime_ctime > now - 86400) ? "%R " : "%b%d "), &date); } char *DarwinProcess_getCmdLine(struct kinfo_proc* k, int* basenameOffset) { /* This function is from the old Mac version of htop. Originally from ps? */ int mib[3], argmax, nargs, c = 0; size_t size; char *procargs, *sp, *np, *cp, *retval; /* Get the maximum process arguments size. */ mib[0] = CTL_KERN; mib[1] = KERN_ARGMAX; size = sizeof( argmax ); if ( sysctl( mib, 2, &argmax, &size, NULL, 0 ) == -1 ) { goto ERROR_A; } /* Allocate space for the arguments. */ procargs = ( char * ) xMalloc( argmax ); if ( procargs == NULL ) { goto ERROR_A; } /* * Make a sysctl() call to get the raw argument space of the process. * The layout is documented in start.s, which is part of the Csu * project. In summary, it looks like: * * /---------------\ 0x00000000 * : : * : : * |---------------| * | argc | * |---------------| * | arg[0] | * |---------------| * : : * : : * |---------------| * | arg[argc - 1] | * |---------------| * | 0 | * |---------------| * | env[0] | * |---------------| * : : * : : * |---------------| * | env[n] | * |---------------| * | 0 | * |---------------| <-- Beginning of data returned by sysctl() is here. * | argc | * |---------------| * | exec_path | * |:::::::::::::::| * | | * | String area. | * | | * |---------------| <-- Top of stack. * : : * : : * \---------------/ 0xffffffff */ mib[0] = CTL_KERN; mib[1] = KERN_PROCARGS2; mib[2] = k->kp_proc.p_pid; size = ( size_t ) argmax; if ( sysctl( mib, 3, procargs, &size, NULL, 0 ) == -1 ) { goto ERROR_B; } memcpy( &nargs, procargs, sizeof( nargs ) ); cp = procargs + sizeof( nargs ); /* Skip the saved exec_path. */ for ( ; cp < &procargs[size]; cp++ ) { if ( *cp == '\0' ) { /* End of exec_path reached. */ break; } } if ( cp == &procargs[size] ) { goto ERROR_B; } /* Skip trailing '\0' characters. */ for ( ; cp < &procargs[size]; cp++ ) { if ( *cp != '\0' ) { /* Beginning of first argument reached. */ break; } } if ( cp == &procargs[size] ) { goto ERROR_B; } /* Save where the argv[0] string starts. */ sp = cp; *basenameOffset = 0; for ( np = NULL; c < nargs && cp < &procargs[size]; cp++ ) { if ( *cp == '\0' ) { c++; if ( np != NULL ) { /* Convert previous '\0'. */ *np = ' '; } /* Note location of current '\0'. */ np = cp; if (*basenameOffset == 0) { *basenameOffset = cp - sp; } } } /* * sp points to the beginning of the arguments/environment string, and * np should point to the '\0' terminator for the string. */ if ( np == NULL || np == sp ) { /* Empty or unterminated string. */ goto ERROR_B; } if (*basenameOffset == 0) { *basenameOffset = np - sp; } /* Make a copy of the string. */ retval = xStrdup(sp); /* Clean up. */ free( procargs ); return retval; ERROR_B: free( procargs ); ERROR_A: retval = xStrdup(k->kp_proc.p_comm); *basenameOffset = strlen(retval); return retval; } void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, time_t now, bool exists) { struct extern_proc *ep = &ps->kp_proc; /* UNSET HERE : * * processor * user (set at ProcessList level) * nlwp * percent_cpu * percent_mem * m_size * m_resident * minflt * majflt */ /* First, the "immutable" parts */ if(!exists) { /* Set the PID/PGID/etc. */ proc->pid = ep->p_pid; proc->ppid = ps->kp_eproc.e_ppid; proc->pgrp = ps->kp_eproc.e_pgid; proc->session = 0; /* TODO Get the session id */ proc->tpgid = ps->kp_eproc.e_tpgid; proc->tgid = proc->pid; proc->st_uid = ps->kp_eproc.e_ucred.cr_uid; /* e_tdev = (major << 24) | (minor & 0xffffff) */ /* e_tdev == -1 for "no device" */ proc->tty_nr = ps->kp_eproc.e_tdev & 0xff; /* TODO tty_nr is unsigned */ DarwinProcess_setStartTime(proc, ep, now); proc->comm = DarwinProcess_getCmdLine(ps, &(proc->basenameOffset)); } /* Mutable information */ proc->nice = ep->p_nice; proc->priority = ep->p_priority; proc->state = (ep->p_stat == SZOMB) ? 'Z' : '?'; /* Make sure the updated flag is set */ proc->updated = true; } void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList *dpl) { struct proc_taskinfo pti; if(sizeof(pti) == proc_pidinfo(proc->super.pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) { if(0 != proc->utime || 0 != proc->stime) { uint64_t diff = (pti.pti_total_system - proc->stime) + (pti.pti_total_user - proc->utime); proc->super.percent_cpu = (double)diff * (double)dpl->super.cpuCount / ((double)dpl->global_diff * 100000.0); // fprintf(stderr, "%f %llu %llu %llu %llu %llu\n", proc->super.percent_cpu, // proc->stime, proc->utime, pti.pti_total_system, pti.pti_total_user, dpl->global_diff); // exit(7); } proc->super.time = (pti.pti_total_system + pti.pti_total_user) / 10000000; proc->super.nlwp = pti.pti_threadnum; proc->super.m_size = pti.pti_virtual_size / 1024 / PAGE_SIZE_KB; proc->super.m_resident = pti.pti_resident_size / 1024 / PAGE_SIZE_KB; proc->super.majflt = pti.pti_faults; proc->super.percent_mem = (double)pti.pti_resident_size * 100.0 / (double)dpl->host_info.max_mem; proc->stime = pti.pti_total_system; proc->utime = pti.pti_total_user; dpl->super.kernelThreads += 0; /*pti.pti_threads_system;*/ dpl->super.userlandThreads += pti.pti_threadnum; /*pti.pti_threads_user;*/ dpl->super.totalTasks += pti.pti_threadnum; dpl->super.runningTasks += pti.pti_numrunning; } } /* * Scan threads for process state information. * Based on: http://stackoverflow.com/questions/6788274/ios-mac-cpu-usage-for-thread * and https://github.com/max-horvath/htop-osx/blob/e86692e869e30b0bc7264b3675d2a4014866ef46/ProcessList.c */ void DarwinProcess_scanThreads(DarwinProcess *dp) { Process* proc = (Process*) dp; kern_return_t ret; if (!dp->taskAccess) { return; } if (proc->state == 'Z') { return; } task_t port; ret = task_for_pid(mach_task_self(), proc->pid, &port); if (ret != KERN_SUCCESS) { dp->taskAccess = false; return; } task_info_data_t tinfo; mach_msg_type_number_t task_info_count = TASK_INFO_MAX; ret = task_info(port, TASK_BASIC_INFO, (task_info_t) tinfo, &task_info_count); if (ret != KERN_SUCCESS) { dp->taskAccess = false; return; } thread_array_t thread_list; mach_msg_type_number_t thread_count; ret = task_threads(port, &thread_list, &thread_count); if (ret != KERN_SUCCESS) { dp->taskAccess = false; mach_port_deallocate(mach_task_self(), port); return; } integer_t run_state = 999; for (unsigned int i = 0; i < thread_count; i++) { thread_info_data_t thinfo; mach_msg_type_number_t thread_info_count = THREAD_BASIC_INFO_COUNT; ret = thread_info(thread_list[i], THREAD_BASIC_INFO, (thread_info_t)thinfo, &thread_info_count); if (ret == KERN_SUCCESS) { thread_basic_info_t basic_info_th = (thread_basic_info_t) thinfo; if (basic_info_th->run_state < run_state) { run_state = basic_info_th->run_state; } mach_port_deallocate(mach_task_self(), thread_list[i]); } } vm_deallocate(mach_task_self(), (vm_address_t) thread_list, sizeof(thread_port_array_t) * thread_count); mach_port_deallocate(mach_task_self(), port); char state = '?'; switch (run_state) { case TH_STATE_RUNNING: state = 'R'; break; case TH_STATE_STOPPED: state = 'S'; break; case TH_STATE_WAITING: state = 'W'; break; case TH_STATE_UNINTERRUPTIBLE: state = 'U'; break; case TH_STATE_HALTED: state = 'H'; break; } proc->state = state; } htop-2.1.0/darwin/Battery.c0000644000175000001440000000412113152362772012451 00000000000000 #include "BatteryMeter.h" #include #include #include #include void Battery_getData(double* level, ACPresence* isOnAC) { CFTypeRef power_sources = IOPSCopyPowerSourcesInfo(); *level = -1; *isOnAC = AC_ERROR; if(NULL == power_sources) { return; } if(power_sources != NULL) { CFArrayRef list = IOPSCopyPowerSourcesList(power_sources); CFDictionaryRef battery = NULL; int len; if(NULL == list) { CFRelease(power_sources); return; } len = CFArrayGetCount(list); /* Get the battery */ for(int i = 0; i < len && battery == NULL; ++i) { CFDictionaryRef candidate = IOPSGetPowerSourceDescription(power_sources, CFArrayGetValueAtIndex(list, i)); /* GET rule */ CFStringRef type; if(NULL != candidate) { type = (CFStringRef) CFDictionaryGetValue(candidate, CFSTR(kIOPSTransportTypeKey)); /* GET rule */ if(kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) { CFRetain(candidate); battery = candidate; } } } if(NULL != battery) { /* Determine the AC state */ CFStringRef power_state = CFDictionaryGetValue(battery, CFSTR(kIOPSPowerSourceStateKey)); *isOnAC = (kCFCompareEqualTo == CFStringCompare(power_state, CFSTR(kIOPSACPowerValue), 0)) ? AC_PRESENT : AC_ABSENT; /* Get the percentage remaining */ double current; double max; CFNumberGetValue(CFDictionaryGetValue(battery, CFSTR(kIOPSCurrentCapacityKey)), kCFNumberDoubleType, ¤t); CFNumberGetValue(CFDictionaryGetValue(battery, CFSTR(kIOPSMaxCapacityKey)), kCFNumberDoubleType, &max); *level = (current * 100.0) / max; CFRelease(battery); } CFRelease(list); CFRelease(power_sources); } } htop-2.1.0/darwin/DarwinProcessList.h0000644000175000001440000000224013152362772014463 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_DarwinProcessList #define HEADER_DarwinProcessList /* htop - DarwinProcessList.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ProcessList.h" #include #include typedef struct DarwinProcessList_ { ProcessList super; host_basic_info_data_t host_info; vm_statistics_data_t vm_stats; processor_cpu_load_info_t prev_load; processor_cpu_load_info_t curr_load; uint64_t kernel_threads; uint64_t user_threads; uint64_t global_diff; } DarwinProcessList; void ProcessList_getHostInfo(host_basic_info_data_t *p); void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p); unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p); void ProcessList_getVMStats(vm_statistics_t p); struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count); ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); void ProcessList_goThroughEntries(ProcessList* super); #endif htop-2.1.0/darwin/Platform.h0000644000175000001440000000223613235653611012632 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Platform #define HEADER_Platform /* htop - darwin/Platform.h (C) 2014 Hisham H. Muhammad (C) 2015 David C. Hunt Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Action.h" #include "SignalsPanel.h" #include "CPUMeter.h" #include "BatteryMeter.h" #include "DarwinProcess.h" #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif extern ProcessField Platform_defaultFields[]; extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; extern ProcessFieldData Process_fields[]; extern MeterClass* Platform_meterTypes[]; void Platform_setBindings(Htop_Action* keys); extern int Platform_numberOfFields; int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); int Platform_getMaxPid(); extern ProcessPidColumn Process_pidColumns[]; double Platform_setCPUValues(Meter* mtr, int cpu); void Platform_setMemoryValues(Meter* mtr); void Platform_setSwapValues(Meter* mtr); char* Platform_getProcessEnv(pid_t pid); #endif htop-2.1.0/darwin/Platform.c0000644000175000001440000002553713235653611012636 00000000000000/* htop - darwin/Platform.c (C) 2014 Hisham H. Muhammad (C) 2015 David C. Hunt Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" #include "CPUMeter.h" #include "MemoryMeter.h" #include "SwapMeter.h" #include "TasksMeter.h" #include "LoadAverageMeter.h" #include "ClockMeter.h" #include "HostnameMeter.h" #include "UptimeMeter.h" #include "DarwinProcessList.h" #include /*{ #include "Action.h" #include "SignalsPanel.h" #include "CPUMeter.h" #include "BatteryMeter.h" #include "DarwinProcess.h" }*/ #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, { .name = " 2 SIGINT", .number = 2 }, { .name = " 3 SIGQUIT", .number = 3 }, { .name = " 4 SIGILL", .number = 4 }, { .name = " 5 SIGTRAP", .number = 5 }, { .name = " 6 SIGABRT", .number = 6 }, { .name = " 6 SIGIOT", .number = 6 }, { .name = " 7 SIGEMT", .number = 7 }, { .name = " 8 SIGFPE", .number = 8 }, { .name = " 9 SIGKILL", .number = 9 }, { .name = "10 SIGBUS", .number = 10 }, { .name = "11 SIGSEGV", .number = 11 }, { .name = "12 SIGSYS", .number = 12 }, { .name = "13 SIGPIPE", .number = 13 }, { .name = "14 SIGALRM", .number = 14 }, { .name = "15 SIGTERM", .number = 15 }, { .name = "16 SIGURG", .number = 16 }, { .name = "17 SIGSTOP", .number = 17 }, { .name = "18 SIGTSTP", .number = 18 }, { .name = "19 SIGCONT", .number = 19 }, { .name = "20 SIGCHLD", .number = 20 }, { .name = "21 SIGTTIN", .number = 21 }, { .name = "22 SIGTTOU", .number = 22 }, { .name = "23 SIGIO", .number = 23 }, { .name = "24 SIGXCPU", .number = 24 }, { .name = "25 SIGXFSZ", .number = 25 }, { .name = "26 SIGVTALRM", .number = 26 }, { .name = "27 SIGPROF", .number = 27 }, { .name = "28 SIGWINCH", .number = 28 }, { .name = "29 SIGINFO", .number = 29 }, { .name = "30 SIGUSR1", .number = 30 }, { .name = "31 SIGUSR2", .number = 31 }, }; const unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem); ProcessFieldData Process_fields[] = { [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, }, [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, }, [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, }, [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, }, [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, }, [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, }, [SESSION] = { .name = "SESSION", .title = " SID ", .description = "Process's session ID", .flags = 0, }, [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, }, [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, }, [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, }, [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, }, [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, }, [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, }, [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, }, [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, }, [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, }, [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, [100] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, }, }; MeterClass* Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, &LoadAverageMeter_class, &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, &TasksMeter_class, &BatteryMeter_class, &HostnameMeter_class, &UptimeMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, &LeftCPUsMeter_class, &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &BlankMeter_class, NULL }; void Platform_setBindings(Htop_Action* keys) { (void) keys; } int Platform_numberOfFields = 100; int Platform_getUptime() { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); int err = sysctl(mib, 2, &bootTime, &size, NULL, 0); if (err) { return -1; } gettimeofday(&currTime, NULL); return (int) difftime(currTime.tv_sec, bootTime.tv_sec); } void Platform_getLoadAverage(double* one, double* five, double* fifteen) { double results[3]; if(3 == getloadavg(results, 3)) { *one = results[0]; *five = results[1]; *fifteen = results[2]; } else { *one = 0; *five = 0; *fifteen = 0; } } int Platform_getMaxPid() { /* http://opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/sys/proc_internal.hh */ return 99999; } ProcessPidColumn Process_pidColumns[] = { { .id = PID, .label = "PID" }, { .id = PPID, .label = "PPID" }, { .id = TPGID, .label = "TPGID" }, { .id = TGID, .label = "TGID" }, { .id = PGRP, .label = "PGRP" }, { .id = SESSION, .label = "SID" }, { .id = 0, .label = NULL }, }; static double Platform_setCPUAverageValues(Meter* mtr) { DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl; int cpus = dpl->super.cpuCount; double sumNice = 0.0; double sumNormal = 0.0; double sumKernel = 0.0; double sumPercent = 0.0; for (int i = 1; i <= cpus; i++) { sumPercent += Platform_setCPUValues(mtr, i); sumNice += mtr->values[CPU_METER_NICE]; sumNormal += mtr->values[CPU_METER_NORMAL]; sumKernel += mtr->values[CPU_METER_KERNEL]; } mtr->values[CPU_METER_NICE] = sumNice / cpus; mtr->values[CPU_METER_NORMAL] = sumNormal / cpus; mtr->values[CPU_METER_KERNEL] = sumKernel / cpus; return sumPercent / cpus; } double Platform_setCPUValues(Meter* mtr, int cpu) { if (cpu == 0) { return Platform_setCPUAverageValues(mtr); } DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl; processor_cpu_load_info_t prev = &dpl->prev_load[cpu-1]; processor_cpu_load_info_t curr = &dpl->curr_load[cpu-1]; double total = 0; /* Take the sums */ for(size_t i = 0; i < CPU_STATE_MAX; ++i) { total += (double)curr->cpu_ticks[i] - (double)prev->cpu_ticks[i]; } mtr->values[CPU_METER_NICE] = ((double)curr->cpu_ticks[CPU_STATE_NICE] - (double)prev->cpu_ticks[CPU_STATE_NICE])* 100.0 / total; mtr->values[CPU_METER_NORMAL] = ((double)curr->cpu_ticks[CPU_STATE_USER] - (double)prev->cpu_ticks[CPU_STATE_USER])* 100.0 / total; mtr->values[CPU_METER_KERNEL] = ((double)curr->cpu_ticks[CPU_STATE_SYSTEM] - (double)prev->cpu_ticks[CPU_STATE_SYSTEM])* 100.0 / total; Meter_setItems(mtr, 3); /* Convert to percent and return */ total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL]; return CLAMP(total, 0.0, 100.0); } void Platform_setMemoryValues(Meter* mtr) { DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl; vm_statistics_t vm = &dpl->vm_stats; double page_K = (double)vm_page_size / (double)1024; mtr->total = dpl->host_info.max_mem / 1024; mtr->values[0] = (double)(vm->active_count + vm->wire_count) * page_K; mtr->values[1] = (double)vm->purgeable_count * page_K; mtr->values[2] = (double)vm->inactive_count * page_K; } void Platform_setSwapValues(Meter* mtr) { int mib[2] = {CTL_VM, VM_SWAPUSAGE}; struct xsw_usage swapused; size_t swlen = sizeof(swapused); sysctl(mib, 2, &swapused, &swlen, NULL, 0); mtr->total = swapused.xsu_total / 1024; mtr->values[0] = swapused.xsu_used / 1024; } char* Platform_getProcessEnv(pid_t pid) { char* env = NULL; int argmax; size_t bufsz = sizeof(argmax); int mib[3]; mib[0] = CTL_KERN; mib[1] = KERN_ARGMAX; if (sysctl(mib, 2, &argmax, &bufsz, 0, 0) == 0) { char* buf = xMalloc(argmax); if (buf) { mib[0] = CTL_KERN; mib[1] = KERN_PROCARGS2; mib[2] = pid; size_t bufsz = argmax; if (sysctl(mib, 3, buf, &bufsz, 0, 0) == 0) { if (bufsz > sizeof(int)) { char *p = buf, *endp = buf + bufsz; int argc = *(int*)p; p += sizeof(int); // skip exe p = strchr(p, 0)+1; // skip padding while(!*p && p < endp) ++p; // skip argv for (; argc-- && p < endp; p = strrchr(p, 0)+1) ; // skip padding while(!*p && p < endp) ++p; size_t size = endp - p; env = xMalloc(size+2); memcpy(env, p, size); env[size] = 0; env[size+1] = 0; } } free(buf); } } return env; } htop-2.1.0/depcomp0000755000175000001440000005601613235540777011003 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: htop-2.1.0/Panel.h0000644000175000001440000000557313235653611010630 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Panel #define HEADER_Panel /* htop - Panel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ //#link curses #include "Object.h" #include "Vector.h" #include "FunctionBar.h" typedef struct Panel_ Panel; typedef enum HandlerResult_ { HANDLED = 0x01, IGNORED = 0x02, BREAK_LOOP = 0x04, REDRAW = 0x08, RESCAN = 0x10, SYNTH_KEY = 0x20, } HandlerResult; #define EVENT_SET_SELECTED -1 #define EVENT_HEADER_CLICK(x_) (-10000 + x_) #define EVENT_IS_HEADER_CLICK(ev_) (ev_ >= -10000 && ev_ <= -9000) #define EVENT_HEADER_CLICK_GET_X(ev_) (ev_ + 10000) typedef HandlerResult(*Panel_EventHandler)(Panel*, int); typedef struct PanelClass_ { const ObjectClass super; const Panel_EventHandler eventHandler; } PanelClass; #define As_Panel(this_) ((PanelClass*)((this_)->super.klass)) #define Panel_eventHandlerFn(this_) As_Panel(this_)->eventHandler #define Panel_eventHandler(this_, ev_) As_Panel(this_)->eventHandler((Panel*)(this_), ev_) struct Panel_ { Object super; int x, y, w, h; WINDOW* window; Vector* items; int selected; int oldSelected; int selectedLen; void* eventHandlerState; int scrollV; short scrollH; bool needsRedraw; FunctionBar* currentBar; FunctionBar* defaultBar; RichString header; int selectionColor; }; #define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0) #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #define KEY_CTRL(l) ((l)-'A'+1) extern PanelClass Panel_class; Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar); void Panel_delete(Object* cast); void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar); void Panel_done(Panel* this); void Panel_setSelectionColor(Panel* this, int color); RichString* Panel_getHeader(Panel* this); extern void Panel_setHeader(Panel* this, const char* header); void Panel_move(Panel* this, int x, int y); void Panel_resize(Panel* this, int w, int h); void Panel_prune(Panel* this); void Panel_add(Panel* this, Object* o); void Panel_insert(Panel* this, int i, Object* o); void Panel_set(Panel* this, int i, Object* o); Object* Panel_get(Panel* this, int i); Object* Panel_remove(Panel* this, int i); Object* Panel_getSelected(Panel* this); void Panel_moveSelectedUp(Panel* this); void Panel_moveSelectedDown(Panel* this); int Panel_getSelectedIndex(Panel* this); int Panel_size(Panel* this); void Panel_setSelected(Panel* this, int selected); void Panel_draw(Panel* this, bool focus); bool Panel_onKey(Panel* this, int key); HandlerResult Panel_selectByTyping(Panel* this, int ch); #endif htop-2.1.0/AffinityPanel.h0000644000175000001440000000104213153324652012304 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_AffinityPanel #define HEADER_AffinityPanel /* htop - AffinityPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Affinity.h" #include "ProcessList.h" #include "ListItem.h" extern PanelClass AffinityPanel_class; Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity); Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl); #endif htop-2.1.0/CPUMeter.h0000644000175000001440000000175413153324652011211 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_CPUMeter #define HEADER_CPUMeter /* htop - CPUMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" typedef enum { CPU_METER_NICE = 0, CPU_METER_NORMAL = 1, CPU_METER_KERNEL = 2, CPU_METER_IRQ = 3, CPU_METER_SOFTIRQ = 4, CPU_METER_STEAL = 5, CPU_METER_GUEST = 6, CPU_METER_IOWAIT = 7, CPU_METER_ITEMCOUNT = 8, // number of entries in this enum } CPUMeterValues; extern int CPUMeter_attributes[]; #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif extern MeterClass CPUMeter_class; extern MeterClass AllCPUsMeter_class; extern MeterClass AllCPUs2Meter_class; extern MeterClass LeftCPUsMeter_class; extern MeterClass RightCPUsMeter_class; extern MeterClass LeftCPUs2Meter_class; extern MeterClass RightCPUs2Meter_class; #endif htop-2.1.0/UptimeMeter.h0000644000175000001440000000056713153324652012026 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_UptimeMeter #define HEADER_UptimeMeter /* htop - UptimeMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int UptimeMeter_attributes[]; extern MeterClass UptimeMeter_class; #endif htop-2.1.0/Meter.h0000644000175000001440000000726213204565055010642 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Meter #define HEADER_Meter /* htop - Meter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #define METER_BUFFER_LEN 256 #define GRAPH_DELAY (DEFAULT_DELAY/2) #define GRAPH_HEIGHT 4 /* Unit: rows (lines) */ #include "ListItem.h" #include typedef struct Meter_ Meter; typedef void(*Meter_Init)(Meter*); typedef void(*Meter_Done)(Meter*); typedef void(*Meter_UpdateMode)(Meter*, int); typedef void(*Meter_UpdateValues)(Meter*, char*, int); typedef void(*Meter_Draw)(Meter*, int, int, int); typedef struct MeterClass_ { ObjectClass super; const Meter_Init init; const Meter_Done done; const Meter_UpdateMode updateMode; const Meter_Draw draw; const Meter_UpdateValues updateValues; const int defaultMode; const double total; const int* attributes; const char* name; const char* uiName; const char* caption; const char* description; const char maxItems; char curItems; } MeterClass; #define As_Meter(this_) ((MeterClass*)((this_)->super.klass)) #define Meter_initFn(this_) As_Meter(this_)->init #define Meter_init(this_) As_Meter(this_)->init((Meter*)(this_)) #define Meter_done(this_) As_Meter(this_)->done((Meter*)(this_)) #define Meter_updateModeFn(this_) As_Meter(this_)->updateMode #define Meter_updateMode(this_, m_) As_Meter(this_)->updateMode((Meter*)(this_), m_) #define Meter_drawFn(this_) As_Meter(this_)->draw #define Meter_doneFn(this_) As_Meter(this_)->done #define Meter_updateValues(this_, buf_, sz_) \ As_Meter(this_)->updateValues((Meter*)(this_), buf_, sz_) #define Meter_defaultMode(this_) As_Meter(this_)->defaultMode #define Meter_getItems(this_) As_Meter(this_)->curItems #define Meter_setItems(this_, n_) As_Meter(this_)->curItems = (n_) #define Meter_attributes(this_) As_Meter(this_)->attributes #define Meter_name(this_) As_Meter(this_)->name #define Meter_uiName(this_) As_Meter(this_)->uiName struct Meter_ { Object super; Meter_Draw draw; char* caption; int mode; int param; void* drawData; int h; struct ProcessList_* pl; double* values; double total; }; typedef struct MeterMode_ { Meter_Draw draw; const char* uiName; int h; } MeterMode; typedef enum { CUSTOM_METERMODE = 0, BAR_METERMODE, TEXT_METERMODE, GRAPH_METERMODE, LED_METERMODE, LAST_METERMODE } MeterModeId; typedef struct GraphData_ { struct timeval time; double values[METER_BUFFER_LEN]; } GraphData; #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif extern MeterClass Meter_class; Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type); int Meter_humanUnit(char* buffer, unsigned long int value, int size); void Meter_delete(Object* cast); void Meter_setCaption(Meter* this, const char* caption); void Meter_setMode(Meter* this, int modeIndex); ListItem* Meter_toListItem(Meter* this, bool moving); /* ---------- TextMeterMode ---------- */ /* ---------- BarMeterMode ---------- */ /* ---------- GraphMeterMode ---------- */ #ifdef HAVE_LIBNCURSESW #define PIXPERROW_UTF8 4 #endif #define PIXPERROW_ASCII 2 /* ---------- LEDMeterMode ---------- */ #ifdef HAVE_LIBNCURSESW #endif extern MeterMode* Meter_modes[]; /* Blank meter */ extern int BlankMeter_attributes[]; extern MeterClass BlankMeter_class; #endif htop-2.1.0/Hashtable.h0000644000175000001440000000200713233625356011454 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Hashtable #define HEADER_Hashtable /* htop - Hashtable.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include typedef struct Hashtable_ Hashtable; typedef void(*Hashtable_PairFunction)(int, void*, void*); typedef struct HashtableItem { unsigned int key; void* value; struct HashtableItem* next; } HashtableItem; struct Hashtable_ { int size; HashtableItem** buckets; int items; bool owner; }; #ifdef DEBUG int Hashtable_count(Hashtable* this); #endif Hashtable* Hashtable_new(int size, bool owner); void Hashtable_delete(Hashtable* this); void Hashtable_put(Hashtable* this, unsigned int key, void* value); void* Hashtable_remove(Hashtable* this, unsigned int key); extern void* Hashtable_get(Hashtable* this, unsigned int key); void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); #endif htop-2.1.0/CategoriesPanel.h0000644000175000001440000000136513153324652012630 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_CategoriesPanel #define HEADER_CategoriesPanel /* htop - CategoriesPanel.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" #include "ProcessList.h" typedef struct CategoriesPanel_ { Panel super; ScreenManager* scr; Settings* settings; Header* header; ProcessList* pl; } CategoriesPanel; void CategoriesPanel_makeMetersPage(CategoriesPanel* this); extern PanelClass CategoriesPanel_class; CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl); #endif htop-2.1.0/HostnameMeter.h0000644000175000001440000000060113153324652012326 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_HostnameMeter #define HEADER_HostnameMeter /* htop - HostnameMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Meter.h" extern int HostnameMeter_attributes[]; extern MeterClass HostnameMeter_class; #endif htop-2.1.0/missing0000755000175000001440000001533013235540777011017 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: htop-2.1.0/config.guess0000755000175000001440000012367213235540777011751 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: htop-2.1.0/Object.h0000644000175000001440000000271513234105373010766 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Object #define HEADER_Object /* htop - Object.h (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "RichString.h" #include "XAlloc.h" typedef struct Object_ Object; typedef void(*Object_Display)(Object*, RichString*); typedef long(*Object_Compare)(const void*, const void*); typedef void(*Object_Delete)(Object*); #define Object_getClass(obj_) ((Object*)(obj_))->klass #define Object_setClass(obj_, class_) Object_getClass(obj_) = (ObjectClass*) class_ #define Object_delete(obj_) Object_getClass(obj_)->delete((Object*)(obj_)) #define Object_displayFn(obj_) Object_getClass(obj_)->display #define Object_display(obj_, str_) Object_getClass(obj_)->display((Object*)(obj_), str_) #define Object_compare(obj_, other_) Object_getClass(obj_)->compare((const void*)(obj_), other_) #define Class(class_) ((ObjectClass*)(&(class_ ## _class))) #define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)); typedef struct ObjectClass_ { const void* extends; const Object_Display display; const Object_Delete delete; const Object_Compare compare; } ObjectClass; struct Object_ { ObjectClass* klass; }; extern ObjectClass Object_class; #ifdef DEBUG bool Object_isA(Object* o, const ObjectClass* klass); #endif #endif htop-2.1.0/Object.c0000644000175000001440000000310613234105373010754 00000000000000/* htop - Object.c (C) 2004-2012 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" /*{ #include "RichString.h" #include "XAlloc.h" typedef struct Object_ Object; typedef void(*Object_Display)(Object*, RichString*); typedef long(*Object_Compare)(const void*, const void*); typedef void(*Object_Delete)(Object*); #define Object_getClass(obj_) ((Object*)(obj_))->klass #define Object_setClass(obj_, class_) Object_getClass(obj_) = (ObjectClass*) class_ #define Object_delete(obj_) Object_getClass(obj_)->delete((Object*)(obj_)) #define Object_displayFn(obj_) Object_getClass(obj_)->display #define Object_display(obj_, str_) Object_getClass(obj_)->display((Object*)(obj_), str_) #define Object_compare(obj_, other_) Object_getClass(obj_)->compare((const void*)(obj_), other_) #define Class(class_) ((ObjectClass*)(&(class_ ## _class))) #define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)); typedef struct ObjectClass_ { const void* extends; const Object_Display display; const Object_Delete delete; const Object_Compare compare; } ObjectClass; struct Object_ { ObjectClass* klass; }; }*/ ObjectClass Object_class = { .extends = NULL }; #ifdef DEBUG bool Object_isA(Object* o, const ObjectClass* klass) { if (!o) return false; const ObjectClass* type = o->klass; while (type) { if (type == klass) return true; type = type->extends; } return false; } #endif htop-2.1.0/StringUtils.c0000644000175000001440000000705113152362772012047 00000000000000/* htop - StringUtils.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "StringUtils.h" #include "XAlloc.h" #include "config.h" #include #include #include /*{ #include #define String_startsWith(s, match) (strncmp((s),(match),strlen(match)) == 0) #define String_contains_i(s1, s2) (strcasestr(s1, s2) != NULL) }*/ /* * String_startsWith gives better performance if strlen(match) can be computed * at compile time (e.g. when they are immutable string literals). :) */ char* String_cat(const char* s1, const char* s2) { int l1 = strlen(s1); int l2 = strlen(s2); char* out = xMalloc(l1 + l2 + 1); strncpy(out, s1, l1); strncpy(out+l1, s2, l2+1); return out; } char* String_trim(const char* in) { while (in[0] == ' ' || in[0] == '\t' || in[0] == '\n') { in++; } int len = strlen(in); while (len > 0 && (in[len-1] == ' ' || in[len-1] == '\t' || in[len-1] == '\n')) { len--; } char* out = xMalloc(len+1); strncpy(out, in, len); out[len] = '\0'; return out; } inline int String_eq(const char* s1, const char* s2) { if (s1 == NULL || s2 == NULL) { if (s1 == NULL && s2 == NULL) return 1; else return 0; } return (strcmp(s1, s2) == 0); } char** String_split(const char* s, char sep, int* n) { *n = 0; const int rate = 10; char** out = xCalloc(rate, sizeof(char*)); int ctr = 0; int blocks = rate; char* where; while ((where = strchr(s, sep)) != NULL) { int size = where - s; char* token = xMalloc(size + 1); strncpy(token, s, size); token[size] = '\0'; out[ctr] = token; ctr++; if (ctr == blocks) { blocks += rate; out = (char**) xRealloc(out, sizeof(char*) * blocks); } s += size + 1; } if (s[0] != '\0') { int size = strlen(s); char* token = xMalloc(size + 1); strncpy(token, s, size + 1); out[ctr] = token; ctr++; } out = xRealloc(out, sizeof(char*) * (ctr + 1)); out[ctr] = NULL; *n = ctr; return out; } void String_freeArray(char** s) { if (!s) { return; } for (int i = 0; s[i] != NULL; i++) { free(s[i]); } free(s); } char* String_getToken(const char* line, const unsigned short int numMatch) { const unsigned short int len = strlen(line); char inWord = 0; unsigned short int count = 0; char match[50]; unsigned short int foundCount = 0; for (unsigned short int i = 0; i < len; i++) { char lastState = inWord; inWord = line[i] == ' ' ? 0:1; if (lastState == 0 && inWord == 1) count++; if(inWord == 1){ if (count == numMatch && line[i] != ' ' && line[i] != '\0' && line[i] != '\n' && line[i] != (char)EOF) { match[foundCount] = line[i]; foundCount++; } } } match[foundCount] = '\0'; return((char*)xStrdup(match)); } char* String_readLine(FILE* fd) { const int step = 1024; int bufSize = step; char* buffer = xMalloc(step + 1); char* at = buffer; for (;;) { char* ok = fgets(at, step + 1, fd); if (!ok) { free(buffer); return NULL; } char* newLine = strrchr(at, '\n'); if (newLine) { *newLine = '\0'; return buffer; } else { if (feof(fd)) { return buffer; } } bufSize += step; buffer = xRealloc(buffer, bufSize + 1); at = buffer + bufSize - step; } } htop-2.1.0/TasksMeter.c0000644000175000001440000000521213235624301011626 00000000000000/* htop - TasksMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "TasksMeter.h" #include "Platform.h" #include "CRT.h" /*{ #include "Meter.h" }*/ int TasksMeter_attributes[] = { CPU_KERNEL, PROCESS_THREAD, PROCESS, TASKS_RUNNING }; static void TasksMeter_updateValues(Meter* this, char* buffer, int len) { ProcessList* pl = this->pl; this->values[0] = pl->kernelThreads; this->values[1] = pl->userlandThreads; this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads; this->values[3] = MIN(pl->runningTasks, pl->cpuCount); if (pl->totalTasks > this->total) { this->total = pl->totalTasks; } if (this->pl->settings->hideKernelThreads) { this->values[0] = 0; } xSnprintf(buffer, len, "%d/%d", (int) this->values[3], (int) this->total); } static void TasksMeter_display(Object* cast, RichString* out) { Meter* this = (Meter*)cast; Settings* settings = this->pl->settings; char buffer[20]; int processes = (int) this->values[2]; xSnprintf(buffer, sizeof(buffer), "%d", processes); RichString_write(out, CRT_colors[METER_VALUE], buffer); int threadValueColor = CRT_colors[METER_VALUE]; int threadCaptionColor = CRT_colors[METER_TEXT]; if (settings->highlightThreads) { threadValueColor = CRT_colors[PROCESS_THREAD_BASENAME]; threadCaptionColor = CRT_colors[PROCESS_THREAD]; } if (!settings->hideUserlandThreads) { RichString_append(out, CRT_colors[METER_TEXT], ", "); xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[1]); RichString_append(out, threadValueColor, buffer); RichString_append(out, threadCaptionColor, " thr"); } if (!settings->hideKernelThreads) { RichString_append(out, CRT_colors[METER_TEXT], ", "); xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[0]); RichString_append(out, threadValueColor, buffer); RichString_append(out, threadCaptionColor, " kthr"); } RichString_append(out, CRT_colors[METER_TEXT], "; "); xSnprintf(buffer, sizeof(buffer), "%d", (int)this->values[3]); RichString_append(out, CRT_colors[TASKS_RUNNING], buffer); RichString_append(out, CRT_colors[METER_TEXT], " running"); } MeterClass TasksMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = TasksMeter_display, }, .updateValues = TasksMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 4, .total = 100.0, .attributes = TasksMeter_attributes, .name = "Tasks", .uiName = "Task counter", .caption = "Tasks: " }; htop-2.1.0/ClockMeter.c0000644000175000001440000000160613152362772011610 00000000000000/* htop - ClockMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ClockMeter.h" #include "CRT.h" #include /*{ #include "Meter.h" }*/ int ClockMeter_attributes[] = { CLOCK }; static void ClockMeter_updateValues(Meter* this, char* buffer, int size) { time_t t = time(NULL); struct tm result; struct tm *lt = localtime_r(&t, &result); this->values[0] = lt->tm_hour * 60 + lt->tm_min; strftime(buffer, size, "%H:%M:%S", lt); } MeterClass ClockMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete }, .updateValues = ClockMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 1, .total = 1440, /* 24*60 */ .attributes = ClockMeter_attributes, .name = "Clock", .uiName = "Clock", .caption = "Time: ", }; htop-2.1.0/SwapMeter.c0000644000175000001440000000277713152362772011501 00000000000000/* htop - SwapMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "SwapMeter.h" #include "CRT.h" #include "Platform.h" #include #include #include #include #include /*{ #include "Meter.h" }*/ int SwapMeter_attributes[] = { SWAP }; static void SwapMeter_updateValues(Meter* this, char* buffer, int size) { int written; Platform_setSwapValues(this); written = Meter_humanUnit(buffer, this->values[0], size); buffer += written; if ((size -= written) > 0) { *buffer++ = '/'; size--; Meter_humanUnit(buffer, this->total, size); } } static void SwapMeter_display(Object* cast, RichString* out) { char buffer[50]; Meter* this = (Meter*)cast; RichString_write(out, CRT_colors[METER_TEXT], ":"); Meter_humanUnit(buffer, this->total, 50); RichString_append(out, CRT_colors[METER_VALUE], buffer); Meter_humanUnit(buffer, this->values[0], 50); RichString_append(out, CRT_colors[METER_TEXT], " used:"); RichString_append(out, CRT_colors[METER_VALUE], buffer); } MeterClass SwapMeter_class = { .super = { .extends = Class(Meter), .delete = Meter_delete, .display = SwapMeter_display, }, .updateValues = SwapMeter_updateValues, .defaultMode = BAR_METERMODE, .maxItems = 1, .total = 100.0, .attributes = SwapMeter_attributes, .name = "Swap", .uiName = "Swap", .caption = "Swp" }; htop-2.1.0/CRT.h0000644000175000001440000000673013235653611010215 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_CRT #define HEADER_CRT /* htop - CRT.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #if HAVE_SETUID_ENABLED #endif #define ColorIndex(i,j) ((7-i)*8+j) #define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j)) #define Black COLOR_BLACK #define Red COLOR_RED #define Green COLOR_GREEN #define Yellow COLOR_YELLOW #define Blue COLOR_BLUE #define Magenta COLOR_MAGENTA #define Cyan COLOR_CYAN #define White COLOR_WHITE #define ColorPairGrayBlack ColorPair(Magenta,Magenta) #define KEY_WHEELUP KEY_F(20) #define KEY_WHEELDOWN KEY_F(21) #define KEY_RECLICK KEY_F(22) //#link curses #include typedef enum TreeStr_ { TREE_STR_HORZ, TREE_STR_VERT, TREE_STR_RTEE, TREE_STR_BEND, TREE_STR_TEND, TREE_STR_OPEN, TREE_STR_SHUT, TREE_STR_COUNT } TreeStr; typedef enum ColorSchemes_ { COLORSCHEME_DEFAULT = 0, COLORSCHEME_MONOCHROME = 1, COLORSCHEME_BLACKONWHITE = 2, COLORSCHEME_LIGHTTERMINAL = 3, COLORSCHEME_MIDNIGHT = 4, COLORSCHEME_BLACKNIGHT = 5, COLORSCHEME_BROKENGRAY = 6, LAST_COLORSCHEME = 7, } ColorSchemes; typedef enum ColorElements_ { RESET_COLOR, DEFAULT_COLOR, FUNCTION_BAR, FUNCTION_KEY, FAILED_SEARCH, PANEL_HEADER_FOCUS, PANEL_HEADER_UNFOCUS, PANEL_SELECTION_FOCUS, PANEL_SELECTION_FOLLOW, PANEL_SELECTION_UNFOCUS, LARGE_NUMBER, METER_TEXT, METER_VALUE, LED_COLOR, UPTIME, BATTERY, TASKS_RUNNING, SWAP, PROCESS, PROCESS_SHADOW, PROCESS_TAG, PROCESS_MEGABYTES, PROCESS_TREE, PROCESS_R_STATE, PROCESS_D_STATE, PROCESS_BASENAME, PROCESS_HIGH_PRIORITY, PROCESS_LOW_PRIORITY, PROCESS_THREAD, PROCESS_THREAD_BASENAME, BAR_BORDER, BAR_SHADOW, GRAPH_1, GRAPH_2, MEMORY_USED, MEMORY_BUFFERS, MEMORY_BUFFERS_TEXT, MEMORY_CACHE, LOAD, LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE, CHECK_BOX, CHECK_MARK, CHECK_TEXT, CLOCK, HELP_BOLD, HOSTNAME, CPU_NICE, CPU_NICE_TEXT, CPU_NORMAL, CPU_KERNEL, CPU_IOWAIT, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, LAST_COLORELEMENT } ColorElements; void CRT_fatalError(const char* note) __attribute__ ((noreturn)); void CRT_handleSIGSEGV(int sgn); #define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) extern const char *CRT_treeStrAscii[TREE_STR_COUNT]; #ifdef HAVE_LIBNCURSESW extern const char *CRT_treeStrUtf8[TREE_STR_COUNT]; extern bool CRT_utf8; #endif extern const char **CRT_treeStr; extern int CRT_delay; int* CRT_colors; extern int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT]; extern int CRT_cursorX; extern int CRT_scrollHAmount; extern int CRT_scrollWheelVAmount; char* CRT_termType; // TODO move color scheme to Settings, perhaps? extern int CRT_colorScheme; void *backtraceArray[128]; #if HAVE_SETUID_ENABLED #define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0) void CRT_dropPrivileges(); void CRT_restorePrivileges(); #else /* Turn setuid operations into NOPs */ #ifndef CRT_dropPrivileges #define CRT_dropPrivileges() #define CRT_restorePrivileges() #endif #endif // TODO: pass an instance of Settings instead. void CRT_init(int delay, int colorScheme); void CRT_done(); void CRT_fatalError(const char* note); int CRT_readKey(); void CRT_disableDelay(); void CRT_enableDelay(); void CRT_setColors(int colorScheme); #endif htop-2.1.0/Process.c0000644000175000001440000004524413235653611011201 00000000000000/* htop - Process.c (C) 2004-2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Process.h" #include "Settings.h" #include "CRT.h" #include "StringUtils.h" #include "RichString.h" #include "Platform.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __ANDROID__ #define SYS_ioprio_get __NR_ioprio_get #define SYS_ioprio_set __NR_ioprio_set #endif // On Linux, this works only with glibc 2.1+. On earlier versions // the behavior is similar to have a hardcoded page size. #ifndef PAGE_SIZE #define PAGE_SIZE ( sysconf(_SC_PAGESIZE) ) #endif #define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K ) /*{ #include "Object.h" #include #define PROCESS_FLAG_IO 0x0001 typedef enum ProcessFields { NULL_PROCESSFIELD = 0, PID = 1, COMM = 2, STATE = 3, PPID = 4, PGRP = 5, SESSION = 6, TTY_NR = 7, TPGID = 8, MINFLT = 10, MAJFLT = 12, PRIORITY = 18, NICE = 19, STARTTIME = 21, PROCESSOR = 38, M_SIZE = 39, M_RESIDENT = 40, ST_UID = 46, PERCENT_CPU = 47, PERCENT_MEM = 48, USER = 49, TIME = 50, NLWP = 51, TGID = 52, } ProcessField; typedef struct ProcessPidColumn_ { int id; char* label; } ProcessPidColumn; typedef struct Process_ { Object super; struct Settings_* settings; unsigned long long int time; pid_t pid; pid_t ppid; pid_t tgid; char* comm; int commLen; int indent; int basenameOffset; bool updated; char state; bool tag; bool showChildren; bool show; unsigned int pgrp; unsigned int session; unsigned int tty_nr; int tpgid; uid_t st_uid; unsigned long int flags; int processor; float percent_cpu; float percent_mem; char* user; long int priority; long int nice; long int nlwp; char starttime_show[8]; time_t starttime_ctime; long m_size; long m_resident; int exit_signal; unsigned long int minflt; unsigned long int majflt; #ifdef DEBUG long int itrealvalue; unsigned long int vsize; long int rss; unsigned long int rlim; unsigned long int startcode; unsigned long int endcode; unsigned long int startstack; unsigned long int kstkesp; unsigned long int kstkeip; unsigned long int signal; unsigned long int blocked; unsigned long int sigignore; unsigned long int sigcatch; unsigned long int wchan; unsigned long int nswap; unsigned long int cnswap; #endif } Process; typedef struct ProcessFieldData_ { const char* name; const char* title; const char* description; int flags; } ProcessFieldData; // Implemented in platform-specific code: void Process_writeField(Process* this, RichString* str, ProcessField field); long Process_compare(const void* v1, const void* v2); void Process_delete(Object* cast); bool Process_isThread(Process* this); extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; extern char Process_pidFormat[20]; typedef Process*(*Process_New)(struct Settings_*); typedef void (*Process_WriteField)(Process*, RichString*, ProcessField); typedef struct ProcessClass_ { const ObjectClass super; const Process_WriteField writeField; } ProcessClass; #define As_Process(this_) ((ProcessClass*)((this_)->super.klass)) #define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_)) #define Process_sortState(state) ((state) == 'I' ? 0x100 : (state)) }*/ static int Process_getuid = -1; #define ONE_K 1024L #define ONE_M (ONE_K * ONE_K) #define ONE_G (ONE_M * ONE_K) #define ONE_DECIMAL_K 1000L #define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K) #define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K) char Process_pidFormat[20] = "%7d "; static char Process_titleBuffer[20][20]; void Process_setupColumnWidths() { int maxPid = Platform_getMaxPid(); if (maxPid == -1) return; int digits = ceil(log10(maxPid)); assert(digits < 20); for (int i = 0; Process_pidColumns[i].label; i++) { assert(i < 20); xSnprintf(Process_titleBuffer[i], 20, "%*s ", digits, Process_pidColumns[i].label); Process_fields[Process_pidColumns[i].id].title = Process_titleBuffer[i]; } xSnprintf(Process_pidFormat, sizeof(Process_pidFormat), "%%%dd ", digits); } void Process_humanNumber(RichString* str, unsigned long number, bool coloring) { char buffer[11]; int len; int largeNumberColor = CRT_colors[LARGE_NUMBER]; int processMegabytesColor = CRT_colors[PROCESS_MEGABYTES]; int processColor = CRT_colors[PROCESS]; if (!coloring) { largeNumberColor = CRT_colors[PROCESS]; processMegabytesColor = CRT_colors[PROCESS]; } if(number >= (10 * ONE_DECIMAL_M)) { #ifdef __LP64__ if(number >= (100 * ONE_DECIMAL_G)) { len = snprintf(buffer, 10, "%4ldT ", number / ONE_G); RichString_appendn(str, largeNumberColor, buffer, len); return; } else if (number >= (1000 * ONE_DECIMAL_M)) { len = snprintf(buffer, 10, "%4.1lfT ", (double)number / ONE_G); RichString_appendn(str, largeNumberColor, buffer, len); return; } #endif if(number >= (100 * ONE_DECIMAL_M)) { len = snprintf(buffer, 10, "%4ldG ", number / ONE_M); RichString_appendn(str, largeNumberColor, buffer, len); return; } len = snprintf(buffer, 10, "%4.1lfG ", (double)number / ONE_M); RichString_appendn(str, largeNumberColor, buffer, len); return; } else if (number >= 100000) { len = snprintf(buffer, 10, "%4ldM ", number / ONE_K); RichString_appendn(str, processMegabytesColor, buffer, len); return; } else if (number >= 1000) { len = snprintf(buffer, 10, "%2ld", number/1000); RichString_appendn(str, processMegabytesColor, buffer, len); number %= 1000; len = snprintf(buffer, 10, "%03lu ", number); RichString_appendn(str, processColor, buffer, len); return; } len = snprintf(buffer, 10, "%5lu ", number); RichString_appendn(str, processColor, buffer, len); } void Process_colorNumber(RichString* str, unsigned long long number, bool coloring) { char buffer[14]; int largeNumberColor = CRT_colors[LARGE_NUMBER]; int processMegabytesColor = CRT_colors[PROCESS_MEGABYTES]; int processColor = CRT_colors[PROCESS]; int processShadowColor = CRT_colors[PROCESS_SHADOW]; if (!coloring) { largeNumberColor = CRT_colors[PROCESS]; processMegabytesColor = CRT_colors[PROCESS]; processShadowColor = CRT_colors[PROCESS]; } if ((long long) number == -1LL) { int len = snprintf(buffer, 13, " no perm "); RichString_appendn(str, CRT_colors[PROCESS_SHADOW], buffer, len); } else if (number > 10000000000) { xSnprintf(buffer, 13, "%11lld ", number / 1000); RichString_appendn(str, largeNumberColor, buffer, 5); RichString_appendn(str, processMegabytesColor, buffer+5, 3); RichString_appendn(str, processColor, buffer+8, 4); } else { xSnprintf(buffer, 13, "%11llu ", number); RichString_appendn(str, largeNumberColor, buffer, 2); RichString_appendn(str, processMegabytesColor, buffer+2, 3); RichString_appendn(str, processColor, buffer+5, 3); RichString_appendn(str, processShadowColor, buffer+8, 4); } } void Process_printTime(RichString* str, unsigned long long totalHundredths) { unsigned long long totalSeconds = totalHundredths / 100; unsigned long long hours = totalSeconds / 3600; int minutes = (totalSeconds / 60) % 60; int seconds = totalSeconds % 60; int hundredths = totalHundredths - (totalSeconds * 100); char buffer[11]; if (hours >= 100) { xSnprintf(buffer, 10, "%7lluh ", hours); RichString_append(str, CRT_colors[LARGE_NUMBER], buffer); } else { if (hours) { xSnprintf(buffer, 10, "%2lluh", hours); RichString_append(str, CRT_colors[LARGE_NUMBER], buffer); xSnprintf(buffer, 10, "%02d:%02d ", minutes, seconds); } else { xSnprintf(buffer, 10, "%2d:%02d.%02d ", minutes, seconds, hundredths); } RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer); } } static inline void Process_writeCommand(Process* this, int attr, int baseattr, RichString* str) { int start = RichString_size(str), finish = 0; char* comm = this->comm; if (this->settings->highlightBaseName || !this->settings->showProgramPath) { int i, basename = 0; for (i = 0; i < this->basenameOffset; i++) { if (comm[i] == '/') { basename = i + 1; } else if (comm[i] == ':') { finish = i + 1; break; } } if (!finish) { if (this->settings->showProgramPath) start += basename; else comm += basename; finish = this->basenameOffset - basename; } finish += start - 1; } RichString_append(str, attr, comm); if (this->settings->highlightBaseName) RichString_setAttrn(str, baseattr, start, finish); } void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring) { int largeNumberColor = CRT_colors[LARGE_NUMBER]; int processMegabytesColor = CRT_colors[PROCESS_MEGABYTES]; int processColor = CRT_colors[PROCESS]; if (!coloring) { largeNumberColor = CRT_colors[PROCESS]; processMegabytesColor = CRT_colors[PROCESS]; } if (rate == -1) { int len = snprintf(buffer, n, " no perm "); RichString_appendn(str, CRT_colors[PROCESS_SHADOW], buffer, len); } else if (rate < ONE_K) { int len = snprintf(buffer, n, "%7.2f B/s ", rate); RichString_appendn(str, processColor, buffer, len); } else if (rate < ONE_K * ONE_K) { int len = snprintf(buffer, n, "%7.2f K/s ", rate / ONE_K); RichString_appendn(str, processColor, buffer, len); } else if (rate < ONE_K * ONE_K * ONE_K) { int len = snprintf(buffer, n, "%7.2f M/s ", rate / ONE_K / ONE_K); RichString_appendn(str, processMegabytesColor, buffer, len); } else { int len = snprintf(buffer, n, "%7.2f G/s ", rate / ONE_K / ONE_K / ONE_K); RichString_appendn(str, largeNumberColor, buffer, len); } } void Process_writeField(Process* this, RichString* str, ProcessField field) { char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; int baseattr = CRT_colors[PROCESS_BASENAME]; int n = sizeof(buffer) - 1; bool coloring = this->settings->highlightMegabytes; switch (field) { case PERCENT_CPU: { if (this->percent_cpu > 999.9) { xSnprintf(buffer, n, "%4d ", (unsigned int)this->percent_cpu); } else if (this->percent_cpu > 99.9) { xSnprintf(buffer, n, "%3d. ", (unsigned int)this->percent_cpu); } else { xSnprintf(buffer, n, "%4.1f ", this->percent_cpu); } break; } case PERCENT_MEM: { if (this->percent_mem > 99.9) { xSnprintf(buffer, n, "100. "); } else { xSnprintf(buffer, n, "%4.1f ", this->percent_mem); } break; } case COMM: { if (this->settings->highlightThreads && Process_isThread(this)) { attr = CRT_colors[PROCESS_THREAD]; baseattr = CRT_colors[PROCESS_THREAD_BASENAME]; } if (!this->settings->treeView || this->indent == 0) { Process_writeCommand(this, attr, baseattr, str); return; } else { char* buf = buffer; int maxIndent = 0; bool lastItem = (this->indent < 0); int indent = (this->indent < 0 ? -this->indent : this->indent); for (int i = 0; i < 32; i++) if (indent & (1U << i)) maxIndent = i+1; for (int i = 0; i < maxIndent - 1; i++) { int written; if (indent & (1 << i)) written = snprintf(buf, n, "%s ", CRT_treeStr[TREE_STR_VERT]); else written = snprintf(buf, n, " "); buf += written; n -= written; } const char* draw = CRT_treeStr[lastItem ? (this->settings->direction == 1 ? TREE_STR_BEND : TREE_STR_TEND) : TREE_STR_RTEE]; xSnprintf(buf, n, "%s%s ", draw, this->showChildren ? CRT_treeStr[TREE_STR_SHUT] : CRT_treeStr[TREE_STR_OPEN] ); RichString_append(str, CRT_colors[PROCESS_TREE], buffer); Process_writeCommand(this, attr, baseattr, str); return; } } case MAJFLT: Process_colorNumber(str, this->majflt, coloring); return; case MINFLT: Process_colorNumber(str, this->minflt, coloring); return; case M_RESIDENT: Process_humanNumber(str, this->m_resident * PAGE_SIZE_KB, coloring); return; case M_SIZE: Process_humanNumber(str, this->m_size * PAGE_SIZE_KB, coloring); return; case NICE: { xSnprintf(buffer, n, "%3ld ", this->nice); attr = this->nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY] : this->nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY] : attr; break; } case NLWP: xSnprintf(buffer, n, "%4ld ", this->nlwp); break; case PGRP: xSnprintf(buffer, n, Process_pidFormat, this->pgrp); break; case PID: xSnprintf(buffer, n, Process_pidFormat, this->pid); break; case PPID: xSnprintf(buffer, n, Process_pidFormat, this->ppid); break; case PRIORITY: { if(this->priority <= -100) xSnprintf(buffer, n, " RT "); else xSnprintf(buffer, n, "%3ld ", this->priority); break; } case PROCESSOR: xSnprintf(buffer, n, "%3d ", Settings_cpuId(this->settings, this->processor)); break; case SESSION: xSnprintf(buffer, n, Process_pidFormat, this->session); break; case STARTTIME: xSnprintf(buffer, n, "%s", this->starttime_show); break; case STATE: { xSnprintf(buffer, n, "%c ", this->state); switch(this->state) { case 'R': attr = CRT_colors[PROCESS_R_STATE]; break; case 'D': attr = CRT_colors[PROCESS_D_STATE]; break; } break; } case ST_UID: xSnprintf(buffer, n, "%4d ", this->st_uid); break; case TIME: Process_printTime(str, this->time); return; case TGID: xSnprintf(buffer, n, Process_pidFormat, this->tgid); break; case TPGID: xSnprintf(buffer, n, Process_pidFormat, this->tpgid); break; case TTY_NR: xSnprintf(buffer, n, "%3u:%3u ", major(this->tty_nr), minor(this->tty_nr)); break; case USER: { if (Process_getuid != (int) this->st_uid) attr = CRT_colors[PROCESS_SHADOW]; if (this->user) { xSnprintf(buffer, n, "%-9s ", this->user); } else { xSnprintf(buffer, n, "%-9d ", this->st_uid); } if (buffer[9] != '\0') { buffer[9] = ' '; buffer[10] = '\0'; } break; } default: xSnprintf(buffer, n, "- "); } RichString_append(str, attr, buffer); } void Process_display(Object* cast, RichString* out) { Process* this = (Process*) cast; ProcessField* fields = this->settings->fields; RichString_prune(out); for (int i = 0; fields[i]; i++) As_Process(this)->writeField(this, out, fields[i]); if (this->settings->shadowOtherUsers && (int)this->st_uid != Process_getuid) RichString_setAttr(out, CRT_colors[PROCESS_SHADOW]); if (this->tag == true) RichString_setAttr(out, CRT_colors[PROCESS_TAG]); assert(out->chlen > 0); } void Process_done(Process* this) { assert (this != NULL); free(this->comm); } ProcessClass Process_class = { .super = { .extends = Class(Object), .display = Process_display, .delete = Process_delete, .compare = Process_compare }, .writeField = Process_writeField, }; void Process_init(Process* this, struct Settings_* settings) { this->settings = settings; this->tag = false; this->showChildren = true; this->show = true; this->updated = false; this->basenameOffset = -1; if (Process_getuid == -1) Process_getuid = getuid(); } void Process_toggleTag(Process* this) { this->tag = this->tag == true ? false : true; } bool Process_setPriority(Process* this, int priority) { CRT_dropPrivileges(); int old_prio = getpriority(PRIO_PROCESS, this->pid); int err = setpriority(PRIO_PROCESS, this->pid, priority); CRT_restorePrivileges(); if (err == 0 && old_prio != getpriority(PRIO_PROCESS, this->pid)) { this->nice = priority; } return (err == 0); } bool Process_changePriorityBy(Process* this, size_t delta) { return Process_setPriority(this, this->nice + delta); } void Process_sendSignal(Process* this, size_t sgn) { CRT_dropPrivileges(); kill(this->pid, (int) sgn); CRT_restorePrivileges(); } long Process_pidCompare(const void* v1, const void* v2) { Process* p1 = (Process*)v1; Process* p2 = (Process*)v2; return (p1->pid - p2->pid); } long Process_compare(const void* v1, const void* v2) { Process *p1, *p2; Settings *settings = ((Process*)v1)->settings; if (settings->direction == 1) { p1 = (Process*)v1; p2 = (Process*)v2; } else { p2 = (Process*)v1; p1 = (Process*)v2; } switch (settings->sortKey) { case PERCENT_CPU: return (p2->percent_cpu > p1->percent_cpu ? 1 : -1); case PERCENT_MEM: return (p2->m_resident - p1->m_resident); case COMM: return strcmp(p1->comm, p2->comm); case MAJFLT: return (p2->majflt - p1->majflt); case MINFLT: return (p2->minflt - p1->minflt); case M_RESIDENT: return (p2->m_resident - p1->m_resident); case M_SIZE: return (p2->m_size - p1->m_size); case NICE: return (p1->nice - p2->nice); case NLWP: return (p1->nlwp - p2->nlwp); case PGRP: return (p1->pgrp - p2->pgrp); case PID: return (p1->pid - p2->pid); case PPID: return (p1->ppid - p2->ppid); case PRIORITY: return (p1->priority - p2->priority); case PROCESSOR: return (p1->processor - p2->processor); case SESSION: return (p1->session - p2->session); case STARTTIME: { if (p1->starttime_ctime == p2->starttime_ctime) return (p1->pid - p2->pid); else return (p1->starttime_ctime - p2->starttime_ctime); } case STATE: return (Process_sortState(p1->state) - Process_sortState(p2->state)); case ST_UID: return (p1->st_uid - p2->st_uid); case TIME: return ((p2->time) - (p1->time)); case TGID: return (p1->tgid - p2->tgid); case TPGID: return (p1->tpgid - p2->tpgid); case TTY_NR: return (p1->tty_nr - p2->tty_nr); case USER: return strcmp(p1->user ? p1->user : "", p2->user ? p2->user : ""); default: return (p1->pid - p2->pid); } } htop-2.1.0/ScreenManager.c0000644000175000001440000002213113235653611012263 00000000000000/* htop - ScreenManager.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ScreenManager.h" #include "ProcessList.h" #include "Object.h" #include "CRT.h" #include #include #include #include /*{ #include "FunctionBar.h" #include "Vector.h" #include "Header.h" #include "Settings.h" #include "Panel.h" typedef enum Orientation_ { VERTICAL, HORIZONTAL } Orientation; typedef struct ScreenManager_ { int x1; int y1; int x2; int y2; Orientation orientation; Vector* panels; int panelCount; const Header* header; const Settings* settings; bool owner; bool allowFocusChange; } ScreenManager; }*/ ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner) { ScreenManager* this; this = xMalloc(sizeof(ScreenManager)); this->x1 = x1; this->y1 = y1; this->x2 = x2; this->y2 = y2; this->orientation = orientation; this->panels = Vector_new(Class(Panel), owner, DEFAULT_SIZE); this->panelCount = 0; this->header = header; this->settings = settings; this->owner = owner; this->allowFocusChange = true; return this; } void ScreenManager_delete(ScreenManager* this) { Vector_delete(this->panels); free(this); } inline int ScreenManager_size(ScreenManager* this) { return this->panelCount; } void ScreenManager_add(ScreenManager* this, Panel* item, int size) { if (this->orientation == HORIZONTAL) { int lastX = 0; if (this->panelCount > 0) { Panel* last = (Panel*) Vector_get(this->panels, this->panelCount - 1); lastX = last->x + last->w + 1; } int height = LINES - this->y1 + this->y2; if (size > 0) { Panel_resize(item, size, height); } else { Panel_resize(item, COLS-this->x1+this->x2-lastX, height); } Panel_move(item, lastX, this->y1); } // TODO: VERTICAL Vector_add(this->panels, item); item->needsRedraw = true; this->panelCount++; } Panel* ScreenManager_remove(ScreenManager* this, int idx) { assert(this->panelCount > idx); Panel* panel = (Panel*) Vector_remove(this->panels, idx); this->panelCount--; return panel; } void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2) { this->x1 = x1; this->y1 = y1; this->x2 = x2; this->y2 = y2; int panels = this->panelCount; if (this->orientation == HORIZONTAL) { int lastX = 0; for (int i = 0; i < panels - 1; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); Panel_resize(panel, panel->w, LINES-y1+y2); Panel_move(panel, lastX, y1); lastX = panel->x + panel->w + 1; } Panel* panel = (Panel*) Vector_get(this->panels, panels-1); Panel_resize(panel, COLS-x1+x2-lastX, LINES-y1+y2); Panel_move(panel, lastX, y1); } // TODO: VERTICAL } static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTimeout, bool* redraw, bool *rescan, bool *timedOut) { ProcessList* pl = this->header->pl; struct timeval tv; gettimeofday(&tv, NULL); double newTime = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000); *timedOut = (newTime - *oldTime > this->settings->delay); *rescan = *rescan || *timedOut; if (newTime < *oldTime) *rescan = true; // clock was adjusted? if (*rescan) { *oldTime = newTime; ProcessList_scan(pl); if (*sortTimeout == 0 || this->settings->treeView) { ProcessList_sort(pl); *sortTimeout = 1; } *redraw = true; } if (*redraw) { ProcessList_rebuildPanel(pl); Header_draw(this->header); } *rescan = false; } static void ScreenManager_drawPanels(ScreenManager* this, int focus) { int nPanels = this->panelCount; for (int i = 0; i < nPanels; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); Panel_draw(panel, i == focus); if (i < nPanels) { if (this->orientation == HORIZONTAL) { mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1); } } } } static Panel* setCurrentPanel(Panel* panel) { FunctionBar_draw(panel->currentBar, NULL); return panel; } void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) { bool quit = false; int focus = 0; Panel* panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus)); double oldTime = 0.0; int ch = ERR; int closeTimeout = 0; bool timedOut = true; bool redraw = true; bool rescan = false; int sortTimeout = 0; int resetSortTimeout = 5; while (!quit) { if (this->header) { checkRecalculation(this, &oldTime, &sortTimeout, &redraw, &rescan, &timedOut); } if (redraw) { ScreenManager_drawPanels(this, focus); } int prevCh = ch; set_escdelay(25); ch = getch(); HandlerResult result = IGNORED; if (ch == KEY_MOUSE) { ch = ERR; MEVENT mevent; int ok = getmouse(&mevent); if (ok == OK) { if (mevent.bstate & BUTTON1_RELEASED) { if (mevent.y == LINES - 1) { ch = FunctionBar_synthesizeEvent(panelFocus->currentBar, mevent.x); } else { for (int i = 0; i < this->panelCount; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); if (mevent.x >= panel->x && mevent.x <= panel->x+panel->w) { if (mevent.y == panel->y) { ch = EVENT_HEADER_CLICK(mevent.x - panel->x); break; } else if (mevent.y > panel->y && mevent.y <= panel->y+panel->h) { ch = KEY_MOUSE; if (panel == panelFocus || this->allowFocusChange) { focus = i; panelFocus = setCurrentPanel(panel); Object* oldSelection = Panel_getSelected(panel); Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1); if (Panel_getSelected(panel) == oldSelection) { ch = KEY_RECLICK; } } break; } } } } #if NCURSES_MOUSE_VERSION > 1 } else if (mevent.bstate & BUTTON4_PRESSED) { ch = KEY_WHEELUP; } else if (mevent.bstate & BUTTON5_PRESSED) { ch = KEY_WHEELDOWN; #endif } } } if (ch == ERR) { sortTimeout--; if (prevCh == ch && !timedOut) { closeTimeout++; if (closeTimeout == 100) { break; } } else closeTimeout = 0; redraw = false; continue; } switch (ch) { case KEY_ALT('H'): ch = KEY_LEFT; break; case KEY_ALT('J'): ch = KEY_DOWN; break; case KEY_ALT('K'): ch = KEY_UP; break; case KEY_ALT('L'): ch = KEY_RIGHT; break; } redraw = true; if (Panel_eventHandlerFn(panelFocus)) { result = Panel_eventHandler(panelFocus, ch); } if (result & SYNTH_KEY) { ch = result >> 16; } if (result & REDRAW) { sortTimeout = 0; } if (result & RESCAN) { rescan = true; sortTimeout = 0; } if (result & HANDLED) { continue; } else if (result & BREAK_LOOP) { quit = true; continue; } switch (ch) { case KEY_RESIZE: { ScreenManager_resize(this, this->x1, this->y1, this->x2, this->y2); continue; } case KEY_LEFT: case KEY_CTRL('B'): if (this->panelCount < 2) { goto defaultHandler; } if (!this->allowFocusChange) break; tryLeft: if (focus > 0) focus--; panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus)); if (Panel_size(panelFocus) == 0 && focus > 0) goto tryLeft; break; case KEY_RIGHT: case KEY_CTRL('F'): case 9: if (this->panelCount < 2) { goto defaultHandler; } if (!this->allowFocusChange) break; tryRight: if (focus < this->panelCount - 1) focus++; panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus)); if (Panel_size(panelFocus) == 0 && focus < this->panelCount - 1) goto tryRight; break; case KEY_F(10): case 'q': case 27: quit = true; continue; default: defaultHandler: sortTimeout = resetSortTimeout; Panel_onKey(panelFocus, ch); break; } } if (lastFocus) *lastFocus = panelFocus; if (lastKey) *lastKey = ch; } htop-2.1.0/Process.h0000644000175000001440000001112213235653611011172 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_Process #define HEADER_Process /* htop - Process.h (C) 2004-2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #ifdef __ANDROID__ #define SYS_ioprio_get __NR_ioprio_get #define SYS_ioprio_set __NR_ioprio_set #endif // On Linux, this works only with glibc 2.1+. On earlier versions // the behavior is similar to have a hardcoded page size. #ifndef PAGE_SIZE #define PAGE_SIZE ( sysconf(_SC_PAGESIZE) ) #endif #define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K ) #include "Object.h" #include #define PROCESS_FLAG_IO 0x0001 typedef enum ProcessFields { NULL_PROCESSFIELD = 0, PID = 1, COMM = 2, STATE = 3, PPID = 4, PGRP = 5, SESSION = 6, TTY_NR = 7, TPGID = 8, MINFLT = 10, MAJFLT = 12, PRIORITY = 18, NICE = 19, STARTTIME = 21, PROCESSOR = 38, M_SIZE = 39, M_RESIDENT = 40, ST_UID = 46, PERCENT_CPU = 47, PERCENT_MEM = 48, USER = 49, TIME = 50, NLWP = 51, TGID = 52, } ProcessField; typedef struct ProcessPidColumn_ { int id; char* label; } ProcessPidColumn; typedef struct Process_ { Object super; struct Settings_* settings; unsigned long long int time; pid_t pid; pid_t ppid; pid_t tgid; char* comm; int commLen; int indent; int basenameOffset; bool updated; char state; bool tag; bool showChildren; bool show; unsigned int pgrp; unsigned int session; unsigned int tty_nr; int tpgid; uid_t st_uid; unsigned long int flags; int processor; float percent_cpu; float percent_mem; char* user; long int priority; long int nice; long int nlwp; char starttime_show[8]; time_t starttime_ctime; long m_size; long m_resident; int exit_signal; unsigned long int minflt; unsigned long int majflt; #ifdef DEBUG long int itrealvalue; unsigned long int vsize; long int rss; unsigned long int rlim; unsigned long int startcode; unsigned long int endcode; unsigned long int startstack; unsigned long int kstkesp; unsigned long int kstkeip; unsigned long int signal; unsigned long int blocked; unsigned long int sigignore; unsigned long int sigcatch; unsigned long int wchan; unsigned long int nswap; unsigned long int cnswap; #endif } Process; typedef struct ProcessFieldData_ { const char* name; const char* title; const char* description; int flags; } ProcessFieldData; // Implemented in platform-specific code: void Process_writeField(Process* this, RichString* str, ProcessField field); long Process_compare(const void* v1, const void* v2); void Process_delete(Object* cast); bool Process_isThread(Process* this); extern ProcessFieldData Process_fields[]; extern ProcessPidColumn Process_pidColumns[]; extern char Process_pidFormat[20]; typedef Process*(*Process_New)(struct Settings_*); typedef void (*Process_WriteField)(Process*, RichString*, ProcessField); typedef struct ProcessClass_ { const ObjectClass super; const Process_WriteField writeField; } ProcessClass; #define As_Process(this_) ((ProcessClass*)((this_)->super.klass)) #define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_)) #define Process_sortState(state) ((state) == 'I' ? 0x100 : (state)) #define ONE_K 1024L #define ONE_M (ONE_K * ONE_K) #define ONE_G (ONE_M * ONE_K) #define ONE_DECIMAL_K 1000L #define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K) #define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K) extern char Process_pidFormat[20]; void Process_setupColumnWidths(); void Process_humanNumber(RichString* str, unsigned long number, bool coloring); void Process_colorNumber(RichString* str, unsigned long long number, bool coloring); void Process_printTime(RichString* str, unsigned long long totalHundredths); void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring); void Process_writeField(Process* this, RichString* str, ProcessField field); void Process_display(Object* cast, RichString* out); void Process_done(Process* this); extern ProcessClass Process_class; void Process_init(Process* this, struct Settings_* settings); void Process_toggleTag(Process* this); bool Process_setPriority(Process* this, int priority); bool Process_changePriorityBy(Process* this, size_t delta); void Process_sendSignal(Process* this, size_t sgn); long Process_pidCompare(const void* v1, const void* v2); long Process_compare(const void* v1, const void* v2); #endif htop-2.1.0/Makefile.in0000644000175000001440000061640313235655576011501 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = htop$(EXEEXT) @HTOP_LINUX_TRUE@am__append_1 = -rdynamic @HTOP_DRAGONFLYBSD_TRUE@am__append_2 = -lkvm -lkinfo -lexecinfo @HTOP_DARWIN_TRUE@am__append_3 = -framework IOKit -framework CoreFoundation subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = htop.1 CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(pixmapdir)" PROGRAMS = $(bin_PROGRAMS) am__htop_SOURCES_DIST = AvailableColumnsPanel.h AvailableMetersPanel.h \ CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h \ ColumnsPanel.h CPUMeter.h CRT.h MainPanel.h \ DisplayOptionsPanel.h FunctionBar.h Hashtable.h Header.h \ htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \ BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h \ ProcessList.h RichString.h ScreenManager.h Settings.h \ SignalsPanel.h StringUtils.h SwapMeter.h TasksMeter.h \ UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h \ IncSet.h Action.h EnvScreen.h InfoScreen.h XAlloc.h \ darwin/Platform.h darwin/DarwinProcess.h \ darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h \ dragonflybsd/Platform.h dragonflybsd/DragonFlyBSDProcessList.h \ dragonflybsd/DragonFlyBSDProcess.h \ dragonflybsd/DragonFlyBSDCRT.h dragonflybsd/Battery.h \ freebsd/Platform.h freebsd/FreeBSDProcessList.h \ freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h \ freebsd/Battery.h linux/Platform.h linux/IOPriorityPanel.h \ linux/IOPriority.h linux/LinuxProcess.h \ linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h \ openbsd/Platform.h openbsd/OpenBSDProcessList.h \ openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h \ openbsd/Battery.h unsupported/Platform.h \ unsupported/UnsupportedProcess.h \ unsupported/UnsupportedProcessList.h \ unsupported/UnsupportedCRT.h unsupported/Battery.h \ AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \ ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c \ MainPanel.c DisplayOptionsPanel.c FunctionBar.c Hashtable.c \ Header.c htop.c ListItem.c LoadAverageMeter.c MemoryMeter.c \ Meter.c MetersPanel.c Object.c Panel.c BatteryMeter.c \ Process.c ProcessList.c RichString.c ScreenManager.c \ Settings.c SignalsPanel.c StringUtils.c SwapMeter.c \ TasksMeter.c UptimeMeter.c TraceScreen.c UsersTable.c Vector.c \ AvailableColumnsPanel.c AffinityPanel.c HostnameMeter.c \ OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \ InfoScreen.c XAlloc.c darwin/Platform.c darwin/DarwinProcess.c \ darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c \ dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ dragonflybsd/DragonFlyBSDProcess.c \ dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c \ freebsd/Platform.c freebsd/FreeBSDProcessList.c \ freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c \ freebsd/Battery.c linux/Platform.c linux/IOPriorityPanel.c \ linux/IOPriority.c linux/LinuxProcess.c \ linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \ openbsd/Platform.c openbsd/OpenBSDProcessList.c \ openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c \ openbsd/Battery.c unsupported/Platform.c \ unsupported/UnsupportedProcess.c \ unsupported/UnsupportedProcessList.c \ unsupported/UnsupportedCRT.c unsupported/Battery.c config.h am__objects_1 = am__objects_2 = htop-AvailableMetersPanel.$(OBJEXT) \ htop-CategoriesPanel.$(OBJEXT) htop-CheckItem.$(OBJEXT) \ htop-ClockMeter.$(OBJEXT) htop-ColorsPanel.$(OBJEXT) \ htop-ColumnsPanel.$(OBJEXT) htop-CPUMeter.$(OBJEXT) \ htop-CRT.$(OBJEXT) htop-MainPanel.$(OBJEXT) \ htop-DisplayOptionsPanel.$(OBJEXT) htop-FunctionBar.$(OBJEXT) \ htop-Hashtable.$(OBJEXT) htop-Header.$(OBJEXT) \ htop-htop.$(OBJEXT) htop-ListItem.$(OBJEXT) \ htop-LoadAverageMeter.$(OBJEXT) htop-MemoryMeter.$(OBJEXT) \ htop-Meter.$(OBJEXT) htop-MetersPanel.$(OBJEXT) \ htop-Object.$(OBJEXT) htop-Panel.$(OBJEXT) \ htop-BatteryMeter.$(OBJEXT) htop-Process.$(OBJEXT) \ htop-ProcessList.$(OBJEXT) htop-RichString.$(OBJEXT) \ htop-ScreenManager.$(OBJEXT) htop-Settings.$(OBJEXT) \ htop-SignalsPanel.$(OBJEXT) htop-StringUtils.$(OBJEXT) \ htop-SwapMeter.$(OBJEXT) htop-TasksMeter.$(OBJEXT) \ htop-UptimeMeter.$(OBJEXT) htop-TraceScreen.$(OBJEXT) \ htop-UsersTable.$(OBJEXT) htop-Vector.$(OBJEXT) \ htop-AvailableColumnsPanel.$(OBJEXT) \ htop-AffinityPanel.$(OBJEXT) htop-HostnameMeter.$(OBJEXT) \ htop-OpenFilesScreen.$(OBJEXT) htop-Affinity.$(OBJEXT) \ htop-IncSet.$(OBJEXT) htop-Action.$(OBJEXT) \ htop-EnvScreen.$(OBJEXT) htop-InfoScreen.$(OBJEXT) \ htop-XAlloc.$(OBJEXT) am__dirstamp = $(am__leading_dot)dirstamp @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@am__objects_3 = unsupported/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedProcess.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedProcessList.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedCRT.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-Battery.$(OBJEXT) @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@am__objects_3 = openbsd/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDProcessList.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDProcess.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDCRT.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-Battery.$(OBJEXT) @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@am__objects_3 = linux/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-IOPriorityPanel.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-IOPriority.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxProcess.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxProcessList.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxCRT.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-Battery.$(OBJEXT) @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_TRUE@am__objects_3 = freebsd/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDProcessList.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDProcess.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDCRT.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-Battery.$(OBJEXT) @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_TRUE@am__objects_3 = dragonflybsd/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_TRUE@ dragonflybsd/htop-DragonFlyBSDProcessList.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_TRUE@ dragonflybsd/htop-DragonFlyBSDProcess.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_TRUE@ dragonflybsd/htop-DragonFlyBSDCRT.$(OBJEXT) \ @HTOP_DARWIN_FALSE@@HTOP_DRAGONFLYBSD_TRUE@ dragonflybsd/htop-Battery.$(OBJEXT) @HTOP_DARWIN_TRUE@am__objects_3 = darwin/htop-Platform.$(OBJEXT) \ @HTOP_DARWIN_TRUE@ darwin/htop-DarwinProcess.$(OBJEXT) \ @HTOP_DARWIN_TRUE@ darwin/htop-DarwinProcessList.$(OBJEXT) \ @HTOP_DARWIN_TRUE@ darwin/htop-DarwinCRT.$(OBJEXT) \ @HTOP_DARWIN_TRUE@ darwin/htop-Battery.$(OBJEXT) am_htop_OBJECTS = $(am__objects_1) $(am__objects_1) $(am__objects_2) \ $(am__objects_3) htop_OBJECTS = $(am_htop_OBJECTS) htop_LDADD = $(LDADD) htop_LINK = $(CCLD) $(htop_CFLAGS) $(CFLAGS) $(htop_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(htop_SOURCES) DIST_SOURCES = $(am__htop_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(applications_DATA) $(pixmap_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/htop.1.in AUTHORS COPYING \ ChangeLog INSTALL NEWS README compile config.guess config.sub \ depcomp install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBNL3GENL_CFLAGS = @LIBNL3GENL_CFLAGS@ LIBNL3GENL_LIBS = @LIBNL3GENL_LIBS@ LIBNL3_CFLAGS = @LIBNL3_CFLAGS@ LIBNL3_LIBS = @LIBNL3_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ my_htop_platform = @my_htop_platform@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ wextra_flag = @wextra_flag@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = subdir-objects dist_man_MANS = htop.1 EXTRA_DIST = $(dist_man_MANS) htop.desktop htop.png scripts/MakeHeader.py \ install-sh autogen.sh missing applicationsdir = $(datadir)/applications applications_DATA = htop.desktop pixmapdir = $(datadir)/pixmaps pixmap_DATA = htop.png htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 \ -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" \ -I"$(top_srcdir)/$(my_htop_platform)" $(am__append_1) htop_LDFLAGS = $(am__append_2) $(am__append_3) AM_CPPFLAGS = -DNDEBUG myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \ ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \ DisplayOptionsPanel.c FunctionBar.c Hashtable.c Header.c htop.c ListItem.c \ LoadAverageMeter.c MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \ BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \ SignalsPanel.c StringUtils.c SwapMeter.c TasksMeter.c UptimeMeter.c \ TraceScreen.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \ HostnameMeter.c OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \ InfoScreen.c XAlloc.c myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \ CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \ CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \ Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \ BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \ ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \ TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \ EnvScreen.h InfoScreen.h XAlloc.h @HTOP_DARWIN_TRUE@myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \ @HTOP_DARWIN_TRUE@darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c @HTOP_DRAGONFLYBSD_TRUE@myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ @HTOP_DRAGONFLYBSD_TRUE@dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c @HTOP_FREEBSD_TRUE@myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ @HTOP_FREEBSD_TRUE@freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c @HTOP_LINUX_TRUE@myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \ @HTOP_LINUX_TRUE@linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c @HTOP_OPENBSD_TRUE@myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \ @HTOP_OPENBSD_TRUE@openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c @HTOP_UNSUPPORTED_TRUE@myhtopplatsources = unsupported/Platform.c \ @HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \ @HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedCRT.c unsupported/Battery.c @HTOP_DARWIN_TRUE@myhtopplatheaders = darwin/Platform.h darwin/DarwinProcess.h \ @HTOP_DARWIN_TRUE@darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h @HTOP_DRAGONFLYBSD_TRUE@myhtopplatheaders = dragonflybsd/Platform.h dragonflybsd/DragonFlyBSDProcessList.h \ @HTOP_DRAGONFLYBSD_TRUE@dragonflybsd/DragonFlyBSDProcess.h dragonflybsd/DragonFlyBSDCRT.h dragonflybsd/Battery.h @HTOP_FREEBSD_TRUE@myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \ @HTOP_FREEBSD_TRUE@freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h @HTOP_LINUX_TRUE@myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \ @HTOP_LINUX_TRUE@linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h @HTOP_OPENBSD_TRUE@myhtopplatheaders = openbsd/Platform.h openbsd/OpenBSDProcessList.h \ @HTOP_OPENBSD_TRUE@openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h openbsd/Battery.h @HTOP_UNSUPPORTED_TRUE@myhtopplatheaders = unsupported/Platform.h \ @HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedProcess.h unsupported/UnsupportedProcessList.h \ @HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedCRT.h unsupported/Battery.h SUFFIXES = .h BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders) htop_SOURCES = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .h .c .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 htop.1: $(top_builddir)/config.status $(srcdir)/htop.1.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) darwin/$(am__dirstamp): @$(MKDIR_P) darwin @: > darwin/$(am__dirstamp) darwin/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) darwin/$(DEPDIR) @: > darwin/$(DEPDIR)/$(am__dirstamp) darwin/htop-Platform.$(OBJEXT): darwin/$(am__dirstamp) \ darwin/$(DEPDIR)/$(am__dirstamp) darwin/htop-DarwinProcess.$(OBJEXT): darwin/$(am__dirstamp) \ darwin/$(DEPDIR)/$(am__dirstamp) darwin/htop-DarwinProcessList.$(OBJEXT): darwin/$(am__dirstamp) \ darwin/$(DEPDIR)/$(am__dirstamp) darwin/htop-DarwinCRT.$(OBJEXT): darwin/$(am__dirstamp) \ darwin/$(DEPDIR)/$(am__dirstamp) darwin/htop-Battery.$(OBJEXT): darwin/$(am__dirstamp) \ darwin/$(DEPDIR)/$(am__dirstamp) dragonflybsd/$(am__dirstamp): @$(MKDIR_P) dragonflybsd @: > dragonflybsd/$(am__dirstamp) dragonflybsd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dragonflybsd/$(DEPDIR) @: > dragonflybsd/$(DEPDIR)/$(am__dirstamp) dragonflybsd/htop-Platform.$(OBJEXT): dragonflybsd/$(am__dirstamp) \ dragonflybsd/$(DEPDIR)/$(am__dirstamp) dragonflybsd/htop-DragonFlyBSDProcessList.$(OBJEXT): \ dragonflybsd/$(am__dirstamp) \ dragonflybsd/$(DEPDIR)/$(am__dirstamp) dragonflybsd/htop-DragonFlyBSDProcess.$(OBJEXT): \ dragonflybsd/$(am__dirstamp) \ dragonflybsd/$(DEPDIR)/$(am__dirstamp) dragonflybsd/htop-DragonFlyBSDCRT.$(OBJEXT): \ dragonflybsd/$(am__dirstamp) \ dragonflybsd/$(DEPDIR)/$(am__dirstamp) dragonflybsd/htop-Battery.$(OBJEXT): dragonflybsd/$(am__dirstamp) \ dragonflybsd/$(DEPDIR)/$(am__dirstamp) freebsd/$(am__dirstamp): @$(MKDIR_P) freebsd @: > freebsd/$(am__dirstamp) freebsd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) freebsd/$(DEPDIR) @: > freebsd/$(DEPDIR)/$(am__dirstamp) freebsd/htop-Platform.$(OBJEXT): freebsd/$(am__dirstamp) \ freebsd/$(DEPDIR)/$(am__dirstamp) freebsd/htop-FreeBSDProcessList.$(OBJEXT): freebsd/$(am__dirstamp) \ freebsd/$(DEPDIR)/$(am__dirstamp) freebsd/htop-FreeBSDProcess.$(OBJEXT): freebsd/$(am__dirstamp) \ freebsd/$(DEPDIR)/$(am__dirstamp) freebsd/htop-FreeBSDCRT.$(OBJEXT): freebsd/$(am__dirstamp) \ freebsd/$(DEPDIR)/$(am__dirstamp) freebsd/htop-Battery.$(OBJEXT): freebsd/$(am__dirstamp) \ freebsd/$(DEPDIR)/$(am__dirstamp) linux/$(am__dirstamp): @$(MKDIR_P) linux @: > linux/$(am__dirstamp) linux/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) linux/$(DEPDIR) @: > linux/$(DEPDIR)/$(am__dirstamp) linux/htop-Platform.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-IOPriorityPanel.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-IOPriority.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-LinuxProcess.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-LinuxProcessList.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-LinuxCRT.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) linux/htop-Battery.$(OBJEXT): linux/$(am__dirstamp) \ linux/$(DEPDIR)/$(am__dirstamp) openbsd/$(am__dirstamp): @$(MKDIR_P) openbsd @: > openbsd/$(am__dirstamp) openbsd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) openbsd/$(DEPDIR) @: > openbsd/$(DEPDIR)/$(am__dirstamp) openbsd/htop-Platform.$(OBJEXT): openbsd/$(am__dirstamp) \ openbsd/$(DEPDIR)/$(am__dirstamp) openbsd/htop-OpenBSDProcessList.$(OBJEXT): openbsd/$(am__dirstamp) \ openbsd/$(DEPDIR)/$(am__dirstamp) openbsd/htop-OpenBSDProcess.$(OBJEXT): openbsd/$(am__dirstamp) \ openbsd/$(DEPDIR)/$(am__dirstamp) openbsd/htop-OpenBSDCRT.$(OBJEXT): openbsd/$(am__dirstamp) \ openbsd/$(DEPDIR)/$(am__dirstamp) openbsd/htop-Battery.$(OBJEXT): openbsd/$(am__dirstamp) \ openbsd/$(DEPDIR)/$(am__dirstamp) unsupported/$(am__dirstamp): @$(MKDIR_P) unsupported @: > unsupported/$(am__dirstamp) unsupported/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) unsupported/$(DEPDIR) @: > unsupported/$(DEPDIR)/$(am__dirstamp) unsupported/htop-Platform.$(OBJEXT): unsupported/$(am__dirstamp) \ unsupported/$(DEPDIR)/$(am__dirstamp) unsupported/htop-UnsupportedProcess.$(OBJEXT): \ unsupported/$(am__dirstamp) \ unsupported/$(DEPDIR)/$(am__dirstamp) unsupported/htop-UnsupportedProcessList.$(OBJEXT): \ unsupported/$(am__dirstamp) \ unsupported/$(DEPDIR)/$(am__dirstamp) unsupported/htop-UnsupportedCRT.$(OBJEXT): \ unsupported/$(am__dirstamp) \ unsupported/$(DEPDIR)/$(am__dirstamp) unsupported/htop-Battery.$(OBJEXT): unsupported/$(am__dirstamp) \ unsupported/$(DEPDIR)/$(am__dirstamp) htop$(EXEEXT): $(htop_OBJECTS) $(htop_DEPENDENCIES) $(EXTRA_htop_DEPENDENCIES) @rm -f htop$(EXEEXT) $(AM_V_CCLD)$(htop_LINK) $(htop_OBJECTS) $(htop_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f darwin/*.$(OBJEXT) -rm -f dragonflybsd/*.$(OBJEXT) -rm -f freebsd/*.$(OBJEXT) -rm -f linux/*.$(OBJEXT) -rm -f openbsd/*.$(OBJEXT) -rm -f unsupported/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Action.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Affinity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-AffinityPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-AvailableColumnsPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-AvailableMetersPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-BatteryMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-CPUMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-CRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-CategoriesPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-CheckItem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ClockMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ColorsPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ColumnsPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-DisplayOptionsPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-EnvScreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-FunctionBar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Hashtable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Header.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-HostnameMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-IncSet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-InfoScreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ListItem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-LoadAverageMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MainPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MemoryMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Meter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MetersPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Object.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-OpenFilesScreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Panel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Process.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-RichString.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ScreenManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Settings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-SignalsPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-StringUtils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-SwapMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-TasksMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-TraceScreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-UptimeMeter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-UsersTable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Vector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-XAlloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-htop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dragonflybsd/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dragonflybsd/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-IOPriority.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-IOPriorityPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-Battery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-Platform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` htop-AvailableMetersPanel.o: AvailableMetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c htop-AvailableMetersPanel.obj: AvailableMetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi` htop-CategoriesPanel.o: CategoriesPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.o -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CategoriesPanel.c' object='htop-CategoriesPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c htop-CategoriesPanel.obj: CategoriesPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.obj -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CategoriesPanel.c' object='htop-CategoriesPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi` htop-CheckItem.o: CheckItem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.o -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CheckItem.c' object='htop-CheckItem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c htop-CheckItem.obj: CheckItem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.obj -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CheckItem.c' object='htop-CheckItem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi` htop-ClockMeter.o: ClockMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.o -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ClockMeter.c' object='htop-ClockMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c htop-ClockMeter.obj: ClockMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.obj -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ClockMeter.c' object='htop-ClockMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi` htop-ColorsPanel.o: ColorsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColorsPanel.c' object='htop-ColorsPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c htop-ColorsPanel.obj: ColorsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColorsPanel.c' object='htop-ColorsPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi` htop-ColumnsPanel.o: ColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColumnsPanel.c' object='htop-ColumnsPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c htop-ColumnsPanel.obj: ColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColumnsPanel.c' object='htop-ColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi` htop-CPUMeter.o: CPUMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.o -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CPUMeter.c' object='htop-CPUMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c htop-CPUMeter.obj: CPUMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.obj -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CPUMeter.c' object='htop-CPUMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi` htop-CRT.o: CRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.o -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CRT.c' object='htop-CRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c htop-CRT.obj: CRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.obj -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CRT.c' object='htop-CRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi` htop-MainPanel.o: MainPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MainPanel.o -MD -MP -MF $(DEPDIR)/htop-MainPanel.Tpo -c -o htop-MainPanel.o `test -f 'MainPanel.c' || echo '$(srcdir)/'`MainPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MainPanel.Tpo $(DEPDIR)/htop-MainPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MainPanel.c' object='htop-MainPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MainPanel.o `test -f 'MainPanel.c' || echo '$(srcdir)/'`MainPanel.c htop-MainPanel.obj: MainPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MainPanel.obj -MD -MP -MF $(DEPDIR)/htop-MainPanel.Tpo -c -o htop-MainPanel.obj `if test -f 'MainPanel.c'; then $(CYGPATH_W) 'MainPanel.c'; else $(CYGPATH_W) '$(srcdir)/MainPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MainPanel.Tpo $(DEPDIR)/htop-MainPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MainPanel.c' object='htop-MainPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MainPanel.obj `if test -f 'MainPanel.c'; then $(CYGPATH_W) 'MainPanel.c'; else $(CYGPATH_W) '$(srcdir)/MainPanel.c'; fi` htop-DisplayOptionsPanel.o: DisplayOptionsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.o -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c htop-DisplayOptionsPanel.obj: DisplayOptionsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.obj -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi` htop-FunctionBar.o: FunctionBar.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.o -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='FunctionBar.c' object='htop-FunctionBar.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c htop-FunctionBar.obj: FunctionBar.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.obj -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='FunctionBar.c' object='htop-FunctionBar.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi` htop-Hashtable.o: Hashtable.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.o -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Hashtable.c' object='htop-Hashtable.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c htop-Hashtable.obj: Hashtable.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.obj -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Hashtable.c' object='htop-Hashtable.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi` htop-Header.o: Header.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.o -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Header.c' object='htop-Header.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c htop-Header.obj: Header.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.obj -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Header.c' object='htop-Header.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi` htop-htop.o: htop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.o -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='htop.c' object='htop-htop.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c htop-htop.obj: htop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.obj -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='htop.c' object='htop-htop.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi` htop-ListItem.o: ListItem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.o -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ListItem.c' object='htop-ListItem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c htop-ListItem.obj: ListItem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.obj -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ListItem.c' object='htop-ListItem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi` htop-LoadAverageMeter.o: LoadAverageMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.o -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='LoadAverageMeter.c' object='htop-LoadAverageMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c htop-LoadAverageMeter.obj: LoadAverageMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.obj -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='LoadAverageMeter.c' object='htop-LoadAverageMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi` htop-MemoryMeter.o: MemoryMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.o -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MemoryMeter.c' object='htop-MemoryMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c htop-MemoryMeter.obj: MemoryMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.obj -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MemoryMeter.c' object='htop-MemoryMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi` htop-Meter.o: Meter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.o -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Meter.c' object='htop-Meter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c htop-Meter.obj: Meter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.obj -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Meter.c' object='htop-Meter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi` htop-MetersPanel.o: MetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.o -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MetersPanel.c' object='htop-MetersPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c htop-MetersPanel.obj: MetersPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MetersPanel.c' object='htop-MetersPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi` htop-Object.o: Object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.o -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Object.c' object='htop-Object.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c htop-Object.obj: Object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.obj -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Object.c' object='htop-Object.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi` htop-Panel.o: Panel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.o -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Panel.c' object='htop-Panel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c htop-Panel.obj: Panel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.obj -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Panel.c' object='htop-Panel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi` htop-BatteryMeter.o: BatteryMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.o -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='BatteryMeter.c' object='htop-BatteryMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c htop-BatteryMeter.obj: BatteryMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.obj -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='BatteryMeter.c' object='htop-BatteryMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi` htop-Process.o: Process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.o -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Process.c' object='htop-Process.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c htop-Process.obj: Process.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.obj -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Process.c' object='htop-Process.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi` htop-ProcessList.o: ProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.o -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ProcessList.c' object='htop-ProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c htop-ProcessList.obj: ProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.obj -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ProcessList.c' object='htop-ProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi` htop-RichString.o: RichString.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.o -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='RichString.c' object='htop-RichString.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c htop-RichString.obj: RichString.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.obj -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='RichString.c' object='htop-RichString.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi` htop-ScreenManager.o: ScreenManager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.o -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ScreenManager.c' object='htop-ScreenManager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c htop-ScreenManager.obj: ScreenManager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.obj -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ScreenManager.c' object='htop-ScreenManager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi` htop-Settings.o: Settings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.o -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Settings.c' object='htop-Settings.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c htop-Settings.obj: Settings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.obj -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Settings.c' object='htop-Settings.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi` htop-SignalsPanel.o: SignalsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.o -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SignalsPanel.c' object='htop-SignalsPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c htop-SignalsPanel.obj: SignalsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.obj -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SignalsPanel.c' object='htop-SignalsPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi` htop-StringUtils.o: StringUtils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-StringUtils.o -MD -MP -MF $(DEPDIR)/htop-StringUtils.Tpo -c -o htop-StringUtils.o `test -f 'StringUtils.c' || echo '$(srcdir)/'`StringUtils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-StringUtils.Tpo $(DEPDIR)/htop-StringUtils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='StringUtils.c' object='htop-StringUtils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-StringUtils.o `test -f 'StringUtils.c' || echo '$(srcdir)/'`StringUtils.c htop-StringUtils.obj: StringUtils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-StringUtils.obj -MD -MP -MF $(DEPDIR)/htop-StringUtils.Tpo -c -o htop-StringUtils.obj `if test -f 'StringUtils.c'; then $(CYGPATH_W) 'StringUtils.c'; else $(CYGPATH_W) '$(srcdir)/StringUtils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-StringUtils.Tpo $(DEPDIR)/htop-StringUtils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='StringUtils.c' object='htop-StringUtils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-StringUtils.obj `if test -f 'StringUtils.c'; then $(CYGPATH_W) 'StringUtils.c'; else $(CYGPATH_W) '$(srcdir)/StringUtils.c'; fi` htop-SwapMeter.o: SwapMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.o -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SwapMeter.c' object='htop-SwapMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c htop-SwapMeter.obj: SwapMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.obj -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SwapMeter.c' object='htop-SwapMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi` htop-TasksMeter.o: TasksMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.o -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TasksMeter.c' object='htop-TasksMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c htop-TasksMeter.obj: TasksMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.obj -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TasksMeter.c' object='htop-TasksMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi` htop-UptimeMeter.o: UptimeMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.o -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UptimeMeter.c' object='htop-UptimeMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c htop-UptimeMeter.obj: UptimeMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.obj -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UptimeMeter.c' object='htop-UptimeMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi` htop-TraceScreen.o: TraceScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.o -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TraceScreen.c' object='htop-TraceScreen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c htop-TraceScreen.obj: TraceScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.obj -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TraceScreen.c' object='htop-TraceScreen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi` htop-UsersTable.o: UsersTable.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.o -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UsersTable.c' object='htop-UsersTable.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c htop-UsersTable.obj: UsersTable.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.obj -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UsersTable.c' object='htop-UsersTable.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi` htop-Vector.o: Vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.o -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vector.c' object='htop-Vector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c htop-Vector.obj: Vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.obj -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vector.c' object='htop-Vector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi` htop-AvailableColumnsPanel.o: AvailableColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c htop-AvailableColumnsPanel.obj: AvailableColumnsPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi` htop-AffinityPanel.o: AffinityPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.o -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AffinityPanel.c' object='htop-AffinityPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c htop-AffinityPanel.obj: AffinityPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.obj -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AffinityPanel.c' object='htop-AffinityPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi` htop-HostnameMeter.o: HostnameMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.o -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='HostnameMeter.c' object='htop-HostnameMeter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c htop-HostnameMeter.obj: HostnameMeter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.obj -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='HostnameMeter.c' object='htop-HostnameMeter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi` htop-OpenFilesScreen.o: OpenFilesScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.o -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OpenFilesScreen.c' object='htop-OpenFilesScreen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c htop-OpenFilesScreen.obj: OpenFilesScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.obj -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OpenFilesScreen.c' object='htop-OpenFilesScreen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi` htop-Affinity.o: Affinity.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.o -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Affinity.c' object='htop-Affinity.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c htop-Affinity.obj: Affinity.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.obj -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Affinity.c' object='htop-Affinity.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi` htop-IncSet.o: IncSet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.o -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='IncSet.c' object='htop-IncSet.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c htop-IncSet.obj: IncSet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.obj -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='IncSet.c' object='htop-IncSet.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi` htop-Action.o: Action.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Action.o -MD -MP -MF $(DEPDIR)/htop-Action.Tpo -c -o htop-Action.o `test -f 'Action.c' || echo '$(srcdir)/'`Action.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Action.Tpo $(DEPDIR)/htop-Action.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Action.c' object='htop-Action.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Action.o `test -f 'Action.c' || echo '$(srcdir)/'`Action.c htop-Action.obj: Action.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Action.obj -MD -MP -MF $(DEPDIR)/htop-Action.Tpo -c -o htop-Action.obj `if test -f 'Action.c'; then $(CYGPATH_W) 'Action.c'; else $(CYGPATH_W) '$(srcdir)/Action.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Action.Tpo $(DEPDIR)/htop-Action.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Action.c' object='htop-Action.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Action.obj `if test -f 'Action.c'; then $(CYGPATH_W) 'Action.c'; else $(CYGPATH_W) '$(srcdir)/Action.c'; fi` htop-EnvScreen.o: EnvScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-EnvScreen.o -MD -MP -MF $(DEPDIR)/htop-EnvScreen.Tpo -c -o htop-EnvScreen.o `test -f 'EnvScreen.c' || echo '$(srcdir)/'`EnvScreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-EnvScreen.Tpo $(DEPDIR)/htop-EnvScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='EnvScreen.c' object='htop-EnvScreen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-EnvScreen.o `test -f 'EnvScreen.c' || echo '$(srcdir)/'`EnvScreen.c htop-EnvScreen.obj: EnvScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-EnvScreen.obj -MD -MP -MF $(DEPDIR)/htop-EnvScreen.Tpo -c -o htop-EnvScreen.obj `if test -f 'EnvScreen.c'; then $(CYGPATH_W) 'EnvScreen.c'; else $(CYGPATH_W) '$(srcdir)/EnvScreen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-EnvScreen.Tpo $(DEPDIR)/htop-EnvScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='EnvScreen.c' object='htop-EnvScreen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-EnvScreen.obj `if test -f 'EnvScreen.c'; then $(CYGPATH_W) 'EnvScreen.c'; else $(CYGPATH_W) '$(srcdir)/EnvScreen.c'; fi` htop-InfoScreen.o: InfoScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-InfoScreen.o -MD -MP -MF $(DEPDIR)/htop-InfoScreen.Tpo -c -o htop-InfoScreen.o `test -f 'InfoScreen.c' || echo '$(srcdir)/'`InfoScreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-InfoScreen.Tpo $(DEPDIR)/htop-InfoScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InfoScreen.c' object='htop-InfoScreen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-InfoScreen.o `test -f 'InfoScreen.c' || echo '$(srcdir)/'`InfoScreen.c htop-InfoScreen.obj: InfoScreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-InfoScreen.obj -MD -MP -MF $(DEPDIR)/htop-InfoScreen.Tpo -c -o htop-InfoScreen.obj `if test -f 'InfoScreen.c'; then $(CYGPATH_W) 'InfoScreen.c'; else $(CYGPATH_W) '$(srcdir)/InfoScreen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-InfoScreen.Tpo $(DEPDIR)/htop-InfoScreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InfoScreen.c' object='htop-InfoScreen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-InfoScreen.obj `if test -f 'InfoScreen.c'; then $(CYGPATH_W) 'InfoScreen.c'; else $(CYGPATH_W) '$(srcdir)/InfoScreen.c'; fi` htop-XAlloc.o: XAlloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-XAlloc.o -MD -MP -MF $(DEPDIR)/htop-XAlloc.Tpo -c -o htop-XAlloc.o `test -f 'XAlloc.c' || echo '$(srcdir)/'`XAlloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-XAlloc.Tpo $(DEPDIR)/htop-XAlloc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='XAlloc.c' object='htop-XAlloc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-XAlloc.o `test -f 'XAlloc.c' || echo '$(srcdir)/'`XAlloc.c htop-XAlloc.obj: XAlloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-XAlloc.obj -MD -MP -MF $(DEPDIR)/htop-XAlloc.Tpo -c -o htop-XAlloc.obj `if test -f 'XAlloc.c'; then $(CYGPATH_W) 'XAlloc.c'; else $(CYGPATH_W) '$(srcdir)/XAlloc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-XAlloc.Tpo $(DEPDIR)/htop-XAlloc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='XAlloc.c' object='htop-XAlloc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-XAlloc.obj `if test -f 'XAlloc.c'; then $(CYGPATH_W) 'XAlloc.c'; else $(CYGPATH_W) '$(srcdir)/XAlloc.c'; fi` darwin/htop-Platform.o: darwin/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Platform.o -MD -MP -MF darwin/$(DEPDIR)/htop-Platform.Tpo -c -o darwin/htop-Platform.o `test -f 'darwin/Platform.c' || echo '$(srcdir)/'`darwin/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Platform.Tpo darwin/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Platform.c' object='darwin/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Platform.o `test -f 'darwin/Platform.c' || echo '$(srcdir)/'`darwin/Platform.c darwin/htop-Platform.obj: darwin/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Platform.obj -MD -MP -MF darwin/$(DEPDIR)/htop-Platform.Tpo -c -o darwin/htop-Platform.obj `if test -f 'darwin/Platform.c'; then $(CYGPATH_W) 'darwin/Platform.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Platform.Tpo darwin/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Platform.c' object='darwin/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Platform.obj `if test -f 'darwin/Platform.c'; then $(CYGPATH_W) 'darwin/Platform.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Platform.c'; fi` darwin/htop-DarwinProcess.o: darwin/DarwinProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcess.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcess.Tpo -c -o darwin/htop-DarwinProcess.o `test -f 'darwin/DarwinProcess.c' || echo '$(srcdir)/'`darwin/DarwinProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcess.Tpo darwin/$(DEPDIR)/htop-DarwinProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcess.c' object='darwin/htop-DarwinProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcess.o `test -f 'darwin/DarwinProcess.c' || echo '$(srcdir)/'`darwin/DarwinProcess.c darwin/htop-DarwinProcess.obj: darwin/DarwinProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcess.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcess.Tpo -c -o darwin/htop-DarwinProcess.obj `if test -f 'darwin/DarwinProcess.c'; then $(CYGPATH_W) 'darwin/DarwinProcess.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcess.Tpo darwin/$(DEPDIR)/htop-DarwinProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcess.c' object='darwin/htop-DarwinProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcess.obj `if test -f 'darwin/DarwinProcess.c'; then $(CYGPATH_W) 'darwin/DarwinProcess.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcess.c'; fi` darwin/htop-DarwinProcessList.o: darwin/DarwinProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcessList.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo -c -o darwin/htop-DarwinProcessList.o `test -f 'darwin/DarwinProcessList.c' || echo '$(srcdir)/'`darwin/DarwinProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo darwin/$(DEPDIR)/htop-DarwinProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcessList.c' object='darwin/htop-DarwinProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcessList.o `test -f 'darwin/DarwinProcessList.c' || echo '$(srcdir)/'`darwin/DarwinProcessList.c darwin/htop-DarwinProcessList.obj: darwin/DarwinProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcessList.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo -c -o darwin/htop-DarwinProcessList.obj `if test -f 'darwin/DarwinProcessList.c'; then $(CYGPATH_W) 'darwin/DarwinProcessList.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo darwin/$(DEPDIR)/htop-DarwinProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcessList.c' object='darwin/htop-DarwinProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcessList.obj `if test -f 'darwin/DarwinProcessList.c'; then $(CYGPATH_W) 'darwin/DarwinProcessList.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcessList.c'; fi` darwin/htop-DarwinCRT.o: darwin/DarwinCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinCRT.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinCRT.Tpo -c -o darwin/htop-DarwinCRT.o `test -f 'darwin/DarwinCRT.c' || echo '$(srcdir)/'`darwin/DarwinCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinCRT.Tpo darwin/$(DEPDIR)/htop-DarwinCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinCRT.c' object='darwin/htop-DarwinCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinCRT.o `test -f 'darwin/DarwinCRT.c' || echo '$(srcdir)/'`darwin/DarwinCRT.c darwin/htop-DarwinCRT.obj: darwin/DarwinCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinCRT.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinCRT.Tpo -c -o darwin/htop-DarwinCRT.obj `if test -f 'darwin/DarwinCRT.c'; then $(CYGPATH_W) 'darwin/DarwinCRT.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinCRT.Tpo darwin/$(DEPDIR)/htop-DarwinCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinCRT.c' object='darwin/htop-DarwinCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinCRT.obj `if test -f 'darwin/DarwinCRT.c'; then $(CYGPATH_W) 'darwin/DarwinCRT.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinCRT.c'; fi` darwin/htop-Battery.o: darwin/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Battery.o -MD -MP -MF darwin/$(DEPDIR)/htop-Battery.Tpo -c -o darwin/htop-Battery.o `test -f 'darwin/Battery.c' || echo '$(srcdir)/'`darwin/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Battery.Tpo darwin/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Battery.c' object='darwin/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Battery.o `test -f 'darwin/Battery.c' || echo '$(srcdir)/'`darwin/Battery.c darwin/htop-Battery.obj: darwin/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Battery.obj -MD -MP -MF darwin/$(DEPDIR)/htop-Battery.Tpo -c -o darwin/htop-Battery.obj `if test -f 'darwin/Battery.c'; then $(CYGPATH_W) 'darwin/Battery.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Battery.Tpo darwin/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Battery.c' object='darwin/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Battery.obj `if test -f 'darwin/Battery.c'; then $(CYGPATH_W) 'darwin/Battery.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Battery.c'; fi` dragonflybsd/htop-Platform.o: dragonflybsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-Platform.o -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-Platform.Tpo -c -o dragonflybsd/htop-Platform.o `test -f 'dragonflybsd/Platform.c' || echo '$(srcdir)/'`dragonflybsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-Platform.Tpo dragonflybsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/Platform.c' object='dragonflybsd/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-Platform.o `test -f 'dragonflybsd/Platform.c' || echo '$(srcdir)/'`dragonflybsd/Platform.c dragonflybsd/htop-Platform.obj: dragonflybsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-Platform.obj -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-Platform.Tpo -c -o dragonflybsd/htop-Platform.obj `if test -f 'dragonflybsd/Platform.c'; then $(CYGPATH_W) 'dragonflybsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-Platform.Tpo dragonflybsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/Platform.c' object='dragonflybsd/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-Platform.obj `if test -f 'dragonflybsd/Platform.c'; then $(CYGPATH_W) 'dragonflybsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/Platform.c'; fi` dragonflybsd/htop-DragonFlyBSDProcessList.o: dragonflybsd/DragonFlyBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDProcessList.o -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Tpo -c -o dragonflybsd/htop-DragonFlyBSDProcessList.o `test -f 'dragonflybsd/DragonFlyBSDProcessList.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDProcessList.c' object='dragonflybsd/htop-DragonFlyBSDProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDProcessList.o `test -f 'dragonflybsd/DragonFlyBSDProcessList.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDProcessList.c dragonflybsd/htop-DragonFlyBSDProcessList.obj: dragonflybsd/DragonFlyBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDProcessList.obj -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Tpo -c -o dragonflybsd/htop-DragonFlyBSDProcessList.obj `if test -f 'dragonflybsd/DragonFlyBSDProcessList.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDProcessList.c' object='dragonflybsd/htop-DragonFlyBSDProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDProcessList.obj `if test -f 'dragonflybsd/DragonFlyBSDProcessList.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDProcessList.c'; fi` dragonflybsd/htop-DragonFlyBSDProcess.o: dragonflybsd/DragonFlyBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDProcess.o -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Tpo -c -o dragonflybsd/htop-DragonFlyBSDProcess.o `test -f 'dragonflybsd/DragonFlyBSDProcess.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDProcess.c' object='dragonflybsd/htop-DragonFlyBSDProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDProcess.o `test -f 'dragonflybsd/DragonFlyBSDProcess.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/htop-DragonFlyBSDProcess.obj: dragonflybsd/DragonFlyBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDProcess.obj -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Tpo -c -o dragonflybsd/htop-DragonFlyBSDProcess.obj `if test -f 'dragonflybsd/DragonFlyBSDProcess.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDProcess.c' object='dragonflybsd/htop-DragonFlyBSDProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDProcess.obj `if test -f 'dragonflybsd/DragonFlyBSDProcess.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDProcess.c'; fi` dragonflybsd/htop-DragonFlyBSDCRT.o: dragonflybsd/DragonFlyBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDCRT.o -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Tpo -c -o dragonflybsd/htop-DragonFlyBSDCRT.o `test -f 'dragonflybsd/DragonFlyBSDCRT.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDCRT.c' object='dragonflybsd/htop-DragonFlyBSDCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDCRT.o `test -f 'dragonflybsd/DragonFlyBSDCRT.c' || echo '$(srcdir)/'`dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/htop-DragonFlyBSDCRT.obj: dragonflybsd/DragonFlyBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-DragonFlyBSDCRT.obj -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Tpo -c -o dragonflybsd/htop-DragonFlyBSDCRT.obj `if test -f 'dragonflybsd/DragonFlyBSDCRT.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Tpo dragonflybsd/$(DEPDIR)/htop-DragonFlyBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/DragonFlyBSDCRT.c' object='dragonflybsd/htop-DragonFlyBSDCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-DragonFlyBSDCRT.obj `if test -f 'dragonflybsd/DragonFlyBSDCRT.c'; then $(CYGPATH_W) 'dragonflybsd/DragonFlyBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/DragonFlyBSDCRT.c'; fi` dragonflybsd/htop-Battery.o: dragonflybsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-Battery.o -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-Battery.Tpo -c -o dragonflybsd/htop-Battery.o `test -f 'dragonflybsd/Battery.c' || echo '$(srcdir)/'`dragonflybsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-Battery.Tpo dragonflybsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/Battery.c' object='dragonflybsd/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-Battery.o `test -f 'dragonflybsd/Battery.c' || echo '$(srcdir)/'`dragonflybsd/Battery.c dragonflybsd/htop-Battery.obj: dragonflybsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT dragonflybsd/htop-Battery.obj -MD -MP -MF dragonflybsd/$(DEPDIR)/htop-Battery.Tpo -c -o dragonflybsd/htop-Battery.obj `if test -f 'dragonflybsd/Battery.c'; then $(CYGPATH_W) 'dragonflybsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dragonflybsd/$(DEPDIR)/htop-Battery.Tpo dragonflybsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dragonflybsd/Battery.c' object='dragonflybsd/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o dragonflybsd/htop-Battery.obj `if test -f 'dragonflybsd/Battery.c'; then $(CYGPATH_W) 'dragonflybsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/dragonflybsd/Battery.c'; fi` freebsd/htop-Platform.o: freebsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Platform.o -MD -MP -MF freebsd/$(DEPDIR)/htop-Platform.Tpo -c -o freebsd/htop-Platform.o `test -f 'freebsd/Platform.c' || echo '$(srcdir)/'`freebsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Platform.Tpo freebsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Platform.c' object='freebsd/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Platform.o `test -f 'freebsd/Platform.c' || echo '$(srcdir)/'`freebsd/Platform.c freebsd/htop-Platform.obj: freebsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Platform.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-Platform.Tpo -c -o freebsd/htop-Platform.obj `if test -f 'freebsd/Platform.c'; then $(CYGPATH_W) 'freebsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Platform.Tpo freebsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Platform.c' object='freebsd/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Platform.obj `if test -f 'freebsd/Platform.c'; then $(CYGPATH_W) 'freebsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Platform.c'; fi` freebsd/htop-FreeBSDProcessList.o: freebsd/FreeBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcessList.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo -c -o freebsd/htop-FreeBSDProcessList.o `test -f 'freebsd/FreeBSDProcessList.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcessList.c' object='freebsd/htop-FreeBSDProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcessList.o `test -f 'freebsd/FreeBSDProcessList.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcessList.c freebsd/htop-FreeBSDProcessList.obj: freebsd/FreeBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcessList.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo -c -o freebsd/htop-FreeBSDProcessList.obj `if test -f 'freebsd/FreeBSDProcessList.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcessList.c' object='freebsd/htop-FreeBSDProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcessList.obj `if test -f 'freebsd/FreeBSDProcessList.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcessList.c'; fi` freebsd/htop-FreeBSDProcess.o: freebsd/FreeBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcess.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo -c -o freebsd/htop-FreeBSDProcess.o `test -f 'freebsd/FreeBSDProcess.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcess.c' object='freebsd/htop-FreeBSDProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcess.o `test -f 'freebsd/FreeBSDProcess.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcess.c freebsd/htop-FreeBSDProcess.obj: freebsd/FreeBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcess.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo -c -o freebsd/htop-FreeBSDProcess.obj `if test -f 'freebsd/FreeBSDProcess.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcess.c' object='freebsd/htop-FreeBSDProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcess.obj `if test -f 'freebsd/FreeBSDProcess.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcess.c'; fi` freebsd/htop-FreeBSDCRT.o: freebsd/FreeBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDCRT.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo -c -o freebsd/htop-FreeBSDCRT.o `test -f 'freebsd/FreeBSDCRT.c' || echo '$(srcdir)/'`freebsd/FreeBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDCRT.c' object='freebsd/htop-FreeBSDCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDCRT.o `test -f 'freebsd/FreeBSDCRT.c' || echo '$(srcdir)/'`freebsd/FreeBSDCRT.c freebsd/htop-FreeBSDCRT.obj: freebsd/FreeBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDCRT.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo -c -o freebsd/htop-FreeBSDCRT.obj `if test -f 'freebsd/FreeBSDCRT.c'; then $(CYGPATH_W) 'freebsd/FreeBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDCRT.c' object='freebsd/htop-FreeBSDCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDCRT.obj `if test -f 'freebsd/FreeBSDCRT.c'; then $(CYGPATH_W) 'freebsd/FreeBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDCRT.c'; fi` freebsd/htop-Battery.o: freebsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Battery.o -MD -MP -MF freebsd/$(DEPDIR)/htop-Battery.Tpo -c -o freebsd/htop-Battery.o `test -f 'freebsd/Battery.c' || echo '$(srcdir)/'`freebsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Battery.Tpo freebsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Battery.c' object='freebsd/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Battery.o `test -f 'freebsd/Battery.c' || echo '$(srcdir)/'`freebsd/Battery.c freebsd/htop-Battery.obj: freebsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Battery.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-Battery.Tpo -c -o freebsd/htop-Battery.obj `if test -f 'freebsd/Battery.c'; then $(CYGPATH_W) 'freebsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Battery.Tpo freebsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Battery.c' object='freebsd/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Battery.obj `if test -f 'freebsd/Battery.c'; then $(CYGPATH_W) 'freebsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Battery.c'; fi` linux/htop-Platform.o: linux/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Platform.o -MD -MP -MF linux/$(DEPDIR)/htop-Platform.Tpo -c -o linux/htop-Platform.o `test -f 'linux/Platform.c' || echo '$(srcdir)/'`linux/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Platform.Tpo linux/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Platform.c' object='linux/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Platform.o `test -f 'linux/Platform.c' || echo '$(srcdir)/'`linux/Platform.c linux/htop-Platform.obj: linux/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Platform.obj -MD -MP -MF linux/$(DEPDIR)/htop-Platform.Tpo -c -o linux/htop-Platform.obj `if test -f 'linux/Platform.c'; then $(CYGPATH_W) 'linux/Platform.c'; else $(CYGPATH_W) '$(srcdir)/linux/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Platform.Tpo linux/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Platform.c' object='linux/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Platform.obj `if test -f 'linux/Platform.c'; then $(CYGPATH_W) 'linux/Platform.c'; else $(CYGPATH_W) '$(srcdir)/linux/Platform.c'; fi` linux/htop-IOPriorityPanel.o: linux/IOPriorityPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriorityPanel.o -MD -MP -MF linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o linux/htop-IOPriorityPanel.o `test -f 'linux/IOPriorityPanel.c' || echo '$(srcdir)/'`linux/IOPriorityPanel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo linux/$(DEPDIR)/htop-IOPriorityPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriorityPanel.c' object='linux/htop-IOPriorityPanel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriorityPanel.o `test -f 'linux/IOPriorityPanel.c' || echo '$(srcdir)/'`linux/IOPriorityPanel.c linux/htop-IOPriorityPanel.obj: linux/IOPriorityPanel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriorityPanel.obj -MD -MP -MF linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o linux/htop-IOPriorityPanel.obj `if test -f 'linux/IOPriorityPanel.c'; then $(CYGPATH_W) 'linux/IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriorityPanel.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo linux/$(DEPDIR)/htop-IOPriorityPanel.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriorityPanel.c' object='linux/htop-IOPriorityPanel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriorityPanel.obj `if test -f 'linux/IOPriorityPanel.c'; then $(CYGPATH_W) 'linux/IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriorityPanel.c'; fi` linux/htop-IOPriority.o: linux/IOPriority.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriority.o -MD -MP -MF linux/$(DEPDIR)/htop-IOPriority.Tpo -c -o linux/htop-IOPriority.o `test -f 'linux/IOPriority.c' || echo '$(srcdir)/'`linux/IOPriority.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriority.Tpo linux/$(DEPDIR)/htop-IOPriority.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriority.c' object='linux/htop-IOPriority.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriority.o `test -f 'linux/IOPriority.c' || echo '$(srcdir)/'`linux/IOPriority.c linux/htop-IOPriority.obj: linux/IOPriority.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriority.obj -MD -MP -MF linux/$(DEPDIR)/htop-IOPriority.Tpo -c -o linux/htop-IOPriority.obj `if test -f 'linux/IOPriority.c'; then $(CYGPATH_W) 'linux/IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriority.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriority.Tpo linux/$(DEPDIR)/htop-IOPriority.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriority.c' object='linux/htop-IOPriority.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriority.obj `if test -f 'linux/IOPriority.c'; then $(CYGPATH_W) 'linux/IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriority.c'; fi` linux/htop-LinuxProcess.o: linux/LinuxProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcess.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcess.Tpo -c -o linux/htop-LinuxProcess.o `test -f 'linux/LinuxProcess.c' || echo '$(srcdir)/'`linux/LinuxProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcess.Tpo linux/$(DEPDIR)/htop-LinuxProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcess.c' object='linux/htop-LinuxProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcess.o `test -f 'linux/LinuxProcess.c' || echo '$(srcdir)/'`linux/LinuxProcess.c linux/htop-LinuxProcess.obj: linux/LinuxProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcess.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcess.Tpo -c -o linux/htop-LinuxProcess.obj `if test -f 'linux/LinuxProcess.c'; then $(CYGPATH_W) 'linux/LinuxProcess.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcess.Tpo linux/$(DEPDIR)/htop-LinuxProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcess.c' object='linux/htop-LinuxProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcess.obj `if test -f 'linux/LinuxProcess.c'; then $(CYGPATH_W) 'linux/LinuxProcess.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcess.c'; fi` linux/htop-LinuxProcessList.o: linux/LinuxProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcessList.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcessList.Tpo -c -o linux/htop-LinuxProcessList.o `test -f 'linux/LinuxProcessList.c' || echo '$(srcdir)/'`linux/LinuxProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcessList.Tpo linux/$(DEPDIR)/htop-LinuxProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcessList.c' object='linux/htop-LinuxProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcessList.o `test -f 'linux/LinuxProcessList.c' || echo '$(srcdir)/'`linux/LinuxProcessList.c linux/htop-LinuxProcessList.obj: linux/LinuxProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcessList.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcessList.Tpo -c -o linux/htop-LinuxProcessList.obj `if test -f 'linux/LinuxProcessList.c'; then $(CYGPATH_W) 'linux/LinuxProcessList.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcessList.Tpo linux/$(DEPDIR)/htop-LinuxProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcessList.c' object='linux/htop-LinuxProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcessList.obj `if test -f 'linux/LinuxProcessList.c'; then $(CYGPATH_W) 'linux/LinuxProcessList.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcessList.c'; fi` linux/htop-LinuxCRT.o: linux/LinuxCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxCRT.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxCRT.Tpo -c -o linux/htop-LinuxCRT.o `test -f 'linux/LinuxCRT.c' || echo '$(srcdir)/'`linux/LinuxCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxCRT.Tpo linux/$(DEPDIR)/htop-LinuxCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxCRT.c' object='linux/htop-LinuxCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxCRT.o `test -f 'linux/LinuxCRT.c' || echo '$(srcdir)/'`linux/LinuxCRT.c linux/htop-LinuxCRT.obj: linux/LinuxCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxCRT.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxCRT.Tpo -c -o linux/htop-LinuxCRT.obj `if test -f 'linux/LinuxCRT.c'; then $(CYGPATH_W) 'linux/LinuxCRT.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxCRT.Tpo linux/$(DEPDIR)/htop-LinuxCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxCRT.c' object='linux/htop-LinuxCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxCRT.obj `if test -f 'linux/LinuxCRT.c'; then $(CYGPATH_W) 'linux/LinuxCRT.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxCRT.c'; fi` linux/htop-Battery.o: linux/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Battery.o -MD -MP -MF linux/$(DEPDIR)/htop-Battery.Tpo -c -o linux/htop-Battery.o `test -f 'linux/Battery.c' || echo '$(srcdir)/'`linux/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Battery.Tpo linux/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Battery.c' object='linux/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Battery.o `test -f 'linux/Battery.c' || echo '$(srcdir)/'`linux/Battery.c linux/htop-Battery.obj: linux/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Battery.obj -MD -MP -MF linux/$(DEPDIR)/htop-Battery.Tpo -c -o linux/htop-Battery.obj `if test -f 'linux/Battery.c'; then $(CYGPATH_W) 'linux/Battery.c'; else $(CYGPATH_W) '$(srcdir)/linux/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Battery.Tpo linux/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Battery.c' object='linux/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Battery.obj `if test -f 'linux/Battery.c'; then $(CYGPATH_W) 'linux/Battery.c'; else $(CYGPATH_W) '$(srcdir)/linux/Battery.c'; fi` openbsd/htop-Platform.o: openbsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Platform.o -MD -MP -MF openbsd/$(DEPDIR)/htop-Platform.Tpo -c -o openbsd/htop-Platform.o `test -f 'openbsd/Platform.c' || echo '$(srcdir)/'`openbsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Platform.Tpo openbsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Platform.c' object='openbsd/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Platform.o `test -f 'openbsd/Platform.c' || echo '$(srcdir)/'`openbsd/Platform.c openbsd/htop-Platform.obj: openbsd/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Platform.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-Platform.Tpo -c -o openbsd/htop-Platform.obj `if test -f 'openbsd/Platform.c'; then $(CYGPATH_W) 'openbsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Platform.Tpo openbsd/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Platform.c' object='openbsd/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Platform.obj `if test -f 'openbsd/Platform.c'; then $(CYGPATH_W) 'openbsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Platform.c'; fi` openbsd/htop-OpenBSDProcessList.o: openbsd/OpenBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcessList.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo -c -o openbsd/htop-OpenBSDProcessList.o `test -f 'openbsd/OpenBSDProcessList.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcessList.c' object='openbsd/htop-OpenBSDProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcessList.o `test -f 'openbsd/OpenBSDProcessList.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcessList.c openbsd/htop-OpenBSDProcessList.obj: openbsd/OpenBSDProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcessList.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo -c -o openbsd/htop-OpenBSDProcessList.obj `if test -f 'openbsd/OpenBSDProcessList.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcessList.c' object='openbsd/htop-OpenBSDProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcessList.obj `if test -f 'openbsd/OpenBSDProcessList.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcessList.c'; fi` openbsd/htop-OpenBSDProcess.o: openbsd/OpenBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcess.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo -c -o openbsd/htop-OpenBSDProcess.o `test -f 'openbsd/OpenBSDProcess.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcess.c' object='openbsd/htop-OpenBSDProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcess.o `test -f 'openbsd/OpenBSDProcess.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcess.c openbsd/htop-OpenBSDProcess.obj: openbsd/OpenBSDProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcess.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo -c -o openbsd/htop-OpenBSDProcess.obj `if test -f 'openbsd/OpenBSDProcess.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcess.c' object='openbsd/htop-OpenBSDProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcess.obj `if test -f 'openbsd/OpenBSDProcess.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcess.c'; fi` openbsd/htop-OpenBSDCRT.o: openbsd/OpenBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDCRT.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo -c -o openbsd/htop-OpenBSDCRT.o `test -f 'openbsd/OpenBSDCRT.c' || echo '$(srcdir)/'`openbsd/OpenBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDCRT.c' object='openbsd/htop-OpenBSDCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDCRT.o `test -f 'openbsd/OpenBSDCRT.c' || echo '$(srcdir)/'`openbsd/OpenBSDCRT.c openbsd/htop-OpenBSDCRT.obj: openbsd/OpenBSDCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDCRT.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo -c -o openbsd/htop-OpenBSDCRT.obj `if test -f 'openbsd/OpenBSDCRT.c'; then $(CYGPATH_W) 'openbsd/OpenBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDCRT.c' object='openbsd/htop-OpenBSDCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDCRT.obj `if test -f 'openbsd/OpenBSDCRT.c'; then $(CYGPATH_W) 'openbsd/OpenBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDCRT.c'; fi` openbsd/htop-Battery.o: openbsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Battery.o -MD -MP -MF openbsd/$(DEPDIR)/htop-Battery.Tpo -c -o openbsd/htop-Battery.o `test -f 'openbsd/Battery.c' || echo '$(srcdir)/'`openbsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Battery.Tpo openbsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Battery.c' object='openbsd/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Battery.o `test -f 'openbsd/Battery.c' || echo '$(srcdir)/'`openbsd/Battery.c openbsd/htop-Battery.obj: openbsd/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Battery.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-Battery.Tpo -c -o openbsd/htop-Battery.obj `if test -f 'openbsd/Battery.c'; then $(CYGPATH_W) 'openbsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Battery.Tpo openbsd/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Battery.c' object='openbsd/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Battery.obj `if test -f 'openbsd/Battery.c'; then $(CYGPATH_W) 'openbsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Battery.c'; fi` unsupported/htop-Platform.o: unsupported/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Platform.o -MD -MP -MF unsupported/$(DEPDIR)/htop-Platform.Tpo -c -o unsupported/htop-Platform.o `test -f 'unsupported/Platform.c' || echo '$(srcdir)/'`unsupported/Platform.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Platform.Tpo unsupported/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Platform.c' object='unsupported/htop-Platform.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Platform.o `test -f 'unsupported/Platform.c' || echo '$(srcdir)/'`unsupported/Platform.c unsupported/htop-Platform.obj: unsupported/Platform.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Platform.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-Platform.Tpo -c -o unsupported/htop-Platform.obj `if test -f 'unsupported/Platform.c'; then $(CYGPATH_W) 'unsupported/Platform.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Platform.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Platform.Tpo unsupported/$(DEPDIR)/htop-Platform.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Platform.c' object='unsupported/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Platform.obj `if test -f 'unsupported/Platform.c'; then $(CYGPATH_W) 'unsupported/Platform.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Platform.c'; fi` unsupported/htop-UnsupportedProcess.o: unsupported/UnsupportedProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcess.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo -c -o unsupported/htop-UnsupportedProcess.o `test -f 'unsupported/UnsupportedProcess.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcess.c' object='unsupported/htop-UnsupportedProcess.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcess.o `test -f 'unsupported/UnsupportedProcess.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcess.c unsupported/htop-UnsupportedProcess.obj: unsupported/UnsupportedProcess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcess.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo -c -o unsupported/htop-UnsupportedProcess.obj `if test -f 'unsupported/UnsupportedProcess.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcess.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcess.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcess.c' object='unsupported/htop-UnsupportedProcess.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcess.obj `if test -f 'unsupported/UnsupportedProcess.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcess.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcess.c'; fi` unsupported/htop-UnsupportedProcessList.o: unsupported/UnsupportedProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcessList.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo -c -o unsupported/htop-UnsupportedProcessList.o `test -f 'unsupported/UnsupportedProcessList.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcessList.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcessList.c' object='unsupported/htop-UnsupportedProcessList.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcessList.o `test -f 'unsupported/UnsupportedProcessList.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcessList.c unsupported/htop-UnsupportedProcessList.obj: unsupported/UnsupportedProcessList.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcessList.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo -c -o unsupported/htop-UnsupportedProcessList.obj `if test -f 'unsupported/UnsupportedProcessList.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcessList.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcessList.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcessList.c' object='unsupported/htop-UnsupportedProcessList.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcessList.obj `if test -f 'unsupported/UnsupportedProcessList.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcessList.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcessList.c'; fi` unsupported/htop-UnsupportedCRT.o: unsupported/UnsupportedCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedCRT.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo -c -o unsupported/htop-UnsupportedCRT.o `test -f 'unsupported/UnsupportedCRT.c' || echo '$(srcdir)/'`unsupported/UnsupportedCRT.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedCRT.c' object='unsupported/htop-UnsupportedCRT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedCRT.o `test -f 'unsupported/UnsupportedCRT.c' || echo '$(srcdir)/'`unsupported/UnsupportedCRT.c unsupported/htop-UnsupportedCRT.obj: unsupported/UnsupportedCRT.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedCRT.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo -c -o unsupported/htop-UnsupportedCRT.obj `if test -f 'unsupported/UnsupportedCRT.c'; then $(CYGPATH_W) 'unsupported/UnsupportedCRT.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedCRT.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedCRT.c' object='unsupported/htop-UnsupportedCRT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedCRT.obj `if test -f 'unsupported/UnsupportedCRT.c'; then $(CYGPATH_W) 'unsupported/UnsupportedCRT.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedCRT.c'; fi` unsupported/htop-Battery.o: unsupported/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Battery.o -MD -MP -MF unsupported/$(DEPDIR)/htop-Battery.Tpo -c -o unsupported/htop-Battery.o `test -f 'unsupported/Battery.c' || echo '$(srcdir)/'`unsupported/Battery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Battery.Tpo unsupported/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Battery.c' object='unsupported/htop-Battery.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Battery.o `test -f 'unsupported/Battery.c' || echo '$(srcdir)/'`unsupported/Battery.c unsupported/htop-Battery.obj: unsupported/Battery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Battery.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-Battery.Tpo -c -o unsupported/htop-Battery.obj `if test -f 'unsupported/Battery.c'; then $(CYGPATH_W) 'unsupported/Battery.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Battery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Battery.Tpo unsupported/$(DEPDIR)/htop-Battery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Battery.c' object='unsupported/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Battery.obj `if test -f 'unsupported/Battery.c'; then $(CYGPATH_W) 'unsupported/Battery.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Battery.c'; fi` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-applicationsDATA: $(applications_DATA) @$(NORMAL_INSTALL) @list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(applicationsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(applicationsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(applicationsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(applicationsdir)" || exit $$?; \ done uninstall-applicationsDATA: @$(NORMAL_UNINSTALL) @list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(applicationsdir)'; $(am__uninstall_files_from_dir) install-pixmapDATA: $(pixmap_DATA) @$(NORMAL_INSTALL) @list='$(pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pixmapdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pixmapdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pixmapdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pixmapdir)" || exit $$?; \ done uninstall-pixmapDATA: @$(NORMAL_UNINSTALL) @list='$(pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pixmapdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(pixmapdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f darwin/$(DEPDIR)/$(am__dirstamp) -rm -f darwin/$(am__dirstamp) -rm -f dragonflybsd/$(DEPDIR)/$(am__dirstamp) -rm -f dragonflybsd/$(am__dirstamp) -rm -f freebsd/$(DEPDIR)/$(am__dirstamp) -rm -f freebsd/$(am__dirstamp) -rm -f linux/$(DEPDIR)/$(am__dirstamp) -rm -f linux/$(am__dirstamp) -rm -f openbsd/$(DEPDIR)/$(am__dirstamp) -rm -f openbsd/$(am__dirstamp) -rm -f unsupported/$(DEPDIR)/$(am__dirstamp) -rm -f unsupported/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) darwin/$(DEPDIR) dragonflybsd/$(DEPDIR) freebsd/$(DEPDIR) linux/$(DEPDIR) openbsd/$(DEPDIR) unsupported/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-applicationsDATA install-man \ install-pixmapDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) darwin/$(DEPDIR) dragonflybsd/$(DEPDIR) freebsd/$(DEPDIR) linux/$(DEPDIR) openbsd/$(DEPDIR) unsupported/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-applicationsDATA uninstall-binPROGRAMS \ uninstall-man uninstall-pixmapDATA uninstall-man: uninstall-man1 .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-cscope clean-generic cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-applicationsDATA \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-pixmapDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-applicationsDATA uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-pixmapDATA .PRECIOUS: Makefile target: echo $(htop_SOURCES) profile: $(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG" debug: $(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG" coverage: $(MAKE) all CFLAGS="" AM_CPPFLAGS="-fprofile-arcs -ftest-coverage -DDEBUG" LDFLAGS="-lgcov" .c.h: @srcdir@/scripts/MakeHeader.py $< cppcheck: cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS .PHONY: lcov lcov: mkdir -p lcov lcov --capture --directory . --output-file coverage.info genhtml coverage.info --output-directory lcov # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: htop-2.1.0/FunctionBar.c0000644000175000001440000000736013235653611011772 00000000000000/* htop - FunctionBar.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "FunctionBar.h" #include "CRT.h" #include "RichString.h" #include "XAlloc.h" #include #include #include /*{ #include typedef struct FunctionBar_ { int size; char** functions; char** keys; int* events; bool staticData; } FunctionBar; }*/ static const char* const FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL}; static const char* const FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL}; static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)}; static const char* const FunctionBar_EnterEscKeys[] = {"Enter", "Esc", NULL}; static const int FunctionBar_EnterEscEvents[] = {13, 27}; FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc) { const char* functions[] = {enter, esc, NULL}; return FunctionBar_new(functions, FunctionBar_EnterEscKeys, FunctionBar_EnterEscEvents); } FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events) { FunctionBar* this = xCalloc(1, sizeof(FunctionBar)); this->functions = xCalloc(16, sizeof(char*)); if (!functions) { functions = FunctionBar_FLabels; } for (int i = 0; i < 15 && functions[i]; i++) { this->functions[i] = xStrdup(functions[i]); } if (keys && events) { this->staticData = false; this->keys = xCalloc(15, sizeof(char*)); this->events = xCalloc(15, sizeof(int)); int i = 0; while (i < 15 && functions[i]) { this->keys[i] = xStrdup(keys[i]); this->events[i] = events[i]; i++; } this->size = i; } else { this->staticData = true; this->keys = (char**) FunctionBar_FKeys; this->events = FunctionBar_FEvents; this->size = 10; } return this; } void FunctionBar_delete(FunctionBar* this) { for (int i = 0; i < 15 && this->functions[i]; i++) { free(this->functions[i]); } free(this->functions); if (!this->staticData) { for (int i = 0; i < this->size; i++) { free(this->keys[i]); } free(this->keys); free(this->events); } free(this); } void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { for (int i = 0; i < this->size; i++) { if (this->events[i] == event) { free(this->functions[i]); this->functions[i] = xStrdup(text); break; } } } void FunctionBar_draw(const FunctionBar* this, char* buffer) { FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]); } void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) { attrset(CRT_colors[FUNCTION_BAR]); mvhline(LINES-1, 0, ' ', COLS); int x = 0; for (int i = 0; i < this->size; i++) { attrset(CRT_colors[FUNCTION_KEY]); mvaddstr(LINES-1, x, this->keys[i]); x += strlen(this->keys[i]); attrset(CRT_colors[FUNCTION_BAR]); mvaddstr(LINES-1, x, this->functions[i]); x += strlen(this->functions[i]); } if (buffer) { attrset(attr); mvaddstr(LINES-1, x, buffer); CRT_cursorX = x + strlen(buffer); curs_set(1); } else { curs_set(0); } attrset(CRT_colors[RESET_COLOR]); } int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) { int x = 0; for (int i = 0; i < this->size; i++) { x += strlen(this->keys[i]); x += strlen(this->functions[i]); if (pos < x) { return this->events[i]; } } return ERR; } htop-2.1.0/README0000644000175000001440000000422013152362772010267 00000000000000[![Build Status](https://travis-ci.org/hishamhm/htop.svg?branch=master)](https://travis-ci.org/hishamhm/htop) [![PayPal donate](https://img.shields.io/badge/paypal-donate-green.svg)](http://hisham.hm/htop/index.php?page=donate) [htop](http://hisham.hm/htop/) ==== by Hisham Muhammad (2004 - 2016) Introduction ------------ This is `htop`, an interactive process viewer. It requires `ncurses`. It is developed primarily on Linux, but we also have code for running under FreeBSD and Mac OS X (help and testing are wanted for these platforms!) This software has evolved considerably over the years, and is reasonably complete, but there is always room for improvement. Comparison between `htop` and classic `top` ------------------------------------------- * In `htop` you can scroll the list vertically and horizontally to see all processes and full command lines. * In `top` you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident). * `htop` starts faster (`top` seems to collect data for a while before displaying anything). * In `htop` you don't need to type the process number to kill a process, in `top` you do. * In `htop` you don't need to type the process number or the priority value to renice a process, in `top` you do. * In `htop` you can kill multiple processes at once. * `top` is older, hence, more tested. Compilation instructions ------------------------ This program is distributed as a standard autotools-based package. See the [INSTALL](/INSTALL) file for detailed instructions. When compiling from a [release tarball](https://hisham.hm/htop/releases/), run: ./configure && make For compiling sources downloaded from the Git repository, run: ./autogen.sh && ./configure && make By default `make install` will install into `/usr/local`, for changing the path use `./configure --prefix=/some/path`. See the manual page (`man htop`) or the on-line help ('F1' or 'h' inside `htop`) for a list of supported key commands. If not all keys work check your curses configuration. ## License GNU General Public License, version 2 (GPL-2.0) htop-2.1.0/BatteryMeter.h0000644000175000001440000000103313153324652012162 00000000000000/* Do not edit this file. It was automatically generated. */ #ifndef HEADER_BatteryMeter #define HEADER_BatteryMeter /* htop - BatteryMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #include "Meter.h" typedef enum ACPresence_ { AC_ABSENT, AC_PRESENT, AC_ERROR } ACPresence; extern int BatteryMeter_attributes[]; extern MeterClass BatteryMeter_class; #endif htop-2.1.0/COPYING0000644000175000001440000004450213152362772010451 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Appendix 2: Special exception concerning PLPA In the following exception, "PLPA" means (i) code released by the Portable Linux Processor Affinity Project, or (ii) derivative works of such code, in both cases provided that the code is covered entirely by free software licensing terms. As a special exception to the GNU GPL, the licensors of htop give you permission to combine GNU GPL-licensed code in htop (and derivative works of such code) with PLPA. You may copy and distribute such a combined work following the terms of the GNU GPL for htop and the applicable licenses of the version of PLPA used in your combined work, provided that you include the source code of such version of PLPA when and as the GNU GPL requires distribution of source code. htop-2.1.0/MainPanel.c0000644000175000001440000001300213235653611011412 00000000000000/* htop - ColumnsPanel.c (C) 2004-2015 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "MainPanel.h" #include "Process.h" #include "Platform.h" #include "CRT.h" #include /*{ #include "Panel.h" #include "Action.h" #include "Settings.h" typedef struct MainPanel_ { Panel super; State* state; IncSet* inc; Htop_Action *keys; pid_t pidSearch; } MainPanel; typedef bool(*MainPanel_ForeachProcessFn)(Process*, size_t); #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) }*/ static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL}; void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) { FunctionBar* bar = MainPanel_getFunctionBar(this); if (mode) { FunctionBar_setLabel(bar, KEY_F(5), "Sorted"); FunctionBar_setLabel(bar, KEY_F(6), "Collap"); } else { FunctionBar_setLabel(bar, KEY_F(5), "Tree "); FunctionBar_setLabel(bar, KEY_F(6), "SortBy"); } } void MainPanel_pidSearch(MainPanel* this, int ch) { Panel* super = (Panel*) this; pid_t pid = ch-48 + this->pidSearch; for (int i = 0; i < Panel_size(super); i++) { Process* p = (Process*) Panel_get(super, i); if (p && p->pid == pid) { Panel_setSelected(super, i); break; } } this->pidSearch = pid * 10; if (this->pidSearch > 10000000) { this->pidSearch = 0; } } static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { MainPanel* this = (MainPanel*) super; HandlerResult result = IGNORED; Htop_Reaction reaction = HTOP_OK; if (EVENT_IS_HEADER_CLICK(ch)) { int x = EVENT_HEADER_CLICK_GET_X(ch); ProcessList* pl = this->state->pl; Settings* settings = this->state->settings; int hx = super->scrollH + x + 1; ProcessField field = ProcessList_keyAt(pl, hx); if (field == settings->sortKey) { Settings_invertSortOrder(settings); settings->treeView = false; } else { reaction |= Action_setSortKey(settings, field); } reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS; result = HANDLED; } else if (ch != ERR && this->inc->active) { bool filterChanged = IncSet_handleKey(this->inc, ch, super, (IncMode_GetPanelValue) MainPanel_getValue, NULL); if (filterChanged) { this->state->pl->incFilter = IncSet_filter(this->inc); reaction = HTOP_REFRESH | HTOP_REDRAW_BAR; } if (this->inc->found) { reaction |= Action_follow(this->state); reaction |= HTOP_KEEP_FOLLOWING; } result = HANDLED; } else if (ch == 27) { return HANDLED; } else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) { reaction |= (this->keys[ch])(this->state); result = HANDLED; } else if (isdigit(ch)) { MainPanel_pidSearch(this, ch); } else { if (ch != ERR) { this->pidSearch = 0; } else { reaction |= HTOP_KEEP_FOLLOWING; } } if (reaction & HTOP_REDRAW_BAR) { MainPanel_updateTreeFunctions(this, this->state->settings->treeView); IncSet_drawBar(this->inc); } if (reaction & HTOP_UPDATE_PANELHDR) { ProcessList_printHeader(this->state->pl, Panel_getHeader(super)); } if (reaction & HTOP_REFRESH) { result |= REDRAW; } if (reaction & HTOP_RECALCULATE) { result |= RESCAN; } if (reaction & HTOP_SAVE_SETTINGS) { this->state->settings->changed = true; } if (reaction & HTOP_QUIT) { return BREAK_LOOP; } if (!(reaction & HTOP_KEEP_FOLLOWING)) { this->state->pl->following = -1; Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOCUS]); } return result; } int MainPanel_selectedPid(MainPanel* this) { Process* p = (Process*) Panel_getSelected((Panel*)this); if (p) { return p->pid; } return -1; } const char* MainPanel_getValue(MainPanel* this, int i) { Process* p = (Process*) Panel_get((Panel*)this, i); if (p) return p->comm; return ""; } bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, size_t arg, bool* wasAnyTagged) { Panel* super = (Panel*) this; bool ok = true; bool anyTagged = false; for (int i = 0; i < Panel_size(super); i++) { Process* p = (Process*) Panel_get(super, i); if (p->tag) { ok = fn(p, arg) && ok; anyTagged = true; } } if (!anyTagged) { Process* p = (Process*) Panel_getSelected(super); if (p) ok = fn(p, arg) && ok; } if (wasAnyTagged) *wasAnyTagged = anyTagged; return ok; } PanelClass MainPanel_class = { .super = { .extends = Class(Panel), .delete = MainPanel_delete }, .eventHandler = MainPanel_eventHandler }; MainPanel* MainPanel_new() { MainPanel* this = AllocThis(MainPanel); Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(MainFunctions, NULL, NULL)); this->keys = xCalloc(KEY_MAX, sizeof(Htop_Action)); this->inc = IncSet_new(MainPanel_getFunctionBar(this)); Action_setBindings(this->keys); Platform_setBindings(this->keys); return this; } void MainPanel_setState(MainPanel* this, State* state) { this->state = state; } void MainPanel_delete(Object* object) { Panel* super = (Panel*) object; MainPanel* this = (MainPanel*) object; Panel_done(super); IncSet_delete(this->inc); free(this->keys); free(this); }