goaccess-1.3/0000755000000000000000000000000013375711133010117 500000000000000goaccess-1.3/ChangeLog0000644000000000000000000010713713375675155011637 00000000000000Changes to GoAccess 1.3 - Friday, November 23, 2018 - Added ability to store accumulated processing time into DB_GEN_STATS tcb file via '--accumulated-time' command line option. - Added additional Apache status codes to the list. - Added a few feed readers to the list. - Added 'Android 8 Oreo' to the list of OSs. - Added 'Android Pie 9' to the list of OSs. - Added --anonymize-ip command line option to anonymize ip addresses. - Added --browsers-file command line option to load a list of crawlers from a text file. - Added byte unit (PiB) to C formatter and refactored code. - Added byte unit (PiB) to JS formatter. - Added Chinese translation (i18n). - Added French translation (i18n). - Added '%h' date specifier to the allowed date character specifiers. - Added "HeadlessChrome" to the list of browsers. - Added --hide-referer command line option to hide referers from report. - Added HTTP status code 429 (TOO MANY REQUESTS). - Added IGNORE_LEVEL_PANEL and IGNORE_LEVEL_REQ definitions. - Added --ignore-referer-report command line option to hide referers from output. - Added Japanese translation (i18n). - Added macOS 10.14 Mojave to the list of OSs. - Added "Mastodon" user-agent to the list of crawlers/unix-like. - Added new fontawesome icons and use angle arrows in HTML paging. - Added new purple theme to HTML report and default to it. - Added --no-parsing-spinner command line option to switch off parsing spinner. - Added .ogv and ogg static file extension (ogg video, Ogg Vorbis audio). - Added OS X version numbers when outputting with --real-os. - Added parsing mechanism in an attempt capture more bots and to include unspecified bots/crawlers. - Added --pidfile command line option to the default config file. - Added Spanish translation (i18n). - Added SSL support for Docker goaccess build. - Added support to the WebSocket server for openssl-1.1*. - Added the ability to show/hide a chart per panel in the HTML report. - Added transparency to the navigation bar of the HTML report. - Added "WhatsApp" user-agent to the list of crawlers. - Changed default db folder so it adds the process id (PID). --db-path is required now when using --load-from-disk. - Changed Dockerfile to build from the current source. - Changed 'hits' to be right-aligned on TUI. - Changed to use faster slide animations on HTML report. - Changed wording from 'Bandwidth' to the proper term 'Tx. Amount'. - Ensure database filenames used by btree are less predictable. - Ensure HTML templates, CSS and JS files are minified when outputting report. - Ensure key phrases from Google are added even when https is used. - Ensure live report updates data & charts if tab/document has focus. - Ensure multiple 'Yandex' crawlers are properly parsed. - Ensure Safari has priority over most crawlers except the ones that are known to have it. - Ensure the request protocol on its own is properly parsed. - Ensure the right number of tests are performed against the given log. - Ensure user configuration is parsed first when available. - Ensure wss:// is used when connecting via HTTPS. - Ensure XFF parser takes into account escaped braces. - Fixed a regression where fifo-in/out would fail with ENXIO. - Fixed a regression where it would return EXIT_FAILURE on an empty log. - Fixed a (ssh) pipeline problem with fgetline()/fgets() when there is a race for data on stdin. - Fixed broken X-Forwarded-For (XFF) %~ specifier in certain parsing cases. - Fixed conf.filenames duplication problem if logs are via pipe. - Fixed float percent value on JSON/HTML output for locales using decimal comma. - Fixed issue where it was not possible to establish a Web Socket connection when attempting to parse and extract HTTP method. - Fixed issue where log formats with pipe delimiter were not propely parsed. - Fixed memory leak after config file path has been set (housekeeping). - Fixed memory leak when adding host to holder introduced in c052d1ea. - Fixed possible memory leak when hiding specific referrers. - Fixed several JS jshint warnings. - Fixed sudo installs on TravisCI. - Fixed UNDEFINED time range in HTML report when VISITORS panel was ignored. - Fixed unnecessary closing span tags from template. - Fixed use-after-free when two color items were found on color_list. Changes to GoAccess 1.2 - Tuesday, March 07, 2017 - Added a Dockerfile. - Added Amazon S3 bucket name as a VirtualHost (server block). - Added a replacement for GNU getline() to dynamically expand line buffer while maintaining real-time output. - Added --daemonize command line option to run GoAccess as daemon. - Added several improvements to the HTML report on small-screen devices. - Added option to the HTML report to auto-hide tables on small-screen devices. - Added --process-and-exit command line option to parse log and exit. - Added several feed readers to the list of browsers. - Added "-" single dash per convention to read from the standard input. - Added support for MaxMind GeoIP2. - Added the ability to read and follow from a pipe such as "tail -f access.log | goaccess -" - Added the ability to specify multiple logs as input sources, e.g.: "goaccess access.log access.log.1" while maintaining real-time output. - Added time unit (seconds) to the processed time label in the HTML/terminal output. - Added visitors' percent column to the terminal dashboard. - Changed D3 charts to dim Y-axis on mouseover. - Changed D3 charts to reflect HTML column sort. - Changed D3 charts to render only if within the viewport. This improves the overall real-time HTML performance. - Changed HTML report tables to render only if within the viewport. - Changed percentage calculation to be based on the total within each panel. - Ensure start/end dates are updated real-time in the HTML output. - Ensure "window.location.hostname" is used as the default WS server host. In most cases, this should avoid the need for specifying "--ws-url=host". Simply using "--real-time-html" should suffice. - Fixed issue on HTML report to avoid outputting scientific notation for all byte sizes. - Fixed integer overflow when calculating bar graph length on terminal output. - Fixed issue where global config file would override command line arguments. - Fixed issue where it wouldn't allow loading from disk without specifying a file when executed from the cron. - Fixed issue where parser couldn't read some X-Forwarded-For (XFF) formats. Note that this breaks compatibility with the original implementation of parsing XFF, but at the same time it gives much more flexibility on different formats. - Fixed issue where specifying fifo-in/out wouldn't allow HTML real-time output. - Fixed issue where the wrong number of parsed lines upon erroring out was displayed. - Fixed issue where the WebSocket server prevented to establish a connection with a client due to invalid UTF-8 sequences. - Fixed percent issue when calculating visitors field. - Updated the list of crawlers. Changes to GoAccess 1.1.1 - Wednesday, November 23, 2016 - Added data metric's "unique" count on each panel to the JSON/HTML outputs. - Changed D3 bar charts to use .rangeBands and avoid extra outer padding. - Fixed mouseover offset position issue on D3 bar charts. - Fixed possible heap overflow when an invalid status code was parsed and processed. This also ensures that only valid HTTP status codes are parsed >=100 or <= 599. - Fixed sluggish D3 chart re-rendering by changing how x-axis labels are displayed in the HTML report. Changes to GoAccess 1.1 - Tuesday, November 08, 2016 - Added a new layout to the HTML report and additional settings and changes. - Added --crawlers-only command line option to display crawlers/bots only. - Added --fifo-in and --fifo-out command line options to set websocket FIFO reader/writer. - Added --no-html-last-updated command line option. - Added --num-tests command line option. - Added --html-prefs command line option to to set default preferences for the HTML report. - Added "Amazon S3" Log Format to the list of predefined options. - Added "Android 7.1 Nougat" to the list of OSs. - Added "Android Marshmallow 6.0.1" to the list of OSs. - Added "Android Nougat 7.0" to the list of OSs. - Added "Feed Wrangler" to the list of feeds. - Added "Go-http-client" to the list of browsers. - Added "MicroMessenger" (WeChat) to the list of browsers. - Added "SemrushBot" to the list of crawlers. - Added "Remote User" panel to capture HTTP authentication requests. Use %e within the log-format variable to enable this panel. - Added tebibyte unit to the byte to string function converter. - Added the ability to parse reverse proxy logs that have multiple IPs. This adds the ability to parse the "X-Forwarded-For" field in a reverse proxy setup. - Added the ability to show which token didn't match log/date/time pattern. This also ensures that in the absence of data, its output is not treated as error but instead it produces an empty report. - Added the ability to specify a WebSocket protocol (ws|wss) through --ws-url. - Added the request query string to the W3C format. - Added TLS/SSL support to the HTML real-time report. - Changed browser classification for Google Cloud Clients. - Changed how "Darwin" OS was reported to display AppName instead. - Changed default W3C log format to use the URL path instead of full request. - Changed HTML default number of items on each table to 7. - Changed request parser to allow empty query strings. - Changed default HTML output theme to darkBlue. - Ensure every version of iOS is broken down under the OS panel. - Ensure latest JSON data is fast-forwarded when connection is opened. GoAccess now sends the latest JSON data to the client as soon as the WebSocket connection is opened. - Ensure localStorage is supported and enabled in the HTML report - Ensure unknown coutries/continents are listed. - Fixed D3 chart width overflow issue on Edge. - Fixed integer to string key conversion for unique visitors. This fixes the issue where resulting keys would collide with existing keys and thus not keeping the right visitors count on certain panels. - Fixed memory leak when unable to URL decode %q specifier. - Fixed memory leak when unable to URL decode %U specifier. - Fixed month name abbreviation on app.js. - Fixed percentage integer overflow with large numbers on 32bits platforms. - Fixed percent calculation due to integer division rounding to zero. - Fixed possible code injection when outputting an HTML report. - Fixed segfault when using options -H or -M without an argument. - Removed timestamp from the HTML report title tag. Changes to GoAccess 1.0.2 - Tuesday, July 05, 2016 - Added minor changes to the HTML report stylesheet. - Added the ability to specify the WebSocket port within --ws-url. - Added the proper byte swap functions used by Sun Solaris. - Added the proper default --http-method/protocol values on the config file. - Changed bar transition to scale delay dynamically to the length of the dataset. - Fixed build issue on platforms lacking of open_memstream() by refactoring the JSON module to use its own memory buffer. - Fixed issue where the server wouldn't send cached buffer to slow clients. - Fixed OS X build check of ncursesw. - Implemented a throttle mechanism for slow clients to avoid caching too much data on the server-side. - Removed flickering on D3 line and bar chart redraw. Changes to GoAccess 1.0.1 - Friday, June 17, 2016 - Added Android version number along with the codename when using --real-os, e.g., "Lollipop 5.1". - Added some missing headers and function checks to configure.ac. - Fixed a regression where it wouldn't allow abbreviated date and time formats such as %F or %T. - Fixed build issues on systems running GLIBC older than 2.9, such as RHEL <= 5. - Fixed issue where it wouldn't send the whole buffer to a socket causing the real-time-html WebSocket server to progressively consume a lot more memory. - Fixed memory leak when using getline and follow mode enabled. - Fixed some buffer initialization issues on read_line() and perform_tail_follow(). - Fixed uint types in sha1 files. Changes to GoAccess 1.0 - Thursday, June 09, 2016 - Added --enable-panel= command line option to display the given module. - Added --json-pretty-print command line option to output pretty json. - Added --log-format= command-line shortcuts for standard log formats. - Added --origin command line option to match the origin WebSocket header. - Added --output= as a shortcut to --output-format. - Added a complete real-time functionality to the HTML output. - Added an option to set the max number of items to show per panel. - Added D3 Visualziations to the HTML dashboard. - Added metadata metrics to the each of the panels (JSON output) - Added option to specify time distribution specificity. - Added the ability to download a JSON file from the HTML report. - Added the ability to output multiple formats on a single log parse. - Added the ability to set the date specificity in hours. - Added the ability to sort all HTML tables on all panels. - Added the ability to specify a custom CSS and JS file to the HTML report. - Added user-agents to the JSON output per each host. - Added "Vivaldi" to the list of browsers. - Bootstrapify the HTML dashboard. - Changed configure.ac to use LDFLAGS instead of CFLAGS where applicable. - Changed default terminal color scheme to 256 Monokai if terminal supports 256 colors. - Changed GoAccess license to The MIT License (MIT) - Changed the visitors panel to display its dates continuously instead of top. - Default to 256 Monokai color scheme if terminal supports 256 colors. - Default to display HTTP method/protocol (if applicable). - Display the children's Max. T.S. as the parent's top Max. T.S. - Ensure the parent's Avg. T.S. displays parent's Cum. T.S. over parent's Hits. - Fixed color issue when switching from the color scheme dialog. - Fixed cross platform build issue when ncurses is built with and without termlib=tinfo. - Fixed curses header window issue where it wouldn't clear out on small window sizes. - Fixed issue where tail mode wouldn't parse full lines using getline(). - Fixed minor background color issue when using ncurses 6. - Fixed possible division by zero when calculating percentage. - Fixed singly link list node removal. - Fixed still reachable memory leak on GeoIP cleanup (geoip legacy >= 1.4.7). - Fixed various Valgrind's still reachable memory leaks. - Removed -Wredundant-decls. Changes to GoAccess 0.9.8 - Monday, February 29, 2016 - Added a more complete list of static extensions to the config file. - Added "Android 6.0 Marshmallow" to the list of OSs. - Added --no-tab-scroll command line option to disable scroll through panels on TAB. - Added the first and last log dates to the overall statistics panel. - Ensure GoAccess links correctly against libtinfo. - Ensure static content is case-insensitive verified. - Fixed bandwidth overflow issue (numbers > 2GB on non-x86_64 arch). - Fixed broken HTML layout when html-method/protocol is missing in config file. - Refactored parsing and display of available modules/panels. Changes to GoAccess 0.9.7 - Monday, December 21, 2015 - Added "Squid native" log format to the config file. - Fixed integer overflow when getting total bandwidth using the on-disk storage. - Fixed issue where a timestamp was stored as date under the visitors panel. - Fixed issue where config dialog fields were not cleared out on select. - Fixed issue where "Virtual Hosts" menu item wasn't shown in the HTML sidebar. Changes to GoAccess 0.9.6 - Tuesday, October 27, 2015 - Added --dcf command line option to view the default config file path. - Added --ignore-status the ability to ignore parsing status codes. - Added "Darwin" to the list of OSs. - Fixed segfault when appending data to a log (follow) without virtualhosts. Changes to GoAccess 0.9.5 - Thursday, October 22, 2015 - Added major performance improvements to the default storage when parsing and storing data (~%44 less memory, ~37% faster). - Added the ability to parse virtual hosts and a new panel to display metrics per virtual host. - Added the ability to parse HTTP/2 requests. - Added the ability to use GNU getline() to parse full line requests. - Added the ability to output debug info if a log file is specified, even without --enable-debug. - Added OS X "El Capitan". - Added WebDav HTTP methods and HTTP status from RFC 2518 and RFC 3253. - Fixed detection of some Googlebots. - Fixed issue where time served metrics were not shown when loading persisted data. - Fixed linker error on OSX: ld: library not found for -lrt. - Fixed percentage on the HTML output when excluding IPs. - Removed GLib dependency and refactored storage functionality. By removing this dependency, GoAccess is able to store data in a more efficient manner, for instance, it avoids storing integer data as void* (generic typing), thus greatly improving memory consumption for integers. Changes to GoAccess 0.9.4 - Tuesday, September 08, 2015 - Added --all-static-files command line option to parse static files containing a query string. - Added --invalid-requests command line option to log invalid requests to a file. - Added additional overall metric - total valid requests. - Added "%~" specifier to move forward through a log string until a non-space char is found. - Added the ability to parse native Squid access.log format. - Fixed a few issues in the configuration script. - Fixed inability to parse color due to a missing POSIX extension. "ERR:Invalid bg/fg color pairs" Changes to GoAccess 0.9.3 - Wednesday, August 26, 2015 - Added --no-column-names command line option to disable column name metrics. - Added a default color palette (Monokai) to the config file. - Added AWS Elastic Load Balancing to the list of predefined log/date/time formats. - Added CloudFlare status codes. - Added column headers for every enabled metric on each panel. - Added cumulative time served metric. - Added "DragonFly" BSD to the list of OSs. - Added maximum time served metric (slowest running requests). - Added "Slackbot" to the list of crawlers/browsers. - Added the ability to parse the query string specifier "%q" from a log file. - Added the ability to process logs incrementally. - Added the ability to set custom colors on the terminal output. - Disabled REFERRERS by default. - Ensure bandwidth metric is displayed only if %b specifier is parsed. - Fixed issue where the --sort-panel option wouldn't sort certain panels. - Fixed several compiler warnings. - Set predefined static files when no config file is used. - Updated "Windows 10" user agent from 6.4 (wrong) to 10.0.(actual) Changes to GoAccess 0.9.2 - Monday, July 06, 2015 - Added ability to fully parse browsers that contain spaces within a token. - Added multiple user agents to the list of browsers. - Added the ability to handle time served in milliseconds as a decimal number `%L`. - Added the ability to parse a timestamp in microseconds. - Added the ability to parse Google Cloud Storage access logs. - Added the ability to set a custom title and header in the HTML report. - Added "%x" as timestamp log-format specifier. - Ensure agents" hash table is destroyed upon exiting the program. - Ensure "Game Systems" are processed correctly. - Ensure visitors panel header is updated depending if crawlers are parsed or not. - Fixed issue where the date value was set as time value in the config dialog. - Fixed memory leak in the hits metrics when using the in-memory storage (GLib). Changes to GoAccess 0.9.1 - Tuesday, May 26, 2015 - Added --hl-header command line option to highlight active panel. - Added "Applebot" to the list of web crawlers. - Added "Microsoft Edge" to the list of browsers. - Added additional Nginx-specific status codes. - Ensure dump_struct is used only if using __GLIBC__. - Ensure goaccess image has an alt attribute on the HTML output for valid HTML5. - Ensure the config file path is displayed when something goes wrong (FATAL). - Ensure there is a character indicator to see which panel is active. - Fixed Cygwin compile issue attempting to use -rdynamic. - Fixed issue where a single IP did not get excluded after an IP range. - Fixed issue where requests showed up in the wrong view even when --no-query-string was used. - Fixed issue where some browsers were not recognized or marked as "unknown". - Fixed memory leak when excluding an IP range. - Fixed overflows on sort comparison functions. - Fixed segfault when using on-disk storage and loading persisted data with -a. - Removed keyphrases menu item from HTML output. - Split iOS devices from Mac OS X. Changes to GoAccess 0.9 - Thursday, March 19, 2015 - Added --geoip-database command line option for GeoIP Country/City IPv6. - Added "Windows 10 (v6.4)" to the real windows user agents. - Added ability to double decode an HTTP referer and agent. - Added ability to sort views through the command line on initial load. - Added additional data values to the backtrace report. - Added additional graph to represent the visitors metric on the HTML output. - Added AM_PROG_CC_C_O to configure.ac - Added "Android Lollipop" to the list of operating systems. - Added "average time served" metric to all panels. - Added "bandwidth" metric to all panels. - Added command line option to disable summary metrics on the CSV output. - Added numeric formatting to the HTML output to improve readability. - Added request method specifier to the default W3C log format. - Added the ability to ignore parsing and displaying given panel(s). - Added the ability to ignore referer sites from being counted. A good case scenario is to ignore own domains. i.e., owndomain.tld. This also allows ignoring hosts using wildcards. For instance, *.mydomain.tld or www.mydomain.* or www?.mydomain.tld - Added time/hour distribution module. e.g., 00-23. - Added "visitors" metrics to all panels. - Changed AC_PREREQ macro version so it builds on old versions of autoconf. - Changed GEOIP database load to GEOIP_MEMORY_CACHE for faster lookups. - Changed maximum number of choices to display per panel to 366 fron 300. - Ensure config file is read from home dir if unable to open it from %sysconfdir% path. - Fixed array overflows when exceeding MAX_* limits on command line options. - Fixed a SEGFAULT where sscanf could not handle special chars within the referer. - Fixed character encoding on geolocation output (ISO-8859 to UTF8). - Fixed issue on wild cards containing "?" at the end of the string. - Fixed issue where a "Nothing valid to process" error was triggered when the number of invalid hits was equal to the number of valid hits. - Fixed issue where outputting to a file left a zero-byte file in pwd. - Improved parsing of operating systems. - Refactored log parser so it allows with ease the addition of new modules. This also attempts to decouple the core functionality from the rendering functions. It also gives the flexibility to add children metrics to root metrics for any module. e.g., Request A was visited by IP1, IP2, IP3, etc. - Restyled HTML output. Changes to GoAccess 0.8.5 - Sunday, September 14, 2014 - Fixed SEGFAULT when parsing a malformed request that doesn't have HTTP status. Changes to GoAccess 0.8.4 - Monday, September 08, 2014 - Added --444-as-404 command line option to handle nginx non-standard status code 444 as 404. - Added --4xx-to-unique-count command line option to count client errors (4xx) to the unique visitors count. Now by default it omits client errors (4xx) from being added to the unique visitors count as they are probably not welcomed visitors. 4xx errors are always counted in panels other than visitors, OS & browsers. - Added and updated operating systems, and browsers. - Added excluded IP hits count to the general statistics panel on all reports. - Added HTTP nonstandard code "444" to the status code list. - Fixed compile error due to missing include for type off_t (gcc 4.1). - Fixed issue when excluding IPv4/v6 ranges. - Removed request status field restriction. This allows parsing logs that contain only a valid date, IPv4/6 and host. Changes to GoAccess 0.8.3 - Monday, July 28, 2014 - Fixed SEGFAULT when parsing a CLF log format and using --ignore-crawlers. - Fixed parsing conflict between some Opera browsers and Chrome. - Fixed parsing of several feed readers that are Firefox/Safari-based. - Fixed Steam detection. - Added Huawei to the browser's list and removed it from the OS's list. Changes to GoAccess 0.8.2 - Monday, July 20, 2014 - Added --version command line option. - Added --ignore-crawlers command line option to ignore crawlers. - Added ability to parse dates containing whitespaces in between, e.g., "Jul 15 20:13:59" (syslog format). - Added a variety of browsers, game systems, feed readers, and podcasts. - Added missing up/down arrows to the help section. - Added the ability to ignore multiple IPv4/v6 and IP ranges. - Added the PATCH method according to RFC 5789. - Fixed GeoLocation percent issue for the JSON, CSV and HTML outputs. - Fixed memory leak when excluding one or multiple IPs. Changes to GoAccess 0.8.1 - Monday, June 16, 2014 - Added ability to add/remove static files by extension through the config file. - Added ability to print backtrace on segmentation fault. - Escaped JSON strings correctly according to [RFC4627]. - Fixed encoding issue when extracting keyphrases for some HTTP referers. - Fixed issue where HTML bar graphs were not shown due to numeric locale. - Fixed issue with URIs containing "\r?\n" thus breaking the corresponding output. - Make sure request string is URL decoded on all outputs. Changes to GoAccess 0.8 - Tuesday, May 20, 2014 - Added APT-HTTP to the list of browsers. - Added data persistence and ability to load data from disk. - Added IE11 to the list of browsers. - Added IEMobile to the list of browsers. - Added multiple command line options. - Added Nagios check_http to the list of browsers. - Added parsing progress metrics - total requests / requests per second. - Added the ability to parse a GeoLiteCity.dat to get the city given an IPv4. - Changed the way the configuration file is parsed. This will parse all configuration options under ~/.goaccessrc or the specified config file and will feed getopt_long with the extracted key/value pairs. This also allows the ability to have comments on the config file which won't be overwritten. - Ensure autoconf determines the location of ncurses headers. - Fixed issue where geo_location_data was NULL. - Fixed issue where GoAccess did not run without a tty allocated to it. - Fixed potential memory leak on --log-file realpath(). - Fixed Solaris build errors. - Implemented an on-memory hash database using Tokyo Cabinet. This implementation allows GoAccess not to rely on GLib's hash table if one is needed. - Implemented large file support using an on-disk B+ Tree database. This implementation allows GoAccess not to hold everything in memory but instead it uses an on-disk B+ Tree database. - Trimmed leading and trailing whitespaces from keyphrases module. Changes to GoAccess 0.7.1 - Monday, February 17, 2014 - Added --no-color command line option to turn off color output. - Added --real-os command line option to get real OS names, e.g., "Android, Windows, Mac". - Added ability to log debug messages to a file. - Added ability to parse tab-separated log format strings. - Added ability to support terminals without colors. - Added command line option to append HTTP method to request. - Added command line option to append HTTP protocol to request. - Added long options to command-line. - Added missing "Win 9x 4.90" (Windows Me) user-agent. - Added missing Windows RT user-agent. - Ensure mouse click does not reset expanded module if it is the same. - Fixed Amazon CloudFront tab-separated log format. - Fixed "FreeBSD style" ncursesw built into system. - Fixed HTML report issue where data cell would not wrap. - Fixed issue when isatty() could not find a valid file descriptor. - Fixed SymbianOS user-agent and retrieve its version. Changes to GoAccess 0.7 - Monday, December 15, 2013 - Added a command line option to ignore request query strings. - Added additional compiler flags & fixed several warnings. - Added additional static file extensions. - Added country per IP to HOSTS module (HTML & JSON). - Added DEBUG mode to Makefile & -O2 to default release. - Added GEOLOCATION report to all outputs - includes continents/countries. - Added IP resolver to HTML and JSON output. - Added module numbers to each module header. - Added the ability to output JSON and CSV. - Added Windows NT 6.3 (Win 8.1) to the list. - Fixed buffer overflow issue with realpath. - New HTML report - HTML5 + CSS styles. - Properly split request line into the three request modules. Changes to GoAccess 0.6.1 - Monday, October 07, 2013 - Added active module indication by name. - Added additional crawlers to the list. - Added custom configuration file option. - Added human-readable string when unable to open log. - Added missing include when compiling on OSX 10.6. - Added optional mouse support to the main dashboard. - Added the ability to select active module by number (keys). - Added the rest of HTTP methods according to RFC2616. - Changed referring site sscanf format to process multiple URLs. - Changed the default color scheme to monochrome. - Fixed issue where %T was not processing floating-point numbers. - Fixed percentage issue for browsers and os modules. - Fixed SIGSEGV when reading from stdin to stdout. - Improved performance when expanding a module. - Reduced memory consumption by decreasing number of dns threads. - Removed ^UP/^DOWN due to a key mapping conflict. Changes to GoAccess 0.6 - Monday, July 15, 2013 - Added a bunch of minor fixes and changes. - Added and updated list of browsers and operating systems. - Added a predefined log format/date for the Amazon CloudFront (Download Distribution). - Added parsing/processing indicators. - Added the ability to independently sort each module. - Added the ability to search across the whole dashboard with the option to use regular expressions. - Config window now accepts [ENTER] to continue or F10. - Fixed issue where Opera +15 was identified as Chrome. - Implemented the ability to parse the time taken to serve the request, in microseconds and seconds. - Improved memory usage and better performance in general. - Moved away from the original pop-up UI to a new expandable dashboard allowing data to be processed in real-time. - Sanitized HTML output with html entities for special chars. - Updated the hosts module so it shows the reverse DNS as a sub node. Changes to GoAccess 0.5 - Monday, June 04, 2012 - Added ability to output a full stats report to a file. - Added a key shortcut to scroll top/bottom. - Added a new include sys/socket.h - BSD - Added support for IPv6 - Added the ability to parse a custom format string. - Fixed google cache key-phrases. - Fixed issue on empty Google query strings. - Fixed issue on Opera agents where version was not recognized correctly. - Fixed other minor fixes and changes. Changes to GoAccess 0.4.2 - Monday, January 03, 2011 - Added UTF-8 support. Now it should handle properly wide-character/UTF-8. Run ./configure --enable-utf8 - Fixed a minor bug when adding monthly totals on visitors subwin. - Removed -lrt since GoAccess does not link to librt. (OS X doesn't include librt) Changes to GoAccess 0.4.1 - Monday, December 13, 2010 - Added more flexibility when resizing the terminal. Should work fine with the standard 80x24. - Added the ability to pass a flag to ./configure so GeoIP can be enabled if needed. - Implemented a pipeline from stdin, so the input doesn't have to be only a file. Changes to GoAccess 0.4 - Tuesday, November 30, 2010 - Added graphs to the unique_visitors subwin. - Implemented bandwidth per day, and host. - Implemented list of agents for specific hosts. - Rewrote hash tables iterative code to avoid the use of GHashTableIter, this way it works with all GLib > 2.0.0. - Various bug fixes and code cleanups (mainly in the subwin modules). Changes to GoAccess 0.3.3 - Monday, September 27, 2010 - Changed tarball's filename. - Fixed a request size parsing issue. Due to malformed syntax on the HTTP protocol, bandwidth was reset to 0. Ex. "HEAD /" 400 20392 - Fixed a segfault when goaccess was executed without any options but with an additional unknown argument. Changes to GoAccess 0.3.2 - Thursday, September 09, 2010 - Fixed an agent parsing issue. As a result, operating systems were not properly counted. Changes to GoAccess 0.3.1 - Friday, September 03, 2010 - Added a color scheme implementation Changes to GoAccess 0.3 - Sunday, August 29, 2010 - Added a counter for total requests since initial parse was implemented - Added a more detailed and comprehensive browser and os report - Added bandwidth details for requested files - Added percentage details on modules 2, 3, 4, 5, 10, 11 - Code cleanups - Fixed a potential segmentation fault when resizing main window - Fixed a segmentation fault on pop-up window search if haystack was null - Fixed invalid entries when parsing status codes - Implemented a real support for LFS - Handles files larger than 2 GiB on 32-bit systems - Implemented support for "vhost_combined" log format - Changed position of data/graphs depending on # of hits Changes to GoAccess 0.2 - Sunday, July 25, 2010 - Added a keyphrases report coming from Google search engine. This includes, raw, cache, and translation queries. - Fixed a memory leak when invalid entries were parsed - Fixed a potential buffer overflow. - Implemented real-time statistics (RTS). Data will be appended as the log file grows. Equivalent to "tail -f" on Unix systems - Implemented screen resize functionality - Simpliflied creation of the "unique visitors" hash-key. - Simpliflied the "process_unique_data" function - Various small speed increases & code cleanup Changes to GoAccess 0.1.2 - Monday, July 12, 2010 - Fixed a segmentation fault when parsing logs with unusual request type. Ex. "GET HTTP/1.1 HTTP/1.1" Changes to GoAccess 0.1.1 - Saturday, July 10, 2010 - Added an enhanced error handling - Added an extra macro on configure.ac to check against GHashTableIter. ./configure might not check for glib 2.16 that introduced "GHashTableIter". - Added Glibc LFS - Cleaned up code a little bit - Fixed a segmentation fault when displaying the help text on x86_64. - Fixed assignments in conditions. In case the assignment is actually intended put extra parenthesis around it. This will shut GCC (and others) up. - Fixed casts associated with "g_hash_table_iter_next". - Fixed comparison between signed and unsigned integer types. - Fixed function declarations. - Fixed includes. - Fixed two format strings. (If the error was ever triggered, it'd most likely lead to a segfault) Changes to GoAccess 0.1 - Tuesday, July 06, 2010 - Initial release 0.1 goaccess-1.3/resources/0000755000000000000000000000000013375711133012131 500000000000000goaccess-1.3/resources/tpls.html0000644000000000000000000002563413375661415013742 00000000000000 goaccess-1.3/resources/css/0000755000000000000000000000000013375711133012721 500000000000000goaccess-1.3/resources/css/app.css0000644000000000000000000004324213375705732014150 00000000000000/* GLOBAL */ html, body { background: #f0f0f0; overflow-x: hidden; } h1 { font-weight: bold; letter-spacing: -3px; } h3 { font-size: 21px; letter-spacing: -1px; } .page-header { border-bottom: 1px solid rgba(0, 0, 0, 0.15); margin: 25px 0 20px; position: relative; } .page-header h1 { margin: 0; } .pagination { margin: 5px 0; } .clickable, .expandable>td { cursor: pointer; } .spinner { color: #999; left: 50%; position: absolute; top: 50%; } .powered { bottom: 190px; color: #9E9E9E; font-size: smaller; position: absolute; right: 20px; transform-origin: 100% 0; transform: rotate(-90deg); } .powered a { color: #636363; } .powered span { color: #007bc3; } .dropdown-header { color: #007bc3; padding: 3px 25px; text-transform: uppercase; } .gheader { letter-spacing: -1px; text-transform: uppercase; } h5.gheader { letter-spacing: 0; } .panel-header h4.gheader { margin-top: 20px; } .panel-header .gheader small { font-size: 69%; } /* NAVIGATION */ nav { -webkit-transition: left .2s; background: #1C1C1C; border-right: 3px solid #5bc0de; height: 100%; left: -236px; overflow: hidden; position: fixed; top: 0; transition: left .2s; width: 300px; z-index: 2; } nav .nav-list { height: 100%; overflow-y: auto; width: 350px; } nav header { margin: 40px 20px 30px; } nav header a { color: rgba(240,240,240,.7); font-size: 2.7em; font-weight: 300; text-transform: uppercase; } nav header a:hover { color: #eee; } nav.active { display: block !important; left: 0; opacity: .97; } nav:hover ~ #content { opacity: .3; } nav.active .nav-bars, nav.active .nav-gears, nav.active .nav-ws-status { opacity: 0; } nav .nav-bars, nav .nav-gears, nav .nav-ws-status { -webkit-transition: opacity .2s; color: #9E9E9E; cursor: pointer; float: right; font-size: 36px; height: 32px; left: 13px; line-height: 32px; position: fixed; text-align: center; top: 30px; transition: opacity .2s; width: 32px; } nav .nav-gears { top: 100px; opacity: 0.6; } nav .nav-ws-status, .nav-ws-status.mini { color: #6A6A6A; cursor: help; display: none; font-size: 12px; } nav .nav-ws-status { left: 25px; top: 125px; } .nav-ws-status.mini { top: 14px; left: 50px; position: absolute; } .nav-ws-status.connected { color: #5DB56A; } nav li a { border-left: 3px solid transparent; color: rgba(200,200,200,.5); display: block; font-size: smaller; max-width: 235px; opacity: 0; overflow: hidden; padding: 9px 20px; text-overflow: ellipsis; text-transform: uppercase; transition: opacity .2s; white-space: nowrap; } nav.active li a { max-width: 100%; opacity: 1; } nav li a:hover, nav li.active a { background: rgba(0,0,0,.1); border-color: #5BC0DE; color: #eee; } nav ul { padding-left: 0; list-style: none; } /* Navigation -- Icon */ nav a, nav a:hover { text-decoration: none; } nav h3 { color: #FFF !important; font-size: medium; font-weight: bold; margin: 20px 25px 10px; text-transform: uppercase; } /* CONTAINER */ @media screen and (max-width: 767px) { .row-offcanvas { -webkit-transition: all .25s ease-out; -o-transition: all .25s ease-out; position: relative; transition: all .25s ease-out; } .row-offcanvas-right { right: 0; } .row-offcanvas-left { left: 0; } .row-offcanvas-right .sidebar-offcanvas { right: -50%; } .row-offcanvas-left .sidebar-offcanvas { left: -50%; } .row-offcanvas-right.active { right: 50%; } .row-offcanvas-left.active { left: 50%; } .sidebar-offcanvas { position: absolute; top: 0; width: 50%; }; } @media (min-width: 768px) { .container { width: 750px; }; } @media (max-width: 480px) { .wrap-general h5, .wrap-panel h5 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wrap-general h5 { width: 100% } .wrap-panel h5 { width: 70% } } .container-fluid { margin-left: 75px; } @media (min-width: 1120px) { .container { width: 970px; }; } @media (min-width: 1320px) { .container { width: 1170px; }; } @media (max-width: 992px) { .container-fluid { margin-left: auto; }; } @media (max-width: 768px) { .container-fluid { padding-left: 5px; padding-right: 5px; } .page-header { padding: 0 10px; } } /* PANEL STYLES */ .wrap-panel .panel-header { position: relative; } div.wrap-panel > div { background: #FFF; margin-top: 10px; padding: 0 10px; border-top: 1px solid rgba(0, 0, 0, 0.15); } /* PANEL TABLES */ .wrap-panel table.table-borderless tbody tr td, .wrap-panel table.table-borderless tbody tr th, .wrap-panel table.table-borderless thead tr th { border: none; } .wrap-panel table thead tr th { text-align: right; border-bottom-width: 1px; } .wrap-panel table .string, .wrap-panel table .date { text-align: left; } .wrap-panel table .percent { color: #898989; } .wrap-panel table td, .wrap-panel table th { white-space: nowrap; overflow: hidden; } .wrap-panel table th.sortable { cursor: pointer; } /* thead meta */ .wrap-panel table tbody.tbody-meta { border-top: 1px solid #C7C7C7; border-bottom: 1px solid #C7C7C7; } .wrap-panel table tbody.tbody-meta tr { background-color: #F1F1F1; color: #222; } .wrap-panel table tbody.tbody-meta small { font-size: 65%; } /* thead data */ .wrap-panel table tbody.tbody-data tr td { border-right: 1px solid #F1F1F1; font-size: smaller; } .wrap-panel table tbody.tbody-data td:last-child { border-right: none; } .wrap-panel table tbody.tbody-data td.row-idx { color: #898989; } .wrap-panel table>tbody+tbody { border-top-width: 1px; } .wrap-panel table tbody.tbody-data tr.shaded { background-color: #F7F7F7; } .wrap-panel table tbody.tbody-data tr. { background-color: #F7F7F7; } .wrap-panel table tbody.tbody-data tr.child td:nth-child(1), .wrap-panel table tbody.tbody-data tr.child td:nth-child(2) { border-right: none; } .wrap-panel table.table-hover>tbody>tr:hover { background-color: #EEE; } /* GENERAL */ .wrap-general { position: relative; } .report-title { background: #FFF; border-radius: 4px; bottom: -10px; color: #9E9E9E; font-size: small; padding: 0 10px; position: absolute; right: 0; z-index: 1; } .panel-plot-wrap { position: absolute; right: 0; top: 18px; } .col-title { font-size: 85%; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #FFF; white-space: nowrap; width: 100%; } .grid-module { background: #FFF; color: rgb(36, 36, 36); font-weight: normal; margin-top: 5px; padding: 7px; } .grid-module h3 { font-size: 25px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; } .grid-module.black { border-top: 4px solid #0F1214; } .grid-module.gray { border-top: 4px solid #9E9E9E; } .grid-module.red { border-top: 4px solid #FF303E; } .grid-module.blue{ border-top: 4px solid #00D4E1; } .grid-module.green { border-top: 4px solid #5DB56A; } @media (max-width: 767px) { .panel-plot-wrap { top: 10px; } .powered { bottom: 10px; left: 25px; transform: initial; } } /* CHARTS */ .chart-wrap { margin-bottom: 15px; position: relative; } svg { background-color: #fff; display: block; } .axis path { fill: transparent; stroke: black; shape-rendering: crispEdges; stroke-width: 1; } .grid.y .tick line, .grid.x .tick line { shape-rendering: crispEdges; stroke: #999; stroke-dasharray: 3 3; stroke-width: 1; } .axis.x .tick line, .axis.y0 .tick line, .axis.y1 .tick line, .grid.y .tick:first-child line { stroke: black; stroke-width: 1; shape-rendering: crispEdges; } .bars rect.bar { shape-rendering: crispEdges; } .rects rect { fill: transparent; } .area { opacity: 0.2; } .points { stroke: transparent; } line.indicator { fill: transparent; pointer-events: none; shape-rendering: crispEdges; stroke: #999; stroke-width: 1; } .area0, .bars.y0 .bar, .points.y0, rect.legend.y0 { fill: #447FB3; } .area1, .bars.y1 .bar, .points.y1, rect.legend.y1 { fill: #FF6854; } .line0, .line1 { fill: transparent; stroke-width: 1; } .line0 { stroke: #007BC3; } .line1 { stroke: #FF303E; } .axis text, .axis-label, text.legend { font: 10px sans-serif; } .axis-label.y0, .axis-label.y1 { text-anchor: end; } rect.legend { height: 10px; width: 10px; } .legend { cursor: pointer; } .wrap-text text { text-anchor: start!important; } /* CHART TOOLTIP */ .chart-tooltip-wrap { left: 0; pointer-events: none; position: absolute; top: 10px; z-index: 10; } .chart-tooltip { -moz-box-shadow: 7px 7px 12px -9px #777777; -webkit-box-shadow: 7px 7px 12px -9px #777777; background-color: #fff; border-collapse: collapse; border-spacing: 0; box-shadow: 7px 7px 12px -9px #777777; empty-cells: show; opacity: 0.9; } .chart-tooltip tr { border: 1px solid #CCC; } .chart-tooltip th { background-color: #aaa; color: #FFF; font-size: 14px; max-width: 380px; overflow: hidden; padding: 2px 5px; text-align: left; text-overflow: ellipsis; white-space: nowrap; } .chart-tooltip td { border-left: 1px dotted #999; font-size: 13px; padding: 3px 6px; } .chart-tooltip td > span { display: inline-block; height: 10px; margin-right: 6px; width: 10px; } .chart-tooltip td.value { text-align: right; } .chart-tooltip .blue { background-color: #007BC3; } .chart-tooltip .red { background-color: #FF303E; } /* DARK THEME */ .dark h1 { color: rgba(255, 255, 255, 0.6); } .dark h3, .dark h4, .dark h5 { color: rgba(255,255,255,0.4); } .dark .table-responsive { border: none; } .dark .wrap-panel > div > table { color: #D2D2D2; } .dark .wrap-panel table tbody.tbody-meta tr { background-color: transparent; color: #F7F7F7; } .dark .wrap-panel table tbody.tbody-data tr td { border-right: none; } .dark .wrap-panel table.table-hover>tbody.tbody-data>tr:hover { background-color: rgba(255, 255, 255, 0.08) !important; } .dark .col-title { color: #9e9e9e; text-shadow:none; } .dark .grid-module h3 { color: #FFF; } .dark .dropdown-menu>li>a { color: #FFF; } .dark div.wrap-panel > div { color: #EEE; margin-top: 10px; padding: 0 10px; border-top: 1px solid rgba(255, 255, 255, 0.15); } /* DARK BLUE THEME */ html.dark.blue, .dark.blue body { background: #252B30; } .dark.blue .container { background: #252B30; } .dark.blue .page-header { border-bottom: 1px solid #3B444C; } .dark.blue .label-info { background-color: #252B30; } .dark.blue nav { border-right: 1px solid #181B1F; background: #1F2328; } .dark.blue div.wrap-panel > div { background: #1F2328; } .dark.blue .wrap-panel table tbody.tbody-meta { border-top: 1px solid #3B444C; border-bottom: 1px solid #3B444C; } .dark.blue .wrap-panel table tbody.tbody-data tr.shaded { background-color: #181B1F; } .dark.blue .gray { border-top: 4px solid #3B444C; } .dark.blue .grid-module { background: #1F2328; } .dark.blue .btn-default { color: #9E9E9E; background-color: #1F2328; border-color: #3B444C; } .dark.blue .btn-default:active, .dark.blue .btn-default:hover, .dark.blue .btn-default.active, .dark.blue .open>.dropdown-toggle.btn-default { color: #3B444C; background-color: #1F2328; border-color: #0F1214; } .dark.blue .pagination>.disabled>a, .dark.blue .pagination>.disabled>a:hover, .dark.blue .pagination>.disabled>a:focus { color: #777; } .dark.blue .pagination>li>a { background-color: #1F2328; border: 1px solid #3B444C; } .dark.blue .pagination>li>a:hover, .dark.blue .pagination>li>a:active, .dark.blue .pagination>li>a:focus { color: #0370B0; background-color: #1F2328; border-color: #3B444C; } .dark.blue .dropdown-menu>li>a:hover, .dark.blue .dropdown-menu>li>a:focus { color: #FFF; background-color: #3B444C; } .dark.blue .dropdown-menu { background-color: #252B30; } .dark.blue::-webkit-scrollbar-track, .dark.blue .table-responsive::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #9E9E9E; } .dark.blue::-webkit-scrollbar, .dark.blue .table-responsive::-webkit-scrollbar { width: 10px; height: 10px; background-color: #9E9E9E; } .dark.blue::-webkit-scrollbar-thumb, .dark.blue .table-responsive::-webkit-scrollbar-thumb { background-color: #3B444C; } .dark.blue .chart-tooltip { background-color: #252B30; } .dark.blue .report-title { background: #1F2328; } /* DARK GREY THEME */ html.dark.gray, .dark.gray body { background: #212121; } .dark.gray .container { background: #212121; } .dark.gray .page-header { border-bottom: 1px solid #303030; } .dark.gray .label-info { background-color: #303030; } .dark.gray nav { border-right: 1px solid #363737; background: #1C1C1C; } .dark.gray div.wrap-panel > div { background: #1C1C1C; } .dark.gray .wrap-panel table tbody.tbody-meta { border-top: 1px solid #363737; border-bottom: 1px solid #363737; } .dark.gray .wrap-panel table tbody.tbody-data tr.shaded { background-color: rgba(48, 48, 48, 0.48); } .dark.gray .gray { border-top: 4px solid #303030; } .dark.gray .grid-module { background: #1C1C1C; } .dark.gray .btn-default { color: #9E9E9E; background-color: #212121; border-color: #303030; } .dark.gray .btn-default:active, .dark.gray .btn-default:hover, .dark.gray .btn-default.active, .dark.gray .open>.dropdown-toggle.btn-default { color: #363737; background-color: #1C1C1C; border-color: #0F1214; } .dark.gray .pagination>.disabled>a, .dark.gray .pagination>.disabled>a:hover, .dark.gray .pagination>.disabled>a:focus { color: #777; } .dark.gray .pagination>li>a { background-color: #212121; border: 1px solid #303030; } .dark.gray .pagination>li>a:hover, .dark.gray .pagination>li>a:active, .dark.gray .pagination>li>a:focus { color: #0370B0; background-color: #212121; border-color: #303030; } .dark.gray .dropdown-menu>li>a { color: #FFF; } .dark.gray .dropdown-menu>li>a:hover, .dark.gray .dropdown-menu>li>a:focus { color: #FFF; background-color: #303030; } .dark.gray .dropdown-menu { background-color: #212121; } .dark.gray::-webkit-scrollbar-track, .dark.gray .table-responsive::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #9E9E9E; } .dark.gray::-webkit-scrollbar, .dark.gray .table-responsive::-webkit-scrollbar { width: 10px; height: 10px; background-color: #9E9E9E; } .dark.gray::-webkit-scrollbar-thumb, .dark.gray .table-responsive::-webkit-scrollbar-thumb { background-color: #303030; } .dark.gray .chart-tooltip { background-color: #303030; } .dark.gray .report-title { background: #303030; } /* DARK CHARTS */ .dark svg { background-color: transparent; } .dark .area { opacity: 0.1; } .dark .line0, .dark .line1 { stroke-width: 2; } .dark .area0, .dark .bars.y0 .bar, .dark rect.legend.y0 { fill: #007BC3; } .dark .area1, .dark .bars.y1 .bar, .dark .points.y1, .dark rect.legend.y1 { fill: #FF303E; } .dark .points.y0 { fill: #00D4E1; } .dark .line0 { stroke: #007BC3; } .dark .line1 { stroke: #FF303E; } .dark .grid.y .tick line, .dark .grid.x .tick line { stroke: #44474B; stroke-dasharray: 1 1; } .dark .axis text, .dark .axis-label, .dark text.legend { fill: #9E9E9E; } .dark .axis path { stroke: #999999; } .dark .axis.x .tick line, .dark .axis.y0 .tick line, .dark .axis.y1 .tick line, .dark .grid.y .tick:first-child line { stroke: #3B444C; } .dark .chart-tooltip th { background-color: #1c1c1c; } .dark .chart-tooltip tr { border: 1px solid #363737; } /* DARK PURPLE THEME */ html.dark.purple, .dark.purple body { background: #1e1e2f; } .dark.purple .container { background: #1e1e2f; } .dark.purple .page-header { border-bottom: 1px solid #2b3553; } .dark.purple .label-info { background-color: #181823; } .dark.purple nav { border-right: 1px solid #e14eca; background: #181823; } .dark.purple div.wrap-panel > div { background: #27293d; border-top: 1px solid #2b3553; } .dark.purple .wrap-panel table tbody.tbody-meta { border-top: 1px solid #2b3553; border-bottom: 1px solid #2b3553; } .dark.purple .wrap-panel table tbody.tbody-data tr.shaded { background-color: #1e1e2f; } .dark.purple .gray { border-top: 4px solid #2b3553; } .dark.purple .red { border-top: 4px solid #fd5d93; } .dark.purple .green { border-top: 4px solid #00f2c3; } .dark.purple .blue { border-top: 4px solid #1f8ef1; } .dark.purple h3, .dark.purple h4, .dark.purple h5 { color: #9a9a9a; } .dark.purple .grid-module { background: #27293d; } .dark.purple .grid-module h3 { color: #FFF; } .dark.purple .btn-default { color: #9E9E9E; background-color: #1e1e2f; border-color: #2b3553; } .dark.purple .btn-default:active, .dark.purple .btn-default:hover, .dark.purple .btn-default.active, .dark.purple .open>.dropdown-toggle.btn-default { color: #59595f; background-color: #1e1e2f; border-color: #2b3553; } .dark.purple .pagination>.disabled>a, .dark.purple .pagination>.disabled>a:hover, .dark.purple .pagination>.disabled>a:focus { color: #777; } .dark.purple .pagination>li>a { background-color: #1e1e2f; border: 1px solid #3B444C; } .dark.purple .pagination>li>a:hover, .dark.purple .pagination>li>a:active, .dark.purple .pagination>li>a:focus { color: #0370B0; background-color: #181823; } .dark.purple .dropdown-menu>li>a:hover, .dark.purple .dropdown-menu>li>a:focus { color: #FFF; background-color: #181823; } .dark.purple .dropdown-menu { background-color: #1e1e2f; } .dark.purple::-webkit-scrollbar-track, .dark.purple .table-responsive::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #9E9E9E; } .dark.purple::-webkit-scrollbar, .dark.purple .table-responsive::-webkit-scrollbar { width: 10px; height: 10px; background-color: #9E9E9E; } .dark.purple::-webkit-scrollbar-thumb, .dark.purple .table-responsive::-webkit-scrollbar-thumb { background-color: #1e1e2f; } .dark.purple .chart-tooltip { background-color: #181823; } .dark.purple .report-title { background: #181823; } .dark.purple .area0, .dark.purple .bars.y0 .bar, .dark.purple rect.legend.y0 { fill: #007BC3; } .dark.purple .area1, .dark.purple .bars.y1 .bar, .dark.purple .points.y1, .dark.purple rect.legend.y1 { fill: #d048b6; } .dark.purple .points.y0 { fill: #00D4E1; } .dark.purple .line0 { stroke: #007BC3; } .dark.purple .line1 { stroke: #d048b6; } goaccess-1.3/resources/css/bootstrap.min.css0000644000000000000000000014463113041415706016160 00000000000000/*! http://getbootstrap.com/customize/?id=f8abc08c888af89b2ed8cd64f48a1fe3 */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover,a.text-primary:focus{color:#286090}.text-success{color:#3c763d}a.text-success:hover,a.text-success:focus{color:#2b542c}.text-info{color:#31708f}a.text-info:hover,a.text-info:focus{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover,a.text-warning:focus{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover,a.text-danger:focus{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover,a.bg-primary:focus{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover,a.bg-success:focus{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover,a.bg-info:focus{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover,a.bg-warning:focus{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover,a.bg-danger:focus{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:34px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:30px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:46px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:34px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#fff;background-color:#398439;border-color:#255625}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#337ab7;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#fff;background-color:#337ab7;border-color:#337ab7;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}} goaccess-1.3/resources/css/fa.min.css0000644000000000000000000004406213353743330014531 00000000000000@font-face { font-family: 'fa'; src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAC2sAAsAAAAALWAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIPHGNtYXAAAAFoAAABbAAAAWzzYPN8Z2FzcAAAAtQAAAAIAAAACAAAABBnbHlmAAAC3AAAJ7QAACe0PqRPf2hlYWQAACqQAAAANgAAADYSBhrHaGhlYQAAKsgAAAAkAAAAJAhUBIZobXR4AAAq7AAAAMwAAADMpCoCC2xvY2EAACu4AAAAaAAAAGjyrvuebWF4cAAALCAAAAAgAAAAIAA+AVduYW1lAAAsQAAAAUoAAAFKIhWTsnBvc3QAAC2MAAAAIAAAACAAAwAAAAMDVgGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8pwDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAVAAAABQAEAABQAQAAEAIPAH8AnwDfAT8BfwIvA68EHwRvBU8HHwgPCF8I7wlvCi8MDwyfDO8Nrw3PDk8QHxBfEI8QzxEfEh8VzxoPHO8ffx/vJo8pLynP/9//8AAAAAACDwB/AJ8AvwE/AW8CHwOvBB8EbwU/Bx8IDwhfCO8JbwovDA8MnwzvDX8Nzw5PEA8QTxCPEM8RHxIfFb8aDxzvH38f7yaPKS8pz//f//AAH/4w/9D/wP+w/2D/QP6w/UD84Pyg++D6IPlA+QD4gPgQ92D1kPUQ9ND0UPRA89DyIPIA8eDxsPFw8IDs8OjA5fDjcOMQ3IDZ8NlgADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAPAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAIAAAAAAtsDbgAbADcAACUUBiMhIiY1NDc+ATc2Mx4BMzI2NzIXHgEXFhUDFAcOAQcGIyInLgEnJjU0Nz4BNzYzMhceARcWAttHMv4YMkgICColJDgjWzU0XCM4JCQqCAiSERE8KCgtLigoOxESEhE7KCguLSgoPBERlz5ZWT45OTpdHh0hKCghHR5dOjk5AfstKCg8ERERETwoKC0uKCg7ERISETsoKAAAAAAEAAAASQO3A24AEAAhADEAQQAAARUUBiMhIiY9ATQ2MyEyFhURFRQGIyEiJj0BNDYzITIWFQEVFAYjISImPQE0NjMhMhYRFRQGIyEiJj0BNDYzITIWAbcrHv7bHisrHgElHisrHv7bHisrHgElHisCACse/tseKyseASUeKyse/tseKyseASUeKwFu3B4rKx7cHisrHgG33B4rKx7cHisrHv5J3B4rKx7cHisrAZncHisrHtweKysABgAAAEkEAANuAA8AHwAvAD8ATwBfAAAlFRQGKwEiJj0BNDY7ATIWERUUBisBIiY9ATQ2OwEyFgEVFAYjISImPQE0NjMhMhYBFRQGKwEiJj0BNDY7ATIWARUUBiMhIiY9ATQ2MyEyFhEVFAYjISImPQE0NjMhMhYBJSEWtxcgIBe3FiEhFrcXICAXtxYhAtsgF/3cFyAgFwIkFyD9JSEWtxcgIBe3FiEC2yAX/dwXICAXAiQXICAX/dwXICAXAiQXIO5uFyAgF24WISEBDm0XICAXbRcgIP7FbhcgIBduFiEhAjNuFyAgF24XICD+xG0XICAXbRcgIAEObhcgIBduFyAgAAABAEUAUQO7AvgAJAAAARQGBwEOASMiJicBLgE1NDY/AT4BMzIWHwEBPgEzMhYfAR4BFQO7CAj+FAcVCgsVB/7jCAgICE4IFAsKFQioAXYIFQoLFAhOCAgCcwoVB/4UCAgICAEdBxULChUHTggICAioAXcICAgITgcVCwAAAQA/AD8C5gLmADwAACUUBg8BDgEjIiYvAQcOASMiJi8BLgE1NDY/AScuATU0Nj8BPgEzMhYfATc+ATMyFh8BHgEVFAYPARceARUC5gkHTggUCwsUCKioBxULChUHTggICAioqAgICAhOBxUKCxUHqKgIFAsLFAhOBwkJB6ioBwnDChUHTggICAioqAgICAhOBxUKCxUHqKgIFAsLFAhOBwkJB6ioBwkJB04IFAsLFAioqAcVCwAAAAIAAAAAA24DbgALAJIAAAE0JiMiBhUUFjMyNiUVFAYPAQ4BBx4BFx4BFRQGBw4BIyImLwEOAQcOAQcOASsBIiYvAS4BJwcOASMiJicuAScuATU0Njc+ATcuAS8BLgE9ATQ2PwE+ATcuAScuATU0Njc+ATMyFh8BPgE3PgE3PgE7ATIWHwEeARc3PgEzMhYXHgEXHgEVFAYHDgEHHgEfAR4BFQJJVjw9VVU9PFYBJQkHagUKBw4fEAIEAwMKVQ8EBwRPDBoOAwYHAgsIfwcMARANGg1QAwgDBAgDFjYSAgICAw4fDwgMBGgICQkGawQLBw8eEAMDAwILVQ8DCANPDRoNAwcHAgsHfwgMARANGgxRAwcEBAcDFzYSAgIDAg4fDwcMBWgHCgG3PFZWPD1VVXt/Bg0BEA4aDBUnEwMIAwQHAw1ZAwI+BgsFGjYaBwkKB2kFCgY9AgMDAxUzGAMHBAMHAxMnFA4cDw8BDAh+Bw0BEA4aDRQnEwMHBAQGAw5ZBAI9BgsEGzYaBwkKB2oECgc9AwMEAhUzGQMGBAQGAxQmFA4cDhACDAcAAAAAAwAA/7cDbgO3ABMAHAAmAAABHgEVERQGIyEiJjURNDYzITIWFwcVMy4BLwEuARMRIyImPQEhESEDRxAXIBf9ABcgIBcCABc3EEzXAwcDsgMO1e4XIP5JAtwC3hA3F/1uFyAgFwOSFyAXECfXCA0DswMH/JkCSSAX7vySAAMAAAAAA24DbgAVADEATQAAAREUBisBIiY9ATQ2OwE1NDY7ATIWFRc0Jy4BJyYjIgcOAQcGFRQXHgEXFjMyNz4BNzY3FAcOAQcGIyInLgEnJjU0Nz4BNzYzMhceARcWAgALB7cICgoIgAoIJQcL7hkYVTg5QEA5OVQZGBgZVDk5QEA5OFUYGYAjIndQUFtbUFB3IyIiI3dQUFtbUFB3IiMCgP8ACAoKCCUHC8kICgoIyUA5OFUYGRkYVTg5QEA5OVQZGBgZVDk5QFtQUHciIyMid1BQW1tQUHciIyMid1BQAAAAAAIAAAAAA24DbgA0AGcAAAEwFBUGBw4BBwYjIicuAScmJwcOASMiJjURNDYzITIWFRQGDwEeATMyNjc+ATc+ATsBMhYVExEUBiMhIiY1NDY/AS4BIyIGBw4BBw4BKwEiJj0BNjc+ATc2MzIXHgEXFhc3PgEzMhYVA18SKCdvRkVPKikpTCMkHkoFDQcPFhYPAQAPFQYFTihoN0yFKAoNBwIJBm4ICg8WD/8ADxUFBU8oaDdMhSgLDAgCCAdxCAsTJyhwRkZPKikpTSMkHkoGDQcPFgFbAwFLQD9bGRkICB8XFh1KBQUVDwEADxYWDwcNBk4mKUtBECESBgcLCAHK/wAPFhYPBw0FTyYoSkERIREGBwsHBExAP1oaGQgJHxYXHEkFBhUPAAAACAAAAEkEAANuABAAIAAwAEEAUgBjAHQAhAAAExUUBisBIiY9ATQ2OwEyFhU1FRQGKwEiJj0BNDY7ATIWNRUUBisBIiY9ATQ2OwEyFgEVFAYjISImPQE0NjMhMhYVNRUUBiMhIiY9ATQ2MyEyFhU1FRQGIyEiJj0BNDYzITIWFRMRNCYjISIGFREUFjMhMjY1ExEUBiMhIiY1ETQ2MyEyFtsLByQICwsIJAcLCwckCAsLCCQHCwsHJAgLCwgkBwsCkwsI/dwHCwsHAiQICwsI/dwHCwsHAiQICwsI/dwHCwsHAiQIC0kLB/y2BwsLBwNKBwtJNiX8tiU2NiUDSiU2ARIkCAsLCCQICwsIkyUHCwsHJQcLC4slBwsLByUHCwv+1CQICwsIJAgLCwiTJQcLCwclBwsLB5IlBwsLByUHCwsH/m4B2wcLCwf+JQgLCwgCbf2TJjY2JgJtJjY2AAAAAAgAAABJBAADbgAQACEAMQBCAFIAYwBzAIMAADcVFAYrASImPQE0NjsBMhYVNRUUBisBIiY9ATQ2OwEyFhU1FRQGKwEiJj0BNDY7ATIWARUUBiMhIiY9ATQ2MyEyFhUBFRQGKwEiJj0BNDY7ATIWARUUBiMhIiY9ATQ2MyEyFhU1FRQGIyEiJj0BNDYzITIWNRUUBiMhIiY9ATQ2MyEyFpILB24HCwsHbgcLCwduBwsLB24HCwsHbgcLCwduBwsDbgsH/QAICwsIAwAHC/ySCwduBwsLB24HCwNuCwf9AAgLCwgDAAcLCwf9AAgLCwgDAAcLCwf9AAgLCwgDAAcLyW4HCwsHbgcLCwfcbgcLCwduBwsLB9tuBwsLB24HCwv+Qm4HCwsHbgcLCwcCkm0ICwsIbQgLC/5CbgcLCwduBwsLB9tuBwsLB24HCwvUbQgLCwhtCAsLAAAAAgAAAAACSQNuAAsAKAAAATQmIyIGFRQWMzI2NxQGBwMOASMiJicDLgE1NDc+ATc2MzIXHgEXFhUBt1Y8PVZWPTxWkggL0AkkFBUkCdALCBcXTzY1PTw2NU8XFwJJPVVVPTxWVjwaNRf+RhMWFhMBuhc1Gj01NVAXFxcXUDU1PQACAAAASQOpA24AOgBQAAABFRQGIyEiJjURNDYzITIWFx4BFxYGDwEOASMiJiMuASMhIgYVERQWMyEyNj0BNDY/AT4BMzIWFx4BFRMBBiIvASY0PwE2Mh8BATYyHwEWFAcDJWFE/iVFYGBFAdsRIhAEBQEBAwMcAwcDAQMBBw0G/iUmNjYmAdsmNQMDJAMHAwIDAgUHhP4uDSYO9Q4OPg4mDpYBcg0mDj8NDQGjtURhYUQB20RhBwgBBwUECQMcAwMBAgI2Jv4lJjY2JpEDBwIlAwMBAQIJBgEY/i8ODvUOJg4+Dg6WAXIODj8OJQ4AAAABAGMAGgKdA50AFQAACQIWFA8BBiInASY0NwE2Mh8BFhQHAp3+0QEvCwtfCh4L/lgLCwGoCx4KXwsLAwv+0P7RCx4KXwsLAagKHgsBqAsLXwoeCwABAD4AGgJ5A50AFQAACQEGIi8BJjQ3CQEmND8BNjIXARYUBwJ5/lgLHgtfCgoBMP7QCgpfCx4LAagKCgHC/lgLC18KHgsBLwEwCx4KXwsL/lgLHgoAAAAAAwAJAAAD9wO3AA8AJgA8AAAlNTQmKwEiBh0BFBY7ATI2JxM0JicuASsBIgYHDgEVExQWOwEyNjUDARYUBw4BIyEiJicmNDcBPgEzMhYXAkkKCG4ICgoIbggKAQoCAwMHBH4EBwMDAgkMCGoHDAgBtwkKCiIT/JITIgoKCQG3CSMUFCMJpW0HDAwHbQgLC94BBgMGAgIEBAICBwP++wYHBwYCFvzbESYRERMTEREmEQMlERUVEQAAAAUAAAAABJIDbgADAAgADgATABgAAAERIxEBESMRMwEVIREzEQERIxEzNxEjETMBbpMBbpKSAkn7bkkC3JOT25KSAbf+2wElAST9twJJ/W5JA2782wIA/kkBt9z9bQKTAAYAAP+/BEkDrgALABcAIwCkAPwBVAAAATQmIyIGFRQWMzI2BTQmIyIGFRQWMzI2ETQmIyIGFRQWMzI2BxUUBg8BDgEHHgEXHgEVFAYHDgEjIiYvAQ4BBw4BBw4BKwEiJi8BLgEnBw4BIyImJy4BNTQ2Nz4BNy4BLwEuAT0BNDY/AT4BNy4BJy4BNTQ2Nz4BMzIWHwE+ATc+ATc+ATsBMhYfAR4BFzc+ATMyFhceARUUBgcOAQceAR8BHgEVARUUBiMOAQceARUUBgcOASMiJiciBiMiJiMOASMiJicuATU0NjcuASciJj0BNDY3PgE3LgE1MDY3PgEzMhYXPgEzMhYXPgE/ATIWFx4BMRQGBx4BFx4BFREVFAYHDgEHHgEVFAYHDgEjIiYnIgYjIiYjDgEjIiYnLgE1NDY3LgEnLgE9ATQ2Nz4BNy4BNTQ2Nz4BMzIWFzI2MzIWMz4BPwEyFhceARUUBgceARceARUCAFY8PVZWPTxWAbcrHh4rKx4eKyseHisrHh4r3AcGWAQJBgwaDgICAgIJRwwEBgJCCxUMAgUGAgkGagYLAQ0LFQtDAgYDBAYCDEcDAQ0ZDQYLA1cGCAgFWQMJBgwaDQICAQMIRw0DBgNBCxYLAgYFAgoGagYKAQ0LFgpDAwYDAwYDC0cCAgwaDAYKBFcGBwFuTAkDCQUEGQEBBUACBi4EBAkEBQgEBS4FAz8FAgEaBAYIBAhNTQgECAYEGgECBT8DBS4FBAgFBAkEDBoOBAJABQEBGQQFCQMJTEwJAwkFBBkBAQVAAgYuBAQJBAUIBAUuBQM/BQIBGgQGCAQITU0IBAgGBBoBAgU/AwUuBQQIBQQJBAwaDgQCQAUBARkEBQkDCUwBtzxWVjw9VVXoHisrHh4rKwJnHiwsHh4rK9JqBQsBDgsVCxEhEAIGAwMGAgxJAgIzBQkEFS4VBggIBlgDCQYzAgICAgtEDQMFAxAgEQsYDA0BCgZqBQsBDQwVCxEgEQIGAwMGAgxJAgIzBQkEFS4VBggJBlcECQUzAgICAwpFDAMFAxEfEQwXDA0BCgb+z1AGCwkOBwk+CAECAQMmPAYBAQY8JgMBAgEHPwkHDgkLBlAHCgEIDwcIPwgDAQImOwcBAQEBESEOAiUDAQMIPwgHDwgBCgcCSVAGCgEIDwcJPggBAgEDJTsGAQEGOyUDAQIBBz8JBw8IAQoGUAcKAQgPBwg/CAECAQImOwYBARAhDwElAwECAQg/CAcPCAEKBwAAAgAAAEkEAAO3ACgASwAAARUUBiMhIiY1ETQ2MyEyFh0BFAYjISIGFREUFjMhMjY9ATQ2OwEyFhUTERQGIyImLwEBDgEjIiYvAS4BNTQ2NwEnLgE1NDYzITIWFQMlYUT+JUVgYEUBkggKCgj+biY2NiYB2yY1CwgkCAvbFg8HDQVl/owDBwQDBwNBAgQEAgF1ZQUGFg8BJA8WAaW3RGFhRAHbRGELCCQICjYm/iUmNjYmtwcLCwcB7f7cDxYGBWX+iwMDAwNBAwcDBAcCAXVlBQ0HDxYWDwAAAgAAAEkDJQNuAA8AHwAAASEiBhURFBYzITI2NRE0JhcRFAYjISImNRE0NjMhMhYCgP4lJjY2JgHbJjU1f2FE/iVFYGBFAdtEYQMlNib+JSY2NiYB2yY2XP4lRGFhRAHbRGFhAAMAJf+3A9sDtwASADAAZwAABTQmIyImNTQmIyIGFRQWMzI2NSUhJicuAScmNTQnLgEnJiMiBw4BBwYVFAcOAQcGByEUBiMhFAYjIiY1ISImNTY3PgE3NjU0Nz4BNzY3LgE1NDYzMhYVFAYHFhceARcWFRQXHgEXFhcCCQUEIjAGAwQGOyoEBf6EAuYmHB0mCQoNDTYqKTg4KSo2DQ0KCSYdHCYDTise/wBWPDxW/wAeKx8hIDUREBERPi0tOQIDIBcXIAMCOS0tPhEREBE1ICEfEgQFMCIEBQUEKTsFBKQsMzN2RENNGyAgNxITExI3ICAbTUNEdjMzLB4rPFZWPCseGycncU1NaCkpKkUZGQkFCwYXICAXBgsFCRkZRSopKWhNTXEnJxsABgAA/7cESQO3ABoANgBCAF4AeACEAAABDgEHIyImNTQ3PgE3NjMyFjMyNjcOARUUFhcBFAYjISImNTQ3PgE3NjMyFjMyNjMyFx4BFxYVARQGIyImNTQ2MzIWARQHDgEHBiMiJy4BJyY1NDc+ATc2MzIXHgEXFgUUBisBLgEnPgE1NCYnHgEzMjYzMhceARcWAxQGIyImNTQ2MzIWAVMtTh1MK0QBAQ0ODxsJUjkUJhIBARgWAmRURf4NRVQIBysmJz8PaFZVaQ4/JyYrCAf9t1Y9PFZWPD1WAZIREjsoKC0uKCg7EhEREjsoKC4tKCg7EhEBSUQrTB1OLRcYAgESJhQ6UQkcDg4NAQFJVjw9VlY9PFYBtwEmIiswESIhQxkZMAYHChIKJ0sg/pRGTk5GMDo5YiEhT08hIWI5OjAC2j1WVj08Vlb+6C0oKDwRERERPCgoLS4oKDsREhIROygorjArIiYBIEsnChIKBwYwGRlDISIBSz1WVj08VlYAAAAAAwAAAEkDbgMlAA8AHwAvAAAlFRQGIyEiJj0BNDYzITIWERUUBiMhIiY9ATQ2MyEyFhEVFAYjISImPQE0NjMhMhYDbhYP/NwPFhYPAyQPFhYP/NwPFhYPAyQPFhYP/NwPFhYPAyQPFrdJDxYWD0kPFRUBFUkPFRUPSQ8WFgEWSQ8WFg9JDxYWAAoAAABJA7cDbgAQACAAMQBBAFEAYgByAIMAlACkAAAlNTQmKwEiBh0BFBY7ATI2NT0BNCYrASIGHQEUFjsBMjYFNTQmKwEiBh0BFBY7ATI2NQE1NCYrASIGHQEUFjsBMjYFNTQmKwEiBh0BFBY7ATI2BTU0JisBIgYdARQWOwEyNjUBNTQmKwEiBh0BFBY7ATI2BTU0JisBIgYdARQWOwEyNjU9ATQmKwEiBh0BFBY7ATI2NTcRFAYjISImNRE0NjMhMhYBJQsItwcLCwe3CAsLCLcHCwsHtwgLASQKCLcICgoItwgK/twLCLcHCwsHtwgLASQKCLcICgoItwgKASULCLYICwsItggL/tsKCLcICgoItwgKASULCLYICwsItggLCwi2CAsLCLYIC0k2Jv0AJTY2JQMAJjalbQgLCwhtCAsLCNtuBwsLB24ICgrTbQgLCwhtCAsLCAG2bggKCghuBwsL1G4HCwsHbggKCtNtCAsLCG0ICwsIAbZuCAoKCG4HCwvUbgcLCwduCAoKCNtuCAoKCG4HCwsHt/2TJjY2JgJtJjY2AAABAAABAAJJAkkAFQAAARQGBwEOASMiJicBLgE1NDYzITIWFQJJBgX/AAUNBwgNBf8ABQYWDwIADxUCJQgNBf8ABQYGBQEABQ0IDxUVDwAAAAEAAADbAkkCJQAUAAABFAYjISImNTQ2NwE+ATMyFhcBHgECSRUP/gAPFgYFAQAFDQgHDQUBAAUGAQAPFhYPBw4FAQAFBgYF/wAFDgABACUAkgFuAtsAFQAAAREUBiMiJicBLgE1NDY3AT4BMzIWFQFuFg8HDQb/AAUFBQUBAAYNBw8WArf+AA8WBgUBAAUOBwcNBgEABQUVDwAAAAEAAACSAUkC2wAVAAABFAYHAQ4BIyImNRE0NjMyFhcBHgEVAUkGBf8ABQ0HDxYWDwcNBQEABQYBtwcOBf8ABQYWDwIADxUFBf8ABg0HAAAAAgAAACUCSQNJABUAKwAAARQGBwEOASMiJicBLgE1NDYzITIWFTUUBiMhIiY1NDY3AT4BMzIWFwEeARUCSQYF/wAFDQcIDQX/AAUGFg8CAA8VFQ/+AA8WBgUBAAUNCAcNBQEABQYBSQcNBv8ABQUFBQEABg0HDxYWD9wPFhYPBw0FAQAFBgYF/wAFDQcAAAAABwAAAAAEAAMlAAsAFwAtADkARQBRAG0AABM0JiMiBhUUFjMyNhM0JiMiBhUUFjMyNhc3NiYnMSYGDwEOAQcGFhcWNjc2JiclNCYjIgYVFBYzMjYBNCYjIgYVFBYzMjYFNCYjIgYVFBYzMjYXFAYHDgEjISImJy4BNTQ3PgE3NjMyFx4BFxYV2yofHisrHh8qbiseHisrHh4r9TkEDw8OGwM6IjYJDC4sLE8LCRkcAXkrHh8qKh8eK/6SKx4eKyseHisBACseHisrHh4rtykoBRAJ/N4JEAUoKSgpi11dampdXYspKAElHisrHh8rKwEfHisrHh8rK/TaDxoEAw8P2gMrIyxPCwwuLCNAFBMeKyseHysrAYwfKiofHisrTx4rKx4fKyvhSow+CAkJCD2NSmleXYsoKSkoi11eaQAAAAACABoAdQJCAq8AJABJAAAlFAYPAQ4BIyImJwEuATU0NjcBPgEzMhYfAR4BFRQGDwEXHgEVMxQGDwEOASMiJicBLgE1NDY3AT4BMzIWHwEeARUUBg8BFx4BFQFmAwIdAwcDBAcC/vUCAwMCAQsCBwQDBwMdAgMDAuHhAgPcAwMdAgcEAwcD/vYDAwMDAQoDBwMEBwIdAwMDA+HhAwOlBAcDHAMDAwMBCgMHAwQHAgELAgMDAh0CCAMDCALh4AMHAwQHAxwDAwMDAQoDBwMEBwIBCwIDAwIdAggDAwgC4eADBwMAAAACAAcAdQIvAq8AJABJAAABFAYHAQ4BIyImLwEuATU0Nj8BJy4BNTQ2PwE+ATMyFhcBHgEVMxQGBwEOASMiJi8BLgE1NDY/AScuATU0Nj8BPgEzMhYXAR4BFQFUAwP+9gMHAwQHAh0CBAQC4eECBAQCHQIHBAMHAwEKAwPbAwL+9QIHBAMHAxwDAwMD4OADAwMDHAMHAwQHAgELAgMBkgMHA/72AwMDAxwDBwQDBwPg4QIIAwMIAh0CAwMC/vUCBwQDBwP+9gMDAwMcAwcEAwcD4OECCAMDCAIdAgMDAv71AgcEAAABABoAdQFmAq8AJAAAARQGDwEXHgEVFAYPAQ4BIyImJwEuATU0NjcBPgEzMhYfAR4BFQFmAwLh4QIDAwIdAwcDBAcC/vUCAwMCAQsCBwQDBwMdAgMCgAMIAuHgAwcDBAcDHAMDAwMBCgMHAwQHAgELAgMDAh0CBwQAAAAAAQAHAHUBVAKvACQAAAEUBgcBDgEjIiYvAS4BNTQ2PwEnLgE1NDY/AT4BMzIWFwEeARUBVAMD/vYDBwMEBwIdAgQEAuHhAgQEAh0CBwQDBwMBCgMDAZIDBwP+9gMDAwMcAwcEAwcD4OECCAMDCAIdAgMDAv71AgcEAAAAAAIAAAAABEkDtwAPAC4AAAERNCYjISIGFREUFjMhMjYTERQGIyEUFhUUBiMhIiY1NDY1ISImNRE0NjMhMhYVBAALB/xtBwsLBwOTBwtJNiX+ySQVD/7bDxUk/sklNjYlA5MlNgGAAdsICwsI/iUHCwsB4v2TJjYkOg8PFhYPDzklNiYCbSY2NiYAAAAAAgAAAAADbgNuABwAOQAAASIHDgEHBhUUFx4BFxYzMjc+ATc2NTQnLgEnJiMBFAcOAQcGIyInLgEnJjU0Nz4BNzYzMTIXHgEXFgG3QDk5VBkYGBlUOTlAQDk4VRgZGRhVODlAAbcjIndQUFtbUFB3IyIiI3dQUFtbUFB3IiMC7hkYVTg5QEA5OVQZGBgZVDk5QEA5OFUYGf7JW1BQdyIjIyJ3UFBbW1BQdyIjIyJ3UFAAAAAAAQAAAAADbgNuABsAAAEUBw4BBwYjIicuAScmNTQ3PgE3NjMyFx4BFxYDbiMid1BQW1tQUHcjIiIjd1BQW1tQUHciIwG3W1BQdyIjIyJ3UFBbW1BQdyIjIyJ3UFAAAAAAAwAfAAsEKgMaABUAJgA8AAAlBwYiJwEmNDcBNjIfARYUDwEXFhQHAQMOAS8BLgE3Ez4BHwEeAQcJAQYiLwEmND8BJyY0PwE2MhcBFhQHAWEdBg8F/vUFBQELBQ8GHQUF4eEFBQFR1QINByQHBwLVAg0HJAcHAgF4/vUFDwYcBgbg4AYGHAYPBQELBQWXHAYGAQoGDwUBCwUFHQUQBeHgBg8GAmL9HgcHAgoCDQcC4gcIAgoCDgf+jP72BgYcBg8G4OEFEAUdBQX+9QUPBgAAAAIAAP+3A24DtwAIABsAAAERHgEfAR4BFwUUFjMhERQGIyEiJjURNDYzIRECSQYKBekECAT+qSAXATcgF/0AFyAgFwHJApIBDgQIBOkECwYSFyD9pRcgIBcDkhcg/skAAAUAAP+3A24DtwAIABoAKwA8AE0AAAEeARchER4BFwMhERQGIyEiJjURNDYzIREUFhM1NCYjISIGHQEUFjMhMjY1PQE0JiMhIgYdARQWMyEyNjU9ATQmIyEiBh0BFBYzITI2NQNHBAgE/vIGCgUnATcgF/0AFyAgFwHJIHIKCP5uCAsLCAGSCAoKCP5uCAsLCAGSCAoKCP5uCAsLCAGSCAoCpwQLBgEOBAgE/rn9pRcgIBcDkhcg/skXIP5cJAgKCggkCAsLCJIkCAsLCCQICgoIkiUHCwsHJQgKCggAAAAAAQAAAAADXANuADsAAAEhHgEVFAcOAQcGIyInLgEnJjU0Nz4BNzYzMhceARcWFwcuASMiBw4BBwYVFBceARcWMzI3PgE3NjcjNQG3AZ4DBB4eb05NX1tQUHcjIiIjd1BQWywpKUogIR13GVZAODIxShYVFRZKMTI4QS4tOw8PBPkB9hEjFV5PT3EgICIjd1BQW1tQUHciIwgIHhUVG3MYLBYWSzIzOToyM0sWFRQVOiEhGJcAAQAS/8kD7gOfADoAAAEUBw4BBwYjIicuAScmNTQ3PgE3NjcVBgcOAQcGFRQXHgEXFjMyNz4BNzY1NCcuAScmJzUWFx4BFxYVA+4nJ4ZaWmZmWlqGJychIHFNTVk/NTZOFhcdHWNDQkxMQkNjHR0XFk42NT9ZTU1xICEBt2ZaWoYnJycnhlpaZl1TU4IrKw2CDSAhXzs8QkxCQ2MdHR0dY0NCTEI8O18hIA2CDSsrglNTXQAABAAN/7cEhgO3ABIAJQA9AG8AAAU0JiMiJjU0JiMiBhUUFjMyNjUJAS4BIyIHDgEHBhUUBw4BBwYHBRQGIyEUBiMiJjU3IS4BJzcWFx4BFxYXExcWFAcBBiYvASY2PwEuATU2Nz4BNzY1NDc+ATc2Ny4BNTQ2MzIWFRQGBx4BFzc2FhcCUgUEIjAFBAQFOykEBf7NAfYWZFI4KSo2DQ0FBRMPDxQDBiwe/wBVPTxWVQGxMEERPwsTEy0aGhkxMAQG+9IFEAQwBQEFawYFHyEhNBEREBE+LS05AgMgFxcgAgNKax3vBg8FEgQFMCIEBQUEKTsFBAEPAbItSRMSNyAgGzczMlwqKSZrHis8VlU9STaDTjdAMjFNHB0VAxw3Bg8F/GEFAQY3Bg8FXAgTChsnJ3FNTWgpKSpFGRkJBQsGFyAgFwYLBQtMMs8FAQYAAAAAAgAAAAAEkgNuAAUACwAAJRUhETMRARMhEQkBBJL7bkkDbpL8SQEAAUlJSQNu/NsCSf4AAUkBSv62AAAABAAA/7cEAAO3ABYAKgA9AEkAAAEyFhceARclJgcOAQcGByc2Nz4BNzYzBRMWFx4BFxY3AyYnLgEnJjU0NjcFFhcWBgcGBw4BJxM2NzYmJyYnJzIWFRQGIyImNTQ2Af5Cgz1DZiD+WC0rK0gcHA+dJS0tZjg3OP5VwRQfH0wqKy2DXE9QdCEhLCcDiyEBATs5OlNDkkjoGQsMAg8PHr1IZWVISGVlA7ciIydtQBYDCwstIiEr8y0kIzEMDej+hikfICgHCAn+/g4tLYZWVmBNjzxgV1taqEhIMCcgAwFkJisrVSkpIgNlR0hlZUhHZQAAAgATAAAD7QNuAAMAaAAAATcjBwEHDgErAQczMhYXHgEPAQ4BKwEHDgErASImJy4BPwEjBw4BKwEiJicuAT8BIyImJy4BPwE+ATsBNyMiJicuAT8BPgE7ATc+ATsBMhYXHgEPATM3PgE7ATIWFx4BDwEzMhYXHgEHAjYlkSUCSCACCQe6JbIEBwMDAgIgAQoGuy4CCgaABAgDAwEBLJEuAgoGgQMIAwICASyxBQcDAgIBIAIJB7olsgQHAwMCAiABCga7LgIKB4AEBwMDAQEskS4CCgeAAwgDAgIBLLEFBwMCAgEBbpKSASCABgiSBAMECASABgi7BggEAwMJBLK7BggEAwMJBLIEAwMJBIAGCJIEAwMJBIAGCLsGCAQDBAgEsrsGCAQDBAgEsgQDBAgEAAQAAAAAA24DbgAQAEQAYQB+AAABFRQGKwEiJj0BNDY7ATIWFRMUBgcOAR0BFAYrASImPQE0Njc+ATU0JiMiBgcOAQcOASMiJi8BLgE3PgEzMTIXHgEXFhUDIgcOAQcGFRQXHgEXFjMyNz4BNzY1NCcuAScmIwEUBw4BBwYjIicuAScmNTQ3PgE3NjMxMhceARcWAfcLB1wICgoIXAcLkkMfFhoLB1wICjwfGR4zHA8eCgkUEAMHBQMFAj4GAgQjY0EjJCM5EhLSTEJDYx0dHR1jQ0JMS0NDYx0dHR1jQ0NLAbcjIndQUFtbUFB3IyIiI3dQUFtbUFB3IiMBCVsICwsIWwgKCggBHD06Eg0UDRMHCwsHJzUsDgwVFBkgCAcGFhMEAwECLwQPBjc2DQ0vHyAlAQAdHWNDQ0tMQkNjHR0dHWNDQkxLQ0NjHR3+kltQUHciIyMid1BQW1tQUHciIyMid1BQAAAAAAEAAAABAAAU8s37Xw889QALBAAAAAAA1yprLgAAAADXKmsuAAD/twSSA7cAAAAIAAIAAAAAAAAAAQAAA8D/wAAABJIAAAAABJIAAQAAAAAAAAAAAAAAAAAAADMEAAAAAAAAAAAAAAACAAAAAtsAAAO3AAAEAAAABAAARQMlAD8DbgAAA24AAANuAAADbgAABAAAAAQAAAACSQAAA7sAAAMAAGMCtwA+BAAACQSSAAAESQAABAAAAAMlAAAEAAAlBEkAAANuAAADtwAAAkkAAAJJAAABkgAlAUkAAAJJAAAEAAAAAlsAGgI3AAcBgAAaAVsABwRJAAADbgAAA24AAARJAB8DbgAAA24AAANcAAAEAAASBJIADQSSAAAENwAABAAAEwNuAAAAAAAAAAoAFAAeAHQA0AFSAZAB7ALCAwADcgQGBLYFYgWiBhoGRAZwBswG/AjUCUAJcgoGCsYLCgveDAYMLAxUDHwMxA1kDdYOSA6GDsQPCg9kD5QP/BAsEJwQ9hFQEfgSFhKOEyYT2gABAAAAMwFVAAoAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEAAgAAAAEAAAAAAAIABwAzAAEAAAAAAAMAAgAnAAEAAAAAAAQAAgBIAAEAAAAAAAUACwAGAAEAAAAAAAYAAgAtAAEAAAAAAAoAGgBOAAMAAQQJAAEABAACAAMAAQQJAAIADgA6AAMAAQQJAAMABAApAAMAAQQJAAQABABKAAMAAQQJAAUAFgARAAMAAQQJAAYABAAvAAMAAQQJAAoANABoZmEAZgBhVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwZmEAZgBhZmEAZgBhUmVndWxhcgBSAGUAZwB1AGwAYQByZmEAZgBhRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff'); font-weight: normal; font-style: normal; } [class^="fa-"],[class*=" fa-"]{font-family:'fa' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes "fa-spin"{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg);}}@keyframes "fa-spin"{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg);}} .fa-square-o:before{content:"\f096";}.fa-user:before{content:"\f007"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before{content:"\f00d"}.fa-remove:before{content:"\f00d"}.fa-times:before{content:"\f00d"}.fa-cog:before{content:"\f013"}.fa-gear:before{content:"\f013"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-list:before{content:"\f03a"}.fa-map-marker:before{content:"\f041"}.fa-check-square-o:before{content:"\f046"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-exclamation-triangle:before{content:"\f071"}.fa-warning:before{content:"\f071"}.fa-bar-chart:before{content:"\f080"}.fa-bar-chart-o:before{content:"\f080"}.fa-cogs:before{content:"\f085"}.fa-gears:before{content:"\f085"}.fa-external-link:before{content:"\f08e"}.fa-bell-o:before{content:"\f0a2"}.fa-group:before{content:"\f0c0"}.fa-users:before{content:"\f0c0"}.fa-bars:before{content:"\f0c9"}.fa-navicon:before{content:"\f0c9"}.fa-reorder:before{content:"\f0c9"}.fa-table:before{content:"\f0ce"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-sort:before{content:"\f0dc"}.fa-unsorted:before{content:"\f0dc"}.fa-dashboard:before{content:"\f0e4"}.fa-tachometer:before{content:"\f0e4"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-desktop:before{content:"\f108"}.fa-circle-o:before{content:"\f10c"}.fa-circle:before{content:"\f111"}.fa-code:before{content:"\f121"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-google:before{content:"\f1a0"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-area-chart:before{content:"\f1fe"}.fa-chrome:before{content:"\f268"}.fa-hashtag:before{content:"\f292"}.fa-question-circle-o:before{content:"\f29c"} goaccess-1.3/resources/js/0000755000000000000000000000000013375711133012545 500000000000000goaccess-1.3/resources/js/charts.js0000644000000000000000000006174713353743330014326 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2018 Gerardo Orellana */ 'use strict'; // This is faster than calculating the exact length of each label. // e.g., getComputedTextLength(), slice()... function truncate(text, width) { text.each(function () { var parent = this.parentNode, $d3parent = d3.select(parent); var gw = $d3parent.node().getBBox(); var x = (Math.min(gw.width, width) / 2) * -1; // adjust wrapper width if ('svg' == parent.nodeName) { $d3parent.attr('width', width).attr('x', x); } // wrap within an svg else { $d3parent.insert('svg', function () { return this; }.bind(this)) .attr('class', 'wrap-text') .attr('width', width) .attr('x', x) .append(function () { return this; }.bind(this)); } }); } function AreaChart(dualYaxis) { var opts = {}; var margin = { top : 20, right : 50, bottom : 40, left : 50, }, height = 170, nTicks = 10, padding = 10, width = 760; var labels = { x: 'Unnamed', y0: 'Unnamed', y1: 'Unnamed' }; var format = { x: null, y0: null, y1: null}; var xValue = function (d) { return d[0]; }, yValue0 = function (d) { return d[1]; }, yValue1 = function (d) { return d[2]; }; var xScale = d3.scale.ordinal(); var yScale0 = d3.scale.linear().nice(); var yScale1 = d3.scale.linear().nice(); var xAxis = d3.svg.axis() .scale(xScale) .orient('bottom') .tickFormat(function (d) { if (format.x) return GoAccess.Util.fmtValue(d, format.x); return d; }); var yAxis0 = d3.svg.axis() .scale(yScale0) .orient('left') .tickFormat(function (d) { return d3.format('.2s')(d); }); var yAxis1 = d3.svg.axis() .scale(yScale1) .orient('right') .tickFormat(function (d) { if (format.y1) return GoAccess.Util.fmtValue(d, format.y1); return d3.format('.2s')(d); }); var xGrid = d3.svg.axis() .scale(xScale) .orient('bottom'); var yGrid = d3.svg.axis() .scale(yScale0) .orient('left'); var area0 = d3.svg.area() .interpolate('cardinal') .x(X) .y(Y0); var area1 = d3.svg.area() .interpolate('cardinal') .x(X) .y(Y1); var line0 = d3.svg.line() .interpolate('cardinal') .x(X) .y(Y0); var line1 = d3.svg.line() .interpolate('cardinal') .x(X) .y(Y1); // The x-accessor for the path generator; xScale ∘ xValue. function X(d) { return xScale(d[0]); } // The x-accessor for the path generator; yScale0 yValue0. function Y0(d) { return yScale0(d[1]); } // The x-accessor for the path generator; yScale0 yValue0. function Y1(d) { return yScale1(d[2]); } function innerW() { return width - margin.left - margin.right; } function innerH() { return height - margin.top - margin.bottom; } function getXTicks(data) { if (data.length < nTicks) return xScale.domain(); return d3.range(0, data.length, Math.ceil(data.length / nTicks)).map(function (d) { return xScale.domain()[d]; }); } function getYTicks(scale) { var domain = scale.domain(); return d3.range(domain[0], domain[1], Math.ceil(domain[1] / nTicks)); } // Convert data to standard representation greedily; // this is needed for nondeterministic accessors. function mapData(data) { var _datum = function (d, i) { var datum = [xValue.call(data, d, i), yValue0.call(data, d, i)]; dualYaxis && datum.push(yValue1.call(data, d, i)); return datum; }; return data.map(function (d, i) { return _datum(d, i); }); } function updateScales(data) { // Update the x-scale. xScale.domain(data.map(function (d) { return d[0]; })) .rangePoints([0, innerW()], 1); // Update the y-scale. yScale0.domain([0, d3.max(data, function (d) { return d[1]; })]) .range([innerH(), 0]); // Update the y-scale. dualYaxis && yScale1.domain([0, d3.max(data, function (d) { return d[2]; })]) .range([innerH(), 0]); } function toggleOpacity(ele, op) { d3.select(ele.parentNode).selectAll('.' + (ele.getAttribute('data-yaxis') == 'y0' ? 'y1' : 'y0')).attr('style', op); } function setLegendLabels(svg) { // Legend Color var rect = svg.selectAll('rect.legend.y0').data([null]); rect.enter().append('rect') .attr('class', 'legend y0') .attr('data-yaxis', 'y0') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 15)); rect .attr('x', (width / 2) - 100); // Legend Labels var text = svg.selectAll('text.legend.y0').data([null]); text.enter().append('text') .attr('class', 'legend y0') .attr('data-yaxis', 'y0') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 6)); text .attr('x', (width / 2) - 85) .text(labels.y0); if (!dualYaxis) return; // Legend Labels rect = svg.selectAll('rect.legend.y1').data([null]); rect.enter().append('rect') .attr('class', 'legend y1') .attr('data-yaxis', 'y1') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 15)); rect .attr('x', (width / 2)); // Legend Labels text = svg.selectAll('text.legend.y1').data([null]); text.enter().append('text') .attr('class', 'legend y1') .attr('data-yaxis', 'y1') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 6)); text .attr('x', (width / 2) + 15) .text(labels.y1); } function setAxisLabels(svg) { // Labels svg.selectAll('text.axis-label.y0').data([null]) .enter().append('text') .attr('class', 'axis-label y0') .attr('y', 10) .attr('x', 53) .text(labels.y0); if (!dualYaxis) return; // Labels var tEnter = svg.selectAll('text.axis-label.y1').data([null]); tEnter.enter().append('text') .attr('class', 'axis-label y1') .attr('y', 10) .text(labels.y1); dualYaxis && tEnter .attr('x', width - 25); } function createSkeleton(svg) { // Otherwise, create the skeletal chart. var gEnter = svg.enter().append('svg').append('g'); // Lines gEnter.append('g') .attr('class', 'line line0 y0'); dualYaxis && gEnter.append('g') .attr('class', 'line line1 y1'); // Areas gEnter.append('g') .attr('class', 'area area0 y0'); dualYaxis && gEnter.append('g') .attr('class', 'area area1 y1'); // Points gEnter.append('g') .attr('class', 'points y0'); dualYaxis && gEnter.append('g') .attr('class', 'points y1'); // Grid gEnter.append('g') .attr('class', 'x grid'); gEnter.append('g') .attr('class', 'y grid'); // Axis gEnter.append('g') .attr('class', 'x axis'); gEnter.append('g') .attr('class', 'y0 axis'); dualYaxis && gEnter.append('g') .attr('class', 'y1 axis'); // Rects gEnter.append('g') .attr('class', 'rects'); setAxisLabels(svg); setLegendLabels(svg); // Mouseover line gEnter.append('line') .attr('y2', innerH()) .attr('y1', 0) .attr('class', 'indicator'); } function pathLen(d) { return d.node().getTotalLength(); } function addLine(g, data, line, cName) { // Update the line path. var path = g.select('g.' + cName).selectAll('path.' + cName) .data([data]); // enter path .enter() .append('svg:path') .attr('d', line) .attr('class', cName) .attr('stroke-dasharray', function (d) { var pl = pathLen(d3.select(this)); return pl + ' ' + pl; }) .attr('stroke-dashoffset', function (d) { return pathLen(d3.select(this)); }); // update path .attr('d', line) .transition() .attr('stroke-dasharray', function (d) { var pl = pathLen(d3.select(this)); return pl + ' ' + pl; }) .duration(2000) .attr('stroke-dashoffset', 0); // remove elements path.exit().remove(); } function addArea(g, data, cb, cName) { // Update the area path. var area = g.select('g.' + cName).selectAll('path.' + cName) .data([data]); area .enter() .append('svg:path') .attr('class', cName); area .attr('d', cb); // remove elements area.exit().remove(); } // Update the area path and lines. function addAreaLines(g, data) { // Update the area path. addArea(g, data, area0.y0(yScale0.range()[0]), 'area0'); // Update the line path. addLine(g, data, line0, 'line0'); // Update the area path. addArea(g, data, area1.y1(yScale1.range()[0]), 'area1'); // Update the line path. addLine(g, data, line1, 'line1'); } // Update chart points function addPoints(g, data) { var radius = data.length > 100 ? 1 : 2.5; var points = g.select('g.points.y0').selectAll('circle.point') .data(data); points .enter() .append('svg:circle') .attr('r', radius) .attr('class', 'point'); points .attr('cx', function (d) { return xScale(d[0]); }) .attr('cy', function (d) { return yScale0(d[1]); }); // remove elements points.exit().remove(); if (!dualYaxis) return; points = g.select('g.points.y1').selectAll('circle.point') .data(data); points .enter() .append('svg:circle') .attr('r', radius) .attr('class', 'point'); points .attr('cx', function (d) { return xScale(d[0]); }) .attr('cy', function (d) { return yScale1(d[2]); }); // remove elements points.exit().remove(); } function addAxis(g, data) { var xTicks = getXTicks(data); var tickDistance = xTicks.length > 1 ? (xScale(xTicks[1]) - xScale(xTicks[0])) : innerW(); var labelW = tickDistance - padding; // Update the x-axis. g.select('.x.axis') .attr('transform', 'translate(0,' + yScale0.range()[0] + ')') .call(xAxis.tickValues(xTicks)) .selectAll(".tick text") .call(truncate, labelW > 0 ? labelW : innerW()); // Update the y0-axis. g.select('.y0.axis') .call(yAxis0.tickValues(getYTicks(yScale0))); if (!dualYaxis) return; // Update the y1-axis. g.select('.y1.axis') .attr('transform', 'translate(' + innerW() + ', 0)') .call(yAxis1.tickValues(getYTicks(yScale1))); } // Update the X-Y grid. function addGrid(g, data) { g.select('.x.grid') .attr('transform', 'translate(0,' + yScale0.range()[0] + ')') .call(xGrid .tickValues(getXTicks(data)) .tickSize(-innerH(), 0, 0) .tickFormat('') ); g.select('.y.grid') .call(yGrid .tickValues(getYTicks(yScale0)) .tickSize(-innerW(), 0, 0) .tickFormat('') ); } function formatTooltip(data, i) { var d = data.slice(0); d[0] = (format.x) ? GoAccess.Util.fmtValue(d[0], format.x) : d[0]; d[1] = (format.y0) ? GoAccess.Util.fmtValue(d[1], format.y0) : d3.format(',')(d[1]); dualYaxis && (d[2] = (format.y1) ? GoAccess.Util.fmtValue(d[2], format.y1) : d3.format(',')(d[2])); var template = d3.select('#tpl-chart-tooltip').html(); return Hogan.compile(template).render({ 'data': d }); } function mouseover(_self, selection, data, idx) { var tooltip = selection.select('.chart-tooltip-wrap'); tooltip.html(formatTooltip(data, idx)) .style('left', (xScale(data[0])) + 'px') .style('top', (d3.mouse(_self)[1] + 10) + 'px') .style('display', 'block'); selection.select('line.indicator') .style('display', 'block') .attr('transform', 'translate(' + xScale(data[0]) + ',' + 0 + ')'); } function mouseout(selection, g) { var tooltip = selection.select('.chart-tooltip-wrap'); tooltip.style('display', 'none'); g.select('line.indicator').style('display', 'none'); } function addRects(selection, g, data) { var w = (innerW() / data.length); var rects = g.select('g.rects').selectAll('rect') .data(data); rects .enter() .append('svg:rect') .attr('height', innerH()) .attr('class', 'point'); rects .attr('width', d3.functor(w)) .attr('x', function (d, i) { return (w * i); }) .attr('y', 0) .on('mousemove', function (d, i) { mouseover(this, selection, d, i); }) .on('mouseleave', function (d, i) { mouseout(selection, g); }); // remove elements rects.exit().remove(); } function chart(selection) { selection.each(function (data) { // normalize data data = mapData(data); // updates X-Y scales updateScales(data); // Select the svg element, if it exists. var svg = d3.select(this).selectAll('svg').data([data]); createSkeleton(svg); // Update the outer dimensions. svg.attr({ 'width': width, 'height': height }); // Update the inner dimensions. var g = svg.select('g') .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); // Add grid addGrid(g, data); // Add chart lines and areas addAreaLines(g, data); // Add chart points addPoints(g, data); // Add axis addAxis(g, data); // Add rects addRects(selection, g, data); }); } chart.opts = function (_) { if (!arguments.length) return opts; opts = _; return chart; }; chart.format = function (_) { if (!arguments.length) return format; format = _; return chart; }; chart.labels = function (_) { if (!arguments.length) return labels; labels = _; return chart; }; chart.margin = function (_) { if (!arguments.length) return margin; margin = _; return chart; }; chart.width = function (_) { if (!arguments.length) return width; width = _; return chart; }; chart.height = function (_) { if (!arguments.length) return height; height = _; return chart; }; chart.x = function (_) { if (!arguments.length) return xValue; xValue = _; return chart; }; chart.y0 = function (_) { if (!arguments.length) return yValue0; yValue0 = _; return chart; }; chart.y1 = function (_) { if (!arguments.length) return yValue1; yValue1 = _; return chart; }; return chart; } function BarChart(dualYaxis) { var opts = {}; var margin = { top : 20, right : 50, bottom : 40, left : 50, }, height = 170, nTicks = 10, padding = 10, width = 760; var labels = { x: 'Unnamed', y0: 'Unnamed', y1: 'Unnamed' }; var format = { x: null, y0: null, y1: null}; var xValue = function (d) { return d[0]; }, yValue0 = function (d) { return d[1]; }, yValue1 = function (d) { return d[2]; }; var xScale = d3.scale.ordinal(); var yScale0 = d3.scale.linear().nice(); var yScale1 = d3.scale.linear().nice(); var xAxis = d3.svg.axis() .scale(xScale) .orient('bottom') .tickFormat(function (d) { if (format.x) return GoAccess.Util.fmtValue(d, format.x); return d; }); var yAxis0 = d3.svg.axis() .scale(yScale0) .orient('left') .tickFormat(function (d) { return d3.format('.2s')(d); }); var yAxis1 = d3.svg.axis() .scale(yScale1) .orient('right') .tickFormat(function (d) { if (format.y1) return GoAccess.Util.fmtValue(d, format.y1); return d3.format('.2s')(d); }); var xGrid = d3.svg.axis() .scale(xScale) .orient('bottom'); var yGrid = d3.svg.axis() .scale(yScale0) .orient('left'); function innerW() { return width - margin.left - margin.right; } function innerH() { return height - margin.top - margin.bottom; } function getXTicks(data) { if (data.length < nTicks) return xScale.domain(); return d3.range(0, data.length, Math.ceil(data.length / nTicks)).map(function (d) { return xScale.domain()[d]; }); } function getYTicks(scale) { var domain = scale.domain(); return d3.range(domain[0], domain[1], Math.ceil(domain[1] / nTicks)); } // Convert data to standard representation greedily; // this is needed for nondeterministic accessors. function mapData(data) { var _datum = function (d, i) { var datum = [xValue.call(data, d, i), yValue0.call(data, d, i)]; dualYaxis && datum.push(yValue1.call(data, d, i)); return datum; }; return data.map(function (d, i) { return _datum(d, i); }); } function updateScales(data) { // Update the x-scale. xScale.domain(data.map(function (d) { return d[0]; })) .rangeBands([0, innerW()], 0.1); // Update the y-scale. yScale0.domain([0, d3.max(data, function (d) { return d[1]; })]) .range([innerH(), 0]); // Update the y-scale. dualYaxis && yScale1.domain([0, d3.max(data, function (d) { return d[2]; })]) .range([innerH(), 0]); } function toggleOpacity(ele, op) { d3.select(ele.parentNode).selectAll('.' + (ele.getAttribute('data-yaxis') == 'y0' ? 'y1' : 'y0')).attr('style', op); } function setLegendLabels(svg) { // Legend Color var rect = svg.selectAll('rect.legend.y0').data([null]); rect.enter().append('rect') .attr('class', 'legend y0') .attr('data-yaxis', 'y0') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 15)); rect .attr('x', (width / 2) - 100); // Legend Labels var text = svg.selectAll('text.legend.y0').data([null]); text.enter().append('text') .attr('class', 'legend y0') .attr('data-yaxis', 'y0') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 6)); text .attr('x', (width / 2) - 85) .text(labels.y0); if (!dualYaxis) return; // Legend Labels rect = svg.selectAll('rect.legend.y1').data([null]); rect.enter().append('rect') .attr('class', 'legend y1') .attr('data-yaxis', 'y1') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 15)); rect .attr('x', (width / 2)); // Legend Labels text = svg.selectAll('text.legend.y1').data([null]); text.enter().append('text') .attr('class', 'legend y1') .attr('data-yaxis', 'y1') .on('mousemove', function (d, i) { toggleOpacity(this, 'opacity:0.1'); }) .on('mouseleave', function (d, i) { toggleOpacity(this, null); }) .attr('y', (height - 6)); text .attr('x', (width / 2) + 15) .text(labels.y1); } function setAxisLabels(svg) { // Labels svg.selectAll('text.axis-label.y0').data([null]) .enter().append('text') .attr('class', 'axis-label y0') .attr('y', 10) .attr('x', 53) .text(labels.y0); if (!dualYaxis) return; // Labels var tEnter = svg.selectAll('text.axis-label.y1').data([null]); tEnter.enter().append('text') .attr('class', 'axis-label y1') .attr('y', 10) .text(labels.y1); dualYaxis && tEnter .attr('x', width - 25); } function createSkeleton(svg) { // Otherwise, create the skeletal chart. var gEnter = svg.enter().append('svg').append('g'); // Grid gEnter.append('g') .attr('class', 'x grid'); gEnter.append('g') .attr('class', 'y grid'); // Axis gEnter.append('g') .attr('class', 'x axis'); gEnter.append('g') .attr('class', 'y0 axis'); dualYaxis && gEnter.append('g') .attr('class', 'y1 axis'); // Bars gEnter.append('g') .attr('class', 'bars y0'); dualYaxis && gEnter.append('g') .attr('class', 'bars y1'); // Rects gEnter.append('g') .attr('class', 'rects'); setAxisLabels(svg); setLegendLabels(svg); // Mouseover line gEnter.append('line') .attr('y2', innerH()) .attr('y1', 0) .attr('class', 'indicator'); } // Update the area path and lines. function addBars(g, data) { var bars = g.select('g.bars.y0').selectAll('rect.bar') .data(data); // enter bars .enter() .append('svg:rect') .attr('class', 'bar') .attr('height', 0) .attr('width', function (d, i) { return xScale.rangeBand() / 2; }) .attr('x', function (d, i) { return xScale(d[0]); }) .attr('y', function (d, i) { return innerH(); }); // update bars .attr('width', xScale.rangeBand() / 2) .attr('x', function (d) { return xScale(d[0]); }) .transition() .delay(function (d, i) { return i / data.length * 1000; }) .duration(500) .attr('height', function (d, i) { return innerH() - yScale0(d[1]); }) .attr('y', function (d, i) { return yScale0(d[1]); }); // remove elements bars.exit().remove(); if (!dualYaxis) return; bars = g.select('g.bars.y1').selectAll('rect.bar') .data(data); // enter bars .enter() .append('svg:rect') .attr('class', 'bar') .attr('height', 0) .attr('width', function (d, i) { return xScale.rangeBand() / 2; }) .attr('x', function (d) { return (xScale(d[0]) + xScale.rangeBand() / 2); }) .attr('y', function (d, i) { return innerH(); }); // update bars .attr('width', xScale.rangeBand() / 2) .attr('x', function (d) { return (xScale(d[0]) + xScale.rangeBand() / 2); }) .transition() .delay(function (d, i) { return i / data.length * 1000; }) .duration(500) .attr('height', function (d, i) { return innerH() - yScale1(d[2]); }) .attr('y', function (d, i) { return yScale1(d[2]); }); // remove elements bars.exit().remove(); } function addAxis(g, data) { var xTicks = getXTicks(data); var tickDistance = xTicks.length > 1 ? (xScale(xTicks[1]) - xScale(xTicks[0])) : innerW(); var labelW = tickDistance - padding; // Update the x-axis. g.select('.x.axis') .attr('transform', 'translate(0,' + yScale0.range()[0] + ')') .call(xAxis.tickValues(xTicks)) .selectAll(".tick text") .call(truncate, labelW > 0 ? labelW : innerW()); // Update the y0-axis. g.select('.y0.axis') .call(yAxis0.tickValues(getYTicks(yScale0))); if (!dualYaxis) return; // Update the y1-axis. g.select('.y1.axis') .attr('transform', 'translate(' + innerW() + ', 0)') .call(yAxis1.tickValues(getYTicks(yScale1))); } // Update the X-Y grid. function addGrid(g, data) { g.select('.x.grid') .attr('transform', 'translate(0,' + yScale0.range()[0] + ')') .call(xGrid .tickValues(getXTicks(data)) .tickSize(-innerH(), 0, 0) .tickFormat('') ); g.select('.y.grid') .call(yGrid .tickValues(getYTicks(yScale0)) .tickSize(-innerW(), 0, 0) .tickFormat('') ); } function formatTooltip(data, i) { var d = data.slice(0); d[0] = (format.x) ? GoAccess.Util.fmtValue(d[0], format.x) : d[0]; d[1] = (format.y0) ? GoAccess.Util.fmtValue(d[1], format.y0) : d3.format(',')(d[1]); dualYaxis && (d[2] = (format.y1) ? GoAccess.Util.fmtValue(d[2], format.y1) : d3.format(',')(d[2])); var template = d3.select('#tpl-chart-tooltip').html(); return Hogan.compile(template).render({ 'data': d }); } function mouseover(_self, selection, data, idx) { var left = xScale(data[0]) + (xScale.rangeBand() / 2); var tooltip = selection.select('.chart-tooltip-wrap'); tooltip.html(formatTooltip(data, idx)) .style('left', left + 'px') .style('top', (d3.mouse(_self)[1] + 10) + 'px') .style('display', 'block'); selection.select('line.indicator') .style('display', 'block') .attr('transform', 'translate(' + left + ',' + 0 + ')'); } function mouseout(selection, g) { var tooltip = selection.select('.chart-tooltip-wrap'); tooltip.style('display', 'none'); g.select('line.indicator').style('display', 'none'); } function addRects(selection, g, data) { var w = (innerW() / data.length); var rects = g.select('g.rects').selectAll('rect') .data(data); rects .enter() .append('svg:rect') .attr('height', innerH()) .attr('class', 'point'); rects .attr('width', d3.functor(w)) .attr('x', function (d, i) { return (w * i); }) .attr('y', 0) .on('mousemove', function (d, i) { mouseover(this, selection, d, i); }) .on('mouseleave', function (d, i) { mouseout(selection, g); }); // remove elements rects.exit().remove(); } function chart(selection) { selection.each(function (data) { // normalize data data = mapData(data); // updates X-Y scales updateScales(data); // Select the svg element, if it exists. var svg = d3.select(this).selectAll('svg').data([data]); createSkeleton(svg); // Update the outer dimensions. svg.attr({ 'width': width, 'height': height }); // Update the inner dimensions. var g = svg.select('g') .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); // Add grid addGrid(g, data); // Add axis addAxis(g, data); // Add chart lines and areas addBars(g, data); // Add rects addRects(selection, g, data); }); } chart.opts = function (_) { if (!arguments.length) return opts; opts = _; return chart; }; chart.format = function (_) { if (!arguments.length) return format; format = _; return chart; }; chart.labels = function (_) { if (!arguments.length) return labels; labels = _; return chart; }; chart.width = function (_) { if (!arguments.length) return width; width = _; return chart; }; chart.height = function (_) { if (!arguments.length) return height; height = _; return chart; }; chart.x = function (_) { if (!arguments.length) return xValue; xValue = _; return chart; }; chart.y0 = function (_) { if (!arguments.length) return yValue0; yValue0 = _; return chart; }; chart.y1 = function (_) { if (!arguments.length) return yValue1; yValue1 = _; return chart; }; return chart; } �������������������������goaccess-1.3/resources/js/d3.v3.min.js��������������������������������������������������������������0000644�0000000�0000000�00000447147�13274713665�014475� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=da.length;r>e;++e){var u=da[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function Z(n){return ya(n,Sa),n}function V(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t0&&(n=n.slice(0,a));var l=ka.get(n);return l&&(n=l,c=B),a?t?u:r:t?b:i}function $(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Aa,u="click"+r,i=ta.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ea&&(Ea="onselectstart"in e?!1:x(e.style,"userSelect")),Ea){var o=n(e).style,a=o[Ea];o[Ea]="none"}return function(n){if(i.on(r,null),Ea&&(o[Ea]=a),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Na){var i=t(n);if(i.scrollX||i.scrollY){r=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Na=!(o.f||o.e),r.remove()}}return Na?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ta.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?qa:Math.acos(n)}function tt(n){return n>1?Ra:-1>n?-Ra:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Da)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Xa,r=pt(r)*$a,i=pt(i)*Ba,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Pa,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,n>>8&255,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=Ga.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Xa),u=vt((.2126729*n+.7151522*t+.072175*e)/$a),i=vt((.0193339*n+.119192*t+.9503041*e)/Ba);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nt(t,e,n,r)}}function Nt(n,t,e,r){function u(){var n,t=c.status;if(!t&&zt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return void o.error.call(i,r)}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(Ct(r))}function Ct(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function zt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qt(){var n=Lt(),t=Tt()-n;t>24?(isFinite(t)&&(clearTimeout(tc),tc=setTimeout(qt,t)),nc=0):(nc=1,rc(qt))}function Lt(){var n=Date.now();for(ec=Ka;ec;)n>=ec.t&&(ec.f=ec.c(n-ec.t)),ec=ec.n;return n}function Tt(){for(var n,t=Ka,e=1/0;t;)t.f?t=n?n.n=t.n:Ka=t.n:(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Pt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=ic.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=oc.get(g)||Ut;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Ut(n){return n+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new cc(e-1)),1),e}function i(n,e){return t(n=new cc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{cc=jt;var r=new jt;return r._=n,o(r,t,e)}finally{cc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ht(n);return c.floor=c,c.round=Ht(r),c.ceil=Ht(u),c.offset=Ht(i),c.range=a,n}function Ht(n){return function(t,e){try{cc=jt;var r=new jt;return r._=t,n(r,e)._}finally{cc=Date}}}function Ot(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++aa;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in sc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{cc=jt;var t=new cc;return t._=n,r(t)}finally{cc=Date}}var r=t(n);return e.parse=function(n){try{cc=jt;var t=r.parse(n);return t&&t._}finally{cc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ae;var M=ta.map(),x=Yt(v),b=Zt(v),_=Yt(d),w=Zt(d),S=Yt(m),k=Zt(m),E=Yt(y),A=Zt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+ac.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(ac.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(ac.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:Qt,e:Qt,H:te,I:te,j:ne,L:ue,m:Kt,M:ee,p:s,S:re,U:Xt,w:Vt,W:$t,x:c,X:l,y:Wt,Y:Bt,Z:Jt,"%":oe};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Yt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Zt(n){for(var t=new l,e=-1,r=n.length;++e68?1900:2e3)}function Kt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Qt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function ne(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function te(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ee(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function re(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ue(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=ga(t)/60|0,u=ga(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function oe(n,t,e){hc.lastIndex=0;var r=hc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ae(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);yc.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;Mc.point=function(o,a){Mc.point=n,r=(t=o)*Da,u=Math.cos(a=(e=a)*Da/2+qa/4),i=Math.sin(a)},Mc.lineEnd=function(){n(t,e)}}function pe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ve(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function me(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ye(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Me(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function xe(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function be(n,t){return ga(n[0]-t[0])a;++a)u.point((e=n[a])[0],e[1]);return void u.lineEnd()}var c=new qe(e,n,null,!0),l=new qe(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new qe(r,n,null,!1),l=new qe(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),ze(i),ze(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ze(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Te))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=Fe(m,p);g.length?(b||(i.polygonStart(),b=!0),Ce(g,De,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Re(),x=t(M),b=!1;return y}}function Te(n){return n.length>1}function Re(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function De(n,t){return((n=n.x)[0]<0?n[1]-Ra-Ca:Ra-n[1])-((t=t.x)[0]<0?t[1]-Ra-Ca:Ra-t[1])}function Pe(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?qa:-qa,c=ga(i-e);ga(c-qa)0?Ra:-Ra),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=qa&&(ga(e-u)Ca?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function je(n,t,e,r){var u;if(null==n)u=e*Ra,r.point(-qa,u),r.point(0,u),r.point(qa,u),r.point(qa,0),r.point(qa,-u),r.point(0,-u),r.point(-qa,-u),r.point(-qa,0),r.point(-qa,u);else if(ga(n[0]-t[0])>Ca){var i=n[0]a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+qa/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+qa/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>qa,k=p*M;if(yc.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*La:b,S^h>=e^m>=e){var E=de(pe(f),pe(n));Me(E);var A=de(u,E);Me(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ca>i||Ca>i&&0>yc)^1&o}function He(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?qa:-qa),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(be(e,g)||be(p,g))&&(p[0]+=Ca,p[1]+=Ca,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&be(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=pe(n),u=pe(t),o=[1,0,0],a=de(r,u),c=ve(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=de(o,a),p=ye(o,f),v=ye(a,h);me(p,v);var d=g,m=ve(p,d),y=ve(d,d),M=m*m-y*(ve(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=ye(d,(-m-x)/y);if(me(b,p),b=xe(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=ga(A-qa)A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(ga(b[0]-w)qa^(w<=b[0]&&b[0]<=S)){var z=ye(d,(-m+x)/y);return me(z,p),[b,xe(z)]}}}function u(t,e){var r=o?n:qa-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ga(i)>Ca,c=gr(n,6*Da);return Le(t,e,c,o?[0,-n]:[-qa,n-qa])}function Oe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return ga(r[0]-n)0?0:3:ga(r[0]-e)0?2:1:ga(r[1]-t)0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Tc,Math.min(Tc,n)),t=Math.max(-Tc,Math.min(Tc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=Re(),N=Oe(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&Ce(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ye(n){var t=0,e=qa/3,r=ir(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*qa/180,e=n[1]*qa/180):[t/qa*180,e/qa*180]},u}function Ze(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Ve(){function n(n,t){Dc+=u*n-r*t,r=n,u=t}var t,e,r,u;Hc.point=function(i,o){Hc.point=n,t=r=i,e=u=o},Hc.lineEnd=function(){n(t,e)}}function Xe(n,t){Pc>n&&(Pc=n),n>jc&&(jc=n),Uc>t&&(Uc=t),t>Fc&&(Fc=t)}function $e(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Be(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Be(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Be(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function We(n,t){_c+=n,wc+=t,++Sc}function Je(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);kc+=o*(t+n)/2,Ec+=o*(e+r)/2,Ac+=o,We(t=n,e=r)}var t,e;Ic.point=function(r,u){Ic.point=n,We(t=r,e=u)}}function Ge(){Ic.point=We}function Ke(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);kc+=o*(r+n)/2,Ec+=o*(u+t)/2,Ac+=o,o=u*n-r*t,Nc+=o*(r+n),Cc+=o*(u+t),zc+=3*o,We(r=n,u=t)}var t,e,r,u;Ic.point=function(i,o){Ic.point=n,We(t=r=i,e=u=o)},Ic.lineEnd=function(){n(t,e)}}function Qe(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,La)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function nr(n){function t(n){return(a?r:e)(n)}function e(t){return rr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=pe([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c },polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ga(ga(w)-1)i||ga((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Da),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function tr(n){var t=nr(function(t,e){return n([t*Pa,e*Pa])});return function(n){return or(t(n))}}function er(n){this.stream=n}function rr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ur(n){return ir(function(){return n})()}function ir(n){function t(n){return n=a(n[0]*Da,n[1]*Da),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Pa,n[1]*Pa]}function r(){a=Ae(o=lr(m,M,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=nr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Lc,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=or(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Lc):He((w=+n)*Da),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Da,d=n[1]%360*Da,r()):[v*Pa,d*Pa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Da,M=n[1]%360*Da,x=n.length>2?n[2]%360*Da:0,r()):[m*Pa,M*Pa,x*Pa]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function or(n){return rr(n,function(t,e){n.point(t*Da,e*Da)})}function ar(n,t){return[n,t]}function cr(n,t){return[n>qa?n-La:-qa>n?n+La:n,t]}function lr(n,t,e){return n?t||e?Ae(fr(n),hr(t,e)):fr(n):t||e?hr(t,e):cr}function sr(n){return function(t,e){return t+=n,[t>qa?t-La:-qa>t?t+La:t,e]}}function fr(n){var t=sr(n);return t.invert=sr(-n),t}function hr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function gr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=pr(e,u),i=pr(e,i),(o>0?i>u:u>i)&&(u+=o*La)):(u=n+o*La,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=xe([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function pr(n,t){var e=pe(t);e[0]-=n,Me(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ca)%(2*Math.PI)}function vr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function dr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function mr(n){return n.source}function yr(n){return n.target}function Mr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Pa,Math.atan2(o,Math.sqrt(r*r+u*u))*Pa]}:function(){return[n*Pa,t*Pa]};return p.distance=h,p}function xr(){function n(n,u){var i=Math.sin(u*=Da),o=Math.cos(u),a=ga((n*=Da)-t),c=Math.cos(a);Yc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Zc.point=function(u,i){t=u*Da,e=Math.sin(i*=Da),r=Math.cos(i),Zc.point=n},Zc.lineEnd=function(){Zc.point=Zc.lineEnd=b}}function br(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function _r(n,t){function e(n,t){o>0?-Ra+Ca>t&&(t=-Ra+Ca):t>Ra-Ca&&(t=Ra-Ca);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(qa/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Ra]},e):Sr}function wr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ga(u)u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function zr(n,t){return n[0]-t[0]||n[1]-t[1]}function qr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Lr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Tr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Rr(){tu(this),this.edge=this.site=this.circle=null}function Dr(n){var t=el.pop()||new Rr;return t.site=n,t}function Pr(n){Xr(n),Qc.remove(n),el.push(n),tu(n)}function Ur(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Pr(n);for(var c=i;c.circle&&ga(e-c.circle.x)s;++s)l=a[s],c=a[s-1],Kr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Jr(c.site,l.site,null,u),Vr(c),Vr(l)}function jr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Qc._;a;)if(r=Fr(a,o)-i,r>Ca)a=a.L;else{if(u=i-Hr(a,o),!(u>Ca)){r>-Ca?(t=a.P,e=a):u>-Ca?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Dr(n);if(Qc.insert(t,c),t||e){if(t===e)return Xr(t),e=Dr(t.site),Qc.insert(c,e),c.edge=e.edge=Jr(t.site,c.site),Vr(t),void Vr(e);if(!e)return void(c.edge=Jr(t.site,c.site));Xr(t),Xr(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Kr(e.edge,l,p,x),c.edge=Jr(l,n,null,x),e.edge=Jr(n,p,null,x),Vr(t),Vr(e)}}function Fr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Hr(n,t){var e=n.N;if(e)return Fr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Or(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Kc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(ga(r-t)>Ca||ga(u-e)>Ca)&&(a.splice(o,0,new Qr(Gr(i.site,s,ga(r-f)Ca?{x:f,y:ga(t-f)Ca?{x:ga(e-p)Ca?{x:h,y:ga(t-h)Ca?{x:ga(e-g)=-za)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=rl.pop()||new Zr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=tl._;M;)if(m.yd||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.yr||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.yg){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.xi||f>o||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function gu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function pu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=mu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function vu(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function du(n,t){var e,r,u,i=il.lastIndex=ol.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=il.exec(n))&&(r=ol.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:vu(e,r)})),i=ol.lastIndex;return ir;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function mu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function yu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(mu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Mu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function xu(n){return function(t){return 1-n(1-t)}}function bu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function _u(n){return n*n}function wu(n){return n*n*n}function Su(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function ku(n){return function(t){return Math.pow(t,n)}}function Eu(n){return 1-Math.cos(n*Ra)}function Au(n){return Math.pow(2,10*(n-1))}function Nu(n){return 1-Math.sqrt(1-n*n)}function Cu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/La*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*La/t)}}function zu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function qu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Lu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Tu(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Pu(n){var t=[n.a,n.b],e=[n.c,n.d],r=ju(t),u=Uu(t,e),i=ju(Fu(e,t,-u))||0;t[0]*e[1]180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vu(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:vu(g[0],p[0])},{i:e-2,x:vu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i=0;)e.push(u[r])}function Qu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++oe;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function si(n){return n.reduce(fi,0)}function fi(n,t){return n+t[1]}function hi(n,t){return gi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function gi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function pi(n){return[ta.min(n),ta.max(n)]}function vi(n,t){return n.value-t.value}function di(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function mi(n,t){n._pack_next=t,t._pack_prev=n}function yi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Mi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(xi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],wi(r,u,i),t(i),di(r,i),r._pack_prev=i,di(i,u),u=r._pack_next,o=3;l>o;o++){wi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(yi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!yi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.ro;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(bi)}}function xi(n){n._pack_next=n._pack_prev=n}function bi(n){delete n._pack_next,delete n._pack_prev}function _i(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Ci(n,t,e){return n.a.parent===t.parent?n.a:e}function zi(n){return 1+ta.max(n,function(n){return n.y})}function qi(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Li(n){var t=n.children;return t&&t.length?Li(t[0]):n}function Ti(n){var t,e=n.children;return e&&(t=e.length)?Ti(e[t-1]):n}function Ri(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Di(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Pi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ui(n){return n.rangeExtent?n.rangeExtent():Pi(n.range())}function ji(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Fi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Hi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ml}function Oi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Oi:ji,c=r?Iu:Ou;return o=u(n,t,c,e),a=u(t,n,c,mu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Du)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Xi(n,t)},i.tickFormat=function(t,e){return $i(n,t,e)},i.nice=function(t){return Zi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Yi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Zi(n,t){return Fi(n,Hi(Vi(n,t)[2]))}function Vi(n,t){null==t&&(t=10);var e=Pi(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Xi(n,t){return ta.range.apply(ta,Vi(n,t))}function $i(n,t,e){var r=Vi(n,t);if(e){var u=ic.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(ga(r[0]),ga(r[1])));return u[7]||(u[7]="."+Bi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Wi(u[8],r)),e=u.join("")}else e=",."+Bi(r[2])+"f";return ta.format(e)}function Bi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Wi(n,t){var e=Bi(t[2]);return n in yl?Math.abs(e-Bi(Math.max(ga(t[0]),ga(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Ji(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Fi(r.map(u),e?Math:xl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Pi(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++0;h--)o.push(i(l)*h);for(l=0;o[l]c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Ml;arguments.length<2?t=Ml:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Ji(n.copy(),t,e,r)},Yi(o,n)}function Gi(n,t,e){function r(t){return n(u(t))}var u=Ki(t),i=Ki(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Xi(e,n)},r.tickFormat=function(n,t){return $i(e,n,t)},r.nice=function(n){return r.domain(Zi(e,n))},r.exponent=function(o){return arguments.length?(u=Ki(t=o),i=Ki(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Gi(n.copy(),t,e)},Yi(r,n)}function Ki(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Qi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new l;for(var i,o=-1,a=r.length;++oe?[0/0,0/0]:[e>0?a[e-1]:n[0],et?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return to(n,t,e)},u()}function eo(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return eo(n,t)},e}function ro(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Xi(n,t)},t.tickFormat=function(t,e){return $i(n,t,e)},t.copy=function(){return ro(n)},t}function uo(){return 0}function io(n){return n.innerRadius}function oo(n){return n.outerRadius}function ao(n){return n.startAngle}function co(n){return n.endAngle}function lo(n){return n&&n.padAngle}function so(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function fo(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function ho(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f1&&u.push("H",r[0]),u.join("")}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function To(n){return n.length<3?go(n):n[0]+_o(n,Lo(n))}function Ro(n){for(var t,e,r,u=-1,i=n.length;++ur)return s();var u=i[i.active];u&&(--i.count,delete i[i.active],u.event&&u.event.interrupt.call(n,n.__data__,u.index)),i.active=r,o.event&&o.event.start.call(n,n.__data__,t),o.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&v.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return p.c=l(e||1)?Ne:l,1},0,a)}function l(e){if(i.active!==r)return 1;for(var u=e/f,a=h(u),c=v.length;c>0;)v[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,n.__data__,t),s()):void 0}function s(){return--i.count?delete i[r]:delete n[e],1}var f,h,g=o.delay,p=ec,v=[];return p.t=g+a,u>=g?c(u-g):void(p.c=c)},0,a)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Vl,u);return i==Vl.length?[t.year,Vi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Vl[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Pi(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Yi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.6"},ea=[].slice,ra=function(n){return ea.call(n)},ua=this.document;if(ua)try{ra(ua.documentElement.childNodes)[0].nodeType}catch(ia){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),ua)try{ua.createElement("DIV").style.setProperty("opacity",0,"")}catch(oa){var aa=this.Element.prototype,ca=aa.setAttribute,la=aa.setAttributeNS,sa=this.CSSStyleDeclaration.prototype,fa=sa.setProperty;aa.setAttribute=function(n,t){ca.call(this,n,t+"")},aa.setAttributeNS=function(n,t,e){la.call(this,n,t,e+"")},sa.setProperty=function(n,t,e){fa.call(this,n,t+"",e)}}ta.ascending=e,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ur&&(e=r)}else{for(;++u=r){e=r;break}for(;++ur&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ue&&(e=r)}else{for(;++u=r){e=r;break}for(;++ue&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o1?c/(s-1):void 0},ta.deviation=function(){var n=ta.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ha=i(e);ta.bisectLeft=ha.left,ta.bisect=ta.bisectRight=ha.right,ta.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,o),e=new Array(t);++n=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ga=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=a(ga(e)),o=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++o)>t;)u.push(r/i);else for(;(r=n+e*++o)=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var c,s,f,h,g=-1,p=o.length,v=i[a++],d=new l;++g=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},c(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(ma,"\\$&")};var ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ya={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ma=function(n,t){return t.querySelector(n)},xa=function(n,t){return t.querySelectorAll(n)},ba=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(ba=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Ma=function(n,t){return Sizzle(n,t)[0]||null},xa=Sizzle,ba=Sizzle.matchesSelector),ta.selection=function(){return ta.select(ua.documentElement)};var _a=ta.selection.prototype=[];_a.select=function(n){var t,e,r,u,i=[];n=N(n);for(var o=-1,a=this.length;++o=0&&(e=n.slice(0,t),n=n.slice(t+1)),wa.hasOwnProperty(e)?{space:wa[e],local:n}:n}},_a.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},_a.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++uu){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},_a.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},_a.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},_a.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},_a.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},_a.insert=function(n,t){return n=j(n),t=N(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},_a.remove=function(){return this.each(F)},_a.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new l,y=new Array(o);for(r=-1;++rr;++r)p[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,a.push(p),c.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++ii;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return A(u)},_a.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},_a.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},_a.size=function(){var n=0;return Y(this,function(){++n}),n};var Sa=[];ta.selection.enter=Z,ta.selection.enter.prototype=Sa,Sa.append=_a.append,Sa.empty=_a.empty,Sa.node=_a.node,Sa.call=_a.call,Sa.size=_a.size,Sa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var ka=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});ua&&ka.forEach(function(n){"on"+n in ua&&ka.remove(n)});var Ea,Aa=0;ta.mouse=function(n){return J(n,k())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(n,t,e,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(e(f)).on(i+d,a).on(o+d,c),y=W(f),M=t(h,v);u?(l=u.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var r=E(n,"drag","dragstart","dragend"),u=null,i=e(b,ta.mouse,t,"mousemove","mouseup"),o=e(G,ta.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},ta.rebind(n,r,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ra(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Ca=1e-6,za=Ca*Ca,qa=Math.PI,La=2*qa,Ta=La-Ca,Ra=qa/2,Da=qa/180,Pa=180/qa,Ua=Math.SQRT2,ja=2,Fa=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(ja*h)*(e*ut(Ua*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Ua*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Ua*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Fa*f)/(2*i*ja*h),p=(c*c-i*i-Fa*f)/(2*c*ja*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Ua;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(q,f).on(Oa+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,o)),i(d=e,r),t=ta.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function c(n){z++||n({type:"zoomstart"})}function l(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){f=1,i(ta.mouse(u),g),l(a)}function r(){h.on(L,null).on(T,null),p(f&&ta.event.target===o),s(a)}var u=this,o=ta.event.target,a=D.of(u,arguments),f=0,h=ta.select(t(u)).on(L,n).on(T,r),g=e(ta.mouse(u)),p=W(u);Dl.call(u),c(a)}function h(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ta.event.target;ta.select(t).on(x,r).on(b,a),_.push(t);for(var e=ta.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var c=n(),l=Date.now();if(1===c.length){if(500>l-M){var s=c[0];o(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=l}else if(c.length>1){var s=c[0],f=c[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,o=ta.touches(p);Dl.call(p);for(var a=0,c=o.length;c>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),l(v)}function a(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(_).on(y,null),w.on(q,f).on(R,h),E(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=ta.select(p),E=W(p);t(),c(v),w.on(q,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Dl.call(this),v=e(d=m||ta.mouse(this)),c(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Ha())*k.k),i(d,v),l(n)}function p(){var n=ta.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ta.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},A=[960,500],N=Ia,C=250,z=0,q="mousedown.zoom",L="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=E(n,"zoomstart","zoom","zoomend");return Oa||(Oa="onwheel"in ua?(Ha=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Ha=function(){return ta.event.wheelDelta},"mousewheel"):(Ha=function(){return-ta.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Tl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},c(n)}).tween("zoom:zoom",function(){var e=A[0],r=A[1],u=d?d[0]:e/2,i=d?d[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},l(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,c(n),l(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?Ia:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],n):A},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ta.rebind(n,D,"on")};var Ha,Oa,Ia=[0,1/0];ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var Ya=at.prototype=new ot;Ya.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},Ya.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Za=lt.prototype=new ot;Za.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Va*(arguments.length?n:1)))},Za.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Va*(arguments.length?n:1)))},Za.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Va=18,Xa=.95047,$a=1,Ba=1.08883,Wa=ft.prototype=new ot;Wa.brighter=function(n){return new ft(Math.min(100,this.l+Va*(arguments.length?n:1)),this.a,this.b)},Wa.darker=function(n){return new ft(Math.max(0,this.l-Va*(arguments.length?n:1)),this.a,this.b)},Wa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var Ja=mt.prototype=new ot;Ja.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},Ja.hsl=function(){return _t(this.r,this.g,this.b)},Ja.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ga=ta.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ga.forEach(function(n,t){Ga.set(n,yt(t))}),ta.functor=Et,ta.xhr=At(y),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Nt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var Ka,Qa,nc,tc,ec,rc=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Qa?Qa.n=i:Ka=i,Qa=i,nc||(tc=clearTimeout(tc),nc=1,rc(qt))},ta.timer.flush=function(){Lt(),Tt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var uc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Rt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),uc[8+e/3]};var ic=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Rt(n,t))).toFixed(Math.max(0,Math.min(20,Rt(n*(1+1e-15),t))))}}),ac=ta.time={},cc=Date;jt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lc.setUTCDate.apply(this._,arguments)},setDay:function(){lc.setUTCDay.apply(this._,arguments)},setFullYear:function(){lc.setUTCFullYear.apply(this._,arguments)},setHours:function(){lc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lc.setUTCSeconds.apply(this._,arguments)},setTime:function(){lc.setTime.apply(this._,arguments)}};var lc=Date.prototype;ac.year=Ft(function(n){return n=ac.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ac.years=ac.year.range,ac.years.utc=ac.year.utc.range,ac.day=Ft(function(n){var t=new cc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ac.days=ac.day.range,ac.days.utc=ac.day.utc.range,ac.dayOfYear=function(n){var t=ac.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ac[n]=Ft(function(n){return(n=ac.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ac[n+"s"]=e.range,ac[n+"s"].utc=e.utc.range,ac[n+"OfYear"]=function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)}}),ac.week=ac.sunday,ac.weeks=ac.sunday.range,ac.weeks.utc=ac.sunday.utc.range,ac.weekOfYear=ac.sundayOfYear;var sc={"-":"",_:" ",0:"0"},fc=/^\s*\d+/,hc=/^%/;ta.locale=function(n){return{numberFormat:Pt(n),timeFormat:Ot(n)}};var gc=ta.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ta.format=gc.numberFormat,ta.geo={},ce.prototype={s:0,t:0,add:function(n){le(n,this.t,pc),le(pc.s,this.s,this),this.s?this.t+=pc.t:this.s=pc.t },reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pc=new ce;ta.geo.stream=function(n,t){n&&vc.hasOwnProperty(n.type)?vc[n.type](n,t):se(n,t)};var vc={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*qa+n:n,Mc.lineStart=Mc.lineEnd=Mc.point=b}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=pe([t*Da,e*Da]);if(m){var u=de(m,r),i=[u[1],-u[0],0],o=de(i,u);Me(o),o=xe(o);var c=t-p,l=c>0?1:-1,v=o[0]*Pa*l,d=ga(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Pa;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Pa;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ga(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Mc.point(n,e),t(n,e)}function i(){Mc.lineStart()}function o(){u(v,d),Mc.lineEnd(),ga(y)>Ca&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nyc?(s=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){xc=bc=_c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,qc);var t=Nc,e=Cc,r=zc,u=t*t+e*e+r*r;return za>u&&(t=kc,e=Ec,r=Ac,Ca>bc&&(t=_c,e=wc,r=Sc),u=t*t+e*e+r*r,za>u)?[0/0,0/0]:[Math.atan2(e,t)*Pa,tt(r/Math.sqrt(u))*Pa]};var xc,bc,_c,wc,Sc,kc,Ec,Ac,Nc,Cc,zc,qc={sphere:b,point:_e,lineStart:Se,lineEnd:ke,polygonStart:function(){qc.lineStart=Ee},polygonEnd:function(){qc.lineStart=Se}},Lc=Le(Ne,Pe,je,[-qa,-qa/2]),Tc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ye(Ze)}).raw=Ze,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ca,f+.12*l+Ca],[s-.214*l-Ca,f+.234*l-Ca]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ca,f+.166*l+Ca],[s-.115*l-Ca,f+.234*l-Ca]]).stream(c).point,n},n.scale(1070)};var Rc,Dc,Pc,Uc,jc,Fc,Hc={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Dc=0,Hc.lineStart=Ve},polygonEnd:function(){Hc.lineStart=Hc.lineEnd=Hc.point=b,Rc+=ga(Dc/2)}},Oc={point:Xe,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ic={point:We,lineStart:Je,lineEnd:Ge,polygonStart:function(){Ic.lineStart=Ke},polygonEnd:function(){Ic.point=We,Ic.lineStart=Je,Ic.lineEnd=Ge}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Rc=0,ta.geo.stream(n,u(Hc)),Rc},n.centroid=function(n){return _c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,u(Ic)),zc?[Nc/zc,Cc/zc]:Ac?[kc/Ac,Ec/Ac]:Sc?[_c/Sc,wc/Sc]:[0/0,0/0]},n.bounds=function(n){return jc=Fc=-(Pc=Uc=1/0),ta.geo.stream(n,u(Oc)),[[Pc,Uc],[jc,Fc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||tr(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new $e:new Qe(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new er(t);for(var r in n)e[r]=n[r];return e}}},er.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ta.geo.projection=ur,ta.geo.projectionMutator=ir,(ta.geo.equirectangular=function(){return ur(ar)}).raw=ar.invert=ar,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t}return n=lr(n[0]%360*Da,n[1]*Da,n.length>2?n[2]*Da:0),t.invert=function(t){return t=n.invert(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t},t},cr.invert=ar,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=lr(-n[0]*Da,-n[1]*Da,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Pa,n[1]*=Pa}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=gr((t=+r)*Da,u*Da),n):t},n.precision=function(r){return arguments.length?(e=gr(t*Da,(u=+r)*Da),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Da,u=n[1]*Da,i=t[1]*Da,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ga(n%d)>Ca}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ga(n%m)>Ca}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=vr(a,o,90),f=dr(r,e,y),h=vr(l,c,90),g=dr(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=mr,u=yr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return Mr(n[0]*Da,n[1]*Da,t[0]*Da,t[1]*Da)},ta.geo.length=function(n){return Yc=0,ta.geo.stream(n,Zc),Yc};var Yc,Zc={sphere:b,point:b,lineStart:xr,lineEnd:b,polygonStart:b,polygonEnd:b},Vc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ur(Vc)}).raw=Vc;var Xc=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(ta.geo.azimuthalEquidistant=function(){return ur(Xc)}).raw=Xc,(ta.geo.conicConformal=function(){return Ye(_r)}).raw=_r,(ta.geo.conicEquidistant=function(){return Ye(wr)}).raw=wr;var $c=br(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ur($c)}).raw=$c,Sr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ra]},(ta.geo.mercator=function(){return kr(Sr)}).raw=Sr;var Bc=br(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ur(Bc)}).raw=Bc;var Wc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ur(Wc)}).raw=Wc,Er.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ra]},(ta.geo.transverseMercator=function(){var n=kr(Er),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Er,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(zr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Cr(a),s=Cr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var r=Ar,u=Nr,i=r,o=u,a=ul;return n?t(n):(t.links=function(n){return iu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return iu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Yr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=su()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.xm&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=su();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){fu(n,k,v,d,m,y)},k.find=function(n){return hu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=cl.get(e)||al,r=ll.get(r)||y,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:sl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=fl,h=hl,g=-30,p=gl,v=.1,d=.64,m=[],M=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,y,x,b=m.length,_=M.length;for(e=0;_>e;++e)a=M[e],f=a.source,h=a.target,y=h.x-f.x,x=h.y-f.y,(p=y*y+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,y*=p,x*=p,h.x-=y*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=y*(d=1-d),f.y+=x*d);if((d=r*v)&&(y=l[0]/2,x=l[1]/2,e=-1,d))for(;++e0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=M[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++at;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=M[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,M[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,M[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(y).on("dragstart.force",Xu).on("drag.force",t).on("dragend.force",$u)),arguments.length?void this.on("mouseover.force",Bu).on("mouseout.force",Wu).call(e):e},ta.rebind(a,c,"on")};var fl=20,hl=1,gl=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ei,e=ni,r=ti;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ku(t,function(n){n.children&&(n.value=0)}),Qu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++lf?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===pl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=pl,r=0,u=La,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var pl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=y,e=ai,r=ci,u=oi,i=ui,o=ii;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:vl.get(t)||ai,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:dl.get(t)||ci,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var vl=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(li),i=n.map(si),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ai}),dl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ci});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=pi,u=hi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return gi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Qu(a,function(n){n.r=+s(n.value)}),Qu(a,Mi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Qu(a,function(n){n.r+=f}),Qu(a,Mi),Qu(a,function(n){n.r-=f})}return _i(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(vi),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Gu(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(Qu(h,e),h.parent.m=-h.z,Ku(h,r),l)Ku(f,i);else{var g=f,p=f,v=f;Ku(f,function(n){n.xp.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Ku(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ni(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ei(o),u=ki(u),o&&u;)c=ki(c),i=Ei(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ai(Ci(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ei(i)&&(i.t=o,i.m+=f-s),u&&!ki(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=Si,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Gu(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Qu(c,function(n){var t=n.children;t&&t.length?(n.x=qi(t),n.y=zi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Li(c),f=Ti(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Qu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=Si,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Gu(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++oe&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++ie.dx)&&(s=e.dx);++ie&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var ml={floor:y,ceil:y};ta.scale.linear=function(){return Ii([0,1],[0,1],mu,!1)};var yl={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Ji(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var Ml=ta.format(".0e"),xl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Gi(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return Qi([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(bl)},ta.scale.category20=function(){return ta.scale.ordinal().range(_l)},ta.scale.category20b=function(){return ta.scale.ordinal().range(wl)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Sl)};var bl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),_l=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),wl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return no([],[])},ta.scale.quantize=function(){return to(0,1,[0,1])},ta.scale.threshold=function(){return eo([.5],[0,1])},ta.scale.identity=function(){return ro([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ra,f=a.apply(this,arguments)-Ra,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ta)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===kl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=qa?0:1;if(A&&so(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=qa?0:1;if(E&&so(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Lr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=fo(null==S?[_,w]:[S,k],[y,M],l,H,g),I=fo([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^so(O[1][0],O[1][1],I[1][0],I[1][1]),",",g," ",I[1],"A",H,",",H," 0 0,",v," ",I[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",I[0])}else N.push("M",y,",",M);if(null!=S){var Y=Math.min(p,(n-F)/(j-1)),Z=fo([y,M],[S,k],n,-Y,g),V=fo([_,w],null==x?[y,M]:[x,b],n,-Y,g);p===Y?N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^so(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",Y,",",Y," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=io,r=oo,u=uo,i=kl,o=ao,a=co,c=lo;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==kl?kl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ra;return[Math.cos(t)*n,Math.sin(t)*n]},n};var kl="auto";ta.svg.line=function(){return ho(y)};var El=ta.map({linear:go,"linear-closed":po,step:vo,"step-before":mo,"step-after":yo,basis:So,"basis-open":ko,"basis-closed":Eo,bundle:Ao,cardinal:bo,"cardinal-open":Mo,"cardinal-closed":xo,monotone:To});El.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=ho(Ro);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},mo.reverse=yo,yo.reverse=mo,ta.svg.area=function(){return Do(y)},ta.svg.area.radial=function(){var n=Do(Ro);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-Ra,s=l.call(n,u,r)-Ra;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>qa)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=mr,o=yr,a=Po,c=ao,l=co;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=mr,e=yr,r=Uo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=Uo,e=n.projection;return n.projection=function(n){return arguments.length?e(jo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(zl.get(t.call(this,n,r))||Oo)(e.call(this,n,r))}var t=Ho,e=Fo;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var zl=ta.map({circle:Oo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ll)),e=t*Ll;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=zl.keys();var ql=Math.sqrt(3),Ll=Math.tan(30*Da);_a.transition=function(n){for(var t,e,r=Tl||++Ul,u=Xo(n),i=[],o=Rl||{time:Date.now(),ease:Su,delay:0,duration:250},a=-1,c=this.length;++ai;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Yo(u,this.namespace,this.id)},Pl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Pl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Hu:mu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Pl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Pl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=mu(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Zo(this,"style."+n,e,i)},Pl.styleTween=function(n,e,r){function u(u,i){var o=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Pl.text=function(n){return Zo(this,"text",n,Vo)},Pl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),Y(this,function(r){r[e][t].ease=n}))},Pl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Pl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Pl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Rl,i=Tl;try{Tl=e,Y(this,function(t,u,i){Rl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Rl=u,Tl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Pl.transition=function(){for(var n,t,e,r,u=this.id,i=++Ul,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Yo(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):y:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),d=ta.transition(p.exit()).style("opacity",Ca).remove(),m=ta.transition(p.order()).style("opacity",1),M=Math.max(u,0)+o,x=Ui(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ta.transition(b));v.append("line"),v.append("text");var w,S,k,E,A=v.select("line"),N=m.select("line"),C=p.select("text").text(g),z=v.select("text"),q=m.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,w="x",k="y",S="x2",E="y2",C.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+L*i+"V0H"+x[1]+"V"+L*i)):(n=Wo,w="y",k="x",S="y2",E="x2",C.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),_.attr("d","M"+L*i+","+x[0]+"H0V"+x[1]+"H"+L*i)),A.attr(E,L*u),z.attr(k,L*M),N.attr(S,0).attr(E,L*u),q.attr(w,0).attr(k,L*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=jl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Fl?t+"":jl,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var jl="bottom",Fl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(t){t.each(function(){var t=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,y);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Hl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var c,f=ta.transition(t),h=ta.transition(o);l&&(c=Ui(l),h.attr("x",c[0]).attr("width",c[1]-c[0]),r(f)),s&&(c=Ui(s),h.attr("y",c[0]).attr("height",c[1]-c[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ta.event.keyCode&&(C||(M=null,q[0]-=f[1],q[1]-=h[1],C=2),S())}function v(){32==ta.event.keyCode&&2==C&&(q[0]+=f[1],q[1]+=h[1],C=0,S())}function d(){var n=ta.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ta.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),q[0]=f[+(n[0]s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?a=null:o=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ta.select(ta.event.target),w=c.of(b,arguments),k=ta.select(b),E=_.datum(),A=!/^(n|s)$/.test(E)&&l,N=!/^(e|w)$/.test(E)&&s,C=_.classed("extent"),z=W(b),q=ta.mouse(b),L=ta.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(ta.event.changedTouches?L.on("touchmove.brush",d).on("touchend.brush",y):L.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=f[0]-q[0],q[1]=h[0]-q[1];else if(E){var T=+/w$/.test(E),R=+/^n/.test(E);x=[f[1-T]-q[0],h[1-R]-q[1]],q[0]=f[T],q[1]=h[R]}else ta.event.altKey&&(M=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,c=E(n,"brushstart","brush","brushend"),l=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Ol[0];return n.event=function(n){n.each(function(){var n=c.of(this,arguments),t={x:f,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Tl?ta.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=yu(f,t.x),r=yu(h,t.y);return o=a=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(l=t,v=Ol[!l<<1|!s],n):l},n.y=function(t){return arguments.length?(s=t,v=Ol[!l<<1|!s],n):s},n.clamp=function(t){return arguments.length?(l&&s?(g=!!t[0],p=!!t[1]):l?g=!!t:s&&(p=!!t),n):l&&s?[g,p]:l?g:s?p:null},n.extent=function(t){var e,r,u,i,c;return arguments.length?(l&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),o=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(c=e,e=r,r=c),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],l&&(u=u[1],i=i[1]),a=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(c=u,u=i,i=c),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(l&&(o?(e=o[0],r=o[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(c=e,e=r,r=c))),s&&(a?(u=a[0],i=a[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(c=u,u=i,i=c))),l&&s?[[e,u],[r,i]]:l?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!l&&f[0]==f[1]||!!s&&h[0]==h[1]},ta.rebind(n,c,"on")};var Hl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ol=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Il=ac.format=gc.timeFormat,Yl=Il.utc,Zl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Il.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:Zl,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=Zl.toString,ac.second=Ft(function(n){return new cc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ac.seconds=ac.second.range,ac.seconds.utc=ac.second.utc.range,ac.minute=Ft(function(n){return new cc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ac.minutes=ac.minute.range,ac.minutes.utc=ac.minute.utc.range,ac.hour=Ft(function(n){var t=n.getTimezoneOffset()/60;return new cc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ac.hours=ac.hour.range,ac.hours.utc=ac.hour.utc.range,ac.month=Ft(function(n){return n=ac.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ac.months=ac.month.range,ac.months.utc=ac.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ac.second,1],[ac.second,5],[ac.second,15],[ac.second,30],[ac.minute,1],[ac.minute,5],[ac.minute,15],[ac.minute,30],[ac.hour,1],[ac.hour,3],[ac.hour,6],[ac.hour,12],[ac.day,1],[ac.day,2],[ac.week,1],[ac.month,1],[ac.month,3],[ac.year,1]],$l=Il.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ne]]),Bl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:y,ceil:y};Xl.year=ac.year,ac.scale=function(){return Go(ta.scale.linear(),Xl,$l)};var Wl=Xl.map(function(n){return[n[0].utc,n[1]]}),Jl=Yl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ne]]);Wl.year=ac.year.utc,ac.scale.utc=function(){return Go(ta.scale.linear(),Wl,Jl)},ta.text=At(function(n){return n.responseText}),ta.json=function(n,t){return Nt(n,"application/json",Qo,t)},ta.html=function(n,t){return Nt(n,"text/html",na,t)},ta.xml=At(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/resources/js/app.js��������������������������������������������������������������������0000644�0000000�0000000�00000140174�13375661451�013621� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*jshint sub:true*/ (function () { 'use strict'; // Syntactic sugar function $(selector) { return document.querySelector(selector); } // Syntactic sugar & execute callback function $$(selector, callback) { var elems = document.querySelectorAll(selector); for (var i = 0; i < elems.length; ++i) { if (callback && typeof callback == 'function') callback.call(this, elems[i]); } } var debounce = function (func, wait, now) { var timeout; return function debounced () { var that = this, args = arguments; function delayed() { if (!now) func.apply(that, args); timeout = null; } if (timeout) { clearTimeout(timeout); } else if (now) { func.apply(obj, args); } timeout = setTimeout(delayed, wait || 250); }; }; // global namespace window.GoAccess = window.GoAccess || { initialize: function (options) { this.opts = options; this.AppState = {}; // current state app key-value store this.AppTpls = {}; // precompiled templates this.AppCharts = {}; // holds all rendered charts this.AppUIData = (this.opts || {}).uiData || {}; // holds panel definitions this.AppData = (this.opts || {}).panelData || {}; // hold raw data this.AppWSConn = (this.opts || {}).wsConnection || {}; // WebSocket connection this.i18n = (this.opts || {}).i18n || {}; // i18n report labels this.AppPrefs = { 'autoHideTables': true, 'layout': 'horizontal', 'perPage': 7, 'theme': 'darkPurple', }; this.AppPrefs = GoAccess.Util.merge(this.AppPrefs, this.opts.prefs); if (GoAccess.Util.hasLocalStorage()) { var ls = JSON.parse(localStorage.getItem('AppPrefs')); this.AppPrefs = GoAccess.Util.merge(this.AppPrefs, ls); } if (Object.keys(this.AppWSConn).length) this.setWebSocket(this.AppWSConn); }, getPanelUI: function (panel) { return panel ? this.AppUIData[panel] : this.AppUIData; }, getPrefs: function (panel) { return panel ? this.AppPrefs[panel] : this.AppPrefs; }, setPrefs: function () { if (GoAccess.Util.hasLocalStorage()) { localStorage.setItem('AppPrefs', JSON.stringify(GoAccess.getPrefs())); } }, getPanelData: function (panel) { return panel ? this.AppData[panel] : this.AppData; }, setWebSocket: function (wsConn) { var host = null; host = wsConn.url ? wsConn.url : window.location.hostname ? window.location.hostname : "localhost"; var str = /^(wss?:\/\/)?[^\/]+:[0-9]{1,5}\//.test(host + "/") ? host : String(host + ':' + wsConn.port); str = !/^wss?:\/\//i.test(str) ? (window.location.protocol === "https:" ? 'wss://' : 'ws://') + str : str; var socket = new WebSocket(str); socket.onopen = function (event) { GoAccess.Nav.WSOpen(); }.bind(this); socket.onmessage = function (event) { this.AppState['updated'] = true; this.AppData = JSON.parse(event.data); this.App.renderData(); }.bind(this); socket.onclose = function (event) { GoAccess.Nav.WSClose(); }.bind(this); }, }; // HELPERS GoAccess.Util = { months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"], // Add all attributes of n to o merge: function (o, n) { var obj = {}, i = 0, il = arguments.length, key; for (; i < il; i++) { for (key in arguments[i]) { if (arguments[i].hasOwnProperty(key)) { obj[key] = arguments[i][key]; } } } return obj; }, // hash a string hashCode: function (s) { return (s.split('').reduce(function (a, b) { a = ((a << 5) - a) + b.charCodeAt(0); return a&a; }, 0) >>> 0).toString(16); }, // Format bytes to human readable formatBytes: function (bytes, decimals, numOnly) { if (bytes == 0) return numOnly ? 0 : '0 Byte'; var k = 1024; var dm = decimals + 1 || 2; var sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']; var i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + (numOnly ? '' : (' ' + sizes[i])); }, // Validate number isNumeric: function (n) { return !isNaN(parseFloat(n)) && isFinite(n); }, // Format microseconds to human readable utime2str: function (usec) { if (usec >= 864E8) return ((usec) / 864E8).toFixed(2) + ' d'; else if (usec >= 36E8) return ((usec) / 36E8).toFixed(2) + ' h'; else if (usec >= 6E7) return ((usec) / 6E7).toFixed(2) + ' m'; else if (usec >= 1E6) return ((usec) / 1E6).toFixed(2) + ' s'; else if (usec >= 1E3) return ((usec) / 1E3).toFixed(2) + ' ms'; return (usec).toFixed(2) + ' us'; }, // Format date from 20120124 to 24/Jan/2012 formatDate: function (str) { var y = str.substr(0,4), m = str.substr(4,2) - 1, d = str.substr(6,2), h = str.substr(8,2) || 0, i = str.substr(10, 2) || 0, s = str.substr(12, 2) || 0; var date = new Date(y,m,d,h,i,s); var out = ('0' + date.getDate()).slice(-2) + '/' + this.months[date.getMonth()] + '/' + date.getFullYear(); 10 <= str.length && (out += ":" + h); 12 <= str.length && (out += ":" + i); 14 <= str.length && (out += ":" + s); return out; }, // Format field value to human readable fmtValue: function (value, dataType, decimals) { var val = 0; if (!dataType) val = value; switch (dataType) { case 'utime': val = this.utime2str(value); break; case 'date': val = this.formatDate(value); break; case 'numeric': if (this.isNumeric(value)) val = value.toLocaleString(); break; case 'bytes': val = this.formatBytes(value, decimals); break; case 'percent': val = parseFloat(value.replace(',', '.')).toFixed(2) + '%'; break; case 'time': if (this.isNumeric(value)) val = value.toLocaleString(); break; case 'secs': val = value + ' secs'; break; default: val = value; } return value == 0 ? String(val) : val; }, isPanelValid: function (panel) { var data = GoAccess.getPanelData(), ui = GoAccess.getPanelUI(); return (!ui.hasOwnProperty(panel) || !data.hasOwnProperty(panel) || !ui[panel].id); }, // Attempts to extract the count from either an object or a scalar. // e.g., item = Object {count: 14351, percent: 5.79} OR item = 4824825140 getCount: function (item) { if (this.isObject(item) && 'count' in item) return item.count; return item; }, getPercent: function (item) { if (this.isObject(item) && 'percent' in item) return this.fmtValue(item.percent, 'percent'); return null; }, isObject: function (o) { return o === Object(o); }, setProp: function (o, s, v) { var schema = o; var a = s.split('.'); for (var i = 0, n = a.length; i < n-1; ++i) { var k = a[i]; if (!schema[k]) schema[k] = {}; schema = schema[k]; } schema[a[n-1]] = v; }, getProp: function (o, s) { s = s.replace(/\[(\w+)\]/g, '.$1'); s = s.replace(/^\./, ''); var a = s.split('.'); for (var i = 0, n = a.length; i < n; ++i) { var k = a[i]; if (this.isObject(o) && k in o) { o = o[k]; } else { return; } } return o; }, hasLocalStorage: function () { try { localStorage.setItem('test', 'test'); localStorage.removeItem('test'); return true; } catch(e) { return false; } }, isWithinViewPort: function (el) { var elemTop = el.getBoundingClientRect().top; var elemBottom = el.getBoundingClientRect().bottom; return elemTop < window.innerHeight && elemBottom >= 0; }, }; // OVERALL STATS GoAccess.OverallStats = { // Render each overall stats box renderBox: function (data, ui, row, x, idx) { var wrap = $('.wrap-general-items'); // create a new bootstrap row every 6 elements if (idx % 6 == 0) { row = document.createElement('div'); row.setAttribute('class', 'row'); wrap.appendChild(row); } var box = document.createElement('div'); box.innerHTML = GoAccess.AppTpls.General.items.render({ 'id': x, 'className': ui.items[x].className, 'label': ui.items[x].label, 'value': GoAccess.Util.fmtValue(data[x], ui.items[x].dataType), }); row.appendChild(box); return row; }, // Render overall stats renderData: function (data, ui) { var idx = 0, row = null; $('.wrap-general').innerHTML = GoAccess.AppTpls.General.wrap.render(GoAccess.Util.merge(ui, { 'lastUpdated': data.date_time, 'from': data.start_date, 'to': data.end_date, })); // Iterate over general data object for (var x in data) { if (!data.hasOwnProperty(x) || !ui.items.hasOwnProperty(x)) continue; row = this.renderBox(data, ui, row, x, idx); idx++; } }, // Render general/overall analyzed requests. initialize: function () { var ui = GoAccess.getPanelUI('general'); var data = GoAccess.getPanelData('general'), i = 0; this.renderData(data, ui); } }; // RENDER PANELS GoAccess.Nav = { events: function () { $('.nav-bars').onclick = function (e) { e.stopPropagation(); this.renderMenu(e); }.bind(this); $('.nav-gears').onclick = function (e) { e.stopPropagation(); this.renderOpts(e); }.bind(this); $('.nav-minibars').onclick = function (e) { e.stopPropagation(); this.renderOpts(e); }.bind(this); $('body').onclick = function (e) { $('nav').classList.remove('active'); }.bind(this); $$('.export-json', function (item) { item.onclick = function (e) { this.downloadJSON(e); }.bind(this); }.bind(this)); $$('.theme-bright', function (item) { item.onclick = function (e) { this.setTheme('bright'); }.bind(this); }.bind(this)); $$('.theme-dark-blue', function (item) { item.onclick = function (e) { this.setTheme('darkBlue'); }.bind(this); }.bind(this)); $$('.theme-dark-gray', function (item) { item.onclick = function (e) { this.setTheme('darkGray'); }.bind(this); }.bind(this)); $$('.theme-dark-purple', function (item) { item.onclick = function (e) { this.setTheme('darkPurple'); }.bind(this); }.bind(this)); $$('.layout-horizontal', function (item) { item.onclick = function (e) { this.setLayout('horizontal'); }.bind(this); }.bind(this)); $$('.layout-vertical', function (item) { item.onclick = function (e) { this.setLayout('vertical'); }.bind(this); }.bind(this)); $$('[data-perpage]', function (item) { item.onclick = function (e) { this.setPerPage(e); }.bind(this); }.bind(this)); $$('[data-show-tables]', function (item) { item.onclick = function (e) { this.toggleTables(); }.bind(this); }.bind(this)); $$('[data-autohide-tables]', function (item) { item.onclick = function (e) { this.toggleAutoHideTables(); }.bind(this); }.bind(this)); }, downloadJSON: function (e) { var targ = e.currentTarget; var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(GoAccess.getPanelData())); targ.href = 'data:' + data; targ.download = 'goaccess-' + (+new Date()) + '.json'; }, setLayout: function (layout) { if ('horizontal' == layout) { $('.container').classList.add('container-fluid'); $('.container').classList.remove('container'); } else if ('vertical' == layout) { $('.container-fluid').classList.add('container'); $('.container').classList.remove('container-fluid'); } GoAccess.AppPrefs['layout'] = layout; GoAccess.setPrefs(); GoAccess.Panels.initialize(); GoAccess.Charts.initialize(); GoAccess.Tables.initialize(); }, toggleAutoHideTables: function (e) { var autoHideTables = GoAccess.Tables.autoHideTables(); $$('.table-wrapper', function (item) { if (autoHideTables) { item.classList.remove('hidden-xs'); } else { item.classList.add('hidden-xs'); } }.bind(this)); GoAccess.AppPrefs['autoHideTables'] = !autoHideTables; GoAccess.setPrefs(); }, toggleTables: function () { var ui = GoAccess.getPanelUI(); var showTables = GoAccess.Tables.showTables(); Object.keys(ui).forEach(function (panel, idx) { if (!GoAccess.Util.isPanelValid(panel)) ui[panel]['table'] = !showTables; }.bind(this)); GoAccess.AppPrefs['showTables'] = !showTables; GoAccess.setPrefs(); GoAccess.Panels.initialize(); GoAccess.Charts.initialize(); GoAccess.Tables.initialize(); }, setTheme: function (theme) { if (!theme) return; $('html').className = ''; switch(theme) { case 'darkGray': $('html').classList.add('dark'); $('html').classList.add('gray'); break; case 'darkBlue': $('html').classList.add('dark'); $('html').classList.add('blue'); break; case 'darkPurple': $('html').classList.add('dark'); $('html').classList.add('purple'); break; } GoAccess.AppPrefs['theme'] = theme; GoAccess.setPrefs(); }, getIcon: function (key) { switch(key) { case 'visitors' : return 'users'; case 'requests' : return 'file'; case 'static_requests' : return 'file-text'; case 'not_found' : return 'file-o'; case 'hosts' : return 'user'; case 'os' : return 'desktop'; case 'browsers' : return 'chrome'; case 'visit_time' : return 'clock-o'; case 'vhosts' : return 'th-list'; case 'referrers' : return 'external-link'; case 'referring_sites' : return 'external-link'; case 'keyphrases' : return 'google'; case 'status_codes' : return 'warning'; case 'remote_user' : return 'users'; case 'geolocation' : return 'map-marker'; default : return 'pie-chart'; } }, getItems: function () { var ui = GoAccess.getPanelUI(), menu = []; for (var panel in ui) { if (GoAccess.Util.isPanelValid(panel)) continue; // Push valid panels to our navigation array menu.push({ 'current': window.location.hash.substr(1) == panel, 'head': ui[panel].head, 'key': panel, 'icon': this.getIcon(panel), }); } return menu; }, setPerPage: function (e) { GoAccess.AppPrefs['perPage'] = +e.currentTarget.getAttribute('data-perpage'); GoAccess.App.renderData(); GoAccess.setPrefs(); }, getTheme: function () { return GoAccess.AppPrefs.theme || 'darkGray'; }, getLayout: function () { return GoAccess.AppPrefs.layout || 'horizontal'; }, getPerPage: function () { return GoAccess.AppPrefs.perPage || 7; }, // Render left-hand side navigation options. renderOpts: function () { var o = {}; o[this.getLayout()] = true; o[this.getTheme()] = true; o['perPage' + this.getPerPage()] = true; o['autoHideTables'] = GoAccess.Tables.autoHideTables(); o['showTables'] = GoAccess.Tables.showTables(); o['labels'] = GoAccess.i18n; $('.nav-list').innerHTML = GoAccess.AppTpls.Nav.opts.render(o); $('nav').classList.toggle('active'); this.events(); }, // Render left-hand side navigation given the available panels. renderMenu: function (e) { $('.nav-list').innerHTML = GoAccess.AppTpls.Nav.menu.render({ 'nav': this.getItems(), 'overall': window.location.hash.substr(1) == '', 'labels': GoAccess.i18n, }); $('nav').classList.toggle('active'); this.events(); }, WSStatus: function () { if (Object.keys(GoAccess.AppWSConn).length) $$('.nav-ws-status', function (item) { item.style.display = 'block'; }); }, WSClose: function () { $$('.nav-ws-status', function (item) { item.classList.remove('connected'); item.setAttribute('title', 'Disconnected'); }); }, WSOpen: function () { $$('.nav-ws-status', function (item) { item.classList.add('connected'); item.setAttribute('title', 'Connected to ' + GoAccess.AppWSConn.url); }); }, // Render left-hand side navigation given the available panels. renderWrap: function (nav) { $('nav').innerHTML = GoAccess.AppTpls.Nav.wrap.render(GoAccess.i18n); }, // Iterate over all available panels and render each. initialize: function () { this.setTheme(GoAccess.AppPrefs.theme); this.renderWrap(); this.WSStatus(); this.events(); } }; // RENDER PANELS GoAccess.Panels = { events: function () { $$('[data-toggle=dropdown]', function (item) { item.onclick = function (e) { this.openOpts(e.currentTarget); }.bind(this); item.onblur = function (e) { this.closeOpts(e); }.bind(this); }.bind(this)); $$('[data-plot]', function (item) { item.onclick = function (e) { GoAccess.Charts.redrawChart(e.currentTarget); }.bind(this); }.bind(this)); $$('[data-chart]', function (item) { item.onclick = function (e) { GoAccess.Charts.toggleChart(e.currentTarget); }.bind(this); }.bind(this)); $$('[data-chart-type]', function (item) { item.onclick = function (e) { GoAccess.Charts.setChartType(e.currentTarget); }.bind(this); }.bind(this)); $$('[data-metric]', function (item) { item.onclick = function (e) { GoAccess.Tables.toggleColumn(e.currentTarget); }.bind(this); }.bind(this)); }, openOpts: function (targ) { var panel = targ.getAttribute('data-panel'); targ.parentElement.classList.toggle('open'); this.renderOpts(panel); }, closeOpts: function (e) { e.currentTarget.parentElement.classList.remove('open'); // Trigger the click event on the target if not opening another menu if (e.relatedTarget && e.relatedTarget.getAttribute('data-toggle') !== 'dropdown') e.relatedTarget.click(); }, setPlotSelection: function (ui, prefs) { var chartType = ((prefs || {}).plot || {}).chartType || ui.plot[0].chartType; var metric = ((prefs || {}).plot || {}).metric || ui.plot[0].className; ui[chartType] = true; for (var i = 0, len = ui.plot.length; i < len; ++i) if (ui.plot[i].className == metric) ui.plot[i]['selected'] = true; }, setColSelection: function (items, prefs) { var columns = (prefs || {}).columns || {}; for (var i = 0, len = items.length; i < len; ++i) if ((items[i].key in columns) && columns[items[i].key]['hide']) items[i]['hide'] = true; }, setChartSelection: function (ui, prefs) { ui['showChart'] = prefs && ('chart' in prefs) ? prefs.chart : true; }, setOpts: function (panel) { var ui = JSON.parse(JSON.stringify(GoAccess.getPanelUI(panel))), prefs = GoAccess.getPrefs(panel); // set preferences selection upon opening panel options this.setChartSelection(ui, prefs); this.setPlotSelection(ui, prefs); this.setColSelection(ui.items, prefs); return GoAccess.Util.merge(ui, {'labels': GoAccess.i18n}); }, renderOpts: function (panel) { $('.panel-opts-' + panel).innerHTML = GoAccess.AppTpls.Panels.opts.render(this.setOpts(panel)); this.events(); }, enablePrev: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-prev'); if ($pagination) $pagination.parentNode.classList.remove('disabled'); }, disablePrev: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-prev'); if ($pagination) $pagination.parentNode.classList.add('disabled'); }, enableNext: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-next'); if ($pagination) $pagination.parentNode.classList.remove('disabled'); }, disableNext: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-next'); if ($pagination) $pagination.parentNode.classList.add('disabled'); }, enableFirst: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-first'); if ($pagination) $pagination.parentNode.classList.remove('disabled'); }, disableFirst: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-first'); if ($pagination) $pagination.parentNode.classList.add('disabled'); }, enableLast: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-last'); if ($pagination) $pagination.parentNode.classList.remove('disabled'); }, disableLast: function (panel) { var $pagination = $('#panel-' + panel + ' .pagination a.panel-last'); if ($pagination) $pagination.parentNode.classList.add('disabled'); }, enablePagination: function (panel) { this.enablePrev(panel); this.enableNext(panel); this.enableFirst(panel); this.enableLast(panel); }, disablePagination: function (panel) { this.disablePrev(panel); this.disableNext(panel); this.disableFirst(panel); this.disableLast(panel); }, hasSubItems: function (ui, data) { for (var i = 0, len = data.length; i < len; ++i) { if (!data[i].items) return (ui['hasSubItems'] = false); if (data[i].items.length) { return (ui['hasSubItems'] = true); } } return false; }, setComputedData: function (panel, ui, data) { this.hasSubItems(ui, data.data); GoAccess.Charts.hasChart(panel, ui); GoAccess.Tables.hasTable(ui); }, // Render the given panel given a user interface definition. renderPanel: function (panel, ui, col) { // set some computed values before rendering panel structure var data = GoAccess.getPanelData(panel); this.setComputedData(panel, ui, data); // per panel wrapper var box = document.createElement('div'); box.id = 'panel-' + panel; box.innerHTML = GoAccess.AppTpls.Panels.wrap.render(GoAccess.Util.merge(ui, { 'labels': GoAccess.i18n })); col.appendChild(box); // Remove pagination if not enough data for the given panel if (data.data.length <= GoAccess.getPrefs().perPage) this.disablePagination(panel); GoAccess.Tables.renderThead(panel, ui); return col; }, createCol: function (row) { var perRow = GoAccess.AppPrefs['layout'] == 'horizontal' ? 6 : 12; // set the number of columns based on current layout var col = document.createElement('div'); col.setAttribute('class', 'col-md-' + perRow + ' wrap-panel'); row.appendChild(col); return col; }, createRow: function (row, idx) { var wrap = $('.wrap-panels'); var every = GoAccess.AppPrefs['layout'] == 'horizontal' ? 2 : 1; // create a new bootstrap row every one or two elements depending on // the layout if (idx % every == 0) { row = document.createElement('div'); row.setAttribute('class', 'row' + (every == 2 ? ' equal' : '')); wrap.appendChild(row); } return row; }, resetPanel: function (panel) { var ui = GoAccess.getPanelUI(), idx = 0, row = null; var ele = $('#panel-' + panel); if (GoAccess.Util.isPanelValid(panel)) return false; var col = ele.parentNode; col.removeChild(ele); // Render panel given a user interface definition this.renderPanel(panel, ui[panel], col); this.events(); }, // Iterate over all available panels and render each panel // structure. renderPanels: function () { var ui = GoAccess.getPanelUI(), idx = 0, row = null, col = null; $('.wrap-panels').innerHTML = ''; for (var panel in ui) { if (GoAccess.Util.isPanelValid(panel)) continue; row = this.createRow(row, idx++); col = this.createCol(row); // Render panel given a user interface definition col = this.renderPanel(panel, ui[panel], col); } }, initialize: function () { this.renderPanels(); this.events(); } }; // RENDER CHARTS GoAccess.Charts = { iter: function (callback) { Object.keys(GoAccess.AppCharts).forEach(function (panel) { // redraw chart only if it's within the viewport if (!GoAccess.Util.isWithinViewPort($('#panel-' + panel))) return; if (callback && typeof callback === 'function') callback.call(this, GoAccess.AppCharts[panel], panel); }); }, getMetricKeys: function (panel, key) { return GoAccess.getPanelUI(panel)['items'].map(function (a) { return a[key]; }); }, getPanelData: function (panel, data) { // Grab ui plot data for the selected panel var plot = GoAccess.Util.getProp(GoAccess.AppState, panel + '.plot'); // Grab the data for the selected panel data = data || this.processChartData(GoAccess.getPanelData(panel).data); return plot.chartReverse ? data.reverse() : data; }, drawPlot: function (panel, plotUI, data) { var chart = this.getChart(panel, plotUI, data); if (!chart) return; this.renderChart(panel, chart, data); GoAccess.AppCharts[panel] = null; GoAccess.AppCharts[panel] = chart; }, setChartType: function (targ) { var panel = targ.getAttribute('data-panel'); var type = targ.getAttribute('data-chart-type'); GoAccess.Util.setProp(GoAccess.AppPrefs, panel + '.plot.chartType', type); GoAccess.setPrefs(); var plotUI = GoAccess.Util.getProp(GoAccess.AppState, panel + '.plot'); // Extract data for the selected panel and process it this.drawPlot(panel, plotUI, this.getPanelData(panel)); }, toggleChart: function (targ) { var panel = targ.getAttribute('data-panel'); var prefs = GoAccess.getPrefs(panel), chart = prefs && ('chart' in prefs) ? prefs.chart : true; GoAccess.Util.setProp(GoAccess.AppPrefs, panel + '.chart', !chart); GoAccess.setPrefs(); GoAccess.Panels.resetPanel(panel); GoAccess.Charts.resetChart(panel); GoAccess.Tables.renderFullTable(panel); }, hasChart: function (panel, ui) { var prefs = GoAccess.getPrefs(panel), chart = prefs && ('chart' in prefs) ? prefs.chart : true; ui['chart'] = ui.plot.length && chart && chart; }, // Redraw a chart upon selecting a metric. redrawChart: function (targ) { var plot = targ.getAttribute('data-plot'); var panel = targ.getAttribute('data-panel'); var ui = GoAccess.getPanelUI(panel); var plotUI = ui.plot; GoAccess.Util.setProp(GoAccess.AppPrefs, panel + '.plot.metric', plot); GoAccess.setPrefs(); // Iterate over plot user interface definition for (var x in plotUI) { if (!plotUI.hasOwnProperty(x) || plotUI[x].className != plot) continue; GoAccess.Util.setProp(GoAccess.AppState, panel + '.plot', plotUI[x]); // Extract data for the selected panel and process it this.drawPlot(panel, plotUI[x], this.getPanelData(panel)); break; } }, // Iterate over the item properties and and extract the count value. extractCount: function (item) { var o = {}; for (var prop in item) o[prop] = GoAccess.Util.getCount(item[prop]); return o; }, // Extract an array of objects that D3 can consume to process the chart. // e.g., o = Object {hits: 37402, visitors: 6949, bytes: // 505881789, avgts: 118609, cumts: 4436224010…} processChartData: function (data) { var out = []; for (var i = 0; i < data.length; ++i) out.push(this.extractCount(data[i])); return out; }, findUIItem: function (panel, key) { var items = GoAccess.getPanelUI(panel).items, o = {}; for (var i = 0; i < items.length; ++i) { if (items[i].key == key) return items[i]; } return null; }, getXKey: function (datum, key) { var arr = []; if (typeof key === 'string') return datum[key]; for (var prop in key) arr.push(datum[key[prop]]); return arr.join(' '); }, getAreaSpline: function (panel, plotUI, data) { var dualYaxis = plotUI['d3']['y1']; var chart = AreaChart(dualYaxis) .labels({ y0: plotUI['d3']['y0'].label, y1: dualYaxis ? plotUI['d3']['y1'].label : '' }) .x(function (d) { if ((((plotUI || {}).d3 || {}).x || {}).key) return this.getXKey(d, plotUI['d3']['x']['key']); return d.data; }.bind(this)) .y0(function (d) { return +d[plotUI['d3']['y0']['key']]; }) .width($("#chart-" + panel).getBoundingClientRect().width) .height(175) .format({ x: (this.findUIItem(panel, 'data') || {}).dataType || null, y0: ((plotUI.d3 || {}).y0 || {}).format, y1: ((plotUI.d3 || {}).y1 || {}).format, }) .opts(plotUI); dualYaxis && chart.y1(function (d) { return +d[plotUI['d3']['y1']['key']]; }); return chart; }, getVBar: function (panel, plotUI, data) { var dualYaxis = plotUI['d3']['y1']; var chart = BarChart(dualYaxis) .labels({ y0: plotUI['d3']['y0'].label, y1: dualYaxis ? plotUI['d3']['y1'].label : '' }) .x(function (d) { if ((((plotUI || {}).d3 || {}).x || {}).key) return this.getXKey(d, plotUI['d3']['x']['key']); return d.data; }.bind(this)) .y0(function (d) { return +d[plotUI['d3']['y0']['key']]; }) .width($("#chart-" + panel).getBoundingClientRect().width) .height(175) .format({ x: (this.findUIItem(panel, 'data') || {}).dataType || null, y0: ((plotUI.d3 || {}).y0 || {}).format, y1: ((plotUI.d3 || {}).y1 || {}).format, }) .opts(plotUI); dualYaxis && chart.y1(function (d) { return +d[plotUI['d3']['y1']['key']]; }); return chart; }, getChartType: function (panel) { var ui = GoAccess.getPanelUI(panel); if (!ui.chart) return ''; return GoAccess.Util.getProp(GoAccess.getPrefs(), panel + '.plot.chartType') || ui.plot[0].chartType; }, getPlotUI: function (panel, ui) { var metric = GoAccess.Util.getProp(GoAccess.getPrefs(), panel + '.plot.metric'); if (!metric) return ui.plot[0]; return ui.plot.filter(function (v) { return v.className == metric; })[0]; }, getChart: function (panel, plotUI, data) { var chart = null; // Render given its type switch (this.getChartType(panel)) { case 'area-spline': chart = this.getAreaSpline(panel, plotUI, data); break; case 'bar': chart = this.getVBar(panel, plotUI, data); break; } return chart; }, renderChart: function (panel, chart, data) { // remove popup d3.select('#chart-' + panel + '>.chart-tooltip-wrap') .remove(); // remove svg d3.select('#chart-' + panel).select('svg') .remove(); // add chart to the document d3.select("#chart-" + panel) .datum(data) .call(chart) .append("div").attr("class", "chart-tooltip-wrap"); }, addChart: function (panel, ui) { var plotUI = null, chart = null; // Ensure it has a plot definition if (!ui.plot || !ui.plot.length) return; plotUI = this.getPlotUI(panel, ui); // set ui plot data GoAccess.Util.setProp(GoAccess.AppState, panel + '.plot', plotUI); // Grab the data for the selected panel var data = this.getPanelData(panel); if (!(chart = this.getChart(panel, plotUI, data))) return; this.renderChart(panel, chart, data); GoAccess.AppCharts[panel] = chart; }, // Render all charts for the applicable panels. renderCharts: function (ui) { for (var panel in ui) { if (!ui.hasOwnProperty(panel)) continue; this.addChart(panel, ui[panel]); } }, resetChart: function (panel) { var ui = {}; if (GoAccess.Util.isPanelValid(panel)) return false; ui = GoAccess.getPanelUI(panel); this.addChart(panel, ui); }, // Reload (doesn't redraw) the given chart's data reloadChart: function (chart, panel) { var subItems = GoAccess.Tables.getSubItemsData(panel); var data = (subItems.length ? subItems : GoAccess.getPanelData(panel).data).slice(0); d3.select("#chart-" + panel) .datum(this.processChartData(this.getPanelData(panel, data))) .call(chart.width($("#chart-" + panel).offsetWidth)); }, // Reload (doesn't redraw) all chart's data reloadCharts: function () { this.iter(function (chart, panel) { this.reloadChart(chart, panel); }.bind(this)); GoAccess.AppState.updated = false; }, // Only redraw charts with current data redrawCharts: function () { this.iter(function (chart, panel) { d3.select("#chart-" + panel).call(chart.width($("#chart-" + panel).offsetWidth)); }); }, initialize: function () { this.renderCharts(GoAccess.getPanelUI()); // reload on scroll & redraw on resize d3.select(window).on('scroll.charts', debounce(function () { this.reloadCharts(); }, 250, false).bind(this)).on('resize.charts', function () { this.redrawCharts(); }.bind(this)); } }; // RENDER TABLES GoAccess.Tables = { chartData: {}, // holds all panel sub items data that feeds the chart events: function () { $$('.panel-next', function (item) { item.onclick = function (e) { var panel = e.currentTarget.getAttribute('data-panel'); this.renderTable(panel, this.nextPage(panel)); }.bind(this); }.bind(this)); $$('.panel-prev', function (item) { item.onclick = function (e) { var panel = e.currentTarget.getAttribute('data-panel'); this.renderTable(panel, this.prevPage(panel)); }.bind(this); }.bind(this)); $$('.panel-first', function (item) { item.onclick = function (e) { var panel = e.currentTarget.getAttribute('data-panel'); this.renderTable(panel, "FIRST_PAGE"); }.bind(this); }.bind(this)); $$('.panel-last', function (item) { item.onclick = function (e) { var panel = e.currentTarget.getAttribute('data-panel'); this.renderTable(panel, "LAST_PAGE"); }.bind(this); }.bind(this)); $$('.expandable>td', function (item) { item.onclick = function (e) { if (!window.getSelection().toString()) this.toggleRow(e.currentTarget); }.bind(this); }.bind(this)); $$('.row-expandable.clickable', function (item) { item.onclick = function (e) { this.toggleRow(e.currentTarget); }.bind(this); }.bind(this)); $$('.sortable', function (item) { item.onclick = function (e) { this.sortColumn(e.currentTarget); }.bind(this); }.bind(this)); }, toggleColumn: function (targ) { var panel = targ.getAttribute('data-panel'); var metric = targ.getAttribute('data-metric'); var columns = (GoAccess.getPrefs(panel) || {}).columns || {}; if (metric in columns) { delete columns[metric]; } else { GoAccess.Util.setProp(columns, metric + '.hide', true); } GoAccess.Util.setProp(GoAccess.AppPrefs, panel + '.columns', columns); GoAccess.setPrefs(); GoAccess.Tables.renderThead(panel, GoAccess.getPanelUI(panel)); GoAccess.Tables.renderFullTable(panel); }, sortColumn: function (ele) { var field = ele.getAttribute('data-key'); var order = ele.getAttribute('data-order'); var panel = ele.parentElement.parentElement.parentElement.getAttribute('data-panel'); order = order ? 'asc' == order ? 'desc' : 'asc' : 'asc'; GoAccess.App.sortData(panel, field, order); GoAccess.Util.setProp(GoAccess.AppState, panel + '.sort', { 'field': field, 'order': order, }); this.renderThead(panel, GoAccess.getPanelUI(panel)); this.renderTable(panel, this.getCurPage(panel)); GoAccess.Charts.reloadChart(GoAccess.AppCharts[panel], panel); }, getDataByKey: function (panel, key) { var data = GoAccess.getPanelData(panel).data; for (var i = 0, n = data.length; i < n; ++i) { if (GoAccess.Util.hashCode(data[i].data) == key) return data[i]; } return null; }, getSubItemsData: function (panel) { var out = [], items = this.chartData[panel]; for (var x in items) { if (!items.hasOwnProperty(x)) continue; out = out.concat(items[x]); } return out; }, addChartData: function (panel, key) { var data = this.getDataByKey(panel, key); var path = panel + '.' + key; if (!data || !data.items) return []; GoAccess.Util.setProp(this.chartData, path, data.items); return this.getSubItemsData(panel); }, removeChartData: function (panel, key) { if (GoAccess.Util.getProp(this.chartData, panel + '.' + key)) delete this.chartData[panel][key]; if (!this.chartData[panel] || Object.keys(this.chartData[panel]).length == 0) return GoAccess.getPanelData(panel).data; return this.getSubItemsData(panel); }, isExpanded: function (panel, key) { var path = panel + '.expanded.' + key; return GoAccess.Util.getProp(GoAccess.AppState, path); }, toggleExpanded: function (panel, key) { var path = panel + '.expanded.' + key, ret = true; if (this.isExpanded(panel, key)) { delete GoAccess.AppState[panel]['expanded'][key]; } else { GoAccess.Util.setProp(GoAccess.AppState, path, true), ret = false; } return ret; }, // Toggle children rows toggleRow: function (ele) { var hide = false, data = []; var row = ele.parentNode; var panel = row.getAttribute('data-panel'), key = row.getAttribute('data-key'); var plotUI = GoAccess.AppCharts[panel].opts(); hide = this.toggleExpanded(panel, key); this.renderTable(panel, this.getCurPage(panel)); if (!plotUI.redrawOnExpand) return; if (!hide) { data = GoAccess.Charts.processChartData(this.addChartData(panel, key)); } else { data = GoAccess.Charts.processChartData(this.removeChartData(panel, key)); } GoAccess.Charts.drawPlot(panel, plotUI, data); }, // Get current panel page getCurPage: function (panel) { return GoAccess.Util.getProp(GoAccess.AppState, panel + '.curPage') || 0; }, // Page offset. // e.g., Return Value: 11, curPage: 2 pageOffSet: function (panel) { return ((this.getCurPage(panel) - 1) * GoAccess.getPrefs().perPage); }, // Get total number of pages given the number of items on array getTotalPages: function (dataItems) { return Math.ceil(dataItems.length / GoAccess.getPrefs().perPage); }, // Get a shallow copy of a portion of the given data array and the // current page. getPage: function (panel, dataItems, page) { var totalPages = this.getTotalPages(dataItems); if (page < 1) page = 1; if (page > totalPages) page = totalPages; GoAccess.Util.setProp(GoAccess.AppState, panel + '.curPage', page); var start = this.pageOffSet(panel); var end = start + GoAccess.getPrefs().perPage; return dataItems.slice(start, end); }, // Get previous page prevPage: function (panel) { return this.getCurPage(panel) - 1; }, // Get next page nextPage: function (panel) { return this.getCurPage(panel) + 1; }, getMetaValue: function (ui, value) { if ('meta' in ui) return value[ui.meta]; return null; }, getMetaCell: function (ui, value) { var val = this.getMetaValue(ui, value); var max = (value || {}).max; var min = (value || {}).min; // use metaType if exist else fallback to dataType var vtype = ui.metaType || ui.dataType; var className = ui.className || ''; className += ui.dataType != 'string' ? 'text-right' : ''; return { 'className': className, 'max' : max != undefined ? GoAccess.Util.fmtValue(max, vtype) : null, 'min' : min != undefined ? GoAccess.Util.fmtValue(min, vtype) : null, 'value' : val != undefined ? GoAccess.Util.fmtValue(val, vtype) : null, 'title' : ui.meta, 'label' : ui.metaLabel || null, }; }, hideColumn: function (panel, col) { var columns = (GoAccess.getPrefs(panel) || {}).columns || {}; return ((col in columns) && columns[col]['hide']); }, showTables: function () { return ('showTables' in GoAccess.getPrefs()) ? GoAccess.getPrefs().showTables : true; }, autoHideTables: function () { return ('autoHideTables' in GoAccess.getPrefs()) ? GoAccess.getPrefs().autoHideTables : true; }, hasTable: function (ui) { ui['table'] = this.showTables(); ui['autoHideTables'] = this.autoHideTables(); }, renderMetaRow: function (panel, ui) { // find the table to set var table = $('.table-' + panel + ' tbody.tbody-meta'); if (!table) return; var cells = [], uiItems = ui.items; var data = GoAccess.getPanelData(panel).metadata; for (var i = 0; i < uiItems.length; ++i) { var item = uiItems[i]; if (this.hideColumn(panel, item.key)) continue; var value = data[item.key]; cells.push(this.getMetaCell(item, value)); } table.innerHTML = GoAccess.AppTpls.Tables.meta.render({ row: [{ 'hasSubItems': ui.hasSubItems, 'cells': cells }] }); }, // Iterate over user interface definition properties iterUIItems: function (panel, uiItems, dataItems, callback) { var out = []; for (var i = 0; i < uiItems.length; ++i) { var uiItem = uiItems[i]; if (this.hideColumn(panel, uiItem.key)) continue; // Data for the current user interface property. // e.g., dataItem = Object {count: 13949, percent: 5.63} var dataItem = dataItems[uiItem.key]; // Apply the callback and push return data to output array if (callback && typeof callback == 'function') { var ret = callback.call(this, panel, uiItem, dataItem); if (ret) out.push(ret); } } return out; }, // Return an object that can be consumed by the table template given a user // interface definition and a cell value object. // e.g., value = Object {count: 14351, percent: 5.79} getObjectCell: function (panel, ui, value) { var className = ui.className || ''; className += ui.dataType != 'string' ? 'text-right' : ''; return { 'className': className, 'percent': GoAccess.Util.getPercent(value), 'value': GoAccess.Util.fmtValue(GoAccess.Util.getCount(value), ui.dataType) }; }, // Given a data item object, set all the row cells and return a // table row that the template can consume. renderRow: function (panel, callback, ui, dataItem, idx, subItem, parentId, expanded) { var shadeParent = ((!subItem && idx % 2 != 0) ? 'shaded' : ''); var shadeChild = ((parentId % 2 != 0) ? 'shaded' : ''); return { 'panel' : panel, 'idx' : !subItem && (String((idx + 1) + this.pageOffSet(panel))), 'key' : !subItem ? GoAccess.Util.hashCode(dataItem.data) : '', 'expanded' : !subItem && expanded, 'parentId' : subItem ? String(parentId) : '', 'className' : subItem ? 'child ' + shadeChild : 'parent ' + shadeParent, 'hasSubItems' : ui.hasSubItems, 'items' : dataItem.items ? dataItem.items.length : 0, 'cells' : callback.call(this), }; }, renderRows: function (rows, panel, ui, dataItems, subItem, parentId) { subItem = subItem || false; // no data rows if (dataItems.length == 0 && ui.items.length) { rows.push({ cells: [{ className: 'text-center', colspan: ui.items.length + 1, value: 'No data on this panel.' }] }); } // Iterate over all data items for the given panel and // generate a table row per date item. var cellcb = null; for (var i = 0; i < dataItems.length; ++i) { var dataItem = dataItems[i], data = null, expanded = false; switch(typeof dataItem) { case 'string': data = dataItem; cellcb = function () { return { 'colspan': ui.items.length, 'value': data }; }; break; default: data = dataItem.data; cellcb = this.iterUIItems.bind(this, panel, ui.items, dataItem, this.getObjectCell.bind(this)); } expanded = this.isExpanded(panel, GoAccess.Util.hashCode(data)); rows.push(this.renderRow(panel, cellcb, ui, dataItem, i, subItem, parentId, expanded)); if (dataItem.items && dataItem.items.length && expanded) { this.renderRows(rows, panel, ui, dataItem.items, true, i, expanded); } } }, // Entry point to render all data rows into the table renderDataRows: function (panel, ui, dataItems, page) { // find the table to set var table = $('.table-' + panel + ' tbody.tbody-data'); if (!table) return; dataItems = this.getPage(panel, dataItems, page); var rows = []; this.renderRows(rows, panel, ui, dataItems); if (rows.length == 0) return; table.innerHTML = GoAccess.AppTpls.Tables.data.render({ rows: rows }); }, togglePagination: function (panel, page, dataItems) { GoAccess.Panels.enablePagination(panel); // Disable pagination next button if last page is reached if (page >= this.getTotalPages(dataItems)) { GoAccess.Panels.disableNext(panel); GoAccess.Panels.disableLast(panel); } if (page <= 1) { GoAccess.Panels.disablePrev(panel); GoAccess.Panels.disableFirst(panel); } }, renderTable: function (panel, page) { var dataItems = GoAccess.getPanelData(panel).data; var ui = GoAccess.getPanelUI(panel); if (page === "LAST_PAGE") { page = this.getTotalPages(dataItems); } else if (page === "FIRST_PAGE") { page = 1; } this.togglePagination(panel, page, dataItems); // Render data rows this.renderDataRows(panel, ui, dataItems, page); this.events(); }, renderFullTable: function (panel) { var ui = GoAccess.getPanelUI(panel), page = 0; // panel's data var data = GoAccess.getPanelData(panel); // render meta data if (data.hasOwnProperty('metadata')) this.renderMetaRow(panel, ui); // render actual data if (data.hasOwnProperty('data')) { page = this.getCurPage(panel); this.togglePagination(panel, page, data.data); this.renderDataRows(panel, ui, data.data, page); } }, // Iterate over all panels and determine which ones should contain // a data table. renderTables: function (force) { var ui = GoAccess.getPanelUI(); for (var panel in ui) { if (GoAccess.Util.isPanelValid(panel) || !this.showTables()) continue; if (force || GoAccess.Util.isWithinViewPort($('#panel-' + panel))) this.renderFullTable(panel); } }, // Given a UI panel definition, make a copy of it and assign the sort // fields to the template object to render sort2Tpl: function (panel, ui) { var uiClone = JSON.parse(JSON.stringify(ui)), out = []; var sort = GoAccess.Util.getProp(GoAccess.AppState, panel + '.sort'); for (var i = 0, len = uiClone.items.length; i < len; ++i) { var item = uiClone.items[i]; if (this.hideColumn(panel, item.key)) continue; item['sort'] = false; if (item.key == sort.field && sort.order) { item['sort'] = true; item[sort.order.toLowerCase()] = true; } out.push(item); } uiClone.items = out; return uiClone; }, renderThead: function (panel, ui) { var $thead = $('.table-' + panel + '>thead'), $colgroup = $('.table-' + panel + '>colgroup'); if ($thead && $colgroup && this.showTables()) { ui = this.sort2Tpl(panel, ui); $thead.innerHTML = GoAccess.AppTpls.Tables.head.render(ui); $colgroup.innerHTML = GoAccess.AppTpls.Tables.colgroup.render(ui); } }, reloadTables: function () { this.renderTables(false); this.events(); }, initialize: function () { this.renderTables(true); this.events(); // redraw on scroll d3.select(window).on('scroll.tables', debounce(function () { this.reloadTables(); }, 250, false).bind(this)); }, }; // Main App GoAccess.App = { hasFocus: true, tpl: function (tpl) { return Hogan.compile(tpl); }, setTpls: function () { GoAccess.AppTpls = { 'Nav': { 'wrap': this.tpl($('#tpl-nav-wrap').innerHTML), 'menu': this.tpl($('#tpl-nav-menu').innerHTML), 'opts': this.tpl($('#tpl-nav-opts').innerHTML), }, 'Panels': { 'wrap': this.tpl($('#tpl-panel').innerHTML), 'opts': this.tpl($('#tpl-panel-opts').innerHTML), }, 'General': { 'wrap': this.tpl($('#tpl-general').innerHTML), 'items': this.tpl($('#tpl-general-items').innerHTML), }, 'Tables': { 'colgroup': this.tpl($('#tpl-table-colgroup').innerHTML), 'head': this.tpl($('#tpl-table-thead').innerHTML), 'meta': this.tpl($('#tpl-table-row-meta').innerHTML), 'data': this.tpl($('#tpl-table-row').innerHTML), }, }; }, sortField: function (o, field) { var f = o[field]; if (GoAccess.Util.isObject(f) && (f !== null)) f = o[field].count; return f; }, sortData: function (panel, field, order) { // panel's data var panelData = GoAccess.getPanelData(panel).data; panelData.sort(function (a, b) { a = this.sortField(a, field); b = this.sortField(b, field); if (typeof a === 'string' && typeof b === 'string') return 'asc' == order ? a.localeCompare(b) : b.localeCompare(a); return 'asc' == order ? a - b : b - a; }.bind(this)); }, setInitSort: function () { var ui = GoAccess.getPanelUI(); for (var panel in ui) { if (GoAccess.Util.isPanelValid(panel)) continue; GoAccess.Util.setProp(GoAccess.AppState, panel + '.sort', ui[panel].sort); } }, // Verify if we need to sort panels upon data re-entry verifySort: function () { var ui = GoAccess.getPanelUI(); for (var panel in ui) { if (GoAccess.Util.isPanelValid(panel)) continue; var sort = GoAccess.Util.getProp(GoAccess.AppState, panel + '.sort'); // do not sort panels if they still hold the same sort properties if (JSON.stringify(sort) === JSON.stringify(ui[panel].sort)) continue; this.sortData(panel, sort.field, sort.order); } }, initDom: function () { $('nav').classList.remove('hide'); $('.container').classList.remove('hide'); $('.spinner').classList.add('hide'); if (GoAccess.AppPrefs['layout'] == 'horizontal') { $('.container').classList.add('container-fluid'); $('.container-fluid').classList.remove('container'); } }, renderData: function () { // update data and charts if tab/document has focus if (!this.hasFocus) return; this.verifySort(); GoAccess.OverallStats.initialize(); // do not rerender tables/charts if data hasn't changed if (!GoAccess.AppState.updated) return; GoAccess.Charts.reloadCharts(); GoAccess.Tables.reloadTables(); }, initialize: function () { this.setInitSort(); this.setTpls(); GoAccess.Nav.initialize(); this.initDom(); GoAccess.OverallStats.initialize(); GoAccess.Panels.initialize(); GoAccess.Charts.initialize(); GoAccess.Tables.initialize(); }, }; // Adds the visibilitychange EventListener document.addEventListener('visibilitychange', function () { // fires when user switches tabs, apps, etc. if (document.visibilityState === 'hidden') GoAccess.App.hasFocus = false; // fires when app transitions from hidden or user returns to the app/tab. if (document.visibilityState === 'visible') { var hasFocus = GoAccess.App.hasFocus; GoAccess.App.hasFocus = true; hasFocus || GoAccess.App.renderData(); } }); // Init app window.onload = function () { GoAccess.initialize({ 'i18n': window.json_i18n, 'uiData': window.user_interface, 'panelData': window.json_data, 'wsConnection': window.connection || null, 'prefs': window.html_prefs || {}, }); GoAccess.App.initialize(); }; }()); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/resources/js/hogan.min.js��������������������������������������������������������������0000644�0000000�0000000�00000020556�13041415706�014706� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @preserve Copyright 2012 Twitter, Inc. * @license http://www.apache.org/licenses/LICENSE-2.0.txt */ var Hogan={};!function(t){function n(t,n,e){var i;return n&&"object"==typeof n&&(void 0!==n[t]?i=n[t]:e&&n.get&&"function"==typeof n.get&&(i=n.get(t))),i}function e(t,n,e,i,r,s){function a(){}function o(){}a.prototype=t,o.prototype=t.subs;var u,c=new a;c.subs=new o,c.subsText={},c.buf="",i=i||{},c.stackSubs=i,c.subsText=s;for(u in n)i[u]||(i[u]=n[u]);for(u in i)c.subs[u]=i[u];r=r||{},c.stackPartials=r;for(u in e)r[u]||(r[u]=e[u]);for(u in r)c.partials[u]=r[u];return c}function i(t){return String(null===t||void 0===t?"":t)}function r(t){return t=i(t),l.test(t)?t.replace(s,"&").replace(a,"<").replace(o,">").replace(u,"'").replace(c,"""):t}t.Template=function(t,n,e,i){t=t||{},this.r=t.code||this.r,this.c=e,this.options=i||{},this.text=n||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(){return""},v:r,t:i,render:function(t,n,e){return this.ri([t],n||{},e)},ri:function(t,n,e){return this.r(t,n,e)},ep:function(t,n){var i=this.partials[t],r=n[i.name];if(i.instance&&i.base==r)return i.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[t].base=r,i.subs){n.stackText||(n.stackText={});for(key in i.subs)n.stackText[key]||(n.stackText[key]=void 0!==this.activeSub&&n.stackText[this.activeSub]?n.stackText[this.activeSub]:this.text);r=e(r,i.subs,i.partials,this.stackSubs,this.stackPartials,n.stackText)}return this.partials[t].instance=r,r},rp:function(t,n,e,i){var r=this.ep(t,e);return r?r.ri(n,e,i):""},rs:function(t,n,e){var i=t[t.length-1];if(!f(i))return void e(t,n,this);for(var r=0;r=0;c--)if(a=e[c],s=n(t,a,u),void 0!==s){o=!0;break}return o?(r||"function"!=typeof s||(s=this.mv(s,e,i)),s):r?!1:""},ls:function(t,n,e,r,s){var a=this.options.delimiters;return this.options.delimiters=s,this.b(this.ct(i(t.call(n,r)),n,e)),this.options.delimiters=a,!1},ct:function(t,n,e){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(n,e)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,n,e,i,r,s,a){var o,u=n[n.length-1],c=t.call(u);return"function"==typeof c?i?!0:(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,e,o.substring(r,s),a)):c},mv:function(t,n,e){var r=n[n.length-1],s=t.call(r);return"function"==typeof s?this.ct(i(s.call(r)),r,e):s},sub:function(t,n,e,i){var r=this.subs[t];r&&(this.activeSub=t,r(n,e,this,i),this.activeSub=!1)}};var s=/&/g,a=//g,u=/\'/g,c=/\"/g,l=/[&<>\"\']/,f=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}("undefined"!=typeof exports?exports:Hogan),function(t){function n(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function e(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function i(t,n,e){if(n.charAt(e)!=t.charAt(0))return!1;for(var i=1,r=t.length;r>i;i++)if(n.charAt(e+i)!=t.charAt(i))return!1;return!0}function r(n,e,i,o){var u=[],c=null,l=null,f=null;for(l=i[i.length-1];n.length>0;){if(f=n.shift(),l&&"<"==l.tag&&!(f.tag in k))throw new Error("Illegal content in < super tag.");if(t.tags[f.tag]<=t.tags.$||s(f,o))i.push(f),f.nodes=r(n,f.tag,i,o);else{if("/"==f.tag){if(0===i.length)throw new Error("Closing tag without opener: /"+f.n);if(c=i.pop(),f.n!=c.n&&!a(f.n,c.n,o))throw new Error("Nesting error: "+c.n+" vs. "+f.n);return c.end=f.i,u}"\n"==f.tag&&(f.last=0==n.length||"\n"==n[0].tag)}u.push(f)}if(i.length>0)throw new Error("missing closing tag: "+i.pop().n);return u}function s(t,n){for(var e=0,i=n.length;i>e;e++)if(n[e].o==t.n)return t.tag="#",!0}function a(t,n,e){for(var i=0,r=e.length;r>i;i++)if(e[i].c==t&&e[i].o==n)return!0}function o(t){var n=[];for(var e in t)n.push('"'+c(e)+'": function(c,p,t,i) {'+t[e]+"}");return"{ "+n.join(",")+" }"}function u(t){var n=[];for(var e in t.partials)n.push('"'+c(e)+'":{name:"'+c(t.partials[e].name)+'", '+u(t.partials[e])+"}");return"partials: {"+n.join(",")+"}, subs: "+o(t.subs)}function c(t){return t.replace(m,"\\\\").replace(v,'\\"').replace(b,"\\n").replace(d,"\\r").replace(x,"\\u2028").replace(w,"\\u2029")}function l(t){return~t.indexOf(".")?"d":"f"}function f(t,n){var e="<"+(n.prefix||""),i=e+t.n+y++;return n.partials[i]={name:t.n,partials:{}},n.code+='t.b(t.rp("'+c(i)+'",c,p,"'+(t.indent||"")+'"));',i}function h(t,n){n.code+="t.b(t.t(t."+l(t.n)+'("'+c(t.n)+'",c,p,0)));'}function p(t){return"t.b("+t+");"}var g=/\S/,v=/\"/g,b=/\n/g,d=/\r/g,m=/\\/g,x=/\u2028/,w=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,s){function a(){m.length>0&&(x.push({tag:"_t",text:new String(m)}),m="")}function o(){for(var n=!0,e=y;e"==e.tag&&(e.indent=x[i].text.toString()),x.splice(i,1));else n||x.push({tag:"\n"});w=!1,y=x.length}function c(t,n){var i="="+S,r=t.indexOf(i,n),s=e(t.substring(t.indexOf("=",n)+1,r)).split(" ");return T=s[0],S=s[s.length-1],r+i.length-1}var l=r.length,f=0,h=1,p=2,v=f,b=null,d=null,m="",x=[],w=!1,k=0,y=0,T="{{",S="}}";for(s&&(s=s.split(" "),T=s[0],S=s[1]),k=0;l>k;k++)v==f?i(T,r,k)?(--k,a(),v=h):"\n"==r.charAt(k)?u(w):m+=r.charAt(k):v==h?(k+=T.length-1,d=t.tags[r.charAt(k+1)],b=d?r.charAt(k+1):"_v","="==b?(k=c(r,k),v=f):(d&&k++,v=p),w=k):i(S,r,k)?(x.push({tag:b,n:e(m),otag:T,ctag:S,i:"/"==b?w-T.length:k+S.length}),m="",k+=S.length-1,v=f,"{"==b&&("}}"==S?k++:n(x[x.length-1]))):m+=r.charAt(k);return u(w,!0),x};var k={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(n){return"{code: function (c,p,i) { "+t.wrapMain(n.code)+" },"+u(n)+"}"};var y=0;t.generate=function(n,e,i){y=0;var r={code:"",subs:{},partials:{}};return t.walk(n,r),i.asString?this.stringify(r,e,i):this.makeTemplate(r,e,i)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,n,e){var i=this.makePartials(t);return i.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(i,n,this,e)},t.makePartials=function(t){var n,e={subs:{},partials:t.partials,name:t.name};for(n in e.partials)e.partials[n]=this.makePartials(e.partials[n]);for(n in t.subs)e.subs[n]=new Function("c","p","t","i",t.subs[n]);return e},t.codegen={"#":function(n,e){e.code+="if(t.s(t."+l(n.n)+'("'+c(n.n)+'",c,p,1),c,p,0,'+n.i+","+n.end+',"'+n.otag+" "+n.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(n.nodes,e),e.code+="});c.pop();}"},"^":function(n,e){e.code+="if(!t.s(t."+l(n.n)+'("'+c(n.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(n.nodes,e),e.code+="};"},">":f,"<":function(n,e){var i={partials:{},code:"",subs:{},inPartial:!0};t.walk(n.nodes,i);var r=e.partials[f(n,e)];r.subs=i.subs,r.partials=i.partials},$:function(n,e){var i={subs:{},code:"",partials:e.partials,prefix:n.n};t.walk(n.nodes,i),e.subs[n.n]=i.code,e.inPartial||(e.code+='t.sub("'+c(n.n)+'",c,p,i);')},"\n":function(t,n){n.code+=p('"\\n"'+(t.last?"":" + i"))},_v:function(t,n){n.code+="t.b(t.v(t."+l(t.n)+'("'+c(t.n)+'",c,p,0)));'},_t:function(t,n){n.code+=p('"'+c(t.text)+'"')},"{":h,"&":h},t.walk=function(n,e){for(var i,r=0,s=n.length;s>r;r++)i=t.codegen[n[r].tag],i&&i(n[r],e);return e},t.parse=function(t,n,e){return e=e||{},r(t,"",[],e.sectionTags||[])},t.cache={},t.cacheKey=function(t,n){return[t,!!n.asString,!!n.disableLambda,n.delimiters,!!n.modelGet].join("||")},t.compile=function(n,e){e=e||{};var i=t.cacheKey(n,e),r=this.cache[i];if(r){var s=r.partials;for(var a in s)delete s[a].instance;return r}return r=this.generate(this.parse(this.scan(n,e.delimiters),n,e),n,e),this.cache[i]=r}}("undefined"!=typeof exports?exports:Hogan);��������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/config/��������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�13375711132�011363� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/config/browsers.list�������������������������������������������������������������������0000644�0000000�0000000�00000005444�13375701455�014064� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# List of browsers and their categories # e.g., WORD delimited by tab(s) TYPE # # **IMPORTANT NOTE**: # --------------------- # The SIZE of the list is proportional to the run time. # Thus, the longer the list, the more time GoAccess will take to parse it. # # Also, you should note that the higher the browser/item is on the list, the # faster the parsing will be. # # The list needs to be specified using --browsers-file=. This file is not # parsed by default. # # The items below are sample crawlers, adjust as needed. Chef Client Crawlers Abonti Crawlers SISTRIX Crawlers DotBot Crawlers Speedy Spider Crawlers Sosospider Crawlers BPImageWalker Crawlers DoCoMo Crawlers GSLFbot Crawlers YodaoBot Crawlers AddThis Crawlers Purebot Crawlers CCBot Crawlers findlinks Crawlers ichiro Crawlers Linguee Bot Crawlers Gigabot Crawlers BacklinkCrawler Crawlers distilator Crawlers Aboundex Crawlers UnwindFetchor Crawlers SBIder Crawlers TestNutch Crawlers DomainCrawler Crawlers NextGenSearchBot Crawlers SEOENGWorldBot Crawlers Cityreview Crawlers PagePeeker Crawlers JS-Kit Crawlers ScreenerBot Crawlers ShowyouBot Crawlers SolomonoBot Crawlers Domnutch Crawlers MaxPoint Crawlers NCBot Crawlers TosCrawler Crawlers Updownerbot Crawlers OpenWebSpider Crawlers WordPress Crawlers PEAR Crawlers ZumBot Crawlers YisouSpider Crawlers W3C Crawlers vcheck Crawlers PercolateCrawler Crawlers NING Crawlers gvfs Crawlers CatchBot Crawlers Combine Crawlers A6-Indexer Crawlers Altresium Crawlers Comodo Crawlers crawler4j Crawlers Cricket Crawlers EC2LinkFinder Crawlers envolk Crawlers GeoHasher Crawlers HTMLParser Crawlers MLBot Crawlers Jaxified Crawlers LinkWalker Crawlers nutch Crawlers PostRank Crawlers keybase-proofs Crawlers CommonCrawler Crawlers X-CAD-SE Crawlers Safeassign Crawlers Nmap Crawlers sqlmap Crawlers Jorgee Crawlers PxBroker Crawlers Seekport Crawlers adscanner Crawlers AfD-Verbotsverfahren_JETZT! Crawlers Vienna Feeds Windows-RSS-Platform Feeds newsbeuter Feeds Wrangler Feeds Fever Feeds Tiny Feeds FreshRSS Feeds KrISS Feeds SimplePie Feeds Feedsubs Feeds UniversalFeedParser Feeds ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/config/goaccess.conf�������������������������������������������������������������������0000644�0000000�0000000�00000051210�13375661253�013750� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������###################################### # Time Format Options (required) ###################################### # # The hour (24-hour clock) [00,23]; leading zeros are permitted but not required. # The minute [00,59]; leading zeros are permitted but not required. # The seconds [00,60]; leading zeros are permitted but not required. # See `man strftime` for more details # # The following time format works with any of the # Apache/NGINX's log formats below. # #time-format %H:%M:%S # # Google Cloud Storage or # The time in microseconds since the Unix epoch. # #time-format %f # Squid native log format # #time-format %s ###################################### # Date Format Options (required) ###################################### # # The date-format variable followed by a space, specifies # the log format date containing any combination of regular # characters and special format specifiers. They all begin with a # percentage (%) sign. See `man strftime` # # The following date format works with any of the # Apache/NGINX's log formats below. # #date-format %d/%b/%Y # # AWS | Amazon CloudFront (Download Distribution) # AWS | Elastic Load Balancing # W3C (IIS) # #date-format %Y-%m-%d # # Google Cloud Storage or # The time in microseconds since the Unix epoch. # #date-format %f # Squid native log format # #date-format %s ###################################### # Log Format Options (required) ###################################### # # The log-format variable followed by a space or \t for # tab-delimited, specifies the log format string. # # NOTE: If the time/date is a timestamp in seconds or microseconds # %x must be used instead of %d & %t to represent the date & time. # NCSA Combined Log Format #log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" # NCSA Combined Log Format with Virtual Host #log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u" # Common Log Format (CLF) #log-format %h %^[%d:%t %^] "%r" %s %b # Common Log Format (CLF) with Virtual Host #log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b # W3C #log-format %d %t %h %^ %^ %^ %^ %r %^ %s %b %^ %^ %u %R # Squid native log format #log-format %^ %^ %^ %v %^: %x.%^ %~%L %h %^/%s %b %m %U # AWS | Amazon CloudFront (Download Distribution) #log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^ # Google Cloud Storage #log-format "%x","%h",%^,%^,"%m","%U","%s",%^,"%b","%D",%^,"%R","%u" # AWS | Elastic Load Balancing #log-format %dT%t.%^ %^ %h:%^ %^ %T %^ %^ %^ %s %^ %b "%r" "%u" # AWSS3 | Amazon Simple Storage Service (S3) #log-format %^[%d:%t %^] %h %^"%r" %s %^ %b %^ %L %^ "%R" "%u" # Virtualmin Log Format with Virtual Host #log-format %h %^ %v %^[%d:%t %^] "%r" %s %b "%R" "%u" # In addition to specifying the raw log/date/time formats, for # simplicity, any of the following predefined log format names can be # supplied to the log/date/time-format variables. GoAccess can also # handle one predefined name in one variable and another predefined # name in another variable. # #log-format COMBINED #log-format VCOMBINED #log-format COMMON #log-format VCOMMON #log-format W3C #log-format SQUID #log-format CLOUDFRONT #log-format CLOUDSTORAGE #log-format AWSELB #log-format AWSS3 ###################################### # UI Options ###################################### # Choose among color schemes # 1 : Monochrome # 2 : Green # 3 : Monokai (if 256-colors supported) # #color-scheme 3 # Prompt log/date configuration window on program start. # config-dialog false # Color highlight active panel. # hl-header true # Specify a custom CSS file in the HTML report. # #html-custom-css /path/file.css # Specify a custom JS file in the HTML report. # #html-custom-js /path/file.js # Set default HTML preferences. # # NOTE: A valid JSON object is required. # DO NOT USE A MULTILINE JSON OBJECT. # The parser will only parse the value next to `html-prefs` (single line) # It allows the ability to customize each panel plot. See example below. # #html-prefs {"theme":"bright","perPage":5,"layout":"horizontal","showTables":true,"visitors":{"plot":{"chartType":"bar"}}} # Set HTML report page title and header. # #html-report-title My Awesome Web Stats # Format JSON output using tabs and newlines. # json-pretty-print false # Turn off colored output. This is the default output on # terminals that do not support colors. # true : for no color output # false : use color-scheme # no-color false # Don't write column names in the terminal output. By default, it displays # column names for each available metric in every panel. # no-column-names false # Disable summary metrics on the CSV output. # no-csv-summary false # Disable progress metrics. # no-progress false # Disable scrolling through panels on TAB. # no-tab-scroll false # Disable progress metrics and parsing spinner. # #no-parsing-spinner true # Do not show the last updated field displayed in the HTML generated report. # #no-html-last-updated true # Enable mouse support on main dashboard. # with-mouse false # Maximum number of items to show per panel. # Note: Only the CSV and JSON outputs allow a maximum greater than the # default value of 366. # #max-items 366 # Custom colors for the terminal output # Tailor GoAccess to suit your own tastes. # # Color Syntax: # DEFINITION space/tab colorFG#:colorBG# [[attributes,] PANEL] # # FG# = foreground color number [-1...255] (-1 = default terminal color) # BG# = background color number [-1...255] (-1 = default terminal color) # # Optionally: # # It is possible to apply color attributes, such as: # bold,underline,normal,reverse,blink. # Multiple attributes are comma separated # # If desired, it is possible to apply custom colors per panel, that is, a # metric in the REQUESTS panel can be of color A, while the same metric in the # BROWSERS panel can be of color B. # # The following is a 256 color scheme (hybrid palette) # #color COLOR_MTRC_HITS color110:color-1 #color COLOR_MTRC_VISITORS color173:color-1 #color COLOR_MTRC_DATA color221:color-1 #color COLOR_MTRC_BW color167:color-1 #color COLOR_MTRC_AVGTS color143:color-1 #color COLOR_MTRC_CUMTS color247:color-1 #color COLOR_MTRC_MAXTS color186:color-1 #color COLOR_MTRC_PROT color109:color-1 #color COLOR_MTRC_MTHD color139:color-1 #color COLOR_MTRC_HITS_PERC color186:color-1 #color COLOR_MTRC_HITS_PERC_MAX color139:color-1 #color COLOR_MTRC_HITS_PERC_MAX color139:color-1 VISITORS #color COLOR_MTRC_HITS_PERC_MAX color139:color-1 OS #color COLOR_MTRC_HITS_PERC_MAX color139:color-1 BROWSERS #color COLOR_MTRC_HITS_PERC_MAX color139:color-1 VISIT_TIMES #color COLOR_MTRC_VISITORS_PERC color186:color-1 #color COLOR_MTRC_VISITORS_PERC_MAX color139:color-1 #color COLOR_PANEL_COLS color243:color-1 #color COLOR_BARS color250:color-1 #color COLOR_ERROR color231:color167 #color COLOR_SELECTED color7:color167 #color COLOR_PANEL_ACTIVE color7:color237 #color COLOR_PANEL_HEADER color250:color235 #color COLOR_PANEL_DESC color242:color-1 #color COLOR_OVERALL_LBLS color243:color-1 #color COLOR_OVERALL_VALS color167:color-1 #color COLOR_OVERALL_PATH color186:color-1 #color COLOR_ACTIVE_LABEL color139:color235 bold underline #color COLOR_BG color250:color-1 #color COLOR_DEFAULT color243:color-1 #color COLOR_PROGRESS color7:color110 ###################################### # Server Options ###################################### # Specify IP address to bind server to. # #addr 0.0.0.0 # Run GoAccess as daemon (if --real-time-html enabled). # #daemonize false # Ensure clients send the specified origin header upon the WebSocket # handshake. # #origin http://example.org # The port to which the connection is being attempted to connect. # By default GoAccess' WebSocket server listens on port 7890 # See man page or http://gwsocket.io for details. # #port 7890 # Write the PID to a file when used along the daemonize option. # #pid-file /var/run/goaccess.pid # Enable real-time HTML output. # #real-time-html true # Path to TLS/SSL certificate. # Note that ssl-cert and ssl-key need to be used to enable TLS/SSL. # #ssl-cert /path/ssl/domain.crt # Path to TLS/SSL private key. # Note that ssl-cert and ssl-key need to be used to enable TLS/SSL. # #ssl-key /path/ssl/domain.key # URL to which the WebSocket server responds. This is the URL supplied # to the WebSocket constructor on the client side. # # Optionally, it is possible to specify the WebSocket URI scheme, such as ws:// # or wss:// for unencrypted and encrypted connections. # e.g., ws-url wss://goaccess.io # # If GoAccess is running behind a proxy, you could set the client side # to connect to a different port by specifying the host followed by a # colon and the port. # e.g., ws-url goaccess.io:9999 # # By default, it will attempt to connect to localhost. If GoAccess is # running on a remote server, the host of the remote server should be # specified here. Also, make sure it is a valid host and NOT an http # address. # #ws-url goaccess.io # Path to read named pipe (FIFO). # #fifo-in /tmp/wspipein.fifo # Path to write named pipe (FIFO). # #fifo-in /tmp/wspipeout.fifo ###################################### # File Options ###################################### # Specify the path to the input log file. If set, it will take # priority over -f from the command line. # #log-file /var/log/apache2/access.log # Send all debug messages to the specified file. # #debug-file debug.log # Specify a custom configuration file to use. If set, it will take # priority over the global configuration file (if any). # #config-file # Log invalid requests to the specified file. # #invalid-requests # Do not load the global configuration file. # #no-global-config false ###################################### # Parse Options ###################################### # Enable a list of user-agents by host. For faster parsing, do not # enable this flag. # agent-list false # Enable IP resolver on HTML|JSON|CSV output. # with-output-resolver false # Exclude an IPv4 or IPv6 from being counted. # Ranges can be included as well using a dash in between # the IPs (start-end). # #exclude-ip 127.0.0.1 #exclude-ip 192.168.0.1-192.168.0.100 #exclude-ip ::1 #exclude-ip 0:0:0:0:0:ffff:808:804-0:0:0:0:0:ffff:808:808 # Include HTTP request method if found. This will create a # request key containing the request method + the actual request. # # [default: yes] # http-method yes # Include HTTP request protocol if found. This will create a # request key containing the request protocol + the actual request. # # [default: yes] # http-protocol yes # Write output to stdout given one of the following files and the # corresponding extension for the output format: # # /path/file.csv - Comma-separated values (CSV) # /path/file.json - JSON (JavaScript Object Notation) # /path/file.html - HTML # # output /path/file.html # Ignore request's query string. # i.e., www.google.com/page.htm?query => www.google.com/page.htm # # Note: Removing the query string can greatly decrease memory # consumption, especially on timestamped requests. # no-query-string false # Disable IP resolver on terminal output. # no-term-resolver false # Treat non-standard status code 444 as 404. # 444-as-404 false # Add 4xx client errors to the unique visitors count. # 4xx-to-unique-count false # Store accumulated processing time from parsing day-by-day logs. # Only if configured with --enable-tcb=btree # #accumulated-time false # IP address anonymization # The IP anonymization option sets the last octet of IPv4 user IP addresses and # the last 80 bits of IPv6 addresses to zeros. # e.g., 192.168.20.100 => 192.168.20.0 # e.g., 2a03:2880:2110:df07:face:b00c::1 => 2a03:2880:2110:df07:: # #anonymize-ip false # Include static files that contain a query string in the static files # panel. # e.g., /fonts/fontawesome-webfont.woff?v=4.0.3 # all-static-files false # Include an additional delimited list of browsers/crawlers/feeds etc. # See config/browsers.list for an example or # https://raw.githubusercontent.com/allinurl/goaccess/master/config/browsers.list # #browsers-file # Date specificity. Possible values: `date` (default), or `hr`. # #date-spec hr # Decode double-encoded values. # double-decode false # Enable parsing/displaying the given panel. # #enable-panel VISITORS #enable-panel REQUESTS #enable-panel REQUESTS_STATIC #enable-panel NOT_FOUND #enable-panel HOSTS #enable-panel OS #enable-panel BROWSERS #enable-panel VISIT_TIMES #enable-panel VIRTUAL_HOSTS #enable-panel REFERRERS #enable-panel REFERRING_SITES #enable-panel KEYPHRASES #enable-panel STATUS_CODES #enable-panel REMOTE_USER #enable-panel GEO_LOCATION # Hide a referer but still count it. Wild cards are allowed. i.e., *.bing.com # #hide-referer *.google.com #hide-referer bing.com # Hour specificity. Possible values: `hr` (default), or `min` (tenth # of a minute). # #hour-spec min # Ignore crawlers from being counted. # This will ignore robots listed under browsers.c # Note that it will count them towards the total # number of requests, but excluded from any of the panels. # ignore-crawlers false # Parse and display crawlers only. # This will ignore robots listed under browsers.c # Note that it will count them towards the total # number of requests, but excluded from any of the panels. # crawlers-only false # Ignore static file requests. # req : Only ignore request from valid requests # panels : Ignore request from panels. # Note that it will count them towards the total number of requests # ignore-statics req # Ignore parsing and displaying the given panel. # #ignore-panel VISITORS #ignore-panel REQUESTS #ignore-panel REQUESTS_STATIC #ignore-panel NOT_FOUND #ignore-panel HOSTS #ignore-panel OS #ignore-panel BROWSERS #ignore-panel VISIT_TIMES #ignore-panel VIRTUAL_HOSTS ignore-panel REFERRERS #ignore-panel REFERRING_SITES ignore-panel KEYPHRASES #ignore-panel STATUS_CODES #ignore-panel REMOTE_USER #ignore-panel GEO_LOCATION # Ignore referers from being counted. # This supports wild cards. For instance, # '*' matches 0 or more characters (including spaces) # '?' matches exactly one character # #ignore-referer *.domain.com #ignore-referer ww?.domain.* # Ignore parsing and displaying one or multiple status code(s) # #ignore-status 400 #ignore-status 502 # Number of lines from the access log to test against the provided # log/date/time format. By default, the parser is set to test 10 # lines. If set to 0, the parser won't test any lines and will parse # the whole access log. # #num-tests 10 # Parse log and exit without outputting data. # #process-and-exit false # Display real OS names. e.g, Windows XP, Snow Leopard. # real-os true # Sort panel on initial load. # Sort options are separated by comma. # Options are in the form: PANEL,METRIC,ORDER # # Available metrics: # BY_HITS - Sort by hits # BY_VISITORS - Sort by unique visitors # BY_DATA - Sort by data # BY_BW - Sort by bandwidth # BY_AVGTS - Sort by average time served # BY_CUMTS - Sort by cumulative time served # BY_MAXTS - Sort by maximum time served # BY_PROT - Sort by http protocol # BY_MTHD - Sort by http method # Available orders: # ASC # DESC # #sort-panel VISITORS,BY_DATA,ASC #sort-panel REQUESTS,BY_HITS,ASC #sort-panel REQUESTS_STATIC,BY_HITS,ASC #sort-panel NOT_FOUND,BY_HITS,ASC #sort-panel HOSTS,BY_HITS,ASC #sort-panel OS,BY_HITS,ASC #sort-panel BROWSERS,BY_HITS,ASC #sort-panel VISIT_TIMES,BY_DATA,DESC #sort-panel VIRTUAL_HOSTS,BY_HITS,ASC #sort-panel REFERRERS,BY_HITS,ASC #sort-panel REFERRING_SITES,BY_HITS,ASC #sort-panel KEYPHRASES,BY_HITS,ASC #sort-panel STATUS_CODES,BY_HITS,ASC #sort-panel REMOTE_USER,BY_HITS,ASC #sort-panel GEO_LOCATION,BY_HITS,ASC # Consider the following extensions as static files # The actual '.' is required and extensions are case sensitive # For a full list, uncomment the less common static extensions below. # static-file .css static-file .js static-file .jpg static-file .png static-file .gif static-file .ico static-file .jpeg static-file .pdf static-file .csv static-file .mpeg static-file .mpg static-file .swf static-file .woff static-file .woff2 static-file .xls static-file .xlsx static-file .doc static-file .docx static-file .ppt static-file .pptx static-file .txt static-file .zip static-file .ogg static-file .mp3 static-file .mp4 static-file .exe static-file .iso static-file .gz static-file .rar static-file .svg static-file .bmp static-file .tar static-file .tgz static-file .tiff static-file .tif static-file .ttf static-file .flv #static-file .less #static-file .ac3 #static-file .avi #static-file .bz2 #static-file .class #static-file .cue #static-file .dae #static-file .dat #static-file .dts #static-file .ejs #static-file .eot #static-file .eps #static-file .img #static-file .jar #static-file .map #static-file .mid #static-file .midi #static-file .ogv #static-file .webm #static-file .mkv #static-file .odp #static-file .ods #static-file .odt #static-file .otf #static-file .pict #static-file .pls #static-file .ps #static-file .qt #static-file .rm #static-file .svgz #static-file .wav #static-file .webp ###################################### # GeoIP Options # Only if configured with --enable-geoip ###################################### # Standard GeoIP database for less memory usage. # #std-geoip false # Specify path to GeoIP database file. i.e., GeoLiteCity.dat # .dat file needs to be downloaded from maxmind.com. # # For IPv4 City database: # wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz # gunzip GeoLiteCity.dat.gz # # For IPv6 City database: # wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz # gunzip GeoLiteCityv6.dat.gz # # For IPv6 Country database: # wget -N http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz # gunzip GeoIPv6.dat.gz # # For GeoIP2 City database: # wget -N http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz # gunzip GeoLite2-City.mmdb.gz # # For GeoIP2 Country database: # wget -N http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz # gunzip GeoLite2-Country.mmdb.gz # # Note: `geoip-city-data` is an alias of `geoip-database` # #geoip-database /usr/local/share/GeoIP/GeoLiteCity.dat ###################################### # Tokyo Cabinet Options # Only if configured with --enable-tcb=btree ###################################### # GoAccess has the ability to process logs incrementally through the on-disk # B+Tree database. # # It works in the following way: # - A data set must be persisted first with --keep-db-files, then the same data # set can be loaded with --load-from-disk. # - If new data is passed (piped or through a log file), it will append it to # the original data set. # - To preserve the data at all times, --keep-db-files must be used. # - If --load-from-disk is used without --keep-db-files, database files will be # deleted upon closing the program. # On-disk B+ Tree # Persist parsed data into disk. This should be set to # the first dataset prior to use `load-from-disk`. # Setting it to false will delete all database files # when exiting the program. #keep-db-files true # On-disk B+ Tree # Load previously stored data from disk. # Database files need to exist. See `keep-db-files`. #load-from-disk false # On-disk B+ Tree # Path where the on-disk database files are stored. # The default value is the /tmp/ directory # Note the trailing forward-slash. # #db-path /tmp/ # On-disk B+ Tree # Set the size in bytes of the extra mapped memory. # The default value is 0. # #xmmap 0 # On-disk B+ Tree # Max number of leaf nodes to be cached. # Specifies the maximum number of leaf nodes to be cached. # If it is not more than 0, the default value is specified. # The default value is 1024. # #cache-lcnum 1024 # On-disk B+ Tree # Specifies the maximum number of non-leaf nodes to be cached. # If it is not more than 0, the default value is specified. # The default value is 512. # #cache-ncnum 512 # On-disk B+ Tree # Specifies the number of members in each leaf page. # If it is not more than 0, the default value is specified. # The default value is 128. # #tune-lmemb 128 # On-disk B+ Tree # Specifies the number of members in each non-leaf page. # If it is not more than 0, the default value is specified. # The default value is 256. # #tune-nmemb 256 # On-disk B+ Tree # Specifies the number of elements of the bucket array. # If it is not more than 0, the default value is specified. # The default value is 32749. # Suggested size of the bucket array is about from 1 to 4 # times of the number of all pages to be stored. # #tune-bnum 32749 # On-disk B+ Tree # Specifies that each page is compressed with ZLIB|BZ2 encoding. # Disabled by default. # #compression zlib ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/depcomp��������������������������������������������������������������������������������0000755�0000000�0000000�00000050643�13375710677�011440� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 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 # A tabulation character. tab=' ' # A newline character. nl=' ' 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" # 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 informations. 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## 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). ## - 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## 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. tr ' ' "$nl" < "$tmpdepfile" | ## 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. 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 -eq 0; then : else 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 # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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 -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 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 -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # 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.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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" = 0; then : else 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" 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" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. 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: ���������������������������������������������������������������������������������������������goaccess-1.3/src/�����������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�13375711133�010706� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/browsers.h�������������������������������������������������������������������������0000644�0000000�0000000�00000003517�13375661253�012662� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef BROWSERS_H_INCLUDED #define BROWSERS_H_INCLUDED #define BROWSER_TYPE_LEN 13 #define MAX_LINE_BROWSERS 128 #define MAX_CUSTOM_BROWSERS 256 /* Each Browser contains the number of hits and the Browser's type */ typedef struct GBrowser_ { char browser_type[BROWSER_TYPE_LEN]; int hits; } GBrowser; char *verify_browser (char *str, char *browser_type); int is_crawler (const char *agent); void free_browsers_hash (void); void parse_browsers_file (void); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/xmalloc.h��������������������������������������������������������������������������0000644�0000000�0000000�00000003103�13375657450�012446� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef XMALLOC_H_INCLUDED #define XMALLOC_H_INCLUDED char *xstrdup (const char *s); void *xcalloc (size_t nmemb, size_t size); void *xmalloc (size_t size); void *xrealloc (void *oldptr, size_t size); #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/gdns.h�����������������������������������������������������������������������������0000644�0000000�0000000�00000005005�13375657450�011745� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GDNS_H_INCLUDED #define GDNS_H_INCLUDED #define H_SIZE 1025 #define QUEUE_SIZE 400 typedef struct GDnsThread_ { pthread_cond_t not_empty; /* not empty queue condition */ pthread_cond_t not_full; /* not full queue condition */ pthread_mutex_t mutex; pthread_t thread; } GDnsThread; typedef struct GDnsQueue_ { int head; /* index to head of queue */ int tail; /* index to tail of queue */ int size; /* queue size */ int capacity; /* length at most */ char buffer[QUEUE_SIZE][H_SIZE]; /* data item */ } GDnsQueue; extern GDnsThread gdns_thread; char *gqueue_dequeue (GDnsQueue * q); char *reverse_ip (char *str); int gqueue_empty (GDnsQueue * q); int gqueue_enqueue (GDnsQueue * q, char *item); int gqueue_find (GDnsQueue * q, const char *item); int gqueue_full (GDnsQueue * q); int gqueue_size (GDnsQueue * q); void dns_resolver (char *addr); void gdns_free_queue (void); void gdns_init (void); void gdns_queue_free (void); void gdns_thread_create (void); void gqueue_destroy (GDnsQueue * q); void gqueue_init (GDnsQueue * q, int capacity); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/geoip2.c���������������������������������������������������������������������������0000644�0000000�0000000�00000017657�13375657450�012212� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * geoip2.c -- implementation of GeoIP2 * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #ifdef HAVE_LIBMAXMINDDB #include #endif #include "geoip1.h" #include "error.h" #include "util.h" #include "xmalloc.h" /* should be reused across lookups */ int geoip_city_type = 0; static MMDB_s *mmdb = NULL; /* Determine if we have a valid geoip resource. * * If the geoip resource is NULL, 0 is returned. * If the geoip resource is valid and malloc'd, 1 is returned. */ int is_geoip_resource (void) { return mmdb != NULL ? 1 : 0; } /* Free up GeoIP resources */ void geoip_free (void) { if (!is_geoip_resource ()) return; MMDB_close (mmdb); free (mmdb); mmdb = NULL; } /* Open the given GeoIP2 database. * * On error, it aborts. * On success, a new geolocation structure is set. */ void init_geoip (void) { const char *fn = conf.geoip_database; int status = 0; if (fn == NULL) return; /* open custom city GeoIP database */ mmdb = xcalloc (1, sizeof (MMDB_s)); if ((status = MMDB_open (fn, MMDB_MODE_MMAP, mmdb)) != MMDB_SUCCESS) { free (mmdb); FATAL ("Unable to open GeoIP2 database: %s\n", fn); } if (strcmp (mmdb->metadata.database_type, "GeoLite2-City") == 0) geoip_city_type = 1; } /* Look up an IP address that is passed in as a null-terminated string. * * On error, it aborts. * If no entry is found, 1 is returned. * On success, MMDB_lookup_result_s struct is set and 0 is returned. */ static int geoip_lookup (MMDB_lookup_result_s * res, const char *ip) { int gai_err, mmdb_err; *res = MMDB_lookup_string (mmdb, ip, &gai_err, &mmdb_err); if (0 != gai_err) return 1; if (MMDB_SUCCESS != mmdb_err) FATAL ("Error from libmaxminddb: %s\n", MMDB_strerror (mmdb_err)); if (!(*res).found_entry) return 1; return 0; } /* Get continent name concatenated with code. * * If continent not found, "Unknown" is returned. * On success, the continent code & name is returned . */ static const char * get_continent_name_and_code (const char *continentid) { if (memcmp (continentid, "NA", 2) == 0) return "NA North America"; else if (memcmp (continentid, "OC", 2) == 0) return "OC Oceania"; else if (memcmp (continentid, "EU", 2) == 0) return "EU Europe"; else if (memcmp (continentid, "SA", 2) == 0) return "SA South America"; else if (memcmp (continentid, "AF", 2) == 0) return "AF Africa"; else if (memcmp (continentid, "AN", 2) == 0) return "AN Antarctica"; else if (memcmp (continentid, "AS", 2) == 0) return "AS Asia"; else return "-- Unknown"; } /* Compose a string with the country name and code and store it in the * given buffer. */ static void geoip_set_country (const char *country, const char *code, char *loc) { if (country && code) snprintf (loc, COUNTRY_LEN, "%s %s", code, country); else snprintf (loc, COUNTRY_LEN, "%s", "Unknown"); } /* Compose a string with the city name and state/region and store it * in the given buffer. */ static void geoip_set_city (const char *city, const char *region, char *loc) { snprintf (loc, CITY_LEN, "%s, %s", city ? city : "N/A City", region ? region : "N/A Region"); } /* Compose a string with the continent name and store it in the given * buffer. */ static void geoip_set_continent (const char *continent, char *loc) { if (continent) snprintf (loc, CONTINENT_LEN, "%s", get_continent_name_and_code (continent)); else snprintf (loc, CONTINENT_LEN, "%s", "Unknown"); } /* A wrapper to fetch the looked up result set. * * On error, it aborts. * If no data is found, NULL is returned. * On success, the fetched value is returned. */ static char * get_value (MMDB_lookup_result_s res, ...) { MMDB_entry_data_s entry_data; char *value = NULL; int status = 0; va_list keys; va_start (keys, res); status = MMDB_vget_value (&res.entry, &entry_data, keys); va_end (keys); if (status != MMDB_SUCCESS) return NULL; if (!entry_data.has_data) return NULL; if (entry_data.type != MMDB_DATA_TYPE_UTF8_STRING) FATAL ("Invalid data UTF8 GeoIP2 data %d:\n", entry_data.type); if ((value = strndup (entry_data.utf8_string, entry_data.data_size)) == NULL) FATAL ("Unable to allocate buffer %s: ", strerror (errno)); return value; } /* A wrapper to fetch the looked up result and set the city and region. * * If no data is found, NULL is set. * On success, the fetched value is set. */ static void geoip_query_city (MMDB_lookup_result_s res, char *location) { char *city = NULL, *region = NULL; if (res.found_entry) { city = get_value (res, "city", "names", "en", NULL); region = get_value (res, "subdivisions", "0", "names", "en", NULL); } geoip_set_city (city, region, location); } /* A wrapper to fetch the looked up result and set the country and code. * * If no data is found, NULL is set. * On success, the fetched value is set. */ static void geoip_query_country (MMDB_lookup_result_s res, char *location) { char *country = NULL, *code = NULL; if (res.found_entry) { country = get_value (res, "country", "names", "en", NULL); code = get_value (res, "country", "iso_code", NULL); } geoip_set_country (country, code, location); } /* A wrapper to fetch the looked up result and set the continent code. * * If no data is found, NULL is set. * On success, the fetched value is set. */ static void geoip_query_continent (MMDB_lookup_result_s res, char *location) { char *code = NULL; if (res.found_entry) code = get_value (res, "continent", "code", NULL); geoip_set_continent (code, location); } /* Set country data by record into the given `location` buffer */ void geoip_get_country (const char *ip, char *location, GO_UNUSED GTypeIP type_ip) { MMDB_lookup_result_s res; geoip_lookup (&res, ip); geoip_query_country (res, location); } /* A wrapper to fetch the looked up result and set the continent. */ void geoip_get_continent (const char *ip, char *location, GO_UNUSED GTypeIP type_ip) { MMDB_lookup_result_s res; geoip_lookup (&res, ip); geoip_query_continent (res, location); } /* Entry point to set GeoIP location into the corresponding buffers, * (continent, country, city). * * On error, 1 is returned * On success, buffers are set and 0 is returned */ int set_geolocation (char *host, char *continent, char *country, char *city) { MMDB_lookup_result_s res; if (!is_geoip_resource ()) return 1; geoip_lookup (&res, host); geoip_query_country (res, country); geoip_query_continent (res, continent); if (geoip_city_type) geoip_query_city (res, city); return 0; } ���������������������������������������������������������������������������������goaccess-1.3/src/settings.h�������������������������������������������������������������������������0000644�0000000�0000000�00000023744�13375661253�012660� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef SETTINGS_H_INCLUDED #define SETTINGS_H_INCLUDED #include #include "commons.h" #define MAX_LINE_CONF 512 #define MAX_EXTENSIONS 128 #define MAX_IGNORE_IPS 1024 + 128 #define MAX_IGNORE_REF 64 #define MAX_CUSTOM_COLORS 64 #define MAX_IGNORE_STATUS 64 #define MAX_OUTFORMATS 3 #define MAX_FILENAMES 512 #define NO_CONFIG_FILE "No config file used" typedef enum LOGTYPE { COMBINED, VCOMBINED, COMMON, VCOMMON, W3C, SQUID, CLOUDFRONT, CLOUDSTORAGE, AWSELB, AWSS3, } GLogType; /* predefined log times */ typedef struct GPreConfTime_ { const char *fmt24; const char *usec; const char *sec; } GPreConfTime; /* predefined log dates */ typedef struct GPreConfDate_ { const char *apache; const char *w3c; const char *usec; const char *sec; } GPreConfDate; /* predefined log formats */ typedef struct GPreConfLog_ { const char *combined; const char *vcombined; const char *common; const char *vcommon; const char *w3c; const char *cloudfront; const char *cloudstorage; const char *awselb; const char *squid; const char *awss3; } GPreConfLog; /* *INDENT-OFF* */ /* All configuration properties */ typedef struct GConf_ { /* Array options */ const char *colors[MAX_CUSTOM_COLORS]; /* colors */ const char *enable_panels[TOTAL_MODULES]; /* array of panels to enable */ const char *filenames[MAX_FILENAMES]; /* log files */ const char *hide_referers[MAX_IGNORE_REF]; /* hide referrers from report */ const char *ignore_ips[MAX_IGNORE_IPS]; /* array of ips to ignore */ const char *ignore_panels[TOTAL_MODULES]; /* array of panels to ignore */ const char *ignore_referers[MAX_IGNORE_REF]; /* referrers to ignore */ const char *ignore_status[MAX_IGNORE_STATUS]; /* status to ignore */ const char *output_formats[MAX_OUTFORMATS]; /* output format, e.g. , HTML */ const char *sort_panels[TOTAL_MODULES]; /* sorting options for each panel */ const char *static_files[MAX_EXTENSIONS]; /* static extensions */ /* Log/date/time formats */ char *date_format; /* date format */ char *date_num_format; /* numeric date format %Y%m%d */ char *time_format; /* time format as given by the user */ char *spec_date_time_format; /* date format w/ specificity */ char *spec_date_time_num_format; /* numeric date format w/ specificity */ char *log_format; /* log format */ char *iconfigfile; /* config file path */ char ***user_browsers_hash; /* custom list of browsers */ const char *debug_log; /* debug log path */ const char *geoip_database; /* geoip db path */ const char *html_custom_css; /* custom CSS */ const char *html_custom_js; /* custom JS */ const char *html_prefs; /* default HTML JSON preferences */ const char *html_report_title; /* report title */ const char *invalid_requests_log; /* invalid lines log path */ const char *pidfile; /* daemonize pid file path */ const char *browsers_file; /* browser's file path */ /* HTML real-time */ const char *addr; /* IP address to bind to */ const char *fifo_in; /* path FIFO in (reader) */ const char *fifo_out; /* path FIFO out (writer) */ const char *origin; /* WebSocket origin */ const char *port; /* port to use */ const char *sslcert; /* TLS/SSL path to certificate */ const char *sslkey; /* TLS/SSL path to private key */ const char *ws_url; /* WebSocket URL */ /* User flags */ int store_accumulated_time; /* store accumulated processing time in tcb */ int all_static_files; /* parse all static files */ int anonymize_ip; /* anonymize ip addresses */ int append_method; /* append method to the req key */ int append_protocol; /* append protocol to the req key */ int client_err_to_unique_count; /* count 400s as visitors */ int code444_as_404; /* 444 as 404s? */ int color_scheme; /* color scheme */ int crawlers_only ; /* crawlers only */ int daemonize; /* run program as a Unix daemon */ int double_decode; /* need to double decode */ int enable_html_resolver; /* html/json/csv resolver */ int geo_db; /* legacy geoip db */ int hl_header; /* highlight header on term */ int ignore_crawlers; /* ignore crawlers */ int ignore_qstr; /* ignore query string */ int ignore_statics; /* ignore static files */ int json_pretty_print; /* pretty print JSON data */ int list_agents; /* show list of agents per host */ int load_conf_dlg; /* load curses config dialog */ int load_global_config; /* use global config file */ int max_items; /* max number of items to output */ int mouse_support; /* add curses mouse support */ int no_color; /* no terminal colors */ int no_column_names; /* don't show col names on termnal */ int no_csv_summary; /* don't show overall metrics */ int no_html_last_updated; /* don't show HTML last updated field */ int no_parsing_spinner; /* disable parsing spinner */ int no_progress; /* disable progress metrics */ int no_tab_scroll; /* don't scroll dashboard on tab */ int output_stdout; /* outputting to stdout */ int process_and_exit; /* parse and exit without outputting */ int real_os; /* show real OSs */ int real_time_html; /* enable real-time HTML output */ int skip_term_resolver; /* no terminal resolver */ uint32_t num_tests; /* number of lines to test */ uint64_t log_size; /* log size override */ /* Internal flags */ int bandwidth; /* is there bandwidth within the req line */ int date_spec_hr; /* date specificity - hour */ int has_geocity; int has_geocountry; int hour_spec_min; /* hour specificity - min */ int read_stdin; /* read from stdin */ int serve_usecs; /* is there time served within req line */ int stop_processing; /* stop all processing */ int tailing_mode; /* in tailing-mode? */ /* Array indices */ int color_idx; /* colors index */ int enable_panel_idx; /* enable panels index */ int filenames_idx; /* filenames index */ int hide_referer_idx; /* hide referrers index */ int ignore_ip_idx; /* ignored ips index */ int ignore_panel_idx; /* ignored panels index */ int ignore_referer_idx; /* ignored referrers index */ int ignore_status_idx; /* ignore status index */ int output_format_idx; /* output format index */ int sort_panel_idx; /* sort panel index */ int static_file_idx; /* static extensions index */ int browsers_hash_idx; /* browsers hash index */ size_t static_file_max_len; /* TokyoCabinet */ const char *db_path; /* db path to files */ int64_t xmmap; /* size of the extra mapped memory */ int cache_lcnum; /* max num of leaf nodes to cache */ int cache_ncnum; /* max num of non-leaf nodes to cache */ int compression; /* deflate or BZIP2 */ int keep_db_files; /* persist parsed data into disk */ int load_from_disk; /* load stored data */ int tune_bnum; /* num of elems of the bucket array */ int tune_lmemb; /* num of memb in each leaf page */ int tune_nmemb; /* num of memb in each non-leaf page */ } GConf; /* *INDENT-ON* */ char *get_selected_date_str (size_t idx); char *get_selected_format_str (size_t idx); char *get_selected_time_str (size_t idx); const char *verify_formats (void); size_t get_selected_format_idx (void); void set_date_format_str (const char *optarg); void set_log_format_str (const char *optarg); void set_spec_date_format (void); void set_time_format_str (const char *optarg); extern GConf conf; char *get_config_file_path (void); int parse_conf_file (int *argc, char ***argv); void free_cmd_args (void); void free_formats (void); void set_default_static_files (void); #endif ����������������������������goaccess-1.3/src/parser.c���������������������������������������������������������������������������0000644�0000000�0000000�00000212466�13375661253�012310� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * parser.c -- web log parsing * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * "_XOPEN_SOURCE" is required for the GNU libc to export "strptime(3)" * correctly. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #define _XOPEN_SOURCE 700 #include #include #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #include "tcbtdb.h" #else #include "gkhash.h" #endif #ifdef HAVE_GEOLOCATION #include "geoip1.h" #endif #include "parser.h" #include "browsers.h" #include "goaccess.h" #include "error.h" #include "opesys.h" #include "util.h" #include "xmalloc.h" /* private prototypes */ /* key/data generators for each module */ static int gen_visitor_key (GKeyData * kdata, GLogItem * logitem); static int gen_404_key (GKeyData * kdata, GLogItem * logitem); static int gen_browser_key (GKeyData * kdata, GLogItem * logitem); static int gen_host_key (GKeyData * kdata, GLogItem * logitem); static int gen_keyphrase_key (GKeyData * kdata, GLogItem * logitem); static int gen_os_key (GKeyData * kdata, GLogItem * logitem); static int gen_vhost_key (GKeyData * kdata, GLogItem * logitem); static int gen_remote_user_key (GKeyData * kdata, GLogItem * logitem); static int gen_referer_key (GKeyData * kdata, GLogItem * logitem); static int gen_ref_site_key (GKeyData * kdata, GLogItem * logitem); static int gen_request_key (GKeyData * kdata, GLogItem * logitem); static int gen_static_request_key (GKeyData * kdata, GLogItem * logitem); static int gen_status_code_key (GKeyData * kdata, GLogItem * logitem); static int gen_visit_time_key (GKeyData * kdata, GLogItem * logitem); #ifdef HAVE_GEOLOCATION static int gen_geolocation_key (GKeyData * kdata, GLogItem * logitem); #endif /* insertion routines */ static void insert_data (int data_nkey, const char *data, GModule module); static void insert_rootmap (int root_nkey, const char *root, GModule module); /* insertion metric routines */ static void insert_hit (int data_nkey, GModule module); static void insert_visitor (int uniq_nkey, GModule module); static void insert_bw (int data_nkey, uint64_t size, GModule module); static void insert_cumts (int data_nkey, uint64_t ts, GModule module); static void insert_maxts (int data_nkey, uint64_t ts, GModule module); static void insert_method (int data_nkey, const char *method, GModule module); static void insert_protocol (int data_nkey, const char *proto, GModule module); static void insert_agent (int data_nkey, int agent_nkey, GModule module); /* *INDENT-OFF* */ static GParse paneling[] = { { VISITORS, gen_visitor_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { REQUESTS, gen_request_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, insert_method, insert_protocol, NULL, }, { REQUESTS_STATIC, gen_static_request_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, insert_method, insert_protocol, NULL, }, { NOT_FOUND, gen_404_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, insert_method, insert_protocol, NULL, }, { HOSTS, gen_host_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, insert_agent, }, { OS, gen_os_key, insert_data, insert_rootmap, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, insert_method, insert_protocol, NULL, }, { BROWSERS, gen_browser_key, insert_data, insert_rootmap, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { REFERRERS, gen_referer_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { REFERRING_SITES, gen_ref_site_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { KEYPHRASES, gen_keyphrase_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, #ifdef HAVE_GEOLOCATION { GEO_LOCATION, gen_geolocation_key, insert_data, insert_rootmap, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, #endif { STATUS_CODES, gen_status_code_key, insert_data, insert_rootmap, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { VISIT_TIMES, gen_visit_time_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { VIRTUAL_HOSTS, gen_vhost_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, { REMOTE_USER, gen_remote_user_key, insert_data, NULL, insert_hit, insert_visitor, insert_bw, insert_cumts, insert_maxts, NULL, NULL, NULL, }, }; /* *INDENT-ON* */ /* Initialize a new GKeyData instance */ static void new_modulekey (GKeyData * kdata) { GKeyData key = { .data = NULL, .data_key = NULL, .data_nkey = 0, .root = NULL, .root_key = NULL, .root_nkey = 0, .uniq_key = NULL, .uniq_nkey = 0, }; *kdata = key; } /* Get a panel from the GParse structure given a module. * * On error, or if not found, NULL is returned. * On success, the panel value is returned. */ static GParse * panel_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (paneling); for (i = 0; i < num_panels; i++) { if (paneling[i].module == module) return &paneling[i]; } return NULL; } /* Allocate memory for a new GRawData instance. * * On success, the newly allocated GRawData is returned . */ GRawData * new_grawdata (void) { GRawData *raw_data = xmalloc (sizeof (*raw_data)); memset (raw_data, 0, sizeof *raw_data); return raw_data; } /* Allocate memory for a new GRawDataItem instance. * * On success, the newly allocated GRawDataItem is returned . */ GRawDataItem * new_grawdata_item (unsigned int size) { GRawDataItem *item = xcalloc (size, sizeof (*item)); return item; } #ifdef HAVE_LIBTOKYOCABINET /* This is due to an additional allocation on tokyo's value * retrieval :( on tcadbget() */ static void free_raw_data_str_value (GRawData * raw_data) { int i = 0; char *str = NULL; for (i = 0; i < raw_data->size; ++i) { str = raw_data->items[i].value.svalue; if (str) free (str); } } #endif /* Free memory allocated for a GRawData and GRawDataItem instance. */ void free_raw_data (GRawData * raw_data) { #ifdef HAVE_LIBTOKYOCABINET if (raw_data->type == STRING) free_raw_data_str_value (raw_data); #endif free (raw_data->items); free (raw_data); } /* Reset an instance of GLog structure. */ void reset_struct (GLog * glog) { glog->invalid = 0; glog->processed = 0; glog->resp_size = 0LL; glog->valid = 0; } /* Allocate memory for a new GLog instance. * * On success, the newly allocated GLog is returned . */ GLog * init_log (void) { GLog *glog = xmalloc (sizeof (GLog)); memset (glog, 0, sizeof *glog); return glog; } /* Initialize a new GLogItem instance. * * On success, the new GLogItem instance is returned. */ GLogItem * init_log_item (GLog * glog) { GLogItem *logitem; glog->items = xmalloc (sizeof (GLogItem)); logitem = glog->items; memset (logitem, 0, sizeof *logitem); logitem->agent = NULL; logitem->browser = NULL; logitem->browser_type = NULL; logitem->continent = NULL; logitem->country = NULL; logitem->date = NULL; logitem->errstr = NULL; logitem->host = NULL; logitem->keyphrase = NULL; logitem->method = NULL; logitem->os = NULL; logitem->os_type = NULL; logitem->protocol = NULL; logitem->qstr = NULL; logitem->ref = NULL; logitem->req_key = NULL; logitem->req = NULL; logitem->resp_size = 0LL; logitem->serve_time = 0; logitem->status = NULL; logitem->time = NULL; logitem->uniq_key = NULL; logitem->vhost = NULL; logitem->userid = NULL; memset (logitem->site, 0, sizeof (logitem->site)); return logitem; } /* Free all members of a GLogItem */ static void free_glog (GLogItem * logitem) { if (logitem->agent != NULL) free (logitem->agent); if (logitem->browser != NULL) free (logitem->browser); if (logitem->browser_type != NULL) free (logitem->browser_type); if (logitem->continent != NULL) free (logitem->continent); if (logitem->country != NULL) free (logitem->country); if (logitem->date != NULL) free (logitem->date); if (logitem->errstr != NULL) free (logitem->errstr); if (logitem->host != NULL) free (logitem->host); if (logitem->keyphrase != NULL) free (logitem->keyphrase); if (logitem->method != NULL) free (logitem->method); if (logitem->os != NULL) free (logitem->os); if (logitem->os_type != NULL) free (logitem->os_type); if (logitem->protocol != NULL) free (logitem->protocol); if (logitem->qstr != NULL) free (logitem->qstr); if (logitem->ref != NULL) free (logitem->ref); if (logitem->req_key != NULL) free (logitem->req_key); if (logitem->req != NULL) free (logitem->req); if (logitem->status != NULL) free (logitem->status); if (logitem->time != NULL) free (logitem->time); if (logitem->uniq_key != NULL) free (logitem->uniq_key); if (logitem->userid != NULL) free (logitem->userid); if (logitem->vhost != NULL) free (logitem->vhost); free (logitem); } /* Decodes the given URL-encoded string. * * On success, the decoded string is assigned to the output buffer. */ #define B16210(x) (((x) >= '0' && (x) <= '9') ? ((x) - '0') : (toupper((x)) - 'A' + 10)) static void decode_hex (char *url, char *out) { char *ptr; const char *c; for (c = url, ptr = out; *c; c++) { if (*c != '%' || !isxdigit (c[1]) || !isxdigit (c[2])) { *ptr++ = *c; } else { *ptr++ = (B16210 (c[1]) * 16) + (B16210 (c[2])); c += 2; } } *ptr = 0; } /* Entry point to decode the given URL-encoded string. * * On success, the decoded trimmed string is assigned to the output * buffer. */ static char * decode_url (char *url) { char *out, *decoded; if ((url == NULL) || (*url == '\0')) return NULL; out = decoded = xstrdup (url); decode_hex (url, out); /* double encoded URL? */ if (conf.double_decode) decode_hex (decoded, out); strip_newlines (out); return trim_str (out); } /* Process keyphrases from Google search, cache, and translate. * Note that the referer hasn't been decoded at the entry point * since there could be '&' within the search query. * * On error, 1 is returned. * On success, the extracted keyphrase is assigned and 0 is returned. */ static int extract_keyphrase (char *ref, char **keyphrase) { char *r, *ptr, *pch, *referer; int encoded = 0; if (!(strstr (ref, "http://www.google.")) && !(strstr (ref, "http://webcache.googleusercontent.com/")) && !(strstr (ref, "http://translate.googleusercontent.com/")) && !(strstr (ref, "https://www.google.")) && !(strstr (ref, "https://webcache.googleusercontent.com/")) && !(strstr (ref, "https://translate.googleusercontent.com/"))) return 1; /* webcache.googleusercontent */ if ((r = strstr (ref, "/+&")) != NULL) return 1; /* webcache.googleusercontent */ else if ((r = strstr (ref, "/+")) != NULL) r += 2; /* webcache.googleusercontent */ else if ((r = strstr (ref, "q=cache:")) != NULL) { pch = strchr (r, '+'); if (pch) r += pch - r + 1; } /* www.google.* or translate.googleusercontent */ else if ((r = strstr (ref, "&q=")) != NULL || (r = strstr (ref, "?q=")) != NULL) r += 3; else if ((r = strstr (ref, "%26q%3D")) != NULL || (r = strstr (ref, "%3Fq%3D")) != NULL) encoded = 1, r += 7; else return 1; if (!encoded && (ptr = strchr (r, '&')) != NULL) *ptr = '\0'; else if (encoded && (ptr = strstr (r, "%26")) != NULL) *ptr = '\0'; referer = decode_url (r); if (referer == NULL || *referer == '\0') return 1; referer = char_replace (referer, '+', ' '); *keyphrase = trim_str (referer); return 0; } #ifdef HAVE_GEOLOCATION /* Extract geolocation for the given host. * * On error, 1 is returned. * On success, the extracted continent and country are set and 0 is * returned. */ static int extract_geolocation (GLogItem * logitem, char *continent, char *country) { if (!is_geoip_resource ()) return 1; geoip_get_country (logitem->host, country, logitem->type_ip); geoip_get_continent (logitem->host, continent, logitem->type_ip); return 0; } #endif /* Parse a URI and extracts the *host* part from it * i.e., //www.example.com/path?googleguy > www.example.com * * On error, 1 is returned. * On success, the extracted referer is set and 0 is returned. */ static int extract_referer_site (const char *referer, char *host) { char *url, *begin, *end; int len = 0; if ((referer == NULL) || (*referer == '\0')) return 1; url = strdup (referer); if ((begin = strstr (url, "//")) == NULL) goto clean; begin += 2; if ((len = strlen (begin)) == 0) goto clean; if ((end = strchr (begin, '/')) != NULL) len = end - begin; if (len == 0) goto clean; if (len >= REF_SITE_LEN) len = REF_SITE_LEN; memcpy (host, begin, len); host[len] = '\0'; free (url); return 0; clean: free (url); return 1; } /* Determine if the given request is static (e.g., jpg, css, js, etc). * * On error, or if not static, 0 is returned. * On success, the 1 is returned. */ static int verify_static_content (const char *req) { const char *nul = req + strlen (req); const char *ext = NULL, *pch = NULL; int elen = 0, i; if (strlen (req) < conf.static_file_max_len) return 0; for (i = 0; i < conf.static_file_idx; ++i) { ext = conf.static_files[i]; if (ext == NULL || *ext == '\0') continue; elen = strlen (ext); if (conf.all_static_files && (pch = strchr (req, '?')) != NULL && pch - req > elen) { pch -= elen; if (0 == strncasecmp (ext, pch, elen)) return 1; continue; } if (!strncasecmp (nul - elen, ext, elen)) return 1; } return 0; } /* Extract the HTTP method. * * On error, or if not found, NULL is returned. * On success, the HTTP method is returned. */ static const char * extract_method (const char *token) { const char *methods[] = { "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "PATCH", "options", "get", "head", "post", "put", "delete", "trace", "connect", "patch", /* WebDAV */ "PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", "VERSION-CONTROL", "REPORT", "CHECKOUT", "CHECKIN", "UNCHECKOUT", "MKWORKSPACE", "UPDATE", "LABEL", "MERGE", "BASELINE-CONTROL", "MKACTIVITY", "ORDERPATCH", "propfind", "propwatch", "mkcol", "copy", "move", "lock", "unlock", "version-control", "report", "checkout", "checkin", "uncheckout", "mkworkspace", "update", "label", "merge", "baseline-control", "mkactivity", "orderpatch" }; const int methods_count = sizeof (methods) / sizeof (*methods); int i; /* Length of every string in list */ static int list_length[sizeof (methods) / sizeof (*methods)] = { -1 }; /* Only calculate length on first time */ if (list_length[0] == -1) { for (i = 0; i < methods_count; i++) { list_length[i] = strlen (methods[i]); } } for (i = 0; i < methods_count; i++) { if (strncmp (token, methods[i], list_length[i]) == 0) { return methods[i]; } } return NULL; } /* Determine if time-served data was stored on-disk. */ static void contains_usecs (void) { if (conf.serve_usecs) return; #ifdef TCB_BTREE ht_insert_genstats ("serve_usecs", 1); #endif conf.serve_usecs = 1; /* flag */ } /* Determine if the given token is a valid HTTP protocol. * * If not valid, 1 is returned. * If valid, 0 is returned. */ static const char * extract_protocol (const char *token) { const char *lookfor; if ((lookfor = "HTTP/1.0", !strncmp (token, lookfor, 8)) || (lookfor = "HTTP/1.1", !strncmp (token, lookfor, 8)) || (lookfor = "HTTP/2", !strncmp (token, lookfor, 6))) return lookfor; return NULL; } /* Parse a request containing the method and protocol. * * On error, or unable to parse, NULL is returned. * On success, the HTTP request is returned and the method and * protocol are assigned to the corresponding buffers. */ static char * parse_req (char *line, char **method, char **protocol) { char *req = NULL, *request = NULL, *dreq = NULL, *ptr = NULL; const char *meth, *proto; ptrdiff_t rlen; meth = extract_method (line); /* couldn't find a method, so use the whole request line */ if (meth == NULL) { request = xstrdup (line); } /* method found, attempt to parse request */ else { req = line + strlen (meth); if (!(ptr = strrchr (req, ' ')) || !(proto = extract_protocol (++ptr))) return alloc_string ("-"); req++; if ((rlen = ptr - req) <= 0) return alloc_string ("-"); request = xmalloc (rlen + 1); strncpy (request, req, rlen); request[rlen] = 0; if (conf.append_method) (*method) = strtoupper (xstrdup (meth)); if (conf.append_protocol) (*protocol) = strtoupper (xstrdup (proto)); } if (!(dreq = decode_url (request))) return request; else if (*dreq == '\0') { free (dreq); return request; } free (request); return dreq; } /* Extract the next delimiter given a log format and copy the * delimiter(s) to the destination buffer. * Note that it's possible to store up to two delimiters. * * On error, the function returns. * On success, the delimiter(s) are stored in the dest buffer and the * number of extra delimiters is returned. */ static int get_delim (char *dest, const char *p) { /* done, nothing to do */ if (p[0] == '\0' || p[1] == '\0') { dest[0] = '\0'; return 0; } /* add the first delim */ dest[0] = *(p + 1); /* check if there's another possible delim */ if (p[2] == '|' && p[3] != '%' && p[3] != '\0') { dest[1] = *(p + 3); return 1; } return 0; } /* Extract and malloc a token given the parsed rule. * * On success, the malloc'd token is returned. */ static char * parsed_string (const char *pch, char **str, int move_ptr) { char *p; size_t len = (pch - *str + 1); p = xmalloc (len); memcpy (p, *str, (len - 1)); p[len - 1] = '\0'; if (move_ptr) *str += len - 1; return trim_str (p); } /* Find and extract a token given a log format rule. * * On error, or unable to parse it, NULL is returned. * On success, the malloc'd token is returned. */ static char * parse_string (char **str, const char *delims, int cnt) { int idx = 0; char *pch = *str, *p = NULL; char end; if ((*delims != 0x0) && (p = strpbrk (*str, delims)) == NULL) return NULL; end = !*delims ? 0x0 : *p; do { /* match number of delims */ if (*pch == end) idx++; /* delim found, parse string then */ if ((*pch == end && cnt == idx) || *pch == '\0') return parsed_string (pch, str, 1); /* advance to the first unescaped delim */ if (*pch == '\\') pch++; } while (*pch++); return NULL; } /* Move forward through the log string until a non-space (!isspace) * char is found. */ static void find_alpha (char **str) { char *s = *str; while (*s) { if (isspace (*s)) s++; else break; } *str += s - *str; } /* Format the broken-down time tm to a numeric date format. * * On error, or unable to format the given tm, 1 is returned. * On success, a malloc'd format is returned. */ #pragma GCC diagnostic ignored "-Wformat-nonliteral" static int set_date (char **fdate, struct tm tm) { char buf[DATE_LEN] = ""; /* Ymd */ memset (buf, 0, sizeof (buf)); if (strftime (buf, DATE_LEN, conf.date_num_format, &tm) <= 0) return 1; *fdate = xstrdup (buf); return 0; } /* Format the broken-down time tm to a numeric time format. * * On error, or unable to format the given tm, 1 is returned. * On success, a malloc'd format is returned. */ static int set_time (char **ftime, struct tm tm) { char buf[TIME_LEN] = ""; memset (buf, 0, sizeof (buf)); if (strftime (buf, TIME_LEN, "%H:%M:%S", &tm) <= 0) return 1; *ftime = xstrdup (buf); return 0; } /* Determine the parsing specifier error and construct a message out * of it. * * On success, a malloc'd error message is assigned to the log * structure and 1 is returned. */ static int spec_err (GLogItem * logitem, int code, const char spec, const char *tkn) { char *err = NULL; const char *fmt = NULL; switch (code) { case SPEC_TOKN_INV: fmt = "Token '%s' doesn't match specifier '%%%c'"; err = xmalloc (snprintf (NULL, 0, fmt, (tkn ? tkn : "-"), spec) + 1); sprintf (err, fmt, (tkn ? tkn : "-"), spec); break; case SPEC_TOKN_SET: fmt = "Token already set for '%%%c' specifier."; err = xmalloc (snprintf (NULL, 0, fmt, spec) + 1); sprintf (err, fmt, spec); break; case SPEC_TOKN_NUL: fmt = "Token for '%%%c' specifier is NULL."; err = xmalloc (snprintf (NULL, 0, fmt, spec) + 1); sprintf (err, fmt, spec); break; case SPEC_SFMT_MIS: fmt = "Missing braces '%s' and ignore chars for specifier '%%%c'"; err = xmalloc (snprintf (NULL, 0, fmt, (tkn ? tkn : "-"), spec) + 1); sprintf (err, fmt, (tkn ? tkn : "-"), spec); break; } logitem->errstr = err; return 1; } #pragma GCC diagnostic warning "-Wformat-nonliteral" /* Parse the log string given log format rule. * * On error, or unable to parse it, 1 is returned. * On success, the malloc'd token is assigned to a GLogItem member. */ static int parse_specifier (GLogItem * logitem, char **str, const char *p, const char *end) { struct tm tm; const char *dfmt = conf.date_format; const char *tfmt = conf.time_format; char *pch, *sEnd, *bEnd, *tkn = NULL; double serve_secs = 0.0; uint64_t bandw = 0, serve_time = 0; long status = 0L; errno = 0; memset (&tm, 0, sizeof (tm)); switch (*p) { /* date */ case 'd': if (logitem->date) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); /* parse date format including dates containing spaces, * i.e., syslog date format (Jul 15 20:10:56) */ if (!(tkn = parse_string (&(*str), end, count_matches (dfmt, ' ') + 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (str_to_time (tkn, dfmt, &tm) != 0 || set_date (&logitem->date, tm) != 0) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } free (tkn); break; /* time */ case 't': if (logitem->time) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (str_to_time (tkn, tfmt, &tm) != 0 || set_time (&logitem->time, tm) != 0) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } free (tkn); break; /* date/time as decimal, i.e., timestamps, ms/us */ case 'x': if (logitem->time && logitem->date) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (str_to_time (tkn, tfmt, &tm) != 0 || set_date (&logitem->date, tm) != 0 || set_time (&logitem->time, tm) != 0) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } break; /* Virtual Host */ case 'v': if (logitem->vhost) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); if (tkn == NULL) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); logitem->vhost = tkn; break; /* remote user */ case 'e': if (logitem->userid) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); if (tkn == NULL) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); logitem->userid = tkn; break; /* remote hostname (IP only) */ case 'h': if (logitem->host) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (invalid_ipaddr (tkn, &logitem->type_ip)) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } logitem->host = tkn; break; /* request method */ case 'm': if (logitem->method) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (!extract_method (tkn)) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } logitem->method = tkn; break; /* request not including method or protocol */ case 'U': if (logitem->req) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); if (tkn == NULL || *tkn == '\0') return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if ((logitem->req = decode_url (tkn)) == NULL) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } free (tkn); break; /* query string alone, e.g., ?param=goaccess&tbm=shop */ case 'q': if (logitem->qstr) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); if (tkn == NULL || *tkn == '\0') return 0; if ((logitem->qstr = decode_url (tkn)) == NULL) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } free (tkn); break; /* request protocol */ case 'H': if (logitem->protocol) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (!extract_protocol (tkn)) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } logitem->protocol = tkn; break; /* request, including method + protocol */ case 'r': if (logitem->req) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); logitem->req = parse_req (tkn, &logitem->method, &logitem->protocol); free (tkn); break; /* Status Code */ case 's': if (logitem->status) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); status = strtol (tkn, &sEnd, 10); if (tkn == sEnd || *sEnd != '\0' || errno == ERANGE || status < 100 || status > 599) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); free (tkn); return 1; } logitem->status = tkn; break; /* size of response in bytes - excluding HTTP headers */ case 'b': if (logitem->resp_size) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); bandw = strtoull (tkn, &bEnd, 10); if (tkn == bEnd || *bEnd != '\0' || errno == ERANGE) bandw = 0; logitem->resp_size = bandw; conf.bandwidth = 1; free (tkn); break; /* referrer */ case 'R': if (logitem->ref) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); if (!(tkn = parse_string (&(*str), end, 1))) tkn = alloc_string ("-"); if (*tkn == '\0') { free (tkn); tkn = alloc_string ("-"); } if (strcmp (tkn, "-") != 0) { extract_keyphrase (tkn, &logitem->keyphrase); extract_referer_site (tkn, logitem->site); /* hide referrers from report */ if (hide_referer (logitem->site)) { logitem->site[0] = '\0'; free (tkn); } else logitem->ref = tkn; break; } logitem->ref = tkn; break; /* user agent */ case 'u': if (logitem->agent) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); if (tkn != NULL && *tkn != '\0') { /* Make sure the user agent is decoded (i.e.: CloudFront) * and replace all '+' with ' ' (i.e.: w3c) */ logitem->agent = decode_url (tkn); free (tkn); break; } else if (tkn != NULL && *tkn == '\0') { free (tkn); tkn = alloc_string ("-"); } /* must be null */ else { tkn = alloc_string ("-"); } logitem->agent = tkn; break; /* time taken to serve the request, in milliseconds as a decimal number */ case 'L': /* ignore it if we already have served time */ if (logitem->serve_time) return 0; if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); serve_secs = strtoull (tkn, &bEnd, 10); if (tkn == bEnd || *bEnd != '\0' || errno == ERANGE) serve_secs = 0; /* convert it to microseconds */ logitem->serve_time = (serve_secs > 0) ? serve_secs * MILS : 0; contains_usecs (); /* set flag */ free (tkn); break; /* time taken to serve the request, in seconds with a milliseconds * resolution */ case 'T': /* ignore it if we already have served time */ if (logitem->serve_time) return 0; if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); if (strchr (tkn, '.') != NULL) serve_secs = strtod (tkn, &bEnd); else serve_secs = strtoull (tkn, &bEnd, 10); if (tkn == bEnd || *bEnd != '\0' || errno == ERANGE) serve_secs = 0; /* convert it to microseconds */ logitem->serve_time = (serve_secs > 0) ? serve_secs * SECS : 0; contains_usecs (); /* set flag */ free (tkn); break; /* time taken to serve the request, in microseconds */ case 'D': /* ignore it if we already have served time */ if (logitem->serve_time) return 0; if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); serve_time = strtoull (tkn, &bEnd, 10); if (tkn == bEnd || *bEnd != '\0' || errno == ERANGE) serve_time = 0; logitem->serve_time = serve_time; contains_usecs (); /* set flag */ free (tkn); break; /* move forward through str until not a space */ case '~': find_alpha (&(*str)); break; /* everything else skip it */ default: if ((pch = strchr (*str, p[1])) != NULL) *str += pch - *str; } return 0; } /* Parse the special host specifier and extract the characters that * need to be rejected when attempting to parse the XFF field. * * If no unable to find both curly braces (boundaries), NULL is returned. * On success, the malloc'd reject set is returned. */ static char * extract_braces (char **p) { char *b1 = NULL, *b2 = NULL, *ret = NULL, *s = *p; int esc = 0; ptrdiff_t len = 0; /* iterate over the log format */ for (; *s; s++) { if (*s == '\\') { esc = 1; } else if (*s == '{' && !esc) { b1 = s; } else if (*s == '}' && !esc) { b2 = s; break; } else { esc = 0; } } if ((!b1) || (!b2)) return NULL; if ((len = b2 - (b1 + 1)) <= 0) return NULL; /* Found braces, extract 'reject' character set. */ ret = xmalloc (len + 1); memcpy (ret, b1 + 1, len); ret[len] = '\0'; (*p) = b2 + 1; return ret; } /* Attempt to extract the client IP from an X-Forwarded-For (XFF) field. * * If no IP is found, 1 is returned. * On success, the malloc'd token is assigned to a GLogItem->host and * 0 is returned. */ static int find_xff_host (GLogItem * logitem, char **str, char **p) { char *ptr = NULL, *tkn = NULL, *skips = NULL; int invalid_ip = 1, len = 0, type_ip = TYPE_IPINV; if (!(skips = extract_braces (p))) return spec_err (logitem, SPEC_SFMT_MIS, **p, "{}"); ptr = *str; while (*ptr != '\0') { if ((len = strcspn (ptr, skips)) == 0) { len++, ptr++; goto move; } ptr += len; /* extract possible IP */ if (!(tkn = parsed_string (ptr, str, 0))) break; invalid_ip = invalid_ipaddr (tkn, &type_ip); /* done, already have IP and current token is not a host */ if (logitem->host && invalid_ip) { free (tkn); break; } if (!logitem->host && !invalid_ip) { logitem->host = xstrdup (tkn); logitem->type_ip = type_ip; } free (tkn); move: *str += len; } free (skips); return logitem->host == NULL; } /* Handle special specifiers. * * On error, or unable to parse it, 1 is returned. * On success, the malloc'd token is assigned to a GLogItem member and * 0 is returned. */ static int special_specifier (GLogItem * logitem, char **str, char **p) { switch (**p) { /* XFF remote hostname (IP only) */ case 'h': if (logitem->host) return spec_err (logitem, SPEC_TOKN_SET, **p, NULL); if (find_xff_host (logitem, str, p)) return spec_err (logitem, SPEC_TOKN_NUL, 'h', NULL); break; } return 0; } /* Iterate over the given log format. * * On error, or unable to parse it, 1 is returned. * On success, the malloc'd token is assigned to a GLogItem member and * 0 is returned. */ static int parse_format (GLogItem * logitem, char *str) { char end[2 + 1] = { 0 }; char *lfmt = conf.log_format, *p = NULL; int perc = 0, tilde = 0, optdelim = 0; if (str == NULL || *str == '\0') return 1; /* iterate over the log format */ for (p = lfmt; *p; p++) { /* advance to the first unescaped delim */ if (*p == '\\') continue; if (*p == '%') { perc++; continue; } if (*p == '~' && perc == 0) { tilde++; continue; } if (tilde && *p != '\0') { if ((str == NULL) || (*str == '\0')) return 0; if (special_specifier (logitem, &str, &p) == 1) return 1; tilde = 0; } /* %h */ else if (perc && *p != '\0') { if ((str == NULL) || (*str == '\0')) return 0; memset (end, 0, sizeof end); optdelim = get_delim (end, p); /* attempt to parse format specifiers */ if (parse_specifier (logitem, &str, p, end) == 1) return 1; /* account for the extra delimiter */ if (optdelim) p++; perc = 0; } else if (perc && isspace (p[0])) { return 1; } else { str++; } } return 0; } /* Determine if the log string is valid and if it's not a comment. * * On error, or invalid, 1 is returned. * On success, or valid line, 0 is returned. */ static int valid_line (char *line) { /* invalid line */ if ((line == NULL) || (*line == '\0')) return 1; /* ignore comments */ if (*line == '#' || *line == '\n') return 1; return 0; } /* Determine if we need to lock the mutex. */ static void lock_spinner (void) { if (parsing_spinner != NULL && parsing_spinner->state == SPN_RUN) pthread_mutex_lock (&parsing_spinner->mutex); } /* Determine if we need to unlock the mutex. */ static void unlock_spinner (void) { if (parsing_spinner != NULL && parsing_spinner->state == SPN_RUN) pthread_mutex_unlock (&parsing_spinner->mutex); } /* Ignore request's query string. e.g., * /index.php?timestamp=1454385289 */ static void strip_qstring (char *req) { char *qmark; if ((qmark = strchr (req, '?')) != NULL) { if ((qmark - req) > 0) *qmark = '\0'; } } /* Increment the overall bandwidth. */ static void inc_resp_size (GLog * glog, uint64_t resp_size) { glog->resp_size += resp_size; #ifdef TCB_BTREE ht_insert_genstats_bw ("bandwidth", resp_size); #endif } /* Output all log errors stored during parsing. */ void output_logerrors (GLog * glog) { int i; if (!glog->log_erridx) return; fprintf (stderr, ERR_PARSED_NLINES, glog->log_erridx); fprintf (stderr, "%s:\n\n", ERR_PARSED_NLINES_DESC); for (i = 0; i < glog->log_erridx; ++i) fprintf (stderr, "%s\n", glog->errors[i]); fprintf (stderr, "\n%s\n", ERR_FORMAT_HEADER); } /* Free all log errors stored during parsing. */ void free_logerrors (GLog * glog) { int i; if (!glog->log_erridx) return; for (i = 0; i < glog->log_erridx; ++i) free (glog->errors[i]); free (glog->errors); glog->errors = NULL; glog->log_erridx = 0; } /* Ensure we have the following fields. */ static int verify_missing_fields (GLogItem * logitem) { /* must have the following fields */ if (logitem->host == NULL) logitem->errstr = xstrdup ("IPv4/6 is required."); else if (logitem->date == NULL) logitem->errstr = xstrdup ("A valid date is required."); else if (logitem->req == NULL) logitem->errstr = xstrdup ("A request is required."); return logitem->errstr != NULL; } /* Keep track of all invalid log strings. */ static void count_invalid (GLog * glog, const char *line) { glog->invalid++; #ifdef TCB_BTREE ht_insert_genstats ("failed_requests", 1); #endif if (conf.invalid_requests_log) { LOG_INVALID (("%s", line)); } if (glog->items->errstr && glog->invalid < MAX_LOG_ERRORS) { if (glog->errors == NULL) glog->errors = xcalloc (MAX_LOG_ERRORS, sizeof (char *)); glog->errors[glog->log_erridx++] = xstrdup (glog->items->errstr); } } /* Count down the number of invalids hits. * Note: Upon performing a log test, invalid hits are counted, since * no valid records were found, then we count down by the number of * tests ran. */ static void uncount_invalid (GLog * glog) { glog->invalid -= conf.num_tests; #ifdef TCB_BTREE ht_replace_genstats ("failed_requests", glog->invalid); #endif } /* Count down the number of processed hits. * Note: Upon performing a log test, processed hits are counted, since * no valid records were found, then we count down by the number of * tests ran. */ static void uncount_processed (GLog * glog) { glog->processed -= conf.num_tests; #ifdef TCB_BTREE ht_replace_genstats ("total_requests", glog->processed); #endif } /* Keep track of all valid log strings. */ static void count_valid (GLog * glog) { lock_spinner (); glog->valid++; #ifdef TCB_BTREE ht_insert_genstats ("valid_requests", 1); #endif unlock_spinner (); } /* Keep track of all valid and processed log strings. */ static void count_process (GLog * glog) { lock_spinner (); glog->processed++; #ifdef TCB_BTREE ht_insert_genstats ("total_requests", 1); #endif unlock_spinner (); } /* Keep track of all excluded log strings (IPs). * * If IP not range, 1 is returned. * If IP is excluded, 0 is returned. */ static int excluded_ip (GLog * glog, GLogItem * logitem) { if (conf.ignore_ip_idx && ip_in_range (logitem->host)) { glog->excluded_ip++; #ifdef TCB_BTREE ht_insert_genstats ("excluded_ip", 1); #endif return 0; } return 1; } /* Determine if the request is from a robot or spider and check if we * need to ignore or show crawlers only. * * If the request line is not ignored, 0 is returned. * If the request line is ignored, 1 is returned. */ static int handle_crawler (const char *agent) { int bot = 0; if (!conf.ignore_crawlers && !conf.crawlers_only) return 1; bot = is_crawler (agent); return (conf.ignore_crawlers && bot) || (conf.crawlers_only && !bot) ? 0 : 1; } /* A wrapper function to determine if the request is static. * * If the request is not static, 0 is returned. * If the request is static, 1 is returned. */ static int is_static (const char *req) { return verify_static_content (req); } /* Determine if the request of the given status code needs to be * ignored. * * If the status code is not within the ignore-array, 0 is returned. * If the status code is within the ignore-array, 1 is returned. */ static int ignore_status_code (const char *status) { if (conf.ignore_status_idx == 0) return 0; if (str_inarray (status, conf.ignore_status, conf.ignore_status_idx) != -1) return 1; return 0; } /* Determine if static file request should be ignored * * If the request line is not ignored, 0 is returned. * If the request line is ignored, 1 is returned. */ static int ignore_static (const char *req) { if (conf.ignore_statics && is_static (req)) return 1; return 0; } /* Determine if the request status code is a 404. * * If the request is not a 404, 0 is returned. * If the request is a 404, 1 is returned. */ static int is_404 (GLogItem * logitem) { /* is this a 404? */ if (logitem->status && !memcmp (logitem->status, "404", 3)) return 1; /* treat 444 as 404? */ else if (logitem->status && !memcmp (logitem->status, "444", 3) && conf.code444_as_404) return 1; return 0; } /* A wrapper function to determine if a log line needs to be ignored. * * If the request line is not ignored, 0 is returned. * If the request line is ignored, IGNORE_LEVEL_PANEL is returned. * If the request line is only not counted as valid, IGNORE_LEVEL_REQ is returned. */ static int ignore_line (GLog * glog, GLogItem * logitem) { if (excluded_ip (glog, logitem) == 0) return IGNORE_LEVEL_PANEL; if (handle_crawler (logitem->agent) == 0) return IGNORE_LEVEL_PANEL; if (ignore_referer (logitem->site)) return IGNORE_LEVEL_PANEL; if (ignore_status_code (logitem->status)) return IGNORE_LEVEL_PANEL; if (ignore_static (logitem->req)) return conf.ignore_statics; // IGNORE_LEVEL_PANEL or IGNORE_LEVEL_REQ /* check if we need to remove the request's query string */ if (conf.ignore_qstr) strip_qstring (logitem->req); return 0; } /* A wrapper function to insert a keymap string key. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ static int insert_keymap (char *key, GModule module) { return ht_insert_keymap (module, key); } /* A wrapper function to insert a datamap int key and string value. */ static void insert_data (int nkey, const char *data, GModule module) { ht_insert_datamap (module, nkey, data); } /* A wrapper function to insert a uniqmap string key. * * If the given key exists, 0 is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ static int insert_uniqmap (char *uniq_key, GModule module) { return ht_insert_uniqmap (module, uniq_key); } /* A wrapper function to insert a rootmap int key from the keymap * store mapped to its string value. */ static void insert_rootmap (int root_nkey, const char *root, GModule module) { ht_insert_rootmap (module, root_nkey, root); } /* A wrapper function to insert a data int key mapped to the * corresponding int root key. */ static void insert_root (int data_nkey, int root_nkey, GModule module) { ht_insert_root (module, data_nkey, root_nkey); } /* A wrapper function to increase hits counter from an int key. */ static void insert_hit (int data_nkey, GModule module) { ht_insert_hits (module, data_nkey, 1); ht_insert_meta_data (module, "hits", 1); } /* A wrapper function to increase visitors counter from an int * key. */ static void insert_visitor (int uniq_nkey, GModule module) { ht_insert_visitor (module, uniq_nkey, 1); ht_insert_meta_data (module, "visitors", 1); } /* A wrapper function to increases bandwidth counter from an int * key. */ static void insert_bw (int data_nkey, uint64_t size, GModule module) { ht_insert_bw (module, data_nkey, size); ht_insert_meta_data (module, "bytes", size); } /* A wrapper call to increases cumulative time served counter * from an int key. */ static void insert_cumts (int data_nkey, uint64_t ts, GModule module) { ht_insert_cumts (module, data_nkey, ts); ht_insert_meta_data (module, "cumts", ts); } /* A wrapper call to insert the maximum time served counter from * an int key. */ static void insert_maxts (int data_nkey, uint64_t ts, GModule module) { ht_insert_maxts (module, data_nkey, ts); ht_insert_meta_data (module, "maxts", ts); } static void insert_method (int nkey, const char *data, GModule module) { ht_insert_method (module, nkey, data ? data : "---"); } /* A wrapper call to insert a method given an int key and string * value. */ static void insert_protocol (int nkey, const char *data, GModule module) { ht_insert_protocol (module, nkey, data ? data : "---"); } /* A wrapper call to insert an agent for a hostname given an int * key and int value. */ static void insert_agent (int data_nkey, int agent_nkey, GModule module) { ht_insert_agent (module, data_nkey, agent_nkey); } /* The following generates a unique key to identity unique visitors. * The key is made out of the IP, date, and user agent. * Note that for readability, doing a simple snprintf/sprintf should * suffice, however, memcpy is the fastest solution * * On success the new unique visitor key is returned */ static char * get_uniq_visitor_key (GLogItem * logitem) { char *ua = NULL, *key = NULL; size_t s1, s2, s3; ua = deblank (xstrdup (logitem->agent)); s1 = strlen (logitem->host); s2 = strlen (logitem->date); s3 = strlen (ua); /* includes terminating null */ key = xcalloc (s1 + s2 + s3 + 3, sizeof (char)); memcpy (key, logitem->host, s1); key[s1] = '|'; memcpy (key + s1 + 1, logitem->date, s2 + 1); key[s1 + s2 + 1] = '|'; memcpy (key + s1 + s2 + 2, ua, s3 + 1); free (ua); return key; } /* The following generates a unique key to identity unique requests. * The key is made out of the actual request, and if available, the * method and the protocol. Note that for readability, doing a simple * snprintf/sprintf should suffice, however, memcpy is the fastest * solution * * On success the new unique request key is returned */ static char * gen_unique_req_key (GLogItem * logitem) { char *key = NULL; size_t s1 = 0, s2 = 0, s3 = 0, nul = 1, sep = 0; /* nothing to do */ if (!conf.append_method && !conf.append_protocol) return xstrdup (logitem->req); /* still nothing to do */ if (!logitem->method && !logitem->protocol) return xstrdup (logitem->req); s1 = strlen (logitem->req); if (logitem->method && conf.append_method) { s2 = strlen (logitem->method); nul++; } if (logitem->protocol && conf.append_protocol) { s3 = strlen (logitem->protocol); nul++; } /* includes terminating null */ key = xcalloc (s1 + s2 + s3 + nul, sizeof (char)); /* append request */ memcpy (key, logitem->req, s1); if (logitem->method && conf.append_method) { key[s1] = '|'; sep++; memcpy (key + s1 + sep, logitem->method, s2 + 1); } if (logitem->protocol && conf.append_protocol) { key[s1 + s2 + sep] = '|'; sep++; memcpy (key + s1 + s2 + sep, logitem->protocol, s3 + 1); } return key; } /* Append the query string to the request, and therefore, it modifies * the original logitem->req */ static void append_query_string (char **req, const char *qstr) { char *r; size_t s1, s2, qm = 0; s1 = strlen (*req); s2 = strlen (qstr); /* add '?' between the URL and the query string */ if (*qstr != '?') qm = 1; r = xmalloc (s1 + s2 + qm + 1); memcpy (r, *req, s1); if (qm) r[s1] = '?'; memcpy (r + s1 + qm, qstr, s2 + 1); free (*req); *req = r; } /* A wrapper to assign the given data key and the data item to the key * data structure */ static void get_kdata (GKeyData * kdata, char *data_key, char *data) { /* inserted in keymap */ kdata->data_key = data_key; /* inserted in datamap */ kdata->data = data; } /* Generate a visitor's key given the date specificity. For instance, * if the specificity if set to hours, then a generated key would * look like: 03/Jan/2016:09 */ static void set_spec_visitor_key (char **fdate, const char *ftime) { size_t dlen = 0, tlen = 0; char *key = NULL, *tkey = NULL, *pch = NULL; tkey = xstrdup (ftime); if (conf.date_spec_hr && (pch = strchr (tkey, ':')) && (pch - tkey) > 0) *pch = '\0'; dlen = strlen (*fdate); tlen = strlen (tkey); key = xmalloc (dlen + tlen + 1); memcpy (key, *fdate, dlen); memcpy (key + dlen, tkey, tlen + 1); free (*fdate); free (tkey); *fdate = key; } /* Generate a unique key for the visitors panel from the given logitem * structure and assign it to the output key data structure. * * On error, or if no date is found, 1 is returned. * On success, the date key is assigned to our key data structure. */ static int gen_visitor_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->date || !logitem->time) return 1; /* Append time specificity to date */ if (conf.date_spec_hr) set_spec_visitor_key (&logitem->date, logitem->time); get_kdata (kdata, logitem->date, logitem->date); return 0; } /* Generate a unique key for the requests panel from the given logitem * structure and assign it to out key data structure. * * On success, the generated request key is assigned to our key data * structure. */ static int gen_req_key (GKeyData * kdata, GLogItem * logitem) { if (logitem->req && logitem->qstr) append_query_string (&logitem->req, logitem->qstr); logitem->req_key = gen_unique_req_key (logitem); get_kdata (kdata, logitem->req_key, logitem->req); return 0; } /* A wrapper to generate a unique key for the request panel. * * On error, or if the request is static or a 404, 1 is returned. * On success, the generated request key is assigned to our key data * structure. */ static int gen_request_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->req || logitem->is_404 || logitem->is_static) return 1; return gen_req_key (kdata, logitem); } /* A wrapper to generate a unique key for the request panel. * * On error, or if the request is not a 404, 1 is returned. * On success, the generated request key is assigned to our key data * structure. */ static int gen_404_key (GKeyData * kdata, GLogItem * logitem) { if (logitem->req && logitem->is_404) return gen_req_key (kdata, logitem); return 1; } /* A wrapper to generate a unique key for the request panel. * * On error, or if the request is not a static request, 1 is returned. * On success, the generated request key is assigned to our key data * structure. */ static int gen_static_request_key (GKeyData * kdata, GLogItem * logitem) { if (logitem->req && logitem->is_static) return gen_req_key (kdata, logitem); return 1; } /* A wrapper to generate a unique key for the virtual host panel. * * On error, 1 is returned. * On success, the generated vhost key is assigned to our key data * structure. */ static int gen_vhost_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->vhost) return 1; get_kdata (kdata, logitem->vhost, logitem->vhost); return 0; } /* A wrapper to generate a unique key for the virtual host panel. * * On error, 1 is returned. * On success, the generated userid key is assigned to our key data * structure. */ static int gen_remote_user_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->userid) return 1; get_kdata (kdata, logitem->userid, logitem->userid); return 0; } /* A wrapper to generate a unique key for the hosts panel. * * On error, 1 is returned. * On success, the generated host key is assigned to our key data * structure. */ static int gen_host_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->host) return 1; get_kdata (kdata, logitem->host, logitem->host); return 0; } /* Generate a browser unique key for the browser's panel given a user * agent and assign the browser type/category as a root element. * * On error, 1 is returned. * On success, the generated browser key is assigned to our key data * structure. */ static int gen_browser_key (GKeyData * kdata, GLogItem * logitem) { char *agent = NULL; char browser_type[BROWSER_TYPE_LEN] = ""; if (logitem->agent == NULL || *logitem->agent == '\0') return 1; agent = xstrdup (logitem->agent); logitem->browser = verify_browser (agent, browser_type); logitem->browser_type = xstrdup (browser_type); /* e.g., Firefox 11.12 */ kdata->data = logitem->browser; kdata->data_key = logitem->browser; /* Firefox */ kdata->root = logitem->browser_type; kdata->root_key = logitem->browser_type; free (agent); return 0; } /* Generate an operating system unique key for the OS' panel given a * user agent and assign the OS type/category as a root element. * * On error, 1 is returned. * On success, the generated OS key is assigned to our key data * structure. */ static int gen_os_key (GKeyData * kdata, GLogItem * logitem) { char *agent = NULL; char os_type[OPESYS_TYPE_LEN] = ""; if (logitem->agent == NULL || *logitem->agent == '\0') return 1; agent = xstrdup (logitem->agent); logitem->os = verify_os (agent, os_type); logitem->os_type = xstrdup (os_type); /* e.g., Linux,Ubuntu 10.12 */ kdata->data = logitem->os; kdata->data_key = logitem->os; /* Linux */ kdata->root = logitem->os_type; kdata->root_key = logitem->os_type; free (agent); return 0; } /* A wrapper to generate a unique key for the referrers panel. * * On error, 1 is returned. * On success, the generated referrer key is assigned to our key data * structure. */ static int gen_referer_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->ref) return 1; get_kdata (kdata, logitem->ref, logitem->ref); return 0; } /* A wrapper to generate a unique key for the referring sites panel. * * On error, 1 is returned. * On success, the generated referring site key is assigned to our key data * structure. */ static int gen_ref_site_key (GKeyData * kdata, GLogItem * logitem) { if (logitem->site[0] == '\0') return 1; get_kdata (kdata, logitem->site, logitem->site); return 0; } /* A wrapper to generate a unique key for the keyphrases panel. * * On error, 1 is returned. * On success, the generated keyphrase key is assigned to our key data * structure. */ static int gen_keyphrase_key (GKeyData * kdata, GLogItem * logitem) { if (!logitem->keyphrase) return 1; get_kdata (kdata, logitem->keyphrase, logitem->keyphrase); return 0; } /* A wrapper to generate a unique key for the geolocation panel. * * On error, 1 is returned. * On success, the generated geolocation key is assigned to our key * data structure. */ #ifdef HAVE_GEOLOCATION static int gen_geolocation_key (GKeyData * kdata, GLogItem * logitem) { char continent[CONTINENT_LEN] = ""; char country[COUNTRY_LEN] = ""; if (extract_geolocation (logitem, continent, country) == 1) return 1; if (country[0] != '\0') logitem->country = xstrdup (country); if (continent[0] != '\0') logitem->continent = xstrdup (continent); kdata->data_key = logitem->country; kdata->data = logitem->country; kdata->root = logitem->continent; kdata->root_key = logitem->continent; return 0; } #endif /* A wrapper to generate a unique key for the status code panel. * * On error, 1 is returned. * On success, the generated status code key is assigned to our key * data structure. */ static int gen_status_code_key (GKeyData * kdata, GLogItem * logitem) { const char *status = NULL, *type = NULL; if (!logitem->status) return 1; type = verify_status_code_type (logitem->status); status = verify_status_code (logitem->status); kdata->data = (char *) status; kdata->data_key = (char *) status; kdata->root = (char *) type; kdata->root_key = (char *) type; return 0; } /* Given a time string containing at least %H:%M, extract either the * tenth of a minute or an hour. * * On error, the given string is not modified. * On success, the conf specificity is extracted. */ static void parse_time_specificity_string (char *hmark, char *ftime) { /* tenth of a minute specificity - e.g., 18:2 */ if (conf.hour_spec_min && hmark[1] != '\0') { hmark[2] = '\0'; return; } /* hour specificity (default) */ if ((hmark - ftime) > 0) *hmark = '\0'; } /* A wrapper to generate a unique key for the time distribution panel. * * On error, 1 is returned. * On success, the generated time key is assigned to our key data * structure. */ static int gen_visit_time_key (GKeyData * kdata, GLogItem * logitem) { char *hmark = NULL; char hour[HRMI_LEN] = ""; /* %H:%M */ if (!logitem->time) return 1; /* if not a timestamp, then it must be a string containing the hour. * this is faster than actual date conversion */ if (!has_timestamp (conf.time_format) && (hmark = strchr (logitem->time, ':'))) { parse_time_specificity_string (hmark, logitem->time); get_kdata (kdata, logitem->time, logitem->time); return 0; } /* otherwise it attempts to convert the date given a time format, * though this is slower */ memset (hour, 0, sizeof *hour); if (convert_date (hour, logitem->time, conf.time_format, "%H:%M", HRMI_LEN) != 0) return 1; if (*hour == '\0') return 1; if ((hmark = strchr (hour, ':'))) parse_time_specificity_string (hmark, hour); free (logitem->time); logitem->time = xstrdup (hour); get_kdata (kdata, logitem->time, logitem->time); return 0; } /* Determine if 404s need to be added to the unique visitors count. * * If it needs to be added, 0 is returned else 1 is returned. */ static int include_uniq (GLogItem * logitem) { int u = conf.client_err_to_unique_count; if (!logitem->status || logitem->status[0] != '4' || (u && logitem->status[0] == '4')) return 1; return 0; } /* Convert two integers keys to to a string (concatenated). * * On success, the given numbers as a string are returned. */ static char * intkeys2str (int a, int b) { char *s = xmalloc (snprintf (NULL, 0, "%d|%d", a, b) + 1); sprintf (s, "%d|%d", a, b); return s; } /* Determine which data metrics need to be set and set them. */ static void set_datamap (GLogItem * logitem, GKeyData * kdata, const GParse * parse) { GModule module; module = parse->module; /* insert data */ parse->datamap (kdata->data_nkey, kdata->data, module); /* insert rootmap and root-data map */ if (parse->rootmap) { parse->rootmap (kdata->root_nkey, kdata->root, module); insert_root (kdata->data_nkey, kdata->root_nkey, module); } /* insert hits */ if (parse->hits) parse->hits (kdata->data_nkey, module); /* insert visitors */ if (parse->visitor && kdata->uniq_nkey != 0) parse->visitor (kdata->data_nkey, module); /* insert bandwidth */ if (parse->bw) parse->bw (kdata->data_nkey, logitem->resp_size, module); /* insert averages time served */ if (parse->cumts) parse->cumts (kdata->data_nkey, logitem->serve_time, module); /* insert averages time served */ if (parse->maxts) parse->maxts (kdata->data_nkey, logitem->serve_time, module); /* insert method */ if (parse->method && conf.append_method) parse->method (kdata->data_nkey, logitem->method, module); /* insert protocol */ if (parse->protocol && conf.append_protocol) parse->protocol (kdata->data_nkey, logitem->protocol, module); /* insert agent */ if (parse->agent && conf.list_agents) parse->agent (kdata->data_nkey, logitem->agent_nkey, module); } /* Set data mapping and metrics. */ static void map_log (GLogItem * logitem, const GParse * parse, GModule module) { GKeyData kdata; char *uniq_key = NULL; new_modulekey (&kdata); if (parse->key_data (&kdata, logitem) == 1) return; /* each module requires a data key/value */ if (parse->datamap && kdata.data_key) kdata.data_nkey = insert_keymap (kdata.data_key, module); /* each module contains a uniq visitor key/value */ if (parse->visitor && logitem->uniq_key && include_uniq (logitem)) { uniq_key = intkeys2str (logitem->uniq_nkey, kdata.data_nkey); /* unique key already exists? */ kdata.uniq_nkey = insert_uniqmap (uniq_key, module); free (uniq_key); } /* root keys are optional */ if (parse->rootmap && kdata.root_key) kdata.root_nkey = insert_keymap (kdata.root_key, module); /* each module requires a root key/value */ if (parse->datamap && kdata.data_key) set_datamap (logitem, &kdata, parse); } /* Process a log line and set the data into the corresponding data * structure. */ static void process_log (GLogItem * logitem) { GModule module; const GParse *parse = NULL; size_t idx = 0; /* Insert one unique visitor key per request to avoid the * overhead of storing one key per module */ logitem->uniq_nkey = ht_insert_unique_key (logitem->uniq_key); /* If we need to store user agents per IP, then we store them and retrieve * its numeric key. * It maintains two maps, one for key -> value, and another * map for value -> key*/ if (conf.list_agents) { /* insert UA key and get a numeric value */ logitem->agent_nkey = ht_insert_agent_key (logitem->agent); /* insert a numeric key and map it to a UA string */ ht_insert_agent_value (logitem->agent_nkey, logitem->agent); } FOREACH_MODULE (idx, module_list) { module = module_list[idx]; if (!(parse = panel_lookup (module))) continue; map_log (logitem, parse, module); } } /* Process a line from the log and store it accordingly taking into * account multiple parsing options prior to setting data into the * corresponding data structure. * * On success, 0 is returned */ static int pre_process_log (GLog * glog, char *line, int dry_run) { GLogItem *logitem; int ret = 0; int ignorelevel = 0; /* soft ignore these lines */ if (valid_line (line)) return -1; count_process (glog); logitem = init_log_item (glog); /* Parse a line of log, and fill structure with appropriate values */ if (parse_format (logitem, line) || verify_missing_fields (logitem)) { ret = 1; count_invalid (glog, line); goto cleanup; } /* agent will be null in cases where %u is not specified */ if (logitem->agent == NULL) logitem->agent = alloc_string ("-"); /* testing log only */ if (dry_run) goto cleanup; ignorelevel = ignore_line (glog, logitem); /* ignore line */ if (ignorelevel == IGNORE_LEVEL_PANEL) goto cleanup; if (is_404 (logitem)) logitem->is_404 = 1; else if (is_static (logitem->req)) logitem->is_static = 1; logitem->uniq_key = get_uniq_visitor_key (logitem); inc_resp_size (glog, logitem->resp_size); process_log (logitem); /* don't ignore line but neither count as valid */ if (ignorelevel != IGNORE_LEVEL_REQ) count_valid (glog); cleanup: free_glog (logitem); return ret; } /* Entry point to process the given live from the log. * * On error, 1 is returned. * On success or soft ignores, 0 is returned. */ static int read_line (GLog * glog, char *line, int *test, int *cnt, int dry_run) { int ret = 0; int tests = conf.num_tests; /* start processing log line */ if ((ret = pre_process_log (glog, line, dry_run)) == 0 && *test) *test = 0; /* soft ignores */ if (ret == -1) return 0; /* glog->processed can actually be less than conf.num_tests, so we make sure * (cnt) compares to the right number */ tests = MIN (conf.num_tests, glog->processed); /* reached num of lines to test and no valid records were found, log * format is likely not matching */ if (conf.num_tests && ++(*cnt) == tests && *test) { uncount_processed (glog); uncount_invalid (glog); return 1; } return 0; } /* A replacement for GNU getline() to dynamically expand fgets buffer. * * On error, NULL is returned. * On success, the malloc'd line is returned. */ char * fgetline (FILE * fp) { char buf[LINE_BUFFER] = { 0 }; char *line = NULL, *tmp = NULL; size_t linelen = 0, len = 0; while (1) { if (!fgets (buf, sizeof (buf), fp)) { if (conf.process_and_exit && errno == EAGAIN) { nanosleep ((const struct timespec[]) { { 0, 100000000L}}, NULL); continue; } else break; } len = strlen (buf); /* overflow check */ if (SIZE_MAX - len - 1 < linelen) break; if ((tmp = realloc (line, linelen + len + 1)) == NULL) break; line = tmp; /* append */ strcpy (line + linelen, buf); linelen += len; if (feof (fp) || buf[len - 1] == '\n') return line; } free (line); return NULL; } /* Iterate over the log and read line by line (use GNU get_line to parse the * whole line). * * On error, 1 is returned. * On success, 0 is returned. */ #ifdef WITH_GETLINE static int read_lines (FILE * fp, GLog ** glog, int dry_run) { char *line = NULL; int ret = 0, cnt = 0, test = conf.num_tests > 0 ? 1 : 0; while ((line = fgetline (fp)) != NULL) { /* handle SIGINT */ if (conf.stop_processing) goto out; if ((ret = read_line ((*glog), line, &test, &cnt, dry_run))) goto out; if (dry_run && NUM_TESTS == cnt) goto out; free (line); } /* if no data was available to read from (probably from a pipe) and * still in test mode, we simply return until data becomes available */ if (!line && (errno == EAGAIN || errno == EWOULDBLOCK) && test) return 0; return (line && test) || ret; out: free (line); return test || ret; } #endif /* Iterate over the log and read line by line (uses a buffer of fixed size). * * On error, 1 is returned. * On success, 0 is returned. */ #ifndef WITH_GETLINE static int read_lines (FILE * fp, GLog ** glog, int dry_run) { char *s = NULL; char line[LINE_BUFFER] = { 0 }; int ret = 0, cnt = 0, test = conf.num_tests > 0 ? 1 : 0; while ((s = fgets (line, LINE_BUFFER, fp)) != NULL) { /* handle SIGINT */ if (conf.stop_processing) break; if ((ret = read_line ((*glog), line, &test, &cnt, dry_run))) break; if (dry_run && NUM_TESTS == cnt) break; } /* if no data was available to read from (probably from a pipe) and * still in test mode, we simply return until data becomes available */ if (!s && (errno == EAGAIN || errno == EWOULDBLOCK) && test) return 0; return (s && test) || ret; } #endif /* Read the given log line by line and process its data. * * On error, 1 is returned. * On success, 0 is returned. */ static int read_log (GLog ** glog, const char *fn, int dry_run) { FILE *fp = NULL; int piping = 0; /* Ensure we have a valid pipe to read from stdin. Only checking for * conf.read_stdin without verifying for a valid FILE pointer would certainly * lead to issues. */ if (fn[0] == '-' && fn[1] == '\0' && (*glog)->pipe) { fp = (*glog)->pipe; (*glog)->piping = piping = 1; } /* make sure we can open the log (if not reading from stdin) */ if (!piping && (fp = fopen (fn, "r")) == NULL) FATAL ("Unable to open the specified log file. %s", strerror (errno)); /* read line by line */ if (read_lines (fp, glog, dry_run)) { if (!piping) fclose (fp); return 1; } /* close log file if not a pipe */ if (!piping) fclose (fp); return 0; } /* Entry point to parse the log line by line. * * On error, 1 is returned. * On success, 0 is returned. */ int parse_log (GLog ** glog, char *tail, int dry_run) { const char *err_log = NULL; int i; /* process tail data and return */ if (tail != NULL) { /* no line testing on tail */ if (pre_process_log ((*glog), tail, dry_run)) return 1; return 0; } /* verify that we have the required formats */ if ((err_log = verify_formats ())) FATAL ("%s", err_log); /* no data piped, no logs passed, load from disk only then */ if (conf.load_from_disk && !conf.filenames_idx && !conf.read_stdin) { (*glog)->load_from_disk_only = 1; return 0; } for (i = 0; i < conf.filenames_idx; ++i) { if (read_log (glog, conf.filenames[i], dry_run)) { fprintf (stderr, "%s\n", conf.filenames[i]); return 1; } } return 0; } /* Ensure we have valid hits * * On error, an array of pointers containing the error strings. * On success, NULL is returned. */ char ** test_format (GLog * glog, int *len) { char **errors = NULL; int i; if (parse_log (&glog, NULL, 1) == 0) goto clean; errors = xcalloc (glog->log_erridx, sizeof (char *)); for (i = 0; i < glog->log_erridx; ++i) errors[i] = xstrdup (glog->errors[i]); *len = glog->log_erridx; clean: free_logerrors (glog); return errors; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/gdashboard.h�����������������������������������������������������������������������0000644�0000000�0000000�00000011164�13375657450�013113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef GDASHBOARD_H_INCLUDED #define GDASHBOARD_H_INCLUDED #include #include "ui.h" /* *INDENT-OFF* */ #define DASH_HEAD_POS 0 /* position of header line */ #define DASH_EMPTY_POS 1 /* empty line position */ #define DASH_COLS_POS 2 /* position of column names */ #define DASH_DASHES_POS 3 /* position of dashes under column names */ #define DASH_DATA_POS 4 /* data line position */ #define DASH_NON_DATA 5 /* number of rows without data stats */ #define DASH_COL_ROWS 2 /* number of rows for column values + dashed lines */ #define DASH_COLLAPSED 12 /* number of rows per panel (collapsed) */ #define DASH_EXPANDED 32 /* number of rows per panel (expanded) */ #define DASH_INIT_X 1 /* start position (x-axis) */ #define DASH_BW_LEN 11 /* max bandwidth string length, e.g., 151.69 MiB */ #define DASH_SRV_TM_LEN 9 /* max time served length, e.g., 483.00 us */ #define DASH_SPACE 1 /* space between columns (metrics) */ /* Common render data line fields */ typedef struct GDashRender_ { WINDOW *win; int y; int w; int idx; int sel; } GDashRender; /* Dashboard panel item */ typedef struct GDashData_ { GMetrics *metrics; short is_subitem; } GDashData; /* Dashboard panel meta data */ typedef struct GDashMeta_ { int max_hits; /* maximum value on the hits column */ int max_visitors; /* maximum value on the visitors column */ /* determine the maximum metric's length of these metrics */ /* for instance, 1022 is the max value for the hits column and its length = 4 */ int hits_len; int hits_perc_len; int visitors_len; int visitors_perc_len; int bw_len; int avgts_len; int cumts_len; int maxts_len; int method_len; int protocol_len; int data_len; } GDashMeta; /* Dashboard panel */ typedef struct GDashModule_ { GDashData *data; /* data metrics */ GModule module; /* module */ GDashMeta meta; /* meta data */ const char *head; /* panel header */ const char *desc; /* panel description */ int alloc_data; /* number of data items allocated. */ /* e.g., MAX_CHOICES or holder size */ int dash_size; /* dashboard size */ int holder_size; /* hash table size */ int ht_size; /* hash table size */ int idx_data; /* idx data */ unsigned short pos_y; /* dashboard current Y position */ } GDashModule; /* Dashboard */ typedef struct GDash_ { int total_alloc; /* number of allocated dashboard lines */ GDashModule module[TOTAL_MODULES]; } GDash; /* Function Prototypes */ GDashData *new_gdata (uint32_t size); GDash *new_gdash (void); int get_num_collapsed_data_rows(void); int get_num_expanded_data_rows(void); int perform_next_find (GHolder * h, GScroll * scroll); int render_find_dialog (WINDOW * main_win, GScroll * scroll); int set_module_from_mouse_event (GScroll *scroll, GDash *dash, int y); uint32_t get_ht_size_by_module (GModule module); void display_content (WINDOW * win, GDash * dash, GScroll * scroll); void free_dashboard (GDash * dash); void load_data_to_dash (GHolder * h, GDash * dash, GModule module, GScroll * scroll); void reset_find (void); void reset_scroll_offsets (GScroll * scroll); /* *INDENT-ON* */ #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/commons.c��������������������������������������������������������������������������0000644�0000000�0000000�00000030575�13375657450�012472� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * commons.c -- holds different data types * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "commons.h" #include "error.h" #include "labels.h" #include "settings.h" #include "util.h" #include "xmalloc.h" /* processing time */ time_t end_proc; time_t timestamp; time_t start_proc; /* list of available modules/panels */ int module_list[TOTAL_MODULES] = {[0 ... TOTAL_MODULES - 1] = -1 }; /* Get number of items per panel to parse. * * The number of items per panel is returned. */ int get_max_choices (void) { char *csv = NULL, *json = NULL, *html = NULL; int max = MAX_CHOICES; /* no max choices, return defaults */ if (conf.max_items <= 0) return conf.real_time_html ? MAX_CHOICES_RT : MAX_CHOICES; /* TERM */ if (!conf.output_stdout) return conf.max_items > MAX_CHOICES ? MAX_CHOICES : conf.max_items; /* REAL-TIME STDOUT */ /* real time HTML, display max rt choices */ if (conf.real_time_html) return conf.max_items > MAX_CHOICES_RT ? MAX_CHOICES_RT : conf.max_items; /* STDOUT */ /* CSV - allow n amount of choices */ if (find_output_type (&csv, "csv", 1) == 0) max = conf.max_items; /* JSON - allow n amount of choices */ if (find_output_type (&json, "json", 1) == 0 && conf.max_items > 0) max = conf.max_items; /* HTML - takes priority on cases where multiple outputs were given. Note that * we check either for an .html extension or we assume not extension was passed * via -o and therefore we are redirecting the output to a file. */ if (find_output_type (&html, "html", 1) == 0 || conf.output_format_idx == 0) max = conf.max_items > MAX_CHOICES ? MAX_CHOICES : conf.max_items; free (csv); free (html); free (json); return max; } /* Calculate a percentage. * * The percentage is returned. */ float get_percentage (unsigned long long total, unsigned long long hit) { return (total == 0 ? 0 : (((float) hit) / total) * 100); } /* Display the storage being used. */ void display_storage (void) { #ifdef TCB_BTREE fprintf (stdout, "%s\n", BUILT_WITH_TCBTREE); #elif TCB_MEMHASH fprintf (stdout, "%s\n", BUILT_WITH_TCMEMHASH); #else fprintf (stdout, "%s\n", BUILT_WITH_DEFHASH); #endif } /* Display the path of the default configuration file when `-p` is not used */ void display_default_config_file (void) { char *path = get_config_file_path (); if (!path) { fprintf (stdout, "%s\n", ERR_NODEF_CONF_FILE); fprintf (stdout, "%s `-p /path/goaccess.conf`\n", ERR_NODEF_CONF_FILE_DESC); } else { fprintf (stdout, "%s\n", path); free (path); } } /* Display the current version. */ void display_version (void) { fprintf (stdout, "GoAccess - %s.\n", GO_VERSION); fprintf (stdout, "%s: http://goaccess.io\n", INFO_MORE_INFO); fprintf (stdout, "Copyright (C) 2009-2016 by Gerardo Orellana\n"); fprintf (stdout, "\nBuild configure arguments:\n"); #ifdef DEBUG fprintf (stdout, " --enable-debug\n"); #endif #ifdef HAVE_NCURSESW_NCURSES_H fprintf (stdout, " --enable-utf8\n"); #endif #ifdef HAVE_LIBGEOIP fprintf (stdout, " --enable-geoip=legacy\n"); #endif #ifdef HAVE_LIBMAXMINDDB fprintf (stdout, " --enable-geoip=mmdb\n"); #endif #ifdef TCB_MEMHASH fprintf (stdout, " --enable-tcb=memhash\n"); #endif #ifdef TCB_BTREE fprintf (stdout, " --enable-tcb=btree\n"); #endif #if defined(TCB_MEMHASH) || defined(TCB_BTREE) #ifndef HAVE_ZLIB fprintf (stdout, " --disable-zlib\n"); #endif #ifndef HAVE_BZ2 fprintf (stdout, " --disable-bzip\n"); #endif #endif #ifdef WITH_GETLINE fprintf (stdout, " --with-getline\n"); #endif #ifdef HAVE_LIBSSL fprintf (stdout, " --with-openssl\n"); #endif } /* Get the enumerated value given a string. * * On error, -1 is returned. * On success, the enumerated module value is returned. */ int str2enum (const GEnum map[], int len, const char *str) { int i; for (i = 0; i < len; ++i) { if (!strcmp (str, map[i].str)) return map[i].idx; } return -1; } /* Get the enumerated module value given a module string. * * On error, -1 is returned. * On success, the enumerated module value is returned. */ int get_module_enum (const char *str) { /* *INDENT-OFF* */ /* String modules to enumerated modules */ GEnum enum_modules[] = { {"VISITORS" , VISITORS} , {"REQUESTS" , REQUESTS} , {"REQUESTS_STATIC" , REQUESTS_STATIC} , {"NOT_FOUND" , NOT_FOUND} , {"HOSTS" , HOSTS} , {"OS" , OS} , {"BROWSERS" , BROWSERS} , {"VISIT_TIMES" , VISIT_TIMES} , {"VIRTUAL_HOSTS" , VIRTUAL_HOSTS} , {"REFERRERS" , REFERRERS} , {"REFERRING_SITES" , REFERRING_SITES} , {"KEYPHRASES" , KEYPHRASES} , {"STATUS_CODES" , STATUS_CODES} , {"REMOTE_USER" , REMOTE_USER} , #ifdef HAVE_GEOLOCATION {"GEO_LOCATION" , GEO_LOCATION} , #endif }; /* *INDENT-ON* */ return str2enum (enum_modules, ARRAY_SIZE (enum_modules), str); } /* Instantiate a new GAgents structure. * * On success, the newly malloc'd structure is returned. */ GAgents * new_gagents (void) { GAgents *agents = xmalloc (sizeof (GAgents)); memset (agents, 0, sizeof *agents); return agents; } /* Instantiate a new GAgentItem structure. * * On success, the newly malloc'd structure is returned. */ GAgentItem * new_gagent_item (uint32_t size) { GAgentItem *item = xcalloc (size, sizeof (GAgentItem)); return item; } /* Clean the array of agents. */ void free_agents_array (GAgents * agents) { int i; if (agents == NULL) return; /* clean stuff up */ for (i = 0; i < agents->size; ++i) free (agents->items[i].agent); if (agents->items) free (agents->items); free (agents); } /* Determine if the given date format is a timestamp. * * On error, 0 is returned. * On success, 1 is returned. */ int has_timestamp (const char *fmt) { if (strcmp ("%s", fmt) == 0 || strcmp ("%f", fmt) == 0) return 1; return 0; } /* Determine if the given module is set to be enabled. * * If enabled, 1 is returned, else 0 is returned. */ int enable_panel (GModule mod) { int i, module; for (i = 0; i < conf.enable_panel_idx; ++i) { if ((module = get_module_enum (conf.enable_panels[i])) == -1) continue; if (mod == (unsigned int) module) { return 1; } } return 0; } /* Determine if the given module is set to be ignored. * * If ignored, 1 is returned, else 0 is returned. */ int ignore_panel (GModule mod) { int i, module; for (i = 0; i < conf.ignore_panel_idx; ++i) { if ((module = get_module_enum (conf.ignore_panels[i])) == -1) continue; if (mod == (unsigned int) module) { return 1; } } return 0; } /* Get the number of available modules/panels. * * The number of modules available is returned. */ uint32_t get_num_modules (void) { size_t idx = 0; uint32_t num = 0; FOREACH_MODULE (idx, module_list) { num++; } return num; } /* Get the index from the module_list given a module. * * If the module is not within the array, -1 is returned. * If the module is within the array, the index is returned. */ int get_module_index (int module) { size_t idx = 0; FOREACH_MODULE (idx, module_list) { if (module_list[idx] == module) return idx; } return -1; } /* Remove the given module from the module_list array. * * If the module is not within the array, 1 is returned. * If the module is within the array, it is removed from the array and * 0 is returned. */ int remove_module (GModule module) { int idx = get_module_index (module); if (idx == -1) return 1; if (idx < TOTAL_MODULES - 1) memmove (&module_list[idx], &module_list[idx + 1], ((TOTAL_MODULES - 1) - idx) * sizeof (module_list[0])); module_list[TOTAL_MODULES - 1] = -1; return 0; } /* Find the next module given the current module. * * The next available module in the array is returned. */ int get_next_module (GModule module) { int next = get_module_index (module) + 1; if (next == TOTAL_MODULES || module_list[next] == -1) return module_list[0]; return module_list[next]; } /* Find the previous module given the current module. * * The previous available module in the array is returned. */ int get_prev_module (GModule module) { int i; int next = get_module_index (module) - 1; if (next >= 0 && module_list[next] != -1) return module_list[next]; for (i = TOTAL_MODULES - 1; i >= 0; i--) { if (module_list[i] != -1) { return module_list[i]; } } return 0; } /* Perform some additional tasks to panels before they are being * parsed. * * Note: This overwrites --enable-panel since it assumes there's * truly nothing to do with the panel */ void verify_panels (void) { int ignore_panel_idx = conf.ignore_panel_idx; /* Remove virtual host panel if no '%v' within log format */ if (!conf.log_format) return; if (!strstr (conf.log_format, "%v") && ignore_panel_idx < TOTAL_MODULES) { if (str_inarray ("VIRTUAL_HOSTS", conf.ignore_panels, ignore_panel_idx) < 0) remove_module (VIRTUAL_HOSTS); } if (!strstr (conf.log_format, "%e") && ignore_panel_idx < TOTAL_MODULES) { if (str_inarray ("REMOTE_USER", conf.ignore_panels, ignore_panel_idx) < 0) remove_module (REMOTE_USER); } } /* Build an array of available modules (ignores listed panels). * * If there are no modules enabled, 0 is returned. * On success, the first enabled module is returned. */ int init_modules (void) { GModule module; int i; /* init - terminating with -1 */ for (module = 0; module < TOTAL_MODULES; ++module) module_list[module] = -1; for (i = 0, module = 0; module < TOTAL_MODULES; ++module) { if (!ignore_panel (module) || enable_panel (module)) { module_list[i++] = module; } } return module_list[0] > -1 ? module_list[0] : 0; } /* Get the logs size. * * If log was piped (from stdin), 0 is returned. * On success, it adds up all log sizes and its value is returned. * if --log-size was specified, it will be returned explicitly */ intmax_t get_log_sizes (void) { int i; off_t size = 0; /* --log-size */ if (conf.log_size > 0) return (intmax_t) conf.log_size; for (i = 0; i < conf.filenames_idx; ++i) { if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0') size += 0; else size += file_size (conf.filenames[i]); } return (intmax_t) size; } /* Get the log sources used. * * On success, a newly malloc'd string containing the log source either * from filename(s) and/or STDIN is returned. */ char * get_log_source_str (int max_len) { char *str = xstrdup (""); int i, len = 0; for (i = 0; i < conf.filenames_idx; ++i) { if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0') append_str (&str, "STDIN"); else append_str (&str, conf.filenames[i]); if (i != conf.filenames_idx - 1) append_str (&str, "; "); } len = strlen (str); if (max_len > 0 && len > 0 && len > max_len) { str[max_len - 3] = 0; append_str (&str, "..."); } return str; } �����������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/error.h����������������������������������������������������������������������������0000644�0000000�0000000�00000006773�13375657450�012160� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ERROR_H_INCLUDED #define ERROR_H_INCLUDED #ifndef COMMONS #include "commons.h" #endif #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_NCURSES_H #include #elif HAVE_NCURSES_H #include #elif HAVE_CURSES_H #include #endif #include "settings.h" #define TRACE_SIZE 128 #define FATAL(fmt, ...) do { \ (void) endwin (); \ fprintf (stderr, "\nGoAccess - version %s - %s %s\n", GO_VERSION, __DATE__, \ __TIME__); \ fprintf (stderr, "Config file: %s\n", conf.iconfigfile ?: NO_CONFIG_FILE); \ fprintf (stderr, "\nFatal error has occurred"); \ fprintf (stderr, "\nError occurred at: %s - %s - %d\n", __FILE__, \ __FUNCTION__, __LINE__); \ fprintf (stderr, fmt, ##__VA_ARGS__); \ fprintf (stderr, "\n\n"); \ LOG_DEBUG ((fmt, ##__VA_ARGS__)); \ exit(EXIT_FAILURE); \ } while (0) #ifdef DEBUG #define DEBUG_TEST 1 #else #define DEBUG_TEST 0 #endif /* access requests log */ #define ACCESS_LOG(x, ...) do { access_fprintf x; } while (0) /* debug log */ #define LOG_DEBUG(x, ...) do { dbg_fprintf x; } while (0) /* invalid requests log */ #define LOG_INVALID(x, ...) do { invalid_fprintf x; } while (0) /* log debug wrapper */ #define LOG(x) do { if (DEBUG_TEST) dbg_printf x; } while (0) int access_log_open (const char *path); void access_fprintf (const char *fmt, ...); void access_log_close (void); void dbg_printf (const char *fmt, ...); void dbg_fprintf (const char *fmt, ...); void dbg_log_close (void); void dbg_log_open (const char *file); void invalid_fprintf (const char *fmt, ...); void invalid_log_close (void); void invalid_log_open (const char *path); void set_signal_data (void *p); void sigsegv_handler (int sig); #endif �����goaccess-1.3/src/sort.c�����������������������������������������������������������������������������0000644�0000000�0000000�00000037331�13375657450�012003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * sort.c -- functions related to sort functionality * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "error.h" #include "settings.h" #include "util.h" #include "sort.h" /* *INDENT-OFF* */ const int sort_choices[][SORT_MAX_OPTS] = { /* VISITORS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* REQUESTS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, SORT_BY_PROT, SORT_BY_MTHD, -1}, /* REQUESTS_STATIC */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, SORT_BY_PROT, SORT_BY_MTHD, -1}, /* NOT_FOUND */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, SORT_BY_PROT, SORT_BY_MTHD, -1}, /* HOSTS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* OS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* BROWSERS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* VISIT_TIMES */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* VIRTUAL_HOSTS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* REFERRERS */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* REFERRING_SITES */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* KEYPHRASES */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* STATUS_CODES */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, /* REMOTE_USER */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, #ifdef HAVE_GEOLOCATION /* GEO_LOCATION */ {SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, -1}, #endif }; static GEnum FIELD[] = { {"BY_HITS" , SORT_BY_HITS } , {"BY_VISITORS" , SORT_BY_VISITORS } , {"BY_DATA" , SORT_BY_DATA } , {"BY_BW" , SORT_BY_BW } , {"BY_AVGTS" , SORT_BY_AVGTS } , {"BY_CUMTS" , SORT_BY_CUMTS } , {"BY_MAXTS" , SORT_BY_MAXTS } , {"BY_PROT" , SORT_BY_PROT } , {"BY_MTHD" , SORT_BY_MTHD } , }; static GEnum ORDER[] = { {"ASC" , SORT_ASC } , {"DESC" , SORT_DESC } , }; GSort module_sort[TOTAL_MODULES] = { {VISITORS , SORT_BY_DATA , SORT_DESC } , {REQUESTS , SORT_BY_HITS , SORT_DESC } , {REQUESTS_STATIC , SORT_BY_HITS , SORT_DESC } , {NOT_FOUND , SORT_BY_HITS , SORT_DESC } , {HOSTS , SORT_BY_HITS , SORT_DESC } , {OS , SORT_BY_HITS , SORT_DESC } , {BROWSERS , SORT_BY_HITS , SORT_DESC } , {VISIT_TIMES , SORT_BY_DATA , SORT_ASC } , {VIRTUAL_HOSTS , SORT_BY_HITS , SORT_DESC } , {REFERRERS , SORT_BY_HITS , SORT_DESC } , {REFERRING_SITES , SORT_BY_HITS , SORT_DESC } , {KEYPHRASES , SORT_BY_HITS , SORT_DESC } , {STATUS_CODES , SORT_BY_HITS , SORT_DESC } , {REMOTE_USER , SORT_BY_HITS , SORT_DESC } , #ifdef HAVE_GEOLOCATION {GEO_LOCATION , SORT_BY_HITS , SORT_DESC } , #endif }; /* *INDENT-ON* */ /* Sort an array of strings ascending */ int strcmp_asc (const void *a, const void *b) { return strcmp (*((char **) a), *((char **) b)); } /* Sort 'data' metric ascending */ static int cmp_data_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ia->metrics->data, ib->metrics->data); } /* Sort 'data' metric descending */ static int cmp_data_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ib->metrics->data, ia->metrics->data); } /* Sort 'hits' metric descending */ static int cmp_num_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; int va = ia->metrics->hits; int vb = ib->metrics->hits; return (va < vb) - (va > vb); } /* Sort 'hits' metric ascending */ static int cmp_num_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; int va = ia->metrics->hits; int vb = ib->metrics->hits; return (va > vb) - (va < vb); } /* Sort 'visitors' metric descending */ static int cmp_vis_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; int va = ia->metrics->visitors; int vb = ib->metrics->visitors; return (va < vb) - (va > vb); } /* Sort 'visitors' metric ascending */ static int cmp_vis_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; int va = ia->metrics->visitors; int vb = ib->metrics->visitors; return (va > vb) - (va < vb); } /* Sort GRawDataItem value descending */ static int cmp_raw_num_desc (const void *a, const void *b) { const GRawDataItem *ia = a; const GRawDataItem *ib = b; int va = ia->value.ivalue; int vb = ib->value.ivalue; return (va < vb) - (va > vb); } /* Sort GRawDataItem value descending */ static int cmp_raw_str_desc (const void *a, const void *b) { const GRawDataItem *ia = a; const GRawDataItem *ib = b; return strcmp (ib->value.svalue, ia->value.svalue); } /* Sort 'bandwidth' metric descending */ static int cmp_bw_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->bw.nbw; uint64_t vb = ib->metrics->bw.nbw; return (va < vb) - (va > vb); } /* Sort 'bandwidth' metric ascending */ static int cmp_bw_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->bw.nbw; uint64_t vb = ib->metrics->bw.nbw; return (va > vb) - (va < vb); } /* Sort 'avgts' metric descending */ static int cmp_avgts_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->avgts.nts; uint64_t vb = ib->metrics->avgts.nts; return (va < vb) - (va > vb); } /* Sort 'avgts' metric ascending */ static int cmp_avgts_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->avgts.nts; uint64_t vb = ib->metrics->avgts.nts; return (va > vb) - (va < vb); } /* Sort 'cumts' metric descending */ static int cmp_cumts_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->cumts.nts; uint64_t vb = ib->metrics->cumts.nts; return (va < vb) - (va > vb); } /* Sort 'cumts' metric ascending */ static int cmp_cumts_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->cumts.nts; uint64_t vb = ib->metrics->cumts.nts; return (va > vb) - (va < vb); } /* Sort 'maxts' metric descending */ static int cmp_maxts_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->maxts.nts; uint64_t vb = ib->metrics->maxts.nts; return (va < vb) - (va > vb); } /* Sort 'maxts' metric ascending */ static int cmp_maxts_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; uint64_t va = ia->metrics->maxts.nts; uint64_t vb = ib->metrics->maxts.nts; return (va > vb) - (va < vb); } /* Sort 'protocol' metric ascending */ static int cmp_proto_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ia->metrics->protocol, ib->metrics->protocol); } /* Sort 'protocol' metric descending */ static int cmp_proto_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ib->metrics->protocol, ia->metrics->protocol); } /* Sort 'method' metric ascending */ static int cmp_mthd_asc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ia->metrics->method, ib->metrics->method); } /* Sort 'method' metric descending */ static int cmp_mthd_desc (const void *a, const void *b) { const GHolderItem *ia = a; const GHolderItem *ib = b; return strcmp (ib->metrics->method, ia->metrics->method); } /* Given a string sort field, get the enum field value. * * On error, -1 is returned. * On success, the enumerated field value is returned. */ int get_sort_field_enum (const char *str) { return str2enum (FIELD, ARRAY_SIZE (FIELD), str); } /* Given a string sort order, get the enum order value. * * On error, -1 is returned. * On success, the enumerated order value is returned. */ int get_sort_order_enum (const char *str) { return str2enum (ORDER, ARRAY_SIZE (ORDER), str); } /* Given a GSortOrder enum value, return the corresponding string. * * The string corresponding to the enumerated order value is returned. */ const char * get_sort_order_str (GSortOrder order) { return ORDER[order].str; } /* Given a GSortField enum value, return the corresponding string. * * The string corresponding to the enumerated field value is returned. */ const char * get_sort_field_str (GSortField field) { return FIELD[field].str; } /* Given a GSortField enum value, return the corresponding key. * * The key corresponding to the enumerated field value is returned. */ const char * get_sort_field_key (GSortField field) { static const char *field2key[][2] = { {"BY_HITS", "hits"}, {"BY_VISITORS", "visitors"}, {"BY_DATA", "data"}, {"BY_BW", "bytes"}, {"BY_AVGTS", "avgts"}, {"BY_CUMTS", "cumts"}, {"BY_MAXTS", "maxts"}, {"BY_PROT", "protocol"}, {"BY_MTHD", "method"}, }; return field2key[field][1]; } /* Set the initial metric sort per module/panel. * * On error, function returns. * On success, panel metrics are sorted. */ void set_initial_sort (const char *smod, const char *sfield, const char *ssort) { int module, field, order; if ((module = get_module_enum (smod)) == -1) return; if ((field = get_sort_field_enum (sfield)) == -1) return; if ((order = get_sort_order_enum (ssort)) == -1) return; if (!can_sort_module (module, field)) return; module_sort[module].field = field; module_sort[module].sort = order; } /* Determine if module/panel metric can be sorted. * * On error or if metric can't be sorted, 0 is returned. * On success, 1 is returned. */ int can_sort_module (GModule module, int field) { int i, can_sort = 0; for (i = 0; -1 != sort_choices[module][i]; i++) { if (sort_choices[module][i] != field) continue; if (SORT_BY_AVGTS == field && !conf.serve_usecs) continue; if (SORT_BY_CUMTS == field && !conf.serve_usecs) continue; if (SORT_BY_MAXTS == field && !conf.serve_usecs) continue; else if (SORT_BY_BW == field && !conf.bandwidth) continue; else if (SORT_BY_PROT == field && !conf.append_protocol) continue; else if (SORT_BY_MTHD == field && !conf.append_method) continue; can_sort = 1; break; } return can_sort; } /* Parse all initial sort options from the config file. * * On error, function returns. * On success, panel metrics are sorted. */ void parse_initial_sort (void) { int i; char module[SORT_MODULE_LEN], field[SORT_FIELD_LEN], order[SORT_ORDER_LEN]; for (i = 0; i < conf.sort_panel_idx; ++i) { if (sscanf (conf.sort_panels[i], "%15[^','],%11[^','],%4s", module, field, order) != 3) continue; set_initial_sort (module, field, order); } } /* Apply user defined sort */ void sort_holder_items (GHolderItem * items, int size, GSort sort) { switch (sort.field) { case SORT_BY_HITS: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_num_desc); else qsort (items, size, sizeof (GHolderItem), cmp_num_asc); break; case SORT_BY_VISITORS: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_vis_desc); else qsort (items, size, sizeof (GHolderItem), cmp_vis_asc); break; case SORT_BY_DATA: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_data_desc); else qsort (items, size, sizeof (GHolderItem), cmp_data_asc); break; case SORT_BY_BW: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_bw_desc); else qsort (items, size, sizeof (GHolderItem), cmp_bw_asc); break; case SORT_BY_AVGTS: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_avgts_desc); else qsort (items, size, sizeof (GHolderItem), cmp_avgts_asc); break; case SORT_BY_CUMTS: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_cumts_desc); else qsort (items, size, sizeof (GHolderItem), cmp_cumts_asc); break; case SORT_BY_MAXTS: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_maxts_desc); else qsort (items, size, sizeof (GHolderItem), cmp_maxts_asc); break; case SORT_BY_PROT: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_proto_desc); else qsort (items, size, sizeof (GHolderItem), cmp_proto_asc); break; case SORT_BY_MTHD: if (sort.sort == SORT_DESC) qsort (items, size, sizeof (GHolderItem), cmp_mthd_desc); else qsort (items, size, sizeof (GHolderItem), cmp_mthd_asc); break; } } /* Sort raw numeric data in a descending order for the first run * (default sort) * * On success, raw data sorted in a descending order. */ GRawData * sort_raw_num_data (GRawData * raw_data, int ht_size) { qsort (raw_data->items, ht_size, sizeof *(raw_data->items), cmp_raw_num_desc); return raw_data; } /* Sort raw string data in a descending order for the first run. * * On success, raw data sorted in a descending order. */ GRawData * sort_raw_str_data (GRawData * raw_data, int ht_size) { qsort (raw_data->items, ht_size, sizeof *(raw_data->items), cmp_raw_str_desc); return raw_data; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/error.c����������������������������������������������������������������������������0000644�0000000�0000000�00000012656�13375657450�012150� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * error.c -- error handling * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #if defined(__GLIBC__) #include #endif #include #include #include "error.h" #include "labels.h" #include "parser.h" static FILE *access_log; static FILE *log_file; static FILE *log_invalid; static GLog *log_data; /* Open a debug file whose name is specified in the given path. */ void dbg_log_open (const char *path) { if (path != NULL) { log_file = fopen (path, "w"); if (log_file == NULL) return; } } /* Close the debug file. */ void dbg_log_close (void) { if (log_file != NULL) fclose (log_file); } /* Open the invalid requests log file whose name is specified in the * given path. */ void invalid_log_open (const char *path) { if (path != NULL) { log_invalid = fopen (path, "w"); if (log_invalid == NULL) return; } } /* Close the invalid requests log file. */ void invalid_log_close (void) { if (log_invalid != NULL) fclose (log_invalid); } /* Set current overall parsed log data. */ void set_signal_data (void *p) { log_data = p; } /* Open the WebSocket access log file whose name is specified in the * given path. */ int access_log_open (const char *path) { if (path == NULL) return 0; if (access (path, F_OK) != -1) access_log = fopen (path, "a"); else access_log = fopen (path, "w"); if (access_log == NULL) return 1; return 0; } /* Close the WebSocket access log file. */ void access_log_close (void) { if (access_log != NULL) fclose (access_log); } /* Dump to the standard output the values of the overall parsed log * data. */ static void dump_struct (FILE * fp) { int pid = getpid (); if (!log_data) return; fprintf (fp, "==%d== VALUES AT CRASH POINT\n", pid); fprintf (fp, "==%d==\n", pid); fprintf (fp, "==%d== Line number: %u\n", pid, log_data->processed); fprintf (fp, "==%d== Offset: %u\n", pid, log_data->offset); fprintf (fp, "==%d== Invalid data: %u\n", pid, log_data->invalid); fprintf (fp, "==%d== Piping: %d\n", pid, log_data->piping); fprintf (fp, "==%d== Response size: %llu bytes\n", pid, log_data->resp_size); fprintf (fp, "==%d==\n", pid); } /* Custom SIGSEGV handler. */ void sigsegv_handler (int sig) { FILE *fp = stderr; int pid = getpid (); #if defined(__GLIBC__) char **messages; size_t size, i; void *trace_stack[TRACE_SIZE]; #endif (void) endwin (); fprintf (fp, "\n"); fprintf (fp, "==%d== GoAccess %s crashed by Sig %d\n", pid, GO_VERSION, sig); fprintf (fp, "==%d==\n", pid); dump_struct (fp); #if defined(__GLIBC__) size = backtrace (trace_stack, TRACE_SIZE); messages = backtrace_symbols (trace_stack, size); fprintf (fp, "==%d== STACK TRACE:\n", pid); fprintf (fp, "==%d==\n", pid); for (i = 0; i < size; i++) fprintf (fp, "==%d== %zu %s\n", pid, i, messages[i]); #endif fprintf (fp, "==%d==\n", pid); fprintf (fp, "==%d== %s:\n", pid, ERR_PLEASE_REPORT); fprintf (fp, "==%d== https://github.com/allinurl/goaccess/issues\n\n", pid); exit (EXIT_FAILURE); } #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* Write formatted debug log data to the logfile. */ void dbg_fprintf (const char *fmt, ...) { va_list args; if (!log_file) return; va_start (args, fmt); vfprintf (log_file, fmt, args); fflush (log_file); va_end (args); } /* Write formatted invalid requests log data to the logfile. */ void invalid_fprintf (const char *fmt, ...) { va_list args; if (!log_invalid) return; va_start (args, fmt); vfprintf (log_invalid, fmt, args); fflush (log_invalid); va_end (args); } /* Debug otuput */ void dbg_printf (const char *fmt, ...) { va_list args; va_start (args, fmt); vfprintf (stderr, fmt, args); va_end (args); } /* Write formatted access log data to the logfile. */ void access_fprintf (const char *fmt, ...) { va_list args; if (!access_log) return; va_start (args, fmt); vfprintf (access_log, fmt, args); fflush (access_log); va_end (args); } #pragma GCC diagnostic warning "-Wformat-nonliteral" ����������������������������������������������������������������������������������goaccess-1.3/src/config.h.in������������������������������������������������������������������������0000644�0000000�0000000�00000021704�13375710676�012670� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* "Build using BZ2" */ #undef HAVE_BZ2 /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Build using GeoIP. */ #undef HAVE_GEOLOCATION /* Define to 1 if you have the `gethostbyaddr' function. */ #undef HAVE_GETHOSTBYADDR /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `GeoIP' library (-lGeoIP). */ #undef HAVE_LIBGEOIP /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the `maxminddb' library (-lmaxminddb). */ #undef HAVE_LIBMAXMINDDB /* Define to 1 if you have the `ncurses' library (-lncurses). */ #undef HAVE_LIBNCURSES /* "ncursesw is present." */ #undef HAVE_LIBNCURSESW /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define to 1 if you have the `tokyocabinet' library (-ltokyocabinet). */ #undef HAVE_LIBTOKYOCABINET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `malloc' function. */ #undef HAVE_MALLOC /* 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 `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkfifo' function. */ #undef HAVE_MKFIFO /* Define to 1 if you have the header file. */ #undef HAVE_NCURSESW_NCURSES_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. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the `realloc' function. */ #undef HAVE_REALLOC /* Define to 1 if you have the `realpath' function. */ #undef HAVE_REALPATH /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* 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 you have the header file. */ #undef HAVE_STDDEF_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 `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strspn' function. */ #undef HAVE_STRSPN /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_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 to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* "Build using ZLIB" */ #undef HAVE_ZLIB /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* 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 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* "Build using on-disk B+ Tree database" */ #undef TCB_BTREE /* "Build using on-memory hash database" */ #undef TCB_MEMHASH /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Build using GNU getline. */ #undef WITH_GETLINE /* Debug option */ #undef _DEBUG /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t ������������������������������������������������������������goaccess-1.3/src/gdns.c�����������������������������������������������������������������������������0000644�0000000�0000000�00000015622�13375657450�011746� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * gdns.c -- hosts resolver * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _MULTI_THREADED #ifdef __FreeBSD__ #include #endif #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gdns.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "error.h" #include "goaccess.h" #include "util.h" #include "xmalloc.h" GDnsThread gdns_thread; static GDnsQueue *gdns_queue; /* Initialize the queue. */ void gqueue_init (GDnsQueue * q, int capacity) { q->head = 0; q->tail = -1; q->size = 0; q->capacity = capacity; } /* Get the current size of queue. * * Returns the size of the queue. */ int gqueue_size (GDnsQueue * q) { return q->size; } /* Determine if the queue is empty. * * Returns true if empty, otherwise false. */ int gqueue_empty (GDnsQueue * q) { return q->size == 0; } /* Determine if the queue is full. * * Returns true if full, otherwise false. */ int gqueue_full (GDnsQueue * q) { return q->size == q->capacity; } /* Free the queue. */ void gqueue_destroy (GDnsQueue * q) { free (q); } /* Add at the end of the queue a string item. * * If the queue is full, -1 is returned. * If added to the queue, 0 is returned. */ int gqueue_enqueue (GDnsQueue * q, char *item) { if (gqueue_full (q)) return -1; q->tail = (q->tail + 1) % q->capacity; strcpy (q->buffer[q->tail], item); q->size++; return 0; } /* Find a string item in the queue. * * If the queue is empty, or the item is not in the queue, 0 is returned. * If found, 1 is returned. */ int gqueue_find (GDnsQueue * q, const char *item) { int i; if (gqueue_empty (q)) return 0; for (i = 0; i < q->size; i++) { if (strcmp (item, q->buffer[i]) == 0) return 1; } return 0; } /* Remove a string item from the head of the queue. * * If the queue is empty, NULL is returned. * If removed, the string item is returned. */ char * gqueue_dequeue (GDnsQueue * q) { char *item; if (gqueue_empty (q)) return NULL; item = q->buffer[q->head]; q->head = (q->head + 1) % q->capacity; q->size--; return item; } /* Get the corresponding hostname given an IP address. * * On error, a string error message is returned. * On success, a malloc'd hostname is returned. */ static char * reverse_host (const struct sockaddr *a, socklen_t length) { char h[H_SIZE]; int flags, st; flags = NI_NAMEREQD; st = getnameinfo (a, length, h, H_SIZE, NULL, 0, flags); if (!st) return alloc_string (h); return alloc_string (gai_strerror (st)); } /* Determine if IPv4 or IPv6 and resolve. * * On error, NULL is returned. * On success, a malloc'd hostname is returned. */ char * reverse_ip (char *str) { union { struct sockaddr addr; struct sockaddr_in6 addr6; struct sockaddr_in addr4; } a; if (str == NULL || *str == '\0') return NULL; memset (&a, 0, sizeof (a)); if (1 == inet_pton (AF_INET, str, &a.addr4.sin_addr)) { a.addr4.sin_family = AF_INET; return reverse_host (&a.addr, sizeof (a.addr4)); } else if (1 == inet_pton (AF_INET6, str, &a.addr6.sin6_addr)) { a.addr6.sin6_family = AF_INET6; return reverse_host (&a.addr, sizeof (a.addr6)); } return NULL; } /* Producer - Resolve an IP address and add it to the queue. */ void dns_resolver (char *addr) { pthread_mutex_lock (&gdns_thread.mutex); /* queue is not full and the IP address is not in the queue */ if (!gqueue_full (gdns_queue) && !gqueue_find (gdns_queue, addr)) { /* add the IP to the queue */ gqueue_enqueue (gdns_queue, addr); pthread_cond_broadcast (&gdns_thread.not_empty); } pthread_mutex_unlock (&gdns_thread.mutex); } /* Consumer - Once an IP has been resolved, add it to dwithe hostnames * hash structure. */ static void dns_worker (void GO_UNUSED (*ptr_data)) { char *ip = NULL, *host = NULL; while (1) { pthread_mutex_lock (&gdns_thread.mutex); /* wait until an item has been added to the queue */ while (gqueue_empty (gdns_queue)) pthread_cond_wait (&gdns_thread.not_empty, &gdns_thread.mutex); ip = gqueue_dequeue (gdns_queue); pthread_mutex_unlock (&gdns_thread.mutex); host = reverse_ip (ip); pthread_mutex_lock (&gdns_thread.mutex); if (!active_gdns) { if (host) free (host); break; } /* insert the corresponding IP -> hostname map */ if (host != NULL && active_gdns) { ht_insert_hostname (ip, host); free (host); } pthread_cond_signal (&gdns_thread.not_full); pthread_mutex_unlock (&gdns_thread.mutex); } } /* Initialize queue and dns thread */ void gdns_init (void) { gdns_queue = xmalloc (sizeof (GDnsQueue)); gqueue_init (gdns_queue, QUEUE_SIZE); if (pthread_cond_init (&(gdns_thread.not_empty), NULL)) FATAL ("Failed init thread condition"); if (pthread_cond_init (&(gdns_thread.not_full), NULL)) FATAL ("Failed init thread condition"); if (pthread_mutex_init (&(gdns_thread.mutex), NULL)) FATAL ("Failed init thread mutex"); } /* Destroy (free) queue */ void gdns_free_queue (void) { gqueue_destroy (gdns_queue); } /* Create a DNS thread and make it active */ void gdns_thread_create (void) { int th; active_gdns = 1; th = pthread_create (&(gdns_thread.thread), NULL, (void *) &dns_worker, NULL); if (th) FATAL ("Return code from pthread_create(): %d", th); pthread_detach (gdns_thread.thread); } ��������������������������������������������������������������������������������������������������������������goaccess-1.3/src/khash.h����������������������������������������������������������������������������0000644�0000000�0000000�00000113340�13375657450�012112� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* The MIT License Copyright (c) 2008, 2009, 2011 by Attractive Chaos 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* An example: #include "khash.h" KHASH_MAP_INIT_INT(32, char) int main() { int ret, is_missing; khiter_t k; khash_t(32) *h = kh_init(32); k = kh_put(32, h, 5, &ret); kh_value(h, k) = 10; k = kh_get(32, h, 10); is_missing = (k == kh_end(h)); k = kh_get(32, h, 5); kh_del(32, h, k); for (k = kh_begin(h); k != kh_end(h); ++k) if (kh_exist(h, k)) kh_value(h, k) = 1; kh_destroy(32, h); return 0; } */ /* 2013-05-02 (0.2.8): * Use quadratic probing. When the capacity is power of 2, stepping function i*(i+1)/2 guarantees to traverse each bucket. It is better than double hashing on cache performance and is more robust than linear probing. In theory, double hashing should be more robust than quadratic probing. However, my implementation is probably not for large hash tables, because the second hash function is closely tied to the first hash function, which reduce the effectiveness of double hashing. Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php 2011-12-29 (0.2.7): * Minor code clean up; no actual effect. 2011-09-16 (0.2.6): * The capacity is a power of 2. This seems to dramatically improve the speed for simple keys. Thank Zilong Tan for the suggestion. Reference: - http://code.google.com/p/ulib/ - http://nothings.org/computer/judy/ * Allow to optionally use linear probing which usually has better performance for random input. Double hashing is still the default as it is more robust to certain non-random input. * Added Wang's integer hash function (not used by default). This hash function is more robust to certain non-random input. 2011-02-14 (0.2.5): * Allow to declare global functions. 2009-09-26 (0.2.4): * Improve portability 2008-09-19 (0.2.3): * Corrected the example * Improved interfaces 2008-09-11 (0.2.2): * Improved speed a little in kh_put() 2008-09-10 (0.2.1): * Added kh_clear() * Fixed a compiling error 2008-09-02 (0.2.0): * Changed to token concatenation which increases flexibility. 2008-08-31 (0.1.2): * Fixed a bug in kh_get(), which has not been tested previously. 2008-08-31 (0.1.1): * Added destructor */ #ifndef __AC_KHASH_H #define __AC_KHASH_H /*! @header Generic hash table library. */ #define AC_VERSION_KHASH_H "0.2.8" #include #include #include /* compiler specific configuration */ #if UINT_MAX == 0xffffffffu typedef unsigned int khint32_t; #elif ULONG_MAX == 0xffffffffu typedef unsigned long khint32_t; #endif #if ULONG_MAX == ULLONG_MAX typedef unsigned long khint64_t; #else typedef unsigned long long khint64_t; #endif #ifndef kh_inline #ifdef _MSC_VER #define kh_inline __inline #else #define kh_inline inline #endif #endif /* kh_inline */ #ifndef klib_unused #if (defined __clang__ && __clang_major__ >= 3) || (defined __GNUC__ && __GNUC__ >= 3) #define klib_unused __attribute__ ((__unused__)) #else #define klib_unused #endif #endif /* klib_unused */ typedef khint32_t khint_t; typedef khint_t khiter_t; #define __ac_isempty(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&2) #define __ac_isdel(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&1) #define __ac_iseither(flag, i) ((flag[i>>4]>>((i&0xfU)<<1))&3) #define __ac_set_isdel_false(flag, i) (flag[i>>4]&=~(1ul<<((i&0xfU)<<1))) #define __ac_set_isempty_false(flag, i) (flag[i>>4]&=~(2ul<<((i&0xfU)<<1))) #define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1))) #define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1)) #define __ac_fsize(m) ((m) < 16? 1 : (m)>>4) #ifndef kroundup32 #define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) #endif #ifndef kcalloc #define kcalloc(N,Z) calloc(N,Z) #endif #ifndef kmalloc #define kmalloc(Z) malloc(Z) #endif #ifndef krealloc #define krealloc(P,Z) realloc(P,Z) #endif #ifndef kfree #define kfree(P) free(P) #endif static const double __ac_HASH_UPPER = 0.77; #define __KHASH_TYPE(name, khkey_t, khval_t) \ typedef struct kh_##name##_s { \ khint_t n_buckets, size, n_occupied, upper_bound; \ khint32_t *flags; \ khkey_t *keys; \ khval_t *vals; \ } kh_##name##_t; #define __KHASH_PROTOTYPES(name, khkey_t, khval_t) \ extern kh_##name##_t *kh_init_##name(void); \ extern void kh_destroy_##name(kh_##name##_t *h); \ extern void kh_clear_##name(kh_##name##_t *h); \ extern khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key); \ extern int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets); \ extern khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret); \ extern void kh_del_##name(kh_##name##_t *h, khint_t x); \ #define __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ SCOPE kh_##name##_t *kh_init_##name(void) { \ return (kh_##name##_t*) kcalloc(1, sizeof(kh_##name##_t)); \ } \ SCOPE void kh_destroy_##name(kh_##name##_t *h) \ { \ if (h) { \ kfree ((void *) h->keys); \ kfree (h->flags); \ kfree ((void *) h->vals); \ kfree (h); \ } \ } \ SCOPE void kh_clear_##name(kh_##name##_t *h) \ { \ if (h && h->flags) { \ memset (h->flags, 0xaa, __ac_fsize (h->n_buckets) * sizeof (khint32_t)); \ h->size = h->n_occupied = 0; \ } \ } \ SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ { \ if (h->n_buckets) { \ khint_t k, i, last, mask, step = 0; \ mask = h->n_buckets - 1; \ k = __hash_func (key); \ i = k & mask; \ last = i; \ while (!__ac_isempty (h->flags, i) && \ (__ac_isdel (h->flags, i) || !__hash_equal (h->keys[i], key))) { \ i = (i + (++step)) & mask; \ if (i == last) \ return h->n_buckets; \ } \ return __ac_iseither (h->flags, i) ? h->n_buckets : i; \ } else \ return 0; \ } \ SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ { \ /* This function uses 0.25*n_buckets bytes of working space instead of */ \ /* [sizeof(key_t+val_t)+.25]*n_buckets. */ \ khint32_t *new_flags = 0; \ khint_t j = 1; \ { \ kroundup32 (new_n_buckets); \ if (new_n_buckets < 4) \ new_n_buckets = 4; \ if (h->size >= (khint_t) (new_n_buckets * __ac_HASH_UPPER + 0.5)) \ j = 0; /* requested size is too small */ \ else { /* hash table size to be changed (shrink or expand); rehash */ \ new_flags = (khint32_t *) kmalloc (__ac_fsize (new_n_buckets) * sizeof (khint32_t)); \ if (!new_flags) \ return -1; \ memset (new_flags, 0xaa, __ac_fsize (new_n_buckets) * sizeof (khint32_t)); \ if (h->n_buckets < new_n_buckets) { /* expand */ \ khkey_t *new_keys = (khkey_t *) krealloc ((void *) h->keys, new_n_buckets * sizeof (khkey_t)); \ if (!new_keys) { \ kfree (new_flags); \ return -1; \ } \ h->keys = new_keys; \ if (kh_is_map) { \ khval_t *new_vals = (khval_t *) krealloc ((void *) h->vals, new_n_buckets * sizeof (khval_t)); \ if (!new_vals) { \ kfree (new_flags); \ return -1; \ } \ h->vals = new_vals; \ } \ } /* otherwise shrink */ \ } \ } \ if (j) { /* rehashing is needed */ \ for (j = 0; j != h->n_buckets; ++j) { \ if (__ac_iseither (h->flags, j) == 0) { \ khkey_t key = h->keys[j]; \ khval_t val; \ khint_t new_mask; \ new_mask = new_n_buckets - 1; \ if (kh_is_map) \ val = h->vals[j]; \ __ac_set_isdel_true (h->flags, j); \ while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \ khint_t k, i, step = 0; \ k = __hash_func (key); \ i = k & new_mask; \ while (!__ac_isempty (new_flags, i)) \ i = (i + (++step)) & new_mask; \ __ac_set_isempty_false (new_flags, i); \ if (i < h->n_buckets && __ac_iseither (h->flags, i) == 0) { /* kick out the existing element */ \ { \ khkey_t tmp = h->keys[i]; \ h->keys[i] = key; \ key = tmp; \ } \ if (kh_is_map) { \ khval_t tmp = h->vals[i]; \ h->vals[i] = val; \ val = tmp; \ } \ __ac_set_isdel_true (h->flags, i); /* mark it as deleted in the old hash table */ \ } else { /* write the element and jump out of the loop */ \ h->keys[i] = key; \ if (kh_is_map) \ h->vals[i] = val; \ break; \ } \ } \ } \ } \ if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \ h->keys = (khkey_t *) krealloc ((void *) h->keys, new_n_buckets * sizeof (khkey_t)); \ if (kh_is_map) \ h->vals = (khval_t *) krealloc ((void *) h->vals, new_n_buckets * sizeof (khval_t)); \ } \ kfree (h->flags); /* free the working space */ \ h->flags = new_flags; \ h->n_buckets = new_n_buckets; \ h->n_occupied = h->size; \ h->upper_bound = (khint_t) (h->n_buckets * __ac_HASH_UPPER + 0.5); \ } \ return 0; \ } \ SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \ { \ khint_t x; \ if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \ if (h->n_buckets > (h->size << 1)) { \ if (kh_resize_##name (h, h->n_buckets - 1) < 0) { /* clear "deleted" elements */ \ *ret = -1; \ return h->n_buckets; \ } \ } else if (kh_resize_##name (h, h->n_buckets + 1) < 0) { /* expand the hash table */ \ *ret = -1; \ return h->n_buckets; \ } \ } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \ { \ khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \ x = site = h->n_buckets; \ k = __hash_func (key); \ i = k & mask; \ if (__ac_isempty (h->flags, i)) \ x = i; /* for speed up */ \ else { \ last = i; \ while (!__ac_isempty (h->flags, i) && (__ac_isdel (h->flags, i) || !__hash_equal (h->keys[i], key))) { \ if (__ac_isdel (h->flags, i)) \ site = i; \ i = (i + (++step)) & mask; \ if (i == last) { \ x = site; \ break; \ } \ } \ if (x == h->n_buckets) { \ if (__ac_isempty (h->flags, i) && site != h->n_buckets) \ x = site; \ else \ x = i; \ } \ } \ } \ if (__ac_isempty (h->flags, x)) { /* not present at all */ \ h->keys[x] = key; \ __ac_set_isboth_false (h->flags, x); \ ++h->size; \ ++h->n_occupied; \ *ret = 1; \ } else if (__ac_isdel (h->flags, x)) { /* deleted */ \ h->keys[x] = key; \ __ac_set_isboth_false (h->flags, x); \ ++h->size; \ *ret = 2; \ } else \ *ret = 0; /* Don't touch h->keys[x] if present and not deleted */ \ return x; \ } \ SCOPE void kh_del_##name(kh_##name##_t *h, khint_t x) \ { \ if (x != h->n_buckets && !__ac_iseither (h->flags, x)) { \ __ac_set_isdel_true (h->flags, x); \ --h->size; \ } \ } \ #define KHASH_DECLARE(name, khkey_t, khval_t) \ __KHASH_TYPE(name, khkey_t, khval_t) \ __KHASH_PROTOTYPES(name, khkey_t, khval_t) #define KHASH_INIT2(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ __KHASH_TYPE(name, khkey_t, khval_t) \ __KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) #define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ KHASH_INIT2(name, static kh_inline klib_unused, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \ /* --- BEGIN OF HASH FUNCTIONS --- */ /*! @function @abstract Integer hash function @param key The integer [khint32_t] @return The hash value [khint_t] */ #define kh_int_hash_func(key) (khint32_t)(key) /*! @function @abstract Integer comparison function */ #define kh_int_hash_equal(a, b) ((a) == (b)) /*! @function @abstract 64-bit integer hash function @param key The integer [khint64_t] @return The hash value [khint_t] */ #define kh_int64_hash_func(key) (khint32_t)((key)>>33^(key)^(key)<<11) /*! @function @abstract 64-bit integer comparison function */ #define kh_int64_hash_equal(a, b) ((a) == (b)) /*! @function @abstract const char* hash function @param s Pointer to a null terminated string @return The hash value */ static kh_inline khint_t __ac_X31_hash_string (const char *s) { khint_t h = (khint_t) * s; if (h) for (++s; *s; ++s) h = (h << 5) - h + (khint_t) * s; return h; } /*! @function @abstract Another interface to const char* hash function @param key Pointer to a null terminated string [const char*] @return The hash value [khint_t] */ #define kh_str_hash_func(key) __ac_X31_hash_string(key) /*! @function @abstract Const char* comparison function */ #define kh_str_hash_equal(a, b) (strcmp(a, b) == 0) static kh_inline khint_t __ac_Wang_hash (khint_t key) { key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16); return key; } #define kh_int_hash_func2(k) __ac_Wang_hash((khint_t)key) /* --- END OF HASH FUNCTIONS --- */ /* Other convenient macros... */ /*! @abstract Type of the hash table. @param name Name of the hash table [symbol] */ #define khash_t(name) kh_##name##_t /*! @function @abstract Initiate a hash table. @param name Name of the hash table [symbol] @return Pointer to the hash table [khash_t(name)*] */ #define kh_init(name) kh_init_##name() /*! @function @abstract Destroy a hash table. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] */ #define kh_destroy(name, h) kh_destroy_##name(h) /*! @function @abstract Reset a hash table without deallocating memory. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] */ #define kh_clear(name, h) kh_clear_##name(h) /*! @function @abstract Resize a hash table. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param s New size [khint_t] */ #define kh_resize(name, h, s) kh_resize_##name(h, s) /*! @function @abstract Insert a key to the hash table. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param k Key [type of keys] @param r Extra return code: -1 if the operation failed; 0 if the key is present in the hash table; 1 if the bucket is empty (never used); 2 if the element in the bucket has been deleted [int*] @return Iterator to the inserted element [khint_t] */ #define kh_put(name, h, k, r) kh_put_##name(h, k, r) /*! @function @abstract Retrieve a key from the hash table. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param k Key [type of keys] @return Iterator to the found element, or kh_end(h) if the element is absent [khint_t] */ #define kh_get(name, h, k) kh_get_##name(h, k) /*! @function @abstract Remove a key from the hash table. @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param k Iterator to the element to be deleted [khint_t] */ #define kh_del(name, h, k) kh_del_##name(h, k) /*! @function @abstract Test whether a bucket contains data. @param h Pointer to the hash table [khash_t(name)*] @param x Iterator to the bucket [khint_t] @return 1 if containing data; 0 otherwise [int] */ #define kh_exist(h, x) (!__ac_iseither((h)->flags, (x))) /*! @function @abstract Get key given an iterator @param h Pointer to the hash table [khash_t(name)*] @param x Iterator to the bucket [khint_t] @return Key [type of keys] */ #define kh_key(h, x) ((h)->keys[x]) /*! @function @abstract Get value given an iterator @param h Pointer to the hash table [khash_t(name)*] @param x Iterator to the bucket [khint_t] @return Value [type of values] @discussion For hash sets, calling this results in segfault. */ #define kh_val(h, x) ((h)->vals[x]) /*! @function @abstract Alias of kh_val() */ #define kh_value(h, x) ((h)->vals[x]) /*! @function @abstract Get the start iterator @param h Pointer to the hash table [khash_t(name)*] @return The start iterator [khint_t] */ #define kh_begin(h) (khint_t)(0) /*! @function @abstract Get the end iterator @param h Pointer to the hash table [khash_t(name)*] @return The end iterator [khint_t] */ #define kh_end(h) ((h)->n_buckets) /*! @function @abstract Get the number of elements in the hash table @param h Pointer to the hash table [khash_t(name)*] @return Number of elements in the hash table [khint_t] */ #define kh_size(h) ((h)->size) /*! @function @abstract Get the number of buckets in the hash table @param h Pointer to the hash table [khash_t(name)*] @return Number of buckets in the hash table [khint_t] */ #define kh_n_buckets(h) ((h)->n_buckets) /*! @function @abstract Iterate over the entries in the hash table @param h Pointer to the hash table [khash_t(name)*] @param kvar Variable to which key will be assigned @param vvar Variable to which value will be assigned @param code Block of code to execute */ #define kh_foreach(h, kvar, vvar, code) { khint_t __i; \ for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \ if (!kh_exist(h,__i)) continue; \ (kvar) = kh_key(h,__i); \ (vvar) = kh_val(h,__i); \ code; \ } } /*! @function @abstract Iterate over the values in the hash table @param h Pointer to the hash table [khash_t(name)*] @param vvar Variable to which value will be assigned @param code Block of code to execute */ #define kh_foreach_value(h, vvar, code) { khint_t __i; \ for (__i = kh_begin (h); __i != kh_end (h); ++__i) { \ if (!kh_exist (h, __i)) \ continue; \ (vvar) = kh_val (h, __i); \ code; \ } } /* More conenient interfaces */ /*! @function @abstract Instantiate a hash set containing integer keys @param name Name of the hash table [symbol] */ #define KHASH_SET_INIT_INT(name) \ KHASH_INIT(name, khint32_t, char, 0, kh_int_hash_func, kh_int_hash_equal) /*! @function @abstract Instantiate a hash map containing integer keys @param name Name of the hash table [symbol] @param khval_t Type of values [type] */ #define KHASH_MAP_INIT_INT(name, khval_t) \ KHASH_INIT(name, khint32_t, khval_t, 1, kh_int_hash_func, kh_int_hash_equal) /*! @function @abstract Instantiate a hash map containing 64-bit integer keys @param name Name of the hash table [symbol] */ #define KHASH_SET_INIT_INT64(name) \ KHASH_INIT(name, khint64_t, char, 0, kh_int64_hash_func, kh_int64_hash_equal) /*! @function @abstract Instantiate a hash map containing 64-bit integer keys @param name Name of the hash table [symbol] @param khval_t Type of values [type] */ #define KHASH_MAP_INIT_INT64(name, khval_t) \ KHASH_INIT(name, khint64_t, khval_t, 1, kh_int64_hash_func, kh_int64_hash_equal) typedef const char *kh_cstr_t; /*! @function @abstract Instantiate a hash map containing const char* keys @param name Name of the hash table [symbol] */ #define KHASH_SET_INIT_STR(name) \ KHASH_INIT(name, kh_cstr_t, char, 0, kh_str_hash_func, kh_str_hash_equal) /*! @function @abstract Instantiate a hash map containing const char* keys @param name Name of the hash table [symbol] @param khval_t Type of values [type] */ #define KHASH_MAP_INIT_STR(name, khval_t) \ KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) #endif /* __AC_KHASH_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/base64.h���������������������������������������������������������������������������0000644�0000000�0000000�00000003074�13375657450�012102� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef BASE64_H_INCLUDED #define BASE64_H_INCLUDED #include char *base64_encode (const void *buf, size_t size); #endif // for #ifndef BASE64_H ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/settings.c�������������������������������������������������������������������������0000644�0000000�0000000�00000047327�13375657450�012662� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * settings.c -- goaccess configuration * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #include #include #include #include #include #include #include "settings.h" #include "error.h" #include "labels.h" #include "util.h" #include "xmalloc.h" static char **nargv; static int nargc = 0; /* *INDENT-OFF* */ static GEnum LOGTYPE[] = { {"COMBINED" , COMBINED} , {"VCOMBINED" , VCOMBINED} , {"COMMON" , COMMON} , {"VCOMMON" , VCOMMON} , {"W3C" , W3C} , {"SQUID" , SQUID} , {"CLOUDFRONT" , CLOUDFRONT} , {"CLOUDSTORAGE" , CLOUDSTORAGE} , {"AWSELB" , AWSELB} , {"AWSS3" , AWSS3} , }; static const GPreConfLog logs = { "%h %^[%d:%t %^] \"%r\" %s %b \"%R\" \"%u\"", /* NCSA */ "%v:%^ %h %^[%d:%t %^] \"%r\" %s %b \"%R\" \"%u\"", /* NCSA + VHost */ "%h %^[%d:%t %^] \"%r\" %s %b", /* CLF */ "%v:%^ %h %^[%d:%t %^] \"%r\" %s %b", /* CLF+VHost */ "%d %t %^ %m %U %q %^ %^ %h %u %R %s %^ %^ %L", /* W3C */ "%d\\t%t\\t%^\\t%b\\t%h\\t%m\\t%^\\t%r\\t%s\\t%R\\t%u\\t%^", /* CloudFront */ "\"%x\",\"%h\",%^,%^,\"%m\",\"%U\",\"%s\",%^,\"%b\",\"%D\",%^,\"%R\",\"%u\"", /* Cloud Storage */ "%dT%t.%^ %^ %h:%^ %^ %T %^ %^ %^ %s %^ %b \"%r\" \"%u\"", /* AWS Elastic Load Balancing */ "%^ %^ %^ %v %^: %x.%^ %~%L %h %^/%s %b %m %U", /* Squid Native */ "%^ %v [%d:%t %^] %h %^\"%r\" %s %^ %b %^ %L %^ \"%R\" \"%u\"", /* Amazon S3 */ }; static const GPreConfTime times = { "%H:%M:%S", "%f", /* Cloud Storage (usec) */ "%s", /* Squid (sec) */ }; static const GPreConfDate dates = { "%d/%b/%Y", /* Apache */ "%Y-%m-%d", /* W3C */ "%f", /* Cloud Storage (usec) */ "%s", /* Squid (sec) */ }; /* *INDENT-ON* */ /* Ignore the following options */ static const char *ignore_cmd_opts[] = { "help", "storage", "version", }; /* Determine if the given command line option needs to be ignored. * * If needs to be ignored, 1 is returned. * If not within the list of ignored command line options, 0 is returned. */ static int in_ignore_cmd_opts (const char *val) { size_t i; for (i = 0; i < ARRAY_SIZE (ignore_cmd_opts); i++) { if (strstr (val, ignore_cmd_opts[i]) != NULL) return 1; } return 0; } /* Get the location of the configuration file. * * By default, it attempts to read it from the user supplied path, else it will * try to open the global config file path (sysconfdir) or from the HOME * environment variable (~/.goaccessrc). * * On success, the path to the configuration file is returned. */ char * get_config_file_path (void) { char *upath = NULL, *rpath = NULL; /* determine which config file to open, default or custom */ if (conf.iconfigfile != NULL) { rpath = realpath (conf.iconfigfile, NULL); if (rpath == NULL) FATAL ("Unable to open the specified config file. %s", strerror (errno)); return rpath; } /* attempt to use the user's config file */ upath = get_home (); rpath = realpath (upath, NULL); if (upath) { free (upath); } /* otherwise, fallback to global config file */ if (rpath == NULL && conf.load_global_config) { upath = get_global_config (); rpath = realpath (upath, NULL); if (upath) { free (upath); } } return rpath; } /* Use predefined static files when no config file is used. Note that * the order in which are listed is from the most to the least common * (most cases). */ void set_default_static_files (void) { size_t i; const char *exts[] = { ".css", ".js ", ".jpg", ".png", ".gif", ".ico", ".jpeg", ".pdf", ".txt", ".csv", ".mpeg", ".mpg", ".swf", ".woff", ".woff2", ".xls", ".xlsx", ".doc ", ".docx", ".ppt ", ".pptx", ".zip", ".mp3", ".mp4", ".exe", ".iso ", ".gz ", ".rar ", ".svg ", ".bmp ", ".tar ", ".tgz ", ".tiff", ".tif ", ".ttf ", ".flv ", }; if (conf.static_file_idx > 0) return; for (i = 0; i < ARRAY_SIZE (exts); i++) { if (conf.static_file_max_len < strlen (exts[i])) conf.static_file_max_len = strlen (exts[i]); conf.static_files[conf.static_file_idx++] = exts[i]; } } /* Clean malloc'd log/date/time escaped formats. */ void free_formats (void) { free (conf.log_format); free (conf.date_format); free (conf.date_num_format); free (conf.spec_date_time_format); free (conf.spec_date_time_num_format); free (conf.time_format); } /* Clean malloc'd command line arguments. */ void free_cmd_args (void) { int i; if (nargc == 0) return; for (i = 0; i < nargc; i++) free (nargv[i]); free (nargv); free (conf.iconfigfile); } /* Append extra value to argv */ static void append_to_argv (int *argc, char ***argv, char *val) { char **_argv = xrealloc (*argv, (*argc + 2) * sizeof (*_argv)); _argv[*argc] = val; _argv[*argc + 1] = (char *) '\0'; (*argc)++; *argv = _argv; } /* Parses the configuration file to feed getopt_long. * * On error, ENOENT error code is returned. * On success, 0 is returned and config file enabled options are appended to * argv. */ int parse_conf_file (int *argc, char ***argv) { char line[MAX_LINE_CONF + 1]; char *path = NULL, *val, *opt, *p; FILE *file; int i, n = 0; size_t idx; /* assumes program name is on argv[0], though, it is not guaranteed */ append_to_argv (&nargc, &nargv, xstrdup ((char *) *argv[0])); /* determine which config file to open, default or custom */ path = get_config_file_path (); if (path == NULL) return ENOENT; /* could not open conf file, if so prompt conf dialog */ if ((file = fopen (path, "r")) == NULL) { free (path); return ENOENT; } while (fgets (line, sizeof line, file) != NULL) { while (line[0] == ' ' || line[0] == '\t') memmove (line, line + 1, strlen (line)); n++; if (line[0] == '\n' || line[0] == '\r' || line[0] == '#') continue; /* key */ idx = strcspn (line, " \t"); if (strlen (line) == idx) FATAL ("Malformed config key at line: %d", n); line[idx] = '\0'; /* make old config options backwards compatible by * substituting underscores with dashes */ while ((p = strpbrk (line, "_")) != NULL) *p = '-'; /* Ignore the following options when reading the config file */ if (in_ignore_cmd_opts (line)) continue; /* value */ val = line + (idx + 1); idx = strspn (val, " \t"); if (strlen (line) == idx) FATAL ("Malformed config value at line: %d", n); val = val + idx; val = trim_str (val); if (strcmp ("false", val) == 0) continue; /* set it as command line options */ opt = xmalloc (snprintf (NULL, 0, "--%s", line) + 1); sprintf (opt, "--%s", line); append_to_argv (&nargc, &nargv, opt); if (strcmp ("true", val) != 0) append_to_argv (&nargc, &nargv, xstrdup (val)); } /* give priority to command line arguments */ for (i = 1; i < *argc; i++) append_to_argv (&nargc, &nargv, xstrdup ((char *) (*argv)[i])); *argc = nargc; *argv = (char **) nargv; fclose (file); if (conf.iconfigfile == NULL) conf.iconfigfile = xstrdup (path); free (path); return 0; } /* Get the enumerated log format given its equivalent format string. * * On error, -1 is returned. * On success, the enumerated format is returned. */ static int get_log_format_item_enum (const char *str) { return str2enum (LOGTYPE, ARRAY_SIZE (LOGTYPE), str); } /* Determine the selected log format from the config file or command line * option. * * On error, -1 is returned. * On success, the index of the matched item is returned. */ size_t get_selected_format_idx (void) { if (conf.log_format == NULL) return -1; if (strcmp (conf.log_format, logs.common) == 0) return COMMON; else if (strcmp (conf.log_format, logs.vcommon) == 0) return VCOMMON; else if (strcmp (conf.log_format, logs.combined) == 0) return COMBINED; else if (strcmp (conf.log_format, logs.vcombined) == 0) return VCOMBINED; else if (strcmp (conf.log_format, logs.w3c) == 0) return W3C; else if (strcmp (conf.log_format, logs.cloudfront) == 0) return CLOUDFRONT; else if (strcmp (conf.log_format, logs.cloudstorage) == 0) return CLOUDSTORAGE; else if (strcmp (conf.log_format, logs.awselb) == 0) return AWSELB; else if (strcmp (conf.log_format, logs.squid) == 0) return SQUID; else if (strcmp (conf.log_format, logs.awss3) == 0) return AWSS3; else return -1; } /* Determine the selected log format from the config file or command line * option. * * On error, NULL is returned. * On success, an allocated string containing the log format is returned. */ char * get_selected_format_str (size_t idx) { char *fmt = NULL; switch (idx) { case COMMON: fmt = alloc_string (logs.common); break; case VCOMMON: fmt = alloc_string (logs.vcommon); break; case COMBINED: fmt = alloc_string (logs.combined); break; case VCOMBINED: fmt = alloc_string (logs.vcombined); break; case W3C: fmt = alloc_string (logs.w3c); break; case CLOUDFRONT: fmt = alloc_string (logs.cloudfront); break; case CLOUDSTORAGE: fmt = alloc_string (logs.cloudstorage); break; case AWSELB: fmt = alloc_string (logs.awselb); break; case SQUID: fmt = alloc_string (logs.squid); break; case AWSS3: fmt = alloc_string (logs.awss3); break; } return fmt; } /* Determine the selected date format from the config file or command line * option. * * On error, NULL is returned. * On success, an allocated string containing the date format is returned. */ char * get_selected_date_str (size_t idx) { char *fmt = NULL; switch (idx) { case COMMON: case VCOMMON: case COMBINED: case VCOMBINED: case AWSS3: fmt = alloc_string (dates.apache); break; case AWSELB: case CLOUDFRONT: case W3C: fmt = alloc_string (dates.w3c); break; case CLOUDSTORAGE: fmt = alloc_string (dates.usec); break; case SQUID: fmt = alloc_string (dates.sec); break; } return fmt; } /* Determine the selected time format from the config file or command line * option. * * On error, NULL is returned. * On success, an allocated string containing the time format is returned. */ char * get_selected_time_str (size_t idx) { char *fmt = NULL; switch (idx) { case AWSELB: case CLOUDFRONT: case COMBINED: case COMMON: case VCOMBINED: case VCOMMON: case W3C: case AWSS3: fmt = alloc_string (times.fmt24); break; case CLOUDSTORAGE: fmt = alloc_string (times.usec); break; case SQUID: fmt = alloc_string (times.sec); break; } return fmt; } /* Determine if the log/date/time were set, otherwise exit the program * execution. */ const char * verify_formats (void) { if (conf.time_format == NULL || *conf.time_format == '\0') return ERR_FORMAT_NO_TIME_FMT; if (conf.date_format == NULL || *conf.date_format == '\0') return ERR_FORMAT_NO_DATE_FMT; if (conf.log_format == NULL || *conf.log_format == '\0') return ERR_FORMAT_NO_LOG_FMT; return NULL; } /* A wrapper function to concat the given specificity to the date * format. */ static char * append_spec_date_format (const char *date_format, const char *spec_format) { char *s = xmalloc (snprintf (NULL, 0, "%s%s", date_format, spec_format) + 1); sprintf (s, "%s%s", date_format, spec_format); return s; } /* Iterate over the given format and clean unwanted chars and keep all * date/time specifiers such as %b%Y%d%M%S. * * On error NULL is returned. * On success, a clean format containing only date/time specifiers is * returned. */ static char * clean_date_time_format (const char *format) { char *fmt = NULL, *pr = NULL, *pw = NULL; int special = 0; if (format == NULL || *format == '\0') return NULL; fmt = xstrdup (format); pr = fmt; pw = fmt; while (*pr) { *pw = *pr++; if (*pw == '%' || special) { special = !special; pw++; } } *pw = '\0'; return fmt; } /* Determine if the given specifier character is an abbreviated type * of date. * * If it is, 1 is returned, otherwise, 0 is returned. */ static int is_date_abbreviated (const char *fdate) { if (strpbrk (fdate, "cDF")) return 1; return 0; } /* A wrapper to extract time specifiers from a time format. * * On error NULL is returned. * On success, a clean format containing only time specifiers is * returned. */ static char * set_format_time (void) { char *ftime = NULL; if (has_timestamp (conf.date_format) || !strcmp ("%T", conf.time_format)) ftime = xstrdup ("%H%M%S"); else ftime = clean_date_time_format (conf.time_format); return ftime; } /* A wrapper to extract date specifiers from a date format. * * On error NULL is returned. * On success, a clean format containing only date specifiers is * returned. */ static char * set_format_date (void) { char *fdate = NULL; if (has_timestamp (conf.date_format)) fdate = xstrdup ("%Y%m%d"); else fdate = clean_date_time_format (conf.date_format); return fdate; } /* Once we have a numeric date format, we attempt to read the time * format and construct a date_time numeric specificity format (if any * specificity is given). The result may look like Ymd[HM]. * * On success, the numeric date time specificity format is set. */ static void set_spec_date_time_num_format (void) { char *buf = NULL, *tf = set_format_time (); const char *df = conf.date_num_format; if (!df || !tf) return; if (conf.date_spec_hr && strchr (tf, 'H')) buf = append_spec_date_format (df, "%H"); else buf = xstrdup (df); conf.spec_date_time_num_format = buf; free (tf); } /* Set a human readable specificity date and time format. * * On success, the human readable date time specificity format is set. */ static void set_spec_date_time_format (void) { char *buf = NULL; const char *fmt = conf.spec_date_time_num_format; int buflen = 0, flen = 0; if (!fmt) return; flen = (strlen (fmt) * 2) + 1; buf = xcalloc (flen, sizeof (char)); if (strchr (fmt, 'd')) buflen += snprintf (buf + buflen, flen - buflen, "%%d/"); if (strchr (fmt, 'm')) buflen += snprintf (buf + buflen, flen - buflen, "%%b/"); if (strchr (fmt, 'Y')) buflen += snprintf (buf + buflen, flen - buflen, "%%Y"); if (strchr (fmt, 'H')) buflen += snprintf (buf + buflen, flen - buflen, ":%%H"); conf.spec_date_time_format = buf; } /* Normalize the date format from the date format given by the user to * Ymd so it can be sorted out properly afterwards. * * On error or unable to determine the format, 1 is returned. * On success, the numeric date format as Ymd is set and 0 is * returned. */ static int set_date_num_format (void) { char *fdate = NULL, *buf = NULL; int buflen = 0, flen = 0; fdate = set_format_date (); if (!fdate) return 1; if (is_date_abbreviated (fdate)) { free (fdate); conf.date_num_format = xstrdup ("%Y%m%d"); return 0; } flen = strlen (fdate) + 1; buf = xcalloc (flen, sizeof (char)); if (strpbrk (fdate, "Yy")) buflen += snprintf (buf + buflen, flen - buflen, "%%Y"); if (strpbrk (fdate, "hbmB")) buflen += snprintf (buf + buflen, flen - buflen, "%%m"); if (strpbrk (fdate, "de")) buflen += snprintf (buf + buflen, flen - buflen, "%%d"); conf.date_num_format = buf; free (fdate); return buflen == 0 ? 1 : 0; } /* If specificity is supplied, then determine which value we need to * append to the date format. */ void set_spec_date_format (void) { if (verify_formats ()) return; if (conf.date_num_format) free (conf.date_num_format); if (conf.spec_date_time_format) free (conf.spec_date_time_format); if (conf.spec_date_time_num_format) free (conf.spec_date_time_num_format); if (set_date_num_format () == 0) { set_spec_date_time_num_format (); set_spec_date_time_format (); } } /* Attempt to set the date format given a command line option * argument. The supplied optarg can be either an actual format string * or the enumerated value such as VCOMBINED */ void set_date_format_str (const char *oarg) { char *fmt = NULL; int type = get_log_format_item_enum (oarg); /* free date format if it was previously set by set_log_format_str() */ if (conf.date_format) free (conf.date_format); /* type not found, use whatever was given by the user then */ if (type == -1) { conf.date_format = unescape_str (oarg); return; } /* attempt to get the format string by the enum value */ if ((fmt = get_selected_date_str (type)) == NULL) { LOG_DEBUG (("Unable to set date format from enum: %s\n", oarg)); return; } conf.date_format = fmt; } /* Attempt to set the time format given a command line option * argument. The supplied optarg can be either an actual format string * or the enumerated value such as VCOMBINED */ void set_time_format_str (const char *oarg) { char *fmt = NULL; int type = get_log_format_item_enum (oarg); /* free time format if it was previously set by set_log_format_str() */ if (conf.time_format) free (conf.time_format); /* type not found, use whatever was given by the user then */ if (type == -1) { conf.time_format = unescape_str (oarg); return; } /* attempt to get the format string by the enum value */ if ((fmt = get_selected_time_str (type)) == NULL) { LOG_DEBUG (("Unable to set time format from enum: %s\n", oarg)); return; } conf.time_format = fmt; } /* Attempt to set the log format given a command line option argument. * The supplied optarg can be either an actual format string or the * enumerated value such as VCOMBINED */ void set_log_format_str (const char *oarg) { char *fmt = NULL; int type = get_log_format_item_enum (oarg); /* free log format if it was previously set */ if (conf.log_format) free (conf.log_format); /* type not found, use whatever was given by the user then */ if (type == -1) { conf.log_format = unescape_str (oarg); return; } /* attempt to get the format string by the enum value */ if ((fmt = get_selected_format_str (type)) == NULL) { LOG_DEBUG (("Unable to set log format from enum: %s\n", oarg)); return; } conf.log_format = unescape_str (fmt); /* assume we are using the default date/time formats */ set_time_format_str (oarg); set_date_format_str (oarg); free (fmt); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/labels.h���������������������������������������������������������������������������0000644�0000000�0000000�00000045345�13375661415�012263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef LABELS_H_INCLUDED #define LABELS_H_INCLUDED #include #define _(String) dgettext (PACKAGE , String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) /* global lang attribute */ #define DOC_LANG _( "en") /* General */ #define GEN_EXPAND_PANEL _( "Exp. Panel") #define GEN_HELP _( "Help") #define GEN_QUIT _( "Quit") #define GEN_TOTAL _( "Total") /* Sort Labels */ #define SORT_ASC_SEL _( "[x] ASC [ ] DESC") #define SORT_DESC_SEL _( "[ ] ASC [x] DESC") /* Overall Stats Labels */ #define T_ACTIVE_PANEL _("[Active Panel: %1$s]") #define T_QUIT _("[q]uit GoAccess") #define T_HELP_ENTER _("[?] Help [Enter] Exp. Panel") #define T_DASH _( "Dashboard") #define T_DASH_HEAD _( "Dashboard - Overall Analyzed Requests") #define T_HEAD N_( "Overall Analyzed Requests") #define T_BW _( "Tx. Amount") #define T_DATETIME _( "Date/Time") #define T_EXCLUDE_IP _( "Excl. IP Hits") #define T_FAILED _( "Failed Requests") #define T_GEN_TIME _( "Init. Proc. Time") #define T_LOG _( "Log Size") #define T_LOG_PATH _( "Log Source") #define T_REFERRER _( "Referrers") #define T_REQUESTS _( "Total Requests") #define T_STATIC_FILES _( "Static Files") #define T_UNIQUE404 _( "Not Found") #define T_UNIQUE_FILES _( "Requested Files") #define T_UNIQUE_VISITORS _( "Unique Visitors") #define T_VALID _( "Valid Requests") /* Metric Labels */ #define MTRC_HITS_LBL _( "Hits") #define MTRC_HITS_PERC_LBL _( "h%") #define MTRC_VISITORS_LBL _( "Visitors") #define MTRC_VISITORS_SHORT_LBL _( "Vis.") #define MTRC_VISITORS_PERC_LBL _( "v%") #define MTRC_BW_LBL _( "Tx. Amount") #define MTRC_AVGTS_LBL _( "Avg. T.S.") #define MTRC_CUMTS_LBL _( "Cum. T.S.") #define MTRC_MAXTS_LBL _( "Max. T.S.") #define MTRC_METHODS_LBL _( "Method") #define MTRC_METHODS_SHORT_LBL _( "Mtd") #define MTRC_PROTOCOLS_LBL _( "Protocol") #define MTRC_PROTOCOLS_SHORT_LBL _( "Proto") #define MTRC_CITY_LBL _( "City") #define MTRC_COUNTRY_LBL _( "Country") #define MTRC_HOSTNAME_LBL _( "Hostname") #define MTRC_DATA_LBL _( "Data") #define HTML_PLOT_HITS_VIS _( "Hits/Visitors") /* Panel Labels and Descriptions */ #define VISITORS_HEAD \ N_("Unique visitors per day") #define VISITORS_HEAD_BOTS \ N_("Unique visitors per day - Including spiders") #define VISITORS_DESC \ N_("Hits having the same IP, date and agent are a unique visit.") #define VISITORS_LABEL \ N_("Visitors") #define REQUESTS_HEAD \ N_("Requested Files (URLs)") #define REQUESTS_DESC \ N_("Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]") #define REQUESTS_LABEL \ N_("Requests") #define REQUESTS_STATIC_HEAD \ N_("Static Requests") #define REQUESTS_STATIC_DESC \ N_("Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]") #define REQUESTS_STATIC_LABEL \ N_("Static Requests") #define VISIT_TIMES_HEAD \ N_("Time Distribution") #define VISIT_TIMES_DESC \ N_("Data sorted by hour [, avgts, cumts, maxts]") #define VISIT_TIMES_LABEL \ N_("Time") #define VIRTUAL_HOSTS_HEAD \ N_("Virtual Hosts") #define VIRTUAL_HOSTS_DESC \ N_("Data sorted by hits [, avgts, cumts, maxts]") #define VIRTUAL_HOSTS_LABEL \ N_("Virtual Hosts") #define REMOTE_USER_HEAD \ N_("Remote User (HTTP authentication)") #define REMOTE_USER_DESC \ N_("Data sorted by hits [, avgts, cumts, maxts]") #define REMOTE_USER_LABEL \ N_("Remote User") #define NOT_FOUND_HEAD \ N_("Not Found URLs (404s)") #define NOT_FOUND_DESC \ N_("Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]") #define NOT_FOUND_LABEL \ N_("Not Found") #define HOSTS_HEAD \ N_("Visitor Hostnames and IPs") #define HOSTS_DESC \ N_("Top visitor hosts sorted by hits [, avgts, cumts, maxts]") #define HOSTS_LABEL \ N_("Hosts") #define OS_HEAD \ N_("Operating Systems") #define OS_DESC \ N_("Top Operating Systems sorted by hits [, avgts, cumts, maxts]") #define OS_LABEL \ N_("OS") #define BROWSERS_HEAD \ N_("Browsers") #define BROWSERS_DESC \ N_("Top Browsers sorted by hits [, avgts, cumts, maxts]") #define BROWSERS_LABEL \ N_("Browsers") #define REFERRERS_HEAD \ N_("Referrers URLs") #define REFERRERS_DESC \ N_("Top Requested Referrers sorted by hits [, avgts, cumts, maxts]") #define REFERRERS_LABEL \ N_("Referrers") #define REFERRING_SITES_HEAD \ N_("Referring Sites") #define REFERRING_SITES_DESC \ N_("Top Referring Sites sorted by hits [, avgts, cumts, maxts]") #define REFERRING_SITES_LABEL \ N_("Referring Sites") #define KEYPHRASES_HEAD \ N_("Keyphrases from Google's search engine") #define KEYPHRASES_DESC \ N_("Top Keyphrases sorted by hits [, avgts, cumts, maxts]") #define KEYPHRASES_LABEL \ N_("Keyphrases") #define GEO_LOCATION_HEAD \ N_("Geo Location") #define GEO_LOCATION_DESC \ N_("Continent > Country sorted by unique hits [, avgts, cumts, maxts]") #define GEO_LOCATION_LABEL \ N_("Geo Location") #define STATUS_CODES_HEAD \ N_("HTTP Status Codes") #define STATUS_CODES_DESC \ N_("Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]") #define STATUS_CODES_LABEL \ N_("Status Codes") /* Find Labels */ #define CISENSITIVE \ _("[ ] case sensitive") #define CSENSITIVE \ _("[x] case sensitive") #define FIND_DESC \ _("Regex allowed - ^g to cancel - TAB switch case") #define FIND_HEAD \ _("Find pattern in all views") /* Config Dialog */ #define CONFDLG_HEAD \ _("Log Format Configuration") #define CONFDLG_KEY_HINTS \ _("[SPACE] to toggle - [ENTER] to proceed - [q] to quit") #define CONFDLG_LOG_FORMAT \ _("Log Format - [c] to add/edit format") #define CONFDLG_DATE_FORMAT \ _("Date Format - [d] to add/edit format") #define CONFDLG_TIME_FORMAT \ _("Time Format - [t] to add/edit format") #define CONFDLG_DESC \ _("[UP/DOWN] to scroll - [q] to close window") /* Agents Dialog */ #define AGENTSDLG_DESC \ _("[UP/DOWN] to scroll - [q] to close window") #define AGENTSDLG_HEAD \ _("User Agents for %1$s") /* Color Scheme Dialog */ #define SCHEMEDLG_HEAD \ _("Scheme Configuration") #define SCHEMEDLG_DESC \ _("[ENTER] to use scheme - [q]uit") /* Sort Dialog */ #define SORTDLG_HEAD \ _("Sort active module by") #define SORTDLG_DESC \ _("[ENTER] select - [TAB] sort - [q]uit") /* Help TUI Dialog */ #define HELPDLG_HEAD \ _("GoAccess Quick Help") #define HELPDLG_DESC \ _("[UP/DOWN] to scroll - [q] to quit") /* Storage Built-in Option */ #define BUILT_WITH_TCBTREE \ _("Built using Tokyo Cabinet on-disk B+ Tree.") #define BUILT_WITH_TCMEMHASH \ _("Built using Tokyo Cabinet in-memory hash database.") #define BUILT_WITH_DEFHASH \ _("Built using the default in-memory hash database.") /* Common UI Errors */ #define ERR_FORMAT_HEADER \ _("Format Errors - Verify your log/date/time format") #define ERR_FORMAT_NO_DATE_FMT \ _("No date format was found on your conf file.") #define ERR_FORMAT_NO_LOG_FMT \ _("No log format was found on your conf file.") #define ERR_FORMAT_NO_TIME_FMT \ _("No time format was found on your conf file.") #define ERR_NODEF_CONF_FILE \ _("No default config file found.") #define ERR_NODEF_CONF_FILE_DESC \ _("You may specify one with") #define ERR_PARSED_NLINES_DESC \ _("producing the following errors") #define ERR_PARSED_NLINES \ _("Parsed %1$d lines") #define ERR_PLEASE_REPORT \ _("Please report it by opening an issue on GitHub") #define ERR_FORMAT_NO_TIME_FMT_DLG \ _("Select a time format.") #define ERR_FORMAT_NO_DATE_FMT_DLG \ _("Select a date format.") #define ERR_FORMAT_NO_LOG_FMT_DLG \ _("Select a log format.") #define ERR_PANEL_DISABLED \ _("'%1$s' panel is disabled") /* Other */ #define INFO_MORE_INFO \ _("For more details visit") #define INFO_LAST_UPDATED \ _("Last Updated") #define INFO_WS_READY_FOR_CONN \ _("WebSocket server ready to accept new client connections") #define INFO_HELP_FOLLOWING_OPTS \ _("The following options can also be supplied to the command") #define INFO_HELP_EXAMPLES \ _("Examples can be found by running") #define HTML_REPORT_TITLE \ _( "Server Statistics") #define HTML_REPORT_NAV_THEME \ N_("Theme") #define HTML_REPORT_NAV_DARK_GRAY \ N_("Dark Gray") #define HTML_REPORT_NAV_BRIGHT \ N_("Bright") #define HTML_REPORT_NAV_DARK_BLUE \ N_("Dark Blue") #define HTML_REPORT_NAV_DARK_PURPLE \ N_("Dark Purple") #define HTML_REPORT_NAV_PANELS \ N_("Panels") #define HTML_REPORT_NAV_ITEMS_PER_PAGE \ N_("Items per Page") #define HTML_REPORT_NAV_TABLES \ N_("Tables") #define HTML_REPORT_NAV_DISPLAY_TABLES \ N_("Display Tables") #define HTML_REPORT_NAV_AH_SMALL \ N_("Auto-Hide on Small Devices") #define HTML_REPORT_NAV_AH_SMALL_TITLE \ N_("Automatically hide tables on small screen devices") #define HTML_REPORT_NAV_LAYOUT \ N_("Layout") #define HTML_REPORT_NAV_HOR \ N_("Horizontal") #define HTML_REPORT_NAV_VER \ N_("Vertical") #define HTML_REPORT_NAV_FILE_OPTS \ N_("File Options") #define HTML_REPORT_NAV_EXPORT_JSON \ N_("Export as JSON") #define HTML_REPORT_PANEL_PANEL_OPTS \ N_("Panel Options") #define HTML_REPORT_PANEL_PREVIOUS \ N_("Previous") #define HTML_REPORT_PANEL_NEXT \ N_("Next") #define HTML_REPORT_PANEL_FIRST \ N_("First") #define HTML_REPORT_PANEL_LAST \ N_("Last") #define HTML_REPORT_PANEL_CHART_OPTS \ N_("Chart Options") #define HTML_REPORT_PANEL_CHART \ N_("Chart") #define HTML_REPORT_PANEL_TYPE \ N_("Type") #define HTML_REPORT_PANEL_AREA_SPLINE \ N_("Area Spline") #define HTML_REPORT_PANEL_BAR \ N_("Bar") #define HTML_REPORT_PANEL_PLOT_METRIC \ N_("Plot Metric") #define HTML_REPORT_PANEL_TABLE_COLS \ N_("Table Columns") /* Status Codes */ #define STATUS_CODE_1XX \ N_("1xx Informational") #define STATUS_CODE_2XX \ N_("2xx Success") #define STATUS_CODE_3XX \ N_("3xx Redirection") #define STATUS_CODE_4XX \ N_("4xx Client Errors") #define STATUS_CODE_5XX \ N_("5xx Server Errors") #define STATUS_CODE_100 \ N_("100 - Continue: Server received the initial part of the request") #define STATUS_CODE_101 \ N_("101 - Switching Protocols: Client asked to switch protocols") #define STATUS_CODE_200 \ N_("200 - OK: The request sent by the client was successful") #define STATUS_CODE_201 \ N_("201 - Created: The request has been fulfilled and created") #define STATUS_CODE_202 \ N_("202 - Accepted: The request has been accepted for processing") #define STATUS_CODE_203 \ N_("203 - Non-authoritative Information: Response from a third party") #define STATUS_CODE_204 \ N_("204 - No Content: Request did not return any content") #define STATUS_CODE_205 \ N_("205 - Reset Content: Server asked the client to reset the document") #define STATUS_CODE_206 \ N_("206 - Partial Content: The partial GET has been successful") #define STATUS_CODE_207 \ N_("207 - Multi-Status: WebDAV; RFC 4918") #define STATUS_CODE_208 \ N_("208 - Already Reported: WebDAV; RFC 5842") #define STATUS_CODE_300 \ N_("300 - Multiple Choices: Multiple options for the resource") #define STATUS_CODE_301 \ N_("301 - Moved Permanently: Resource has permanently moved") #define STATUS_CODE_302 \ N_("302 - Moved Temporarily (redirect)") #define STATUS_CODE_303 \ N_("303 - See Other Document: The response is at a different URI") #define STATUS_CODE_304 \ N_("304 - Not Modified: Resource has not been modified") #define STATUS_CODE_305 \ N_("305 - Use Proxy: Can only be accessed through the proxy") #define STATUS_CODE_307 \ N_("307 - Temporary Redirect: Resource temporarily moved") #define STATUS_CODE_400 \ N_("400 - Bad Request: The syntax of the request is invalid") #define STATUS_CODE_401 \ N_("401 - Unauthorized: Request needs user authentication") #define STATUS_CODE_402 \ N_("402 - Payment Required") #define STATUS_CODE_403 \ N_("403 - Forbidden: Server is refusing to respond to it") #define STATUS_CODE_404 \ N_("404 - Not Found: Requested resource could not be found") #define STATUS_CODE_405 \ N_("405 - Method Not Allowed: Request method not supported") #define STATUS_CODE_406 \ N_("406 - Not Acceptable") #define STATUS_CODE_407 \ N_("407 - Proxy Authentication Required") #define STATUS_CODE_408 \ N_("408 - Request Timeout: Server timed out waiting for the request") #define STATUS_CODE_409 \ N_("409 - Conflict: Conflict in the request") #define STATUS_CODE_410 \ N_("410 - Gone: Resource requested is no longer available") #define STATUS_CODE_411 \ N_("411 - Length Required: Invalid Content-Length") #define STATUS_CODE_412 \ N_("412 - Precondition Failed: Server does not meet preconditions") #define STATUS_CODE_413 \ N_("413 - Payload Too Large") #define STATUS_CODE_414 \ N_("414 - Request-URI Too Long") #define STATUS_CODE_415 \ N_("415 - Unsupported Media Type: Media type is not supported") #define STATUS_CODE_416 \ N_("416 - Requested Range Not Satisfiable: Cannot supply that portion") #define STATUS_CODE_417 \ N_("417 - Expectation Failed") #define STATUS_CODE_421 \ N_("421 - Misdirected Request") #define STATUS_CODE_422 \ N_("422 - Unprocessable Entity due to semantic errors: WebDAV") #define STATUS_CODE_423 \ N_("423 - The resource that is being accessed is locked") #define STATUS_CODE_424 \ N_("424 - Failed Dependency: WebDAV") #define STATUS_CODE_426 \ N_("426 - Upgrade Required: Client should switch to a different protocol") #define STATUS_CODE_428 \ N_("428 - Precondition Required") #define STATUS_CODE_429 \ N_("429 - Too Many Requests: The user has sent too many requests") #define STATUS_CODE_431 \ N_("431 - Request Header Fields Too Large") #define STATUS_CODE_451 \ N_("451 - Unavailable For Legal Reasons") #define STATUS_CODE_444 \ N_("444 - (Nginx) Connection closed without sending any headers") #define STATUS_CODE_494 \ N_("494 - (Nginx) Request Header Too Large") #define STATUS_CODE_495 \ N_("495 - (Nginx) SSL client certificate error") #define STATUS_CODE_496 \ N_("496 - (Nginx) Client didn't provide certificate") #define STATUS_CODE_497 \ N_("497 - (Nginx) HTTP request sent to HTTPS port") #define STATUS_CODE_499 \ N_("499 - (Nginx) Connection closed by client while processing request") #define STATUS_CODE_500 \ N_("500 - Internal Server Error") #define STATUS_CODE_501 \ N_("501 - Not Implemented") #define STATUS_CODE_502 \ N_("502 - Bad Gateway: Received an invalid response from the upstream") #define STATUS_CODE_503 \ N_("503 - Service Unavailable: The server is currently unavailable") #define STATUS_CODE_504 \ N_("504 - Gateway Timeout: The upstream server failed to send request") #define STATUS_CODE_505 \ N_("505 - HTTP Version Not Supported") #define STATUS_CODE_520 \ N_("520 - CloudFlare - Web server is returning an unknown error") #define STATUS_CODE_521 \ N_("521 - CloudFlare - Web server is down") #define STATUS_CODE_522 \ N_("522 - CloudFlare - Connection timed out") #define STATUS_CODE_523 \ N_("523 - CloudFlare - Origin is unreachable") #define STATUS_CODE_524 \ N_("524 - CloudFlare - A timeout occurred") #endif // for #ifndef LABELS_H �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/bin2c.c����������������������������������������������������������������������������0000644�0000000�0000000�00000005441�13375657450�012006� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * This is bin2c program, which allows you to convert binary file to * C language array, for use as embedded resource, for instance you can * embed graphics or audio file directly into your program. * This is public domain software, use it on your own risk. * Contact Serge Fukanchik at fuxx@mail.ru if you have any questions. * * Some modifications were made by Gwilym Kuiper (kuiper.gwilym@gmail.com) * I have decided not to change the licence. */ #include #include #include #include #ifdef USE_BZ2 #include #endif int main (int argc, char *argv[]) { char *buf; char *ident; unsigned int i, file_size, need_comma; FILE *f_input, *f_output; #ifdef USE_BZ2 int status; char *bz2_buf; unsigned int uncompressed_size, bz2_size; #endif if (argc < 4) { fprintf (stderr, "Usage: %s binary_file output_file array_name\n", argv[0]); return -1; } f_input = fopen (argv[1], "rb"); if (f_input == NULL) { fprintf (stderr, "%s: can't open %s for reading\n", argv[0], argv[1]); return -1; } // Get the file length fseek (f_input, 0, SEEK_END); file_size = ftell (f_input); fseek (f_input, 0, SEEK_SET); file_size++; if ((buf = malloc (file_size)) == NULL) { fprintf (stderr, "Unable to malloc bin2c.c buffer\n"); fclose (f_input); return -1; } fread (buf, file_size, 1, f_input); fclose (f_input); #ifdef USE_BZ2 // allocate for bz2. bz2_size = ((file_size) * 1.01) + 600; // as per the documentation if ((bz2_buf = malloc (bz2_size)) == NULL) { fprintf (stderr, "Unable to malloc bin2c.c buffer\n"); free (buf); return -1; } // compress the data status = BZ2_bzBuffToBuffCompress (bz2_buf, &bz2_size, buf, file_size, 9, 1, 0); if (status != BZ_OK) { fprintf (stderr, "Failed to compress data: error %i\n", status); free (buf); free (bz2_buf); return -1; } // and be very lazy free (buf); uncompressed_size = file_size; file_size = bz2_size; buf = bz2_buf; #endif f_output = fopen (argv[2], "w"); if (f_output == NULL) { fprintf (stderr, "%s: can't open %s for writing\n", argv[0], argv[1]); free (buf); return -1; } ident = argv[3]; need_comma = 0; fprintf (f_output, "const char %s[%u] = {", ident, file_size); for (i = 0; i < file_size; ++i) { if (need_comma) fprintf (f_output, ", "); else need_comma = 1; if ((i % 11) == 0) fprintf (f_output, "\n\t"); fprintf (f_output, "0x%.2x", buf[i] & 0xff); } fprintf (f_output, "\n};\n\n"); fprintf (f_output, "const int %s_length = %u;\n", ident, file_size); #ifdef USE_BZ2 fprintf (f_output, "const int %s_length_uncompressed = %u;\n", ident, uncompressed_size); #endif fclose (f_output); free (buf); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/goaccess.h�������������������������������������������������������������������������0000644�0000000�0000000�00000003105�13375657450�012600� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GOACCESS_H_INCLUDED #define GOACCESS_H_INCLUDED #include "ui.h" extern GSpinner *parsing_spinner; extern int active_gdns; /* kill dns pthread flag */ void read_client (void *ptr_data); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/src/options.c��������������������������������������������������������������������������0000644�0000000�0000000�00000072720�13375702374�012504� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * options.c -- functions related to parsing program options * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #include "tcbtdb.h" #endif #ifdef HAVE_LIBGEOIP #include #endif #include "options.h" #include "error.h" #include "labels.h" #include "util.h" #include "xmalloc.h" static char short_options[] = "f:e:p:o:l:H:M:S:b:" #ifdef HAVE_LIBGEOIP "g" #endif "acirmMhHqdsV"; /* *INDENT-OFF* */ struct option long_opts[] = { {"agent-list" , no_argument , 0 , 'a' } , {"browsers-file" , required_argument , 0 , 'b' } , {"config-dialog" , no_argument , 0 , 'c' } , {"config-file" , required_argument , 0 , 'p' } , {"debug-file" , required_argument , 0 , 'l' } , {"exclude-ip" , required_argument , 0 , 'e' } , #ifdef HAVE_LIBGEOIP {"std-geoip" , no_argument , 0 , 'g' } , #endif {"help" , no_argument , 0 , 'h' } , {"hl-header" , no_argument , 0 , 'i' } , {"http-method" , required_argument , 0 , 'M' } , {"http-protocol" , required_argument , 0 , 'H' } , {"log-file" , required_argument , 0 , 'f' } , {"log-size" , required_argument , 0 , 'S' } , {"no-query-string" , no_argument , 0 , 'q' } , {"no-term-resolver" , no_argument , 0 , 'r' } , {"output-format" , required_argument , 0 , 'o' } , {"storage" , no_argument , 0 , 's' } , {"version" , no_argument , 0 , 'V' } , {"with-mouse" , no_argument , 0 , 'm' } , {"with-output-resolver" , no_argument , 0 , 'd' } , {"444-as-404" , no_argument , 0 , 0 } , {"4xx-to-unique-count" , no_argument , 0 , 0 } , {"anonymize-ip" , no_argument , 0 , 0 } , {"addr" , required_argument , 0 , 0 } , {"all-static-files" , no_argument , 0 , 0 } , {"color" , required_argument , 0 , 0 } , {"color-scheme" , required_argument , 0 , 0 } , {"crawlers-only" , no_argument , 0 , 0 } , {"daemonize" , no_argument , 0 , 0 } , {"date-format" , required_argument , 0 , 0 } , {"date-spec" , required_argument , 0 , 0 } , {"dcf" , no_argument , 0 , 0 } , {"double-decode" , no_argument , 0 , 0 } , {"enable-panel" , required_argument , 0 , 0 } , {"fifo-in" , required_argument , 0 , 0 } , {"fifo-out" , required_argument , 0 , 0 } , {"hide-referer" , required_argument , 0 , 0 } , {"hour-spec" , required_argument , 0 , 0 } , {"html-custom-css" , required_argument , 0 , 0 } , {"html-custom-js" , required_argument , 0 , 0 } , {"html-prefs" , required_argument , 0 , 0 } , {"html-report-title" , required_argument , 0 , 0 } , {"ignore-crawlers" , no_argument , 0 , 0 } , {"ignore-statics" , required_argument , 0 , 0 } , {"ignore-panel" , required_argument , 0 , 0 } , {"ignore-referer" , required_argument , 0 , 0 } , {"ignore-status" , required_argument , 0 , 0 } , {"invalid-requests" , required_argument , 0 , 0 } , {"json-pretty-print" , no_argument , 0 , 0 } , {"log-format" , required_argument , 0 , 0 } , {"max-items" , required_argument , 0 , 0 } , {"no-color" , no_argument , 0 , 0 } , {"no-column-names" , no_argument , 0 , 0 } , {"no-csv-summary" , no_argument , 0 , 0 } , {"no-global-config" , no_argument , 0 , 0 } , {"no-html-last-updated" , no_argument , 0 , 0 } , {"no-parsing-spinner" , no_argument , 0 , 0 } , {"no-progress" , no_argument , 0 , 0 } , {"no-tab-scroll" , no_argument , 0 , 0 } , {"num-tests" , required_argument , 0 , 0 } , {"origin" , required_argument , 0 , 0 } , {"output" , required_argument , 0 , 0 } , {"pid-file" , required_argument , 0 , 0 } , {"port" , required_argument , 0 , 0 } , {"process-and-exit" , no_argument , 0 , 0 } , {"real-os" , no_argument , 0 , 0 } , {"real-time-html" , no_argument , 0 , 0 } , {"sort-panel" , required_argument , 0 , 0 } , {"static-file" , required_argument , 0 , 0 } , #ifdef HAVE_LIBSSL {"ssl-cert" , required_argument , 0 , 0 } , {"ssl-key" , required_argument , 0 , 0 } , #endif {"time-format" , required_argument , 0 , 0 } , {"ws-url" , required_argument , 0 , 0 } , #ifdef HAVE_GEOLOCATION {"geoip-database" , required_argument , 0 , 0 } , #endif #ifdef HAVE_LIBGEOIP {"geoip-city-data" , required_argument , 0 , 0 } , #endif #ifdef TCB_BTREE {"accumulated-time" , no_argument , 0 , 0 } , {"cache-lcnum" , required_argument , 0 , 0 } , {"cache-ncnum" , required_argument , 0 , 0 } , {"compression" , required_argument , 0 , 0 } , {"db-path" , required_argument , 0 , 0 } , {"keep-db-files" , no_argument , 0 , 0 } , {"load-from-disk" , no_argument , 0 , 0 } , {"tune-bnum" , required_argument , 0 , 0 } , {"tune-lmemb" , required_argument , 0 , 0 } , {"tune-nmemb" , required_argument , 0 , 0 } , {"xmmap" , required_argument , 0 , 0 } , #endif {0, 0, 0, 0} }; /* Command line help. */ void cmd_help (void) { printf ("\nGoAccess - %s\n\n", GO_VERSION); printf ( "Usage: " "goaccess [filename] [ options ... ] [-c][-M][-H][-S][-q][-d][...]\n" "%s:\n\n", INFO_HELP_FOLLOWING_OPTS); printf ( /* Log & Date Format Options */ "Log & Date Format Options\n\n" " --date-format= - Specify log date format. e.g., %%d/%%b/%%Y\n" " --log-format= - Specify log format. Inner quotes need to be\n" " escaped, or use single quotes.\n" " --time-format= - Specify log time format. e.g., %%H:%%M:%%S\n\n" /* User Interface Options */ "User Interface Options\n\n" " -c --config-dialog - Prompt log/date/time configuration window.\n" " -i --hl-header - Color highlight active panel.\n" " -m --with-mouse - Enable mouse support on main dashboard.\n" " --color= - Specify custom colors. See manpage for more\n" " details and options.\n" " --color-scheme=<1|2|3> - Schemes: 1 => Grey, 2 => Green, 3 => Monokai.\n" " --html-custom-css= - Specify a custom CSS file in the HTML report.\n" " --html-custom-js= - Specify a custom JS file in the HTML report.\n" " --html-prefs= - Set default HTML report preferences.\n" " --html-report-title= - Set HTML report page title and header.\n" " --json-pretty-print - Format JSON output w/ tabs & newlines.\n" " --max-items - Maximum number of items to show per panel.\n" " See man page for limits.\n" " --no-color - Disable colored output.\n" " --no-column-names - Don't write column names in term output.\n" " --no-csv-summary - Disable summary metrics on the CSV output.\n" " --no-html-last-updated - Hide HTML last updated field.\n" " --no-parsing-spinner - Disable progress metrics and parsing spinner.\n" " --no-progress - Disable progress metrics.\n" " --no-tab-scroll - Disable scrolling through panels on TAB.\n" "\n" /* Server Options */ "Server Options\n\n" " --addr= - Specify IP address to bind server to.\n" " --daemonize - Run as daemon (if --real-time-html enabled).\n" " --fifo-in= - Path to read named pipe (FIFO).\n" " --fifo-out= - Path to write named pipe (FIFO).\n" " --origin= - Ensure clients send the specified origin header\n" " upon the WebSocket handshake.\n" " --pid-file= - Write PID to a file when --daemonize is used.\n" " --port= - Specify the port to use.\n" " --real-time-html - Enable real-time HTML output.\n" " --ssl-cert= - Path to TLS/SSL certificate.\n" " --ssl-key= - Path to TLS/SSL private key.\n" " --ws-url= - URL to which the WebSocket server responds.\n" "\n" /* File Options */ "File Options\n\n" " - - The log file to parse is read from stdin.\n" " -f --log-file= - Path to input log file.\n" " -S --log-size= - Specify the log size, useful when piping in logs.\n" " -l --debug-file= - Send all debug messages to the specified\n" " file.\n" " -p --config-file= - Custom configuration file.\n" " --invalid-requests= - Log invalid requests to the specified file.\n" " --no-global-config - Don't load global configuration file.\n" "\n" /* Parse Options */ "Parse Options\n\n" " -a --agent-list - Enable a list of user-agents by host.\n" " -b --browsers-file= - Use additional custom list of browsers.\n" " -d --with-output-resolver - Enable IP resolver on HTML|JSON output.\n" " -e --exclude-ip= - Exclude one or multiple IPv4/6. Allows IP\n" " ranges e.g. 192.168.0.1-192.168.0.10\n" " -H --http-protocol= - Set/unset HTTP request protocol if found.\n" " -M --http-method= - Set/unset HTTP request method if found.\n" " -o --output=file.html|json|csv - Output either an HTML, JSON or a CSV file.\n" " -q --no-query-string - Ignore request's query string. Removing the\n" " query string can greatly decrease memory\n" " consumption.\n" " -r --no-term-resolver - Disable IP resolver on terminal output.\n" " --444-as-404 - Treat non-standard status code 444 as 404.\n" " --4xx-to-unique-count - Add 4xx client errors to the unique visitors\n" " count.\n" #ifdef TCB_BTREE " --accumulated-time - Store accumulated time from parsing day-by-day logs.\n" #endif " --anonymize-ip - Anonymize IP addresses before outputting to report.\n" " --all-static-files - Include static files with a query string.\n" " --crawlers-only - Parse and display only crawlers.\n" " --date-spec= - Date specificity. Possible values: `date`\n" " (default), or `hr`.\n" " --double-decode - Decode double-encoded values.\n" " --enable-panel= - Enable parsing/displaying the given panel.\n" " --hide-referer= - Hide a referer but still count it. Wild cards\n" " are allowed. i.e., *.bing.com\n" " --hour-spec= - Hour specificity. Possible values: `hr`\n" " (default), or `min` (tenth of a min).\n" " --ignore-crawlers - Ignore crawlers.\n" " --ignore-panel= - Ignore parsing/displaying the given panel.\n" " --ignore-referer= - Ignore a referer from being counted. Wild cards\n" " are allowed. i.e., *.bing.com\n" " --ignore-statics= - Ignore static requests.\n" " req => Ignore from valid requests.\n" " panel => Ignore from valid requests and panels.\n" " --ignore-status= - Ignore parsing the given status code.\n" " --num-tests= - Number of lines to test. >= 0 (10 default)\n" " --process-and-exit - Parse log and exit without outputting data.\n" " --real-os - Display real OS names. e.g, Windows XP, Snow\n" " Leopard.\n" " --sort-panel=PANEL,METRIC,ORDER - Sort panel on initial load. For example:\n" " --sort-panel=VISITORS,BY_HITS,ASC. See\n" " manpage for a list of panels/fields.\n" " --static-file= - Add static file extension. e.g.: .mp3.\n" " Extensions are case sensitive.\n" "\n" /* GeoIP Options */ #ifdef HAVE_GEOLOCATION "GeoIP Options\n\n" #ifdef HAVE_LIBGEOIP " -g --std-geoip - Standard GeoIP database for less memory\n" " consumption.\n" #endif " --geoip-database= - Specify path to GeoIP database file. i.e.,\n" " GeoLiteCity.dat, GeoIPv6.dat ...\n" "\n" #endif /* On-Disk Database Options */ #ifdef TCB_BTREE "On-Disk Database Options\n\n" " --keep-db-files - Persist parsed data into disk.\n" " --load-from-disk - Load previously stored data from disk.\n" " --db-path= - Path of the database file. Default [%s]\n" " --cache-lcnum= - Max number of leaf nodes to be cached. Default\n" " [%d]\n" " --cache-ncnum= - Max number of non-leaf nodes to be cached.\n" " Default [%d]\n" " --tune-bnum= - Number of elements of the bucket array. Default\n" " [%d]\n" " --tune-lmemb= - Number of members in each leaf page. Default\n" " [%d]\n" " --tune-nmemb= - Number of members in each non-leaf page.\n" " Default [%d]\n" " --xmmap= - Set the size in bytes of the extra mapped\n" " memory. Default [%d]\n" #if defined(HAVE_ZLIB) || defined(HAVE_BZ2) " --compression= - Specifies that each page is compressed with\n" " ZLIB|BZ2 encoding.\n" "\n" #endif #endif /* Other Options */ "Other Options\n\n" " -h --help - This help.\n" " -V --version - Display version information and exit.\n" " -s --storage - Display current storage method. e.g., B+\n" " Tree, Hash.\n" " --dcf - Display the path of the default config\n" " file when `-p` is not used.\n" "\n" "%s `man goaccess`.\n\n" "%s: http://goaccess.io\n" "GoAccess Copyright (C) 2009-2017 by Gerardo Orellana" "\n\n" #ifdef TCB_BTREE , TC_DBPATH, TC_MMAP, TC_LCNUM, TC_NCNUM, TC_LMEMB, TC_NMEMB, TC_BNUM #endif , INFO_HELP_EXAMPLES, INFO_MORE_INFO ); exit (EXIT_FAILURE); } /* *INDENT-ON* */ /* Push a command line option to the given array if within bounds and if it's * not in the array. */ static void set_array_opt (const char *oarg, const char *arr[], int *size, int max) { if (str_inarray (oarg, arr, *size) < 0 && *size < max) arr[(*size)++] = oarg; } /* Parse command line long options. */ static void parse_long_opt (const char *name, const char *oarg) { if (!strcmp ("no-global-config", name)) return; /* LOG & DATE FORMAT OPTIONS * ========================= */ /* log format */ if (!strcmp ("log-format", name)) set_log_format_str (oarg); /* time format */ if (!strcmp ("time-format", name)) set_time_format_str (oarg); /* date format */ if (!strcmp ("date-format", name)) set_date_format_str (oarg); /* USER INTERFACE OPTIONS * ========================= */ /* colors */ if (!strcmp ("color", name)) set_array_opt (oarg, conf.colors, &conf.color_idx, MAX_CUSTOM_COLORS); /* color scheme */ if (!strcmp ("color-scheme", name)) conf.color_scheme = atoi (oarg); /* html custom CSS */ if (!strcmp ("html-custom-css", name)) conf.html_custom_css = oarg; /* html custom JS */ if (!strcmp ("html-custom-js", name)) conf.html_custom_js = oarg; /* html JSON object containing default preferences */ if (!strcmp ("html-prefs", name)) conf.html_prefs = oarg; /* html report title */ if (!strcmp ("html-report-title", name)) conf.html_report_title = oarg; /* json pretty print */ if (!strcmp ("json-pretty-print", name)) conf.json_pretty_print = 1; /* max items */ if (!strcmp ("max-items", name)) { char *sEnd; int max = strtol (oarg, &sEnd, 10); if (oarg == sEnd || *sEnd != '\0' || errno == ERANGE) conf.max_items = 1; else conf.max_items = max; } /* no color */ if (!strcmp ("no-color", name)) conf.no_color = 1; /* no columns */ if (!strcmp ("no-column-names", name)) conf.no_column_names = 1; /* no csv summary */ if (!strcmp ("no-csv-summary", name)) conf.no_csv_summary = 1; /* no parsing spinner */ if (!strcmp ("no-parsing-spinner", name)) conf.no_parsing_spinner = 1; /* no progress */ if (!strcmp ("no-progress", name)) conf.no_progress = 1; /* no tab scroll */ if (!strcmp ("no-tab-scroll", name)) conf.no_tab_scroll = 1; /* no html last updated field */ if (!strcmp ("no-html-last-updated", name)) conf.no_html_last_updated = 1; /* SERVER OPTIONS * ========================= */ /* address to bind to */ if (!strcmp ("addr", name)) conf.addr = oarg; /* FIFO in (read) */ if (!strcmp ("fifo-in", name)) conf.fifo_in = oarg; /* FIFO out (write) */ if (!strcmp ("fifo-out", name)) conf.fifo_out = oarg; /* run program as a Unix daemon */ if (!strcmp ("daemonize", name)) conf.daemonize = 1; /* WebSocket origin */ if (!strcmp ("origin", name)) conf.origin = oarg; /* PID file to write */ if (!strcmp ("pid-file", name)) conf.pidfile = oarg; /* port to use */ if (!strcmp ("port", name)) { int port = strtol (oarg, NULL, 10); if (port < 0 || port > 65535) LOG_DEBUG (("Invalid port.")); else conf.port = oarg; } /* real time HTML */ if (!strcmp ("real-time-html", name)) conf.real_time_html = 1; /* TLS/SSL certificate */ if (!strcmp ("ssl-cert", name)) conf.sslcert = oarg; /* TLS/SSL private key */ if (!strcmp ("ssl-key", name)) conf.sslkey = oarg; /* URL to which the WebSocket server responds. */ if (!strcmp ("ws-url", name)) conf.ws_url = oarg; /* FILE OPTIONS * ========================= */ /* invalid requests */ if (!strcmp ("invalid-requests", name)) { conf.invalid_requests_log = oarg; invalid_log_open (conf.invalid_requests_log); } /* output file */ if (!strcmp ("output", name)) set_array_opt (oarg, conf.output_formats, &conf.output_format_idx, MAX_OUTFORMATS); /* PARSE OPTIONS * ========================= */ /* 444 as 404 */ if (!strcmp ("444-as-404", name)) conf.code444_as_404 = 1; /* 4xx to unique count */ if (!strcmp ("4xx-to-unique-count", name)) conf.client_err_to_unique_count = 1; /* anonymize ip */ if (!strcmp ("anonymize-ip", name)) conf.anonymize_ip = 1; /* store accumulated time in tcb */ if (!strcmp ("accumulated-time", name)) conf.store_accumulated_time = 1; /* all static files */ if (!strcmp ("all-static-files", name)) conf.all_static_files = 1; /* crawlers only */ if (!strcmp ("crawlers-only", name)) conf.crawlers_only = 1; /* date specificity */ if (!strcmp ("date-spec", name) && !strcmp (oarg, "hr")) conf.date_spec_hr = 1; /* double decode */ if (!strcmp ("double-decode", name)) conf.double_decode = 1; /* enable panel */ if (!strcmp ("enable-panel", name)) set_array_opt (oarg, conf.enable_panels, &conf.enable_panel_idx, TOTAL_MODULES); /* hour specificity */ if (!strcmp ("hour-spec", name) && !strcmp (oarg, "min")) conf.hour_spec_min = 1; /* ignore crawlers */ if (!strcmp ("ignore-crawlers", name)) conf.ignore_crawlers = 1; /* ignore panel */ if (!strcmp ("ignore-panel", name)) set_array_opt (oarg, conf.ignore_panels, &conf.ignore_panel_idx, TOTAL_MODULES); /* ignore referer */ if (!strcmp ("ignore-referer", name)) set_array_opt (oarg, conf.ignore_referers, &conf.ignore_referer_idx, MAX_IGNORE_REF); /* hide referer from report (e.g. within same site) */ if (!strcmp ("hide-referer", name)) set_array_opt (oarg, conf.hide_referers, &conf.hide_referer_idx, MAX_IGNORE_REF); /* ignore status code */ if (!strcmp ("ignore-status", name)) set_array_opt (oarg, conf.ignore_status, &conf.ignore_status_idx, MAX_IGNORE_STATUS); /* ignore static requests */ if (!strcmp ("ignore-statics", name)) { if (!strcmp ("req", oarg)) conf.ignore_statics = IGNORE_LEVEL_REQ; else if (!strcmp ("panel", oarg)) conf.ignore_statics = IGNORE_LEVEL_PANEL; else LOG_DEBUG (("Invalid statics ignore option.")); } /* number of line tests */ if (!strcmp ("num-tests", name)) { char *sEnd; int tests = strtol (oarg, &sEnd, 10); if (oarg == sEnd || *sEnd != '\0' || errno == ERANGE) return; conf.num_tests = tests >= 0 ? tests : 0; } /* process and exit */ if (!strcmp ("process-and-exit", name)) conf.process_and_exit = 1; /* real os */ if (!strcmp ("real-os", name)) conf.real_os = 1; /* sort view */ if (!strcmp ("sort-panel", name)) set_array_opt (oarg, conf.sort_panels, &conf.sort_panel_idx, TOTAL_MODULES); /* static file */ if (!strcmp ("static-file", name) && conf.static_file_idx < MAX_EXTENSIONS) { if (conf.static_file_max_len < strlen (oarg)) conf.static_file_max_len = strlen (oarg); set_array_opt (oarg, conf.static_files, &conf.static_file_idx, MAX_EXTENSIONS); } /* GEOIP OPTIONS * ========================= */ /* specifies the path of the GeoIP City database file */ if (!strcmp ("geoip-city-data", name) || !strcmp ("geoip-database", name)) conf.geoip_database = oarg; /* BTREE OPTIONS * ========================= */ /* keep database files */ if (!strcmp ("keep-db-files", name)) conf.keep_db_files = 1; /* load data from disk */ if (!strcmp ("load-from-disk", name)) conf.load_from_disk = 1; /* specifies the path of the database file */ if (!strcmp ("db-path", name)) conf.db_path = oarg; /* specifies the maximum number of leaf nodes to be cached */ if (!strcmp ("cache-lcnum", name)) conf.cache_lcnum = atoi (oarg); /* specifies the maximum number of non-leaf nodes to be cached */ if (!strcmp ("cache-ncnum", name)) conf.cache_ncnum = atoi (oarg); /* number of elements of the bucket array */ if (!strcmp ("tune-bnum", name)) conf.tune_bnum = atoi (oarg); /* number of members in each non-leaf page */ if (!strcmp ("tune-nmemb", name)) conf.tune_nmemb = atoi (oarg); /* number of members in each leaf page */ if (!strcmp ("tune-lmemb", name)) conf.tune_lmemb = atoi (oarg); /* set the size in bytes of the extra mapped memory */ if (!strcmp ("xmmap", name)) conf.xmmap = atoi (oarg); /* specifies that each page is compressed with X encoding */ if (!strcmp ("compression", name)) { #ifdef HAVE_ZLIB if (!strcmp ("zlib", oarg)) conf.compression = TC_ZLIB; #endif #ifdef HAVE_BZ2 if (!strcmp ("bz2", oarg)) conf.compression = TC_BZ2; #endif } /* default config file --dwf */ if (!strcmp ("dcf", name)) { display_default_config_file (); exit (EXIT_SUCCESS); } } /* Determine if the '--no-global-config' command line option needs to be * enabled or not. */ void verify_global_config (int argc, char **argv) { int o, idx = 0; conf.load_global_config = 1; while ((o = getopt_long (argc, argv, short_options, long_opts, &idx)) >= 0) { if (-1 == o || EOF == o) break; switch (o) { case 'p': conf.iconfigfile = xstrdup (optarg); break; case 0: if (!strcmp ("no-global-config", long_opts[idx].name)) conf.load_global_config = 0; break; case '?': exit (EXIT_FAILURE); } } /* reset it to 1 */ optind = 1; } /* Attempt to add - to the array of filenames if it hasn't been added it yet. */ void add_dash_filename (void) { int i; // pre-scan for '-' and don't add if already exists: github.com/allinurl/goaccess/issues/907 for (i = 0; i < conf.filenames_idx; ++i) { if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0') return; } if (conf.filenames_idx < MAX_FILENAMES && !conf.read_stdin) { conf.read_stdin = 1; conf.filenames[conf.filenames_idx++] = "-"; } } /* Read the user's supplied command line options. */ void read_option_args (int argc, char **argv) { int o, idx = 0; #ifdef HAVE_LIBGEOIP conf.geo_db = GEOIP_MEMORY_CACHE; #endif while ((o = getopt_long (argc, argv, short_options, long_opts, &idx)) >= 0) { if (-1 == o || EOF == o) break; switch (o) { case 'f': if (conf.filenames_idx < MAX_FILENAMES) conf.filenames[conf.filenames_idx++] = optarg; break; case 'S': if (strchr (optarg, '-')) { printf ("[ERROR] log-size must be a positive integer\n"); exit (EXIT_FAILURE); } conf.log_size = (uint64_t) atoll (optarg); break; case 'p': /* ignore it */ break; #ifdef HAVE_LIBGEOIP case 'g': conf.geo_db = GEOIP_STANDARD; break; #endif case 'e': if (conf.ignore_ip_idx < MAX_IGNORE_IPS) conf.ignore_ips[conf.ignore_ip_idx++] = optarg; else LOG_DEBUG (("Max num of (%d) IPs to ignore reached.", MAX_IGNORE_IPS)); break; case 'a': conf.list_agents = 1; break; case 'b': conf.browsers_file = optarg; break; case 'c': conf.load_conf_dlg = 1; break; case 'i': conf.hl_header = 1; break; case 'q': conf.ignore_qstr = 1; break; case 'o': if (!valid_output_type (optarg)) { printf ("[ERROR] Invalid filename extension used, must be any of .csv, .json, or .html\n"); exit (EXIT_FAILURE); } if (conf.output_format_idx < MAX_OUTFORMATS) conf.output_formats[conf.output_format_idx++] = optarg; break; case 'l': conf.debug_log = optarg; dbg_log_open (conf.debug_log); break; case 'r': conf.skip_term_resolver = 1; break; case 'd': conf.enable_html_resolver = 1; break; case 'm': conf.mouse_support = 1; break; case 'M': if (strcmp ("no", optarg) == 0) conf.append_method = 0; else conf.append_method = 1; break; case 'h': cmd_help (); break; case 'H': if (strcmp ("no", optarg) == 0) conf.append_protocol = 0; else conf.append_protocol = 1; break; case 'V': display_version (); exit (EXIT_SUCCESS); break; case 0: parse_long_opt (long_opts[idx].name, optarg); break; case 's': display_storage (); exit (EXIT_SUCCESS); case '?': exit (EXIT_FAILURE); default: exit (EXIT_FAILURE); } } for (idx = optind; idx < argc; ++idx) { /* read from standard input */ if (!conf.read_stdin && strcmp ("-", argv[idx]) == 0) add_dash_filename (); /* read filenames */ else { if (conf.filenames_idx < MAX_FILENAMES) conf.filenames[conf.filenames_idx++] = argv[idx]; } } } goaccess-1.3/src/websocket.h0000644000000000000000000002407113375657450013004 00000000000000/** * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WEBSOCKET_H_INCLUDED #define WEBSOCKET_H_INCLUDED #include #include #include #if HAVE_LIBSSL #include #include #include #endif #if defined(__linux__) || defined(__CYGWIN__) # include #if ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 9)) #if defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN) # include # define htobe16(x) htons(x) # define htobe64(x) (((uint64_t)htonl(((uint32_t)(((uint64_t)(x)) >> 32)))) | \ (((uint64_t)htonl(((uint32_t)(x)))) << 32)) # define be16toh(x) ntohs(x) # define be32toh(x) ntohl(x) # define be64toh(x) (((uint64_t)ntohl(((uint32_t)(((uint64_t)(x)) >> 32)))) | \ (((uint64_t)ntohl(((uint32_t)(x)))) << 32)) #else # error Byte Order not supported! #endif #endif #elif defined(__sun__) # include # define htobe16(x) BE_16(x) # define htobe64(x) BE_64(x) # define be16toh(x) BE_IN16(x) # define be32toh(x) BE_IN32(x) # define be64toh(x) BE_IN64(x) #elif defined(__FreeBSD__) || defined(__NetBSD__) # include #elif defined(__OpenBSD__) # include # if !defined(be16toh) # define be16toh(x) betoh16(x) # endif # if !defined(be32toh) # define be32toh(x) betoh32(x) # endif # if !defined(be64toh) # define be64toh(x) betoh64(x) # endif #elif defined(__APPLE__) # include # define htobe16(x) OSSwapHostToBigInt16(x) # define htobe64(x) OSSwapHostToBigInt64(x) # define be16toh(x) OSSwapBigToHostInt16(x) # define be32toh(x) OSSwapBigToHostInt32(x) # define be64toh(x) OSSwapBigToHostInt64(x) #else # error Platform not supported! #endif #define MAX(a,b) (((a)>(b))?(a):(b)) #include "gslist.h" #define WS_PIPEIN "/tmp/wspipein.fifo" #define WS_PIPEOUT "/tmp/wspipeout.fifo" #define WS_BAD_REQUEST_STR "HTTP/1.1 400 Invalid Request\r\n\r\n" #define WS_SWITCH_PROTO_STR "HTTP/1.1 101 Switching Protocols" #define WS_TOO_BUSY_STR "HTTP/1.1 503 Service Unavailable\r\n\r\n" #define CRLF "\r\n" #define SHA_DIGEST_LENGTH 20 /* packet header is 3 unit32_t : type, size, listener */ #define HDR_SIZE 3 * 4 #define WS_MAX_FRM_SZ 1048576 /* 1 MiB max frame size */ #define WS_THROTTLE_THLD 2097152 /* 2 MiB throttle threshold */ #define WS_MAGIC_STR "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" #define WS_PAYLOAD_EXT16 126 #define WS_PAYLOAD_EXT64 127 #define WS_PAYLOAD_FULL 125 #define WS_FRM_HEAD_SZ 16 /* frame header size */ #define WS_FRM_FIN(x) (((x) >> 7) & 0x01) #define WS_FRM_MASK(x) (((x) >> 7) & 0x01) #define WS_FRM_R1(x) (((x) >> 6) & 0x01) #define WS_FRM_R2(x) (((x) >> 5) & 0x01) #define WS_FRM_R3(x) (((x) >> 4) & 0x01) #define WS_FRM_OPCODE(x) ((x) & 0x0F) #define WS_FRM_PAYLOAD(x) ((x) & 0x7F) #define WS_CLOSE_NORMAL 1000 #define WS_CLOSE_GOING_AWAY 1001 #define WS_CLOSE_PROTO_ERR 1002 #define WS_CLOSE_INVALID_UTF8 1007 #define WS_CLOSE_TOO_LARGE 1009 #define WS_CLOSE_UNEXPECTED 1011 typedef enum WSSTATUS { WS_OK = 0, WS_ERR = (1 << 0), WS_CLOSE = (1 << 1), WS_READING = (1 << 2), WS_SENDING = (1 << 3), WS_THROTTLING = (1 << 4), WS_TLS_ACCEPTING = (1 << 5), WS_TLS_READING = (1 << 6), WS_TLS_WRITING = (1 << 7), WS_TLS_SHUTTING = (1 << 8), } WSStatus; typedef enum WSOPCODE { WS_OPCODE_CONTINUATION = 0x00, WS_OPCODE_TEXT = 0x01, WS_OPCODE_BIN = 0x02, WS_OPCODE_END = 0x03, WS_OPCODE_CLOSE = 0x08, WS_OPCODE_PING = 0x09, WS_OPCODE_PONG = 0x0A, } WSOpcode; typedef struct WSQueue_ { char *queued; /* queue data */ int qlen; /* queue length */ } WSQueue; typedef struct WSPacket_ { uint32_t type; /* packet type (fixed-size) */ uint32_t size; /* payload size in bytes (fixed-size) */ char *data; /* payload */ int len; /* payload buffer len */ } WSPacket; /* WS HTTP Headers */ typedef struct WSHeaders_ { int reading; int buflen; char buf[BUFSIZ + 1]; char *agent; char *path; char *method; char *protocol; char *host; char *origin; char *upgrade; char *referer; char *connection; char *ws_protocol; char *ws_key; char *ws_sock_ver; char *ws_accept; char *ws_resp; } WSHeaders; /* A WebSocket Message */ typedef struct WSFrame_ { /* frame format */ WSOpcode opcode; /* frame opcode */ unsigned char fin; /* frame fin flag */ unsigned char mask[4]; /* mask key */ uint8_t res; /* extensions */ int payload_offset; /* end of header/start of payload */ int payloadlen; /* payload length (for each frame) */ /* status flags */ int reading; /* still reading frame's header part? */ int masking; /* are we masking the frame? */ char buf[WS_FRM_HEAD_SZ + 1]; /* frame's header */ int buflen; /* recv'd buf length so far (for each frame) */ } WSFrame; /* A WebSocket Message */ typedef struct WSMessage_ { WSOpcode opcode; /* frame opcode */ int fragmented; /* reading a fragmented frame */ int mask_offset; /* for fragmented frames */ char *payload; /* payload message */ int payloadsz; /* total payload size (whole message) */ int buflen; /* recv'd buf length so far (for each frame) */ } WSMessage; /* FD event states */ typedef struct WSEState_ { fd_set master; fd_set rfds; fd_set wfds; } WSEState; /* A WebSocket Client */ typedef struct WSClient_ { /* socket data */ int listener; /* socket */ char remote_ip[INET6_ADDRSTRLEN]; /* client IP */ WSQueue *sockqueue; /* sending buffer */ WSEState *state; /* FDs states */ WSHeaders *headers; /* HTTP headers */ WSFrame *frame; /* frame headers */ WSMessage *message; /* message */ WSStatus status; /* connection status */ struct timeval start_proc; struct timeval end_proc; #ifdef HAVE_LIBSSL SSL *ssl; WSStatus sslstatus; /* ssl connection status */ #endif } WSClient; /* Config OOptions */ typedef struct WSPipeIn_ { int fd; /* named pipe FD */ WSPacket *packet; /* FIFO data's buffer */ WSEState *state; /* FDs states */ char hdr[HDR_SIZE]; /* FIFO header's buffer */ int hlen; } WSPipeIn; /* Pipe Out */ typedef struct WSPipeOut_ { int fd; /* named pipe FD */ WSEState *state; /* FDs states */ WSQueue *fifoqueue; /* FIFO out queue */ WSStatus status; /* connection status */ } WSPipeOut; /* Config OOptions */ typedef struct WSConfig_ { /* Config Options */ const char *accesslog; const char *host; const char *origin; const char *pipein; const char *pipeout; const char *port; const char *sslcert; const char *sslkey; int echomode; int strict; int max_frm_size; int use_ssl; } WSConfig; /* A WebSocket Instance */ typedef struct WSServer_ { /* Server Status */ int closing; /* Callbacks */ int (*onclose) (WSPipeOut * pipeout, WSClient * client); int (*onmessage) (WSPipeOut * pipeout, WSClient * client); int (*onopen) (WSPipeOut * pipeout, WSClient * client); /* self-pipe */ int self_pipe[2]; /* FIFO reader */ WSPipeIn *pipein; /* FIFO writer */ WSPipeOut *pipeout; /* Connected Clients */ GSLList *colist; #ifdef HAVE_LIBSSL SSL_CTX *ctx; #endif } WSServer; int ws_read_fifo (int fd, char *buf, int *buflen, int pos, int need); int ws_send_data (WSClient * client, WSOpcode opcode, const char *p, int sz); int ws_setfifo (const char *pipename); int ws_validate_string (const char *str, int len); int ws_write_fifo (WSPipeOut * pipeout, char *buffer, int len); size_t pack_uint32 (void *buf, uint32_t val); size_t unpack_uint32 (const void *buf, uint32_t * val); void set_nonblocking (int listener); void ws_set_config_accesslog (const char *accesslog); void ws_set_config_echomode (int echomode); void ws_set_config_frame_size (int max_frm_size); void ws_set_config_host (const char *host); void ws_set_config_origin (const char *origin); void ws_set_config_pipein (const char *pipein); void ws_set_config_pipeout (const char *pipeout); void ws_set_config_port (const char *port); void ws_set_config_sslcert (const char *sslcert); void ws_set_config_sslkey (const char *sslkey); void ws_set_config_strict (int strict); void ws_start (WSServer * server); void ws_stop (WSServer * server); WSServer *ws_init (const char *host, const char *port, void (*initopts) (void)); #endif // for #ifndef WEBSOCKET_H goaccess-1.3/src/csv.c0000644000000000000000000002145213375657450011604 00000000000000/** * output.c -- output csv to the standard output stream * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include #include #include #include #include #include #include #include #include #include "csv.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "error.h" #include "ui.h" #include "util.h" /* Panel output */ typedef struct GPanel_ { GModule module; void (*render) (FILE * fp, GHolder * h, GPercTotals totals); } GPanel; static void print_csv_data (FILE * fp, GHolder * h, GPercTotals totals); /* *INDENT-OFF* */ /* A function pointer for each panel */ static GPanel paneling[] = { {VISITORS , print_csv_data} , {REQUESTS , print_csv_data} , {REQUESTS_STATIC , print_csv_data} , {NOT_FOUND , print_csv_data} , {HOSTS , print_csv_data} , {OS , print_csv_data} , {BROWSERS , print_csv_data} , {VISIT_TIMES , print_csv_data} , {VIRTUAL_HOSTS , print_csv_data} , {REFERRERS , print_csv_data} , {REFERRING_SITES , print_csv_data} , {KEYPHRASES , print_csv_data} , {STATUS_CODES , print_csv_data} , {REMOTE_USER , print_csv_data} , #ifdef HAVE_GEOLOCATION {GEO_LOCATION , print_csv_data} , #endif }; /* *INDENT-ON* */ /* Get a panel from the GPanel structure given a module. * * On error, or if not found, NULL is returned. * On success, the panel value is returned. */ static GPanel * panel_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (paneling); for (i = 0; i < num_panels; i++) { if (paneling[i].module == module) return &paneling[i]; } return NULL; } /* Iterate over the string and escape CSV output. */ static void escape_cvs_output (FILE * fp, char *s) { while (*s) { switch (*s) { case '"': fprintf (fp, "\"\""); break; default: fputc (*s, fp); break; } s++; } } /* Output metrics. * * On success, outputs item value. */ static void print_csv_metric_block (FILE * fp, GMetrics * nmetrics) { /* basic metrics */ fprintf (fp, "\"%d\",", nmetrics->hits); fprintf (fp, "\"%4.2f%%\",", nmetrics->hits_perc); fprintf (fp, "\"%d\",", nmetrics->visitors); fprintf (fp, "\"%4.2f%%\",", nmetrics->visitors_perc); /* bandwidth */ if (conf.bandwidth) { fprintf (fp, "\"%lld\",", (long long) nmetrics->bw.nbw); fprintf (fp, "\"%4.2f%%\",", nmetrics->bw_perc); } /* time served metrics */ if (conf.serve_usecs) { fprintf (fp, "\"%lld\",", (long long) nmetrics->avgts.nts); fprintf (fp, "\"%lld\",", (long long) nmetrics->cumts.nts); fprintf (fp, "\"%lld\",", (long long) nmetrics->maxts.nts); } /* request method */ if (conf.append_method && nmetrics->method) fprintf (fp, "\"%s\"", nmetrics->method); fprintf (fp, ","); /* request protocol */ if (conf.append_protocol && nmetrics->protocol) fprintf (fp, "\"%s\"", nmetrics->protocol); fprintf (fp, ","); /* data field */ fprintf (fp, "\""); escape_cvs_output (fp, nmetrics->data); fprintf (fp, "\"\r\n"); } /* Output a sublist (double linked-list) items for a particular parent node. * * On error, it exits early. * On success, outputs item value. */ static void print_csv_sub_items (FILE * fp, GHolder * h, int idx, GPercTotals totals) { GMetrics *nmetrics; GSubList *sub_list = h->items[idx].sub_list; GSubItem *iter; int i = 0; if (sub_list == NULL) return; for (iter = sub_list->head; iter; iter = iter->next, i++) { set_data_metrics (iter->metrics, &nmetrics, totals); fprintf (fp, "\"%d\",", i); /* idx */ fprintf (fp, "\"%d\",", idx); /* parent idx */ fprintf (fp, "\"%s\",", module_to_id (h->module)); /* output metrics */ print_csv_metric_block (fp, nmetrics); free (nmetrics); } } /* Output first-level items. * * On success, outputs item value. */ static void print_csv_data (FILE * fp, GHolder * h, GPercTotals totals) { GMetrics *nmetrics; int i; for (i = 0; i < h->idx; i++) { set_data_metrics (h->items[i].metrics, &nmetrics, totals); fprintf (fp, "\"%d\",", i); /* idx */ fprintf (fp, ","); /* no parent */ fprintf (fp, "\"%s\",", module_to_id (h->module)); /* output metrics */ print_csv_metric_block (fp, nmetrics); if (h->sub_items_size) print_csv_sub_items (fp, h, i, totals); free (nmetrics); } } #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* Output general statistics information. */ static void print_csv_summary (FILE * fp, GLog * glog) { char now[DATE_TIME]; char *source = NULL; const char *fmt; int i = 0, total = 0; long long t = 0LL; generate_time (); strftime (now, DATE_TIME, "%Y-%m-%d %H:%M:%S %z", now_tm); /* generated date time */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%s\",\"%s\"\r\n"; fprintf (fp, fmt, i++, GENER_ID, now, OVERALL_DATETIME); /* total requests */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%d\",\"%s\"\r\n"; total = glog->processed; fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_REQ); /* valid requests */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%d\",\"%s\"\r\n"; total = glog->valid; fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_VALID); /* invalid requests */ total = glog->invalid; fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_FAILED); /* generated time */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%lld\",\"%s\"\r\n"; t = (long long) end_proc - start_proc; fprintf (fp, fmt, i++, GENER_ID, t, OVERALL_GENTIME); /* visitors */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%d\",\"%s\"\r\n"; total = ht_get_size_uniqmap (VISITORS); fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_VISITORS); /* files */ total = ht_get_size_datamap (REQUESTS); fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_FILES); /* excluded hits */ total = glog->excluded_ip; fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_EXCL_HITS); /* referrers */ total = ht_get_size_datamap (REFERRERS); fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_REF); /* not found */ total = ht_get_size_datamap (NOT_FOUND); fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_NOTFOUND); /* static files */ total = ht_get_size_datamap (REQUESTS_STATIC); fprintf (fp, fmt, i++, GENER_ID, total, OVERALL_STATIC); /* log size */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%jd\",\"%s\"\r\n"; fprintf (fp, fmt, i++, GENER_ID, (intmax_t) get_log_sizes (), OVERALL_LOGSIZE); /* bandwidth */ fmt = "\"%d\",,\"%s\",,,,,,,,\"%llu\",\"%s\"\r\n"; fprintf (fp, fmt, i++, GENER_ID, glog->resp_size, OVERALL_BANDWIDTH); /* log path */ source = get_log_source_str (0); fmt = "\"%d\",,\"%s\",,,,,,,,\"%s\",\"%s\"\r\n"; fprintf (fp, fmt, i++, GENER_ID, source, OVERALL_LOG); free (source); } #pragma GCC diagnostic warning "-Wformat-nonliteral" /* Entry point to generate a a csv report writing it to the fp */ void output_csv (GLog * glog, GHolder * holder, const char *filename) { GModule module; GPercTotals totals; const GPanel *panel = NULL; size_t idx = 0; FILE *fp; fp = (filename != NULL) ? fopen (filename, "w") : stdout; if (!fp) FATAL ("Unable to open CSV file: %s.", strerror (errno)); if (!conf.no_csv_summary) print_csv_summary (fp, glog); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; if (!(panel = panel_lookup (module))) continue; set_module_totals (module, &totals); panel->render (fp, holder + module, totals); } fclose (fp); } goaccess-1.3/src/color.c0000644000000000000000000006510613375657450012133 00000000000000/** * color.c -- functions related to custom color * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "color.h" #include "error.h" #include "gslist.h" #include "util.h" #include "xmalloc.h" static GSLList *color_list = NULL; static GSLList *pair_list = NULL; /* *INDENT-OFF* */ static GEnum CSTM_COLORS[] = { {"COLOR_MTRC_HITS" , COLOR_MTRC_HITS}, {"COLOR_MTRC_VISITORS" , COLOR_MTRC_VISITORS}, {"COLOR_MTRC_HITS_PERC" , COLOR_MTRC_HITS_PERC}, {"COLOR_MTRC_VISITORS_PERC" , COLOR_MTRC_VISITORS_PERC}, {"COLOR_MTRC_BW" , COLOR_MTRC_BW}, {"COLOR_MTRC_AVGTS" , COLOR_MTRC_AVGTS}, {"COLOR_MTRC_CUMTS" , COLOR_MTRC_CUMTS}, {"COLOR_MTRC_MAXTS" , COLOR_MTRC_MAXTS}, {"COLOR_MTRC_PROT" , COLOR_MTRC_PROT}, {"COLOR_MTRC_MTHD" , COLOR_MTRC_MTHD}, {"COLOR_MTRC_DATA" , COLOR_MTRC_DATA}, {"COLOR_MTRC_HITS_PERC_MAX" , COLOR_MTRC_HITS_PERC_MAX}, {"COLOR_MTRC_VISITORS_PERC_MAX" , COLOR_MTRC_VISITORS_PERC_MAX}, {"COLOR_PANEL_COLS" , COLOR_PANEL_COLS}, {"COLOR_BARS" , COLOR_BARS}, {"COLOR_ERROR" , COLOR_ERROR}, {"COLOR_SELECTED" , COLOR_SELECTED}, {"COLOR_PANEL_ACTIVE" , COLOR_PANEL_ACTIVE}, {"COLOR_PANEL_HEADER" , COLOR_PANEL_HEADER}, {"COLOR_PANEL_DESC" , COLOR_PANEL_DESC}, {"COLOR_OVERALL_LBLS" , COLOR_OVERALL_LBLS}, {"COLOR_OVERALL_VALS" , COLOR_OVERALL_VALS}, {"COLOR_OVERALL_PATH" , COLOR_OVERALL_PATH}, {"COLOR_ACTIVE_LABEL" , COLOR_ACTIVE_LABEL}, {"COLOR_BG" , COLOR_BG}, {"COLOR_DEFAULT" , COLOR_DEFAULT}, {"COLOR_PROGRESS" , COLOR_PROGRESS}, }; static const char *colors256_mono[] = { "COLOR_MTRC_HITS color7:color-1", "COLOR_MTRC_VISITORS color8:color-1", "COLOR_MTRC_DATA color7:color-1", "COLOR_MTRC_BW color8:color-1", "COLOR_MTRC_AVGTS color8:color-1", "COLOR_MTRC_CUMTS color8:color-1", "COLOR_MTRC_MAXTS color8:color-1", "COLOR_MTRC_PROT color8:color-1", "COLOR_MTRC_MTHD color7:color-1", "COLOR_MTRC_HITS_PERC color0:color-1 bold", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC color1:color-1 bold OS", "COLOR_MTRC_HITS_PERC color1:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISIT_TIMES", "COLOR_MTRC_HITS_PERC_MAX color0:color-1 bold", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold OS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISIT_TIMES", "COLOR_MTRC_VISITORS_PERC color0:color-1 bold", "COLOR_MTRC_VISITORS_PERC_MAX color0:color-1 bold", "COLOR_PANEL_COLS color7:color-1", "COLOR_BARS color7:color-1", "COLOR_ERROR color7:color1", "COLOR_SELECTED color7:color8", "COLOR_PANEL_ACTIVE color0:color3", "COLOR_PANEL_HEADER color0:color7", "COLOR_PANEL_DESC color7:color-1", "COLOR_OVERALL_LBLS color7:color-1 bold", "COLOR_OVERALL_VALS color6:color-1 bold", "COLOR_OVERALL_PATH color3:color-1", "COLOR_ACTIVE_LABEL color4:color7", "COLOR_BG color7:color-1", "COLOR_DEFAULT color7:color-1", "COLOR_PROGRESS color0:color6", }; static const char *colors256_green[] = { "COLOR_MTRC_HITS color7:color-1", "COLOR_MTRC_VISITORS color8:color-1", "COLOR_MTRC_DATA color7:color-1", "COLOR_MTRC_BW color8:color-1", "COLOR_MTRC_AVGTS color8:color-1", "COLOR_MTRC_CUMTS color8:color-1", "COLOR_MTRC_MAXTS color8:color-1", "COLOR_MTRC_PROT color8:color-1", "COLOR_MTRC_MTHD color7:color-1", "COLOR_MTRC_HITS_PERC color0:color-1 bold", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC color1:color-1 bold OS", "COLOR_MTRC_HITS_PERC color1:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISIT_TIMES", "COLOR_MTRC_HITS_PERC_MAX color0:color-1 bold", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold OS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISIT_TIMES", "COLOR_MTRC_VISITORS_PERC color0:color-1 bold", "COLOR_MTRC_VISITORS_PERC_MAX color0:color-1 bold", "COLOR_PANEL_COLS color7:color-1", "COLOR_BARS color7:color-1", "COLOR_ERROR color7:color1", "COLOR_SELECTED color7:color8", "COLOR_PANEL_ACTIVE color0:color3", "COLOR_PANEL_HEADER color0:color35", "COLOR_PANEL_DESC color7:color-1", "COLOR_OVERALL_LBLS color7:color-1 bold", "COLOR_OVERALL_VALS color6:color-1 bold", "COLOR_OVERALL_PATH color3:color-1", "COLOR_ACTIVE_LABEL color7:color35", "COLOR_BG color7:color-1", "COLOR_DEFAULT color7:color-1", "COLOR_PROGRESS color0:color6", }; static const char *colors256_monokai[] = { "COLOR_MTRC_HITS color197:color-1", "COLOR_MTRC_VISITORS color148:color-1", "COLOR_MTRC_DATA color7:color-1", "COLOR_MTRC_BW color81:color-1", "COLOR_MTRC_AVGTS color247:color-1", "COLOR_MTRC_CUMTS color95:color-1", "COLOR_MTRC_MAXTS color186:color-1", "COLOR_MTRC_PROT color141:color-1", "COLOR_MTRC_MTHD color81:color-1", "COLOR_MTRC_HITS_PERC color186:color-1", "COLOR_MTRC_HITS_PERC color186:color-1 VISITORS", "COLOR_MTRC_HITS_PERC color186:color-1 OS", "COLOR_MTRC_HITS_PERC color186:color-1 BROWSERS", "COLOR_MTRC_HITS_PERC color186:color-1 VISIT_TIMES", "COLOR_MTRC_HITS_PERC_MAX color208:color-1", "COLOR_MTRC_HITS_PERC_MAX color208:color-1 VISITORS", "COLOR_MTRC_HITS_PERC_MAX color208:color-1 OS", "COLOR_MTRC_HITS_PERC_MAX color208:color-1 BROWSERS", "COLOR_MTRC_HITS_PERC_MAX color208:color-1 VISIT_TIMES", "COLOR_MTRC_VISITORS_PERC color187:color-1", "COLOR_MTRC_VISITORS_PERC_MAX color208:color-1", "COLOR_PANEL_COLS color242:color-1", "COLOR_BARS color186:color-1", "COLOR_ERROR color231:color197", "COLOR_SELECTED color0:color215", "COLOR_PANEL_ACTIVE color7:color240", "COLOR_PANEL_HEADER color7:color237", "COLOR_PANEL_DESC color242:color-1", "COLOR_OVERALL_LBLS color251:color-1", "COLOR_OVERALL_VALS color148:color-1", "COLOR_OVERALL_PATH color186:color-1", "COLOR_ACTIVE_LABEL color7:color237", "COLOR_BG color7:color-1", "COLOR_DEFAULT color7:color-1", "COLOR_PROGRESS color7:color141", }; static const char *colors8_mono[] = { "COLOR_MTRC_HITS color7:color-1", "COLOR_MTRC_VISITORS color0:color-1 bold", "COLOR_MTRC_DATA color7:color-1", "COLOR_MTRC_BW color0:color-1 bold", "COLOR_MTRC_AVGTS color0:color-1 bold", "COLOR_MTRC_CUMTS color0:color-1 bold", "COLOR_MTRC_MAXTS color0:color-1 bold", "COLOR_MTRC_PROT color0:color-1 bold", "COLOR_MTRC_MTHD color7:color-1 ", "COLOR_MTRC_HITS_PERC color0:color-1 bold", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC color1:color-1 bold OS", "COLOR_MTRC_HITS_PERC color1:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISIT_TIMES", "COLOR_MTRC_HITS_PERC_MAX color0:color-1 bold", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold OS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISIT_TIMES", "COLOR_MTRC_VISITORS_PERC color0:color-1 bold", "COLOR_MTRC_VISITORS_PERC_MAX color0:color-1 bold", "COLOR_PANEL_COLS color7:color-1", "COLOR_BARS color7:color-1", "COLOR_ERROR color7:color1", "COLOR_SELECTED color0:color7", "COLOR_PANEL_ACTIVE color0:color3", "COLOR_PANEL_HEADER color0:color7", "COLOR_PANEL_DESC color7:color-1", "COLOR_OVERALL_LBLS color7:color-1 bold", "COLOR_OVERALL_VALS color6:color-1", "COLOR_OVERALL_PATH color3:color-1", "COLOR_ACTIVE_LABEL color4:color7", "COLOR_BG color7:color-1", "COLOR_DEFAULT color7:color-1", "COLOR_PROGRESS color0:color6", }; static const char *colors8_green[] = { "COLOR_MTRC_HITS color7:color-1", "COLOR_MTRC_VISITORS color0:color-1 bold", "COLOR_MTRC_DATA color7:color-1", "COLOR_MTRC_BW color0:color-1 bold", "COLOR_MTRC_AVGTS color0:color-1 bold", "COLOR_MTRC_CUMTS color0:color-1 bold", "COLOR_MTRC_MAXTS color0:color-1 bold", "COLOR_MTRC_PROT color0:color-1 bold", "COLOR_MTRC_MTHD color7:color-1 ", "COLOR_MTRC_HITS_PERC color0:color-1 bold", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC color1:color-1 bold OS", "COLOR_MTRC_HITS_PERC color1:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC color1:color-1 bold VISIT_TIMES", "COLOR_MTRC_HITS_PERC_MAX color0:color-1 bold", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISITORS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold OS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold BROWSERS", "COLOR_MTRC_HITS_PERC_MAX color3:color-1 bold VISIT_TIMES", "COLOR_MTRC_VISITORS_PERC color0:color-1 bold", "COLOR_MTRC_VISITORS_PERC_MAX color0:color-1 bold", "COLOR_PANEL_COLS color7:color-1", "COLOR_BARS color2:color-1", "COLOR_ERROR color7:color1", "COLOR_SELECTED color0:color7", "COLOR_PANEL_ACTIVE color0:color3", "COLOR_PANEL_HEADER color0:color2", "COLOR_PANEL_DESC color7:color-1", "COLOR_OVERALL_LBLS color7:color-1 bold", "COLOR_OVERALL_VALS color6:color-1", "COLOR_OVERALL_PATH color3:color-1", "COLOR_ACTIVE_LABEL color0:color2", "COLOR_BG color7:color-1", "COLOR_DEFAULT color7:color-1", "COLOR_PROGRESS color0:color6", }; static const char *nocolors[] = { "COLOR_MTRC_HITS color0:color-1", "COLOR_MTRC_VISITORS color0:color-1", "COLOR_MTRC_DATA color0:color-1", "COLOR_MTRC_BW color0:color-1", "COLOR_MTRC_AVGTS color0:color-1", "COLOR_MTRC_CUMTS color0:color-1", "COLOR_MTRC_MAXTS color0:color-1", "COLOR_MTRC_PROT color0:color-1", "COLOR_MTRC_MTHD color0:color-1", "COLOR_MTRC_HITS_PERC color0:color-1", "COLOR_MTRC_HITS_PERC_MAX color0:color-1", "COLOR_MTRC_VISITORS_PERC color0:color-1", "COLOR_MTRC_VISITORS_PERC_MAX color0:color-1", "COLOR_PANEL_COLS color0:color-1", "COLOR_BARS color0:color-1", "COLOR_ERROR color0:color-1", "COLOR_SELECTED color0:color-1 reverse", "COLOR_PANEL_ACTIVE color0:color-1 reverse", "COLOR_PANEL_HEADER color0:color-1 reverse", "COLOR_PANEL_DESC color0:color-1", "COLOR_OVERALL_LBLS color0:color-1", "COLOR_OVERALL_VALS color0:color-1", "COLOR_OVERALL_PATH color0:color-1", "COLOR_ACTIVE_LABEL color0:color-1 reverse", "COLOR_BG color0:color-1", "COLOR_DEFAULT color0:color-1", "COLOR_PROGRESS color0:color-1 reverse", }; /* *INDENT-ON* */ /* Allocate memory for color elements */ static GColors * new_gcolors (void) { GColors *color = xcalloc (1, sizeof (GColors)); color->module = -1; return color; } /* Allocate memory for a color element properties */ static GColorPair * new_gcolorpair (void) { GColorPair *pair = xcalloc (1, sizeof (GColorPair)); /* Must be between 2 and COLOR_PAIRS-1. * Starts at 2 since COLOR_NORMAL has already been set */ pair->idx = 2; return pair; } /* Free malloc'd memory for color elements */ void free_color_lists (void) { if (pair_list) list_remove_nodes (pair_list); if (color_list) list_remove_nodes (color_list); color_list = NULL; pair_list = NULL; } /* Set a default color - COLOR_NORMAL, this will be used if * no colors are supported by the terminal */ void set_normal_color (void) { GColorPair *pair = new_gcolorpair (); GColors *color = new_gcolors (); pair->idx = 1; pair->fg = COLOR_WHITE; pair->bg = -1; color->pair = pair; color->item = COLOR_NORMAL; pair_list = list_create (pair); color_list = list_create (color); init_pair (pair->idx, pair->fg, pair->bg); } /* Get color properties for COLOR_OVERALL_LBLS */ GColors * color_overall_lbls (void) { return get_color (COLOR_OVERALL_LBLS); } /* Get color properties for COLOR_OVERALL_VALS */ GColors * color_overall_vals (void) { return get_color (COLOR_OVERALL_VALS); } /* Get color properties for COLOR_OVERALL_PATH */ GColors * color_overall_path (void) { return get_color (COLOR_OVERALL_PATH); } /* Get color properties for COLOR_PANEL_HEADER */ GColors * color_panel_header (void) { return get_color (COLOR_PANEL_HEADER); } /* Get color properties for COLOR_PANEL_DESC */ GColors * color_panel_desc (void) { return get_color (COLOR_PANEL_DESC); } /* Get color properties for COLOR_PANEL_ACTIVE*/ GColors * color_panel_active (void) { return get_color (COLOR_PANEL_ACTIVE); } /* Get color properties for COLOR_SELECTED */ GColors * color_selected (void) { return get_color (COLOR_SELECTED); } /* Get color properties for COLOR_PROGRESS */ GColors * color_progress (void) { return get_color (COLOR_PROGRESS); } /* Get color properties for COLOR_DEFAULT */ GColors * color_default (void) { return get_color (COLOR_DEFAULT); } /* Get color properties for COLOR_ERROR */ GColors * color_error (void) { return get_color (COLOR_ERROR); } /* Get the enumerated color given its equivalent color string. * * On error, -1 is returned. * On success, the enumerated color is returned. */ static int get_color_item_enum (const char *str) { return str2enum (CSTM_COLORS, ARRAY_SIZE (CSTM_COLORS), str); } /* Extract color number from the given config string. * * On error, -2 is returned. If color is greater than max colors, it aborts. * On success, the color number is returned. */ static int extract_color (char *color) { char *sEnd; int col = 0; if (strncasecmp (color, "color", 5) != 0) return -2; color += 5; col = strtol (color, &sEnd, 10); if (color == sEnd || *sEnd != '\0' || errno == ERANGE) return -2; /* ensure used color is supported by the terminal */ if (col > COLORS) FATAL ("Terminal doesn't support color: %d - max colors: %d", col, COLORS); return col; } /* Assign the background and foreground color number from the given * config string to GColorPair. * * On error, 1 is returned. * On success, 0 is returned. */ static int parse_bg_fg_color (GColorPair * pair, const char *value) { char bgcolor[COLOR_STR_LEN] = "", fgcolor[COLOR_STR_LEN] = ""; int ret = 0; if (sscanf (value, "%8[^:]:%8[^ ]", fgcolor, bgcolor) != 2) return 1; if ((pair->bg = extract_color (bgcolor)) == -2) ret = 1; if ((pair->fg = extract_color (fgcolor)) == -2) ret = 1; return ret; } /* Assign color attributes from the given config string to GColors. */ static void locate_attr_color (GColors * color, const char *attr) { if (strstr (attr, "bold")) color->attr |= A_BOLD; if (strstr (attr, "underline")) color->attr |= A_UNDERLINE; if (strstr (attr, "normal")) color->attr |= A_NORMAL; if (strstr (attr, "reverse")) color->attr |= A_REVERSE; if (strstr (attr, "standout")) color->attr |= A_REVERSE; if (strstr (attr, "blink")) color->attr |= A_BLINK; } /* Parse color attributes from the given config string. * * On error, 1 is returned. * On success, 0 is returned. */ static int parse_attr_color (GColors * color, const char *value) { char *line, *ptr, *start; int ret = 0; line = xstrdup (value); start = strchr (line, ' '); if ((!start) || (!*(start + 1))) { LOG_DEBUG (("attempted to parse color attr: %s\n", value)); goto clean; } start++; while (1) { if ((ptr = strpbrk (start, ", ")) != NULL) *ptr = 0; locate_attr_color (color, start); if (ptr == NULL) break; start = ptr + 1; } clean: free (line); return ret; } /* Parse color module from the given config string. * * On error, 1 is returned. * On success, 0 is returned. */ static int parse_module_color (GColors * color, const char *value) { char *line = xstrdup (value), *p; p = strrchr (line, ' '); if (!p || !*(p + 1)) { LOG_DEBUG (("attempted to parse color module: %s\n", value)); goto clean; } if ((color->module = get_module_enum (p + 1)) == -1) LOG_DEBUG (("attempted to parse color module: %s\n", value)); clean: free (line); return 0; } /* Find a color by item and module attributes on the list of already * parsed colors. * * If color exists, 1 is returned. * If color does not exist, 1 is returned. */ static int find_color_in_list (void *data, void *color) { GColors *new_color = color; GColors *old_color = data; if (old_color->item != new_color->item) return 0; if (old_color->module != new_color->module) return 0; return 1; } /* Find a color by foreground and background attributes on the list of * already parsed colors. * * If color exists, 1 is returned. * If color does not exist, 1 is returned. */ static int find_pair_in_list (void *data, void *color) { GColorPair *new_color = color; GColorPair *old_color = data; if (old_color->fg != new_color->fg) return 0; if (old_color->bg != new_color->bg) return 0; return 1; } /* Compare a color item (GColorItem) that has no module with the given needle * item. * * If the items match and with no module, 1 is returned. * If condition is not satisfied, 0 is returned. */ static int find_color_item_in_list (void *data, void *needle) { GColors *color = data; GColorItem *item = needle; return color->item == (GColorItem) (*(int *) item) && color->module == -1; } /* Compare a color item (GColorItem) and module with the given needle item. * * If the items match and with no module, 1 is returned. * If condition is not satisfied, 0 is returned. */ static int find_color_item_module_in_list (void *data, void *needle) { GColors *color = data; GColors *item = needle; return color->item == item->item && color->module == item->module; } /* Get color item properties given an item (enumerated). * * On error, it aborts. * On success, the color item properties are returned, or NULL if no match * found. */ GColors * get_color (GColorItem item) { GColorItem normal = COLOR_NORMAL; GSLList *match = NULL; if ((match = list_find (color_list, find_color_item_in_list, &item))) return (GColors *) match->data; if ((match = list_find (color_list, find_color_item_in_list, &normal))) return (GColors *) match->data; /* should not get here */ FATAL ("Unable to find color item %d", item); } /* Get color item properties given an item (enumerated) and its module. * * On error, it aborts. * On success, the color item properties are returned, or NULL if no match * found. */ GColors * get_color_by_item_module (GColorItem item, GModule module) { GColors *needle = new_gcolors (), *color = NULL; GSLList *match = NULL; needle->module = module; needle->item = item; /* find color for specific item/module pair */ if ((match = list_find (color_list, find_color_item_module_in_list, needle))) color = match->data; /* attempt to find color by item (fallback) */ if (!color) color = get_color (item); free (needle); return color; } /* Parse a color definition line from the config file. * * On error, it aborts. * On success, the color properties are assigned */ static void parse_color_line (GColorPair * pair, GColors * color, char *line) { char *val; int item = 0; size_t idx; /* key */ idx = strcspn (line, " \t"); if (strlen (line) == idx) FATAL ("Malformed color key at line: %s", line); line[idx] = '\0'; if ((item = get_color_item_enum (line)) == -1) FATAL ("Unable to find color key: %s", line); /* value */ val = line + (idx + 1); idx = strspn (val, " \t"); if (strlen (val) == idx) FATAL ("Malformed color value at line: %s", line); val = val + idx; /* get background/foreground color */ if (parse_bg_fg_color (pair, val) == 1) FATAL ("Invalid bg/fg color pairs at: %s %s", line, val); if (parse_attr_color (color, val) == 1) FATAL ("Invalid color attrs at: %s %s", line, val); if (parse_module_color (color, val) == 1) FATAL ("Invalid color module at: %s %s", line, val); color->item = item; } /* Attempt to prepend the given color on our color linked list. * * On error, or if color already exists, the given color is freed. * On success, or if not color found, store color properties */ static void prepend_color (GColors ** color) { GSLList *match = NULL; /* create a list of colors if one does not exist */ if (color_list == NULL) { color_list = list_create (*color); } /* attempt to find the given color data type (by item and attributes) in * our color list */ else if ((match = list_find (color_list, find_color_in_list, *color))) { /* if found, free the recently malloc'd color data type and use * existing color */ free (*color); *color = NULL; } else { /* not a dup, so insert the new color in our color list */ color_list = list_insert_prepend (color_list, *color); } } /* Parse a color definition line from the config file and store it on a signle * linked-list. * * On error, it aborts. * On success, the color properties are stored */ static void parse_color (char *line) { GSLList *match = NULL; GColors *color = NULL; GColorPair *pair = NULL; color = new_gcolors (); pair = new_gcolorpair (); /* extract a color pair and color attributes from the given config line */ parse_color_line (pair, color, line); /* create a pair color list if one doesn't exist */ if (pair_list == NULL) { pair_list = list_create (pair); } /* attempt to find the given color pair in our pair list */ else if ((match = list_find (pair_list, find_pair_in_list, pair))) { /* pair found, use new pair and free existing one */ free (pair); pair = (GColorPair *) match->data; } /* pair not found, use it then */ else { pair->idx += list_count (pair_list); pair_list = list_insert_prepend (pair_list, pair); } /* set color pair */ color->pair = pair; prepend_color (&color); /* if no color pair was found, then we init the color pair */ if (!match && color) init_pair (color->pair->idx, color->pair->fg, color->pair->bg); free (line); } /* Iterate over all color definitions in the config file. * * On error, it aborts. * On success, the color properties are parsed and stored */ static void parse_colors (const char *colors[], size_t n) { char *line; size_t i; for (i = 0; i < n; ++i) { line = strdup (colors[i]); /* did not find a valid format */ if (strchr (line, ':') == NULL) { free (line); continue; } parse_color (line); } } /* Use default color definitions if necessary. */ static void add_default_colors (void) { /* no colors */ if (COLORS < 8) parse_colors (nocolors, ARRAY_SIZE (nocolors)); /* 256 colors, and no color scheme set or set to monokai */ if (COLORS == 256 && (!conf.color_scheme || conf.color_scheme == MONOKAI)) parse_colors (colors256_monokai, ARRAY_SIZE (colors256_monokai)); /* otherwise use 16 colors scheme */ else if (COLORS > 16) { if (conf.color_scheme == STD_GREEN) parse_colors (colors256_green, ARRAY_SIZE (colors256_green)); else parse_colors (colors256_mono, ARRAY_SIZE (colors256_mono)); } /* 8 colors */ if (COLORS >= 8 && COLORS <= 16) { if (conf.color_scheme == STD_GREEN) parse_colors (colors8_green, ARRAY_SIZE (colors8_green)); else parse_colors (colors8_mono, ARRAY_SIZE (colors8_mono)); } } /* Entry point to parse color definitions or use default colors */ void set_colors (int force) { errno = 0; if (conf.color_idx > 0 && !force) parse_colors (conf.colors, conf.color_idx); else add_default_colors (); } goaccess-1.3/src/gmenu.c0000644000000000000000000000777213375657450012135 00000000000000/** * gmenu.c -- goaccess menus * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include "gmenu.h" #include "xmalloc.h" #include "ui.h" /* Allocate memory for a new GMenu instance. * * On success, the newly allocated GMenu is returned . */ GMenu * new_gmenu (WINDOW * parent, int h, int w, int y, int x) { GMenu *menu = xmalloc (sizeof (GMenu)); memset (menu, 0, sizeof *menu); menu->count = 0; menu->idx = 0; menu->multiple = 0; menu->selectable = 0; menu->start = 0; menu->status = 0; menu->h = h; menu->w = w; menu->x = x; menu->y = y; menu->win = derwin (parent, menu->h, menu->w, menu->y, menu->x); return menu; } /* Render actual menu item */ static void draw_menu_item (GMenu * menu, char *s, int x, int y, int w, int checked, GColors * (*func) (void)) { char check, *lbl = NULL; if (menu->selectable) { check = checked ? 'x' : ' '; lbl = xmalloc (snprintf (NULL, 0, "[%c] %s", check, s) + 1); sprintf (lbl, "[%c] %s", check, s); draw_header (menu->win, lbl, "%s", y, x, w, (*func)); free (lbl); } else { draw_header (menu->win, s, "%s", y, x, w, (*func)); } } /* Displays a menu to its associated window. * * On error, 1 is returned. * On success, the newly created menu is added to the window and 0 is * returned. */ int post_gmenu (GMenu * menu) { GColors *(*func) (void); int i = 0, j = 0, start, end, height, total, checked = 0; if (menu == NULL) return 1; werase (menu->win); height = menu->h; start = menu->start; total = menu->size; end = height < total ? start + height : total; for (i = start; i < end; i++, j++) { func = i == menu->idx ? color_selected : color_default; checked = menu->items[i].checked ? 1 : 0; draw_menu_item (menu, menu->items[i].name, 0, j, menu->w, checked, func); } wrefresh (menu->win); return 0; } /* Main work horse of the menu system processing input events */ void gmenu_driver (GMenu * menu, int c) { int i; switch (c) { case REQ_DOWN: if (menu->idx >= menu->size - 1) break; ++menu->idx; if (menu->idx >= menu->h && menu->idx >= menu->start + menu->h) menu->start++; post_gmenu (menu); break; case REQ_UP: if (menu->idx <= 0) break; --menu->idx; if (menu->idx < menu->start) --menu->start; post_gmenu (menu); break; case REQ_SEL: if (!menu->multiple) { for (i = 0; i < menu->size; i++) menu->items[i].checked = 0; } if (menu->items[menu->idx].checked) menu->items[menu->idx].checked = 0; else menu->items[menu->idx].checked = 1; post_gmenu (menu); break; } } goaccess-1.3/src/opesys.h0000644000000000000000000000321413375657450012334 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef OPESYS_H_INCLUDED #define OPESYS_H_INCLUDED #define OPESYS_TYPE_LEN 10 /* Each OS contains the number of hits and the OS's type */ typedef struct GOpeSys_ { char os_type[OPESYS_TYPE_LEN]; int hits; } GOpeSys; char *verify_os (const char *str, char *os_type); #endif goaccess-1.3/src/output.h0000644000000000000000000000565213375657450012362 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef OUTPUT_H_INCLUDED #define OUTPUT_H_INCLUDED #define MAX_PLOTS 5 /* number of metrics we can plot */ #include "commons.h" #include "parser.h" /* Enumerated chart types */ typedef enum GChartType_ { CHART_NONE, CHART_VBAR, CHART_AREASPLINE, } GChartType; /* Chart axis structure */ typedef struct GChartDef_ { const char *key; const char *value; } GChartDef; /* Chart axis structure */ typedef struct GChart_ { const char *key; GChartDef *def; } GChart; /* Chart behavior */ typedef struct GHTMLPlot_ { GChartType chart_type; void (*plot) (FILE * fp, struct GHTMLPlot_ plot, int sp); int8_t chart_reverse; int8_t redraw_expand; char *chart_key; char *chart_lbl; } GHTMLPlot; /* Controls HTML panel output. */ typedef struct GHTML_ { GModule module; int8_t table; void (*metrics) (FILE * fp, const struct GHTML_ * def, int sp); GHTMLPlot chart[MAX_PLOTS]; } GHTML; /* Metric definition . */ typedef struct GDefMetric_ { const char *cname; /* metric class name */ const char *cwidth; /* metric column width */ const char *datakey; /* metric JSON data key */ const char *datatype; /* metric data value type */ const char *lbl; /* metric label (column name) */ const char *metakey; /* metric JSON meta key */ const char *metatype; /* metric meta value type */ const char *metalbl; /* metric meta value label */ } GDefMetric; void output_html (GLog * glog, GHolder * holder, const char *filename); #endif goaccess-1.3/src/gstorage.h0000644000000000000000000000432313375657450012627 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GSTORAGE_H_INCLUDED #define GSTORAGE_H_INCLUDED #include "commons.h" /* Total number of storage metrics (GSMetric) */ #define GSMTRC_TOTAL 14 /* Enumerated Storage Metrics */ typedef enum GSMetric_ { MTRC_KEYMAP, MTRC_ROOTMAP, MTRC_DATAMAP, MTRC_UNIQMAP, MTRC_ROOT, MTRC_HITS, MTRC_VISITORS, MTRC_BW, MTRC_CUMTS, MTRC_MAXTS, MTRC_METHODS, MTRC_PROTOCOLS, MTRC_AGENTS, MTRC_METADATA, } GSMetric; GMetrics *new_gmetrics (void); int *int2ptr (int val); uint64_t *uint642ptr (uint64_t val); void *get_storage_metric_by_module (GModule module, GSMetric metric); void *get_storage_metric (GModule module, GSMetric metric); void set_data_metrics (GMetrics * ometrics, GMetrics ** nmetrics, GPercTotals totals); void set_module_totals (GModule module, GPercTotals * totals); #endif // for #ifndef GSTORAGE_H goaccess-1.3/src/tcabdb.h0000644000000000000000000001517213375657450012237 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef TCABDB_H_INCLUDED #define TCABDB_H_INCLUDED #include #include "gslist.h" #include "gstorage.h" #include "parser.h" #define DB_PARAMS 256 /* Metrics Storage */ /* Maps keys (string) to numeric values (integer). * This mitigates the issue of having multiple stores * with the same string key, and therefore, avoids unnecessary * memory usage (in most cases). * * HEAD|/index.php -> 1 * POST|/index.php -> 2 * Windows XP -> 3 * Ubuntu 10.10 -> 4 * GET|Ubuntu 10.10 -> 5 * Linux -> 6 * 26/Dec/2014 -> 7 * Windows -> 8 */ /* MTRC_KEYMAP */ /* Maps integer keys of root elements from the keymap hash * to actual string values. * * 6 -> Linux * 8 -> Windows */ /* MTRC_ROOTMAP */ /* Maps integer keys of data elements from the keymap hash * to actual string values. * * 1 -> /index.php * 2 -> /index.php * 3 -> Windows XP * 4 -> Ubuntu 10.10 * 5 -> Ubuntu 10.10 * 7 -> 26/Dec/2014 */ /* MTRC_DATAMAP */ /* Maps a string key made from the integer key of the * IP/date/UA and the integer key from the data field of * each module to numeric autoincremented values. e.g., "1|4" * => 1 -> unique visitor key (concatenated) with 4 -> data * key. * * "1|4" -> 1 * "1|5" -> 2 */ /* MTRC_UNIQMAP */ /* Maps integer key from the keymap hash to the number of * hits. * * 1 -> 10934 * 2 -> 3231 * 3 -> 500 * 4 -> 201 * 5 -> 206 */ /* MTRC_HITS */ /* Maps numeric keys made from the uniqmap store to autoincremented values * (counter). * 10 -> 100 * 40 -> 56 */ /* MTRC_VISITORS */ /* Maps numeric data keys to bandwidth (in bytes). * 1 -> 1024 * 2 -> 2048 */ /* MTRC_BW */ /* Maps numeric data keys to cumulative time served (in usecs/msecs). * 1 -> 187 * 2 -> 208 */ /* MTRC_CUMTS */ /* Maps numeric data keys to max time served (in usecs/msecs). * 1 -> 1287 * 2 -> 2308 */ /* MTRC_MAXTS */ /* Maps numeric data keys to string values. * 1 -> GET * 2 -> POST */ /* MTRC_METHODS */ /* Maps numeric data keys to string values. * 1 -> HTTP/1.1 * 2 -> HTTP/1.0 */ /* MTRC_PROTOCOLS */ /* Maps numeric unique user-agent keys to the * corresponding numeric value. * 1 -> 3 * 2 -> 4 */ /* MTRC_AGENTS */ /* Enumerated Storage Metrics */ typedef struct GTCStorageMetric_ { GSMetric metric; const char *dbname; char *dbpath; void *store; } GTCStorageMetric; /* Data Storage per module */ typedef struct GTCStorage_ { GModule module; GTCStorageMetric metrics[GSMTRC_TOTAL]; } GTCStorage; void free_agent_list (void); void free_storage (void); void init_storage (void); int ht_insert_agent_key (const char *key); int ht_insert_agent_value (int key, const char *value); int ht_insert_unique_key (const char *key); int ht_insert_agent (GModule module, int key, int value); int ht_insert_bw (GModule module, int key, uint64_t inc); int ht_insert_cumts (GModule module, int key, uint64_t inc); int ht_insert_datamap (GModule module, int key, const char *value); int ht_insert_genstats_accumulated_time (time_t elapsed); int ht_insert_genstats_bw (const char *key, uint64_t inc); int ht_insert_genstats (const char *key, int inc); int ht_insert_hits (GModule module, int key, int inc); int ht_insert_hostname (const char *ip, const char *host); int ht_insert_keymap (GModule module, const char *key); int ht_insert_maxts (GModule module, int key, uint64_t value); int ht_insert_meta_data (GModule module, const char *key, uint64_t value); int ht_insert_method (GModule module, int key, const char *value); int ht_insert_protocol (GModule module, int key, const char *value); int ht_insert_root (GModule module, int key, int value); int ht_insert_rootmap (GModule module, int key, const char *value); int ht_insert_uniqmap (GModule module, const char *key); int ht_insert_visitor (GModule module, int key, int inc); int ht_replace_genstats (const char *key, int value); uint32_t ht_get_size_datamap (GModule module); uint32_t ht_get_size_uniqmap (GModule module); char *ht_get_datamap (GModule module, int key); char *ht_get_host_agent_val (int key); char *ht_get_hostname (const char *host); char *ht_get_method (GModule module, int key); char *ht_get_protocol (GModule module, int key); char *ht_get_root (GModule module, int key); int ht_get_hits (GModule module, int key); int ht_get_keymap (GModule module, const char *key); int ht_get_uniqmap (GModule module, const char *key); int ht_get_visitors (GModule module, int key); uint32_t ht_get_genstats (const char *key); uint64_t ht_get_bw (GModule module, int key); uint64_t ht_get_cumts (GModule module, int key); uint64_t ht_get_genstats_bw (const char *key); uint64_t ht_get_maxts (GModule module, int key); uint64_t ht_get_meta_data (GModule module, const char *key); void ht_get_bw_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_cumts_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_hits_min_max (GModule module, int *min, int *max); void ht_get_maxts_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_visitors_min_max (GModule module, int *min, int *max); GSLList *tclist_to_gsllist (TCLIST * tclist); GSLList *ht_get_host_agent_list (GModule module, int key); TCLIST *ht_get_host_agent_tclist (GModule module, int key); GRawData *parse_raw_data (GModule module); /* *INDENT-ON* */ #endif goaccess-1.3/src/commons.h0000644000000000000000000001443713375662612012472 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef COMMONS_H_INCLUDED #define COMMONS_H_INCLUDED #include #include /* Remove the __attribute__ stuff when the compiler is not GCC. */ #if !__GNUC__ #define __attribute__(x) /**/ #endif #define GO_UNUSED __attribute__((unused)) #define GO_VERSION "1.3" #define GO_WEBSITE "http://goaccess.io/" struct tm *now_tm; /* common char array buffer size */ #define INIT_BUF_SIZE 1024 /* total number of modules */ #ifdef HAVE_GEOLOCATION #define TOTAL_MODULES 15 #else #define TOTAL_MODULES 14 #endif /* maximum number of items within a panel */ #define MAX_CHOICES 366 /* real-time */ #define MAX_CHOICES_RT 50 /* date and time length - e.g., 2016/12/12 12:12:12 -0600 */ #define DATE_TIME 25 + 1 /* date length - e.g., 2016/12/12 */ #define DATE_LEN 10 + 1 /* date length - e.g., 12:12:12 */ #define TIME_LEN 8 + 1 /* hour + ':' + min length - e.g., 12:12 */ #define HRMI_LEN 4 + 1 + 1 #define YR_FMT "%Y" #define MO_FMT "%M" #define DT_FMT "%d" /* maximum protocol string length */ #define REQ_PROTO_LEN 9 #define IGNORE_LEVEL_PANEL 1 #define IGNORE_LEVEL_REQ 2 /* Type of IP */ typedef enum { TYPE_IPINV, TYPE_IPV4, TYPE_IPV6 } GTypeIP; /* Type of Modules */ typedef enum MODULES { VISITORS, REQUESTS, REQUESTS_STATIC, NOT_FOUND, HOSTS, OS, BROWSERS, VISIT_TIMES, VIRTUAL_HOSTS, REFERRERS, REFERRING_SITES, KEYPHRASES, STATUS_CODES, REMOTE_USER, #ifdef HAVE_GEOLOCATION GEO_LOCATION, #endif } GModule; /* Metric totals. These are metrics that have a percent value and are * calculated values. */ typedef struct GPercTotals_ { int hits; /* total valid hits */ int visitors; /* total visitors */ uint64_t bw; /* total bandwidth */ } GPercTotals; /* Metrics within GHolder or GDashData */ typedef struct GMetrics { /* metric id can be used to identify * a specific data field */ uint8_t id; char *data; char *method; char *protocol; float hits_perc; float visitors_perc; float bw_perc; int hits; int visitors; /* holder has a numeric value, while * dashboard has a displayable string value */ union { char *sbw; uint64_t nbw; } bw; /* holder has a numeric value, while * dashboard has a displayable string value */ union { char *sts; uint64_t nts; } avgts; /* holder has a numeric value, while * dashboard has a displayable string value */ union { char *sts; uint64_t nts; } cumts; /* holder has a numeric value, while * dashboard has a displayable string value */ union { char *sts; uint64_t nts; } maxts; } GMetrics; /* Holder sub item */ typedef struct GSubItem_ { GModule module; GMetrics *metrics; struct GSubItem_ *prev; struct GSubItem_ *next; } GSubItem; /* Double linked-list of sub items */ typedef struct GSubList_ { int size; struct GSubItem_ *head; struct GSubItem_ *tail; } GSubList; /* Holder item */ typedef struct GHolderItem_ { GSubList *sub_list; GMetrics *metrics; } GHolderItem; /* Holder of GRawData */ typedef struct GHolder_ { GHolderItem *items; /* holder items */ GModule module; /* current module */ int idx; /* holder index */ int holder_size; /* number of allocated items */ int ht_size; /* size of the hash table/store */ int sub_items_size; /* number of sub items */ } GHolder; /* Enum-to-string */ typedef struct GEnum_ { const char *str; int idx; } GEnum; /* A metric can contain a root/data/uniq node id */ typedef struct GDataMap_ { int data; int root; } GDataMap; typedef struct GAgentItem_ { char *agent; } GAgentItem; typedef struct GAgents_ { int size; struct GAgentItem_ *items; } GAgents; #define FOREACH_MODULE(item, array) \ for (; (item < ARRAY_SIZE(array)) && array[item] != -1; ++item) /* Processing time */ extern time_t end_proc; extern time_t timestamp; extern time_t start_proc; /* list of available modules/panels */ extern int module_list[TOTAL_MODULES]; /* *INDENT-OFF* */ GAgentItem *new_gagent_item (uint32_t size); GAgents *new_gagents (void); void free_agents_array (GAgents *agents); float get_percentage (unsigned long long total, unsigned long long hit); int get_max_choices (void); int get_module_enum (const char *str); int has_timestamp (const char *fmt); int str2enum (const GEnum map[], int len, const char *str); int enable_panel (GModule mod); int get_module_index (int module); int get_next_module (GModule module); int get_prev_module (GModule module); int ignore_panel (GModule mod); int init_modules (void); int remove_module(GModule module); uint32_t get_num_modules (void); void verify_panels (void); char *get_log_source_str (int max_len); intmax_t get_log_sizes (void); void display_default_config_file (void); void display_storage (void); void display_version (void); /* *INDENT-ON* */ #endif goaccess-1.3/src/json.h0000644000000000000000000000470013375657450011764 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef JSON_H_INCLUDED #define JSON_H_INCLUDED #define TAB "\t\t\t\t\t\t\t\t\t\t\t" #define NL "\n\n\n" #include "parser.h" typedef struct GJSON_ { char *buf; /* pointer to buffer */ size_t size; /* size of malloc'd buffer */ size_t offset; /* current write offset */ } GJSON; char *get_json (GLog * glog, GHolder * holder, int escape_html); void output_json (GLog * glog, GHolder * holder, const char *filename); void set_json_nlines (int nl); void fpskeyival (FILE * fp, const char *key, int val, int sp, int last); void fpskeysval (FILE * fp, const char *key, const char *val, int sp, int last); void fpskeyaval (FILE * fp, const char *key, const char *val, int sp, int last); void fpclose_arr (FILE * fp, int sp, int last); void fpclose_obj (FILE * fp, int iisp, int last); void fpjson (FILE * fp, const char *fmt, ...); void fpopen_arr_attr (FILE * fp, const char *attr, int sp); void fpopen_obj_attr (FILE * fp, const char *attr, int sp); void fpopen_obj (FILE * fp, int iisp); #endif goaccess-1.3/src/gwsocket.h0000644000000000000000000000526213375657450012645 00000000000000/** * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GWSOCKET_H_INCLUDED #define GWSOCKET_H_INCLUDED #define GW_VERSION "0.1" #include #include "websocket.h" typedef struct GWSReader_ { int fd; int self_pipe[2]; /* self-pipe */ pthread_mutex_t mutex; /* Mutex fifo out */ pthread_t thread; /* Thread fifo in */ WSPacket *packet; /* FIFO data's buffer */ char hdr[HDR_SIZE]; /* FIFO header's buffer */ int hlen; /* header length */ } GWSReader; typedef struct GWSWriter_ { int fd; pthread_mutex_t mutex; /* Mutex fifo in */ pthread_t thread; /* Thread fifo out */ WSServer *server; /* WebSocket server */ } GWSWriter; GWSReader *new_gwsreader (void); GWSWriter *new_gwswriter (void); int broadcast_holder (int fd, const char *buf, int len); int open_fifoin (void); int open_fifoout (void); int read_fifo (GWSReader * gwsreader, fd_set rfds, fd_set wfds, void (*f) (int)); int send_holder_to_client (int fd, int listener, const char *buf, int len); int setup_ws_server (GWSWriter * gwswriter, GWSReader * gwsreader); void set_ready_state (void); void set_self_pipe (int *self_pipe); void stop_ws_server (GWSWriter * gwswriter, GWSReader * gwsreader); #endif // for #ifndef GWSOCKET_H goaccess-1.3/src/options.h0000644000000000000000000000310713375657450012506 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef OPTIONS_H_INCLUDED #define OPTIONS_H_INCLUDED void add_dash_filename (void); void cmd_help (void); void read_option_args (int argc, char **argv); void verify_global_config (int argc, char **argv); #endif goaccess-1.3/src/geoip1.c0000644000000000000000000002771213375657450012202 00000000000000/** * geoip.c -- implementation of GeoIP * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifdef HAVE_LIBGEOIP #include #include #endif #include "geoip1.h" #include "error.h" #include "util.h" static GeoIP *geo_location_data; /* Determine if we have a valid geoip resource. * * If the geoip resource is NULL, 0 is returned. * If the geoip resource is valid and malloc'd, 1 is returned. */ int is_geoip_resource (void) { return geo_location_data != NULL ? 1 : 0; } /* Free up GeoIP resources */ void geoip_free (void) { if (!is_geoip_resource ()) return; GeoIP_delete (geo_location_data); GeoIP_cleanup (); } /* Open the given GeoLocation database and set its charset. * * On error, it aborts. * On success, a new geolocation structure is returned. */ static GeoIP * geoip_open_db (const char *db) { GeoIP *geoip; geoip = GeoIP_open (db, GEOIP_MEMORY_CACHE); if (geoip == NULL) FATAL ("Unable to open GeoIP database: %s\n", db); GeoIP_set_charset (geoip, GEOIP_CHARSET_UTF8); LOG_DEBUG (("Opened GeoIP City database: %s\n", db)); return geoip; } /* Set up and open GeoIP database */ void init_geoip (void) { /* open custom city GeoIP database */ if (conf.geoip_database != NULL) geo_location_data = geoip_open_db (conf.geoip_database); /* fall back to legacy GeoIP database */ else geo_location_data = GeoIP_new (conf.geo_db); } /* Get continent name concatenated with code. * * If continent not found, "Unknown" is returned. * On success, the continent code & name is returned . */ static const char * get_continent_name_and_code (const char *continentid) { if (memcmp (continentid, "NA", 2) == 0) return "NA North America"; else if (memcmp (continentid, "OC", 2) == 0) return "OC Oceania"; else if (memcmp (continentid, "EU", 2) == 0) return "EU Europe"; else if (memcmp (continentid, "SA", 2) == 0) return "SA South America"; else if (memcmp (continentid, "AF", 2) == 0) return "AF Africa"; else if (memcmp (continentid, "AN", 2) == 0) return "AN Antarctica"; else if (memcmp (continentid, "AS", 2) == 0) return "AS Asia"; else return "-- Unknown"; } /* Compose a string with the country name and code and store it in the * given buffer. */ static void geoip_set_country (const char *country, const char *code, char *loc) { if (country && code) snprintf (loc, COUNTRY_LEN, "%s %s", code, country); else snprintf (loc, COUNTRY_LEN, "%s", "Unknown"); } /* Compose a string with the city name and state/region and store it * in the given buffer. */ static void geoip_set_city (const char *city, const char *region, char *loc) { snprintf (loc, CITY_LEN, "%s, %s", city ? city : "N/A City", region ? region : "N/A Region"); } /* Compose a string with the continent name and store it in the given * buffer. */ static void geoip_set_continent (const char *continent, char *loc) { if (continent) snprintf (loc, CONTINENT_LEN, "%s", get_continent_name_and_code (continent)); else snprintf (loc, CONTINENT_LEN, "%s", "Unknown"); } /* Get detailed information found in the GeoIP Database about the * given IPv4 or IPv6. * * On error, NULL is returned * On success, GeoIPRecord structure is returned */ static GeoIPRecord * get_geoip_record (const char *addr, GTypeIP type_ip) { GeoIPRecord *rec = NULL; if (TYPE_IPV4 == type_ip) rec = GeoIP_record_by_name (geo_location_data, addr); else if (TYPE_IPV6 == type_ip) rec = GeoIP_record_by_name_v6 (geo_location_data, addr); return rec; } /* Set country data by record into the given `location` buffer based * on the IP version. */ static void geoip_set_country_by_record (const char *ip, char *location, GTypeIP type_ip) { GeoIPRecord *rec = NULL; const char *country = NULL, *code = NULL, *addr = ip; if (conf.geoip_database == NULL || geo_location_data == NULL) return; /* Custom GeoIP database */ if ((rec = get_geoip_record (addr, type_ip))) { country = rec->country_name; code = rec->country_code; } geoip_set_country (country, code, location); if (rec != NULL) { GeoIPRecord_delete (rec); } } /* Get the GeoIP location id by name. * * On error, 0 is returned * On success, the GeoIP location id is returned */ static int geoip_get_geoid (const char *addr, GTypeIP type_ip) { int geoid = 0; if (TYPE_IPV4 == type_ip) geoid = GeoIP_id_by_name (geo_location_data, addr); else if (TYPE_IPV6 == type_ip) geoid = GeoIP_id_by_name_v6 (geo_location_data, addr); return geoid; } /* Get the country name by GeoIP location id. * * On error, NULL is returned * On success, the country name is returned */ static const char * geoip_get_country_by_geoid (const char *addr, GTypeIP type_ip) { const char *country = NULL; if (TYPE_IPV4 == type_ip) country = GeoIP_country_name_by_name (geo_location_data, addr); else if (TYPE_IPV6 == type_ip) country = GeoIP_country_name_by_name_v6 (geo_location_data, addr); return country; } /* Set country data by geoid into the given `location` buffer based on * the IP version. */ static void geoip_set_country_by_geoid (const char *ip, char *location, GTypeIP type_ip) { const char *country = NULL, *code = NULL, *addr = ip; int geoid = 0; if (!is_geoip_resource ()) return; if (!(country = geoip_get_country_by_geoid (addr, type_ip))) goto out; /* return two letter country code */ if (!(geoid = geoip_get_geoid (addr, type_ip))) goto out; code = GeoIP_code_by_id (geoid); out: geoip_set_country (country, code, location); } /* Set country data by geoid or record into the given `location` buffer * based on the IP version and currently used database edition. */ void geoip_get_country (const char *ip, char *location, GTypeIP type_ip) { unsigned char rec = GeoIP_database_edition (geo_location_data); switch (rec) { case GEOIP_COUNTRY_EDITION: if (TYPE_IPV4 == type_ip) geoip_set_country_by_geoid (ip, location, TYPE_IPV4); else geoip_set_country (NULL, NULL, location); break; case GEOIP_COUNTRY_EDITION_V6: if (TYPE_IPV6 == type_ip) geoip_set_country_by_geoid (ip, location, TYPE_IPV6); else geoip_set_country (NULL, NULL, location); break; case GEOIP_CITY_EDITION_REV0: case GEOIP_CITY_EDITION_REV1: if (TYPE_IPV4 == type_ip) geoip_set_country_by_record (ip, location, TYPE_IPV4); else geoip_set_country (NULL, NULL, location); break; case GEOIP_CITY_EDITION_REV0_V6: case GEOIP_CITY_EDITION_REV1_V6: if (TYPE_IPV6 == type_ip) geoip_set_country_by_record (ip, location, TYPE_IPV6); else geoip_set_country (NULL, NULL, location); break; } } /* Set continent data by record into the given `location` buffer based * on the IP version. */ static void geoip_set_continent_by_record (const char *ip, char *location, GTypeIP type_ip) { GeoIPRecord *rec = NULL; const char *continent = NULL, *addr = ip; if (conf.geoip_database == NULL || geo_location_data == NULL) return; /* Custom GeoIP database */ if ((rec = get_geoip_record (addr, type_ip))) continent = rec->continent_code; geoip_set_continent (continent, location); if (rec != NULL) { GeoIPRecord_delete (rec); } } /* Set continent data by geoid into the given `location` buffer based * on the IP version. */ static void geoip_set_continent_by_geoid (const char *ip, char *location, GTypeIP type_ip) { const char *continent = NULL, *addr = ip; int geoid = 0; if (!is_geoip_resource ()) return; if (!(geoid = geoip_get_geoid (addr, type_ip))) goto out; continent = GeoIP_continent_by_id (geoid); out: geoip_set_continent (continent, location); } /* Set continent data by geoid or record into the given `location` buffer * based on the IP version and currently used database edition. */ void geoip_get_continent (const char *ip, char *location, GTypeIP type_ip) { unsigned char rec = GeoIP_database_edition (geo_location_data); switch (rec) { case GEOIP_COUNTRY_EDITION: if (TYPE_IPV4 == type_ip) geoip_set_continent_by_geoid (ip, location, TYPE_IPV4); else geoip_set_continent (NULL, location); break; case GEOIP_COUNTRY_EDITION_V6: if (TYPE_IPV6 == type_ip) geoip_set_continent_by_geoid (ip, location, TYPE_IPV6); else geoip_set_continent (NULL, location); break; case GEOIP_CITY_EDITION_REV0: case GEOIP_CITY_EDITION_REV1: if (TYPE_IPV4 == type_ip) geoip_set_continent_by_record (ip, location, TYPE_IPV4); else geoip_set_continent (NULL, location); break; case GEOIP_CITY_EDITION_REV0_V6: case GEOIP_CITY_EDITION_REV1_V6: if (TYPE_IPV6 == type_ip) geoip_set_continent_by_record (ip, location, TYPE_IPV6); else geoip_set_continent (NULL, location); break; } } /* Set city data by record into the given `location` buffer based on * the IP version. */ static void geoip_set_city_by_record (const char *ip, char *location, GTypeIP type_ip) { GeoIPRecord *rec = NULL; const char *city = NULL, *region = NULL, *addr = ip; /* Custom GeoIP database */ if ((rec = get_geoip_record (addr, type_ip))) { city = rec->city; region = rec->region; } geoip_set_city (city, region, location); if (rec != NULL) { GeoIPRecord_delete (rec); } } /* Set city data by geoid or record into the given `location` buffer * based on the IP version and currently used database edition. * It uses the custom GeoIP database - i.e., GeoLiteCity.dat */ void geoip_get_city (const char *ip, char *location, GTypeIP type_ip) { unsigned char rec = GeoIP_database_edition (geo_location_data); if (conf.geoip_database == NULL || geo_location_data == NULL) return; switch (rec) { case GEOIP_CITY_EDITION_REV0: case GEOIP_CITY_EDITION_REV1: if (TYPE_IPV4 == type_ip) geoip_set_city_by_record (ip, location, TYPE_IPV4); else geoip_set_city (NULL, NULL, location); break; case GEOIP_CITY_EDITION_REV0_V6: case GEOIP_CITY_EDITION_REV1_V6: if (TYPE_IPV6 == type_ip) geoip_set_city_by_record (ip, location, TYPE_IPV6); else geoip_set_city (NULL, NULL, location); break; } } /* Entry point to set GeoIP location into the corresponding buffers, * (continent, country, city). * * On error, 1 is returned * On success, buffers are set and 0 is returned */ int set_geolocation (char *host, char *continent, char *country, char *city) { int type_ip = 0; if (!is_geoip_resource ()) return 1; if (invalid_ipaddr (host, &type_ip)) return 1; geoip_get_country (host, country, type_ip); geoip_get_continent (host, continent, type_ip); if (conf.geoip_database) geoip_get_city (host, city, type_ip); return 0; } goaccess-1.3/src/tcabdb.c0000644000000000000000000011432513375657450012232 00000000000000/** * tcabdb.c -- Tokyo Cabinet database functions * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include "tcabdb.h" #include "tcbtdb.h" #ifdef HAVE_GEOLOCATION #include "geoip1.h" #endif #include "error.h" #include "sort.h" #include "util.h" #include "xmalloc.h" /* Hash tables storage */ static GTCStorage *tc_storage; /* tables for the whole app */ static TCADB *ht_agent_keys = NULL; static TCADB *ht_agent_vals = NULL; static TCADB *ht_general_stats = NULL; static TCADB *ht_hostnames = NULL; static TCADB *ht_unique_keys = NULL; /* db paths for whole app hashes */ static char *dbpath_agent_keys = NULL; static char *dbpath_agent_vals = NULL; static char *dbpath_general_stats = NULL; static char *dbpath_hostnames = NULL; static char *dbpath_unique_keys = NULL; /* Instantiate a new store */ static GTCStorage * new_tcstorage (uint32_t size) { GTCStorage *storage = xcalloc (size, sizeof (GTCStorage)); return storage; } /* Open a concrete database */ static int tc_adb_open (TCADB * adb, const char *params) { /* attempt to open the database */ if (!tcadbopen (adb, params)) return 1; return 0; } /* Close the database handle */ static int tc_db_close (TCADB * adb, char *dbname) { if (adb == NULL) return 1; /* close the database */ if (!tcadbclose (adb)) FATAL ("Unable to close DB: %s", dbname); /* delete the object */ tcadbdel (adb); #ifdef TCB_BTREE /* remove database file */ if (!conf.keep_db_files && !tcremovelink (dbname)) LOG_DEBUG (("Unable to remove DB: %s\n", dbname)); #endif free (dbname); return 0; } /* Setup a database given the file path and open it up */ static TCADB * tc_adb_create (char *path) { char params[DB_PARAMS] = ""; TCADB *adb = tcadbnew (); #ifdef TCB_MEMHASH xstrncpy (params, path, DB_PARAMS); #endif #ifdef TCB_BTREE tc_db_get_params (params, path); #endif if (tc_adb_open (adb, params)) { free (path); LOG_DEBUG (("params: %s", params)); FATAL ("Unable to open an abstract database: %s", params); } return adb; } /* Get the file path for the given a database name */ static char * get_dbname (const char *dbname, int module) { char *path = NULL; #ifdef TCB_MEMHASH (void) dbname; (void) module; path = alloc_string ("*"); #endif #ifdef TCB_BTREE path = tc_db_set_path (dbname, module); #endif return path; } /* Create hashes used across the whole app (not per module) */ static void create_prog_tables (void) { ht_agent_keys = tc_adb_create (dbpath_agent_keys); ht_agent_vals = tc_adb_create (dbpath_agent_vals); ht_general_stats = tc_adb_create (dbpath_general_stats); ht_hostnames = tc_adb_create (dbpath_hostnames); ht_unique_keys = tc_adb_create (dbpath_unique_keys); } /* Set db paths for hashes used across the whole app (not per module) */ static void set_prog_tables_dbpaths (void) { dbpath_agent_keys = get_dbname (DB_AGENT_KEYS, -1); dbpath_agent_vals = get_dbname (DB_AGENT_VALS, -1); dbpath_general_stats = get_dbname (DB_GEN_STATS, -1); dbpath_hostnames = get_dbname (DB_HOSTNAMES, -1); dbpath_unique_keys = get_dbname (DB_UNIQUE_KEYS, -1); } /* Free hashes used across the whole app (not per module) */ static void free_prog_tables (void) { tc_db_close (ht_agent_keys, dbpath_agent_keys); tc_db_close (ht_agent_vals, dbpath_agent_vals); tc_db_close (ht_general_stats, dbpath_general_stats); tc_db_close (ht_hostnames, dbpath_hostnames); tc_db_close (ht_unique_keys, dbpath_unique_keys); } /* Initialize map & metric hashes */ static void init_tables (GModule module) { GTCStorageMetric mtrc; int n = 0, i; /* *INDENT-OFF* */ GTCStorageMetric metrics[] = { {MTRC_KEYMAP , DB_KEYMAP , NULL, NULL} , {MTRC_ROOTMAP , DB_ROOTMAP , NULL, NULL} , {MTRC_DATAMAP , DB_DATAMAP , NULL, NULL} , {MTRC_UNIQMAP , DB_UNIQMAP , NULL, NULL} , {MTRC_ROOT , DB_ROOT , NULL, NULL} , {MTRC_HITS , DB_HITS , NULL, NULL} , {MTRC_VISITORS , DB_VISITORS , NULL, NULL} , {MTRC_BW , DB_BW , NULL, NULL} , {MTRC_CUMTS , DB_CUMTS , NULL, NULL} , {MTRC_MAXTS , DB_MAXTS , NULL, NULL} , {MTRC_METHODS , DB_METHODS , NULL, NULL} , {MTRC_PROTOCOLS , DB_PROTOCOLS , NULL, NULL} , {MTRC_AGENTS , DB_AGENTS , NULL, NULL} , {MTRC_METADATA , DB_METADATA , NULL, NULL} , }; /* *INDENT-ON* */ n = ARRAY_SIZE (metrics); for (i = 0; i < n; i++) { mtrc = metrics[i]; #ifdef TCB_MEMHASH mtrc.dbpath = get_dbname (mtrc.dbname, module); mtrc.store = tc_adb_create (mtrc.dbpath); #endif #ifdef TCB_BTREE /* allow for duplicate keys */ if (mtrc.metric == MTRC_AGENTS) { mtrc.dbpath = tc_db_set_path (DB_AGENTS, module); mtrc.store = tc_bdb_create (mtrc.dbpath); } else { mtrc.dbpath = get_dbname (mtrc.dbname, module); mtrc.store = tc_adb_create (mtrc.dbpath); } #endif tc_storage[module].metrics[i] = mtrc; } } /* Initialize hash tables */ void init_storage (void) { GModule module; size_t idx = 0; set_prog_tables_dbpaths (); create_prog_tables (); tc_storage = new_tcstorage (TOTAL_MODULES); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; tc_storage[module].module = module; init_tables (module); } } /* Destroys the hash structure allocated metrics */ static void free_metrics (GModule module) { int i; GTCStorageMetric mtrc; for (i = 0; i < GSMTRC_TOTAL; i++) { mtrc = tc_storage[module].metrics[i]; #ifdef TCB_MEMHASH tc_db_close (mtrc.store, mtrc.dbpath); #endif #ifdef TCB_BTREE if (mtrc.metric == MTRC_AGENTS) tc_bdb_close (mtrc.store, mtrc.dbpath); else tc_db_close (mtrc.store, mtrc.dbpath); #endif } } /* Destroys the hash structure and its content */ void free_storage (void) { size_t idx = 0; if (!tc_storage) return; free_prog_tables (); FOREACH_MODULE (idx, module_list) { free_metrics (module_list[idx]); } free (tc_storage); #ifdef TCB_BTREE tc_db_rmdir (); #endif } static uint32_t ht_get_size (TCADB * adb) { return tcadbrnum (adb); } /* Given a module and a metric, get the hash table * * On error, or if table is not found, NULL is returned. * On success the hash structure pointer is returned. */ static void * get_hash (GModule module, GSMetric metric) { void *hash = NULL; int i; GTCStorageMetric mtrc; if (!tc_storage) return NULL; for (i = 0; i < GSMTRC_TOTAL; i++) { mtrc = tc_storage[module].metrics[i]; if (mtrc.metric != metric) continue; hash = mtrc.store; break; } return hash; } /* Insert a string key and the corresponding int value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_si32 (void *hash, const char *key, int value) { if (!hash) return -1; /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, key, strlen (key), &value, sizeof (int))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert an int key and the corresponding string value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_is32 (void *hash, int key, const char *value) { if (!hash) return -1; /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, &key, sizeof (int), value, strlen (value))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert a string key and the corresponding string value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_ss32 (void *hash, const char *key, const char *value) { if (!hash) return -1; /* if key exists in the database, it is overwritten */ if (!tcadbput2 (hash, key, value)) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert an int key and an int value * Note: If the key exists, its value is replaced by the given value. * * On error, -1 is returned. * On success 0 is returned */ static int ins_ii32 (void *hash, int key, int value) { if (!hash) return -1; /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, &key, sizeof (int), &value, sizeof (int))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert an int key and a uint64_t value * Note: If the key exists, its value is replaced by the given value. * * On error, -1 is returned. * On success 0 is returned */ static int ins_iu64 (void *hash, int key, uint64_t value) { if (!hash) return -1; /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, &key, sizeof (int), &value, sizeof (uint64_t))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Increase an int value given an int key. * Note: If the key exists, its value is increased by the given inc. * * On error, -1 is returned. * On success 0 is returned */ static int inc_ii32 (void *hash, int key, int inc) { if (!hash) return -1; /* if key exists in the database, it is incremented */ if (tcadbaddint (hash, &key, sizeof (int), inc) == INT_MIN) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Increase a uint64_t value given an int key. * Note: If the key exists, its value is increased by the given inc. * * On error, -1 is returned. * On success 0 is returned */ static int inc_iu64 (void *hash, int key, uint64_t inc) { int sp; uint64_t value = inc; void *ptr; if (!hash) return -1; if ((ptr = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) { value = (*(uint64_t *) ptr) + inc; free (ptr); } /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, &key, sizeof (int), &value, sizeof (uint64_t))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert a string key and auto increment its value. * * On error, -1 is returned. * On success the value of the key inserted is returned */ static int inc_si32 (void *hash, const char *key, int inc) { int value = inc, sp; void *ptr; if (!hash) return -1; if ((ptr = tcadbget (hash, key, strlen (key), &sp)) != NULL) { value = (*(int *) ptr) + inc; free (ptr); } /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, key, strlen (key), &value, sizeof (int))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert a string key and auto increment by uint64_t value. * * On error, -1 is returned. * On success the value of the key is inserted and 0 is returned */ static int inc_su64 (void *hash, const char *key, uint64_t inc) { int sp; uint64_t value = inc; void *ptr; if (!hash) return -1; if ((ptr = tcadbget (hash, key, strlen (key), &sp)) != NULL) { value = (*(uint64_t *) ptr) + inc; free (ptr); } /* if key exists in the database, it is overwritten */ if (!tcadbput (hash, key, strlen (key), &value, sizeof (uint64_t))) LOG_DEBUG (("Unable to tcadbput\n")); return 0; } /* Insert a string key and auto increment int value. * * On error, -1 is returned. * On success the value of the key inserted is returned */ static int ins_si32_ai (void *hash, const char *key) { int size = 0, value = 0; if (!hash) return -1; size = ht_get_size (hash); /* the auto increment value starts at SIZE (hash table) + 1 */ value = size > 0 ? size + 1 : 1; if (ins_si32 (hash, key, value) == -1) return -1; return value; } #ifdef TCB_MEMHASH /* Compare if the given needle is in the haystack * * if equal, 1 is returned, else 0 */ static int find_int_key_in_list (void *data, void *needle) { return (*(int *) data) == (*(int *) needle) ? 1 : 0; } /* Insert an int key and the corresponding GSLList (Single linked-list) value. * Note: If the key exists within the list, the value is not appended. * * On error, -1 is returned. * On success 0 is returned */ static int ins_igsl (void *hash, int key, int value) { GSLList *list, *match; int sp; if (!hash) return -1; /* key found, check if key exists within the list */ if ((list = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) { if ((match = list_find (list, find_int_key_in_list, &value))) goto out; list = list_insert_prepend (list, int2ptr (value)); } else { list = list_create (int2ptr (value)); } if (!tcadbput (hash, &key, sizeof (int), list, sizeof (GSLList))) LOG_DEBUG (("Unable to tcadbput\n")); out: free (list); return 0; } #endif /* Get the int value of a given string key. * * On error, or if key is not found, -1 is returned. * On success the int value for the given key is returned */ static int get_si32 (void *hash, const char *key) { int ret = 0, sp; void *ptr; if (!hash) return -1; /* key found, return current value */ if ((ptr = tcadbget (hash, key, strlen (key), &sp)) != NULL) { ret = (*(int *) ptr); free (ptr); return ret; } return -1; } /* Get the unsigned int value of a given string key. * * On error, or if key is not found, 0 is returned. * On success the uint32_t value for the given key is returned */ static uint32_t get_sui32 (void *hash, const char *key) { int ret = 0, sp; void *ptr; if (!hash) return 0; /* key found, return current value */ if ((ptr = tcadbget (hash, key, strlen (key), &sp)) != NULL) { ret = (*(uint32_t *) ptr); free (ptr); return ret; } return 0; } /* Get the uint64_t value of a given string key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ static uint64_t get_su64 (void *hash, const char *key) { int sp; uint64_t ret = 0; void *ptr; if (!hash) return 0; /* key found, return current value */ if ((ptr = tcadbget (hash, key, strlen (key), &sp)) != NULL) { ret = (*(uint64_t *) ptr); free (ptr); return ret; } return 0; } /* Iterate over all the key/value pairs for the given hash structure * and set the maximum and minimum values found on an integer key and * integer value. * * Note: This are expensive calls since it has to iterate over all * key-value pairs * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ static void get_ii32_min_max (void *hash, int *min, int *max) { int curvalue = 0, i = 0, ksize = 0, sp = 0; void *key, *ptr; tcadbiterinit (hash); while ((key = tcadbiternext (hash, &ksize)) != NULL) { if ((ptr = tcadbget (hash, key, ksize, &sp)) == NULL) { free (key); continue; } curvalue = (*(int *) ptr); if (i++ == 0) *min = curvalue; if (curvalue > *max) *max = curvalue; if (curvalue < *min) *min = curvalue; free (key); free (ptr); } } /* Iterate over all the key/value pairs for the given hash structure * and set the maximum and minimum values found on an integer key and * a uint64_t value. * * Note: This are expensive calls since it has to iterate over all * key-value pairs * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ static void get_iu64_min_max (void *hash, uint64_t * min, uint64_t * max) { int i = 0, ksize = 0, sp = 0; uint64_t curvalue = 0; void *key, *ptr; tcadbiterinit (hash); while ((key = tcadbiternext (hash, &ksize)) != NULL) { if ((ptr = tcadbget (hash, key, ksize, &sp)) == NULL) { free (key); continue; } curvalue = (*(uint64_t *) ptr); if (i++ == 0) *min = curvalue; if (curvalue > *max) *max = curvalue; if (curvalue < *min) *min = curvalue; free (key); free (ptr); } } /* Get the string value of a given int key. * * On error, or if key is not found, NULL is returned. * On success the string value for the given key is returned */ static char * get_is32 (void *hash, int key) { int sp; char *value = NULL; if (!hash) return NULL; if ((value = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) return value; return NULL; } /* Get the string value of a given string key. * * On error, or if key is not found, NULL is returned. * On success the string value for the given key is returned */ static char * get_ss32 (void *hash, const char *key) { char *value = NULL; if (!hash) return NULL; if ((value = tcadbget2 (hash, key)) != NULL) return value; return NULL; } /* Get the int value of a given int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ static int get_ii32 (void *hash, int key) { int sp, ret = 0; void *ptr = 0; if (!hash) return -1; /* key found, return current value */ if ((ptr = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) { ret = (*(int *) ptr); free (ptr); return ret; } return 0; } /* Get the uint64_t value of a given int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ static uint64_t get_iu64 (void *hash, int key) { int sp; uint64_t ret = 0; void *ptr = 0; if (!hash) return 0; /* key found, return current value */ if ((ptr = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) { ret = (*(uint64_t *) ptr); free (ptr); return ret; } return 0; } /* Get the GSLList value of a given int key. * * On error, or if key is not found, NULL is returned. * On success the GSLList value for the given key is returned */ static GSLList * get_igsl (void *hash, int key) { int sp; GSLList *list = NULL; if (!hash) return NULL; /* key found, return current value */ if ((list = tcadbget (hash, &key, sizeof (int), &sp)) != NULL) return list; return NULL; } /* Get the TCLIST value of a given int key. * * On error, or if key is not found, NULL is returned. * On success the GSLList value for the given key is returned */ static TCLIST * get_itcli (void *hash, int key) { TCLIST *list = NULL; if (!hash) return NULL; /* key found, return current value */ if ((list = tcbdbget4 (hash, &key, sizeof (int))) != NULL) return list; return NULL; } /* Insert a unique visitor key string (IP/DATE/UA), mapped to an auto * incremented value. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_unique_key (const char *key) { int value = -1; void *hash = ht_unique_keys; if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Set the maximum and minimum values found on an integer key and * integer value found on the MTRC_VISITORS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_hits_min_max (GModule module, int *min, int *max) { void *hash = get_hash (module, MTRC_HITS); if (!hash) return; get_ii32_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * integer value found on the MTRC_VISITORS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_visitors_min_max (GModule module, int *min, int *max) { void *hash = get_hash (module, MTRC_VISITORS); if (!hash) return; get_ii32_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_BW hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_bw_min_max (GModule module, uint64_t * min, uint64_t * max) { void *hash = get_hash (module, MTRC_BW); if (!hash) return; get_iu64_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_CUMTS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_cumts_min_max (GModule module, uint64_t * min, uint64_t * max) { void *hash = get_hash (module, MTRC_CUMTS); if (!hash) return; get_iu64_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_MAXTS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_maxts_min_max (GModule module, uint64_t * min, uint64_t * max) { void *hash = get_hash (module, MTRC_MAXTS); if (!hash) return; get_iu64_min_max (hash, min, max); } /* Insert a user agent key string, mapped to an auto incremented value. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_agent_key (const char *key) { int value = -1; void *hash = ht_agent_keys; if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Insert a user agent int key, mapped to a user agent string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_agent_value (int key, const char *value) { void *hash = ht_agent_vals; if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a keymap string key. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_keymap (GModule module, const char *key) { int value = -1; void *hash = get_hash (module, MTRC_KEYMAP); if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Insert a datamap int key and string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_datamap (GModule module, int key, const char *value) { void *hash = get_hash (module, MTRC_DATAMAP); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a rootmap int key from the keymap store mapped to its string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_rootmap (GModule module, int key, const char *value) { void *hash = get_hash (module, MTRC_ROOTMAP); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a uniqmap string key. * * If the given key exists, 0 is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_uniqmap (GModule module, const char *key) { int value = -1; void *hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return 0; return ins_si32_ai (hash, key); } /* Insert a data int key mapped to the corresponding int root key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_root (GModule module, int key, int value) { void *hash = get_hash (module, MTRC_ROOT); if (!hash) return -1; return ins_ii32 (hash, key, value); } /* Increases hits counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_hits (GModule module, int key, int inc) { void *hash = get_hash (module, MTRC_HITS); if (!hash) return -1; return inc_ii32 (hash, key, inc); } /* Increases visitors counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_visitor (GModule module, int key, int inc) { void *hash = get_hash (module, MTRC_VISITORS); if (!hash) return -1; return inc_ii32 (hash, key, inc); } /* Increases bandwidth counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_bw (GModule module, int key, uint64_t inc) { void *hash = get_hash (module, MTRC_BW); if (!hash) return -1; return inc_iu64 (hash, key, inc); } /* Increases cumulative time served counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_cumts (GModule module, int key, uint64_t inc) { void *hash = get_hash (module, MTRC_CUMTS); if (!hash) return -1; return inc_iu64 (hash, key, inc); } /* Insert the maximum time served counter from an int key. * Note: it compares the current value with the given value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_maxts (GModule module, int key, uint64_t value) { uint64_t curvalue = 0; void *hash = get_hash (module, MTRC_MAXTS); if (!hash) return -1; if ((curvalue = get_iu64 (hash, key)) < value) ins_iu64 (hash, key, value); return 0; } /* Insert a method given an int key and string value. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_method (GModule module, int key, const char *value) { void *hash = get_hash (module, MTRC_METHODS); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a protocol given an int key and string value. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_protocol (GModule module, int key, const char *value) { void *hash = get_hash (module, MTRC_PROTOCOLS); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert an agent for a hostname given an int key and int value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_agent (GModule module, int key, int value) { void *hash = get_hash (module, MTRC_AGENTS); if (!hash) return -1; return ins_igsl (hash, key, value); } /* Insert an IP hostname mapped to the corresponding hostname. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_hostname (const char *ip, const char *host) { void *hash = ht_hostnames; if (!hash) return -1; return ins_ss32 (hash, ip, host); } /* Increases a general stats counter int from a string key. * * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_genstats (const char *key, int inc) { void *hash = ht_general_stats; if (!hash) return -1; return inc_si32 (hash, key, inc); } /* Replaces a general stats counter int from a string key. * * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_replace_genstats (const char *key, int value) { void *hash = ht_general_stats; if (!hash) return -1; return ins_si32 (hash, key, value); } /* Increases the general stats counter accumulated_time. * * On error, 0 is returned * On success 1 is returned */ int ht_insert_genstats_accumulated_time (time_t elapsed) { void *hash = ht_general_stats; if (!hash) return 0; return inc_si32 (hash, "accumulated_time", (int) elapsed) != -1; } /* Increases a general stats counter uint64_t from a string key. * * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_genstats_bw (const char *key, uint64_t inc) { void *hash = ht_general_stats; if (!hash) return -1; return inc_su64 (hash, key, inc); } /* Insert meta data counters from a string key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_meta_data (GModule module, const char *key, uint64_t value) { void *hash = get_hash (module, MTRC_METADATA); if (!hash) return -1; return inc_su64 (hash, key, value); } /* Get the number of elements in a datamap. * * Return -1 if the operation fails, else number of elements. */ uint32_t ht_get_size_datamap (GModule module) { void *hash = get_hash (module, MTRC_DATAMAP); if (!hash) return 0; return ht_get_size (hash); } /* Get the number of elements in a uniqmap. * * On error, 0 is returned. * On success the number of elements in MTRC_UNIQMAP is returned */ uint32_t ht_get_size_uniqmap (GModule module) { void *hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return 0; return ht_get_size (hash); } /* Get the string data value of a given int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_datamap (GModule module, int key) { void *hash = get_hash (module, MTRC_DATAMAP); if (!hash) return NULL; return get_is32 (hash, key); } /* Get the int value from MTRC_KEYMAP given a string key. * * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_keymap (GModule module, const char *key) { void *hash = get_hash (module, MTRC_KEYMAP); if (!hash) return -1; return get_si32 (hash, key); } /* Get the int value from MTRC_UNIQMAP given a string key. * * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_uniqmap (GModule module, const char *key) { void *hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return -1; return get_si32 (hash, key); } /* Get the uint32_t value from ht_general_stats given a string key. * * On error, 0 is returned. * On success the uint32_t value for the given key is returned */ uint32_t ht_get_genstats (const char *key) { void *hash = ht_general_stats; if (!hash) return 0; return get_sui32 (hash, key); } /* Get the uint64_t value from ht_general_stats given a string key. * * On error, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_genstats_bw (const char *key) { void *hash = ht_general_stats; if (!hash) return 0; return get_su64 (hash, key); } /* Get the string root from MTRC_ROOTMAP given an int data key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_root (GModule module, int key) { int root_key = 0; void *hashroot = get_hash (module, MTRC_ROOT); void *hashrootmap = get_hash (module, MTRC_ROOTMAP); if (!hashroot || !hashrootmap) return NULL; /* not found */ if ((root_key = get_ii32 (hashroot, key)) == 0) return NULL; return get_is32 (hashrootmap, root_key); } /* Get the int visitors value from MTRC_HITS given an int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_hits (GModule module, int key) { void *hash = get_hash (module, MTRC_HITS); if (!hash) return -1; return get_ii32 (hash, key); } /* Get the int visitors value from MTRC_VISITORS given an int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_visitors (GModule module, int key) { void *hash = get_hash (module, MTRC_VISITORS); if (!hash) return -1; return get_ii32 (hash, key); } /* Get the uint64_t value from MTRC_BW given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_bw (GModule module, int key) { void *hash = get_hash (module, MTRC_BW); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the uint64_t value from MTRC_CUMTS given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_cumts (GModule module, int key) { void *hash = get_hash (module, MTRC_CUMTS); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the uint64_t value from MTRC_MAXTS given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_maxts (GModule module, int key) { void *hash = get_hash (module, MTRC_MAXTS); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the string value from MTRC_METHODS given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_method (GModule module, int key) { void *hash = get_hash (module, MTRC_METHODS); if (!hash) return NULL; return get_is32 (hash, key); } char * ht_get_protocol (GModule module, int key) { void *hash = get_hash (module, MTRC_PROTOCOLS); if (!hash) return NULL; return get_is32 (hash, key); } /* Get the string value from MTRC_PROTOCOLS given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_hostname (const char *host) { void *hash = ht_hostnames; if (!hash) return NULL; return get_ss32 (hash, host); } /* Get the string value from ht_agent_vals (user agent) given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_host_agent_val (int key) { void *hash = ht_agent_vals; if (!hash) return NULL; return get_is32 (hash, key); } /* Get the list value from MTRC_AGENTS given an int key. * * On error, or if key is not found, NULL is returned. * On success the GSLList value for the given key is returned */ GSLList * ht_get_host_agent_list (GModule module, int key) { void *hash = get_hash (module, MTRC_AGENTS); GSLList *list; if ((list = get_igsl (hash, key))) return list; return NULL; } /* Get the meta data uint64_t from MTRC_METADATA given a string key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_meta_data (GModule module, const char *key) { void *hash = get_hash (module, MTRC_METADATA); if (!hash) return 0; return get_su64 (hash, key); } /* Get the list value from MTRC_AGENTS given an int key. * * On error, or if key is not found, NULL is returned. * On success the TCLIST value for the given key is returned */ TCLIST * ht_get_host_agent_tclist (GModule module, int key) { void *hash = get_hash (module, MTRC_AGENTS); TCLIST *list; if ((list = get_itcli (hash, key))) return list; return NULL; } /* Insert the values from a TCLIST into a GSLList. * * On success the GSLList is returned */ GSLList * tclist_to_gsllist (TCLIST * tclist) { GSLList *list = NULL; int i, sz; int *val; for (i = 0; i < tclistnum (tclist); ++i) { val = (int *) tclistval (tclist, i, &sz); if (list == NULL) list = list_create (int2ptr (*val)); else list = list_insert_prepend (list, int2ptr (*val)); } return list; } /* Calls the given function for each of the key/value pairs */ static void tc_db_foreach (void *db, void (*fp) (TCADB * m, void *k, int s, void *u), void *user_data) { TCADB *adb = db; int ksize = 0; void *key; tcadbiterinit (adb); while ((key = tcadbiternext (adb, &ksize)) != NULL) { (*fp) (adb, key, ksize, user_data); free (key); } } /* Free the key/value pair */ static void free_agent_values (TCADB * adb, void *key, int ksize, GO_UNUSED void *user_data) { void *list; int sp = 0; list = tcadbget (adb, key, ksize, &sp); if (list) list_remove_nodes (list); } /* Iterate over the each key/value pair under MTRC_AGENTS and free the and the * list of values */ void free_agent_list (void) { void *hash = get_hash (HOSTS, MTRC_AGENTS); if (!hash) return; tc_db_foreach (hash, free_agent_values, NULL); } /* A wrapper to initialize a raw data structure. * * On success a GRawData structure is returned. */ static GRawData * init_new_raw_data (GModule module, uint32_t ht_size) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->idx = 0; raw_data->module = module; raw_data->size = ht_size; raw_data->items = new_grawdata_item (ht_size); return raw_data; } /* For each key/value pair stored in MTRC_HITS/MTRC_DATAMAP, assign the * key/value to a GRawDataItem */ static void set_raw_data (void *key, void *value, GRawData * raw_data) { raw_data->items[raw_data->idx].key = (*(int *) key); if (raw_data->type == STRING) raw_data->items[raw_data->idx].value.svalue = (char *) value; else raw_data->items[raw_data->idx].value.ivalue = (*(int *) value); raw_data->idx++; } /* Get the value stored in MTRC_HITS */ static void data_iter_generic (TCADB * adb, void *key, int ksize, void *user_data) { GRawData *raw_data = user_data; void *value; int sp = 0; value = tcadbget (adb, key, ksize, &sp); if (value) { set_raw_data (key, value, raw_data); if (raw_data->type != STRING) free (value); } } /* Entry point to load the raw data from the data store into our * GRawData structure. * * On error, NULL is returned. * On success the GRawData sorted is returned */ GRawData * parse_raw_data (GModule module) { GRawData *raw_data; GRawDataType type; uint32_t ht_size = 0; void *hash = NULL; switch (module) { case VISITORS: hash = get_hash (module, MTRC_DATAMAP); type = STRING; break; default: hash = get_hash (module, MTRC_HITS); type = INTEGER; } if (!hash) return NULL; ht_size = ht_get_size (hash); raw_data = init_new_raw_data (module, ht_size); raw_data->type = type; tc_db_foreach (hash, data_iter_generic, raw_data); sort_raw_num_data (raw_data, raw_data->idx); return raw_data; } goaccess-1.3/src/base64.c0000644000000000000000000000457613375657450012105 00000000000000/** * base64.c -- A basic base64 encode implementation * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include "base64.h" /* Encodes the given data with base64.. * * On success, the encoded nul-terminated data, as a string is returned. */ char * base64_encode (const void *buf, size_t size) { static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *str = (char *) malloc ((size + 3) * 4 / 3 + 1); char *p = str; const unsigned char *q = (const unsigned char *) buf; size_t i = 0; while (i < size) { int c = q[i++]; c *= 256; if (i < size) c += q[i]; i++; c *= 256; if (i < size) c += q[i]; i++; *p++ = base64[(c & 0x00fc0000) >> 18]; *p++ = base64[(c & 0x0003f000) >> 12]; if (i > size + 1) *p++ = '='; else *p++ = base64[(c & 0x00000fc0) >> 6]; if (i > size) *p++ = '='; else *p++ = base64[c & 0x0000003f]; } *p = 0; return str; } goaccess-1.3/src/sort.h0000644000000000000000000000562413375657450012010 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef SORT_H_INCLUDED #define SORT_H_INCLUDED #include "commons.h" #include "parser.h" #define SORT_MAX_OPTS 11 /* See GEnum for mapping */ #define SORT_FIELD_LEN 11 + 1 /* longest metric name */ #define SORT_MODULE_LEN 15 + 1 /* longest module name */ #define SORT_ORDER_LEN 4 + 1 /* length of ASC or DESC */ /* Enumerated sorting metrics */ typedef enum GSortField_ { SORT_BY_HITS, SORT_BY_VISITORS, SORT_BY_DATA, SORT_BY_BW, SORT_BY_AVGTS, SORT_BY_CUMTS, SORT_BY_MAXTS, SORT_BY_PROT, SORT_BY_MTHD, } GSortField; /* Enumerated sorting order */ typedef enum GSortOrder_ { SORT_ASC, SORT_DESC } GSortOrder; /* Sorting of each panel, metric and order */ typedef struct GSort_ { GModule module; GSortField field; GSortOrder sort; } GSort; extern GSort module_sort[TOTAL_MODULES]; extern const int sort_choices[][SORT_MAX_OPTS];; GRawData *sort_raw_num_data (GRawData * raw_data, int ht_size); GRawData *sort_raw_str_data (GRawData * raw_data, int ht_size); const char *get_sort_field_key (GSortField field); const char *get_sort_field_str (GSortField field); const char *get_sort_order_str (GSortOrder order); int can_sort_module (GModule module, int field); int get_sort_field_enum (const char *str); int get_sort_order_enum (const char *str); int strcmp_asc (const void *a, const void *b); void parse_initial_sort (void); void set_initial_sort (const char *smod, const char *sfield, const char *ssort); void sort_holder_items (GHolderItem * items, int size, GSort sort); #endif goaccess-1.3/src/util.h0000644000000000000000000000705513375657450011776 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef UTIL_H_INCLUDED #define UTIL_H_INCLUDED #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define REGEX_ERROR 100 #define KIB(n) (n << 10) #define MIB(n) (n << 20) #define GIB(n) (n << 30) #define TIB(n) (n << 40) #define PIB(n) (n << 50) #define MILS 1000ULL #define SECS 1000000ULL #define MINS 60000000ULL #define HOUR 3600000000ULL #define DAY 86400000000ULL /* *INDENT-OFF* */ #include #include #include char *alloc_string (const char *str); char *char_repeat (int n, char c); char *char_replace (char *str, char o, char n); char *deblank (char *str); char *escape_str (const char *src); char *filesize_str (unsigned long long log_size); char *float2str (float d, int width); char *get_global_config (void); char *get_home (void); char *get_visitors_date (const char *odate, const char *from, const char *to); char *int2str (int d, int width); char *left_pad_str (const char *s, int indent); char *ltrim (char *s); char *replace_str (const char *str, const char *old, const char *new); char *rtrim (char *s); char *secs_to_str (int secs); char *strtoupper(char *str); char *substring (const char *str, int begin, int len); char *trim_str (char *str); char *unescape_str (const char *src); char *usecs_to_str (unsigned long long usec); const char *verify_status_code (char *str); const char *verify_status_code_type (const char *str); int convert_date (char *res, const char *data, const char *from, const char *to, int size); int count_matches (const char *s1, char c); int find_output_type (char **filename, const char *ext, int alloc); int hide_referer (const char *ref); int ignore_referer (const char *ref); int intlen (int num); int invalid_ipaddr (char *str, int *ipvx); int ip_in_range (const char *ip); int str_inarray (const char *s, const char *arr[], int size); int str_to_time (const char *str, const char *fmt, struct tm *tm); int valid_output_type (const char *filename); off_t file_size (const char *filename); uint32_t ip_to_binary (const char *ip); void append_str (char **dest, const char *src); void genstr(char *dest, size_t len); void strip_newlines (char *str); void xstrncpy (char *dest, const char *source, const size_t dest_size); /* *INDENT-ON* */ #endif goaccess-1.3/src/gstorage.c0000644000000000000000000000774513375657450012635 00000000000000/** * gstorage.c -- common storage handling * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #if !defined __SUNPRO_C #include #endif #include #include #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "gstorage.h" #include "error.h" #include "xmalloc.h" /* Allocate memory for a new GMetrics instance. * * On success, the newly allocated GMetrics is returned . */ GMetrics * new_gmetrics (void) { GMetrics *metrics = xcalloc (1, sizeof (GMetrics)); return metrics; } /* Allocate space off the heap to store an int. * * On success, the newly allocated pointer is returned . */ int * int2ptr (int val) { int *ptr = xmalloc (sizeof (int)); *ptr = val; return ptr; } /* Allocate space off the heap to store a uint64_t. * * On success, the newly allocated pointer is returned . */ uint64_t * uint642ptr (uint64_t val) { uint64_t *ptr = xmalloc (sizeof (uint64_t)); *ptr = val; return ptr; } /* Set the module totals to calculate percentages. */ void set_module_totals (GModule module, GPercTotals * totals) { totals->bw = ht_get_meta_data (module, "bytes"); totals->hits = ht_get_meta_data (module, "hits"); totals->visitors = ht_get_meta_data (module, "visitors"); } /* Set numeric metrics for each request given raw data. * * On success, numeric metrics are set into the given structure. */ void set_data_metrics (GMetrics * ometrics, GMetrics ** nmetrics, GPercTotals totals) { GMetrics *metrics; /* determine percentages for certain fields */ float hits_perc = get_percentage (totals.hits, ometrics->hits); float visitors_perc = get_percentage (totals.visitors, ometrics->visitors); float bw_perc = get_percentage (totals.bw, ometrics->bw.nbw); metrics = new_gmetrics (); /* basic fields */ metrics->id = ometrics->id; metrics->hits = ometrics->hits; metrics->visitors = ometrics->visitors; /* percentage fields */ metrics->hits_perc = hits_perc < 0 ? 0 : hits_perc; metrics->bw_perc = bw_perc < 0 ? 0 : bw_perc; metrics->visitors_perc = visitors_perc < 0 ? 0 : visitors_perc; /* bandwidth field */ metrics->bw.nbw = ometrics->bw.nbw; /* time served fields */ if (conf.serve_usecs && ometrics->hits > 0) { metrics->avgts.nts = ometrics->avgts.nts; metrics->cumts.nts = ometrics->cumts.nts; metrics->maxts.nts = ometrics->maxts.nts; } /* method field */ if (conf.append_method && ometrics->method) metrics->method = ometrics->method; /* protocol field */ if (conf.append_protocol && ometrics->protocol) metrics->protocol = ometrics->protocol; /* data field */ metrics->data = ometrics->data; *nmetrics = metrics; } goaccess-1.3/src/sha1.h0000644000000000000000000000074313375657450011652 00000000000000#ifndef SHA1_H_INCLUDED #define SHA1_H_INCLUDED #include #include // From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c typedef struct { uint32_t state[5]; uint32_t count[2]; uint8_t buffer[64]; } SHA1_CTX; extern void SHA1Init (SHA1_CTX * context); extern void SHA1Update (SHA1_CTX * context, uint8_t * data, uint32_t len); extern void SHA1Final (uint8_t digest[20], SHA1_CTX * context); #endif // for #ifndef SHA1_H goaccess-1.3/src/gslist.h0000644000000000000000000000410613375657450012320 00000000000000/** * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GSLIST_H_INCLUDED #define GSLIST_H_INCLUDED /* Generic Single linked-list */ typedef struct GSLList_ { void *data; struct GSLList_ *next; } GSLList; /* single linked-list */ GSLList *list_create (void *data); GSLList *list_find (GSLList * node, int (*func) (void *, void *), void *data); GSLList *list_insert_append (GSLList * node, void *data); GSLList *list_insert_prepend (GSLList * list, void *data); int list_count (GSLList * list); int list_foreach (GSLList * node, int (*func) (void *, void *), void *user_data); int list_remove_node (GSLList ** list, GSLList * node); int list_remove_nodes (GSLList * list); #endif // for #ifndef GSLIST_H goaccess-1.3/src/goaccess.c0000644000000000000000000011043713375661253012576 00000000000000/** * goaccess.c -- main log analyzer * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include #include #include #include #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #ifdef HAVE_GEOLOCATION #include "geoip1.h" #endif #include "browsers.h" #include "csv.h" #include "error.h" #include "gdashboard.h" #include "gdns.h" #include "gholder.h" #include "goaccess.h" #include "gwsocket.h" #include "json.h" #include "options.h" #include "output.h" #include "util.h" #include "websocket.h" #include "xmalloc.h" GConf conf = { .append_method = 1, .append_protocol = 1, .hl_header = 1, .num_tests = 10, }; /* Loading/Spinner */ GSpinner *parsing_spinner; /* active reverse dns flag */ int active_gdns = 0; /* WebSocket server - writer and reader threads */ static GWSWriter *gwswriter; static GWSReader *gwsreader; /* Dashboard data structure */ static GDash *dash; /* Data holder structure */ static GHolder *holder; /* Log line properties structure */ static GLog *glog; /* Old signal mask */ static sigset_t oldset; /* Curses windows */ static WINDOW *header_win, *main_win; static int main_win_height = 0; /* *INDENT-OFF* */ static GScroll gscroll = { { {0, 0}, /* visitors {scroll, offset} */ {0, 0}, /* requests {scroll, offset} */ {0, 0}, /* req static {scroll, offset} */ {0, 0}, /* not found {scroll, offset} */ {0, 0}, /* hosts {scroll, offset} */ {0, 0}, /* os {scroll, offset} */ {0, 0}, /* browsers {scroll, offset} */ {0, 0}, /* visit times {scroll, offset} */ {0, 0}, /* referrers {scroll, offset} */ {0, 0}, /* ref sites {scroll, offset} */ {0, 0}, /* keywords {scroll, offset} */ #ifdef HAVE_GEOLOCATION {0, 0}, /* geolocation {scroll, offset} */ #endif {0, 0}, /* status {scroll, offset} */ }, 0, /* current module */ 0, /* main dashboard scroll */ 0, /* expanded flag */ }; /* *INDENT-ON* */ /* Free malloc'd holder */ static void house_keeping_holder (void) { /* REVERSE DNS THREAD */ pthread_mutex_lock (&gdns_thread.mutex); /* kill dns pthread */ active_gdns = 0; /* clear holder structure */ free_holder (&holder); /* clear reverse dns queue */ gdns_free_queue (); /* clear the whole storage */ free_storage (); pthread_mutex_unlock (&gdns_thread.mutex); } /* Free malloc'd data across the whole program */ static void house_keeping (void) { #ifdef TCB_MEMHASH /* free malloc'd int values on the agent list */ if (conf.list_agents) free_agent_list (); #endif house_keeping_holder (); /* DASHBOARD */ if (dash && !conf.output_stdout) { free_dashboard (dash); reset_find (); } /* GEOLOCATION */ #ifdef HAVE_GEOLOCATION geoip_free (); #endif /* LOGGER */ if (glog->pipe) fclose (glog->pipe); free_logerrors (glog); free (glog); /* INVALID REQUESTS */ if (conf.invalid_requests_log) { LOG_DEBUG (("Closing invalid requests log.\n")); invalid_log_close (); } /* CONFIGURATION */ free_formats (); free_browsers_hash (); if (conf.debug_log) { LOG_DEBUG (("Bye.\n")); dbg_log_close (); } /* clear spinner */ free (parsing_spinner); /* free colors */ free_color_lists (); /* free cmd arguments */ free_cmd_args (); /* WebSocket writer */ free (gwswriter); /* WebSocket reader */ free (gwsreader); } /* Open the pidfile whose name is specified in the given path and write * the daemonized given pid. */ static void write_pid_file (const char *path, pid_t pid) { FILE *pidfile; if (!path) return; if ((pidfile = fopen (path, "w"))) { fprintf (pidfile, "%d", pid); fclose (pidfile); } else { FATAL ("Unable to open the specified pid file. %s", strerror (errno)); } } /* Set GoAccess to run as a daemon */ static void daemonize (void) { pid_t pid, sid; int fd; /* Clone ourselves to make a child */ pid = fork (); if (pid < 0) exit (EXIT_FAILURE); if (pid > 0) { write_pid_file (conf.pidfile, pid); printf ("Daemonized GoAccess: %d\n", pid); exit (EXIT_SUCCESS); } umask (0); /* attempt to create our own process group */ sid = setsid (); if (sid < 0) { LOG_DEBUG (("Unable to setsid: %s.\n", strerror (errno))); exit (EXIT_FAILURE); } /* set the working directory to the root directory. * requires the user to specify absolute paths */ if (chdir ("/") < 0) { LOG_DEBUG (("Unable to set chdir: %s.\n", strerror (errno))); exit (EXIT_FAILURE); } /* redirect fd's 0,1,2 to /dev/null */ /* Note that the user will need to use --debug-file for log output */ if ((fd = open ("/dev/null", O_RDWR, 0)) == -1) { LOG_DEBUG (("Unable to open /dev/null: %s.\n", strerror (errno))); exit (EXIT_FAILURE); } dup2 (fd, STDIN_FILENO); dup2 (fd, STDOUT_FILENO); dup2 (fd, STDERR_FILENO); if (fd > STDERR_FILENO) { close (fd); } } /* Extract data from the given module hash structure and allocate + * load data from the hash table into an instance of GHolder */ static void allocate_holder_by_module (GModule module) { GRawData *raw_data; /* extract data from the corresponding hash table */ raw_data = parse_raw_data (module); if (!raw_data) { LOG_DEBUG (("raw data is NULL for module: %d.\n", module)); return; } load_holder_data (raw_data, holder + module, module, module_sort[module]); } /* Iterate over all modules/panels and extract data from hash * structures and load it into an instance of GHolder */ static void allocate_holder (void) { size_t idx = 0; holder = new_gholder (TOTAL_MODULES); FOREACH_MODULE (idx, module_list) { allocate_holder_by_module (module_list[idx]); } } /* Extract data from the modules GHolder structure and load it into * the terminal dashboard */ static void allocate_data_by_module (GModule module, int col_data) { int size = 0, max_choices = get_max_choices (); dash->module[module].head = module_to_head (module); dash->module[module].desc = module_to_desc (module); size = holder[module].idx; if (gscroll.expanded && module == gscroll.current) { size = size > max_choices ? max_choices : holder[module].idx; } else { size = holder[module].idx > col_data ? col_data : holder[module].idx; } dash->module[module].alloc_data = size; /* data allocated */ dash->module[module].ht_size = holder[module].ht_size; /* hash table size */ dash->module[module].idx_data = 0; dash->module[module].pos_y = 0; if (gscroll.expanded && module == gscroll.current) dash->module[module].dash_size = DASH_EXPANDED; else dash->module[module].dash_size = DASH_COLLAPSED; dash->total_alloc += dash->module[module].dash_size; pthread_mutex_lock (&gdns_thread.mutex); load_data_to_dash (&holder[module], dash, module, &gscroll); pthread_mutex_unlock (&gdns_thread.mutex); } /* Iterate over all modules/panels and extract data from GHolder * structure and load it into the terminal dashboard */ static void allocate_data (void) { GModule module; int col_data = get_num_collapsed_data_rows (); size_t idx = 0; dash = new_gdash (); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; allocate_data_by_module (module, col_data); } } /* A wrapper to render all windows within the dashboard. */ static void render_screens (void) { GColors *color = get_color (COLOR_DEFAULT); int row, col, chg = 0; getmaxyx (stdscr, row, col); term_size (main_win, &main_win_height); generate_time (); chg = glog->processed - glog->offset; draw_header (stdscr, "", "%s", row - 1, 0, col, color_default); wattron (stdscr, color->attr | COLOR_PAIR (color->pair->idx)); mvaddstr (row - 1, 1, T_HELP_ENTER); mvprintw (row - 1, 30, "%d - %s", chg, asctime (now_tm)); mvaddstr (row - 1, col - 21, T_QUIT); mvprintw (row - 1, col - 5, "%s", GO_VERSION); wattroff (stdscr, color->attr | COLOR_PAIR (color->pair->idx)); refresh (); /* call general stats header */ display_general (header_win, glog, holder); wrefresh (header_win); /* display active label based on current module */ update_active_module (header_win, gscroll.current); display_content (main_win, dash, &gscroll); } /* Collapse the current expanded module */ static void collapse_current_module (void) { if (!gscroll.expanded) return; gscroll.expanded = 0; reset_scroll_offsets (&gscroll); free_dashboard (dash); allocate_data (); render_screens (); } /* Display message a the bottom of the terminal dashboard that panel * is disabled */ static void disabled_panel_msg (GModule module) { const char *lbl = module_to_label (module); int row, col; getmaxyx (stdscr, row, col); draw_header (stdscr, lbl, ERR_PANEL_DISABLED, row - 1, 0, col, color_error); } /* Set the current module/panel */ static void set_module_to (GScroll * scrll, GModule module) { if (get_module_index (module) == -1) { disabled_panel_msg (module); return; } /* scroll to panel */ if (!conf.no_tab_scroll) gscroll.dash = get_module_index (module) * DASH_COLLAPSED; /* reset expanded module */ collapse_current_module (); scrll->current = module; render_screens (); } /* Scroll expanded module or terminal dashboard to the top */ static void scroll_to_first_line (void) { if (!gscroll.expanded) gscroll.dash = 0; else { gscroll.module[gscroll.current].scroll = 0; gscroll.module[gscroll.current].offset = 0; } } /* Scroll expanded module or terminal dashboard to the last row */ static void scroll_to_last_line (void) { int exp_size = get_num_expanded_data_rows (); int scrll = 0, offset = 0; if (!gscroll.expanded) gscroll.dash = dash->total_alloc - main_win_height; else { scrll = dash->module[gscroll.current].idx_data - 1; if (scrll >= exp_size && scrll >= offset + exp_size) offset = scrll < exp_size - 1 ? 0 : scrll - exp_size + 1; gscroll.module[gscroll.current].scroll = scrll; gscroll.module[gscroll.current].offset = offset; } } /* Load the user-agent window given the selected IP */ static void load_ip_agent_list (void) { int type_ip = 0; /* make sure we have a valid IP */ int sel = gscroll.module[gscroll.current].scroll; GDashData item = dash->module[HOSTS].data[sel]; if (!invalid_ipaddr (item.metrics->data, &type_ip)) load_agent_list (main_win, item.metrics->data); } /* Expand the selected module */ static void expand_current_module (void) { if (gscroll.expanded && gscroll.current == HOSTS) { load_ip_agent_list (); return; } /* expanded, nothing to do... */ if (gscroll.expanded) return; reset_scroll_offsets (&gscroll); gscroll.expanded = 1; free_holder_by_module (&holder, gscroll.current); free_dashboard (dash); allocate_holder_by_module (gscroll.current); allocate_data (); } /* Expand the clicked module/panel given the Y event coordinate. */ static void expand_module_from_ypos (int y) { /* ignore header/footer clicks */ if (y < MAX_HEIGHT_HEADER || y == LINES - 1) return; if (set_module_from_mouse_event (&gscroll, dash, y)) return; reset_scroll_offsets (&gscroll); gscroll.expanded = 1; free_holder_by_module (&holder, gscroll.current); free_dashboard (dash); allocate_holder_by_module (gscroll.current); allocate_data (); render_screens (); } /* Expand the clicked module/panel */ static void expand_on_mouse_click (void) { int ok_mouse; MEVENT event; ok_mouse = getmouse (&event); if (!conf.mouse_support || ok_mouse != OK) return; if (event.bstate & BUTTON1_CLICKED) expand_module_from_ypos (event.y); } /* Scroll dowm expanded module to the last row */ static void scroll_down_expanded_module (void) { int exp_size = get_num_expanded_data_rows (); int *scroll_ptr, *offset_ptr; scroll_ptr = &gscroll.module[gscroll.current].scroll; offset_ptr = &gscroll.module[gscroll.current].offset; if (!gscroll.expanded) return; if (*scroll_ptr >= dash->module[gscroll.current].idx_data - 1) return; ++(*scroll_ptr); if (*scroll_ptr >= exp_size && *scroll_ptr >= *offset_ptr + exp_size) ++(*offset_ptr); } /* Scroll up expanded module */ static void scroll_up_expanded_module (void) { int *scroll_ptr, *offset_ptr; scroll_ptr = &gscroll.module[gscroll.current].scroll; offset_ptr = &gscroll.module[gscroll.current].offset; if (!gscroll.expanded) return; if (*scroll_ptr <= 0) return; --(*scroll_ptr); if (*scroll_ptr < *offset_ptr) --(*offset_ptr); } /* Scroll up terminal dashboard */ static void scroll_up_dashboard (void) { gscroll.dash--; } /* Page up expanded module */ static void page_up_module (void) { int exp_size = get_num_expanded_data_rows (); int *scroll_ptr, *offset_ptr; scroll_ptr = &gscroll.module[gscroll.current].scroll; offset_ptr = &gscroll.module[gscroll.current].offset; if (!gscroll.expanded) return; /* decrease scroll and offset by exp_size */ *scroll_ptr -= exp_size; if (*scroll_ptr < 0) *scroll_ptr = 0; if (*scroll_ptr < *offset_ptr) *offset_ptr -= exp_size; if (*offset_ptr <= 0) *offset_ptr = 0; } /* Page down expanded module */ static void page_down_module (void) { int exp_size = get_num_expanded_data_rows (); int *scroll_ptr, *offset_ptr; scroll_ptr = &gscroll.module[gscroll.current].scroll; offset_ptr = &gscroll.module[gscroll.current].offset; if (!gscroll.expanded) return; *scroll_ptr += exp_size; if (*scroll_ptr >= dash->module[gscroll.current].idx_data - 1) *scroll_ptr = dash->module[gscroll.current].idx_data - 1; if (*scroll_ptr >= exp_size && *scroll_ptr >= *offset_ptr + exp_size) *offset_ptr += exp_size; if (*offset_ptr + exp_size >= dash->module[gscroll.current].idx_data - 1) *offset_ptr = dash->module[gscroll.current].idx_data - exp_size; if (*scroll_ptr < exp_size - 1) *offset_ptr = 0; } /* Create a new find dialog window and render it. Upon closing the * window, dashboard is refreshed. */ static void render_search_dialog (int search) { if (render_find_dialog (main_win, &gscroll)) return; pthread_mutex_lock (&gdns_thread.mutex); search = perform_next_find (holder, &gscroll); pthread_mutex_unlock (&gdns_thread.mutex); if (search != 0) return; free_dashboard (dash); allocate_data (); render_screens (); } /* Search for the next occurrence within the dashboard structure */ static void search_next_match (int search) { pthread_mutex_lock (&gdns_thread.mutex); search = perform_next_find (holder, &gscroll); pthread_mutex_unlock (&gdns_thread.mutex); if (search != 0) return; free_dashboard (dash); allocate_data (); render_screens (); } /* Update holder structure and dashboard screen */ static void tail_term (void) { pthread_mutex_lock (&gdns_thread.mutex); free_holder (&holder); pthread_cond_broadcast (&gdns_thread.not_empty); pthread_mutex_unlock (&gdns_thread.mutex); free_dashboard (dash); allocate_holder (); allocate_data (); term_size (main_win, &main_win_height); render_screens (); } static void tail_html (void) { char *json = NULL; pthread_mutex_lock (&gdns_thread.mutex); free_holder (&holder); pthread_cond_broadcast (&gdns_thread.not_empty); pthread_mutex_unlock (&gdns_thread.mutex); allocate_holder (); pthread_mutex_lock (&gdns_thread.mutex); json = get_json (glog, holder, 0); pthread_mutex_unlock (&gdns_thread.mutex); if (json == NULL) return; broadcast_holder (gwswriter->fd, json, strlen (json)); free (json); } /* Fast-forward latest JSON data when client connection is opened. */ static void fast_forward_client (int listener) { char *json = NULL; pthread_mutex_lock (&gdns_thread.mutex); json = get_json (glog, holder, 0); pthread_mutex_unlock (&gdns_thread.mutex); if (json == NULL) return; pthread_mutex_lock (&gwswriter->mutex); send_holder_to_client (gwswriter->fd, listener, json, strlen (json)); pthread_mutex_unlock (&gwswriter->mutex); free (json); } /* Start reading data coming from the client side through the * WebSocket server. */ void read_client (void *ptr_data) { GWSReader *reader = (GWSReader *) ptr_data; fd_set rfds, wfds; FD_ZERO (&rfds); FD_ZERO (&wfds); /* check we have a fifo for reading */ if (reader->fd == -1) return; pthread_mutex_lock (&reader->mutex); set_self_pipe (reader->self_pipe); pthread_mutex_unlock (&reader->mutex); while (1) { /* select(2) will block */ if (read_fifo (reader, rfds, wfds, fast_forward_client)) break; } close (reader->fd); } /* Parse tailed lines */ static void parse_tail_follow (FILE * fp) { #ifdef WITH_GETLINE char *buf = NULL; #else char buf[LINE_BUFFER] = { 0 }; #endif #ifdef WITH_GETLINE while ((buf = fgetline (fp)) != NULL) { #else while (fgets (buf, LINE_BUFFER, fp) != NULL) { #endif pthread_mutex_lock (&gdns_thread.mutex); parse_log (&glog, buf, 0); pthread_mutex_unlock (&gdns_thread.mutex); #ifdef WITH_GETLINE free (buf); #endif } } /* Process appended log data */ static void perform_tail_follow (uint64_t * size1, const char *fn) { FILE *fp = NULL; uint64_t size2 = 0; if (fn[0] == '-' && fn[1] == '\0') { parse_tail_follow (glog->pipe); goto out; } if (glog->load_from_disk_only) return; size2 = file_size (fn); /* file hasn't changed */ if (size2 == *size1) return; if (!(fp = fopen (fn, "r"))) FATAL ("Unable to read log file %s.", strerror (errno)); if (!fseeko (fp, *size1, SEEK_SET)) parse_tail_follow (fp); fclose (fp); *size1 = size2; out: if (!conf.output_stdout) tail_term (); else tail_html (); usleep (200000); /* 0.2 seconds */ } /* Entry point to start processing the HTML output */ static void process_html (const char *filename) { uint64_t *size1 = NULL; int i = 0; /* render report */ pthread_mutex_lock (&gdns_thread.mutex); output_html (glog, holder, filename); pthread_mutex_unlock (&gdns_thread.mutex); /* not real time? */ if (!conf.real_time_html) return; /* ignore loading from disk */ if (glog->load_from_disk_only) return; pthread_mutex_lock (&gwswriter->mutex); gwswriter->fd = open_fifoin (); pthread_mutex_unlock (&gwswriter->mutex); /* open fifo for write */ if (gwswriter->fd == -1) return; size1 = xcalloc (conf.filenames_idx, sizeof (uint64_t)); for (i = 0; i < conf.filenames_idx; ++i) { if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0') size1[i] = 0; else size1[i] = file_size (conf.filenames[i]); } set_ready_state (); while (1) { if (conf.stop_processing) break; for (i = 0; i < conf.filenames_idx; ++i) perform_tail_follow (&size1[i], conf.filenames[i]); /* 0.2 secs */ usleep (800000); /* 0.8 secs */ } close (gwswriter->fd); free (size1); } /* Iterate over available panels and advance the panel pointer. */ static int next_module (void) { int next = -1; if ((next = get_next_module (gscroll.current)) == -1) return 1; gscroll.current = next; if (!conf.no_tab_scroll) gscroll.dash = get_module_index (gscroll.current) * DASH_COLLAPSED; return 0; } /* Iterate over available panels and rewind the panel pointer. */ static int previous_module (void) { int prev = -1; if ((prev = get_prev_module (gscroll.current)) == -1) return 1; gscroll.current = prev; if (!conf.no_tab_scroll) gscroll.dash = get_module_index (gscroll.current) * DASH_COLLAPSED; return 0; } /* Perform several curses operations upon resizing the terminal. */ static void window_resize (void) { endwin (); refresh (); werase (header_win); werase (main_win); werase (stdscr); term_size (main_win, &main_win_height); refresh (); render_screens (); } /* Create a new sort dialog window and render it. Upon closing the * window, dashboard is refreshed. */ static void render_sort_dialog (void) { load_sort_win (main_win, gscroll.current, &module_sort[gscroll.current]); pthread_mutex_lock (&gdns_thread.mutex); free_holder (&holder); pthread_cond_broadcast (&gdns_thread.not_empty); pthread_mutex_unlock (&gdns_thread.mutex); free_dashboard (dash); allocate_holder (); allocate_data (); render_screens (); } /* Interfacing with the keyboard */ static void get_keys (void) { int search = 0; int c, quit = 1, i; uint64_t *size1 = NULL; if (!glog->load_from_disk_only && conf.filenames_idx) { size1 = xcalloc (conf.filenames_idx, sizeof (uint64_t)); for (i = 0; i < conf.filenames_idx; ++i) { if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0') size1[i] = 0; else size1[i] = file_size (conf.filenames[i]); } } while (quit) { if (conf.stop_processing) break; c = wgetch (stdscr); switch (c) { case 'q': /* quit */ if (!gscroll.expanded) { quit = 0; break; } collapse_current_module (); break; case KEY_F (1): case '?': case 'h': load_help_popup (main_win); render_screens (); break; case 49: /* 1 */ /* reset expanded module */ set_module_to (&gscroll, VISITORS); break; case 50: /* 2 */ /* reset expanded module */ set_module_to (&gscroll, REQUESTS); break; case 51: /* 3 */ /* reset expanded module */ set_module_to (&gscroll, REQUESTS_STATIC); break; case 52: /* 4 */ /* reset expanded module */ set_module_to (&gscroll, NOT_FOUND); break; case 53: /* 5 */ /* reset expanded module */ set_module_to (&gscroll, HOSTS); break; case 54: /* 6 */ /* reset expanded module */ set_module_to (&gscroll, OS); break; case 55: /* 7 */ /* reset expanded module */ set_module_to (&gscroll, BROWSERS); break; case 56: /* 8 */ /* reset expanded module */ set_module_to (&gscroll, VISIT_TIMES); break; case 57: /* 9 */ /* reset expanded module */ set_module_to (&gscroll, VIRTUAL_HOSTS); break; case 48: /* 0 */ /* reset expanded module */ set_module_to (&gscroll, REFERRERS); break; case 33: /* shift + 1 */ /* reset expanded module */ set_module_to (&gscroll, REFERRING_SITES); break; case 34: /* shift + 2 */ /* reset expanded module */ set_module_to (&gscroll, KEYPHRASES); break; case 35: /* Shift + 3 */ /* reset expanded module */ set_module_to (&gscroll, STATUS_CODES); break; case 36: /* Shift + 3 */ /* reset expanded module */ set_module_to (&gscroll, REMOTE_USER); break; #ifdef HAVE_GEOLOCATION case 37: /* Shift + 4 */ /* reset expanded module */ set_module_to (&gscroll, GEO_LOCATION); break; #endif case 9: /* TAB */ /* reset expanded module */ collapse_current_module (); if (next_module () == 0) render_screens (); break; case 353: /* Shift TAB */ /* reset expanded module */ collapse_current_module (); if (previous_module () == 0) render_screens (); break; case 'g': /* g = top */ scroll_to_first_line (); display_content (main_win, dash, &gscroll); break; case 'G': /* G = down */ scroll_to_last_line (); display_content (main_win, dash, &gscroll); break; /* expand dashboard module */ case KEY_RIGHT: case 0x0a: case 0x0d: case 32: /* ENTER */ case 79: /* o */ case 111: /* O */ case KEY_ENTER: expand_current_module (); display_content (main_win, dash, &gscroll); break; case KEY_DOWN: /* scroll main dashboard */ if ((gscroll.dash + main_win_height) < dash->total_alloc) { gscroll.dash++; display_content (main_win, dash, &gscroll); } break; case KEY_MOUSE: /* handles mouse events */ expand_on_mouse_click (); break; case 106: /* j - DOWN expanded module */ scroll_down_expanded_module (); display_content (main_win, dash, &gscroll); break; /* scroll up main_win */ case KEY_UP: if (gscroll.dash > 0) { scroll_up_dashboard (); display_content (main_win, dash, &gscroll); } break; case 2: /* ^ b - page up */ case 339: /* ^ PG UP */ page_up_module (); display_content (main_win, dash, &gscroll); break; case 6: /* ^ f - page down */ case 338: /* ^ PG DOWN */ page_down_module (); display_content (main_win, dash, &gscroll); break; case 107: /* k - UP expanded module */ scroll_up_expanded_module (); display_content (main_win, dash, &gscroll); break; case 'n': search_next_match (search); break; case '/': render_search_dialog (search); break; case 99: /* c */ if (conf.no_color) break; load_schemes_win (main_win); free_dashboard (dash); allocate_data (); set_wbkgd (main_win, header_win); render_screens (); break; case 115: /* s */ render_sort_dialog (); break; case 269: case KEY_RESIZE: window_resize (); break; default: for (i = 0; i < conf.filenames_idx; ++i) perform_tail_follow (&size1[i], conf.filenames[i]); break; } } free (size1); } /* Set general/overall statistics when loading data from the on-disk * storage. i.e., --load-from-disk */ static void set_general_stats (void) { glog->valid = glog->processed = glog->invalid = glog->excluded_ip = 0; #ifdef TCB_BTREE glog->excluded_ip = ht_get_genstats ("excluded_ip"); glog->invalid = ht_get_genstats ("failed_requests"); glog->processed = ht_get_genstats ("total_requests"); glog->resp_size = ht_get_genstats_bw ("bandwidth"); glog->valid = ht_get_genstats ("valid_requests"); if (glog->resp_size > 0) conf.bandwidth = 1; if (ht_get_genstats ("serve_usecs")) conf.serve_usecs = 1; #endif } /* Store accumulated processing time * Note: As we store with time_t second resolution, * if elapsed time == 0, we will bump it to 1. */ #ifdef TCB_BTREE static void set_accumulated_time (void) { if (conf.store_accumulated_time) { time_t elapsed = end_proc - start_proc; elapsed = (!elapsed) ? !elapsed : elapsed; ht_insert_genstats_accumulated_time (elapsed); } } #endif /* Execute the following calls right before we start the main * processing/parsing loop */ static void init_processing (void) { /* perform some additional checks before parsing panels */ verify_panels (); /* initialize storage */ init_storage (); if (conf.load_from_disk) set_general_stats (); set_spec_date_format (); } /* Determine the type of output, i.e., JSON, CSV, HTML */ static void standard_output (void) { char *csv = NULL, *json = NULL, *html = NULL; /* CSV */ if (find_output_type (&csv, "csv", 1) == 0) output_csv (glog, holder, csv); /* JSON */ if (find_output_type (&json, "json", 1) == 0) output_json (glog, holder, json); /* HTML */ if (find_output_type (&html, "html", 1) == 0 || conf.output_format_idx == 0) process_html (html); free (csv); free (html); free (json); } /* Output to a terminal */ static void curses_output (void) { allocate_data (); if (!conf.skip_term_resolver) gdns_thread_create (); render_screens (); /* will loop in here */ get_keys (); } /* Set locale */ static void set_locale (void) { char *loc_ctype; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); loc_ctype = getenv ("LC_CTYPE"); if (loc_ctype != NULL) setlocale (LC_CTYPE, loc_ctype); else if ((loc_ctype = getenv ("LC_ALL"))) setlocale (LC_CTYPE, loc_ctype); else setlocale (LC_CTYPE, ""); } /* Attempt to get the current name of a terminal or fallback to /dev/tty * * On error, -1 is returned * On success, the new file descriptor is returned */ static int open_term (char **buf) { const char *term = "/dev/tty"; if (!isatty (STDERR_FILENO) || (term = ttyname (STDERR_FILENO)) == 0) { if (!isatty (STDOUT_FILENO) || (term = ttyname (STDOUT_FILENO)) == 0) { if (!isatty (STDIN_FILENO) || (term = ttyname (STDIN_FILENO)) == 0) { term = "/dev/tty"; } } } *buf = xstrdup (term); return open (term, O_RDONLY); } /* Determine if reading from a pipe, and duplicate file descriptors so * it doesn't get in the way of curses' normal reading stdin for * wgetch() */ static void set_pipe_stdin (void) { char *term = NULL; FILE *pipe = stdin; int fd1, fd2; /* If unable to open a terminal, yet data is being piped, then it's * probably from the cron. * * Note: If used from the cron, it will require the * user to use a single dash to parse piped data such as: * cat access.log | goaccess - */ if ((fd1 = open_term (&term)) == -1) goto out; if ((fd2 = dup (fileno (stdin))) == -1) FATAL ("Unable to dup stdin: %s", strerror (errno)); pipe = fdopen (fd2, "r"); if (freopen (term, "r", stdin) == 0) FATAL ("Unable to open input from TTY"); if (fileno (stdin) != 0) (void) dup2 (fileno (stdin), 0); add_dash_filename (); /* no need to set it as non-blocking since we are simply outputting a * static report */ if (conf.output_stdout && !conf.real_time_html) goto out; /* Using select(), poll(), or epoll(), etc may be a better choice... */ if (fcntl (fd2, F_SETFL, fcntl (fd2, F_GETFL, 0) | O_NONBLOCK) == -1) FATAL ("Unable to set fd as non-blocking: %s.", strerror (errno)); out: glog->pipe = pipe; free (term); } /* Determine if we are getting data from the stdin, and where are we * outputting to. */ static void set_io (void) { /* For backwards compatibility, check if we are not outputting to a * terminal or if an output format was supplied */ if (!isatty (STDOUT_FILENO) || conf.output_format_idx > 0) conf.output_stdout = 1; /* dup fd if data piped */ if (!isatty (STDIN_FILENO)) set_pipe_stdin (); /* No data piped, no file was used and not loading from disk */ if (!conf.filenames_idx && !conf.read_stdin && !conf.load_from_disk) cmd_help (); } /* Process command line options and set some default options. */ static void parse_cmd_line (int argc, char **argv) { read_option_args (argc, argv); set_default_static_files (); } /* Set up signal handlers. */ static void setup_signal_handlers (void) { struct sigaction act; sigemptyset (&act.sa_mask); act.sa_flags = 0; act.sa_handler = sigsegv_handler; sigaction (SIGSEGV, &act, NULL); } static void handle_signal_action (int sig_number) { switch (sig_number) { case SIGTERM: case SIGINT: fprintf (stderr, "\nSIGINT caught!\n"); fprintf (stderr, "Closing GoAccess...\n"); stop_ws_server (gwswriter, gwsreader); conf.stop_processing = 1; break; case SIGPIPE: fprintf (stderr, "SIGPIPE caught!\n"); /* ignore it */ break; } } static void setup_thread_signals (void) { struct sigaction act; act.sa_handler = handle_signal_action; sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction (SIGINT, &act, NULL); sigaction (SIGPIPE, &act, NULL); sigaction (SIGTERM, &act, NULL); /* Restore old signal mask for the main thread */ pthread_sigmask (SIG_SETMASK, &oldset, NULL); } static void block_thread_signals (void) { /* Avoid threads catching SIGINT/SIGPIPE/SIGTERM and handle them in * main thread */ sigset_t sigset; sigemptyset (&sigset); sigaddset (&sigset, SIGINT); sigaddset (&sigset, SIGPIPE); sigaddset (&sigset, SIGTERM); pthread_sigmask (SIG_BLOCK, &sigset, &oldset); } /* Initialize various types of data. */ static void initializer (void) { /* initialize modules and set first */ gscroll.current = init_modules (); /* setup to use the current locale */ set_locale (); parse_browsers_file (); #ifdef HAVE_GEOLOCATION init_geoip (); #endif /* init glog */ glog = init_log (); set_io (); set_signal_data (glog); /* init parsing spinner */ parsing_spinner = new_gspinner (); parsing_spinner->processed = &glog->processed; } static void set_standard_output (void) { int html = 0; gwswriter = new_gwswriter (); gwsreader = new_gwsreader (); /* HTML */ if (find_output_type (NULL, "html", 0) == 0 || conf.output_format_idx == 0) html = 1; /* Spawn WebSocket server threads */ if (html && conf.real_time_html) { /* open fifo for read */ if ((gwsreader->fd = open_fifoout ()) == -1) { LOG (("Unable to open FIFO for read.\n")); return; } if (conf.daemonize) daemonize (); setup_ws_server (gwswriter, gwsreader); } setup_thread_signals (); /* Spawn progress spinner thread */ ui_spinner_create (parsing_spinner); } /* Set up curses. */ static void set_curses (int *quit) { const char *err_log = NULL; setup_thread_signals (); set_input_opts (); if (conf.no_color || has_colors () == FALSE) { conf.color_scheme = NO_COLOR; conf.no_color = 1; } else { start_color (); } init_colors (0); init_windows (&header_win, &main_win); set_curses_spinner (parsing_spinner); /* Display configuration dialog if missing formats and not piping data in */ if (!conf.read_stdin && (verify_formats () || conf.load_conf_dlg)) { refresh (); *quit = render_confdlg (glog, parsing_spinner); clear (); } /* Piping data in without log/date/time format */ else if (conf.read_stdin && (err_log = verify_formats ())) { FATAL ("%s", err_log); } /* straight parsing */ else { ui_spinner_create (parsing_spinner); } } /* Where all begins... */ int main (int argc, char **argv) { int quit = 0, ret = 0; block_thread_signals (); setup_signal_handlers (); /* command line/config options */ verify_global_config (argc, argv); parse_conf_file (&argc, &argv); parse_cmd_line (argc, argv); initializer (); /* ignore outputting, process only */ if (conf.process_and_exit) { } /* set stdout */ else if (conf.output_stdout) { set_standard_output (); } /* set curses */ else { set_curses (&quit); } /* no log/date/time format set */ if (quit) goto clean; init_processing (); /* main processing event */ time (&start_proc); if ((ret = parse_log (&glog, NULL, 0))) { end_spinner (); goto clean; } if (conf.stop_processing) goto clean; glog->offset = glog->processed; /* init reverse lookup thread */ gdns_init (); parse_initial_sort (); allocate_holder (); end_spinner (); time (&end_proc); /* ignore outputting, process only */ if (conf.process_and_exit) { #ifdef TCB_BTREE set_accumulated_time (); #endif } /* stdout */ else if (conf.output_stdout) { standard_output (); } /* curses */ else { curses_output (); } /* clean */ clean: /* done, restore tty modes and reset terminal into * non-visual mode */ if (!conf.output_stdout) endwin (); /* unable to process valid data */ if (ret) output_logerrors (glog); house_keeping (); return ret ? EXIT_FAILURE : EXIT_SUCCESS; } goaccess-1.3/src/util.c0000644000000000000000000005516113375657450011772 00000000000000/** * util.c -- a set of handy functions to help parsing * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #define _XOPEN_SOURCE 700 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "util.h" #include "error.h" #include "labels.h" #include "xmalloc.h" /* HTTP status codes categories */ static const char *code_type[][2] = { {"1", STATUS_CODE_1XX}, {"2", STATUS_CODE_2XX}, {"3", STATUS_CODE_3XX}, {"4", STATUS_CODE_4XX}, {"5", STATUS_CODE_5XX}, }; /* HTTP status codes */ static const char *codes[][2] = { {"100", STATUS_CODE_100}, {"101", STATUS_CODE_101}, {"200", STATUS_CODE_200}, {"201", STATUS_CODE_201}, {"202", STATUS_CODE_202}, {"203", STATUS_CODE_203}, {"204", STATUS_CODE_204}, {"205", STATUS_CODE_205}, {"206", STATUS_CODE_206}, {"207", STATUS_CODE_207}, {"208", STATUS_CODE_208}, {"300", STATUS_CODE_300}, {"301", STATUS_CODE_301}, {"302", STATUS_CODE_302}, {"303", STATUS_CODE_303}, {"304", STATUS_CODE_304}, {"305", STATUS_CODE_305}, {"307", STATUS_CODE_307}, {"400", STATUS_CODE_400}, {"401", STATUS_CODE_401}, {"402", STATUS_CODE_402}, {"403", STATUS_CODE_403}, {"404", STATUS_CODE_404}, {"405", STATUS_CODE_405}, {"406", STATUS_CODE_406}, {"407", STATUS_CODE_407}, {"408", STATUS_CODE_408}, {"409", STATUS_CODE_409}, {"410", STATUS_CODE_410}, {"411", STATUS_CODE_411}, {"412", STATUS_CODE_412}, {"413", STATUS_CODE_413}, {"414", STATUS_CODE_414}, {"415", STATUS_CODE_415}, {"416", STATUS_CODE_416}, {"417", STATUS_CODE_417}, {"421", STATUS_CODE_421}, {"422", STATUS_CODE_422}, {"423", STATUS_CODE_423}, {"424", STATUS_CODE_424}, {"426", STATUS_CODE_426}, {"428", STATUS_CODE_428}, {"429", STATUS_CODE_429}, {"431", STATUS_CODE_431}, {"444", STATUS_CODE_444}, {"451", STATUS_CODE_451}, {"494", STATUS_CODE_494}, {"495", STATUS_CODE_495}, {"496", STATUS_CODE_496}, {"497", STATUS_CODE_497}, {"499", STATUS_CODE_499}, {"500", STATUS_CODE_500}, {"501", STATUS_CODE_501}, {"502", STATUS_CODE_502}, {"503", STATUS_CODE_503}, {"504", STATUS_CODE_504}, {"505", STATUS_CODE_505}, {"520", STATUS_CODE_520}, {"521", STATUS_CODE_521}, {"522", STATUS_CODE_522}, {"523", STATUS_CODE_523}, {"524", STATUS_CODE_524} }; /* Return part of a string * * On error NULL is returned. * On success the extracted part of string is returned */ char * substring (const char *str, int begin, int len) { char *buffer; if (str == NULL) return NULL; if (begin < 0) begin = strlen (str) + begin; if (begin < 0) begin = 0; if (len < 0) len = 0; if (((size_t) begin) > strlen (str)) begin = strlen (str); if (((size_t) len) > strlen (&str[begin])) len = strlen (&str[begin]); if ((buffer = xmalloc (len + 1)) == NULL) return NULL; memcpy (buffer, &(str[begin]), len); buffer[len] = '\0'; return buffer; } /* A pointer to the allocated memory of the new string * * On success, a pointer to a new string is returned */ char * alloc_string (const char *str) { char *new = xmalloc (strlen (str) + 1); strcpy (new, str); return new; } /* A wrapper function to copy the first num characters of source to * destination. */ void xstrncpy (char *dest, const char *source, const size_t dest_size) { strncpy (dest, source, dest_size); if (dest_size > 0) { dest[dest_size - 1] = '\0'; } else { dest[0] = '\0'; } } /* A random string generator. */ void genstr (char *dest, size_t len) { char set[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; while (len-- > 0) *dest++ = set[rand () % (sizeof (set) - 1)]; *dest = '\0'; } /* Count the number of matches on the string `s1` given a character `c` * * If the character is not found, 0 is returned * On success, the number of characters found */ int count_matches (const char *s1, char c) { const char *ptr = s1; int n = 0; do { if (*ptr == c) n++; } while (*(ptr++)); return n; } /* String matching where one string contains wildcard characters. * * If no match found, 1 is returned. * If match found, 0 is returned. */ static int wc_match (const char *wc, char *str) { while (*wc && *str) { if (*wc == '*') { while (*wc && *wc == '*') wc++; if (!*wc) return 1; while (*str && *str != *wc) str++; } else if (*wc == '?' || *wc == *str) { wc++; str++; } else { break; } } if (!*wc && !*str) return 1; return 0; } /* Determine if the given host needs to be ignored given the list of * referrers to ignore. * * On error, or the referrer is not found, 0 is returned * On success, or if the host needs to be ignored, 1 is returned */ int ignore_referer (const char *host) { char *needle = NULL; int i, ignore = 0; if (conf.ignore_referer_idx == 0) return 0; if (host == NULL || *host == '\0') return 0; needle = xstrdup (host); for (i = 0; i < conf.ignore_referer_idx; ++i) { if (conf.ignore_referers[i] == NULL || *conf.ignore_referers[i] == '\0') continue; if (wc_match (conf.ignore_referers[i], needle)) { ignore = 1; goto out; } } out: free (needle); return ignore; } /* Determine if the given host needs to be hidden given the list of * referrers to hide. * * On error, or the referrer is not found, 0 is returned * On success, or if the host needs to be ignored, 1 is returned */ int hide_referer (const char *host) { char *needle = NULL; int i, ignore = 0; if (conf.hide_referer_idx == 0) return 0; if (host == NULL || *host == '\0') return 0; needle = xstrdup (host); for (i = 0; i < conf.hide_referer_idx; ++i) { if (conf.hide_referers[i] == NULL || *conf.hide_referers[i] == '\0') continue; if (wc_match (conf.hide_referers[i], needle)) { ignore = 1; goto out; } } out: free (needle); return ignore; } /* Determine if the given ip is within a range of IPs. * * On error, or not within the range, 0 is returned * On success, or if within the range, 1 is returned */ static int within_range (const char *ip, const char *start, const char *end) { struct in6_addr addr6, start6, end6; struct in_addr addr4, start4, end4; if (start == NULL || *start == '\0') return 0; if (end == NULL || *end == '\0') return 0; if (ip == NULL || *ip == '\0') return 0; /* IPv4 */ if (1 == inet_pton (AF_INET, ip, &addr4)) { if (1 != inet_pton (AF_INET, start, &start4)) return 0; if (1 != inet_pton (AF_INET, end, &end4)) return 0; if (memcmp (&addr4, &start4, sizeof (addr4)) >= 0 && memcmp (&addr4, &end4, sizeof (addr4)) <= 0) return 1; } /* IPv6 */ else if (1 == inet_pton (AF_INET6, ip, &addr6)) { if (1 != inet_pton (AF_INET6, start, &start6)) return 0; if (1 != inet_pton (AF_INET6, end, &end6)) return 0; if (memcmp (&addr6, &start6, sizeof (addr6)) >= 0 && memcmp (&addr6, &end6, sizeof (addr6)) <= 0) return 1; } return 0; } /* Determine if the given IP needs to be ignored given the list of IPs * to ignore. * * On error, or not within the range, 0 is returned * On success, or if within the range, 1 is returned */ int ip_in_range (const char *ip) { char *start = NULL, *end, *dash; int i; for (i = 0; i < conf.ignore_ip_idx; ++i) { end = NULL; if (conf.ignore_ips[i] == NULL || *conf.ignore_ips[i] == '\0') continue; start = xstrdup (conf.ignore_ips[i]); /* split range */ if ((dash = strchr (start, '-')) != NULL) { *dash = '\0'; end = dash + 1; } /* matches single IP */ if (end == NULL && start) { if (strcmp (ip, start) == 0) { free (start); return 1; } } /* within range */ else if (start && end) { if (within_range (ip, start, end)) { free (start); return 1; } } free (start); } return 0; } /* Searches the array of output formats for the given extension value. * * If not found, 1 is returned. * On success, the given filename is malloc'd and assigned and 0 is * returned. */ int find_output_type (char **filename, const char *ext, int alloc) { int i; const char *dot = NULL; for (i = 0; i < conf.output_format_idx; ++i) { /* for backwards compatibility. i.e., -o json */ if (strcmp (conf.output_formats[i], ext) == 0) return 0; if ((dot = strrchr (conf.output_formats[i], '.')) != NULL && strcmp (dot + 1, ext) == 0) { if (alloc) *filename = xstrdup (conf.output_formats[i]); return 0; } } return 1; } /* Validates the '-o' filename extension for any of: * 1) .csv * 2) .json * 3) .html * * Return Value * 1: valid * 0: invalid * -1: non-existent extension */ int valid_output_type (const char *filename) { const char *ext = NULL; size_t sl; if ((ext = strrchr (filename, '.')) == NULL) return -1; ext++; /* Is extension 3<=len<=4? */ sl = strlen (ext); if (sl < 3 || sl > 4) return 0; if (strcmp ("html", ext) == 0) return 1; if (strcmp ("json", ext) == 0) return 1; if (strcmp ("csv", ext) == 0) return 1; return 0; } /* Search the environment HOME variable and append GoAccess' config * file. * * On error, it outputs an error message and the program terminates. * On success, the path of HOME and the config file is returned. */ char * get_home (void) { char *user_home = NULL, *path = NULL; user_home = getenv ("HOME"); if (user_home == NULL) FATAL ("Unable to determine the HOME environment variable."); path = xmalloc (snprintf (NULL, 0, "%s/.goaccessrc", user_home) + 1); sprintf (path, "%s/.goaccessrc", user_home); return path; } /* Get the path to the global config file. * * On success, the path of the global config file is returned. */ char * get_global_config (void) { char *path = NULL; path = xmalloc (snprintf (NULL, 0, "%s/goaccess.conf", SYSCONFDIR) + 1); sprintf (path, "%s/goaccess.conf", SYSCONFDIR); return path; } /* A self-checking wrapper to convert_date(). * * On error, a newly malloc'd '---' string is returned. * On success, a malloc'd 'Ymd' date is returned. */ char * get_visitors_date (const char *odate, const char *from, const char *to) { char date[DATE_TIME] = ""; /* Ymd */ memset (date, 0, sizeof *date); /* verify we have a valid date conversion */ if (convert_date (date, odate, from, to, DATE_TIME) == 0) return xstrdup (date); LOG_DEBUG (("invalid date: %s", odate)); return xstrdup ("---"); } /* Format the given date/time according the given format. * * On error, 1 is returned. * On success, 0 is returned. */ #pragma GCC diagnostic ignored "-Wformat-nonliteral" int str_to_time (const char *str, const char *fmt, struct tm *tm) { char *end = NULL, *sEnd = NULL; unsigned long long usecs = 0; if (str == NULL || *str == '\0' || fmt == NULL || *fmt == '\0') return 1; /* check if char string needs to be converted from microseconds */ if (strcmp ("%f", fmt) == 0) { errno = 0; tm->tm_year = 1970 - 1900; tm->tm_mday = 1; usecs = strtoull (str, &sEnd, 10); if (str == sEnd || *sEnd != '\0' || errno == ERANGE) return 1; tm->tm_sec = usecs / SECS; tm->tm_isdst = -1; if (mktime (tm) == -1) return 1; return 0; } end = strptime (str, fmt, tm); if (end == NULL || *end != '\0') return 1; return 0; } /* Convert a date from one format to another and store inot the given buffer. * * On error, 1 is returned. * On success, 0 is returned. */ int convert_date (char *res, const char *data, const char *from, const char *to, int size) { struct tm tm; memset (&tm, 0, sizeof (tm)); timestamp = time (NULL); now_tm = localtime (×tamp); if (str_to_time (data, from, &tm) != 0) return 1; /* if not a timestamp, use current year if not passed */ if (!has_timestamp (from) && strpbrk (from, "Yy") == NULL) tm.tm_year = now_tm->tm_year; if (strftime (res, size, to, &tm) <= 0) return 1; return 0; } #pragma GCC diagnostic warning "-Wformat-nonliteral" /* Determine if the given IP is a valid IPv4/IPv6 address. * * On error, 1 is returned. * On success, 0 is returned. */ int invalid_ipaddr (char *str, int *ipvx) { union { struct sockaddr addr; struct sockaddr_in6 addr6; struct sockaddr_in addr4; } a; (*ipvx) = TYPE_IPINV; if (str == NULL || *str == '\0') return 1; memset (&a, 0, sizeof (a)); if (1 == inet_pton (AF_INET, str, &a.addr4.sin_addr)) { (*ipvx) = TYPE_IPV4; return 0; } else if (1 == inet_pton (AF_INET6, str, &a.addr6.sin6_addr)) { (*ipvx) = TYPE_IPV6; return 0; } return 1; } /* Get information about the filename. * * On error, -1 is returned. * On success, the file size of the given filename. */ off_t file_size (const char *filename) { struct stat st; if (stat (filename, &st) == 0) return st.st_size; LOG_DEBUG (("Can't determine size of %s: %s\n", filename, strerror (errno))); return -1; } /* Determine if the given status code is within the list of status * codes and find out the status type/category. * * If not found, "Unknown" is returned. * On success, the status code type/category is returned. */ const char * verify_status_code_type (const char *str) { size_t i; for (i = 0; i < ARRAY_SIZE (code_type); i++) if (strchr (code_type[i][0], str[0]) != NULL) return _(code_type[i][1]); return "Unknown"; } /* Determine if the given status code is within the list of status * codes. * * If not found, "Unknown" is returned. * On success, the status code is returned. */ const char * verify_status_code (char *str) { size_t i; for (i = 0; i < ARRAY_SIZE (codes); i++) if (strstr (str, codes[i][0]) != NULL) return _(codes[i][1]); return "Unknown"; } /* Checks if the given string is within the given array. * * If not found, -1 is returned. * If found, the key for needle in the array is returned. */ int str_inarray (const char *s, const char *arr[], int size) { int i; for (i = 0; i < size; i++) { if (strcmp (arr[i], s) == 0) return i; } return -1; } /* Strip whitespace from the beginning of a string. * * On success, a string with whitespace stripped from the beginning of * the string is returned. */ char * ltrim (char *s) { char *begin = s; while (isspace (*begin)) ++begin; memmove (s, begin, strlen (begin) + 1); return s; } /* Strip whitespace from the end of a string. * * On success, a string with whitespace stripped from the end of the * string is returned. */ char * rtrim (char *s) { char *end = s + strlen (s); while ((end != s) && isspace (*(end - 1))) --end; *end = '\0'; return s; } /* Strip whitespace from the beginning and end of the string. * * On success, the trimmed string is returned. */ char * trim_str (char *str) { return rtrim (ltrim (str)); } /* Convert the file size in bytes to a human readable format. * * On error, the original size of the string in bytes is returned. * On success, the file size in a human readable format is returned. */ char * filesize_str (unsigned long long log_size) { char *size = xmalloc (sizeof (char) * 12); if (log_size >= (1ULL << 50)) snprintf (size, 12, "%.2f PiB", (double) (log_size) / PIB (1ULL)); else if (log_size >= (1ULL << 40)) snprintf (size, 12, "%.2f TiB", (double) (log_size) / TIB (1ULL)); else if (log_size >= (1ULL << 30)) snprintf (size, 12, "%.2f GiB", (double) (log_size) / GIB (1ULL)); else if (log_size >= (1ULL << 20)) snprintf (size, 12, "%.2f MiB", (double) (log_size) / MIB (1ULL)); else if (log_size >= (1ULL << 10)) snprintf (size, 12, "%.2f KiB", (double) (log_size) / KIB (1ULL)); else snprintf (size, 12, "%.1f B", (double) (log_size)); return size; } /* Convert microseconds to a human readable format. * * On error, a malloc'd string in microseconds is returned. * On success, the time in a human readable format is returned. */ char * usecs_to_str (unsigned long long usec) { char *size = xmalloc (sizeof (char) * 11); if (usec >= DAY) snprintf (size, 11, "%.2f d", (double) (usec) / DAY); else if (usec >= HOUR) snprintf (size, 11, "%.2f hr", (double) (usec) / HOUR); else if (usec >= MINS) snprintf (size, 11, "%.2f mn", (double) (usec) / MINS); else if (usec >= SECS) snprintf (size, 11, "%.2f s", (double) (usec) / SECS); else if (usec >= MILS) snprintf (size, 11, "%.2f ms", (double) (usec) / MILS); else snprintf (size, 11, "%.2f us", (double) (usec)); return size; } /* Convert the given int to a string with the ability to add some * padding. * * On success, the given number as a string is returned. */ char * int2str (int d, int width) { char *s = xmalloc (snprintf (NULL, 0, "%*d", width, d) + 1); sprintf (s, "%*d", width, d); return s; } /* Convert the given float to a string with the ability to add some * padding. * * On success, the given number as a string is returned. */ char * float2str (float d, int width) { char *s = xmalloc (snprintf (NULL, 0, "%*.2f", width, d) + 1); sprintf (s, "%*.2f", width, d); return s; } /* Determine the length of an integer (number of digits). * * On success, the length of the number is returned. */ int intlen (int num) { int l = 1; while (num > 9) { l++; num /= 10; } return l; } /* Allocate a new string and fill it with the given character. * * On success, the newly allocated string is returned. */ char * char_repeat (int n, char c) { char *dest = xmalloc (n + 1); memset (dest, c, n); dest[n] = '\0'; return dest; } /* Replace all occurrences of the given char with the replacement * char. * * On error the original string is returned. * On success, a string with the replaced values is returned. */ char * char_replace (char *str, char o, char n) { char *p = str; if (str == NULL || *str == '\0') return str; while ((p = strchr (p, o)) != NULL) *p++ = n; return str; } /* Remove all occurrences of a new line. * * On success, a string with the replaced new lines is returned. */ void strip_newlines (char *str) { char *src, *dst; for (src = dst = str; *src != '\0'; src++) { *dst = *src; if (*dst != '\r' && *dst != '\n') dst++; } *dst = '\0'; } /* Strip blanks from a string. * * On success, a string without whitespace is returned. */ char * deblank (char *str) { char *out = str, *put = str; for (; *str != '\0'; ++str) { if (*str != ' ') *put++ = *str; } *put = '\0'; return out; } /* Make a string uppercase. * * On error the original string is returned. * On success, the uppercased string is returned. */ char * strtoupper (char *str) { char *p = str; if (str == NULL || *str == '\0') return str; while (*p != '\0') { *p = toupper (*p); p++; } return str; } /* Left-pad a string with n amount of spaces. * * On success, a left-padded string is returned. */ char * left_pad_str (const char *s, int indent) { char *buf = NULL; indent = strlen (s) + indent; buf = xmalloc (snprintf (NULL, 0, "%*s", indent, s) + 1); sprintf (buf, "%*s", indent, s); return buf; } /* Append the source string to destination and reallocates and * updating the destination buffer appropriately. */ void append_str (char **dest, const char *src) { size_t curlen = strlen (*dest); size_t srclen = strlen (src); size_t newlen = curlen + srclen; char *str = xrealloc (*dest, newlen + 1); memcpy (str + curlen, src, srclen + 1); *dest = str; } /* Escapes the special characters, e.g., '\n', '\r', '\t', '\' * in the string source by inserting a '\' before them. * * On error NULL is returned. * On success the escaped string is returned */ char * escape_str (const char *src) { char *dest, *q; const unsigned char *p; if (src == NULL || *src == '\0') return NULL; p = (unsigned char *) src; q = dest = xmalloc (strlen (src) * 4 + 1); while (*p) { switch (*p) { case '\\': *q++ = '\\'; *q++ = '\\'; break; case '\n': *q++ = '\\'; *q++ = 'n'; break; case '\r': *q++ = '\\'; *q++ = 'r'; break; case '\t': *q++ = '\\'; *q++ = 't'; break; default: /* not ASCII */ if ((*p < ' ') || (*p >= 0177)) { *q++ = '\\'; *q++ = '0' + (((*p) >> 6) & 07); *q++ = '0' + (((*p) >> 3) & 07); *q++ = '0' + ((*p) & 07); } else *q++ = *p; break; } p++; } *q = 0; return dest; } /* Get an unescaped malloc'd string * * On error NULL is returned. * On success the unescaped string is returned */ char * unescape_str (const char *src) { char *dest, *q; const char *p = src; if (src == NULL || *src == '\0') return NULL; dest = xmalloc (strlen (src) + 1); q = dest; while (*p) { if (*p == '\\') { p++; switch (*p) { case '\0': /* warning... */ goto out; case 'n': *q++ = '\n'; break; case 'r': *q++ = '\r'; break; case 't': *q++ = '\t'; break; default: *q++ = *p; break; } } else *q++ = *p; p++; } out: *q = 0; return dest; } goaccess-1.3/src/gkhash.h0000644000000000000000000001645013375657450012265 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GKHASH_H_INCLUDED #define GKHASH_H_INCLUDED #include #include "gslist.h" #include "gstorage.h" #include "khash.h" #include "parser.h" /* int keys, int payload */ KHASH_MAP_INIT_INT (ii32, int); /* int keys, string payload */ KHASH_MAP_INIT_INT (is32, char *); /* int keys, uint64_t payload */ KHASH_MAP_INIT_INT (iu64, uint64_t); /* string keys, int payload */ KHASH_MAP_INIT_STR (si32, int); /* string keys, string payload */ KHASH_MAP_INIT_STR (ss32, char *); /* int keys, GSLList payload */ KHASH_MAP_INIT_INT (igsl, GSLList *); /* string keys, uint64_t payload */ KHASH_MAP_INIT_STR (su64, uint64_t); /* Metrics Storage */ /* Maps keys (string) to numeric values (integer). * This mitigates the issue of having multiple stores * with the same string key, and therefore, avoids unnecessary * memory usage (in most cases). * * HEAD|/index.php -> 1 * POST|/index.php -> 2 * Windows XP -> 3 * Ubuntu 10.10 -> 4 * GET|Ubuntu 10.10 -> 5 * Linux -> 6 * 26/Dec/2014 -> 7 * Windows -> 8 */ /*khash_t(si32) MTRC_KEYMAP */ /* Maps integer keys of root elements from the keymap hash * to actual string values. * * 6 -> Linux * 8 -> Windows */ /*khash_t(is32) MTRC_ROOTMAP */ /* Maps integer keys of data elements from the keymap hash * to actual string values. * * 1 -> /index.php * 2 -> /index.php * 3 -> Windows XP * 4 -> Ubuntu 10.10 * 5 -> Ubuntu 10.10 * 7 -> 26/Dec/2014 */ /*khash_t(is32) MTRC_DATAMAP */ /* Maps a string key made from the integer key of the * IP/date/UA and the integer key from the data field of * each module to numeric autoincremented values. e.g., "1|4" * => 1 -> unique visitor key (concatenated) with 4 -> data * key. * * "1|4" -> 1 * "1|5" -> 2 */ /*khash_t(si32) MTRC_UNIQMAP */ /* Maps integer key from the keymap hash to the number of * hits. * * 1 -> 10934 * 2 -> 3231 * 3 -> 500 * 4 -> 201 * 5 -> 206 */ /*khash_t(ii32) MTRC_HITS */ /* Maps numeric keys made from the uniqmap store to autoincremented values * (counter). * 10 -> 100 * 40 -> 56 */ /*khash_t(ii32) MTRC_VISITORS */ /* Maps numeric data keys to bandwidth (in bytes). * 1 -> 1024 * 2 -> 2048 */ /*khash_t(iu64) MTRC_BW */ /* Maps numeric data keys to cumulative time served (in usecs/msecs). * 1 -> 187 * 2 -> 208 */ /*khash_t(iu64) MTRC_CUMTS */ /* Maps numeric data keys to max time served (in usecs/msecs). * 1 -> 1287 * 2 -> 2308 */ /*khash_t(iu64) MTRC_MAXTS */ /* Maps numeric data keys to string values. * 1 -> GET * 2 -> POST */ /*khash_t(is32) MTRC_METHODS */ /* Maps numeric data keys to string values. * 1 -> HTTP/1.1 * 2 -> HTTP/1.0 */ /*khash_t(is32) MTRC_PROTOCOLS */ /* Maps numeric unique user-agent keys to the * corresponding numeric value. * 1 -> 3 * 2 -> 4 */ /*khash_t(igsl) MTRC_AGENTS */ /* Enumerated Storage Metrics */ typedef enum GSMetricType_ { /* int key - int val */ MTRC_TYPE_II32, /* int key - string val */ MTRC_TYPE_IS32, /* int key - uint64_t val */ MTRC_TYPE_IU64, /* string key - int val */ MTRC_TYPE_SI32, /* string key - string val */ MTRC_TYPE_SS32, /* int key - GSLList val */ MTRC_TYPE_IGSL, /* string key - uint64_t val */ MTRC_TYPE_SU64, } GSMetricType; typedef struct GKHashMetric_ { GSMetric metric; GSMetricType type; union { khash_t (ii32) * ii32; khash_t (is32) * is32; khash_t (iu64) * iu64; khash_t (si32) * si32; khash_t (ss32) * ss32; khash_t (igsl) * igsl; khash_t (su64) * su64; }; } GKHashMetric; /* Data Storage per module */ typedef struct GKHashStorage_ { GModule module; GKHashMetric metrics[GSMTRC_TOTAL]; } GKHashStorage; void free_storage (void); void init_storage (void); int ht_insert_agent_key (const char *key); int ht_insert_agent_value (int key, const char *value); int ht_insert_unique_key (const char *key); int ht_insert_agent (GModule module, int key, int value); int ht_insert_bw (GModule module, int key, uint64_t inc); int ht_insert_cumts (GModule module, int key, uint64_t inc); int ht_insert_datamap (GModule module, int key, const char *value); int ht_insert_hits (GModule module, int key, int inc); int ht_insert_hostname (const char *ip, const char *host); int ht_insert_keymap (GModule module, const char *key); int ht_insert_maxts (GModule module, int key, uint64_t value); int ht_insert_meta_data (GModule module, const char *key, uint64_t value); int ht_insert_method (GModule module, int key, const char *value); int ht_insert_protocol (GModule module, int key, const char *value); int ht_insert_root (GModule module, int key, int value); int ht_insert_rootmap (GModule module, int key, const char *value); int ht_insert_uniqmap (GModule module, const char *key); int ht_insert_visitor (GModule module, int key, int inc); uint32_t ht_get_size_datamap (GModule module); uint32_t ht_get_size_uniqmap (GModule module); char *ht_get_datamap (GModule module, int key); char *ht_get_host_agent_val (int key); char *ht_get_hostname (const char *host); char *ht_get_method (GModule module, int key); char *ht_get_protocol (GModule module, int key); char *ht_get_root (GModule module, int key); GSLList *ht_get_host_agent_list (GModule module, int key); int ht_get_hits (GModule module, int key); int ht_get_keymap (GModule module, const char *key); int ht_get_uniqmap (GModule module, const char *key); int ht_get_visitors (GModule module, int key); uint64_t ht_get_bw (GModule module, int key); uint64_t ht_get_cumts (GModule module, int key); uint64_t ht_get_maxts (GModule module, int key); uint64_t ht_get_meta_data (GModule module, const char *key); void ht_get_bw_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_cumts_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_hits_min_max (GModule module, int *min, int *max); void ht_get_maxts_min_max (GModule module, uint64_t * min, uint64_t * max); void ht_get_visitors_min_max (GModule module, int *min, int *max); GRawData *parse_raw_data (GModule module); #endif // for #ifndef GKHASH_H goaccess-1.3/src/output.c0000644000000000000000000007466213375661415012360 00000000000000/** * output.c -- output to the standard output stream * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include #include #include #include #include #include "output.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "error.h" #include "gwsocket.h" #include "json.h" #include "settings.h" #include "ui.h" #include "util.h" #include "xmalloc.h" #include "tpls.h" #include "bootstrapcss.h" #include "facss.h" #include "appcss.h" #include "d3js.h" #include "hoganjs.h" #include "chartsjs.h" #include "appjs.h" static void hits_bw_plot (FILE * fp, GHTMLPlot plot, int sp); static void hits_bw_req_plot (FILE * fp, GHTMLPlot plot, int sp); static void hits_visitors_plot (FILE * fp, GHTMLPlot plot, int sp); static void hits_visitors_req_plot (FILE * fp, GHTMLPlot plot, int sp); static void print_metrics (FILE * fp, const GHTML * def, int sp); static void print_host_metrics (FILE * fp, const GHTML * def, int sp); /* *INDENT-OFF* */ static GHTML htmldef[] = { {VISITORS, 1, print_metrics, { {CHART_AREASPLINE, hits_visitors_plot, 1, 1} , {CHART_AREASPLINE, hits_bw_plot, 1, 1} , }}, {REQUESTS, 1, print_metrics, { {CHART_VBAR, hits_visitors_req_plot, 0, 0}, {CHART_VBAR, hits_bw_req_plot, 0, 0}, }}, {REQUESTS_STATIC, 1, print_metrics, { {CHART_VBAR, hits_visitors_req_plot, 0, 0}, {CHART_VBAR, hits_bw_req_plot, 0, 0}, }}, {NOT_FOUND, 1, print_metrics, { {CHART_VBAR, hits_visitors_req_plot, 0, 0}, {CHART_VBAR, hits_bw_req_plot, 0, 0}, }}, {HOSTS, 1, print_host_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, {OS, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 1}, {CHART_VBAR, hits_bw_plot, 0, 1}, }}, {BROWSERS, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 1}, {CHART_VBAR, hits_bw_plot, 0, 1}, }}, {VISIT_TIMES, 1, print_metrics, { {CHART_AREASPLINE, hits_visitors_plot, 0, 1}, {CHART_AREASPLINE, hits_bw_plot, 0, 1}, }}, {VIRTUAL_HOSTS, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, {REFERRERS, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, {REFERRING_SITES, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, {KEYPHRASES, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, {STATUS_CODES, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 1}, {CHART_VBAR, hits_bw_plot, 0, 1}, }}, {REMOTE_USER, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 0}, {CHART_VBAR, hits_bw_plot, 0, 0}, }}, #ifdef HAVE_GEOLOCATION {GEO_LOCATION, 1, print_metrics, { {CHART_VBAR, hits_visitors_plot, 0, 1}, {CHART_VBAR, hits_bw_plot, 0, 1}, }}, #endif }; /* *INDENT-ON* */ /* number of new lines (applicable fields) */ static int nlines = 0; /* Get the chart type for the JSON definition. * * On success, the chart type string is returned. */ static const char * chart2str (GChartType type) { static const char *strings[] = { "null", "bar", "area-spline" }; return strings[type]; } /* Get panel output data for the given module. * * If not found, NULL is returned. * On success, panel data is returned . */ static GHTML * panel_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (htmldef); for (i = 0; i < num_panels; i++) { if (htmldef[i].module == module) return &htmldef[i]; } return NULL; } /* Sanitize output with html entities for special chars */ static void clean_output (FILE * fp, char *s) { if (!s) { LOG_DEBUG (("NULL data on clean_output.\n")); return; } while (*s) { switch (*s) { case '\'': fprintf (fp, "'"); break; case '"': fprintf (fp, """); break; case '&': fprintf (fp, "&"); break; case '<': fprintf (fp, "<"); break; case '>': fprintf (fp, ">"); break; case ' ': fprintf (fp, " "); break; default: fputc (*s, fp); break; } s++; } } /* Set the HTML document title and the generated date/time */ static void print_html_title (FILE * fp) { const char *title = conf.html_report_title ? conf.html_report_title : HTML_REPORT_TITLE; fprintf (fp, ""); clean_output (fp, (char *) title); fprintf (fp, ""); } /* *INDENT-OFF* */ /* Output all the document head elements. */ static void print_html_header (FILE * fp) { fprintf (fp, "" "" "" "" "" "" "" "" "", _(DOC_LANG)); print_html_title (fp); fprintf (fp, "", fa_css); fprintf (fp, "", bootstrap_css); fprintf (fp, "", app_css); /* load custom CSS file, if any */ if (conf.html_custom_css) fprintf (fp, "", conf.html_custom_css); fprintf (fp, "" ""); } /* Output all structural elements of the HTML document. */ static void print_html_body (FILE * fp, const char *now) { fprintf (fp, "" "" "
" "
" "
" "
" "" "
" "
" "
" "
" "
" "
", conf.html_report_title ? conf.html_report_title : ""); fprintf (fp, "%s", tpls); } /* Output all the document footer elements such as script and closing * tags. */ static void print_html_footer (FILE * fp) { fprintf (fp, "", d3_js); fprintf (fp, "", hogan_js); fprintf (fp, "", app_js); fprintf (fp, "", charts_js); /* load custom JS file, if any */ if (conf.html_custom_js) fprintf (fp, "", conf.html_custom_js); fprintf (fp, ""); fprintf (fp, ""); } /* *INDENT-ON* */ static const GChartDef ChartDefStopper = { NULL, NULL }; /* Get the number of chart definitions per panel. * * The number of chart definitions is returned . */ static int get_chartdef_cnt (GChart * chart) { GChartDef *def = chart->def; while (memcmp (def, &ChartDefStopper, sizeof ChartDefStopper)) ++def; return def - chart->def; } /* Output the given JSON chart axis definition for the given panel. */ static void print_d3_chart_def_axis (FILE * fp, GChart * chart, size_t cnt, int isp) { GChartDef *def = chart->def; size_t j = 0; for (j = 0; j < cnt; ++j) { if (strchr (def[j].value, '[') != NULL) fpskeyaval (fp, def[j].key, def[j].value, isp, j == cnt - 1); else fpskeysval (fp, def[j].key, def[j].value, isp, j == cnt - 1); } } /* Output the given JSON chart definition for the given panel. */ static void print_d3_chart_def (FILE * fp, GChart * chart, size_t n, int sp) { size_t i = 0, cnt = 0; int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; for (i = 0; i < n; ++i) { cnt = get_chartdef_cnt (chart + i); fpopen_obj_attr (fp, chart[i].key, sp); print_d3_chart_def_axis (fp, chart + i, cnt, isp); fpclose_obj (fp, sp, (i == n - 1)); } } static void print_plot_def (FILE * fp, const GHTMLPlot plot, GChart * chart, int n, int sp) { int isp = 0, iisp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1, iisp = sp + 2; fpskeysval (fp, "className", plot.chart_key, isp, 0); fpskeysval (fp, "label", plot.chart_lbl, isp, 0); fpskeysval (fp, "chartType", chart2str (plot.chart_type), isp, 0); fpskeyival (fp, "chartReverse", plot.chart_reverse, isp, 0); fpskeyival (fp, "redrawOnExpand", plot.redraw_expand, isp, 0); /* D3.js data */ fpopen_obj_attr (fp, "d3", isp); /* print chart definitions */ print_d3_chart_def (fp, chart, n, iisp); /* close D3 */ fpclose_obj (fp, isp, 1); } /* Output D3.js hits/visitors plot definitions. */ static void hits_visitors_plot (FILE * fp, GHTMLPlot plot, int sp) { /* *INDENT-OFF* */ GChart def[] = { {"y0", (GChartDef[]) { {"key", "hits"}, {"label", MTRC_HITS_LBL}, ChartDefStopper }}, {"y1", (GChartDef[]) { {"key", "visitors"}, {"label", MTRC_VISITORS_LBL}, ChartDefStopper }}, }; plot.chart_key = (char[]) {"hits-visitors"}; plot.chart_lbl = (char *) {HTML_PLOT_HITS_VIS}; /* *INDENT-ON* */ print_plot_def (fp, plot, def, ARRAY_SIZE (def), sp); } /* Output D3.js hits/visitors plot definitions. */ static void hits_visitors_req_plot (FILE * fp, GHTMLPlot plot, int sp) { /* *INDENT-OFF* */ GChart def[] = { {"x", (GChartDef[]) { {"key", "[\"method\", \"data\", \"protocol\"]"}, ChartDefStopper }}, {"y0", (GChartDef[]) { {"key", "hits"}, {"label", MTRC_HITS_LBL}, ChartDefStopper }}, {"y1", (GChartDef[]) { {"key", "visitors"}, {"label", MTRC_VISITORS_LBL}, ChartDefStopper }}, }; plot.chart_key = (char[]) {"hits-visitors"}; plot.chart_lbl = (char *) {HTML_PLOT_HITS_VIS}; /* *INDENT-ON* */ print_plot_def (fp, plot, def, ARRAY_SIZE (def), sp); } /* Output C3.js bandwidth plot definitions. */ static void hits_bw_plot (FILE * fp, GHTMLPlot plot, int sp) { /* *INDENT-OFF* */ GChart def[] = { {"y0", (GChartDef[]) { {"key", "bytes"}, {"label", MTRC_BW_LBL}, {"format", "bytes"}, ChartDefStopper }}, }; if (!conf.bandwidth) return; plot.chart_key = (char[]) {"bandwidth"}; plot.chart_lbl = (char *) {MTRC_BW_LBL}; /* *INDENT-ON* */ print_plot_def (fp, plot, def, ARRAY_SIZE (def), sp); } /* Output C3.js bandwidth plot definitions. */ static void hits_bw_req_plot (FILE * fp, GHTMLPlot plot, int sp) { /* *INDENT-OFF* */ GChart def[] = { {"x", (GChartDef[]) { {"key", "[\"method\", \"protocol\", \"data\"]"}, ChartDefStopper }}, {"y0", (GChartDef[]) { {"key", "bytes"}, {"label", MTRC_BW_LBL}, {"format", "bytes"}, ChartDefStopper }}, }; if (!conf.bandwidth) return; plot.chart_key = (char[]) {"bandwidth"}; plot.chart_lbl = (char *) {MTRC_BW_LBL}; /* *INDENT-ON* */ print_plot_def (fp, plot, def, ARRAY_SIZE (def), sp); } /* Output JSON data definitions. */ static void print_json_data (FILE * fp, GLog * glog, GHolder * holder) { char *json = NULL; if ((json = get_json (glog, holder, 1)) == NULL) return; fprintf (fp, ""); free (json); } /* Output WebSocket connection definition. */ static void print_conn_def (FILE * fp) { int sp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) sp += 1; if (!conf.real_time_html) return; fprintf (fp, ""); } /* Output JSON per panel metric definitions. */ static void print_def_metric (FILE * fp, const GDefMetric def, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; if (def.cname) fpskeysval (fp, "className", def.cname, isp, 0); if (def.cwidth) fpskeysval (fp, "colWidth", def.cwidth, isp, 0); if (def.metakey) fpskeysval (fp, "meta", def.metakey, isp, 0); if (def.metatype) fpskeysval (fp, "metaType", def.metatype, isp, 0); if (def.metalbl) fpskeysval (fp, "metaLabel", def.metalbl, isp, 0); if (def.datatype) fpskeysval (fp, "dataType", def.datatype, isp, 0); if (def.datakey) fpskeysval (fp, "key", def.datakey, isp, 0); if (def.lbl) fpskeysval (fp, "label", def.lbl, isp, 1); } /* Output JSON metric definition block. */ static void print_def_block (FILE * fp, const GDefMetric def, int sp, int last) { fpopen_obj (fp, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, last); } /* Output JSON overall requests definition block. */ static void print_def_overall_requests (FILE * fp, int sp) { GDefMetric def = { .lbl = T_REQUESTS, .datatype = "numeric", .cname = "black" }; fpopen_obj_attr (fp, OVERALL_REQ, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall valid requests definition block. */ static void print_def_overall_valid_reqs (FILE * fp, int sp) { GDefMetric def = { .lbl = T_VALID, .datatype = "numeric", .cname = "green" }; fpopen_obj_attr (fp, OVERALL_VALID, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall invalid requests definition block. */ static void print_def_overall_invalid_reqs (FILE * fp, int sp) { GDefMetric def = { .lbl = T_FAILED, .datatype = "numeric", .cname = "red" }; fpopen_obj_attr (fp, OVERALL_FAILED, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON process time definition block. */ static void print_def_overall_processed_time (FILE * fp, int sp) { GDefMetric def = { .lbl = T_GEN_TIME, .datatype = "secs", .cname = "gray" }; fpopen_obj_attr (fp, OVERALL_GENTIME, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall visitors definition block. */ static void print_def_overall_visitors (FILE * fp, int sp) { GDefMetric def = { .lbl = T_UNIQUE_VISITORS, .datatype = "numeric", .cname = "blue" }; fpopen_obj_attr (fp, OVERALL_VISITORS, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall files definition block. */ static void print_def_overall_files (FILE * fp, int sp) { GDefMetric def = { .lbl = T_UNIQUE_FILES, .datatype = "numeric", }; fpopen_obj_attr (fp, OVERALL_FILES, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall excluded requests definition block. */ static void print_def_overall_excluded (FILE * fp, int sp) { GDefMetric def = { .lbl = T_EXCLUDE_IP, .datatype = "numeric", }; fpopen_obj_attr (fp, OVERALL_EXCL_HITS, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall referrers definition block. */ static void print_def_overall_refs (FILE * fp, int sp) { GDefMetric def = { .lbl = T_REFERRER, .datatype = "numeric", }; fpopen_obj_attr (fp, OVERALL_REF, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall not found definition block. */ static void print_def_overall_notfound (FILE * fp, int sp) { GDefMetric def = { .lbl = T_UNIQUE404, .datatype = "numeric", }; fpopen_obj_attr (fp, OVERALL_NOTFOUND, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall static files definition block. */ static void print_def_overall_static_files (FILE * fp, int sp) { GDefMetric def = { .lbl = T_STATIC_FILES, .datatype = "numeric", }; fpopen_obj_attr (fp, OVERALL_STATIC, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON log size definition block. */ static void print_def_overall_log_size (FILE * fp, int sp) { GDefMetric def = { .lbl = T_LOG, .datatype = "bytes", }; fpopen_obj_attr (fp, OVERALL_LOGSIZE, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 0); } /* Output JSON overall bandwidth definition block. */ static void print_def_overall_bandwidth (FILE * fp, int sp) { GDefMetric def = { .lbl = T_BW, .datatype = "bytes", }; fpopen_obj_attr (fp, OVERALL_BANDWIDTH, sp); print_def_metric (fp, def, sp); fpclose_obj (fp, sp, 1); } /* Output JSON hits definition block. */ static void print_def_hits (FILE * fp, int sp) { GDefMetric def = { .datakey = "hits", .lbl = MTRC_HITS_LBL, .datatype = "numeric", .metakey = "count", .cwidth = "12%", }; print_def_block (fp, def, sp, 0); } /* Output JSON visitors definition block. */ static void print_def_visitors (FILE * fp, int sp) { GDefMetric def = { .datakey = "visitors", .lbl = MTRC_VISITORS_LBL, .datatype = "numeric", .metakey = "count", .cwidth = "12%", }; print_def_block (fp, def, sp, 0); } /* Output JSON bandwidth definition block. */ static void print_def_bw (FILE * fp, int sp) { GDefMetric def = { .datakey = "bytes", .lbl = MTRC_BW_LBL, .datatype = "bytes", .metakey = "count", .cwidth = "12%", }; if (!conf.bandwidth) return; print_def_block (fp, def, sp, 0); } /* Output JSON Avg. T.S. definition block. */ static void print_def_avgts (FILE * fp, int sp) { GDefMetric def = { .datakey = "avgts", .lbl = MTRC_AVGTS_LBL, .datatype = "utime", .metakey = "avg", .cwidth = "8%", }; if (!conf.serve_usecs) return; print_def_block (fp, def, sp, 0); } /* Output JSON Cum. T.S. definition block. */ static void print_def_cumts (FILE * fp, int sp) { GDefMetric def = { .datakey = "cumts", .lbl = MTRC_CUMTS_LBL, .datatype = "utime", .metakey = "count", .cwidth = "8%", }; if (!conf.serve_usecs) return; print_def_block (fp, def, sp, 0); } /* Output JSON Max. T.S. definition block. */ static void print_def_maxts (FILE * fp, int sp) { GDefMetric def = { .datakey = "maxts", .lbl = MTRC_MAXTS_LBL, .datatype = "utime", .metakey = "count", .cwidth = "8%", }; if (!conf.serve_usecs) return; print_def_block (fp, def, sp, 0); } /* Output JSON method definition block. */ static void print_def_method (FILE * fp, int sp) { GDefMetric def = { .datakey = "method", .lbl = MTRC_METHODS_LBL, .datatype = "string", .cwidth = "6%", }; if (!conf.append_method) return; print_def_block (fp, def, sp, 0); } /* Output JSON protocol definition block. */ static void print_def_protocol (FILE * fp, int sp) { GDefMetric def = { .datakey = "protocol", .lbl = MTRC_PROTOCOLS_LBL, .datatype = "string", .cwidth = "7%", }; if (!conf.append_protocol) return; print_def_block (fp, def, sp, 0); } /* Output JSON city definition block. */ static void print_def_city (FILE * fp, int sp) { GDefMetric def = { .datakey = "city", .lbl = MTRC_CITY_LBL, .datatype = "string", }; if (!conf.has_geocity) return; print_def_block (fp, def, sp, 0); } /* Output JSON country definition block. */ static void print_def_country (FILE * fp, int sp) { GDefMetric def = { .datakey = "country", .lbl = MTRC_COUNTRY_LBL, .datatype = "string", }; if (!conf.has_geocountry) return; print_def_block (fp, def, sp, 0); } /* Output JSON hostname definition block. */ static void print_def_hostname (FILE * fp, int sp) { GDefMetric def = { .datakey = "hostname", .lbl = MTRC_HOSTNAME_LBL, .datatype = "string", .cname = "light", }; if (!conf.enable_html_resolver) return; print_def_block (fp, def, sp, 0); } /* Output JSON data definition block. */ static void print_def_data (FILE * fp, GModule module, int sp) { GDefMetric def = { .cname = "trunc", .cwidth = "100%", .datakey = "data", .datatype = module == VISITORS ? "date" : "string", .lbl = MTRC_DATA_LBL, .metakey = "unique", .metalbl = "Total", .metatype = "numeric", }; print_def_block (fp, def, sp, 1); } /* Get the number of plots for the given panel definition. * * The number of plots for the given panel is returned. */ static int count_plot_fp (const GHTML * def) { int i = 0; for (i = 0; def->chart[i].plot != 0; ++i); return i; } /* Entry function to output JSON plot definition block. */ static void print_def_plot (FILE * fp, const GHTML * def, int sp) { int i, isp = 0, n = count_plot_fp (def); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; fpopen_arr_attr (fp, "plot", sp); for (i = 0; i < n; ++i) { fpopen_obj (fp, isp); def->chart[i].plot (fp, def->chart[i], isp); fpclose_obj (fp, isp, (i == n - 1)); } fpclose_arr (fp, sp, 0); } /* Output JSON host panel definitions. */ static void print_host_metrics (FILE * fp, const GHTML * def, int sp) { const GOutput *output = output_lookup (def->module); print_def_hits (fp, sp); print_def_visitors (fp, sp); print_def_bw (fp, sp); print_def_avgts (fp, sp); print_def_cumts (fp, sp); print_def_maxts (fp, sp); if (output->method) print_def_method (fp, sp); if (output->protocol) print_def_protocol (fp, sp); print_def_city (fp, sp); print_def_country (fp, sp); print_def_hostname (fp, sp); print_def_data (fp, def->module, sp); } /* Output JSON panel definitions. */ static void print_metrics (FILE * fp, const GHTML * def, int sp) { const GOutput *output = output_lookup (def->module); print_def_hits (fp, sp); print_def_visitors (fp, sp); print_def_bw (fp, sp); print_def_avgts (fp, sp); print_def_cumts (fp, sp); print_def_maxts (fp, sp); if (output->method) print_def_method (fp, sp); if (output->protocol) print_def_protocol (fp, sp); print_def_data (fp, def->module, sp); } /* Entry point to output JSON metric definitions. */ static void print_def_metrics (FILE * fp, const GHTML * def, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; /* open data metric data */ fpopen_arr_attr (fp, "items", sp); /* definition metrics */ def->metrics (fp, def, isp); /* close metrics block */ fpclose_arr (fp, sp, 1); } /* Output panel header and description metadata definitions. */ static void print_def_meta (FILE * fp, const char *head, const char *desc, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; fpskeysval (fp, "head", head, isp, 0); fpskeysval (fp, "desc", desc, isp, 0); } /* Output panel sort metadata definitions. */ static void print_def_sort (FILE * fp, const GHTML * def, int sp) { GSort sort = module_sort[def->module]; int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; /* output open sort attribute */ fpopen_obj_attr (fp, "sort", sp); fpskeysval (fp, "field", get_sort_field_key (sort.field), isp, 0); fpskeysval (fp, "order", get_sort_order_str (sort.sort), isp, 1); /* output close sort attribute */ fpclose_obj (fp, sp, 0); } /* Output panel metadata definitions. */ static void print_panel_def_meta (FILE * fp, const GHTML * def, int sp) { const char *desc = module_to_desc (def->module); const char *head = module_to_head (def->module); const char *id = module_to_id (def->module); int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; print_def_meta (fp, head, desc, sp); fpskeysval (fp, "id", id, isp, 0); fpskeyival (fp, "table", def->table, isp, 0); print_def_sort (fp, def, isp); print_def_plot (fp, def, isp); print_def_metrics (fp, def, isp); } /* Output definitions for the given panel. */ static void print_json_def (FILE * fp, const GHTML * def) { int sp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) sp = 1; /* output open panel attribute */ fpopen_obj_attr (fp, module_to_id (def->module), sp); /* output panel data definitions */ print_panel_def_meta (fp, def, sp); /* output close panel attribute */ fpclose_obj (fp, sp, 1); fpjson (fp, (def->module != TOTAL_MODULES - 1) ? ",%.*s" : "%.*s", nlines, NL); } /* Output overall definitions. */ static void print_def_summary (FILE * fp, int sp) { int isp = 0, iisp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1, iisp = sp + 2; /* open metrics block */ fpopen_obj_attr (fp, "items", isp); print_def_overall_requests (fp, iisp); print_def_overall_valid_reqs (fp, iisp); print_def_overall_invalid_reqs (fp, iisp); print_def_overall_processed_time (fp, iisp); print_def_overall_visitors (fp, iisp); print_def_overall_files (fp, iisp); print_def_overall_excluded (fp, iisp); print_def_overall_refs (fp, iisp); print_def_overall_notfound (fp, iisp); print_def_overall_static_files (fp, iisp); print_def_overall_log_size (fp, iisp); print_def_overall_bandwidth (fp, iisp); /* close metrics block */ fpclose_obj (fp, isp, 1); } /* Cheap JSON internationalisation (i18n) - report labels */ static void print_json_i18n_def (FILE * fp) { int sp = 0; size_t i = 0; /* *INDENT-OFF* */ static const char *json_i18n[][2] = { {"theme" , HTML_REPORT_NAV_THEME} , {"dark_gray" , HTML_REPORT_NAV_DARK_GRAY} , {"bright" , HTML_REPORT_NAV_BRIGHT} , {"dark_blue" , HTML_REPORT_NAV_DARK_BLUE} , {"dark_purple" , HTML_REPORT_NAV_DARK_PURPLE} , {"panels" , HTML_REPORT_NAV_PANELS} , {"items_per_page" , HTML_REPORT_NAV_ITEMS_PER_PAGE} , {"tables" , HTML_REPORT_NAV_TABLES} , {"display_tables" , HTML_REPORT_NAV_DISPLAY_TABLES} , {"ah_small" , HTML_REPORT_NAV_AH_SMALL} , {"ah_small_title" , HTML_REPORT_NAV_AH_SMALL_TITLE} , {"layout" , HTML_REPORT_NAV_LAYOUT} , {"horizontal" , HTML_REPORT_NAV_HOR} , {"vertical" , HTML_REPORT_NAV_VER} , {"file_opts" , HTML_REPORT_NAV_FILE_OPTS} , {"export_json" , HTML_REPORT_NAV_EXPORT_JSON} , {"panel_opts" , HTML_REPORT_PANEL_PANEL_OPTS} , {"previous" , HTML_REPORT_PANEL_PREVIOUS} , {"next" , HTML_REPORT_PANEL_NEXT} , {"first" , HTML_REPORT_PANEL_FIRST} , {"last" , HTML_REPORT_PANEL_LAST} , {"chart_opts" , HTML_REPORT_PANEL_CHART_OPTS} , {"chart" , HTML_REPORT_PANEL_CHART} , {"type" , HTML_REPORT_PANEL_TYPE} , {"area_spline" , HTML_REPORT_PANEL_AREA_SPLINE} , {"bar" , HTML_REPORT_PANEL_BAR} , {"plot_metric" , HTML_REPORT_PANEL_PLOT_METRIC} , {"table_columns" , HTML_REPORT_PANEL_TABLE_COLS} , {"thead" , T_HEAD} , {"version" , GO_VERSION} , }; /* *INDENT-ON* */ /* use tabs to prettify output */ if (conf.json_pretty_print) sp = 1; fpopen_obj (fp, 0); for (i = 0; i < ARRAY_SIZE (json_i18n); ++i) { fpskeysval (fp, json_i18n[i][0], _(json_i18n[i][1]), sp, 0); } fpclose_obj (fp, 0, 1); } /* Output definitions for the given panel. */ static void print_json_def_summary (FILE * fp) { int sp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) sp = 1; /* output open panel attribute */ fpopen_obj_attr (fp, GENER_ID, sp); print_def_meta (fp, _(T_HEAD), "", sp); print_def_summary (fp, sp); /* output close panel attribute */ fpclose_obj (fp, sp, 0); } /* Entry point to output definitions for all panels. */ static void print_json_defs (FILE * fp) { const GHTML *def; size_t idx = 0; fprintf (fp, ""); } /* entry point to generate a report writing it to the fp */ void output_html (GLog * glog, GHolder * holder, const char *filename) { FILE *fp; char now[DATE_TIME]; if (filename != NULL) fp = fopen (filename, "w"); else fp = stdout; if (!fp) FATAL ("Unable to open HTML file: %s.", strerror (errno)); /* use new lines to prettify output */ if (conf.json_pretty_print) nlines = 1; set_json_nlines (nlines); generate_time (); strftime (now, DATE_TIME, "%Y-%m-%d %H:%M:%S %z", now_tm); print_html_header (fp); print_html_body (fp, now); print_json_defs (fp); print_json_data (fp, glog, holder); print_conn_def (fp); print_html_footer (fp); fclose (fp); } goaccess-1.3/src/geoip1.h0000644000000000000000000000427013375657450012201 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef GEOIP_H_INCLUDED #define GEOIP_H_INCLUDED #include "commons.h" #define CITY_LEN 47 + 1 /* max string length for a city */ #define CONTINENT_LEN 47 + 1 /* max string length for a country */ #define COUNTRY_LEN 48 + 3 /* Country + two-letter Code */ typedef struct GLocation_ { char city[CITY_LEN]; char continent[CONTINENT_LEN]; int hits; } GLocation; int is_geoip_resource (void); int set_geolocation (char *host, char *continent, char *country, char *city); void geoip_free (void); void geoip_get_city (const char *ip, char *location, GTypeIP type_ip); void geoip_get_continent (const char *ip, char *location, GTypeIP type_ip); void geoip_get_country (const char *ip, char *location, GTypeIP type_ip); void init_geoip (void); #endif // for #ifndef GEOIP_H goaccess-1.3/src/gmenu.h0000644000000000000000000000431413375657450012127 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_NCURSES_H #include #elif HAVE_NCURSES_H #include #elif HAVE_CURSES_H #include #endif #ifndef GMENU_H_INCLUDED #define GMENU_H_INCLUDED enum ACTION { REQ_DOWN, REQ_UP, REQ_SEL }; typedef struct GMenu_ GMenu; typedef struct GItem_ GItem; /* Menu Item */ struct GItem_ { char *name; int checked; }; /* Menu Panel */ struct GMenu_ { WINDOW *win; int count; int size; int idx; int start; int h; int w; int x; int y; unsigned short multiple; unsigned short selectable; unsigned short status; GItem *items; }; GMenu *new_gmenu (WINDOW * parent, int h, int w, int y, int x); int post_gmenu (GMenu * menu); void gmenu_driver (GMenu * menu, int c); #endif goaccess-1.3/src/ui.c0000644000000000000000000014444013375661253011425 00000000000000/** * ui.c -- various curses interfaces * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #define STDIN_FILENO 0 #ifndef _BSD_SOURCE #define _BSD_SOURCE /* include stuff from 4.3 BSD */ #endif #ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE #endif #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "ui.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "color.h" #include "error.h" #include "gmenu.h" #include "goaccess.h" #include "util.h" #include "xmalloc.h" /* *INDENT-OFF* */ /* Determine which metrics should be displayed per module/panel */ static GOutput outputting[] = { {VISITORS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1} , {REQUESTS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0} , {REQUESTS_STATIC , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0} , {NOT_FOUND , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0} , {HOSTS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0} , {OS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1} , {BROWSERS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1} , {VISIT_TIMES , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1} , {VIRTUAL_HOSTS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , {REFERRERS , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , {REFERRING_SITES , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , {KEYPHRASES , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , {STATUS_CODES , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , {REMOTE_USER , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , #ifdef HAVE_GEOLOCATION {GEO_LOCATION , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0} , #endif }; /* *INDENT-ON* */ /* Structure to display overall statistics */ typedef struct Field_ { const char *field; /* char due to log, bw, log_file */ char *value; GColors *(*colorlbl) (void); GColors *(*colorval) (void); short oneliner; } Field; /* Determine which metrics to output given a module * * On error, or if not found, NULL is returned. * On success, the panel value is returned. */ GOutput * output_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (outputting); for (i = 0; i < num_panels; i++) { if (outputting[i].module == module) return &outputting[i]; } return NULL; } /* Initialize curses colors */ void init_colors (int force) { /* use default foreground/background colors */ use_default_colors (); /* first set a default normal color */ set_normal_color (); /* then parse custom colors and initialize them */ set_colors (force); } /* Ncurses' window handling */ void set_input_opts (void) { initscr (); clear (); noecho (); halfdelay (10); nonl (); intrflush (stdscr, FALSE); keypad (stdscr, TRUE); if (curs_set (0) == ERR) LOG_DEBUG (("Unable to change cursor: %s\n", strerror (errno))); if (conf.mouse_support) mousemask (BUTTON1_CLICKED, NULL); } /* Deletes the given window, freeing all memory associated with it. */ void close_win (WINDOW * w) { if (w == NULL) return; wclear (w); wrefresh (w); delwin (w); } /* Get the current calendar time as a value of type time_t and convert * time_t to tm as local time */ void generate_time (void) { timestamp = time (NULL); now_tm = localtime (×tamp); } /* Set the loading spinner as ended and manage the mutex locking. */ void end_spinner (void) { if (conf.no_parsing_spinner) return; pthread_mutex_lock (&parsing_spinner->mutex); parsing_spinner->state = SPN_END; pthread_mutex_unlock (&parsing_spinner->mutex); } /* Set background colors to all windows. */ void set_wbkgd (WINDOW * main_win, WINDOW * header_win) { GColors *color = get_color (COLOR_BG); /* background colors */ wbkgd (main_win, COLOR_PAIR (color->pair->idx)); wbkgd (header_win, COLOR_PAIR (color->pair->idx)); wbkgd (stdscr, COLOR_PAIR (color->pair->idx)); wrefresh (main_win); } /* Creates and the new terminal windows and set basic properties to * each of them. e.g., background color, enable the reading of * function keys. */ void init_windows (WINDOW ** header_win, WINDOW ** main_win) { int row = 0, col = 0; /* init standard screen */ getmaxyx (stdscr, row, col); if (row < MIN_HEIGHT || col < MIN_WIDTH) FATAL ("Minimum screen size - 0 columns by 7 lines"); /* init header screen */ *header_win = newwin (6, col, 0, 0); keypad (*header_win, TRUE); if (*header_win == NULL) FATAL ("Unable to allocate memory for header_win."); /* init main screen */ *main_win = newwin (row - 8, col, 7, 0); keypad (*main_win, TRUE); if (*main_win == NULL) FATAL ("Unable to allocate memory for main_win."); set_wbkgd (*main_win, *header_win); } #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* Draw a generic header with the ability to set a custom text to it. */ void draw_header (WINDOW * win, const char *s, const char *fmt, int y, int x, int w, GColors * (*func) (void)) { GColors *color = (*func) (); char *buf; buf = xmalloc (snprintf (NULL, 0, fmt, s) + 1); sprintf (buf, fmt, s); wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwhline (win, y, x, ' ', w); mvwaddnstr (win, y, x, buf, w); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); free (buf); } #pragma GCC diagnostic warning "-Wformat-nonliteral" /* Determine the actual size of the main window. */ void term_size (WINDOW * main_win, int *main_win_height) { int term_h = 0, term_w = 0; getmaxyx (stdscr, term_h, term_w); *main_win_height = term_h - (MAX_HEIGHT_HEADER + MAX_HEIGHT_FOOTER); wresize (main_win, *main_win_height, term_w); wmove (main_win, *main_win_height, 0); } /* Get the module/panel label name for the given module enum value. * * On success, a string containing the label name is returned. */ const char * module_to_label (GModule module) { static const char *modules[] = { VISITORS_LABEL, REQUESTS_LABEL, REQUESTS_STATIC_LABEL, NOT_FOUND_LABEL, HOSTS_LABEL, OS_LABEL, BROWSERS_LABEL, VISIT_TIMES_LABEL, VIRTUAL_HOSTS_LABEL, REFERRERS_LABEL, REFERRING_SITES_LABEL, KEYPHRASES_LABEL, STATUS_CODES_LABEL, REMOTE_USER_LABEL, #ifdef HAVE_GEOLOCATION GEO_LOCATION_LABEL, #endif }; return _(modules[module]); } /* Get the module/panel label id for the given module enum value. * * On success, a string containing the label id is returned. */ const char * module_to_id (GModule module) { static const char *modules[] = { VISITORS_ID, REQUESTS_ID, REQUESTS_STATIC_ID, NOT_FOUND_ID, HOSTS_ID, OS_ID, BROWSERS_ID, VISIT_TIMES_ID, VIRTUAL_HOSTS_ID, REFERRERS_ID, REFERRING_SITES_ID, KEYPHRASES_ID, STATUS_CODES_ID, REMOTE_USER_ID, #ifdef HAVE_GEOLOCATION GEO_LOCATION_ID, #endif }; return _(modules[module]); } /* Get the module/panel label header for the given module enum value. * * On success, a string containing the label header is returned. */ const char * module_to_head (GModule module) { static const char *modules[] = { VISITORS_HEAD, REQUESTS_HEAD, REQUESTS_STATIC_HEAD, NOT_FOUND_HEAD, HOSTS_HEAD, OS_HEAD, BROWSERS_HEAD, VISIT_TIMES_HEAD, VIRTUAL_HOSTS_HEAD, REFERRERS_HEAD, REFERRING_SITES_HEAD, KEYPHRASES_HEAD, STATUS_CODES_HEAD, REMOTE_USER_HEAD, #ifdef HAVE_GEOLOCATION GEO_LOCATION_HEAD, #endif }; if (!conf.ignore_crawlers) modules[VISITORS] = VISITORS_HEAD_BOTS; return _(modules[module]); } /* Get the module/panel label description for the given module enum * value. * * On success, a string containing the label description is returned. */ const char * module_to_desc (GModule module) { static const char *modules[] = { VISITORS_DESC, REQUESTS_DESC, REQUESTS_STATIC_DESC, NOT_FOUND_DESC, HOSTS_DESC, OS_DESC, BROWSERS_DESC, VISIT_TIMES_DESC, VIRTUAL_HOSTS_DESC, REFERRERS_DESC, REFERRING_SITES_DESC, KEYPHRASES_DESC, STATUS_CODES_DESC, REMOTE_USER_DESC, #ifdef HAVE_GEOLOCATION GEO_LOCATION_DESC, #endif }; return _(modules[module]); } /* Rerender the header window to reflect active module. */ void update_active_module (WINDOW * header_win, GModule current) { GColors *color = get_color (COLOR_ACTIVE_LABEL); const char *module = module_to_label (current); int col = getmaxx (stdscr); char *lbl = xmalloc (snprintf (NULL, 0, T_ACTIVE_PANEL, module) + 1); sprintf (lbl, T_ACTIVE_PANEL, module); wmove (header_win, 0, 30); wattron (header_win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (header_win, 0, col - strlen (lbl) - 1, "%s", lbl); wattroff (header_win, color->attr | COLOR_PAIR (color->pair->idx)); wrefresh (header_win); free (lbl); } /* Print out (terminal) an overall field label. e.g., 'Processed Time' */ static void render_overall_field (WINDOW * win, const char *s, int y, int x, GColors * color) { wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, x, "%s", s); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } /* Print out (terminal) an overall field value. e.g., '120 secs' */ static void render_overall_value (WINDOW * win, const char *s, int y, int x, GColors * color) { wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, x, "%s", s); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } /* Convert the number of excluded ips to a string. * * On success, the number of excluded ips as a string is returned. */ static char * get_str_excluded_ips (GLog * glog) { return int2str (glog->excluded_ip, 0); } /* Convert the number of failed requests to a string. * * On success, the number of failed requests as a string is returned. */ static char * get_str_failed_reqs (GLog * glog) { return int2str (glog->invalid, 0); } /* Convert the number of processed requests to a string. * * On success, the number of processed requests as a string is returned. */ static char * get_str_processed_reqs (GLog * glog) { return int2str (glog->processed, 0); } /* Convert the number of valid requests to a string. * * On success, the number of valid requests as a string is returned. */ static char * get_str_valid_reqs (GLog * glog) { return int2str (glog->valid, 0); } /* Convert the number of not found requests to a string. * * On success, the number of not found requests as a string is * returned. */ static char * get_str_notfound_reqs (void) { return int2str (ht_get_size_datamap (NOT_FOUND), 0); } /* Convert the number of referrers to a string. * * On success, the number of referrers as a string is returned. */ static char * get_str_ref_reqs (void) { return int2str (ht_get_size_datamap (REFERRERS), 0); } /* Convert the number of requests to a string. * * On success, the number of requests as a string is returned. */ static char * get_str_reqs (void) { return int2str (ht_get_size_datamap (REQUESTS), 0); } /* Convert the number of static requests to a string. * * On success, the number of static requests as a string is returned. */ static char * get_str_static_reqs (void) { return int2str (ht_get_size_datamap (REQUESTS_STATIC), 0); } /* Convert the number of unique visitors to a string. * * On success, the number of unique visitors as a string is returned. */ static char * get_str_visitors (void) { return int2str (ht_get_size_uniqmap (VISITORS), 0); } /* Convert the time taken to process the log to a string. * * On success, the time taken to process the log as a string is * returned. */ static char * get_str_proctime (void) { char *s = NULL; uint64_t secs = (long long) end_proc - start_proc; #ifdef TCB_BTREE if (conf.store_accumulated_time) secs = (uint64_t) ht_get_genstats ("accumulated_time"); #endif s = xmalloc (snprintf (NULL, 0, "%" PRIu64 "s", secs) + 1); sprintf (s, "%" PRIu64 "s", secs); return s; } /* Get the log file size in a human readable format. * * On success, the log file size as a string is returned. */ static char * get_str_filesize (void) { return filesize_str (get_log_sizes ()); } /* Get the log file path. * * On success, the log file path as a string is returned. */ static char * get_str_logfile (void) { int col = getmaxx (stdscr), left_padding = 20; return get_log_source_str (col - left_padding); } /* Get the bandwidth in a human readable format. * * On success, the bandwidth as a string is returned. */ static char * get_str_bandwidth (GLog * glog) { return filesize_str ((float) glog->resp_size); } /* Iterate over the visitors module and sort date in an ascending * order. * * On success, an array of sorted dates is returned. */ static char ** get_visitors_dates (GHolder * h) { char **dates = malloc (sizeof (char *) * h->holder_size); int i; for (i = 0; i < h->idx; i++) { dates[i] = h->items[i].metrics->data; } qsort (dates, h->holder_size, sizeof (char *), strcmp_asc); return dates; } /* Get the overall statistics start and end dates. * * On failure, 1 is returned * On success, 0 is returned and an string containing the overall * header is returned. */ int get_start_end_parsing_dates (GHolder * h, char **start, char **end, const char *f) { char **dates = NULL; const char *sndfmt = conf.spec_date_time_num_format; if (h->idx == 0) return 1; dates = get_visitors_dates (h + VISITORS); /* just display the actual dates - no specificity */ *start = get_visitors_date (dates[0], sndfmt, f); *end = get_visitors_date (dates[h->idx - 1], sndfmt, f); free (dates); return 0; } /* Get the overall statistics header (label). * * On success, an string containing the overall header is returned. */ char * get_overall_header (GHolder * h) { const char *head = T_DASH_HEAD; char *hd = NULL, *start = NULL, *end = NULL; if (h->idx == 0 || get_start_end_parsing_dates (h, &start, &end, "%d/%b/%Y")) return xstrdup (head); hd = xmalloc (snprintf (NULL, 0, "%s (%s - %s)", head, start, end) + 1); sprintf (hd, "%s (%s - %s)", head, start, end); free (end); free (start); return hd; } /* Print out (terminal dashboard) the overall statistics header. */ static void render_overall_header (WINDOW * win, GHolder * h) { char *hd = get_overall_header (h); int col = getmaxx (stdscr); draw_header (win, hd, " %s", 0, 0, col, color_panel_header); free (hd); } /* Render the overall statistics. This will attempt to determine the * right X and Y position given the current values. */ static void render_overall_statistics (WINDOW * win, Field fields[], size_t n) { GColors *color = NULL; int x_field = 2, x_value = 0; size_t i, j, k, max_field = 0, max_value = 0, mod_val, y; for (i = 0, k = 0, y = 2; i < n; i++) { /* new line every OVERALL_NUM_COLS */ mod_val = k % OVERALL_NUM_COLS; /* reset position & length and increment row */ if (k > 0 && mod_val == 0) { max_value = max_field = 0; x_value = x_field = 2; y++; } /* x pos = max length of field */ x_field += max_field; color = (*fields[i].colorlbl) (); render_overall_field (win, fields[i].field, y, x_field, color); /* get max length of field in the same column */ max_field = 0; for (j = 0; j < n; j++) { size_t len = strlen (fields[j].field); if (j % OVERALL_NUM_COLS == mod_val && len > max_field && !fields[j].oneliner) max_field = len; } /* get max length of value in the same column */ max_value = 0; for (j = 0; j < n; j++) { size_t len = strlen (fields[j].value); if (j % OVERALL_NUM_COLS == mod_val && len > max_value && !fields[j].oneliner) max_value = len; } /* spacers */ x_value = max_field + x_field + 1; max_field += max_value + 2; color = (*fields[i].colorval) (); render_overall_value (win, fields[i].value, y, x_value, color); k += fields[i].oneliner ? OVERALL_NUM_COLS : 1; } } /* The entry point to render the overall statistics and free its data. */ void display_general (WINDOW * win, GLog * glog, GHolder * h) { GColors *(*colorlbl) (void) = color_overall_lbls; GColors *(*colorpth) (void) = color_overall_path; GColors *(*colorval) (void) = color_overall_vals; size_t n, i; /* *INDENT-OFF* */ Field fields[] = { {T_REQUESTS , get_str_processed_reqs (glog), colorlbl, colorval, 0}, {T_UNIQUE_VISITORS , get_str_visitors () , colorlbl, colorval, 0}, {T_UNIQUE_FILES , get_str_reqs () , colorlbl, colorval, 0}, {T_REFERRER , get_str_ref_reqs () , colorlbl, colorval, 0}, {T_VALID , get_str_valid_reqs (glog) , colorlbl, colorval, 0}, {T_GEN_TIME , get_str_proctime () , colorlbl, colorval, 0}, {T_STATIC_FILES , get_str_static_reqs () , colorlbl, colorval, 0}, {T_LOG , get_str_filesize () , colorlbl, colorval, 0}, {T_FAILED , get_str_failed_reqs (glog) , colorlbl, colorval, 0}, {T_EXCLUDE_IP , get_str_excluded_ips (glog) , colorlbl, colorval, 0}, {T_UNIQUE404 , get_str_notfound_reqs () , colorlbl, colorval, 0}, {T_BW , get_str_bandwidth (glog) , colorlbl, colorval, 0}, {T_LOG_PATH , get_str_logfile () , colorlbl, colorpth, 1} }; /* *INDENT-ON* */ werase (win); render_overall_header (win, h); n = ARRAY_SIZE (fields); render_overall_statistics (win, fields, n); for (i = 0; i < n; i++) { free (fields[i].value); } } /* Implement a basic framework to build a field input. * * On success, the inputted string is returned. */ char * input_string (WINDOW * win, int pos_y, int pos_x, size_t max_width, const char *str, int enable_case, int *toggle_case) { char *s = xmalloc (max_width + 1), *tmp; size_t i, c, pos = 0, x = 0, quit = 1, len = 0, size_x = 0, size_y = 0; getmaxyx (win, size_y, size_x); size_x -= 4; /* are we setting a default string */ if (str) { len = MIN (max_width, strlen (str)); memcpy (s, str, len); s[len] = '\0'; x = pos = 0; /* is the default str length greater than input field? */ if (strlen (s) > size_x) { tmp = xstrdup (&s[0]); tmp[size_x] = '\0'; mvwprintw (win, pos_y, pos_x, "%s", tmp); free (tmp); } else { mvwprintw (win, pos_y, pos_x, "%s", s); } } else { s[0] = '\0'; } if (enable_case) mvwprintw (win, size_y - 2, 1, " %s", CSENSITIVE); wmove (win, pos_y, pos_x + x); wrefresh (win); curs_set (1); while (quit) { c = wgetch (stdscr); switch (c) { case 1: /* ^a */ case 262: /* HOME */ pos = x = 0; break; case 5: case 360: /* END of line */ if (strlen (s) > size_x) { x = size_x; pos = strlen (s) - size_x; } else { pos = 0; x = strlen (s); } break; case 7: /* ^g */ case 27: /* ESC */ pos = x = 0; if (str && *str == '\0') s[0] = '\0'; quit = 0; break; case 9: /* TAB */ if (!enable_case) break; *toggle_case = *toggle_case == 0 ? 1 : 0; if (*toggle_case) mvwprintw (win, size_y - 2, 1, " %s", CISENSITIVE); else if (!*toggle_case) mvwprintw (win, size_y - 2, 1, " %s", CSENSITIVE); break; case 21: /* ^u */ s[0] = '\0'; pos = x = 0; break; case 8: /* xterm-256color */ case 127: case KEY_BACKSPACE: if (pos + x > 0) { memmove (&s[(pos + x) - 1], &s[pos + x], (max_width - (pos + x)) + 1); if (pos <= 0) x--; else pos--; } break; case KEY_LEFT: if (x > 0) x--; else if (pos > 0) pos--; break; case KEY_RIGHT: if ((x + pos) < strlen (s)) { if (x < size_x) x++; else pos++; } break; case 0x0a: case 0x0d: case KEY_ENTER: quit = 0; break; default: if (strlen (s) == max_width) break; if (!isprint (c)) break; if (strlen (s) == pos) { s[pos + x] = c; s[pos + x + 1] = '\0'; waddch (win, c); } else { memmove (&s[pos + x + 1], &s[pos + x], strlen (&s[pos + x]) + 1); s[pos + x] = c; } if ((x + pos) < max_width) { if (x < size_x) x++; else pos++; } } tmp = xstrdup (&s[pos > 0 ? pos : 0]); tmp[MIN (strlen (tmp), size_x)] = '\0'; for (i = strlen (tmp); i < size_x; i++) mvwprintw (win, pos_y, pos_x + i, "%s", " "); mvwprintw (win, pos_y, pos_x, "%s", tmp); free (tmp); wmove (win, pos_y, pos_x + x); wrefresh (win); } curs_set (0); return s; } /* Fill the given terminal dashboard menu with user agent data. * * On error, the 1 is returned. * On success, 0 is returned. */ static int fill_host_agents_gmenu (void *val, void *user_data) { GMenu *menu = user_data; char *agent = ht_get_host_agent_val ((*(int *) val)); if (agent == NULL) return 1; menu->items[menu->size].name = agent; menu->items[menu->size].checked = 0; menu->size++; return 0; } /* Iterate over the linked-list of user agents for the given host and * load its data into the given menu. */ static void load_host_agents_gmenu (void *list, void *user_data, int count) { GSLList *lst = list; GMenu *menu = user_data; menu->items = (GItem *) xcalloc (count, sizeof (GItem)); list_foreach (lst, fill_host_agents_gmenu, menu); } /* Set host data from a linked-list and load its data into a GMenu * structure. * * On error, the 1 is returned. * On success, 0 is returned. */ #ifdef TCB_BTREE int set_host_agents (const char *addr, void (*func) (void *, void *, int), void *arr) { TCLIST *tclist; GSLList *list; int key, count = 0; key = ht_get_keymap (HOSTS, addr); if (key == 0) return 1; tclist = ht_get_host_agent_tclist (HOSTS, key); if (!tclist) return 1; list = tclist_to_gsllist (tclist); if ((count = list_count (list)) == 0) { free (list); return 1; } func (list, arr, count); list_remove_nodes (list); tclistdel (tclist); return 0; } #endif /* Set host data from a linked-list and load its data into a GMenu * structure. * * On error, the 1 is returned. * On success, 0 is returned. */ #ifndef TCB_BTREE int set_host_agents (const char *addr, void (*func) (void *, void *, int), void *arr) { GSLList *list; int data_nkey, count = 0; data_nkey = ht_get_keymap (HOSTS, addr); if (data_nkey == 0) return 1; list = ht_get_host_agent_list (HOSTS, data_nkey); if (!list) return 1; if ((count = list_count (list)) == 0) { free (list); return 1; } func (list, arr, count); #ifdef TCB_MEMHASH free (list); #endif return 0; } #endif /* Render a list of agents if available for the selected host/IP. */ void load_agent_list (WINDOW * main_win, char *addr) { GMenu *menu; WINDOW *win; char buf[256]; int c, quit = 1, i; int y, x, list_h, list_w, menu_w, menu_h; if (!conf.list_agents) return; getmaxyx (stdscr, y, x); list_h = y / 2; /* list window - height */ list_w = x - 4; /* list window - width */ menu_h = list_h - AGENTS_MENU_Y - 1; /* menu window - height */ menu_w = list_w - AGENTS_MENU_X - AGENTS_MENU_X; /* menu window - width */ win = newwin (list_h, list_w, (y - list_h) / 2, (x - list_w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, menu_h, menu_w, AGENTS_MENU_Y, AGENTS_MENU_X); if (set_host_agents (addr, load_host_agents_gmenu, menu) == 1) goto out; post_gmenu (menu); snprintf (buf, sizeof buf, AGENTSDLG_HEAD, addr); draw_header (win, buf, " %s", 1, 1, list_w - 2, color_panel_header); mvwprintw (win, 2, 2, AGENTSDLG_DESC); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); break; case KEY_UP: gmenu_driver (menu, REQ_UP); break; case KEY_RESIZE: case 'q': quit = 0; break; } wrefresh (win); } touchwin (main_win); close_win (win); wrefresh (main_win); out: /* clean stuff up */ for (i = 0; i < menu->size; ++i) free (menu->items[i].name); if (menu->items) free (menu->items); free (menu); } /* Render the processing spinner. This runs within its own thread. */ static void ui_spinner (void *ptr_data) { GSpinner *sp = (GSpinner *) ptr_data; GColors *color = NULL; static char const spin_chars[] = "/-\\|"; char buf[SPIN_LBL]; int i = 0; long long tdiff = 0, psec = 0; time_t begin; if (sp->curses) color = (*sp->color) (); time (&begin); while (1) { pthread_mutex_lock (&sp->mutex); if (sp->state == SPN_END) break; setlocale (LC_NUMERIC, ""); if (conf.no_progress) { snprintf (buf, sizeof buf, SPIN_FMT, sp->label); } else { tdiff = (long long) (time (NULL) - begin); psec = tdiff >= 1 ? *(sp->processed) / tdiff : 0; snprintf (buf, sizeof buf, SPIN_FMTM, sp->label, *(sp->processed), psec); } setlocale (LC_NUMERIC, "POSIX"); if (sp->curses) { /* CURSES */ draw_header (sp->win, buf, " %s", sp->y, sp->x, sp->w, sp->color); /* caret */ wattron (sp->win, COLOR_PAIR (color->pair->idx)); mvwaddch (sp->win, sp->y, sp->spin_x, spin_chars[i++ & 3]); wattroff (sp->win, COLOR_PAIR (color->pair->idx)); wrefresh (sp->win); } else if (!conf.no_progress) { /* STDOUT */ fprintf (stderr, "%s\r", buf); } pthread_mutex_unlock (&sp->mutex); usleep (100000); } } /* Create the processing spinner's thread */ void ui_spinner_create (GSpinner * spinner) { if (conf.no_parsing_spinner) return; pthread_create (&(spinner->thread), NULL, (void *) &ui_spinner, spinner); pthread_detach (spinner->thread); } /* Initialize processing spinner data. */ void set_curses_spinner (GSpinner * spinner) { int y, x; if (spinner == NULL) return; getmaxyx (stdscr, y, x); spinner->color = color_progress; spinner->curses = 1; spinner->win = stdscr; spinner->x = 0; spinner->w = x; spinner->spin_x = x - 2; spinner->y = y - 1; } /* Allocate memory for a spinner instance and initialize its data. * * On success, the newly allocated GSpinner is returned. */ GSpinner * new_gspinner (void) { GSpinner *spinner; spinner = xcalloc (1, sizeof (GSpinner)); spinner->label = "Parsing..."; spinner->state = SPN_RUN; spinner->curses = 0; if (conf.load_from_disk) conf.no_progress = 1; if (pthread_mutex_init (&(spinner->mutex), NULL)) FATAL ("Failed init thread mutex"); return spinner; } /* A wrapper call to clear the status bar on the config dialog * (terminal output). */ static void clear_confdlg_status_bar (WINDOW * win, int y, int x, int w) { draw_header (win, "", "%s", y, x, w + 1, color_default); } /* Escape a date format string. * * If no conf.date_format is given, NULL is returned. * On success, the newly escaped allocated string is returned. */ static char * get_input_date_format (void) { char *date_format = NULL; if (conf.date_format) date_format = escape_str (conf.date_format); return date_format; } /* Escape a time format string. * * If no conf.time_format is given, NULL is returned. * On success, the newly escaped allocated string is returned. */ static char * get_input_time_format (void) { char *time_format = NULL; if (conf.time_format) time_format = escape_str (conf.time_format); return time_format; } /* Escape a log format string. * * If no conf.log_format is given, NULL is returned. * On success, the newly escaped allocated string is returned. */ static char * get_input_log_format (void) { char *log_format = NULL; if (conf.log_format) log_format = escape_str (conf.log_format); return log_format; } static void draw_formats (WINDOW * win, int w2) { char *date_format = NULL, *log_format = NULL, *time_format = NULL; draw_header (win, CONFDLG_HEAD, " %s", 1, 1, w2, color_panel_header); mvwprintw (win, 2, 2, CONFDLG_KEY_HINTS); /* set log format from config file if available */ draw_header (win, CONFDLG_LOG_FORMAT, " %s", 11, 1, w2, color_panel_header); if ((log_format = get_input_log_format ())) { mvwprintw (win, 12, 2, "%.*s", CONF_MENU_W, log_format); free (log_format); } /* set log format from config file if available */ draw_header (win, CONFDLG_DATE_FORMAT, " %s", 14, 1, w2, color_panel_header); if ((date_format = get_input_date_format ())) { mvwprintw (win, 15, 2, "%.*s", CONF_MENU_W, date_format); free (date_format); } /* set log format from config file if available */ draw_header (win, CONFDLG_TIME_FORMAT, " %s", 17, 1, w2, color_panel_header); if ((time_format = get_input_time_format ())) { mvwprintw (win, 18, 2, "%.*s", CONF_MENU_W, time_format); free (time_format); } } static const char * set_formats (char *date_format, char *log_format, char *time_format) { /* display status bar error messages */ if (!time_format && !conf.time_format) return ERR_FORMAT_NO_TIME_FMT_DLG; if (!date_format && !conf.date_format) return ERR_FORMAT_NO_DATE_FMT_DLG; if (!log_format && !conf.log_format) return ERR_FORMAT_NO_LOG_FMT_DLG; if (time_format) { free (conf.time_format); conf.time_format = unescape_str (time_format); } if (date_format) { free (conf.date_format); conf.date_format = unescape_str (date_format); } if (log_format) { free (conf.log_format); conf.log_format = unescape_str (log_format); } set_spec_date_format (); return NULL; } /* Render the help dialog. */ static void load_confdlg_error (WINDOW * parent_win, char **errors, int nerrors) { int c, quit = 1, i = 0; int y, x, h = ERR_WIN_HEIGHT, w = ERR_WIN_WIDTH; WINDOW *win; GMenu *menu; getmaxyx (stdscr, y, x); win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, ERR_MENU_HEIGHT, ERR_MENU_WIDTH, ERR_MENU_Y, ERR_MENU_X); menu->size = nerrors; /* add items to GMenu */ menu->items = (GItem *) xcalloc (nerrors, sizeof (GItem)); for (i = 0; i < nerrors; ++i) { menu->items[i].name = alloc_string (errors[i]); menu->items[i].checked = 0; free (errors[i]); } free (errors); post_gmenu (menu); draw_header (win, ERR_FORMAT_HEADER, " %s", 1, 1, w - 2, color_error); mvwprintw (win, 2, 2, CONFDLG_DESC); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); break; case KEY_UP: gmenu_driver (menu, REQ_UP); break; case KEY_RESIZE: case 'q': quit = 0; break; } wrefresh (win); } /* clean stuff up */ for (i = 0; i < nerrors; ++i) free (menu->items[i].name); free (menu->items); free (menu); touchwin (parent_win); close_win (win); wrefresh (parent_win); } /* Render the config log date/format dialog. * * On error, or if the selected format is invalid, 1 is returned. * On success, 0 is returned. */ int render_confdlg (GLog * glog, GSpinner * spinner) { GMenu *menu; WINDOW *win; const char *log_err = NULL; char *date_format = NULL, *log_format = NULL, *time_format = NULL; char *cstm_log, *cstm_date, *cstm_time; int c, quit = 1, invalid = 1, y, x, h = CONF_WIN_H, w = CONF_WIN_W; int w2 = w - 2; size_t i, n, sel; /* conf dialog menu options */ const char *choices[] = { "NCSA Combined Log Format", "NCSA Combined Log Format with Virtual Host", "Common Log Format (CLF)", "Common Log Format (CLF) with Virtual Host", "W3C", "Squid Native Format", "CloudFront (Download Distribution)", "Google Cloud Storage", "AWS Elastic Load Balancing (HTTP/S)", "AWS Simple Storage Service (S3)", }; n = ARRAY_SIZE (choices); getmaxyx (stdscr, y, x); win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, CONF_MENU_H, CONF_MENU_W, CONF_MENU_Y, CONF_MENU_X); menu->size = n; menu->selectable = 1; /* add items to GMenu */ menu->items = (GItem *) xcalloc (n, sizeof (GItem)); for (i = 0; i < n; ++i) { menu->items[i].name = alloc_string (choices[i]); sel = get_selected_format_idx (); menu->items[i].checked = sel == i ? 1 : 0; } post_gmenu (menu); draw_formats (win, w2); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); clear_confdlg_status_bar (win, 3, 2, CONF_MENU_W); break; case KEY_UP: gmenu_driver (menu, REQ_UP); clear_confdlg_status_bar (win, 3, 2, CONF_MENU_W); break; case 32: /* space */ gmenu_driver (menu, REQ_SEL); clear_confdlg_status_bar (win, 12, 1, CONF_MENU_W); clear_confdlg_status_bar (win, 15, 1, CONF_MENU_W); clear_confdlg_status_bar (win, 18, 1, CONF_MENU_W); if (time_format) free (time_format); if (date_format) free (date_format); if (log_format) free (log_format); for (i = 0; i < n; ++i) { if (menu->items[i].checked != 1) continue; date_format = get_selected_date_str (i); log_format = get_selected_format_str (i); time_format = get_selected_time_str (i); mvwprintw (win, 12, 1, " %s", log_format); mvwprintw (win, 15, 1, " %s", date_format); mvwprintw (win, 18, 1, " %s", time_format); break; } break; case 99: /* c */ /* clear top status bar */ clear_confdlg_status_bar (win, 3, 2, CONF_MENU_W); wmove (win, 12, 2); /* get input string */ if (!log_format) log_format = get_input_log_format (); cstm_log = input_string (win, 12, 2, 70, log_format, 0, 0); if (cstm_log != NULL && *cstm_log != '\0') { if (log_format) free (log_format); log_format = alloc_string (cstm_log); free (cstm_log); } /* did not set an input string */ else { if (cstm_log) free (cstm_log); if (log_format) { free (log_format); log_format = NULL; } } break; case 100: /* d */ /* clear top status bar */ clear_confdlg_status_bar (win, 3, 2, CONF_MENU_W); wmove (win, 15, 0); /* get input string */ if (!date_format) date_format = get_input_date_format (); cstm_date = input_string (win, 15, 2, 14, date_format, 0, 0); if (cstm_date != NULL && *cstm_date != '\0') { if (date_format) free (date_format); date_format = alloc_string (cstm_date); free (cstm_date); } /* did not set an input string */ else { if (cstm_date) free (cstm_date); if (date_format) { free (date_format); date_format = NULL; } } break; case 116: /* t */ /* clear top status bar */ clear_confdlg_status_bar (win, 3, 2, CONF_MENU_W); wmove (win, 15, 0); /* get input string */ if (!time_format) time_format = get_input_time_format (); cstm_time = input_string (win, 18, 2, 14, time_format, 0, 0); if (cstm_time != NULL && *cstm_time != '\0') { if (time_format) free (time_format); time_format = alloc_string (cstm_time); free (cstm_time); } /* did not set an input string */ else { if (cstm_time) free (cstm_time); if (time_format) { free (time_format); time_format = NULL; } } break; case 274: /* F10 */ case 0x0a: case 0x0d: case KEY_ENTER: if ((log_err = set_formats (date_format, log_format, time_format))) draw_header (win, log_err, " %s", 3, 2, CONF_MENU_W, color_error); if (!log_err) { char **errors = NULL; int nerrors = 0; /* test log against selected settings */ if ((errors = test_format (glog, &nerrors))) { invalid = 1; load_confdlg_error (win, errors, nerrors); } /* valid data, reset glog & start parsing */ else { reset_struct (glog); /* start spinner thread */ spinner->win = win; spinner->y = 3; spinner->x = 2; spinner->spin_x = CONF_MENU_W; spinner->w = CONF_MENU_W; spinner->color = color_progress; ui_spinner_create (spinner); invalid = 0; quit = 0; } } break; case KEY_RESIZE: case 'q': quit = 0; break; } pthread_mutex_lock (&spinner->mutex); wrefresh (win); pthread_mutex_unlock (&spinner->mutex); } free (time_format); free (date_format); free (log_format); /* clean stuff up */ for (i = 0; i < n; ++i) free (menu->items[i].name); free (menu->items); free (menu); return invalid ? 1 : 0; } /* Given the name of the selected scheme, set it under our config * options. */ static void scheme_chosen (const char *name) { int force = 0; free_color_lists (); if (strcmp ("Green", name) == 0) { conf.color_scheme = STD_GREEN; force = 1; } else if (strcmp ("Monochrome", name) == 0) { conf.color_scheme = MONOCHROME; force = 1; } else if (strcmp ("Monokai", name) == 0) { conf.color_scheme = MONOKAI; force = 1; } else if (strcmp ("Custom Scheme", name) == 0) { force = 0; } init_colors (force); } static const char ** get_color_schemes (size_t * size) { const char *choices[] = { "Monokai", "Monochrome", "Green", "Custom Scheme" }; int i, j, n = ARRAY_SIZE (choices); const char **opts = xmalloc (sizeof (char *) * n); for (i = 0, j = 0; i < n; ++i) { if (!conf.color_idx && !strcmp ("Custom Scheme", choices[i])) continue; if (COLORS < 256 && !strcmp ("Monokai", choices[i])) continue; opts[j++] = choices[i]; } *size = j; return opts; } /* Render the schemes dialog. */ void load_schemes_win (WINDOW * main_win) { GMenu *menu; WINDOW *win; int c, quit = 1; size_t i, n = 0; int y, x, h = SCHEME_WIN_H, w = SCHEME_WIN_W; int w2 = w - 2; const char **choices = get_color_schemes (&n); getmaxyx (stdscr, y, x); win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, SCHEME_MENU_H, SCHEME_MENU_W, SCHEME_MENU_Y, SCHEME_MENU_X); /* remove custom color option if no custom scheme used */ menu->size = n; /* add items to GMenu */ menu->items = (GItem *) xcalloc (n, sizeof (GItem)); for (i = 0; i < n; ++i) { menu->items[i].name = alloc_string (choices[i]); menu->items[i].checked = 0; } post_gmenu (menu); draw_header (win, SCHEMEDLG_HEAD, " %s", 1, 1, w2, color_panel_header); mvwprintw (win, 2, 2, SCHEMEDLG_DESC); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); break; case KEY_UP: gmenu_driver (menu, REQ_UP); break; case 32: case 0x0a: case 0x0d: case KEY_ENTER: gmenu_driver (menu, REQ_SEL); for (i = 0; i < n; ++i) { if (menu->items[i].checked != 1) continue; scheme_chosen (choices[i]); break; } quit = 0; break; case KEY_RESIZE: case 'q': quit = 0; break; } wrefresh (win); } /* clean stuff up */ for (i = 0; i < n; ++i) free (menu->items[i].name); free (menu->items); free (menu); free (choices); touchwin (main_win); close_win (win); wrefresh (main_win); } /* Render the sort dialog. */ void load_sort_win (WINDOW * main_win, GModule module, GSort * sort) { GMenu *menu; WINDOW *win; GSortField opts[SORT_MAX_OPTS]; int c, quit = 1; int i = 0, k, n = 0; int y, x, h = SORT_WIN_H, w = SORT_WIN_W; int w2 = w - 2; getmaxyx (stdscr, y, x); /* determine amount of sort choices */ for (i = 0, k = 0; -1 != sort_choices[module][i]; i++) { GSortField field = sort_choices[module][i]; if (SORT_BY_CUMTS == field && !conf.serve_usecs) continue; else if (SORT_BY_MAXTS == field && !conf.serve_usecs) continue; else if (SORT_BY_AVGTS == field && !conf.serve_usecs) continue; else if (SORT_BY_BW == field && !conf.bandwidth) continue; else if (SORT_BY_PROT == field && !conf.append_protocol) continue; else if (SORT_BY_MTHD == field && !conf.append_method) continue; opts[k++] = field; n++; } win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, SORT_MENU_H, SORT_MENU_W, SORT_MENU_Y, SORT_MENU_X); menu->size = n; menu->selectable = 1; /* add items to GMenu */ menu->items = (GItem *) xcalloc (n, sizeof (GItem)); /* set choices, checked option and index */ for (i = 0; i < n; ++i) { GSortField field = sort_choices[module][opts[i]]; if (SORT_BY_HITS == field) { menu->items[i].name = alloc_string (MTRC_HITS_LBL); if (sort->field == SORT_BY_HITS) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_VISITORS == field) { menu->items[i].name = alloc_string (MTRC_VISITORS_LBL); if (sort->field == SORT_BY_VISITORS) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_DATA == field) { menu->items[i].name = alloc_string (MTRC_DATA_LBL); if (sort->field == SORT_BY_DATA) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_BW == field) { menu->items[i].name = alloc_string (MTRC_BW_LBL); if (sort->field == SORT_BY_BW) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_AVGTS == field) { menu->items[i].name = alloc_string (MTRC_AVGTS_LBL); if (sort->field == SORT_BY_AVGTS) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_CUMTS == field) { menu->items[i].name = alloc_string (MTRC_CUMTS_LBL); if (sort->field == SORT_BY_CUMTS) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_MAXTS == field) { menu->items[i].name = alloc_string (MTRC_MAXTS_LBL); if (sort->field == SORT_BY_MAXTS) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_PROT == field) { menu->items[i].name = alloc_string (MTRC_PROTOCOLS_LBL); if (sort->field == SORT_BY_PROT) { menu->items[i].checked = 1; menu->idx = i; } } else if (SORT_BY_MTHD == field) { menu->items[i].name = alloc_string (MTRC_METHODS_LBL); if (sort->field == SORT_BY_MTHD) { menu->items[i].checked = 1; menu->idx = i; } } } post_gmenu (menu); draw_header (win, SORTDLG_HEAD, " %s", 1, 1, w2, color_panel_header); mvwprintw (win, 2, 2, SORTDLG_DESC); if (sort->sort == SORT_ASC) mvwprintw (win, SORT_WIN_H - 2, 1, " %s", SORT_ASC_SEL); else mvwprintw (win, SORT_WIN_H - 2, 1, " %s", SORT_DESC_SEL); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); break; case KEY_UP: gmenu_driver (menu, REQ_UP); break; case 9: /* TAB */ if (sort->sort == SORT_ASC) { /* ascending */ sort->sort = SORT_DESC; mvwprintw (win, SORT_WIN_H - 2, 1, " %s", SORT_DESC_SEL); } else { /* descending */ sort->sort = SORT_ASC; mvwprintw (win, SORT_WIN_H - 2, 1, " %s", SORT_ASC_SEL); } break; case 32: case 0x0a: case 0x0d: case KEY_ENTER: gmenu_driver (menu, REQ_SEL); for (i = 0; i < n; ++i) { if (menu->items[i].checked != 1) continue; if (strcmp ("Hits", menu->items[i].name) == 0) sort->field = SORT_BY_HITS; else if (strcmp ("Visitors", menu->items[i].name) == 0) sort->field = SORT_BY_VISITORS; else if (strcmp ("Data", menu->items[i].name) == 0) sort->field = SORT_BY_DATA; else if (strcmp ("Tx. Amount", menu->items[i].name) == 0) sort->field = SORT_BY_BW; else if (strcmp ("Avg. T.S.", menu->items[i].name) == 0) sort->field = SORT_BY_AVGTS; else if (strcmp ("Cum. T.S.", menu->items[i].name) == 0) sort->field = SORT_BY_CUMTS; else if (strcmp ("Max. T.S.", menu->items[i].name) == 0) sort->field = SORT_BY_MAXTS; else if (strcmp ("Protocol", menu->items[i].name) == 0) sort->field = SORT_BY_PROT; else if (strcmp ("Method", menu->items[i].name) == 0) sort->field = SORT_BY_MTHD; quit = 0; break; } break; case KEY_RESIZE: case 'q': quit = 0; break; } wrefresh (win); } /* clean stuff up */ for (i = 0; i < n; ++i) free (menu->items[i].name); free (menu->items); free (menu); touchwin (main_win); close_win (win); wrefresh (main_win); } /* Help menu data (F1/h). */ static const char *help_main[] = { "Copyright (C) 2009-2017 by Gerardo Orellana", "http://goaccess.io - ", "Released under the MIT License.", "", "See `man` page for more details", "", "GoAccess is an open source real-time web log analyzer and", "interactive viewer that runs in a terminal in *nix systems.", "It provides fast and valuable HTTP statistics for system", "administrators that require a visual server report on the", "fly.", "", "The data collected based on the parsing of the log is", "divided into different modules. Modules are automatically", "generated and presented to the user.", "", "The main dashboard displays general statistics, top", "visitors, requests, browsers, operating systems,", "hosts, etc.", "", "The user can make use of the following keys:", " ^F1^ or ^h^ Main help", " ^F5^ Redraw [main window]", " ^q^ Quit the program, current window or module", " ^o^ or ^ENTER^ Expand selected module", " ^[Shift]0-9^ Set selected module to active", " ^Up^ arrow Scroll up main dashboard", " ^Down^ arrow Scroll down main dashboard", " ^j^ Scroll down within expanded module", " ^k^ Scroll up within expanded module", " ^c^ Set or change scheme color", " ^CTRL^ + ^f^ Scroll forward one screen within", " active module", " ^CTRL^ + ^b^ Scroll backward one screen within", " active module", " ^TAB^ Iterate modules (forward)", " ^SHIFT^ + ^TAB^ Iterate modules (backward)", " ^s^ Sort options for current module", " ^/^ Search across all modules", " ^n^ Find position of the next occurrence", " ^g^ Move to the first item or top of screen", " ^G^ Move to the last item or bottom of screen", "", "Examples can be found by running `man goaccess`.", "", "If you believe you have found a bug, please drop me", "an email with details.", "", "Feedback? Just shoot me an email to:", "hello@goaccess.io", }; /* Render the help dialog. */ void load_help_popup (WINDOW * main_win) { int c, quit = 1; size_t i, n; int y, x, h = HELP_WIN_HEIGHT, w = HELP_WIN_WIDTH; int w2 = w - 2; WINDOW *win; GMenu *menu; n = ARRAY_SIZE (help_main); getmaxyx (stdscr, y, x); win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); /* create a new instance of GMenu and make it selectable */ menu = new_gmenu (win, HELP_MENU_HEIGHT, HELP_MENU_WIDTH, HELP_MENU_Y, HELP_MENU_X); menu->size = n; /* add items to GMenu */ menu->items = (GItem *) xcalloc (n, sizeof (GItem)); for (i = 0; i < n; ++i) { menu->items[i].name = alloc_string (help_main[i]); menu->items[i].checked = 0; } post_gmenu (menu); draw_header (win, HELPDLG_HEAD, " %s", 1, 1, w2, color_panel_header); mvwprintw (win, 2, 2, HELPDLG_DESC); wrefresh (win); while (quit) { c = wgetch (stdscr); switch (c) { case KEY_DOWN: gmenu_driver (menu, REQ_DOWN); break; case KEY_UP: gmenu_driver (menu, REQ_UP); break; case KEY_RESIZE: case 'q': quit = 0; break; } wrefresh (win); } /* clean stuff up */ for (i = 0; i < n; ++i) free (menu->items[i].name); free (menu->items); free (menu); touchwin (main_win); close_win (win); wrefresh (main_win); } goaccess-1.3/src/tcbtdb.c0000644000000000000000000002177313375657450012261 00000000000000/** * tcbtdb.c -- Tokyo Cabinet database functions * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include "tcbtdb.h" #include "tcabdb.h" #ifdef HAVE_GEOLOCATION #include "geoip1.h" #endif #include "error.h" #include "util.h" #include "xmalloc.h" #ifdef TCB_BTREE /* Get the on-disk databases path. * * On success, the databases path string is returned. */ char * tc_db_set_path (const char *dbname, int module) { struct stat info; static char default_path[sizeof (TC_DBPATH "01234567890/")]; static char *db_path; char *path; char fname[RAND_FN]; int cx; /* db_path is either specified explicitly, or gets the default (pid appended) */ if (conf.db_path != NULL) db_path = (char *) conf.db_path; else { sprintf (default_path, "%s%d", TC_DBPATH, getpid ()); db_path = default_path; mkdir (db_path, TC_DBPMODE); } /* sanity check: Is db_path accessible and a directory? */ if (stat (db_path, &info) != 0) FATAL ("Unable to access database path: %s", strerror (errno)); if (!(info.st_mode & S_IFDIR)) FATAL ("Database path is not a directory."); /* for tc_db_rmdir(), return the pure folder path (or NULL to keep) */ if (dbname == NULL) return conf.db_path == NULL ? db_path : NULL; memset (fname, 0, sizeof (fname)); /* tcadbopen requires the db name suffix to be ".tcb" and thus we * don't use mkstemp(3) */ genstr (fname, RAND_FN - 1); cx = snprintf (NULL, 0, "%s/%dm%s%s", db_path, module, fname, dbname) + 1; path = xmalloc (cx); sprintf (path, "%s/%dm%s%s", db_path, module, fname, dbname); return path; } /* delete db folder if we used the customized (pid appended) default */ void tc_db_rmdir () { const char *db_path = NULL; db_path = tc_db_set_path (NULL, 0); if (db_path != NULL) if (rmdir (db_path)) LOG_DEBUG (("Unable to remove custom db folder: %s\n", db_path)); } /* Set the given database parameter into the parameters buffer. * * On error, a negative number is returned. * On success, the number of characters that would have been written is * returned. */ static int set_dbparam (char *params, int len, const char *fmt, ...) { int n; va_list args; va_start (args, fmt); n = vsnprintf (params + len, DB_PARAMS - len, fmt, args); va_end (args); if (n < 0) { n = 0; LOG_DEBUG (("Output error is encountered on set_dbparam\n")); } else if (n >= DB_PARAMS - len) { LOG_DEBUG (("Output truncated on set_dbparam\n")); n = DB_PARAMS - len; } return n; } /* Set the on-disk database parameters from enabled options in the config file. */ void tc_db_get_params (char *params, const char *path) { int len = 0; long xmmap = conf.xmmap; uint32_t lcnum, ncnum, lmemb, nmemb, bnum; /* copy path name to buffer */ len += set_dbparam (params, len, "%s", path); /* caching parameters of a B+ tree database object */ lcnum = conf.cache_lcnum > 0 ? conf.cache_lcnum : TC_LCNUM; len += set_dbparam (params, len, "#%s=%d", "lcnum", lcnum); ncnum = conf.cache_ncnum > 0 ? conf.cache_ncnum : TC_NCNUM; len += set_dbparam (params, len, "#%s=%d", "ncnum", ncnum); /* set the size of the extra mapped memory */ if (xmmap > 0) len += set_dbparam (params, len, "#%s=%ld", "xmsiz", xmmap); lmemb = conf.tune_lmemb > 0 ? conf.tune_lmemb : TC_LMEMB; len += set_dbparam (params, len, "#%s=%d", "lmemb", lmemb); nmemb = conf.tune_nmemb > 0 ? conf.tune_nmemb : TC_NMEMB; len += set_dbparam (params, len, "#%s=%d", "nmemb", nmemb); bnum = conf.tune_bnum > 0 ? conf.tune_bnum : TC_BNUM; len += set_dbparam (params, len, "#%s=%d", "bnum", bnum); /* compression */ len += set_dbparam (params, len, "#%s=%c", "opts", 'l'); if (conf.compression == TC_BZ2) { len += set_dbparam (params, len, "%c", 'b'); } else if (conf.compression == TC_ZLIB) { len += set_dbparam (params, len, "%c", 'd'); } /* open flags. create a new database if not exist, otherwise read it */ len += set_dbparam (params, len, "#%s=%s", "mode", "wc"); /* if not loading from disk, truncate regardless if a db file exists */ if (!conf.load_from_disk) len += set_dbparam (params, len, "%c", 't'); LOG_DEBUG (("%s\n", path)); LOG_DEBUG (("params: %s\n", params)); } /* Open the database handle. * * On error, the program will exit. * On success, the opened on-disk database is returned. */ TCBDB * tc_bdb_create (char *dbpath) { TCBDB *bdb; int ecode; uint32_t lcnum, ncnum, lmemb, nmemb, bnum, flags; bdb = tcbdbnew (); lcnum = conf.cache_lcnum > 0 ? conf.cache_lcnum : TC_LCNUM; ncnum = conf.cache_ncnum > 0 ? conf.cache_ncnum : TC_NCNUM; /* set the caching parameters of a B+ tree database object */ if (!tcbdbsetcache (bdb, lcnum, ncnum)) { free (dbpath); FATAL ("Unable to set TCB cache"); } /* set the size of the extra mapped memory */ if (conf.xmmap > 0 && !tcbdbsetxmsiz (bdb, conf.xmmap)) { free (dbpath); FATAL ("Unable to set TCB xmmap."); } lmemb = conf.tune_lmemb > 0 ? conf.tune_lmemb : TC_LMEMB; nmemb = conf.tune_nmemb > 0 ? conf.tune_nmemb : TC_NMEMB; bnum = conf.tune_bnum > 0 ? conf.tune_bnum : TC_BNUM; /* compression */ flags = BDBTLARGE; if (conf.compression == TC_BZ2) { flags |= BDBTBZIP; } else if (conf.compression == TC_ZLIB) { flags |= BDBTDEFLATE; } /* set the tuning parameters */ tcbdbtune (bdb, lmemb, nmemb, bnum, 8, 10, flags); /* open flags */ flags = BDBOWRITER | BDBOCREAT; if (!conf.load_from_disk) flags |= BDBOTRUNC; /* attempt to open the database */ if (!tcbdbopen (bdb, dbpath, flags)) { free (dbpath); ecode = tcbdbecode (bdb); FATAL ("%s", tcbdberrmsg (ecode)); } return bdb; } /* Close the database handle. * * On error, 1 is returned. * On success or the database is closed, 0 is returned. */ int tc_bdb_close (void *db, char *dbname) { TCBDB *bdb = db; int ecode; if (bdb == NULL) return 1; /* close the database */ if (!tcbdbclose (bdb)) { ecode = tcbdbecode (bdb); FATAL ("%s", tcbdberrmsg (ecode)); } /* delete the object */ tcbdbdel (bdb); /* remove database file */ if (!conf.keep_db_files && !tcremovelink (dbname)) LOG_DEBUG (("Unable to remove DB: %s\n", dbname)); free (dbname); return 0; } /* Compare the given integer value with one in the list object. * * If values are the equal, 1 is returned else 0 is returned. */ static int find_int_key_in_list (void *data, void *needle) { return (*(int *) data) == (*(int *) needle) ? 1 : 0; } /* Iterate over the list object and compare the current value with the given * value. * * If the value exists, 1 is returned else 0 is returned. */ static int is_value_in_tclist (TCLIST * tclist, void *value) { int i, sz; int *val; if (!tclist) return 0; for (i = 0; i < tclistnum (tclist); ++i) { val = (int *) tclistval (tclist, i, &sz); if (find_int_key_in_list (value, val)) return 1; } return 0; } /* Insert a string key and the corresponding string value. * Note: If the key exists, the value is not replaced. * * On error, or if found, 1 is returned. * On success, or if not in the list, 0 is returned. */ int ins_igsl (void *hash, int key, int value) { TCLIST *list; int in_list = 0; if (!hash) return -1; /* key found, check if key exists within the list */ if ((list = tcbdbget4 (hash, &key, sizeof (int))) != NULL) { if (is_value_in_tclist (list, &value)) in_list = 1; tclistdel (list); } /* if not on the list, add it */ if (!in_list && tcbdbputdup (hash, &key, sizeof (int), &value, sizeof (int))) return 0; return -1; } #endif goaccess-1.3/src/gkhash.c0000644000000000000000000010661613375657450012264 00000000000000/** * gkhash.c -- default hash table functions * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include "gkhash.h" #include "error.h" #include "sort.h" #include "util.h" #include "xmalloc.h" /* Hash tables storage */ static GKHashStorage *gkh_storage; /* *INDENT-OFF* */ /* Hash tables used across the whole app */ static khash_t (is32) *ht_agent_vals = NULL; static khash_t (si32) *ht_agent_keys = NULL; static khash_t (si32) *ht_unique_keys = NULL; static khash_t (ss32) *ht_hostnames = NULL; /* *INDENT-ON* */ static GKHashStorage * new_gkhstorage (uint32_t size) { GKHashStorage *storage = xcalloc (size, sizeof (GKHashStorage)); return storage; } /* Initialize a new int key - int value hash table */ static khash_t (ii32) * new_ii32_ht (void) { khash_t (ii32) * h = kh_init (ii32); return h; } /* Initialize a new int key - string value hash table */ static khash_t (is32) * new_is32_ht (void) { khash_t (is32) * h = kh_init (is32); return h; } /* Initialize a new int key - uint64_t value hash table */ static khash_t (iu64) * new_iu64_ht (void) { khash_t (iu64) * h = kh_init (iu64); return h; } /* Initialize a new string key - int value hash table */ static khash_t (si32) * new_si32_ht (void) { khash_t (si32) * h = kh_init (si32); return h; } /* Initialize a new string key - string value hash table */ static khash_t (ss32) * new_ss32_ht (void) { khash_t (ss32) * h = kh_init (ss32); return h; } /* Initialize a new int key - int value hash table */ static khash_t (igsl) * new_igsl_ht (void) { khash_t (igsl) * h = kh_init (igsl); return h; } /* Initialize a new int key - uint64_t value hash table */ static khash_t (su64) * new_su64_ht (void) { khash_t (su64) * h = kh_init (su64); return h; } /* Destroys both the hash structure and the keys for a * string key - int value hash */ static void des_si32_free (khash_t (si32) * hash) { khint_t k; if (!hash) return; for (k = 0; k < kh_end (hash); ++k) { if (kh_exist (hash, k)) { free ((char *) kh_key (hash, k)); } } kh_destroy (si32, hash); } /* Destroys both the hash structure and its string values */ static void des_is32_free (khash_t (is32) * hash) { khint_t k; if (!hash) return; for (k = 0; k < kh_end (hash); ++k) { if (kh_exist (hash, k)) { free ((char *) kh_value (hash, k)); } } kh_destroy (is32, hash); } /* Destroys both the hash structure and its string * keys and string values */ static void des_ss32_free (khash_t (ss32) * hash) { khint_t k; if (!hash) return; for (k = 0; k < kh_end (hash); ++k) { if (kh_exist (hash, k)) { free ((char *) kh_key (hash, k)); free ((char *) kh_value (hash, k)); } } kh_destroy (ss32, hash); } /* Destroys the hash structure */ static void des_ii32 (khash_t (ii32) * hash) { if (!hash) return; kh_destroy (ii32, hash); } /* Destroys both the hash structure and its GSLList * values */ static void des_igsl_free (khash_t (igsl) * hash) { khint_t k; void *list = NULL; if (!hash) return; for (k = 0; k < kh_end (hash); ++k) { if (kh_exist (hash, k) && (list = kh_value (hash, k))) { list_remove_nodes (list); } } kh_destroy (igsl, hash); } /* Destroys both the hash structure and the keys for a * string key - uint64_t value hash */ static void des_su64_free (khash_t (su64) * hash) { if (!hash) return; kh_destroy (su64, hash); } /* Destroys the hash structure */ static void des_iu64 (khash_t (iu64) * hash) { if (!hash) return; kh_destroy (iu64, hash); } /* Initialize map & metric hashes */ static void init_tables (GModule module) { int n = 0, i; /* *INDENT-OFF* */ GKHashMetric metrics[] = { {MTRC_KEYMAP , MTRC_TYPE_SI32 , {.si32 = new_si32_ht ()}} , {MTRC_ROOTMAP , MTRC_TYPE_IS32 , {.is32 = new_is32_ht ()}} , {MTRC_DATAMAP , MTRC_TYPE_IS32 , {.is32 = new_is32_ht ()}} , {MTRC_UNIQMAP , MTRC_TYPE_SI32 , {.si32 = new_si32_ht ()}} , {MTRC_ROOT , MTRC_TYPE_II32 , {.ii32 = new_ii32_ht ()}} , {MTRC_HITS , MTRC_TYPE_II32 , {.ii32 = new_ii32_ht ()}} , {MTRC_VISITORS , MTRC_TYPE_II32 , {.ii32 = new_ii32_ht ()}} , {MTRC_BW , MTRC_TYPE_IU64 , {.iu64 = new_iu64_ht ()}} , {MTRC_CUMTS , MTRC_TYPE_IU64 , {.iu64 = new_iu64_ht ()}} , {MTRC_MAXTS , MTRC_TYPE_IU64 , {.iu64 = new_iu64_ht ()}} , {MTRC_METHODS , MTRC_TYPE_IS32 , {.is32 = new_is32_ht ()}} , {MTRC_PROTOCOLS , MTRC_TYPE_IS32 , {.is32 = new_is32_ht ()}} , {MTRC_AGENTS , MTRC_TYPE_IGSL , {.igsl = new_igsl_ht ()}} , {MTRC_METADATA , MTRC_TYPE_SU64 , {.su64 = new_su64_ht ()}} , }; /* *INDENT-ON* */ n = ARRAY_SIZE (metrics); for (i = 0; i < n; i++) { gkh_storage[module].metrics[i] = metrics[i]; } } /* Initialize hash tables */ void init_storage (void) { GModule module; size_t idx = 0; /* Hashes used across the whole app (not per module) */ ht_agent_keys = (khash_t (si32) *) new_si32_ht (); ht_agent_vals = (khash_t (is32) *) new_is32_ht (); ht_hostnames = (khash_t (ss32) *) new_ss32_ht (); ht_unique_keys = (khash_t (si32) *) new_si32_ht (); gkh_storage = new_gkhstorage (TOTAL_MODULES); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; gkh_storage[module].module = module; init_tables (module); } } static void free_metric_type (GKHashMetric mtrc) { /* Determine the hash structure type */ switch (mtrc.type) { case MTRC_TYPE_II32: des_ii32 (mtrc.ii32); break; case MTRC_TYPE_IS32: des_is32_free (mtrc.is32); break; case MTRC_TYPE_IU64: des_iu64 (mtrc.iu64); break; case MTRC_TYPE_SI32: des_si32_free (mtrc.si32); break; case MTRC_TYPE_SS32: des_ss32_free (mtrc.ss32); break; case MTRC_TYPE_IGSL: des_igsl_free (mtrc.igsl); break; case MTRC_TYPE_SU64: des_su64_free (mtrc.su64); break; } } /* Destroys the hash structure allocated metrics */ static void free_metrics (GModule module) { int i; GKHashMetric mtrc; for (i = 0; i < GSMTRC_TOTAL; i++) { mtrc = gkh_storage[module].metrics[i]; free_metric_type (mtrc); } } /* Destroys the hash structure and its content */ void free_storage (void) { size_t idx = 0; des_is32_free (ht_agent_vals); des_si32_free (ht_agent_keys); des_si32_free (ht_unique_keys); des_ss32_free (ht_hostnames); if (!gkh_storage) return; FOREACH_MODULE (idx, module_list) { free_metrics (module_list[idx]); } free (gkh_storage); } /* Given a module and a metric, get the hash table * * On error, or if table is not found, NULL is returned. * On success the hash structure pointer is returned. */ static void * get_hash (GModule module, GSMetric metric) { void *hash = NULL; int i; GKHashMetric mtrc; for (i = 0; i < GSMTRC_TOTAL; i++) { if (hash != NULL) break; mtrc = gkh_storage[module].metrics[i]; if (mtrc.metric != metric) continue; /* Determine the hash structure type */ switch (mtrc.type) { case MTRC_TYPE_II32: hash = mtrc.ii32; break; case MTRC_TYPE_IS32: hash = mtrc.is32; break; case MTRC_TYPE_IU64: hash = mtrc.iu64; break; case MTRC_TYPE_SI32: hash = mtrc.si32; break; case MTRC_TYPE_SS32: hash = mtrc.ss32; break; case MTRC_TYPE_IGSL: hash = mtrc.igsl; break; case MTRC_TYPE_SU64: hash = mtrc.su64; break; } } return hash; } /* Insert a string key and the corresponding int value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_si32 (khash_t (si32) * hash, const char *key, int value) { khint_t k; int ret; char *dupkey = NULL; if (!hash) return -1; dupkey = xstrdup (key); k = kh_put (si32, hash, dupkey, &ret); /* operation failed, or key exists */ if (ret == -1 || ret == 0) { free (dupkey); return -1; } kh_val (hash, k) = value; return 0; } /* Insert an int key and the corresponding string value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_is32 (khash_t (is32) * hash, int key, const char *value) { khint_t k; int ret; if (!hash) return -1; k = kh_put (is32, hash, key, &ret); if (ret == -1 || ret == 0) return -1; kh_val (hash, k) = xstrdup (value); return 0; } /* Insert a string key and the corresponding string value. * Note: If the key exists, the value is not replaced. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ static int ins_ss32 (khash_t (ss32) * hash, const char *key, const char *value) { khint_t k; int ret; char *dupkey = NULL; if (!hash) return -1; dupkey = xstrdup (key); k = kh_put (ss32, hash, dupkey, &ret); /* operation failed, or key exists */ if (ret == -1 || ret == 0) { free (dupkey); return -1; } kh_val (hash, k) = xstrdup (value); return 0; } /* Insert an int key and an int value * Note: If the key exists, its value is replaced by the given value. * * On error, -1 is returned. * On success 0 is returned */ static int ins_ii32 (khash_t (ii32) * hash, int key, int value) { khint_t k; int ret; if (!hash) return -1; k = kh_put (ii32, hash, key, &ret); if (ret == -1) return -1; kh_val (hash, k) = value; return 0; } /* Insert an int key and a uint64_t value * Note: If the key exists, its value is replaced by the given value. * * On error, -1 is returned. * On success 0 is returned */ static int ins_iu64 (khash_t (iu64) * hash, int key, uint64_t value) { khint_t k; int ret; if (!hash) return -1; k = kh_put (iu64, hash, key, &ret); if (ret == -1) return -1; kh_val (hash, k) = value; return 0; } /* Increase an int value given an int key. * Note: If the key exists, its value is increased by the given inc. * * On error, -1 is returned. * On success the inserted value is returned */ static int inc_ii32 (khash_t (ii32) * hash, int key, int inc) { khint_t k; int ret, value = inc; if (!hash) return -1; k = kh_get (ii32, hash, key); /* key found, increment current value by the given `inc` */ if (k != kh_end (hash)) value = kh_val (hash, k) + inc; k = kh_put (ii32, hash, key, &ret); if (ret == -1) return -1; kh_val (hash, k) = value; return value; } /* Increase a uint64_t value given a string key. * * On error, -1 is returned. * On success 0 is returned */ static int inc_su64 (khash_t (su64) * hash, const char *key, uint64_t inc) { khint_t k; int ret; uint64_t value = inc; if (!hash) return -1; k = kh_get (su64, hash, key); /* key not found, set new value to the given `inc` */ if (k == kh_end (hash)) { k = kh_put (su64, hash, key, &ret); /* operation failed */ if (ret == -1) return -1; } else { value = kh_val (hash, k) + inc; } kh_val (hash, k) = value; return 0; } /* Increase a uint64_t value given an int key. * Note: If the key exists, its value is increased by the given inc. * * On error, -1 is returned. * On success 0 is returned */ static int inc_iu64 (khash_t (iu64) * hash, int key, uint64_t inc) { khint_t k; int ret; uint64_t value = inc; if (!hash) return -1; k = kh_get (iu64, hash, key); /* key found, increment current value by the given `inc` */ if (k != kh_end (hash)) value = (uint64_t) kh_val (hash, k) + inc; k = kh_put (iu64, hash, key, &ret); if (ret == -1) return -1; kh_val (hash, k) = value; return 0; } /* Insert a string key and auto increment int value. * * On error, -1 is returned. * On success the value of the key inserted is returned */ static int ins_si32_ai (khash_t (si32) * hash, const char *key) { int size = 0, value = 0; if (!hash) return -1; size = kh_size (hash); /* the auto increment value starts at SIZE (hash table) + 1 */ value = size > 0 ? size + 1 : 1; if (ins_si32 (hash, key, value) == -1) return -1; return value; } /* Compare if the given needle is in the haystack * * if equal, 1 is returned, else 0 */ static int find_int_key_in_list (void *data, void *needle) { return (*(int *) data) == (*(int *) needle) ? 1 : 0; } /* Insert an int key and the corresponding GSLList (Single linked-list) value. * Note: If the key exists within the list, the value is not appended. * * On error, -1 is returned. * On success 0 is returned */ static int ins_igsl (khash_t (igsl) * hash, int key, int value) { khint_t k; GSLList *list, *match; int ret; if (!hash) return -1; k = kh_get (igsl, hash, key); /* key found, check if key exists within the list */ if (k != kh_end (hash) && (list = kh_val (hash, k))) { if ((match = list_find (list, find_int_key_in_list, &value))) return 0; list = list_insert_prepend (list, int2ptr (value)); } else { list = list_create (int2ptr (value)); } k = kh_put (igsl, hash, key, &ret); if (ret == -1) return -1; kh_val (hash, k) = list; return 0; } /* Get the int value of a given string key. * * On error, -1 is returned. * On success the int value for the given key is returned */ static int get_si32 (khash_t (si32) * hash, const char *key) { khint_t k; if (!hash) return -1; k = kh_get (si32, hash, key); /* key found, return current value */ if (k != kh_end (hash)) return kh_val (hash, k); return -1; } /* Get the string value of a given int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ static char * get_is32 (khash_t (is32) * hash, int key) { khint_t k; char *value = NULL; if (!hash) return NULL; k = kh_get (is32, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (value = kh_val (hash, k))) return xstrdup (value); return NULL; } /* Get the string value of a given string key. * * On error, NULL is returned. * On success the string value for the given key is returned */ static char * get_ss32 (khash_t (ss32) * hash, const char *key) { khint_t k; char *value = NULL; if (!hash) return NULL; k = kh_get (ss32, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (value = kh_val (hash, k))) return xstrdup (value); return NULL; } /* Get the int value of a given int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ static int get_ii32 (khash_t (ii32) * hash, int key) { khint_t k; int value = 0; if (!hash) return -1; k = kh_get (ii32, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (value = kh_val (hash, k))) return value; return 0; } /* Get the uint64_t value of a given int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ static uint64_t get_iu64 (khash_t (iu64) * hash, int key) { khint_t k; uint64_t value = 0; if (!hash) return 0; k = kh_get (iu64, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (value = kh_val (hash, k))) return value; return 0; } /* Get the GSLList value of a given int key. * * On error, or if key is not found, NULL is returned. * On success the GSLList value for the given key is returned */ static GSLList * get_igsl (khash_t (igsl) * hash, int key) { khint_t k; GSLList *list = NULL; if (!hash) return NULL; k = kh_get (igsl, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (list = kh_val (hash, k))) return list; return NULL; } /* Get the uint64_t value of a given string key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ static uint64_t get_su64 (khash_t (su64) * hash, const char *key) { khint_t k; uint64_t val = 0; if (!hash) return 0; k = kh_get (su64, hash, key); /* key found, return current value */ if (k != kh_end (hash) && (val = kh_val (hash, k))) return val; return 0; } /* Iterate over all the key/value pairs for the given hash structure * and set the maximum and minimum values found on an integer key and * integer value. * * Note: This are expensive calls since it has to iterate over all * key-value pairs * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ static void get_ii32_min_max (khash_t (ii32) * hash, int *min, int *max) { khint_t k; int curvalue = 0, i; for (i = 0, k = kh_begin (hash); k != kh_end (hash); ++k) { if (!kh_exist (hash, k)) continue; curvalue = kh_value (hash, k); if (i++ == 0) *min = curvalue; if (curvalue > *max) *max = curvalue; if (curvalue < *min) *min = curvalue; } } /* Iterate over all the key/value pairs for the given hash structure * and set the maximum and minimum values found on an integer key and * a uint64_t value. * * Note: This are expensive calls since it has to iterate over all * key-value pairs * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ static void get_iu64_min_max (khash_t (iu64) * hash, uint64_t * min, uint64_t * max) { khint_t k; uint64_t curvalue = 0; int i; for (i = 0, k = kh_begin (hash); k != kh_end (hash); ++k) { if (!kh_exist (hash, k)) continue; curvalue = kh_value (hash, k); if (i++ == 0) *min = curvalue; if (curvalue > *max) *max = curvalue; if (curvalue < *min) *min = curvalue; } } /* Insert a unique visitor key string (IP/DATE/UA), mapped to an auto * incremented value. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_unique_key (const char *key) { int value = -1; khash_t (si32) * hash = ht_unique_keys; if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Insert a user agent key string, mapped to an auto incremented value. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_agent_key (const char *key) { int value = -1; khash_t (si32) * hash = ht_agent_keys; if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Insert a user agent int key, mapped to a user agent string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_agent_value (int key, const char *value) { khash_t (is32) * hash = ht_agent_vals; if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a keymap string key. * * If the given key exists, its value is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_keymap (GModule module, const char *key) { int value = -1; khash_t (si32) * hash = get_hash (module, MTRC_KEYMAP); if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return value; return ins_si32_ai (hash, key); } /* Insert a datamap int key and string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_datamap (GModule module, int key, const char *value) { khash_t (is32) * hash = get_hash (module, MTRC_DATAMAP); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a rootmap int key from the keymap store mapped to its string value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_rootmap (GModule module, int key, const char *value) { khash_t (is32) * hash = get_hash (module, MTRC_ROOTMAP); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a uniqmap string key. * * If the given key exists, 0 is returned. * On error, -1 is returned. * On success the value of the key inserted is returned */ int ht_insert_uniqmap (GModule module, const char *key) { int value = -1; khash_t (si32) * hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return -1; if ((value = get_si32 (hash, key)) != -1) return 0; return ins_si32_ai (hash, key); } /* Insert a data int key mapped to the corresponding int root key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_root (GModule module, int key, int value) { khash_t (ii32) * hash = get_hash (module, MTRC_ROOT); if (!hash) return -1; return ins_ii32 (hash, key, value); } /* Insert meta data counters from a string key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_meta_data (GModule module, const char *key, uint64_t value) { khash_t (su64) * hash = get_hash (module, MTRC_METADATA); if (!hash) return -1; return inc_su64 (hash, key, value); } /* Increases hits counter from an int key. * * On error, -1 is returned. * On success the inserted value is returned */ int ht_insert_hits (GModule module, int key, int inc) { khash_t (ii32) * hash = get_hash (module, MTRC_HITS); if (!hash) return -1; return inc_ii32 (hash, key, inc); } /* Increases visitors counter from an int key. * * On error, -1 is returned. * On success the inserted value is returned */ int ht_insert_visitor (GModule module, int key, int inc) { khash_t (ii32) * hash = get_hash (module, MTRC_VISITORS); if (!hash) return -1; return inc_ii32 (hash, key, inc); } /* Increases bandwidth counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_bw (GModule module, int key, uint64_t inc) { khash_t (iu64) * hash = get_hash (module, MTRC_BW); if (!hash) return -1; return inc_iu64 (hash, key, inc); } /* Increases cumulative time served counter from an int key. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_cumts (GModule module, int key, uint64_t inc) { khash_t (iu64) * hash = get_hash (module, MTRC_CUMTS); if (!hash) return -1; return inc_iu64 (hash, key, inc); } /* Insert the maximum time served counter from an int key. * Note: it compares the current value with the given value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_maxts (GModule module, int key, uint64_t value) { uint64_t curvalue = 0; khash_t (iu64) * hash = get_hash (module, MTRC_MAXTS); if (!hash) return -1; if ((curvalue = get_iu64 (hash, key)) < value) ins_iu64 (hash, key, value); return 0; } /* Insert a method given an int key and string value. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_method (GModule module, int key, const char *value) { khash_t (is32) * hash = get_hash (module, MTRC_METHODS); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert a protocol given an int key and string value. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_protocol (GModule module, int key, const char *value) { khash_t (is32) * hash = get_hash (module, MTRC_PROTOCOLS); if (!hash) return -1; return ins_is32 (hash, key, value); } /* Insert an agent for a hostname given an int key and int value. * * On error, -1 is returned. * On success 0 is returned */ int ht_insert_agent (GModule module, int key, int value) { khash_t (igsl) * hash = get_hash (module, MTRC_AGENTS); if (!hash) return -1; return ins_igsl (hash, key, value); } /* Insert an IP hostname mapped to the corresponding hostname. * * On error, or if key exists, -1 is returned. * On success 0 is returned */ int ht_insert_hostname (const char *ip, const char *host) { khash_t (ss32) * hash = ht_hostnames; if (!hash) return -1; return ins_ss32 (hash, ip, host); } /* Get the number of elements in a datamap. * * Return -1 if the operation fails, else number of elements. */ uint32_t ht_get_size_datamap (GModule module) { khash_t (is32) * hash = get_hash (module, MTRC_DATAMAP); if (!hash) return 0; return kh_size (hash); } /* Get the number of elements in a uniqmap. * * On error, 0 is returned. * On success the number of elements in MTRC_UNIQMAP is returned */ uint32_t ht_get_size_uniqmap (GModule module) { khash_t (is32) * hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return 0; return kh_size (hash); } /* Get the string data value of a given int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_datamap (GModule module, int key) { khash_t (is32) * hash = get_hash (module, MTRC_DATAMAP); if (!hash) return NULL; return get_is32 (hash, key); } /* Get the int value from MTRC_KEYMAP given a string key. * * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_keymap (GModule module, const char *key) { khash_t (si32) * hash = get_hash (module, MTRC_KEYMAP); if (!hash) return -1; return get_si32 (hash, key); } /* Get the int value from MTRC_UNIQMAP given a string key. * * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_uniqmap (GModule module, const char *key) { khash_t (si32) * hash = get_hash (module, MTRC_UNIQMAP); if (!hash) return -1; return get_si32 (hash, key); } /* Get the string root from MTRC_ROOTMAP given an int data key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_root (GModule module, int key) { int root_key = 0; khash_t (ii32) * hashroot = get_hash (module, MTRC_ROOT); khash_t (is32) * hashrootmap = get_hash (module, MTRC_ROOTMAP); if (!hashroot || !hashrootmap) return NULL; /* not found */ if ((root_key = get_ii32 (hashroot, key)) == 0) return NULL; return get_is32 (hashrootmap, root_key); } /* Get the int visitors value from MTRC_VISITORS given an int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_visitors (GModule module, int key) { khash_t (ii32) * hash = get_hash (module, MTRC_VISITORS); if (!hash) return -1; return get_ii32 (hash, key); } /* Get the int visitors value from MTRC_VISITORS given an int key. * * If key is not found, 0 is returned. * On error, -1 is returned. * On success the int value for the given key is returned */ int ht_get_hits (GModule module, int key) { khash_t (ii32) * hash = get_hash (module, MTRC_HITS); if (!hash) return -1; return get_ii32 (hash, key); } /* Get the uint64_t value from MTRC_BW given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_bw (GModule module, int key) { khash_t (iu64) * hash = get_hash (module, MTRC_BW); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the uint64_t value from MTRC_CUMTS given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_cumts (GModule module, int key) { khash_t (iu64) * hash = get_hash (module, MTRC_CUMTS); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the uint64_t value from MTRC_MAXTS given an int key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_maxts (GModule module, int key) { khash_t (iu64) * hash = get_hash (module, MTRC_MAXTS); if (!hash) return 0; return get_iu64 (hash, key); } /* Get the string value from MTRC_METHODS given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_method (GModule module, int key) { khash_t (is32) * hash = get_hash (module, MTRC_METHODS); if (!hash) return NULL; return get_is32 (hash, key); } /* Get the string value from MTRC_PROTOCOLS given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_protocol (GModule module, int key) { khash_t (is32) * hash = get_hash (module, MTRC_PROTOCOLS); if (!hash) return NULL; return get_is32 (hash, key); } /* Get the string value from ht_hostnames given a string key (IP). * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_hostname (const char *host) { khash_t (ss32) * hash = ht_hostnames; if (!hash) return NULL; return get_ss32 (hash, host); } /* Get the string value from ht_agent_vals (user agent) given an int key. * * On error, NULL is returned. * On success the string value for the given key is returned */ char * ht_get_host_agent_val (int key) { khash_t (is32) * hash = ht_agent_vals; if (!hash) return NULL; return get_is32 (hash, key); } /* Get the list value from MTRC_AGENTS given an int key. * * On error, or if key is not found, NULL is returned. * On success the GSLList value for the given key is returned */ GSLList * ht_get_host_agent_list (GModule module, int key) { khash_t (igsl) * hash = get_hash (module, MTRC_AGENTS); GSLList *list; if ((list = get_igsl (hash, key))) return list; return NULL; } /* Get the meta data uint64_t from MTRC_METADATA given a string key. * * On error, or if key is not found, 0 is returned. * On success the uint64_t value for the given key is returned */ uint64_t ht_get_meta_data (GModule module, const char *key) { khash_t (su64) * hash = get_hash (module, MTRC_METADATA); return get_su64 (hash, key); } /* Set the maximum and minimum values found on an integer key and * integer value found on the MTRC_VISITORS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_hits_min_max (GModule module, int *min, int *max) { khash_t (ii32) * hash = get_hash (module, MTRC_HITS); if (!hash) return; get_ii32_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * integer value found on the MTRC_VISITORS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_visitors_min_max (GModule module, int *min, int *max) { khash_t (ii32) * hash = get_hash (module, MTRC_VISITORS); if (!hash) return; get_ii32_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_BW hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_bw_min_max (GModule module, uint64_t * min, uint64_t * max) { khash_t (iu64) * hash = get_hash (module, MTRC_BW); if (!hash) return; get_iu64_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_CUMTS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_cumts_min_max (GModule module, uint64_t * min, uint64_t * max) { khash_t (iu64) * hash = get_hash (module, MTRC_CUMTS); if (!hash) return; get_iu64_min_max (hash, min, max); } /* Set the maximum and minimum values found on an integer key and * a uint64_t value found on the MTRC_MAXTS hash structure. * * If the hash structure is empty, no values are set. * On success the minimum and maximum values are set. */ void ht_get_maxts_min_max (GModule module, uint64_t * min, uint64_t * max) { khash_t (iu64) * hash = get_hash (module, MTRC_MAXTS); if (!hash) return; get_iu64_min_max (hash, min, max); } /* A wrapper to initialize a raw data structure. * * On success a GRawData structure is returned. */ static GRawData * init_new_raw_data (GModule module, uint32_t ht_size) { GRawData *raw_data; raw_data = new_grawdata (); raw_data->idx = 0; raw_data->module = module; raw_data->size = ht_size; raw_data->items = new_grawdata_item (ht_size); return raw_data; } /* Store the key/value pairs from a hash table into raw_data and sorts * the hits (numeric) value. * * On error, NULL is returned. * On success the GRawData sorted is returned */ static GRawData * parse_raw_num_data (GModule module) { GRawData *raw_data; khiter_t key; uint32_t ht_size = 0; khash_t (ii32) * hash = get_hash (module, MTRC_HITS); if (!hash) return NULL; ht_size = kh_size (hash); raw_data = init_new_raw_data (module, ht_size); raw_data->type = INTEGER; for (key = kh_begin (hash); key != kh_end (hash); ++key) { if (!kh_exist (hash, key)) continue; raw_data->items[raw_data->idx].key = kh_key (hash, key); raw_data->items[raw_data->idx].value.ivalue = kh_value (hash, key); raw_data->idx++; } sort_raw_num_data (raw_data, raw_data->idx); return raw_data; } /* Store the key/value pairs from a hash table into raw_data and sorts * the data (string) value. * * On error, NULL is returned. * On success the GRawData sorted is returned */ static GRawData * parse_raw_str_data (GModule module) { GRawData *raw_data; khiter_t key; uint32_t ht_size = 0; khash_t (is32) * hash = get_hash (module, MTRC_DATAMAP); if (!hash) return NULL; ht_size = kh_size (hash); raw_data = init_new_raw_data (module, ht_size); raw_data->type = STRING; for (key = kh_begin (hash); key != kh_end (hash); ++key) { if (!kh_exist (hash, key)) continue; raw_data->items[raw_data->idx].key = kh_key (hash, key); raw_data->items[raw_data->idx].value.svalue = kh_value (hash, key); raw_data->idx++; } sort_raw_str_data (raw_data, raw_data->idx); return raw_data; } /* Entry point to load the raw data from the data store into our * GRawData structure. * * On error, NULL is returned. * On success the GRawData sorted is returned */ GRawData * parse_raw_data (GModule module) { GRawData *raw_data; switch (module) { case VISITORS: raw_data = parse_raw_str_data (module); break; default: raw_data = parse_raw_num_data (module); } return raw_data; } goaccess-1.3/src/browsers.c0000644000000000000000000003406513375703564012661 00000000000000/** 6 browsers.c -- functions for dealing with browsers * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include "browsers.h" #include "error.h" #include "settings.h" #include "util.h" #include "xmalloc.h" /* ###NOTE: The size of the list is proportional to the run time, * which makes this pretty slow */ static char ***browsers_hash = NULL; /* {"search string", "belongs to"} */ static const char *browsers[][2] = { /* Game systems: most of them are based of major browsers, * thus they need to go before. */ {"Xbox One", "Game Systems"}, {"Xbox", "Game Systems"}, {"PlayStation", "Game Systems"}, {"NintendoBrowser", "Game Systems"}, {"Valve Steam", "Game Systems"}, {"Origin", "Game Systems"}, {"Raptr", "Game Systems"}, /* Based on Internet Explorer */ {"America Online Browser", "Others"}, {"Avant Browser", "Others"}, /* Internet Explorer */ {"IEMobile", "MSIE"}, {"MSIE", "MSIE"}, /* IE11 */ {"Trident/7.0", "MSIE"}, /* Microsoft Edge */ {"Edge", "MSIE"}, /* Opera */ {"Opera Mini", "Opera"}, {"Opera Mobi", "Opera"}, {"Opera", "Opera"}, {"OPR", "Opera"}, {"OPiOS", "Opera"}, {"Coast", "Opera"}, /* Others */ {"Homebrew", "Others"}, {"APT-HTTP", "Others"}, {"Apt-Cacher", "Others"}, {"Chef Client", "Others"}, {"Huawei", "Others"}, {"HUAWEI", "Others"}, {"BlackBerry", "Others"}, {"BrowserX", "Others"}, {"Dalvik", "Others"}, {"Dillo", "Others"}, {"ELinks", "Others"}, {"Epiphany", "Others"}, {"Firebird", "Others"}, {"Galeon", "Others"}, {"google-cloud-sdk", "Others"}, {"GranParadiso", "Others"}, {"IBrowse", "Others"}, {"K-Meleon", "Others"}, {"Kazehakase", "Others"}, {"Konqueror", "Others"}, {"Links", "Others"}, {"Lynx", "Others"}, {"Midori", "Others"}, {"Minefield", "Others"}, {"Mosaic", "Others"}, {"Netscape", "Others"}, {"SeaMonkey", "Others"}, {"UCBrowser", "Others"}, {"Wget", "Others"}, {"libfetch", "Others"}, {"check_http", "Others"}, {"Go-http-client", "Others"}, {"curl", "Others"}, {"midori", "Others"}, {"w3m", "Others"}, {"MicroMessenger", "Others"}, {"Apache", "Others"}, {"JOSM", "Others"}, /* Feed-reader-as-a-service */ {"AppleNewsBot", "Feeds"}, {"Bloglines", "Feeds"}, {"Digg Feed Fetcher", "Feeds"}, {"Feedbin", "Feeds"}, {"FeedHQ", "Feeds"}, {"Feedly", "Feeds"}, {"Flipboard", "Feeds"}, {"Netvibes", "Feeds"}, {"NewsBlur", "Feeds"}, {"PinRSS", "Feeds"}, {"WordPress.com Reader", "Feeds"}, {"YandexBlogs", "Feeds"}, /* Google crawlers (some based on Chrome, * therefore up on the list) */ {"AdsBot-Google", "Crawlers"}, {"AppEngine-Google", "Crawlers"}, {"Mediapartners-Google", "Crawlers"}, {"Google", "Crawlers"}, {"WhatsApp", "Crawlers"}, /* Based on Firefox */ {"Camino", "Others"}, /* Rebranded Firefox but is really unmodified * Firefox (Debian trademark policy) */ {"Iceweasel", "Firefox"}, {"Firefox", "Firefox"}, /* Based on Chromium */ {"Vivaldi", "Others"}, {"YaBrowser", "Others"}, {"Flock", "Others"}, /* Chrome has to go before Safari */ {"HeadlessChrome", "Chrome"}, {"Chrome", "Chrome"}, {"CriOS", "Chrome"}, /* Crawlers/Bots (Possible Safari based) */ {"AppleBot", "Crawlers"}, {"Twitter", "Crawlers"}, {"Safari", "Safari"}, /* Crawlers/Bots */ {"Sogou", "Crawlers"}, {"Java", "Crawlers"}, {"Jakarta Commons-HttpClient", "Crawlers"}, {"netEstate", "Crawlers"}, {"PiplBot", "Crawlers"}, {"IstellaBot", "Crawlers"}, {"heritrix", "Crawlers"}, {"PagesInventory", "Crawlers"}, {"rogerbot", "Crawlers"}, {"fastbot", "Crawlers"}, {"yacybot", "Crawlers"}, {"PycURL", "Crawlers"}, {"PHP", "Crawlers"}, {"AndroidDownloadManager", "Crawlers"}, {"Embedly", "Crawlers"}, {"ruby", "Crawlers"}, {"Ruby", "Crawlers"}, {"python", "Crawlers"}, {"Python", "Crawlers"}, {"LinkedIn", "Crawlers"}, {"Microsoft-WebDAV", "Crawlers"}, /* Podcast fetchers */ {"Downcast", "Podcasts"}, {"gPodder", "Podcasts"}, {"Instacast", "Podcasts"}, {"iTunes", "Podcasts"}, {"Miro", "Podcasts"}, {"Pocket Casts", "Podcasts"}, {"BashPodder", "Podcasts"}, /* Feed reader clients */ {"Akregator", "Feeds"}, {"Apple-PubSub", "Feeds"}, {"com.apple.Safari.WebFeedParser", "Feeds"}, {"FeedDemon", "Feeds"}, {"Feedy", "Feeds"}, {"Liferea", "Feeds"}, {"NetNewsWire", "Feeds"}, {"RSSOwl", "Feeds"}, {"Thunderbird", "Feeds"}, {"Pingdom.com", "Uptime"}, {"jetmon", "Uptime"}, {"NodeUptime", "Uptime"}, {"NewRelicPinger", "Uptime"}, {"StatusCake", "Uptime"}, {"internetVista", "Uptime"}, {"Server Density Service Monitoring v2", "Uptime"}, {"Mozilla", "Others"} }; /* Free all browser entries from our array of key/value pairs. */ void free_browsers_hash (void) { size_t i; int j; for (i = 0; i < ARRAY_SIZE (browsers); ++i) { free (browsers_hash[i][0]); free (browsers_hash[i][1]); free (browsers_hash[i]); } free (browsers_hash); for (j = 0; j < conf.browsers_hash_idx; ++j) { free (conf.user_browsers_hash[j][0]); free (conf.user_browsers_hash[j][1]); free (conf.user_browsers_hash[j]); } if (conf.browsers_file) { free (conf.user_browsers_hash); } } static int is_dup (char ***list, int len, const char *browser) { int i; /* check for dups */ for (i = 0; i < len; ++i) { if (strcmp (browser, list[i][0]) == 0) return 1; } return 0; } /* Set a browser/type pair into our multidimensional array of browsers. * * On duplicate functions returns void. * Otherwise memory is mallo'd for our array entry. */ static void set_browser (char ***list, int idx, const char *browser, const char *type) { list[idx] = xcalloc (2, sizeof (char *)); list[idx][0] = xstrdup (browser); list[idx][1] = xstrdup (type); } /* Parse the key/value pair from the browser list file. */ static void parse_browser_token (char ***list, char *line, int n) { char *val; size_t idx = 0; /* key */ idx = strcspn (line, "\t"); if (strlen (line) == idx) FATAL ("Malformed browser name at line: %d", n); line[idx] = '\0'; /* value */ val = line + (idx + 1); idx = strspn (val, "\t"); if (strlen (val) == idx) FATAL ("Malformed browser category at line: %d", n); val = val + idx; val = trim_str (val); if (is_dup (list, conf.browsers_hash_idx, line)) { LOG_INVALID (("Duplicate browser entry: %s", line)); return; } set_browser (list, conf.browsers_hash_idx, line, val); conf.browsers_hash_idx++; } /* Parse our default array of browsers and put them on our hash including those * from the custom parsed browsers file. * * On error functions returns void. * Otherwise browser entries are put into the hash. */ void parse_browsers_file (void) { char line[MAX_LINE_BROWSERS + 1]; FILE *file; int n = 0; size_t i, len = ARRAY_SIZE (browsers); browsers_hash = xmalloc (ARRAY_SIZE (browsers) * sizeof (char **)); /* load hash from the browser's array (default) */ for (i = 0; i < len; ++i) { set_browser (browsers_hash, i, browsers[i][0], browsers[i][1]); } if (!conf.browsers_file) return; /* could not open browsers file */ if ((file = fopen (conf.browsers_file, "r")) == NULL) FATAL ("Unable to open browser's file: %s", strerror (errno)); conf.user_browsers_hash = xmalloc (MAX_CUSTOM_BROWSERS * sizeof (char **)); /* load hash from the user's given browsers file */ while (fgets (line, sizeof line, file) != NULL) { while (line[0] == ' ' || line[0] == '\t') memmove (line, line + 1, strlen (line)); n++; if (line[0] == '\n' || line[0] == '\r' || line[0] == '#') continue; if (conf.browsers_hash_idx >= MAX_CUSTOM_BROWSERS) FATAL ("Maximum number of custom browsers has been reached"); parse_browser_token (conf.user_browsers_hash, line, n); } fclose (file); } /* Determine if the user-agent is a crawler. * * On error or is not a crawler, 0 is returned. * If it is a crawler, 1 is returned . */ int is_crawler (const char *agent) { char type[BROWSER_TYPE_LEN]; char *browser, *a; if (agent == NULL || *agent == '\0') return 0; if ((a = xstrdup (agent), browser = verify_browser (a, type)) != NULL) free (browser); free (a); return strcmp (type, "Crawlers") == 0 ? 1 : 0; } /* Return the Opera 15 and beyond. * * On success, the opera string and version is returned. */ static char * parse_opera (char *token) { char *val = xmalloc (snprintf (NULL, 0, "Opera%s", token) + 1); sprintf (val, "Opera%s", token); return val; } /* Given the original user agent string, and a partial crawler match, iterate * back until the next delimiter is found and return occurrence. * * On error when attempting to extract crawler, NULL is returned. * If a possible crawler string is matched, then possible bot is returned . */ static char * parse_crawler (char *str, char *match, char *type) { char *ptr = NULL; int found = 0; while (match != str) { match--; if (*match == ' ' || *match == '+') { found = 1; break; } } /* same addr */ if (match == str) return NULL; /* account for the previous +|space */ if (found) match++; if ((ptr = strpbrk (match, "; "))) *ptr = '\0'; /* empty string after parsing it */ if (*match == '\0') return NULL; xstrncpy (type, "Crawlers", BROWSER_TYPE_LEN); return xstrdup (match); } /* If the following string matches are found within user agent, then it's * highly likely it's a possible crawler. * Note that this could certainly return false positives. * * If no occurrences are found, NULL is returned. * If an occurrence is found, a pointer to the match is returned . */ static char * check_http_crawler (const char *str) { char *match = NULL; /* e.g., compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm */ if ((match = strstr (str, "; +http"))) return match; /* compatible; UptimeRobot/2.0; http://www.uptimerobot.com/ */ if ((match = strstr (str, "; http"))) return match; /* Slack-ImgProxy (+https://api.slack.com/robots) */ if ((match = strstr (str, " (+http"))) return match; /* TurnitinBot/3.0 (http://www.turnitin.com/robot/crawlerinfo.html) */ if ((match = strstr (str, " (http"))) return match; /* w3c e.g., (compatible;+Googlebot/2.1;++http://www.google.com/bot.html) */ if ((match = strstr (str, ";++http"))) return match; return NULL; } /* Parse the given user agent match and extract the browser string. * * If no match, the original match is returned. * Otherwise the parsed browser is returned. */ static char * parse_browser (char *match, char *type, int i, char ***hash) { char *b = NULL, *ptr = NULL, *slh = NULL; size_t cnt = 0, space = 0; /* Check if there are spaces in the token string, that way strpbrk * does not stop at the first space within the token string */ if ((cnt = count_matches (hash[i][0], ' ')) && (b = match)) { while (space++ < cnt && (b = strchr (b, ' '))) b++; } else b = match; xstrncpy (type, hash[i][1], BROWSER_TYPE_LEN); /* Internet Explorer 11 */ if (strstr (match, "rv:11") && strstr (match, "Trident/7.0")) { return alloc_string ("MSIE/11.0"); } /* Opera +15 uses OPR/# */ if (strstr (match, "OPR") != NULL && (slh = strrchr (match, '/'))) { return parse_opera (slh); } /* Opera has the version number at the end */ if (strstr (match, "Opera") && (slh = strrchr (match, '/')) && match < slh) { memmove (match + 5, slh, strlen (slh) + 1); } /* IE Old */ if (strstr (match, "MSIE") != NULL) { if ((ptr = strpbrk (match, ";)-")) != NULL) *ptr = '\0'; match = char_replace (match, ' ', '/'); } /* all others */ else if ((ptr = strpbrk (b, ";) ")) != NULL) { *ptr = '\0'; } return alloc_string (match); } /* Given a user agent, determine the browser used. * * ###NOTE: The size of the list is proportional to the run time, * which makes this pretty slow * * On error, NULL is returned. * On success, a malloc'd string containing the browser is returned. */ char * verify_browser (char *str, char *type) { char *match = NULL, *token = NULL; int i = 0; size_t j = 0; if (str == NULL || *str == '\0') return NULL; /* check user's list */ for (i = 0; i < conf.browsers_hash_idx; ++i) { if ((match = strstr (str, conf.user_browsers_hash[i][0])) == NULL) continue; return parse_browser (match, type, i, conf.user_browsers_hash); } if ((match = check_http_crawler (str)) && (token = parse_crawler (str, match, type))) return token; /* fallback to default browser list */ for (j = 0; j < ARRAY_SIZE (browsers); ++j) { if ((match = strstr (str, browsers_hash[j][0])) == NULL) continue; return parse_browser (match, type, j, browsers_hash); } xstrncpy (type, "Unknown", BROWSER_TYPE_LEN); return alloc_string ("Unknown"); } goaccess-1.3/src/gwsocket.c0000644000000000000000000002536113375657450012642 00000000000000/** * gwsocket.c -- An interface to send/recv data from/to Web Socket Server * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include #include #include "gwsocket.h" #include "commons.h" #include "error.h" #include "goaccess.h" #include "json.h" #include "parser.h" #include "settings.h" #include "websocket.h" #include "xmalloc.h" /* Allocate memory for a new GWSReader instance. * * On success, the newly allocated GWSReader is returned. */ GWSReader * new_gwsreader (void) { GWSReader *reader = xmalloc (sizeof (GWSReader)); memset (reader, 0, sizeof *reader); return reader; } /* Allocate memory for a new GWSWriter instance. * * On success, the newly allocated GWSWriter is returned. */ GWSWriter * new_gwswriter (void) { GWSWriter *writer = xmalloc (sizeof (GWSWriter)); memset (writer, 0, sizeof *writer); return writer; } /* Write the JSON data to a pipe. * * If unable to write bytes, -1 is returned. * On success, the number of written bytes is returned . */ static int write_holder (int fd, const char *buf, int len) { int i, ret = 0; for (i = 0; i < len;) { ret = write (fd, buf + i, len - i); if (ret < 0) { if (errno == EINTR || errno == EAGAIN) continue; return -1; } else { i += ret; } } return i; } /* Clear an incoming FIFO packet and header data. */ static void clear_fifo_packet (GWSReader * gwserver) { memset (gwserver->hdr, 0, sizeof (gwserver->hdr)); gwserver->hlen = 0; if (gwserver->packet == NULL) return; if (gwserver->packet->data) free (gwserver->packet->data); free (gwserver->packet); gwserver->packet = NULL; } /* Pack the JSON data into a network byte order and writes it to a * pipe. * * On success, 0 is returned . */ int broadcast_holder (int fd, const char *buf, int len) { char *p = NULL, *ptr = NULL; p = calloc (sizeof (uint32_t) * 3, sizeof (char)); ptr = p; ptr += pack_uint32 (ptr, 0); ptr += pack_uint32 (ptr, 0x01); ptr += pack_uint32 (ptr, len); write_holder (fd, p, sizeof (uint32_t) * 3); write_holder (fd, buf, len); free (p); return 0; } /* Pack the JSON data into a network byte order and write it to a * pipe. * * On success, 0 is returned . */ int send_holder_to_client (int fd, int listener, const char *buf, int len) { char *p = NULL, *ptr = NULL; p = calloc (sizeof (uint32_t) * 3, sizeof (char)); ptr = p; ptr += pack_uint32 (ptr, listener); ptr += pack_uint32 (ptr, 0x01); ptr += pack_uint32 (ptr, len); write_holder (fd, p, sizeof (uint32_t) * 3); write_holder (fd, buf, len); free (p); return 0; } /* Attempt to read data from the named pipe on strict mode. * Note: For now it only reads on new connections, i.e., onopen. * * If there's less data than requested, 0 is returned * If the thread is done, 1 is returned */ int read_fifo (GWSReader * gwsreader, fd_set rfds, fd_set wfds, void (*f) (int)) { WSPacket **pa = &gwsreader->packet; char *ptr; int bytes = 0, readh = 0, need = 0, fd = gwsreader->fd, max = 0; uint32_t listener = 0, type = 0, size = 0; FD_ZERO (&rfds); FD_ZERO (&wfds); /* self-pipe trick to stop the event loop */ FD_SET (gwsreader->self_pipe[0], &rfds); /* fifo */ FD_SET (fd, &rfds); max = MAX (fd, gwsreader->self_pipe[0]); if (select (max + 1, &rfds, &wfds, NULL, NULL) == -1) { switch (errno) { case EINTR: break; default: FATAL ("Unable to select: %s.", strerror (errno)); } } /* handle self-pipe trick */ if (FD_ISSET (gwsreader->self_pipe[0], &rfds)) return 1; if (!FD_ISSET (fd, &rfds)) { LOG (("No file descriptor set on read_message()\n")); return 0; } readh = gwsreader->hlen; /* read from header so far */ need = HDR_SIZE - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_fifo (fd, gwsreader->hdr, &gwsreader->hlen, readh, need)) < 0) return 0; if (bytes != need) return 0; } /* unpack size, and type */ ptr = gwsreader->hdr; ptr += unpack_uint32 (ptr, &listener); ptr += unpack_uint32 (ptr, &type); ptr += unpack_uint32 (ptr, &size); if ((*pa) == NULL) { (*pa) = xcalloc (1, sizeof (WSPacket)); (*pa)->type = type; (*pa)->size = size; (*pa)->data = xcalloc (size, sizeof (char)); } readh = (*pa)->len; /* read from payload so far */ need = (*pa)->size - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_fifo (fd, (*pa)->data, &(*pa)->len, readh, need)) < 0) return 0; if (bytes != need) return 0; } clear_fifo_packet (gwsreader); /* fast forward JSON data to the given client */ (*f) (listener); return 0; } /* Callback once a new connection is established * * It writes to a named pipe a header containing the socket, the * message type, the payload's length and the actual payload */ static int onopen (WSPipeOut * pipeout, WSClient * client) { uint32_t hsize = sizeof (uint32_t) * 3; char *hdr = calloc (hsize, sizeof (char)); char *ptr = hdr; ptr += pack_uint32 (ptr, client->listener); ptr += pack_uint32 (ptr, WS_OPCODE_TEXT); ptr += pack_uint32 (ptr, INET6_ADDRSTRLEN); ws_write_fifo (pipeout, hdr, hsize); ws_write_fifo (pipeout, client->remote_ip, INET6_ADDRSTRLEN); free (hdr); return 0; } /* Done parsing, clear out line and set status message. */ void set_ready_state (void) { fprintf (stderr, "\33[2K\r"); fprintf (stderr, "%s\n", INFO_WS_READY_FOR_CONN); } /* Open the named pipe where the websocket server writes to. * * If unable to open, -1 is returned. * On success, return the new file descriptor is returned . */ int open_fifoout (void) { const char *fifo = conf.fifo_out ? conf.fifo_out : WS_PIPEOUT; int fdfifo; /* open fifo for reading before writing */ ws_setfifo (fifo); if ((fdfifo = open (fifo, O_RDWR | O_NONBLOCK)) == -1) return -1; return fdfifo; } /* Open the named pipe where the websocket server reads from. * * If unable to open, -1 is returned. * On success, return the new file descriptor is returned . */ int open_fifoin (void) { const char *fifo = conf.fifo_in ? conf.fifo_in : WS_PIPEIN; int fdfifo; if ((fdfifo = open (fifo, O_WRONLY | O_NONBLOCK)) == -1) return -1; return fdfifo; } /* Set the self-pipe trick to handle select(2). */ void set_self_pipe (int *self_pipe) { /* Initialize self pipe. */ if (pipe (self_pipe) == -1) FATAL ("Unable to create pipe: %s.", strerror (errno)); /* make the read and write pipe non-blocking */ set_nonblocking (self_pipe[0]); set_nonblocking (self_pipe[1]); } /* Close the WebSocket server and clean up. */ void stop_ws_server (GWSWriter * gwswriter, GWSReader * gwsreader) { pthread_t writer, reader; WSServer *server = NULL; if (!gwsreader || !gwswriter) return; if (!(server = gwswriter->server)) return; pthread_mutex_lock (&gwsreader->mutex); if ((write (gwsreader->self_pipe[1], "x", 1)) == -1 && errno != EAGAIN) LOG (("Unable to write to self pipe on pipeout.\n")); pthread_mutex_unlock (&gwsreader->mutex); pthread_mutex_lock (&gwswriter->mutex); /* if it fails to write, force stop */ if ((write (server->self_pipe[1], "x", 1)) == -1 && errno != EAGAIN) ws_stop (server); pthread_mutex_unlock (&gwswriter->mutex); reader = gwsreader->thread; if (pthread_join (reader, NULL) != 0) LOG (("Unable to join thread: %d %s\n", reader, strerror (errno))); writer = gwswriter->thread; if (pthread_join (writer, NULL) != 0) LOG (("Unable to join thread: %d %s\n", writer, strerror (errno))); } /* Start the WebSocket server and initialize default options. */ static void start_server (void *ptr_data) { GWSWriter *writer = (GWSWriter *) ptr_data; writer->server->onopen = onopen; set_self_pipe (writer->server->self_pipe); /* select(2) will block in here */ ws_start (writer->server); fprintf (stderr, "Stopping WebSocket server...\n"); ws_stop (writer->server); } /* Read and set the WebSocket config options. */ static void set_ws_opts (void) { ws_set_config_strict (1); if (conf.addr) ws_set_config_host (conf.addr); if (conf.fifo_in) ws_set_config_pipein (conf.fifo_in); if (conf.fifo_out) ws_set_config_pipeout (conf.fifo_out); if (conf.origin) ws_set_config_origin (conf.origin); if (conf.port) ws_set_config_port (conf.port); if (conf.sslcert) ws_set_config_sslcert (conf.sslcert); if (conf.sslkey) ws_set_config_sslkey (conf.sslkey); } /* Setup and start the WebSocket threads. */ int setup_ws_server (GWSWriter * gwswriter, GWSReader * gwsreader) { int id; pthread_t *thread; if (pthread_mutex_init (&gwswriter->mutex, NULL)) FATAL ("Failed init gwswriter mutex"); if (pthread_mutex_init (&gwsreader->mutex, NULL)) FATAL ("Failed init gwsreader mutex"); /* send WS data thread */ thread = &gwswriter->thread; /* pre-init the websocket server, to ensure the FIFOs are created */ if ((gwswriter->server = ws_init ("0.0.0.0", "7890", set_ws_opts)) == NULL) FATAL ("Failed init websocket"); id = pthread_create (&(*thread), NULL, (void *) &start_server, gwswriter); if (id) FATAL ("Return code from pthread_create(): %d", id); /* read WS data thread */ thread = &gwsreader->thread; id = pthread_create (&(*thread), NULL, (void *) &read_client, gwsreader); if (id) FATAL ("Return code from pthread_create(): %d", id); return 0; } goaccess-1.3/src/sha1.c0000644000000000000000000001435013375657450011644 00000000000000/* SHA-1 in C By Steve Reid 100% Public Domain Test Vectors (from FIPS PUB 180-1) "abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ /* #define LITTLE_ENDIAN * This should be #define'd if true. */ #if __LITTLE_ENDIAN__ #define LITTLE_ENDIAN #endif /* #define SHA1HANDSOFF * Copies data before messing with it. */ #include #include #include "sha1.h" void SHA1Transform (uint32_t state[5], uint8_t buffer[64]); #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ /* I got the idea of expanding during the round function from SSLeay */ #ifdef LITTLE_ENDIAN #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |(rol(block->l[i],8)&0x00FF00FF)) #else #define blk0(i) block->l[i] #endif #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); /* Hash a single 512-bit block. This is the core of the algorithm. */ void SHA1Transform (uint32_t state[5], uint8_t buffer[64]) { uint32_t a, b, c, d, e; typedef union { uint8_t c[64]; uint32_t l[16]; } CHAR64LONG16; CHAR64LONG16 *block; #ifdef SHA1HANDSOFF static uint8_t workspace[64]; block = (CHAR64LONG16 *) workspace; memcpy (block, buffer, 64); #else block = (CHAR64LONG16 *) buffer; #endif /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; /* 4 rounds of 20 operations each. Loop unrolled. */ R0 (a, b, c, d, e, 0); R0 (e, a, b, c, d, 1); R0 (d, e, a, b, c, 2); R0 (c, d, e, a, b, 3); R0 (b, c, d, e, a, 4); R0 (a, b, c, d, e, 5); R0 (e, a, b, c, d, 6); R0 (d, e, a, b, c, 7); R0 (c, d, e, a, b, 8); R0 (b, c, d, e, a, 9); R0 (a, b, c, d, e, 10); R0 (e, a, b, c, d, 11); R0 (d, e, a, b, c, 12); R0 (c, d, e, a, b, 13); R0 (b, c, d, e, a, 14); R0 (a, b, c, d, e, 15); R1 (e, a, b, c, d, 16); R1 (d, e, a, b, c, 17); R1 (c, d, e, a, b, 18); R1 (b, c, d, e, a, 19); R2 (a, b, c, d, e, 20); R2 (e, a, b, c, d, 21); R2 (d, e, a, b, c, 22); R2 (c, d, e, a, b, 23); R2 (b, c, d, e, a, 24); R2 (a, b, c, d, e, 25); R2 (e, a, b, c, d, 26); R2 (d, e, a, b, c, 27); R2 (c, d, e, a, b, 28); R2 (b, c, d, e, a, 29); R2 (a, b, c, d, e, 30); R2 (e, a, b, c, d, 31); R2 (d, e, a, b, c, 32); R2 (c, d, e, a, b, 33); R2 (b, c, d, e, a, 34); R2 (a, b, c, d, e, 35); R2 (e, a, b, c, d, 36); R2 (d, e, a, b, c, 37); R2 (c, d, e, a, b, 38); R2 (b, c, d, e, a, 39); R3 (a, b, c, d, e, 40); R3 (e, a, b, c, d, 41); R3 (d, e, a, b, c, 42); R3 (c, d, e, a, b, 43); R3 (b, c, d, e, a, 44); R3 (a, b, c, d, e, 45); R3 (e, a, b, c, d, 46); R3 (d, e, a, b, c, 47); R3 (c, d, e, a, b, 48); R3 (b, c, d, e, a, 49); R3 (a, b, c, d, e, 50); R3 (e, a, b, c, d, 51); R3 (d, e, a, b, c, 52); R3 (c, d, e, a, b, 53); R3 (b, c, d, e, a, 54); R3 (a, b, c, d, e, 55); R3 (e, a, b, c, d, 56); R3 (d, e, a, b, c, 57); R3 (c, d, e, a, b, 58); R3 (b, c, d, e, a, 59); R4 (a, b, c, d, e, 60); R4 (e, a, b, c, d, 61); R4 (d, e, a, b, c, 62); R4 (c, d, e, a, b, 63); R4 (b, c, d, e, a, 64); R4 (a, b, c, d, e, 65); R4 (e, a, b, c, d, 66); R4 (d, e, a, b, c, 67); R4 (c, d, e, a, b, 68); R4 (b, c, d, e, a, 69); R4 (a, b, c, d, e, 70); R4 (e, a, b, c, d, 71); R4 (d, e, a, b, c, 72); R4 (c, d, e, a, b, 73); R4 (b, c, d, e, a, 74); R4 (a, b, c, d, e, 75); R4 (e, a, b, c, d, 76); R4 (d, e, a, b, c, 77); R4 (c, d, e, a, b, 78); R4 (b, c, d, e, a, 79); /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; } /* SHA1Init - Initialize new context */ void SHA1Init (SHA1_CTX * context) { /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = context->count[1] = 0; } /* Run your data through this. */ void SHA1Update (SHA1_CTX * context, uint8_t * data, unsigned int len) { unsigned int i, j; j = (context->count[0] >> 3) & 63; if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; context->count[1] += (len >> 29); if ((j + len) > 63) { memcpy (&context->buffer[j], data, (i = 64 - j)); SHA1Transform (context->state, context->buffer); for (; i + 63 < len; i += 64) { SHA1Transform (context->state, &data[i]); } j = 0; } else i = 0; memcpy (&context->buffer[j], &data[i], len - i); } /* Add padding and return the message digest. */ void SHA1Final (uint8_t digest[20], SHA1_CTX * context) { uint32_t i, j; uint8_t finalcount[8]; for (i = 0; i < 8; i++) { finalcount[i] = (uint8_t) ((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ } SHA1Update (context, (uint8_t *) "\200", 1); while ((context->count[0] & 504) != 448) { SHA1Update (context, (uint8_t *) "\0", 1); } SHA1Update (context, finalcount, 8); /* Should cause a SHA1Transform() */ for (i = 0; i < 20; i++) { digest[i] = (uint8_t) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } /* Wipe variables */ i = j = 0; memset (context->buffer, 0, 64); memset (context->state, 0, 20); memset (context->count, 0, 8); memset (&finalcount, 0, 8); #ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ SHA1Transform (context->state, context->buffer); #endif } goaccess-1.3/src/ui.h0000644000000000000000000001712013375657450011430 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef UI_H_INCLUDED #define UI_H_INCLUDED #ifdef HAVE_NCURSESW_NCURSES_H #include #elif HAVE_NCURSES_NCURSES_H #include #elif HAVE_NCURSES_H #include #elif HAVE_CURSES_H #include #endif #ifdef HAVE_LIBPTHREAD #include #endif /* string literals and translations */ #include "labels.h" /* Global UI defaults */ #define MIN_HEIGHT 8 /* minimum window height */ #define MIN_WIDTH 0 /* minimum window width */ #define MAX_HEIGHT_FOOTER 1 /* height of the footer window */ #define MAX_HEIGHT_HEADER 7 /* height of the header window */ #define OVERALL_NUM_COLS 4 /* number of columns on the overall stats win */ /* Spinner Label Format */ #define SPIN_FMT "%s" #define SPIN_FMTM "%s [%'d] [%'lld/s]" #define SPIN_LBL 50 /* max length of the progress spinner */ /* Module JSON keys */ #define VISITORS_ID "visitors" #define REQUESTS_ID "requests" #define REQUESTS_STATIC_ID "static_requests" #define VISIT_TIMES_ID "visit_time" #define VIRTUAL_HOSTS_ID "vhosts" #define REMOTE_USER_ID "remote_user" #define NOT_FOUND_ID "not_found" #define HOSTS_ID "hosts" #define OS_ID "os" #define BROWSERS_ID "browsers" #define REFERRERS_ID "referrers" #define REFERRING_SITES_ID "referring_sites" #define KEYPHRASES_ID "keyphrases" #define GEO_LOCATION_ID "geolocation" #define STATUS_CODES_ID "status_codes" #define GENER_ID "general" /* Overall Statistics CSV/JSON Keys */ #define OVERALL_STARTDATE "start_date" #define OVERALL_ENDDATE "end_date" #define OVERALL_DATETIME "date_time" #define OVERALL_REQ "total_requests" #define OVERALL_VALID "valid_requests" #define OVERALL_GENTIME "generation_time" #define OVERALL_FAILED "failed_requests" #define OVERALL_VISITORS "unique_visitors" #define OVERALL_FILES "unique_files" #define OVERALL_EXCL_HITS "excluded_hits" #define OVERALL_REF "unique_referrers" #define OVERALL_NOTFOUND "unique_not_found" #define OVERALL_STATIC "unique_static_files" #define OVERALL_LOGSIZE "log_size" #define OVERALL_BANDWIDTH "bandwidth" #define OVERALL_LOG "log_path" /* CONFIG DIALOG */ #define CONF_MENU_H 6 #define CONF_MENU_W 57 #define CONF_MENU_X 2 #define CONF_MENU_Y 4 #define CONF_WIN_H 20 #define CONF_WIN_W 61 /* FIND DIALOG */ #define FIND_DLG_HEIGHT 8 #define FIND_DLG_WIDTH 50 #define FIND_MAX_MATCHES 1 /* COLOR SCHEME DIALOG */ #define SCHEME_MENU_H 4 #define SCHEME_MENU_W 38 #define SCHEME_MENU_X 2 #define SCHEME_MENU_Y 4 #define SCHEME_WIN_H 10 #define SCHEME_WIN_W 42 /* SORT DIALOG */ #define SORT_MENU_H 6 #define SORT_MENU_W 38 #define SORT_MENU_X 2 #define SORT_MENU_Y 4 #define SORT_WIN_H 13 #define SORT_WIN_W 42 /* AGENTS DIALOG */ #define AGENTS_MENU_X 2 #define AGENTS_MENU_Y 4 /* HELP DIALOG */ #define HELP_MENU_HEIGHT 12 #define HELP_MENU_WIDTH 60 #define HELP_MENU_X 2 #define HELP_MENU_Y 4 #define HELP_WIN_HEIGHT 17 #define HELP_WIN_WIDTH 64 /* CONF ERROR DIALOG */ #define ERR_MENU_HEIGHT 10 #define ERR_MENU_WIDTH 57 #define ERR_MENU_X 2 #define ERR_MENU_Y 4 #define ERR_WIN_HEIGHT 15 #define ERR_WIN_WIDTH 61 /* Convenient macros */ #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #include "color.h" #include "commons.h" #include "sort.h" /* Curses dashboard find */ typedef struct GFind_ { GModule module; char *pattern; int next_idx; int next_parent_idx; int next_sub_idx; int look_in_sub; int done; int icase; } GFind; /* Each panel contains its own scrolling and offset */ typedef struct GScrollModule_ { int scroll; int offset; } GScrollModule; /* Curses Scrolling */ typedef struct GScroll_ { GScrollModule module[TOTAL_MODULES]; GModule current; int dash; int expanded; } GScroll; /* Spinner or Progress Indicator */ typedef struct GSpinner_ { const char *label; GColors *(*color) (void); int curses; int spin_x; int w; int x; int y; pthread_mutex_t mutex; pthread_t thread; unsigned int *processed; WINDOW *win; enum { SPN_RUN, SPN_END } state; } GSpinner; /* Controls metric output. * i.e., which metrics it should display */ typedef struct GOutput_ { GModule module; int8_t visitors; int8_t hits; int8_t percent; int8_t bw; int8_t avgts; int8_t cumts; int8_t maxts; int8_t protocol; int8_t method; int8_t data; int8_t graph; /* display bars when collapsed */ int8_t sub_graph; /* display bars upon expanding it */ } GOutput; /* *INDENT-OFF* */ GOutput *output_lookup (GModule module); GSpinner *new_gspinner (void); char *get_browser_type (char *line); char *get_overall_header (GHolder *h); char *input_string (WINDOW * win, int pos_y, int pos_x, size_t max_width, const char *str, int enable_case, int *toggle_case); const char *module_to_desc (GModule module); const char *module_to_head (GModule module); const char *module_to_id (GModule module); const char *module_to_label (GModule module); int get_start_end_parsing_dates (GHolder * h, char **start, char **end, const char *f); int render_confdlg (GLog * glog, GSpinner * spinner); int set_host_agents (const char *addr, void (*func) (void *, void *, int), void *arr); void close_win (WINDOW * w); void display_general (WINDOW * win, GLog * glog, GHolder *h); void draw_header (WINDOW * win, const char *s, const char *fmt, int y, int x, int w, GColors * (*func) (void)); void end_spinner (void); void generate_time (void); void init_colors (int force); void init_windows (WINDOW ** header_win, WINDOW ** main_win); void load_agent_list (WINDOW * main_win, char *addr); void load_help_popup (WINDOW * main_win); void load_schemes_win (WINDOW * main_win); void load_sort_win (WINDOW * main_win, GModule module, GSort * sort); void set_curses_spinner (GSpinner *spinner); void set_input_opts (void); void set_wbkgd (WINDOW *main_win, WINDOW *header_win); void term_size (WINDOW * main_win, int *main_win_height); void ui_spinner_create (GSpinner * spinner); void update_active_module (WINDOW * header_win, GModule current); void update_header (WINDOW * header_win, int current); /* *INDENT-ON* */ #endif goaccess-1.3/src/gholder.c0000644000000000000000000004440113375657450012434 00000000000000/** * gholder.c -- data structure to hold raw data * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #ifdef HAVE_GEOLOCATION #include "geoip1.h" #endif #include "gholder.h" #include "error.h" #include "gdns.h" #include "util.h" #include "xmalloc.h" typedef struct GPanel_ { GModule module; void (*insert) (GRawDataItem item, GHolder * h, GRawDataType type, const struct GPanel_ *); void (*holder_callback) (GHolder * h); void (*lookup) (GRawDataItem item); } GPanel; static void add_data_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, const GPanel * panel); static void add_host_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, const GPanel * panel); static void add_root_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, const GPanel * panel); static void add_host_child_to_holder (GHolder * h); /* *INDENT-OFF* */ static GPanel paneling[] = { {VISITORS , add_data_to_holder, NULL} , {REQUESTS , add_data_to_holder, NULL} , {REQUESTS_STATIC , add_data_to_holder, NULL} , {NOT_FOUND , add_data_to_holder, NULL} , {HOSTS , add_host_to_holder, add_host_child_to_holder} , {OS , add_root_to_holder, NULL} , {BROWSERS , add_root_to_holder, NULL} , {VISIT_TIMES , add_data_to_holder, NULL} , {VIRTUAL_HOSTS , add_data_to_holder, NULL} , {REFERRERS , add_data_to_holder, NULL} , {REFERRING_SITES , add_data_to_holder, NULL} , {KEYPHRASES , add_data_to_holder, NULL} , {STATUS_CODES , add_root_to_holder, NULL} , {REMOTE_USER , add_data_to_holder, NULL} , #ifdef HAVE_GEOLOCATION {GEO_LOCATION , add_root_to_holder, NULL} , #endif }; /* *INDENT-ON* */ /* Get a panel from the GPanel structure given a module. * * On error, or if not found, NULL is returned. * On success, the panel value is returned. */ static GPanel * panel_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (paneling); for (i = 0; i < num_panels; i++) { if (paneling[i].module == module) return &paneling[i]; } return NULL; } /* Allocate memory for a new GHolder instance. * * On success, the newly allocated GHolder is returned . */ GHolder * new_gholder (uint32_t size) { GHolder *holder = xmalloc (size * sizeof (GHolder)); memset (holder, 0, size * sizeof *holder); return holder; } /* Allocate memory for a new GHolderItem instance. * * On success, the newly allocated GHolderItem is returned . */ static GHolderItem * new_gholder_item (uint32_t size) { GHolderItem *item = xcalloc (size, sizeof (GHolderItem)); return item; } /* Allocate memory for a new double linked-list GSubList instance. * * On success, the newly allocated GSubList is returned . */ static GSubList * new_gsublist (void) { GSubList *sub_list = xmalloc (sizeof (GSubList)); sub_list->head = NULL; sub_list->tail = NULL; sub_list->size = 0; return sub_list; } /* Allocate memory for a new double linked-list GSubItem node. * * On success, the newly allocated GSubItem is returned . */ static GSubItem * new_gsubitem (GModule module, GMetrics * nmetrics) { GSubItem *sub_item = xmalloc (sizeof (GSubItem)); sub_item->metrics = nmetrics; sub_item->module = module; sub_item->prev = NULL; sub_item->next = NULL; return sub_item; } /* Add an item to the end of a given sub list. */ static void add_sub_item_back (GSubList * sub_list, GModule module, GMetrics * nmetrics) { GSubItem *sub_item = new_gsubitem (module, nmetrics); if (sub_list->tail) { sub_list->tail->next = sub_item; sub_item->prev = sub_list->tail; sub_list->tail = sub_item; } else { sub_list->head = sub_item; sub_list->tail = sub_item; } sub_list->size++; } /* Delete the entire given sub list. */ static void delete_sub_list (GSubList * sub_list) { GSubItem *item = NULL; GSubItem *next = NULL; if (sub_list != NULL && sub_list->size == 0) goto clear; if (sub_list->size == 0) return; for (item = sub_list->head; item; item = next) { next = item->next; free (item->metrics->data); free (item->metrics); free (item); } clear: sub_list->head = NULL; sub_list->size = 0; free (sub_list); } /* Free malloc'd holder fields. */ static void free_holder_data (GHolderItem item) { if (item.sub_list != NULL) delete_sub_list (item.sub_list); if (item.metrics->data != NULL) free (item.metrics->data); if (item.metrics->method != NULL) free (item.metrics->method); if (item.metrics->protocol != NULL) free (item.metrics->protocol); if (item.metrics != NULL) free (item.metrics); } /* Free all memory allocated in holder for a given module. */ void free_holder_by_module (GHolder ** holder, GModule module) { int j; if ((*holder) == NULL) return; for (j = 0; j < (*holder)[module].idx; j++) { free_holder_data ((*holder)[module].items[j]); } free ((*holder)[module].items); (*holder)[module].holder_size = 0; (*holder)[module].idx = 0; (*holder)[module].sub_items_size = 0; } /* Free all memory allocated in holder for all modules. */ void free_holder (GHolder ** holder) { GModule module; int j; size_t idx = 0; if ((*holder) == NULL) return; FOREACH_MODULE (idx, module_list) { module = module_list[idx]; for (j = 0; j < (*holder)[module].idx; j++) { free_holder_data ((*holder)[module].items[j]); } free ((*holder)[module].items); } free (*holder); (*holder) = NULL; } /* Iterate over holder and get the key index. * * If the key does not exist, -1 is returned. * On success, the key in holder is returned . */ static int get_item_idx_in_holder (GHolder * holder, const char *k) { int i; if (holder == NULL) return KEY_NOT_FOUND; if (holder->idx == 0) return KEY_NOT_FOUND; if (k == NULL || *k == '\0') return KEY_NOT_FOUND; for (i = 0; i < holder->idx; i++) { if (strcmp (k, holder->items[i].metrics->data) == 0) return i; } return KEY_NOT_FOUND; } /* Copy linked-list items to an array, sort, and move them back to the * list. Should be faster than sorting the list */ static void sort_sub_list (GHolder * h, GSort sort) { GHolderItem *arr; GSubItem *iter; GSubList *sub_list; int i, j, k; /* iterate over root-level nodes */ for (i = 0; i < h->idx; i++) { sub_list = h->items[i].sub_list; if (sub_list == NULL) continue; arr = new_gholder_item (sub_list->size); /* copy items from the linked-list into an array */ for (j = 0, iter = sub_list->head; iter; iter = iter->next, j++) { arr[j].metrics = new_gmetrics (); arr[j].metrics->bw.nbw = iter->metrics->bw.nbw; arr[j].metrics->data = xstrdup (iter->metrics->data); arr[j].metrics->hits = iter->metrics->hits; arr[j].metrics->id = iter->metrics->id; arr[j].metrics->visitors = iter->metrics->visitors; if (conf.serve_usecs) { arr[j].metrics->avgts.nts = iter->metrics->avgts.nts; arr[j].metrics->cumts.nts = iter->metrics->cumts.nts; arr[j].metrics->maxts.nts = iter->metrics->maxts.nts; } } sort_holder_items (arr, j, sort); delete_sub_list (sub_list); sub_list = new_gsublist (); for (k = 0; k < j; k++) { if (k > 0) sub_list = h->items[i].sub_list; add_sub_item_back (sub_list, h->module, arr[k].metrics); h->items[i].sub_list = sub_list; } free (arr); } } /* Set the data metric field for the host panel. * * On success, the data field/metric is set. */ static int set_host_child_metrics (char *data, uint8_t id, GMetrics ** nmetrics) { GMetrics *metrics; metrics = new_gmetrics (); metrics->data = xstrdup (data); metrics->id = id; *nmetrics = metrics; return 0; } /* Set host panel data, including sub items. * * On success, the host panel data is set. */ static void set_host_sub_list (GHolder * h, GSubList * sub_list) { GMetrics *nmetrics; #ifdef HAVE_GEOLOCATION char city[CITY_LEN] = ""; char continent[CONTINENT_LEN] = ""; char country[COUNTRY_LEN] = ""; #endif char *host = h->items[h->idx].metrics->data, *hostname = NULL; #ifdef HAVE_GEOLOCATION /* add geolocation child nodes */ set_geolocation (host, continent, country, city); /* country */ if (country[0] != '\0') { set_host_child_metrics (country, MTRC_ID_COUNTRY, &nmetrics); add_sub_item_back (sub_list, h->module, nmetrics); h->items[h->idx].sub_list = sub_list; h->sub_items_size++; /* flag only */ conf.has_geocountry = 1; } /* city */ if (city[0] != '\0') { set_host_child_metrics (city, MTRC_ID_CITY, &nmetrics); add_sub_item_back (sub_list, h->module, nmetrics); h->items[h->idx].sub_list = sub_list; h->sub_items_size++; /* flag only */ conf.has_geocity = 1; } #endif /* hostname */ if (conf.enable_html_resolver && conf.output_stdout) { hostname = reverse_ip (host); set_host_child_metrics (hostname, MTRC_ID_HOSTNAME, &nmetrics); add_sub_item_back (sub_list, h->module, nmetrics); h->items[h->idx].sub_list = sub_list; h->sub_items_size++; free (hostname); } } /* Set host panel data, including sub items. * * On success, the host panel data is set. */ static void add_host_child_to_holder (GHolder * h) { GMetrics *nmetrics; GSubList *sub_list = new_gsublist (); char *ip = h->items[h->idx].metrics->data; char *hostname = NULL; int n = h->sub_items_size; /* add child nodes */ set_host_sub_list (h, sub_list); pthread_mutex_lock (&gdns_thread.mutex); hostname = ht_get_hostname (ip); pthread_mutex_unlock (&gdns_thread.mutex); /* determine if we have the IP's hostname */ if (!hostname) { dns_resolver (ip); } else if (hostname) { set_host_child_metrics (hostname, MTRC_ID_HOSTNAME, &nmetrics); add_sub_item_back (sub_list, h->module, nmetrics); h->items[h->idx].sub_list = sub_list; h->sub_items_size++; free (hostname); } /* did not add any items */ if (n == h->sub_items_size) free (sub_list); } /* Given a GRawDataType, set the data and hits value. * * On error, no values are set and 1 is returned. * On success, the data and hits values are set and 0 is returned. */ static int set_data_hits_keys (GModule module, GRawDataItem item, GRawDataType type, char **data, int *hits) { if (type == INTEGER) { if (!(*data = ht_get_datamap (module, item.key))) return 1; *hits = item.value.ivalue; } else if (type == STRING) { if (!(*hits = ht_get_hits (module, item.key))) return 1; *data = xstrdup (item.value.svalue); } return 0; } /* Given a data item, store it into a holder structure. */ static void set_data_holder_metrics (GRawDataItem item, GHolder * h, char *data, int hits) { char *method = NULL, *protocol = NULL; int visitors = 0; uint64_t bw = 0, cumts = 0, maxts = 0; bw = ht_get_bw (h->module, item.key); cumts = ht_get_cumts (h->module, item.key); maxts = ht_get_maxts (h->module, item.key); visitors = ht_get_visitors (h->module, item.key); h->items[h->idx].metrics = new_gmetrics (); h->items[h->idx].metrics->hits = hits; h->items[h->idx].metrics->data = data; h->items[h->idx].metrics->visitors = visitors; h->items[h->idx].metrics->bw.nbw = bw; h->items[h->idx].metrics->avgts.nts = cumts / hits; h->items[h->idx].metrics->cumts.nts = cumts; h->items[h->idx].metrics->maxts.nts = maxts; if (conf.append_method) { method = ht_get_method (h->module, item.key); h->items[h->idx].metrics->method = method; } if (conf.append_protocol) { protocol = ht_get_protocol (h->module, item.key); h->items[h->idx].metrics->protocol = protocol; } } /* A wrapper to set a host item */ static void set_host (GRawDataItem item, GHolder * h, const GPanel * panel, char *data, int hits) { set_data_holder_metrics (item, h, xstrdup (data), hits); if (panel->holder_callback) panel->holder_callback (h); h->idx++; } /* Set all panel data. This will set data for panels that do not * contain sub items. A function pointer is used for post data set. */ static void add_data_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, const GPanel * panel) { char *data = NULL; int hits = 0; if (set_data_hits_keys (h->module, item, type, &data, &hits) == 1) return; set_data_holder_metrics (item, h, data, hits); if (panel->holder_callback) panel->holder_callback (h); h->idx++; } /* Set all panel data. This will set data for panels that do not * contain sub items. A function pointer is used for post data set. */ static void add_host_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, const GPanel * panel) { char buf4[INET_ADDRSTRLEN]; char buf6[INET6_ADDRSTRLEN]; char *data = NULL; int hits = 0; unsigned i; struct in6_addr addr6, mask6, nwork6; struct in_addr addr4, mask4, nwork4; const char *m4 = "255.255.255.0"; const char *m6 = "ffff:ffff:ffff:ffff:0000:0000:0000:0000"; if (set_data_hits_keys (h->module, item, type, &data, &hits) == 1) return; if (!conf.anonymize_ip) { add_data_to_holder (item, h, type, panel); free (data); return; } if (1 == inet_pton (AF_INET, data, &addr4)) { if (1 == inet_pton (AF_INET, m4, &mask4)) { memset (buf4, 0, sizeof *buf4); nwork4.s_addr = addr4.s_addr & mask4.s_addr; if (inet_ntop (AF_INET, &nwork4, buf4, INET_ADDRSTRLEN) != NULL) { set_host (item, h, panel, buf4, hits); free (data); } } } else if (1 == inet_pton (AF_INET6, data, &addr6)) { if (1 == inet_pton (AF_INET6, m6, &mask6)) { memset (buf6, 0, sizeof *buf6); for (i = 0; i < 16; i++) { nwork6.s6_addr[i] = addr6.s6_addr[i] & mask6.s6_addr[i]; } if (inet_ntop (AF_INET6, &nwork6, buf6, INET6_ADDRSTRLEN) != NULL) { set_host (item, h, panel, buf6, hits); free (data); } } } } /* Set all root panel data. This will set the root nodes. */ static int set_root_metrics (GRawDataItem item, GRawDataType type, GModule module, GMetrics ** nmetrics) { GMetrics *metrics; char *data = NULL; uint64_t bw = 0, cumts = 0, maxts = 0; int hits = 0, visitors = 0; if (set_data_hits_keys (module, item, type, &data, &hits) == 1) return 1; bw = ht_get_bw (module, item.key); cumts = ht_get_cumts (module, item.key); maxts = ht_get_maxts (module, item.key); visitors = ht_get_visitors (module, item.key); metrics = new_gmetrics (); metrics->avgts.nts = cumts / hits; metrics->cumts.nts = cumts; metrics->maxts.nts = maxts; metrics->bw.nbw = bw; metrics->data = data; metrics->hits = hits; metrics->visitors = visitors; *nmetrics = metrics; return 0; } /* Set all root panel data, including sub list items. */ static void add_root_to_holder (GRawDataItem item, GHolder * h, GRawDataType type, GO_UNUSED const GPanel * panel) { GSubList *sub_list; GMetrics *metrics, *nmetrics; char *root = NULL; int root_idx = KEY_NOT_FOUND, idx = 0; if (set_root_metrics (item, type, h->module, &nmetrics) == 1) return; if (!(root = (ht_get_root (h->module, item.key)))) return; /* add data as a child node into holder */ if (KEY_NOT_FOUND == (root_idx = get_item_idx_in_holder (h, root))) { idx = h->idx; sub_list = new_gsublist (); metrics = new_gmetrics (); h->items[idx].metrics = metrics; h->items[idx].metrics->data = root; h->idx++; } else { sub_list = h->items[root_idx].sub_list; metrics = h->items[root_idx].metrics; idx = root_idx; free (root); } add_sub_item_back (sub_list, h->module, nmetrics); h->items[idx].sub_list = sub_list; h->items[idx].metrics = metrics; h->items[idx].metrics->cumts.nts += nmetrics->cumts.nts; h->items[idx].metrics->bw.nbw += nmetrics->bw.nbw; h->items[idx].metrics->hits += nmetrics->hits; h->items[idx].metrics->visitors += nmetrics->visitors; h->items[idx].metrics->avgts.nts = h->items[idx].metrics->cumts.nts / h->items[idx].metrics->hits; if (nmetrics->maxts.nts > h->items[idx].metrics->maxts.nts) h->items[idx].metrics->maxts.nts = nmetrics->maxts.nts; h->sub_items_size++; } /* Load raw data into our holder structure */ void load_holder_data (GRawData * raw_data, GHolder * h, GModule module, GSort sort) { int i, size = 0, max_choices = get_max_choices (); const GPanel *panel = panel_lookup (module); size = raw_data->size; h->holder_size = size > max_choices ? max_choices : size; h->ht_size = size; h->idx = 0; h->module = module; h->sub_items_size = 0; h->items = new_gholder_item (h->holder_size); for (i = 0; i < h->holder_size; i++) { panel->insert (raw_data->items[i], h, raw_data->type, panel); } sort_holder_items (h->items, h->idx, sort); if (h->sub_items_size) sort_sub_list (h, sort); free_raw_data (raw_data); } goaccess-1.3/src/opesys.c0000644000000000000000000002623113375657450012333 00000000000000/** * opesys.c -- functions for dealing with operating systems * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include "opesys.h" #include "settings.h" #include "util.h" #include "xmalloc.h" /* ###NOTE: The size of the list is proportional to the run time, * which makes this pretty slow */ /* {"search string", "belongs to"} */ static const char *os[][2] = { {"Android", "Android"}, {"Windows NT 10.0", "Windows"}, {"Windows NT 6.3; ARM", "Windows"}, {"Windows NT 6.3", "Windows"}, {"Windows NT 6.2; ARM", "Windows"}, {"Windows NT 6.2", "Windows"}, {"Windows NT 6.1", "Windows"}, {"Windows NT 6.0", "Windows"}, {"Windows NT 5.2", "Windows"}, {"Windows NT 5.1", "Windows"}, {"Windows NT 5.01", "Windows"}, {"Windows NT 5.0", "Windows"}, {"Windows NT 4.0", "Windows"}, {"Windows NT", "Windows"}, {"Win 9x 4.90", "Windows"}, {"Windows 98", "Windows"}, {"Windows 95", "Windows"}, {"Windows CE", "Windows"}, {"Windows Phone 8.1", "Windows"}, {"Windows Phone 8.0", "Windows"}, {"Googlebot", "Unix-like"}, {"Mastodon", "Unix-like"}, {"bingbot", "Windows"}, {"iPad", "iOS"}, {"iPod", "iOS"}, {"iPhone", "iOS"}, {"AppleTV", "iOS"}, {"iTunes", "Macintosh"}, {"OS X", "Macintosh"}, {"Darwin", "Darwin"}, {"Debian", "Linux"}, {"Ubuntu", "Linux"}, {"Fedora", "Linux"}, {"Mint", "Linux"}, {"SUSE", "Linux"}, {"Mandriva", "Linux"}, {"Red Hat", "Linux"}, {"Gentoo", "Linux"}, {"CentOS", "Linux"}, {"PCLinuxOS", "Linux"}, {"Linux", "Linux"}, {"FreeBSD", "BSD"}, {"NetBSD", "BSD"}, {"OpenBSD", "BSD"}, {"DragonFly", "BSD"}, {"PlayStation", "BSD"}, {"CrOS", "Chrome OS"}, {"SunOS", "Unix-like"}, {"QNX", "Unix-like"}, {"BB10", "Unix-like"}, {"BlackBerry", "Others"}, {"Sony", "Others"}, {"AmigaOS", "Others"}, {"SymbianOS", "Others"}, {"Nokia", "Others"}, {"Nintendo", "Others"}, {"Apache", "Others"}, {"Xbox One", "Windows"}, {"Xbox", "Windows"}, }; /* Get the Android code name (if applicable). * * On error, the given name is allocated and returned. * On success, the matching Android codename is allocated and * returned. */ static char * get_real_android (const char *droid) { if (strstr (droid, "9")) return alloc_string ("Pie 9"); else if (strstr (droid, "8.1")) return alloc_string ("Oreo 8.1"); else if (strstr (droid, "8.0")) return alloc_string ("Oreo 8.0"); else if (strstr (droid, "7.1")) return alloc_string ("Nougat 7.1"); else if (strstr (droid, "7.0")) return alloc_string ("Nougat 7.0"); else if (strstr (droid, "6.0.1")) return alloc_string ("Marshmallow 6.0.1"); else if (strstr (droid, "6.0")) return alloc_string ("Marshmallow 6.0"); else if (strstr (droid, "5.1")) return alloc_string ("Lollipop 5.1"); else if (strstr (droid, "5.0")) return alloc_string ("Lollipop 5.0"); else if (strstr (droid, "4.4")) return alloc_string ("KitKat 4.4"); else if (strstr (droid, "4.3")) return alloc_string ("Jelly Bean 4.3"); else if (strstr (droid, "4.2")) return alloc_string ("Jelly Bean 4.2"); else if (strstr (droid, "4.1")) return alloc_string ("Jelly Bean 4.1"); else if (strstr (droid, "4.0")) return alloc_string ("Ice Cream Sandwich 4.0"); else if (strstr (droid, "3.")) return alloc_string ("Honeycomb 3"); else if (strstr (droid, "2.3")) return alloc_string ("Gingerbread 2.3"); else if (strstr (droid, "2.2")) return alloc_string ("Froyo 2.2"); else if (strstr (droid, "2.0") || strstr (droid, "2.1")) return alloc_string ("Eclair 2"); else if (strstr (droid, "1.6")) return alloc_string ("Donut 1.6"); else if (strstr (droid, "1.5")) return alloc_string ("Cupcake 1.5"); return alloc_string (droid); } /* Get the Windows marketing name (if applicable). * * On error, the given name is allocated and returned. * On success, the matching Windows marketing name is allocated and * returned. */ static char * get_real_win (const char *win) { if (strstr (win, "10.0")) return alloc_string ("Windows 10"); else if (strstr (win, "6.3")) return alloc_string ("Windows 8.1"); else if (strstr (win, "6.3; ARM")) return alloc_string ("Windows RT"); else if (strstr (win, "6.2; ARM")) return alloc_string ("Windows RT"); else if (strstr (win, "6.2")) return alloc_string ("Windows 8"); else if (strstr (win, "6.1")) return alloc_string ("Windows 7"); else if (strstr (win, "6.0")) return alloc_string ("Windows Vista"); else if (strstr (win, "5.2")) return alloc_string ("Windows XP x64"); else if (strstr (win, "5.1")) return alloc_string ("Windows XP"); else if (strstr (win, "5.0")) return alloc_string ("Windows 2000"); return NULL; } /* Get the Mac OS X code name (if applicable). * * On error, the given name is allocated and returned. * On success, the matching Mac OS X codename is allocated and * returned. */ static char * get_real_mac_osx (const char *osx) { if (strstr (osx, "10.14")) return alloc_string ("macOS 10.14 Mojave"); else if (strstr (osx, "10.13")) return alloc_string ("macOS 10.13 High Sierra"); else if (strstr (osx, "10.12")) return alloc_string ("macOS 10.12 Sierra"); else if (strstr (osx, "10.11")) return alloc_string ("OS X 10.11 El Capitan"); else if (strstr (osx, "10.10")) return alloc_string ("OS X 10.10 Yosemite"); else if (strstr (osx, "10.9")) return alloc_string ("OS X 10.9 Mavericks"); else if (strstr (osx, "10.8")) return alloc_string ("OS X 10.8 Mountain Lion"); else if (strstr (osx, "10.7")) return alloc_string ("OS X 10.7 Lion"); else if (strstr (osx, "10.6")) return alloc_string ("OS X 10.6 Snow Leopard"); else if (strstr (osx, "10.5")) return alloc_string ("OS X 10.5 Leopard"); else if (strstr (osx, "10.4")) return alloc_string ("OS X 10.4 Tiger"); else if (strstr (osx, "10.3")) return alloc_string ("OS X 10.3 Panther"); else if (strstr (osx, "10.2")) return alloc_string ("OS X 10.2 Jaguar"); else if (strstr (osx, "10.1")) return alloc_string ("OS X 10.1 Puma"); else if (strstr (osx, "10.0")) return alloc_string ("OS X 10.0 Cheetah"); return alloc_string (osx); } /* Parse all other operating systems. * * On error, the given name is returned. * On success, the parsed OS is returned. */ static char * parse_others (char *agent, int spaces) { char *p; int space = 0; p = agent; /* assume the following chars are within the given agent */ while (*p != ';' && *p != ')' && *p != '(' && *p != '\0') { if (*p == ' ') space++; if (space > spaces) break; p++; } *p = 0; return agent; } /* Parse iOS string including version number. * * On error, the matching token is returned (no version). * On success, the parsed iOS is returned. */ static char * parse_ios (char *agent, int tlen) { char *p = NULL, *q = NULL; ptrdiff_t offset; p = agent; if ((p = strstr (agent, " OS ")) == NULL) goto out; if ((offset = p - agent) <= 0) goto out; if ((q = strstr (p, " like Mac")) == NULL) goto out; *q = 0; memmove (agent + tlen, agent + offset, offset); return char_replace (agent, '_', '.'); out: agent[tlen] = 0; return agent; } /* Parse a Mac OS X string. * * On error, the given name is returned. * On success, the parsed Mac OS X is returned. */ static char * parse_osx (char *agent) { int space = 0; char *p; p = agent; /* assume the following chars are within the given agent */ while (*p != ';' && *p != ')' && *p != '(' && *p != '\0') { if (*p == '_') *p = '.'; if (*p == ' ') space++; if (space > 3) break; p++; } *p = 0; return agent; } /* Parse an Android string. * * On error, the given name is returned. * On success, the parsed Android is returned. */ static char * parse_android (char *agent) { char *p; p = agent; /* assume the following chars are within the given agent */ while (*p != ';' && *p != ')' && *p != '(' && *p != '\0') p++; *p = 0; return agent; } /* Attempt to parse specific OS. * * On success, a malloc'd string containing the OS is returned. */ static char * parse_os (const char *str, char *tkn, char *os_type, int idx) { char *b; int spaces = 0; xstrncpy (os_type, os[idx][1], OPESYS_TYPE_LEN); /* Windows */ if ((strstr (str, "Windows")) != NULL) return conf.real_os && (b = get_real_win (tkn)) ? b : xstrdup (os[idx][0]); /* Android */ if ((strstr (tkn, "Android")) != NULL) { tkn = parse_android (tkn); return conf.real_os ? get_real_android (tkn) : xstrdup (tkn); } /* iOS */ if (strstr (tkn, "iPad") || strstr (tkn, "iPod")) return xstrdup (parse_ios (tkn, 4)); if (strstr (tkn, "iPhone")) return xstrdup (parse_ios (tkn, 6)); /* Mac OS X */ if ((strstr (tkn, "OS X")) != NULL) { tkn = parse_osx (tkn); return conf.real_os ? get_real_mac_osx (tkn) : xstrdup (tkn); } /* Darwin - capture the first part of agents such as: * Slack/248000 CFNetwork/808.0.2 Darwin/16.0.0 */ if ((strstr (tkn, "Darwin")) != NULL) { if ((b = strchr (str, ' '))) *b = 0; return xstrdup (str); } /* all others */ spaces = count_matches (os[idx][0], ' '); return alloc_string (parse_others (tkn, spaces)); } /* Given a user agent, determine the operating system used. * * ###NOTE: The size of the list is proportional to the run time, * which makes this pretty slow * * On error, NULL is returned. * On success, a malloc'd string containing the OS is returned. */ char * verify_os (const char *str, char *os_type) { char *a; size_t i; if (str == NULL || *str == '\0') return NULL; for (i = 0; i < ARRAY_SIZE (os); i++) { if ((a = strstr (str, os[i][0])) != NULL) return parse_os (str, a, os_type, i); } xstrncpy (os_type, "Unknown", OPESYS_TYPE_LEN); return alloc_string ("Unknown"); } goaccess-1.3/src/json.c0000644000000000000000000007740313375657450011771 00000000000000/** * output.c -- output json to the standard output stream * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include #include #include #include #include #include #include #include #include #include "json.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "error.h" #include "settings.h" #include "ui.h" #include "util.h" #include "websocket.h" #include "xmalloc.h" typedef struct GPanel_ { GModule module; void (*render) (GJSON * json, GHolder * h, GPercTotals totals, const struct GPanel_ *); void (*subitems) (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp); } GPanel; /* number of new lines (applicable fields) */ static int nlines = 0; /* escape HTML in JSON data values */ static int escape_html_output = 0; static void print_json_data (GJSON * json, GHolder * h, GPercTotals totals, const struct GPanel_ *); static void print_json_host_items (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp); static void print_json_sub_items (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp); /* *INDENT-OFF* */ static GPanel paneling[] = { {VISITORS , print_json_data , NULL } , {REQUESTS , print_json_data , NULL } , {REQUESTS_STATIC , print_json_data , NULL } , {NOT_FOUND , print_json_data , NULL } , {HOSTS , print_json_data , print_json_host_items } , {OS , print_json_data , print_json_sub_items } , {BROWSERS , print_json_data , print_json_sub_items } , {VISIT_TIMES , print_json_data , NULL } , {VIRTUAL_HOSTS , print_json_data , NULL } , {REFERRERS , print_json_data , NULL } , {REFERRING_SITES , print_json_data , NULL } , {KEYPHRASES , print_json_data , NULL } , {STATUS_CODES , print_json_data , print_json_sub_items } , {REMOTE_USER , print_json_data , NULL } , #ifdef HAVE_GEOLOCATION {GEO_LOCATION , print_json_data , print_json_sub_items } , #endif }; /* *INDENT-ON* */ /* Get panel output data for the given module. * * If not found, NULL is returned. * On success, panel data is returned . */ static GPanel * panel_lookup (GModule module) { int i, num_panels = ARRAY_SIZE (paneling); for (i = 0; i < num_panels; i++) { if (paneling[i].module == module) return &paneling[i]; } return NULL; } /* Allocate memory for a new GJSON instance. * * On success, the newly allocated GJSON is returned . */ static GJSON * new_gjson (void) { GJSON *json = xcalloc (1, sizeof (GJSON)); return json; } /* Free malloc'd GJSON resources. */ static void free_json (GJSON * json) { if (!json) return; free (json->buf); free (json); } /* Set number of new lines when --json-pretty-print is used. */ void set_json_nlines (int newline) { nlines = newline; } /* Make sure that we have enough storage to write "len" bytes at the * current offset. */ static void set_json_buffer (GJSON * json, int len) { char *tmp = NULL; /* Maintain a null byte at the end of the buffer */ size_t need = json->offset + len + 1, newlen = 0; if (need <= json->size) return; if (json->size == 0) { newlen = INIT_BUF_SIZE; } else { newlen = json->size; newlen += newlen / 2; /* resize by 3/2 */ } if (newlen < need) newlen = need; tmp = realloc (json->buf, newlen); if (tmp == NULL) { free_json (json); FATAL (("Unable to realloc JSON buffer.\n")); } json->buf = tmp; json->size = newlen; } #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* A wrapper function to write a formatted string and expand the * buffer if necessary. * * On success, data is outputted. */ static void pjson (GJSON * json, const char *fmt, ...) { int len = 0; va_list args; va_start (args, fmt); if ((len = vsnprintf (NULL, 0, fmt, args)) < 0) FATAL (("Unable to write JSON formatted data.\n")); va_end (args); /* malloc/realloc buffer as needed */ set_json_buffer (json, len); va_start (args, fmt); /* restart args */ vsprintf (json->buf + json->offset, fmt, args); va_end (args); json->offset += len; } /* A wrapper function to output a formatted string to a file pointer. * * On success, data is outputted. */ void fpjson (FILE * fp, const char *fmt, ...) { va_list args; va_start (args, fmt); vfprintf (fp, fmt, args); va_end (args); } #pragma GCC diagnostic warning "-Wformat-nonliteral" /* Escape all other characters accordingly. */ static void escape_json_other (GJSON * json, char **s) { /* Since JSON data is bootstrapped into the HTML document of a report, * then we perform the following four translations in case weird stuff * is put into the document. * * Note: The following scenario assumes that the user manually makes * the HTML report a PHP file (GoAccess doesn't allow the creation of a * PHP file): * * /index.html */ if (escape_html_output) { switch (**s) { case '\'': pjson (json, "'"); return; case '&': pjson (json, "&"); return; case '<': pjson (json, "<"); return; case '>': pjson (json, ">"); return; } } if ((uint8_t) ** s <= 0x1f) { /* Control characters (U+0000 through U+001F) */ char buf[8]; snprintf (buf, sizeof buf, "\\u%04x", **s); pjson (json, "%s", buf); } else if ((uint8_t) ** s == 0xe2 && (uint8_t) * (*s + 1) == 0x80 && (uint8_t) * (*s + 2) == 0xa8) { /* Line separator (U+2028) - 0xE2 0x80 0xA8 */ pjson (json, "\\u2028"); *s += 2; } else if ((uint8_t) ** s == 0xe2 && (uint8_t) * (*s + 1) == 0x80 && (uint8_t) * (*s + 2) == 0xa9) { /* Paragraph separator (U+2019) - 0xE2 0x80 0xA9 */ pjson (json, "\\u2029"); *s += 2; } else { char buf[2]; snprintf (buf, sizeof buf, "%c", **s); pjson (json, "%s", buf); } } /* Escape and write to a valid JSON buffer. * * On success, escaped JSON data is outputted. */ static void escape_json_output (GJSON * json, char *s) { while (*s) { switch (*s) { /* These are required JSON special characters that need to be escaped. */ case '"': pjson (json, "\\\""); break; case '\\': pjson (json, "\\\\"); break; case '\b': pjson (json, "\\b"); break; case '\f': pjson (json, "\\f"); break; case '\n': pjson (json, "\\n"); break; case '\r': pjson (json, "\\r"); break; case '\t': pjson (json, "\\t"); break; case '/': pjson (json, "\\/"); break; default: escape_json_other (json, &s); break; } s++; } } /* Write to a buffer a JSON a key/value pair. */ static void pskeysval (GJSON * json, const char *key, const char *val, int sp, int last) { if (!last) pjson (json, "%.*s\"%s\": \"%s\",%.*s", sp, TAB, key, val, nlines, NL); else pjson (json, "%.*s\"%s\": \"%s\"", sp, TAB, key, val); } /* Output a JSON string key, array value pair. */ void fpskeyaval (FILE * fp, const char *key, const char *val, int sp, int last) { if (!last) fpjson (fp, "%.*s\"%s\": %s,%.*s", sp, TAB, key, val, nlines, NL); else fpjson (fp, "%.*s\"%s\": %s", sp, TAB, key, val); } /* Output a JSON a key/value pair. */ void fpskeysval (FILE * fp, const char *key, const char *val, int sp, int last) { if (!last) fpjson (fp, "%.*s\"%s\": \"%s\",%.*s", sp, TAB, key, val, nlines, NL); else fpjson (fp, "%.*s\"%s\": \"%s\"", sp, TAB, key, val); } /* Write to a buffer a JSON string key, int value pair. */ static void pskeyival (GJSON * json, const char *key, int val, int sp, int last) { if (!last) pjson (json, "%.*s\"%s\": %d,%.*s", sp, TAB, key, val, nlines, NL); else pjson (json, "%.*s\"%s\": %d", sp, TAB, key, val); } /* Output a JSON string key, int value pair. */ void fpskeyival (FILE * fp, const char *key, int val, int sp, int last) { if (!last) fpjson (fp, "%.*s\"%s\": %d,%.*s", sp, TAB, key, val, nlines, NL); else fpjson (fp, "%.*s\"%s\": %d", sp, TAB, key, val); } /* Write to a buffer a JSON string key, uint64_t value pair. */ static void pskeyu64val (GJSON * json, const char *key, uint64_t val, int sp, int last) { if (!last) pjson (json, "%.*s\"%s\": %" PRIu64 ",%.*s", sp, TAB, key, val, nlines, NL); else pjson (json, "%.*s\"%s\": %" PRIu64 "", sp, TAB, key, val); } /* Write to a buffer a JSON string key, int value pair. */ static void pskeyfval (GJSON * json, const char *key, float val, int sp, int last) { if (!last) pjson (json, "%.*s\"%s\": \"%4.2f\",%.*s", sp, TAB, key, val, nlines, NL); else pjson (json, "%.*s\"%s\": \"%4.2f\"", sp, TAB, key, val); } /* Write to a buffer the open block item object. */ static void popen_obj (GJSON * json, int iisp) { /* open data metric block */ pjson (json, "%.*s{%.*s", iisp, TAB, nlines, NL); } /* Output the open block item object. */ void fpopen_obj (FILE * fp, int iisp) { /* open data metric block */ fpjson (fp, "%.*s{%.*s", iisp, TAB, nlines, NL); } /* Write to a buffer a JSON open object attribute. */ static void popen_obj_attr (GJSON * json, const char *attr, int sp) { /* open object attribute */ pjson (json, "%.*s\"%s\": {%.*s", sp, TAB, attr, nlines, NL); } /* Output a JSON open object attribute. */ void fpopen_obj_attr (FILE * fp, const char *attr, int sp) { /* open object attribute */ fpjson (fp, "%.*s\"%s\": {%.*s", sp, TAB, attr, nlines, NL); } /* Close JSON object. */ static void pclose_obj (GJSON * json, int iisp, int last) { if (!last) pjson (json, "%.*s%.*s},%.*s", nlines, NL, iisp, TAB, nlines, NL); else pjson (json, "%.*s%.*s}", nlines, NL, iisp, TAB); } /* Close JSON object. */ void fpclose_obj (FILE * fp, int iisp, int last) { if (!last) fpjson (fp, "%.*s%.*s},%.*s", nlines, NL, iisp, TAB, nlines, NL); else fpjson (fp, "%.*s%.*s}", nlines, NL, iisp, TAB); } /* Write to a buffer a JSON open array attribute. */ static void popen_arr_attr (GJSON * json, const char *attr, int sp) { /* open object attribute */ pjson (json, "%.*s\"%s\": [%.*s", sp, TAB, attr, nlines, NL); } /* Output a JSON open array attribute. */ void fpopen_arr_attr (FILE * fp, const char *attr, int sp) { /* open object attribute */ fpjson (fp, "%.*s\"%s\": [%.*s", sp, TAB, attr, nlines, NL); } /* Close the data array. */ static void pclose_arr (GJSON * json, int sp, int last) { if (!last) pjson (json, "%.*s%.*s],%.*s", nlines, NL, sp, TAB, nlines, NL); else pjson (json, "%.*s%.*s]", nlines, NL, sp, TAB); } /* Close the data array. */ void fpclose_arr (FILE * fp, int sp, int last) { if (!last) fpjson (fp, "%.*s%.*s],%.*s", nlines, NL, sp, TAB, nlines, NL); else fpjson (fp, "%.*s%.*s]", nlines, NL, sp, TAB); } /* Write to a buffer the date and time for the overall object. */ static void poverall_datetime (GJSON * json, int sp) { char now[DATE_TIME]; generate_time (); strftime (now, DATE_TIME, "%Y-%m-%d %H:%M:%S %z", now_tm); pskeysval (json, OVERALL_DATETIME, now, sp, 0); } /* Write to a buffer the date and time for the overall object. */ static void poverall_start_end_date (GJSON * json, GHolder * h, int sp) { char *start = NULL, *end = NULL; if (h->idx == 0 || get_start_end_parsing_dates (h, &start, &end, "%d/%b/%Y")) return; pskeysval (json, OVERALL_STARTDATE, start, sp, 0); pskeysval (json, OVERALL_ENDDATE, end, sp, 0); free (end); free (start); } /* Write to a buffer date and time for the overall object. */ static void poverall_requests (GJSON * json, GLog * glog, int sp) { pskeyival (json, OVERALL_REQ, glog->processed, sp, 0); } /* Write to a buffer the number of valid requests under the overall * object. */ static void poverall_valid_reqs (GJSON * json, GLog * glog, int sp) { pskeyival (json, OVERALL_VALID, glog->valid, sp, 0); } /* Write to a buffer the number of invalid requests under the overall * object. */ static void poverall_invalid_reqs (GJSON * json, GLog * glog, int sp) { pskeyival (json, OVERALL_FAILED, glog->invalid, sp, 0); } /* Write to a buffer the total processed time under the overall * object. */ static void poverall_processed_time (GJSON * json, int sp) { uint64_t elapsed_proc = end_proc - start_proc; #ifdef TCB_BTREE if (conf.store_accumulated_time) elapsed_proc = (uint64_t) ht_get_genstats ("accumulated_time"); #endif pskeyu64val (json, OVERALL_GENTIME, elapsed_proc, sp, 0); } /* Write to a buffer the total number of unique visitors under the * overall object. */ static void poverall_visitors (GJSON * json, int sp) { pskeyival (json, OVERALL_VISITORS, ht_get_size_uniqmap (VISITORS), sp, 0); } /* Write to a buffer the total number of unique files under the * overall object. */ static void poverall_files (GJSON * json, int sp) { pskeyival (json, OVERALL_FILES, ht_get_size_datamap (REQUESTS), sp, 0); } /* Write to a buffer the total number of excluded requests under the * overall object. */ static void poverall_excluded (GJSON * json, GLog * glog, int sp) { pskeyival (json, OVERALL_EXCL_HITS, glog->excluded_ip, sp, 0); } /* Write to a buffer the number of referrers under the overall object. */ static void poverall_refs (GJSON * json, int sp) { pskeyival (json, OVERALL_REF, ht_get_size_datamap (REFERRERS), sp, 0); } /* Write to a buffer the number of not found (404s) under the overall * object. */ static void poverall_notfound (GJSON * json, int sp) { pskeyival (json, OVERALL_NOTFOUND, ht_get_size_datamap (NOT_FOUND), sp, 0); } /* Write to a buffer the number of static files (jpg, pdf, etc) under * the overall object. */ static void poverall_static_files (GJSON * json, int sp) { pskeyival (json, OVERALL_STATIC, ht_get_size_datamap (REQUESTS_STATIC), sp, 0); } /* Write to a buffer the size of the log being parsed under the * overall object. */ static void poverall_log_size (GJSON * json, int sp) { pjson (json, "%.*s\"%s\": %jd,%.*s", sp, TAB, OVERALL_LOGSIZE, (intmax_t) get_log_sizes (), nlines, NL); } /* Write to a buffer the total bandwidth consumed under the overall * object. */ static void poverall_bandwidth (GJSON * json, GLog * glog, int sp) { pskeyu64val (json, OVERALL_BANDWIDTH, glog->resp_size, sp, 0); } static void poverall_log_path (GJSON * json, int idx, int isp) { pjson (json, "%.*s\"", isp, TAB); if (conf.filenames[idx][0] == '-' && conf.filenames[idx][1] == '\0') pjson (json, "STDIN"); else escape_json_output (json, (char *) conf.filenames[idx]); pjson (json, conf.filenames_idx - 1 != idx ? "\",\n" : "\""); } /* Write to a buffer the path of the log being parsed under the * overall object. */ static void poverall_log (GJSON * json, int sp) { int idx, isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_arr_attr (json, OVERALL_LOG, sp); for (idx = 0; idx < conf.filenames_idx; ++idx) poverall_log_path (json, idx, isp); pclose_arr (json, sp, 1); } /* Write to a buffer hits data. */ static void phits (GJSON * json, GMetrics * nmetrics, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "hits", sp); /* print hits */ pskeyival (json, "count", nmetrics->hits, isp, 0); /* print hits percent */ pskeyfval (json, "percent", nmetrics->hits_perc, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer visitors data. */ static void pvisitors (GJSON * json, GMetrics * nmetrics, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "visitors", sp); /* print visitors */ pskeyival (json, "count", nmetrics->visitors, isp, 0); /* print visitors percent */ pskeyfval (json, "percent", nmetrics->visitors_perc, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer bandwidth data. */ static void pbw (GJSON * json, GMetrics * nmetrics, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; if (!conf.bandwidth) return; popen_obj_attr (json, "bytes", sp); /* print bandwidth */ pskeyu64val (json, "count", nmetrics->bw.nbw, isp, 0); /* print bandwidth percent */ pskeyfval (json, "percent", nmetrics->bw_perc, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer average time served data. */ static void pavgts (GJSON * json, GMetrics * nmetrics, int sp) { if (!conf.serve_usecs) return; pskeyu64val (json, "avgts", nmetrics->avgts.nts, sp, 0); } /* Write to a buffer cumulative time served data. */ static void pcumts (GJSON * json, GMetrics * nmetrics, int sp) { if (!conf.serve_usecs) return; pskeyu64val (json, "cumts", nmetrics->cumts.nts, sp, 0); } /* Write to a buffer maximum time served data. */ static void pmaxts (GJSON * json, GMetrics * nmetrics, int sp) { if (!conf.serve_usecs) return; pskeyu64val (json, "maxts", nmetrics->maxts.nts, sp, 0); } /* Write to a buffer request method data. */ static void pmethod (GJSON * json, GMetrics * nmetrics, int sp) { /* request method */ if (conf.append_method && nmetrics->method) { pskeysval (json, "method", nmetrics->method, sp, 0); } } /* Write to a buffer protocol method data. */ static void pprotocol (GJSON * json, GMetrics * nmetrics, int sp) { /* request protocol */ if (conf.append_protocol && nmetrics->protocol) { pskeysval (json, "protocol", nmetrics->protocol, sp, 0); } } /* Write to a buffer the hits meta data object. */ static void pmeta_data_unique (GJSON * json, int ht_size, int sp) { int isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "data", sp); pskeyu64val (json, "unique", ht_size, isp, 1); pclose_obj (json, sp, 1); } /* Write to a buffer the hits meta data object. */ static void pmeta_data_hits (GJSON * json, GModule module, int sp) { int isp = 0; int max = 0, min = 0; ht_get_hits_min_max (module, &min, &max); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "hits", sp); pskeyu64val (json, "count", ht_get_meta_data (module, "hits"), isp, 0); pskeyival (json, "max", max, isp, 0); pskeyival (json, "min", min, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer the visitors meta data object. */ static void pmeta_data_visitors (GJSON * json, GModule module, int sp) { int isp = 0; int max = 0, min = 0; ht_get_visitors_min_max (module, &min, &max); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "visitors", sp); pskeyu64val (json, "count", ht_get_meta_data (module, "visitors"), isp, 0); pskeyival (json, "max", max, isp, 0); pskeyival (json, "min", min, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer the bytes meta data object. */ static void pmeta_data_bw (GJSON * json, GModule module, int sp) { int isp = 0; uint64_t max = 0, min = 0; if (!conf.bandwidth) return; ht_get_bw_min_max (module, &min, &max); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "bytes", sp); pskeyu64val (json, "count", ht_get_meta_data (module, "bytes"), isp, 0); pskeyu64val (json, "max", max, isp, 0); pskeyu64val (json, "min", min, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer the average of the average time served meta data * object. */ static void pmeta_data_avgts (GJSON * json, GModule module, int sp) { int isp = 0; uint64_t avg = 0, hits = 0, cumts = 0; if (!conf.serve_usecs) return; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; cumts = ht_get_meta_data (module, "cumts"); hits = ht_get_meta_data (module, "hits"); if (hits > 0) avg = cumts / hits; popen_obj_attr (json, "avgts", sp); pskeyu64val (json, "avg", avg, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer the cumulative time served meta data object. */ static void pmeta_data_cumts (GJSON * json, GModule module, int sp) { int isp = 0; uint64_t max = 0, min = 0; if (!conf.serve_usecs) return; ht_get_cumts_min_max (module, &min, &max); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "cumts", sp); pskeyu64val (json, "count", ht_get_meta_data (module, "cumts"), isp, 0); pskeyu64val (json, "max", max, isp, 0); pskeyu64val (json, "min", min, isp, 1); pclose_obj (json, sp, 0); } /* Write to a buffer the maximum time served meta data object. */ static void pmeta_data_maxts (GJSON * json, GModule module, int sp) { int isp = 0; uint64_t max = 0, min = 0; if (!conf.serve_usecs) return; ht_get_maxts_min_max (module, &min, &max); /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1; popen_obj_attr (json, "maxts", sp); pskeyu64val (json, "count", ht_get_meta_data (module, "maxts"), isp, 0); pskeyu64val (json, "max", max, isp, 0); pskeyu64val (json, "min", min, isp, 1); pclose_obj (json, sp, 0); } /* Entry point to output panel's metadata. */ static void print_meta_data (GJSON * json, GHolder * h, int sp) { int isp = 0, iisp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1, iisp = sp + 2; popen_obj_attr (json, "metadata", isp); pmeta_data_avgts (json, h->module, iisp); pmeta_data_cumts (json, h->module, iisp); pmeta_data_maxts (json, h->module, iisp); pmeta_data_bw (json, h->module, iisp); pmeta_data_visitors (json, h->module, iisp); pmeta_data_hits (json, h->module, iisp); pmeta_data_unique (json, h->ht_size, iisp); pclose_obj (json, isp, 0); } /* A wrapper function to ouput data metrics per panel. */ static void print_json_block (GJSON * json, GMetrics * nmetrics, int sp) { /* print hits */ phits (json, nmetrics, sp); /* print visitors */ pvisitors (json, nmetrics, sp); /* print bandwidth */ pbw (json, nmetrics, sp); /* print time served metrics */ pavgts (json, nmetrics, sp); pcumts (json, nmetrics, sp); pmaxts (json, nmetrics, sp); /* print protocol/method */ pmethod (json, nmetrics, sp); pprotocol (json, nmetrics, sp); /* data metric */ pjson (json, "%.*s\"data\": \"", sp, TAB); escape_json_output (json, nmetrics->data); pjson (json, "\""); } /* Add the given user agent value into our array of GAgents. * * On error, 1 is returned. * On success, the user agent is added to the array and 0 is returned. */ static int fill_host_agents (void *val, void *user_data) { GAgents *agents = user_data; char *agent = ht_get_host_agent_val ((*(int *) val)); if (agent == NULL) return 1; agents->items[agents->size].agent = agent; agents->size++; return 0; } /* Iterate over the list of agents */ static void load_host_agents (void *list, void *user_data, GO_UNUSED int count) { GSLList *lst = list; GAgents *agents = user_data; agents->items = new_gagent_item (count); list_foreach (lst, fill_host_agents, agents); } /* A wrapper function to ouput an array of user agents for each host. */ static void process_host_agents (GJSON * json, GHolderItem * item, int iisp) { GAgents *agents = new_gagents (); int i, n = 0, iiisp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) iiisp = iisp + 1; if (set_host_agents (item->metrics->data, load_host_agents, agents) == 1) return; pjson (json, ",%.*s%.*s\"items\": [%.*s", nlines, NL, iisp, TAB, nlines, NL); n = agents->size > 10 ? 10 : agents->size; for (i = 0; i < n; ++i) { pjson (json, "%.*s\"", iiisp, TAB); escape_json_output (json, agents->items[i].agent); if (i == n - 1) pjson (json, "\""); else pjson (json, "\",%.*s", nlines, NL); } pclose_arr (json, iisp, 1); /* clean stuff up */ free_agents_array (agents); } /* A wrapper function to ouput children nodes. */ static void print_json_sub_items (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp) { GMetrics *nmetrics; GSubItem *iter; GSubList *sl = item->sub_list; int i = 0, iiisp = 0, iiiisp = 0; /* no sub items, nothing to output */ if (size == 0) return; /* use tabs to prettify output */ if (conf.json_pretty_print) iiisp = iisp + 1, iiiisp = iiisp + 1; if (sl == NULL) return; pjson (json, ",%.*s%.*s\"items\": [%.*s", nlines, NL, iisp, TAB, nlines, NL); for (iter = sl->head; iter; iter = iter->next, i++) { set_data_metrics (iter->metrics, &nmetrics, totals); popen_obj (json, iiisp); print_json_block (json, nmetrics, iiiisp); pclose_obj (json, iiisp, (i == sl->size - 1)); free (nmetrics); } pclose_arr (json, iisp, 1); } /* A wrapper function to ouput geolocation fields for the given host. */ static void print_json_host_geo (GJSON * json, GSubList * sl, int iisp) { GSubItem *iter; int i; static const char *key[] = { "country", "city", "hostname", }; pjson (json, ",%.*s", nlines, NL); /* Iterate over child properties (country, city, etc) and print them out */ for (i = 0, iter = sl->head; iter; iter = iter->next, i++) { pjson (json, "%.*s\"%s\": \"", iisp, TAB, key[iter->metrics->id]); escape_json_output (json, iter->metrics->data); pjson (json, (i != sl->size - 1) ? "\",%.*s" : "\"", nlines, NL); } } /* Ouput Geolocation data and the IP's hostname. */ static void print_json_host_items (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp) { (void) totals; /* print geolocation fields */ if (size > 0 && item->sub_list != NULL) print_json_host_geo (json, item->sub_list, iisp); /* print list of user agents */ if (conf.list_agents) process_host_agents (json, item, iisp); } /* Ouput data and determine if there are children nodes. */ static void print_data_metrics (GJSON * json, GHolder * h, GPercTotals totals, int sp, const struct GPanel_ *panel) { GMetrics *nmetrics; int i, isp = 0, iisp = 0, iiisp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) isp = sp + 1, iisp = sp + 2, iiisp = sp + 3; popen_arr_attr (json, "data", isp); /* output data metrics */ for (i = 0; i < h->idx; i++) { set_data_metrics (h->items[i].metrics, &nmetrics, totals); /* open data metric block */ popen_obj (json, iisp); /* output data metric block */ print_json_block (json, nmetrics, iiisp); /* if there are children nodes, spit them out */ if (panel->subitems) panel->subitems (json, h->items + i, totals, h->sub_items_size, iiisp); /* close data metric block */ pclose_obj (json, iisp, (i == h->idx - 1)); free (nmetrics); } pclose_arr (json, isp, 1); } /* Entry point to ouput data metrics per panel. */ static void print_json_data (GJSON * json, GHolder * h, GPercTotals totals, const struct GPanel_ *panel) { int sp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) sp = 1; /* output open panel attribute */ popen_obj_attr (json, module_to_id (h->module), sp); /* output panel metadata */ print_meta_data (json, h, sp); /* output panel data */ print_data_metrics (json, h, totals, sp, panel); /* output close panel attribute */ pclose_obj (json, sp, 1); } /* Get the number of available panels. * * On success, the total number of available panels is returned . */ static int num_panels (void) { size_t idx = 0, npanels = 0; FOREACH_MODULE (idx, module_list) npanels++; return npanels; } /* Write to a buffer overall data. */ static void print_json_summary (GJSON * json, GLog * glog, GHolder * holder) { int sp = 0, isp = 0; /* use tabs to prettify output */ if (conf.json_pretty_print) sp = 1, isp = 2; popen_obj_attr (json, GENER_ID, sp); /* generated start/end date */ poverall_start_end_date (json, holder, isp); /* generated date time */ poverall_datetime (json, isp); /* total requests */ poverall_requests (json, glog, isp); /* valid requests */ poverall_valid_reqs (json, glog, isp); /* invalid requests */ poverall_invalid_reqs (json, glog, isp); /* generated time */ poverall_processed_time (json, isp); /* visitors */ poverall_visitors (json, isp); /* files */ poverall_files (json, isp); /* excluded hits */ poverall_excluded (json, glog, isp); /* referrers */ poverall_refs (json, isp); /* not found */ poverall_notfound (json, isp); /* static files */ poverall_static_files (json, isp); /* log size */ poverall_log_size (json, isp); /* bandwidth */ poverall_bandwidth (json, glog, isp); /* log path */ poverall_log (json, isp); pclose_obj (json, sp, num_panels () > 0 ? 0 : 1); } /* Iterate over all panels and generate json output. */ static GJSON * init_json_output (GLog * glog, GHolder * holder) { GJSON *json = NULL; GModule module; GPercTotals totals; const GPanel *panel = NULL; size_t idx = 0, npanels = num_panels (), cnt = 0; json = new_gjson (); popen_obj (json, 0); print_json_summary (json, glog, holder); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; if (!(panel = panel_lookup (module))) continue; set_module_totals (module, &totals); panel->render (json, holder + module, totals, panel); pjson (json, (cnt++ != npanels - 1) ? ",%.*s" : "%.*s", nlines, NL); } pclose_obj (json, 0, 1); return json; } /* Open and write to a dynamically sized output buffer. * * On success, the newly allocated buffer is returned . */ char * get_json (GLog * glog, GHolder * holder, int escape_html) { GJSON *json = NULL; char *buf = NULL; if (holder == NULL) return NULL; escape_html_output = escape_html; if ((json = init_json_output (glog, holder)) && json->size > 0) { buf = xstrdup (json->buf); free_json (json); } return buf; } /* Entry point to generate a json report writing it to the fp */ void output_json (GLog * glog, GHolder * holder, const char *filename) { GJSON *json = NULL; FILE *fp; if (filename != NULL) fp = fopen (filename, "w"); else fp = stdout; if (!fp) FATAL ("Unable to open JSON file: %s.", strerror (errno)); /* use new lines to prettify output */ if (conf.json_pretty_print) nlines = 1; /* spit it out */ if ((json = init_json_output (glog, holder)) && json->size > 0) { fprintf (fp, "%s", json->buf); free_json (json); } fclose (fp); } goaccess-1.3/src/gholder.h0000644000000000000000000000366413375657450012447 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef GHOLDER_H_INCLUDED #define GHOLDER_H_INCLUDED #define MTRC_ID_COUNTRY 0 #define MTRC_ID_CITY 1 #define MTRC_ID_HOSTNAME 2 #include "commons.h" #include "sort.h" /* Function Prototypes */ GHolder *new_gholder (uint32_t size); void *add_hostname_node (void *ptr_holder); void free_holder_by_module (GHolder ** holder, GModule module); void free_holder (GHolder ** holder); void load_holder_data (GRawData * raw_data, GHolder * h, GModule module, GSort sort); void load_host_to_holder (GHolder * h, char *ip); #endif // for #ifndef GHOLDER_H goaccess-1.3/src/parser.h0000644000000000000000000001166113375657450012313 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef PARSER_H_INCLUDED #define PARSER_H_INCLUDED #define KEY_FOUND 1 #define KEY_NOT_FOUND -1 #define LINE_BUFFER 4096 /* read at most this num of chars */ #define NUM_TESTS 20 /* test this many lines from the log */ #define MAX_LOG_ERRORS 20 #define LINE_LEN 23 #define ERROR_LEN 255 #define REF_SITE_LEN 511 /* maximum length of a referring site */ #define SPEC_TOKN_SET 0x1 #define SPEC_TOKN_NUL 0x2 #define SPEC_TOKN_INV 0x3 #define SPEC_SFMT_MIS 0x4 #include "commons.h" /* Log properties. Note: This is per line parsed */ typedef struct GLogItem_ { char *agent; char *browser; char *browser_type; char *continent; char *country; char *date; char *host; char *keyphrase; char *method; char *os; char *os_type; char *protocol; char *qstr; char *ref; char *req; char *req_key; char *status; char *time; char *uniq_key; char *vhost; char *userid; char site[REF_SITE_LEN + 1]; uint64_t resp_size; uint64_t serve_time; int type_ip; int is_404; int is_static; int uniq_nkey; int agent_nkey; char *errstr; } GLogItem; /* Overall parsed log properties */ typedef struct GLog_ { unsigned int excluded_ip; unsigned int invalid; unsigned int offset; unsigned int processed; unsigned int valid; unsigned long long resp_size; unsigned short load_from_disk_only; unsigned short piping; GLogItem *items; unsigned short log_erridx; char **errors; FILE *pipe; } GLog; /* Raw data field type */ typedef enum { INTEGER, STRING } GRawDataType; /* Raw Data extracted from table stores */ typedef struct GRawDataItem_ { int key; union { char *svalue; int ivalue; } value; } GRawDataItem; /* Raw Data per module */ typedef struct GRawData_ { GRawDataItem *items; /* data */ GModule module; /* current module */ GRawDataType type; /* raw data items type */ int idx; /* first level index */ int size; /* total num of items on ht */ } GRawData; /* Each record contains a data value, i.e., Windows XP, and it may contain a * root value, i.e., Windows, and a unique key which is the combination of * date, IP and user agent */ typedef struct GKeyData_ { void *data; void *data_key; int data_nkey; void *root; void *root_key; int root_nkey; void *uniq_key; int uniq_nkey; } GKeyData; typedef struct GParse_ { GModule module; int (*key_data) (GKeyData * kdata, GLogItem * logitem); /* data field */ void (*datamap) (int data_nkey, const char *data, GModule module); void (*rootmap) (int root_nkey, const char *root, GModule module); /* metrics */ void (*hits) (int data_nkey, GModule module); void (*visitor) (int uniq_nkey, GModule module); void (*bw) (int data_nkey, uint64_t size, GModule module); void (*cumts) (int data_nkey, uint64_t ts, GModule module); void (*maxts) (int data_nkey, uint64_t ts, GModule module); void (*method) (int data_nkey, const char *method, GModule module); void (*protocol) (int data_nkey, const char *proto, GModule module); void (*agent) (int data_nkey, int agent_nkey, GModule module); } GParse; char *fgetline (FILE * fp); char **test_format (GLog * glog, int *len); GLog *init_log (void); GLogItem *init_log_item (GLog * glog); GRawDataItem *new_grawdata_item (unsigned int size); GRawData *new_grawdata (void); int parse_log (GLog ** glog, char *tail, int dry_run); void free_logerrors (GLog * glog); void free_raw_data (GRawData * raw_data); void output_logerrors (GLog * glog); void reset_struct (GLog * glog); #endif goaccess-1.3/src/tcbtdb.h0000644000000000000000000000555313375657450012264 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef TCBTDB_H_INCLUDED #define TCBTDB_H_INCLUDED #include #include "commons.h" #include "gstorage.h" #include "parser.h" #define TC_MMAP 0 #define TC_LCNUM 1024 #define TC_NCNUM 512 #define TC_LMEMB 128 #define TC_NMEMB 256 #define TC_BNUM 32749 #define TC_DBPATH "/tmp/goaccess" #define TC_DBPMODE 0755 #define TC_ZLIB 1 #define TC_BZ2 2 #define RAND_FN 7 + 1 /* B+ Tree - on-disk databases */ #define DB_AGENT_KEYS "db_agent_keys.tcb" #define DB_AGENT_VALS "db_agent_vals.tcb" #define DB_GEN_STATS "db_gen_stats.tcb" #define DB_HOSTNAMES "db_hostnames.tcb" #define DB_UNIQUE_KEYS "db_unique_keys.tcb" #define DB_KEYMAP "db_keymap.tcb" #define DB_DATAMAP "db_datamap.tcb" #define DB_ROOTMAP "db_rootmap.tcb" #define DB_UNIQMAP "db_uniqmap.tcb" #define DB_VISITORS "db_visitors.tcb" #define DB_ROOT "db_root.tcb" #define DB_HITS "db_hits.tcb" #define DB_BW "db_bw.tcb" #define DB_CUMTS "db_cumts.tcb" #define DB_MAXTS "db_maxts.tcb" #define DB_METHODS "db_methods.tcb" #define DB_PROTOCOLS "db_protocols.tcb" #define DB_AGENTS "db_agents.tcb" #define DB_METADATA "db_metadata.tcb" /* *INDENT-OFF* */ TCBDB *tc_bdb_create (char *dbpath); char *tc_db_set_path (const char *dbname, int module); void tc_db_rmdir(void); int tc_bdb_close (void *db, char *dbname); void tc_db_get_params (char *params, const char *path); #ifdef TCB_BTREE int ins_igsl (void *hash, int key, int value); #endif /* *INDENT-ON* */ #endif goaccess-1.3/src/color.h0000644000000000000000000000642413375657450012136 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef COLOR_H_INCLUDED #define COLOR_H_INCLUDED #define COLOR_STR_LEN 9 /* Color Items/Fields */ typedef enum CSTM_COLORS { COLOR_NORMAL, COLOR_MTRC_HITS, COLOR_MTRC_VISITORS, COLOR_MTRC_DATA, COLOR_MTRC_BW, COLOR_MTRC_AVGTS, COLOR_MTRC_CUMTS, COLOR_MTRC_MAXTS, COLOR_MTRC_PROT, COLOR_MTRC_MTHD, COLOR_MTRC_HITS_PERC, COLOR_MTRC_HITS_PERC_MAX, COLOR_MTRC_VISITORS_PERC, COLOR_MTRC_VISITORS_PERC_MAX, COLOR_PANEL_COLS, COLOR_BARS, COLOR_ERROR, COLOR_SELECTED, COLOR_PANEL_ACTIVE, COLOR_PANEL_HEADER, COLOR_PANEL_DESC, COLOR_OVERALL_LBLS, COLOR_OVERALL_VALS, COLOR_OVERALL_PATH, COLOR_ACTIVE_LABEL, COLOR_BG, COLOR_DEFAULT, COLOR_PROGRESS, } GColorItem; /* Default Color Schemes */ typedef enum SCHEMES { NO_COLOR, MONOCHROME, STD_GREEN, MONOKAI, } GShemes; #include "commons.h" /* Each color properties */ typedef struct GColorPair_ { short idx; /* color pair index identifier */ short fg; /* foreground color */ short bg; /* background color */ } GColorPair; /* Color */ typedef struct GColors_ { GColorItem item; /* screen item */ GColorPair *pair; /* color pair */ int attr; /* color attributes, e.g., bold */ short module; /* panel */ } GColors; GColors *color_default (void); GColors *color_error (void); GColors *color_overall_lbls (void); GColors *color_overall_path (void); GColors *color_overall_vals (void); GColors *color_panel_active (void); GColors *color_panel_desc (void); GColors *color_panel_header (void); GColors *color_progress (void); GColors *color_selected (void); GColors *get_color_by_item_module (GColorItem item, GModule module); GColors *get_color (GColorItem item); GColors *get_color_normal (void); void free_color_lists (void); void set_colors (int force); void set_normal_color (void); #endif // for #ifndef COLOR_H goaccess-1.3/src/gdashboard.c0000644000000000000000000012064213375657450013110 00000000000000/** * gdashboard.c -- goaccess main dashboard * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #define _XOPEN_SOURCE 700 #include #include #include #include #include #include #include #include "gdashboard.h" #ifdef HAVE_LIBTOKYOCABINET #include "tcabdb.h" #else #include "gkhash.h" #endif #include "color.h" #include "error.h" #include "gstorage.h" #include "util.h" #include "xmalloc.h" static GFind find_t; /* Reset find indices */ void reset_find (void) { if (find_t.pattern != NULL && *find_t.pattern != '\0') free (find_t.pattern); find_t.look_in_sub = 0; find_t.module = 0; find_t.next_idx = 0; /* next total index */ find_t.next_parent_idx = 0; /* next parent index */ find_t.next_sub_idx = 0; /* next sub item index */ find_t.pattern = NULL; } /* Allocate memory for a new GDash instance. * * On success, the newly allocated GDash is returned . */ GDash * new_gdash (void) { GDash *dash = xmalloc (sizeof (GDash)); memset (dash, 0, sizeof *dash); dash->total_alloc = 0; return dash; } /* Allocate memory for a new GDashData instance. * * On success, the newly allocated GDashData is returned . */ GDashData * new_gdata (uint32_t size) { GDashData *data = xcalloc (size, sizeof (GDashData)); return data; } /* Free memory allocated for a GDashData instance. Includes malloc'd * strings. */ static void free_dashboard_data (GDashData item) { if (item.metrics == NULL) return; if (item.metrics->data) free (item.metrics->data); if (item.metrics->bw.sbw) free (item.metrics->bw.sbw); if (conf.serve_usecs && item.metrics->avgts.sts) free (item.metrics->avgts.sts); if (conf.serve_usecs && item.metrics->cumts.sts) free (item.metrics->cumts.sts); if (conf.serve_usecs && item.metrics->maxts.sts) free (item.metrics->maxts.sts); free (item.metrics); } /* Free memory allocated for a GDash instance, and nested structure * data. */ void free_dashboard (GDash * dash) { GModule module; int j; size_t idx = 0; FOREACH_MODULE (idx, module_list) { module = module_list[idx]; for (j = 0; j < dash->module[module].alloc_data; j++) { free_dashboard_data (dash->module[module].data[j]); } free (dash->module[module].data); } free (dash); } /* Get the current panel/module given the `Y` offset (position) in the * terminal dashboard. * * If not found, 0 is returned. * If found, the module number is returned . */ static GModule get_find_current_module (GDash * dash, int offset) { GModule module; size_t idx = 0; FOREACH_MODULE (idx, module_list) { module = module_list[idx]; /* set current module */ if (dash->module[module].pos_y == offset) return module; /* we went over by one module, set current - 1 */ if (dash->module[module].pos_y > offset) return module - 1; } return 0; } /* Get the number of rows that a collapsed dashboard panel contains. * * On success, the number of rows is returned. */ int get_num_collapsed_data_rows (void) { /* The default number of rows is fixed */ int size = DASH_COLLAPSED - DASH_NON_DATA; /* If no column names, then add the number of rows occupied by the * column values to the default number */ return conf.no_column_names ? size + DASH_COL_ROWS : size; } /* Get the number of rows that an expanded dashboard panel contains. * * On success, the number of rows is returned. */ int get_num_expanded_data_rows (void) { /* The default number of rows is fixed */ int size = DASH_EXPANDED - DASH_NON_DATA; /* If no column names, then add the number of rows occupied by the * column values to the default number */ return conf.no_column_names ? size + DASH_COL_ROWS : size; } /* Get the Y position of the terminal dashboard where data rows * (metrics) start. * * On success, the Y position is returned. */ static int get_data_pos_rows (void) { return conf.no_column_names ? DASH_DATA_POS - DASH_COL_ROWS : DASH_DATA_POS; } /* Get the initial X position of the terminal dashboard where metrics * and data columns start. * * On success, the X position is returned. */ static int get_xpos (void) { return DASH_INIT_X; } /* Determine which module should be expanded given the current mouse * position. * * On error, 1 is returned. * On success, 0 is returned. */ int set_module_from_mouse_event (GScroll * gscroll, GDash * dash, int y) { int module = 0; int offset = y - MAX_HEIGHT_HEADER - MAX_HEIGHT_FOOTER + 1; if (gscroll->expanded) { module = get_find_current_module (dash, offset); } else { offset += gscroll->dash; module = offset / DASH_COLLAPSED; } if (module >= TOTAL_MODULES) module = TOTAL_MODULES - 1; else if (module < 0) module = 0; if ((int) gscroll->current == module) return 1; gscroll->current = module; return 0; } /* Allocate a new string for a sub item on the terminal dashboard. * * On error, NULL is returned. * On success, the newly allocated string is returned. */ static char * render_child_node (const char *data) { char *buf; int len = 0; /* chars to use based on encoding used */ #ifdef HAVE_LIBNCURSESW const char *bend = "\xe2\x94\x9c"; const char *horz = "\xe2\x94\x80"; #else const char *bend = "|"; const char *horz = "`-"; #endif if (data == NULL || *data == '\0') return NULL; len = snprintf (NULL, 0, " %s%s %s", bend, horz, data); buf = xmalloc (len + 3); sprintf (buf, " %s%s %s", bend, horz, data); return buf; } /* Get a string of bars given current hits, maximum hit & xpos. * * On success, the newly allocated string representing the chart is * returned. */ static char * get_bars (int n, int max, int x) { int w, h; float len = 0.0; getmaxyx (stdscr, h, w); (void) h; /* avoid lint warning */ len = ((((float) n) / max)); len *= (w - x); if (len < 1) len = 1; return char_repeat (len, '|'); } /* Set largest hits metric (length of the integer). */ static void set_max_hit_len (GDashMeta * meta, GDashData * idata) { int vlen = intlen (idata->metrics->hits); int llen = strlen (MTRC_HITS_LBL); if (vlen > meta->hits_len) meta->hits_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->hits_len) meta->hits_len = llen; } /* Get the percent integer length. */ static void set_max_hit_perc_len (GDashMeta * meta, GDashData * idata) { int vlen = intlen (idata->metrics->hits_perc); int llen = strlen (MTRC_HITS_PERC_LBL); if (vlen > meta->hits_perc_len) meta->hits_perc_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->hits_perc_len) meta->hits_perc_len = llen; } /* Set largest hits metric (length of the integer). */ static void set_max_visitors_len (GDashMeta * meta, GDashData * idata) { int vlen = intlen (idata->metrics->visitors); int llen = strlen (MTRC_VISITORS_SHORT_LBL); if (vlen > meta->visitors_len) meta->visitors_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->visitors_len) meta->visitors_len = llen; } /* Get the percent integer length. */ static void set_max_visitors_perc_len (GDashMeta * meta, GDashData * idata) { int vlen = intlen (idata->metrics->visitors_perc); int llen = strlen (MTRC_VISITORS_PERC_LBL); if (vlen > meta->visitors_perc_len) meta->visitors_perc_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->visitors_perc_len) meta->visitors_perc_len = llen; } /* Get the percent integer length. */ static void set_max_bw_len (GDashMeta * meta, GDashData * idata) { int vlen = strlen (idata->metrics->bw.sbw); int llen = strlen (MTRC_BW_LBL); if (vlen > meta->bw_len) meta->bw_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->bw_len) meta->bw_len = llen; } /* Get the percent integer length. */ static void set_max_avgts_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; if (!conf.serve_usecs || !idata->metrics->avgts.sts) return; vlen = strlen (idata->metrics->avgts.sts); llen = strlen (MTRC_AVGTS_LBL); if (vlen > meta->avgts_len) meta->avgts_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->avgts_len) meta->avgts_len = llen; } /* Get the percent integer length. */ static void set_max_cumts_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; if (!conf.serve_usecs || !idata->metrics->cumts.sts) return; vlen = strlen (idata->metrics->cumts.sts); llen = strlen (MTRC_AVGTS_LBL); if (vlen > meta->cumts_len) meta->cumts_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->cumts_len) meta->cumts_len = llen; } /* Get the percent integer length. */ static void set_max_maxts_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; if (!conf.serve_usecs || !idata->metrics->maxts.sts) return; vlen = strlen (idata->metrics->maxts.sts); llen = strlen (MTRC_AVGTS_LBL); if (vlen > meta->maxts_len) meta->maxts_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->maxts_len) meta->maxts_len = llen; } /* Get the percent integer length. */ static void set_max_method_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; if (!conf.append_method || !idata->metrics->method) return; vlen = strlen (idata->metrics->method); llen = strlen (MTRC_METHODS_SHORT_LBL); if (vlen > meta->method_len) meta->method_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->method_len) meta->method_len = llen; } /* Get the percent integer length. */ static void set_max_protocol_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; if (!conf.append_protocol || !idata->metrics->protocol) return; vlen = strlen (idata->metrics->protocol); llen = strlen (MTRC_PROTOCOLS_SHORT_LBL); if (vlen > meta->protocol_len) meta->protocol_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->protocol_len) meta->protocol_len = llen; } /* Get the percent integer length. */ static void set_max_data_len (GDashMeta * meta, GDashData * idata) { int vlen = 0, llen = 0; vlen = strlen (idata->metrics->data); llen = strlen (MTRC_DATA_LBL); if (vlen > meta->data_len) meta->data_len = vlen; /* if outputting with column names, then determine if the value is * longer than the length of the column name */ if (llen > meta->data_len) meta->data_len = llen; } static void set_max_values (GDashMeta * meta, GMetrics * metrics) { if (metrics->hits > meta->max_hits) meta->max_hits = metrics->hits; if (metrics->visitors > meta->max_visitors) meta->max_visitors = metrics->visitors; } static void set_metrics_len (GDashMeta * meta, GDashData * idata) { /* integer-based length */ set_max_hit_len (meta, idata); set_max_hit_perc_len (meta, idata); set_max_visitors_len (meta, idata); set_max_visitors_perc_len (meta, idata); /* string-based length */ set_max_bw_len (meta, idata); set_max_avgts_len (meta, idata); set_max_cumts_len (meta, idata); set_max_maxts_len (meta, idata); set_max_method_len (meta, idata); set_max_protocol_len (meta, idata); set_max_data_len (meta, idata); } /* Render host's panel selected row */ static void render_data_hosts (WINDOW * win, GDashRender render, char *value, int x) { char *padded_data; padded_data = left_pad_str (value, x); draw_header (win, padded_data, "%s", render.y, 0, render.w, color_selected); free (padded_data); } /* Set panel's date on the given buffer * * On error, '---' placeholder is returned. * On success, the formatted date is returned. */ static char * set_visitors_date (const char *value) { return get_visitors_date (value, conf.spec_date_time_num_format, conf.spec_date_time_format); } static char * get_fixed_fmt_width (int w, char type) { char *fmt = xmalloc (snprintf (NULL, 0, "%%%d%c", w, type) + 1); sprintf (fmt, "%%%d%c", w, type); return fmt; } /* Render the 'total' label on each panel */ static void render_total_label (WINDOW * win, GDashModule * data, int y, GColors * (*func) (void)) { char *s; int win_h, win_w, total, ht_size; total = data->holder_size; ht_size = data->ht_size; s = xmalloc (snprintf (NULL, 0, "%s: %d/%d", GEN_TOTAL, total, ht_size) + 1); getmaxyx (win, win_h, win_w); (void) win_h; sprintf (s, "%s: %d/%d", GEN_TOTAL, total, ht_size); draw_header (win, s, "%s", y, win_w - strlen (s) - 2, win_w, func); free (s); } /* Render panel bar graph */ static void render_bars (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color (COLOR_BARS); WINDOW *win = render.win; char *bar; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; bar = get_bars (data->data[idx].metrics->hits, data->meta.max_hits, *x); if (sel) draw_header (win, bar, "%s", y, *x, w, color_selected); else { wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%s", bar); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } free (bar); } /* Render the data metric for each panel */ static void render_data (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_DATA, data->module); WINDOW *win = render.win; char *date = NULL, *value = NULL, *buf = NULL; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; int date_len = 0; value = substring (data->data[idx].metrics->data, 0, w - *x); if (data->module == VISITORS) { date = set_visitors_date (value); date_len = strlen (date); } if (sel && data->module == HOSTS && data->data[idx].is_subitem) { render_data_hosts (win, render, value, *x); } else if (sel) { buf = data->module == VISITORS ? date : value; draw_header (win, buf, "%s", y, *x, w, color_selected); } else { wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%s", data->module == VISITORS ? date : value); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } *x += data->module == VISITORS ? date_len : data->meta.data_len; *x += DASH_SPACE; free (value); free (date); } /* Render the method metric for each panel * * On error, no method is rendered and it returns. * On success, method is rendered. */ static void render_method (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_MTHD, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *method = data->data[idx].metrics->method; if (method == NULL || *method == '\0') return; if (sel) { /* selected state */ draw_header (win, method, "%s", y, *x, w, color_selected); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%s", method); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } *x += data->meta.method_len + DASH_SPACE; } /* Render the protocol metric for each panel * * On error, no protocol is rendered and it returns. * On success, protocol is rendered. */ static void render_proto (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_PROT, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *protocol = data->data[idx].metrics->protocol; if (protocol == NULL || *protocol == '\0') return; if (sel) { /* selected state */ draw_header (win, protocol, "%s", y, *x, w, color_selected); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%s", protocol); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } *x += REQ_PROTO_LEN - 1 + DASH_SPACE; } /* Render the average time served metric for each panel */ static void render_avgts (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_AVGTS, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *avgts = data->data[idx].metrics->avgts.sts; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { /* selected state */ draw_header (win, avgts, "%9s", y, *x, w, color_selected); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%9s", avgts); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += DASH_SRV_TM_LEN + DASH_SPACE; } /* Render the cumulative time served metric for each panel */ static void render_cumts (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_CUMTS, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *cumts = data->data[idx].metrics->cumts.sts; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { /* selected state */ draw_header (win, cumts, "%9s", y, *x, w, color_selected); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%9s", cumts); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += DASH_SRV_TM_LEN + DASH_SPACE; } /* Render the maximum time served metric for each panel */ static void render_maxts (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_MAXTS, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *maxts = data->data[idx].metrics->maxts.sts; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { /* selected state */ draw_header (win, maxts, "%9s", y, *x, w, color_selected); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%9s", maxts); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += DASH_SRV_TM_LEN + DASH_SPACE; } /* Render the bandwidth metric for each panel */ static void render_bw (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_BW, data->module); WINDOW *win = render.win; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; char *bw = data->data[idx].metrics->bw.sbw; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { char *fw = get_fixed_fmt_width (data->meta.bw_len, 's'); /* selected state */ draw_header (win, bw, fw, y, *x, w, color_selected); free (fw); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%*s", data->meta.bw_len, bw); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += data->meta.bw_len + DASH_SPACE; } /* Render a percent metric */ static void render_percent (GDashRender render, GColors * color, float perc, int len, int x) { WINDOW *win = render.win; char *percent; int y = render.y, w = render.w, sel = render.sel; if (sel) { /* selected state */ percent = float2str (perc, len); draw_header (win, percent, "%s%%", y, x, w, color_selected); free (percent); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, x, "%*.2f%%", len, perc); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } } /* Render the hits percent metric for each panel */ static void render_hits_percent (GDashModule * data, GDashRender render, int *x) { GColorItem item = COLOR_MTRC_HITS_PERC; GColors *color; int l = data->meta.hits_perc_len + 3, idx = render.idx; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (data->meta.max_hits == data->data[idx].metrics->hits) item = COLOR_MTRC_HITS_PERC_MAX; color = get_color_by_item_module (item, data->module); render_percent (render, color, data->data[idx].metrics->hits_perc, l, *x); out: *x += l + 1 + DASH_SPACE; } /* Render the visitors percent metric for each panel */ static void render_visitors_percent (GDashModule * data, GDashRender render, int *x) { GColorItem item = COLOR_MTRC_VISITORS_PERC; GColors *color; int l = data->meta.visitors_perc_len + 3, idx = render.idx; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (data->meta.max_visitors == data->data[idx].metrics->visitors) item = COLOR_MTRC_VISITORS_PERC_MAX; color = get_color_by_item_module (item, data->module); render_percent (render, color, data->data[idx].metrics->visitors_perc, l, *x); out: *x += l + 1 + DASH_SPACE; } /* Render the hits metric for each panel */ static void render_hits (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_HITS, data->module); WINDOW *win = render.win; char *hits; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; int len = data->meta.hits_len; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { /* selected state */ hits = int2str (data->data[idx].metrics->hits, len); draw_header (win, hits, " %s", y, 0, w, color_selected); free (hits); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%*d", len, data->data[idx].metrics->hits); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += len + DASH_SPACE; } /* Render the visitors metric for each panel */ static void render_visitors (GDashModule * data, GDashRender render, int *x) { GColors *color = get_color_by_item_module (COLOR_MTRC_VISITORS, data->module); WINDOW *win = render.win; char *visitors; int y = render.y, w = render.w, idx = render.idx, sel = render.sel; int len = data->meta.visitors_len; if (data->module == HOSTS && data->data[idx].is_subitem) goto out; if (sel) { /* selected state */ visitors = int2str (data->data[idx].metrics->visitors, len); draw_header (win, visitors, "%s", y, *x, w, color_selected); free (visitors); } else { /* regular state */ wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, "%*d", len, data->data[idx].metrics->visitors); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); } out: *x += len + DASH_SPACE; } /* Render the header row for each panel */ static void render_header (WINDOW * win, GDashModule * data, GModule cur_module, int *y) { GColors *(*func) (void); char ind; char *hd; int k, w, h; getmaxyx (win, h, w); (void) h; k = data->module + 1; ind = cur_module == data->module ? '>' : ' '; func = cur_module == data->module && conf.hl_header ? color_panel_active : color_panel_header; hd = xmalloc (snprintf (NULL, 0, "%c %d - %s", ind, k, data->head) + 1); sprintf (hd, "%c %d - %s", ind, k, data->head); draw_header (win, hd, " %s", (*y), 0, w, func); free (hd); render_total_label (win, data, (*y), func); data->pos_y = (*y); (*y)++; } /* Render the description row for each panel */ static void render_description (WINDOW * win, GDashModule * data, int *y) { int w, h; getmaxyx (win, h, w); (void) h; draw_header (win, data->desc, " %s", (*y), 0, w, color_panel_desc); data->pos_y = (*y); (*y)++; (*y)++; /* add empty line underneath description */ } /* Render available metrics per panel. * ###TODO: Have the abilitity to display metrics in specific order */ static void render_metrics (GDashModule * data, GDashRender render, int expanded) { int x = get_xpos (); GModule module = data->module; const GOutput *output = output_lookup (module); /* basic metrics */ if (output->hits) render_hits (data, render, &x); if (output->percent) render_hits_percent (data, render, &x); if (output->visitors) render_visitors (data, render, &x); if (output->percent) render_visitors_percent (data, render, &x); /* render bandwidth if available */ if (conf.bandwidth && output->bw) render_bw (data, render, &x); /* render avgts, cumts and maxts if available */ if (output->avgts && conf.serve_usecs) render_avgts (data, render, &x); if (output->cumts && conf.serve_usecs) render_cumts (data, render, &x); if (output->maxts && conf.serve_usecs) render_maxts (data, render, &x); /* render request method if available */ if (output->method && conf.append_method) render_method (data, render, &x); /* render request protocol if available */ if (output->protocol && conf.append_protocol) render_proto (data, render, &x); if (output->data) render_data (data, render, &x); /* skip graph bars if module is expanded and we have sub nodes */ if ((output->graph && !expanded) || (output->sub_graph && expanded)) render_bars (data, render, &x); } /* Render a dashboard row. */ static void render_data_line (WINDOW * win, GDashModule * data, int *y, int j, GScroll * gscroll) { GDashRender render; GModule module = data->module; int expanded = 0, sel = 0; int w, h; getmaxyx (win, h, w); (void) h; if (gscroll->expanded && module == gscroll->current) expanded = 1; if (j >= data->idx_data) goto out; sel = expanded && j == gscroll->module[module].scroll ? 1 : 0; render.win = win; render.y = *y; render.w = w; render.idx = j; render.sel = sel; render_metrics (data, render, expanded); out: (*y)++; } /* Render a dashed line underneath the metric label. */ static void print_horizontal_dash (WINDOW * win, int y, int x, int len) { mvwprintw (win, y, x, "%.*s", len, "----------------"); } /* Render left-aligned column label. */ static void lprint_col (WINDOW * win, int y, int *x, int len, const char *fmt, const char *str) { GColors *color = get_color (COLOR_PANEL_COLS); wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, fmt, str); print_horizontal_dash (win, y + 1, *x, len); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); *x += len + DASH_SPACE; } /* Render right-aligned column label. */ static void rprint_col (WINDOW * win, int y, int *x, int len, const char *fmt, const char *str) { GColors *color = get_color (COLOR_PANEL_COLS); wattron (win, color->attr | COLOR_PAIR (color->pair->idx)); mvwprintw (win, y, *x, fmt, len, str); print_horizontal_dash (win, y + 1, *x, len); wattroff (win, color->attr | COLOR_PAIR (color->pair->idx)); *x += len + DASH_SPACE; } /* Render column names for available metrics. * ###TODO: Have the abilitity to display metrics in specific order */ static void render_cols (WINDOW * win, GDashModule * data, int *y) { GModule module = data->module; const GOutput *output = output_lookup (module); int x = get_xpos (); if (data->idx_data == 0 || conf.no_column_names) return; if (output->hits) lprint_col (win, *y, &x, data->meta.hits_len, "%s", MTRC_HITS_LBL); if (output->percent) rprint_col (win, *y, &x, data->meta.hits_perc_len + 4, "%*s", MTRC_HITS_PERC_LBL); if (output->visitors) rprint_col (win, *y, &x, data->meta.visitors_len, "%*s", MTRC_VISITORS_SHORT_LBL); if (output->percent) rprint_col (win, *y, &x, data->meta.visitors_perc_len + 4, "%*s", MTRC_VISITORS_PERC_LBL); if (output->bw && conf.bandwidth) rprint_col (win, *y, &x, data->meta.bw_len, "%*s", MTRC_BW_LBL); if (output->avgts && conf.serve_usecs) rprint_col (win, *y, &x, DASH_SRV_TM_LEN, "%*s", MTRC_AVGTS_LBL); if (output->cumts && conf.serve_usecs) rprint_col (win, *y, &x, DASH_SRV_TM_LEN, "%*s", MTRC_CUMTS_LBL); if (output->maxts && conf.serve_usecs) rprint_col (win, *y, &x, DASH_SRV_TM_LEN, "%*s", MTRC_MAXTS_LBL); if (output->method && conf.append_method) lprint_col (win, *y, &x, data->meta.method_len, "%s", MTRC_METHODS_SHORT_LBL); if (output->protocol && conf.append_protocol) lprint_col (win, *y, &x, 8, "%s", MTRC_PROTOCOLS_SHORT_LBL); if (output->data) lprint_col (win, *y, &x, 4, "%s", MTRC_DATA_LBL); } /* Iterate over all dashboard data and render its content. */ static void render_content (WINDOW * win, GDashModule * data, int *y, int *offset, int *total, GScroll * gscroll) { GModule module = data->module; int i, j, size, h, w, data_pos = get_data_pos_rows (); getmaxyx (win, h, w); (void) w; size = data->dash_size; for (i = *offset, j = 0; i < size; i++) { /* header */ if ((i % size) == DASH_HEAD_POS) { render_header (win, data, gscroll->current, y); } else if ((i % size) == DASH_EMPTY_POS && conf.no_column_names) { /* if no column names, print panel description */ render_description (win, data, y); } else if ((i % size) == DASH_EMPTY_POS || (i % size) == size - 1) { /* blank lines */ (*y)++; } else if ((i % size) == DASH_DASHES_POS && !conf.no_column_names) { /* account for already printed dash lines under columns */ (*y)++; } else if ((i % size) == DASH_COLS_POS && !conf.no_column_names) { /* column headers lines */ render_cols (win, data, y); (*y)++; } else if ((i % size) >= data_pos || (i % size) <= size - 2) { /* account for 2 lines at the header and 2 blank lines */ j = ((i % size) - data_pos) + gscroll->module[module].offset; /* actual data */ render_data_line (win, data, y, j, gscroll); } else { /* everything else should be empty */ (*y)++; } (*total)++; if (*y >= h) break; } } /* Entry point to render the terminal dashboard. */ void display_content (WINDOW * win, GDash * dash, GScroll * gscroll) { GModule module; int j = 0; size_t idx = 0; int y = 0, offset = 0, total = 0; int dash_scroll = gscroll->dash; werase (win); FOREACH_MODULE (idx, module_list) { module = module_list[idx]; offset = 0; for (j = 0; j < dash->module[module].dash_size; j++) { if (dash_scroll > total) { offset++; total++; } } /* used module */ dash->module[module].module = module; render_content (win, &dash->module[module], &y, &offset, &total, gscroll); } wrefresh (win); } /* Reset the scroll and offset fields for each panel/module. */ void reset_scroll_offsets (GScroll * gscroll) { GModule module; size_t idx = 0; FOREACH_MODULE (idx, module_list) { module = module_list[idx]; gscroll->module[module].scroll = 0; gscroll->module[module].offset = 0; } } /* Compile the regular expression and see if it's valid. * * If unable to compile, an error as described in . * Upon successful completion, function returns 0. */ static int regexp_init (regex_t * regex, const char *pattern) { int y, x, rc; char buf[REGEX_ERROR]; getmaxyx (stdscr, y, x); rc = regcomp (regex, pattern, REG_EXTENDED | (find_t.icase ? REG_ICASE : 0)); /* something went wrong */ if (rc != 0) { regerror (rc, regex, buf, sizeof (buf)); draw_header (stdscr, buf, "%s", y - 1, 0, x, color_error); refresh (); return 1; } return 0; } /* Set the dashboard scroll and offset based on the search index. */ static void perform_find_dash_scroll (GScroll * gscroll, GModule module) { int *scrll, *offset; int exp_size = get_num_expanded_data_rows (); /* reset gscroll offsets if we are changing module */ if (gscroll->current != module) reset_scroll_offsets (gscroll); scrll = &gscroll->module[module].scroll; offset = &gscroll->module[module].offset; (*scrll) = find_t.next_idx; if (*scrll >= exp_size && *scrll >= *offset + exp_size) (*offset) = (*scrll) < exp_size - 1 ? 0 : (*scrll) - exp_size + 1; gscroll->current = module; gscroll->dash = get_module_index (module) * DASH_COLLAPSED; gscroll->expanded = 1; find_t.module = module; } /* Find the searched item within the given sub list. * * If not found, the GFind structure is reset and 1 is returned. * If found, a GFind structure is set and 0 is returned. */ static int find_next_sub_item (GSubList * sub_list, regex_t * regex) { GSubItem *iter; int i = 0, rc; if (sub_list == NULL) goto out; for (iter = sub_list->head; iter; iter = iter->next) { if (i >= find_t.next_sub_idx) { rc = regexec (regex, iter->metrics->data, 0, NULL, 0); if (rc == 0) { find_t.next_idx++; find_t.next_sub_idx = (1 + i); return 0; } find_t.next_idx++; } i++; } out: find_t.next_parent_idx++; find_t.next_sub_idx = 0; find_t.look_in_sub = 0; return 1; } /* Perform a forward search across all modules. * * On error or if not found, 1 is returned. * On success or if found, a GFind structure is set and 0 is returned. */ int perform_next_find (GHolder * h, GScroll * gscroll) { GModule module; GSubList *sub_list; regex_t regex; char buf[REGEX_ERROR], *data; int y, x, j, n, rc; size_t idx = 0; getmaxyx (stdscr, y, x); if (find_t.pattern == NULL || *find_t.pattern == '\0') return 1; /* compile and initialize regexp */ if (regexp_init (®ex, find_t.pattern)) return 1; /* use last find_t.module and start search */ idx = find_t.module; FOREACH_MODULE (idx, module_list) { module = module_list[idx]; n = h[module].idx; for (j = find_t.next_parent_idx; j < n; j++, find_t.next_idx++) { data = h[module].items[j].metrics->data; rc = regexec (®ex, data, 0, NULL, 0); /* error matching against the precompiled pattern buffer */ if (rc != 0 && rc != REG_NOMATCH) { regerror (rc, ®ex, buf, sizeof (buf)); draw_header (stdscr, buf, "%s", y - 1, 0, x, color_error); refresh (); regfree (®ex); return 1; } /* a match was found (data level) */ else if (rc == 0 && !find_t.look_in_sub) { find_t.look_in_sub = 1; perform_find_dash_scroll (gscroll, module); goto out; } /* look at sub list nodes */ else { sub_list = h[module].items[j].sub_list; if (find_next_sub_item (sub_list, ®ex) == 0) { perform_find_dash_scroll (gscroll, module); goto out; } } } /* reset find */ find_t.next_idx = 0; find_t.next_parent_idx = 0; find_t.next_sub_idx = 0; if (find_t.module != module) { reset_scroll_offsets (gscroll); gscroll->expanded = 0; } if (module == TOTAL_MODULES - 1) { find_t.module = 0; goto out; } } out: regfree (®ex); return 0; } /* Render a find dialog. * * On error or if no query is set, 1 is returned. * On success, the dialog is rendered and 0 is returned. */ int render_find_dialog (WINDOW * main_win, GScroll * gscroll) { int y, x, valid = 1; int w = FIND_DLG_WIDTH; int h = FIND_DLG_HEIGHT; char *query = NULL; WINDOW *win; getmaxyx (stdscr, y, x); win = newwin (h, w, (y - h) / 2, (x - w) / 2); keypad (win, TRUE); wborder (win, '|', '|', '-', '-', '+', '+', '+', '+'); draw_header (win, FIND_HEAD, " %s", 1, 1, w - 2, color_panel_header); mvwprintw (win, 2, 1, " %s", FIND_DESC); find_t.icase = 0; query = input_string (win, 4, 2, w - 3, "", 1, &find_t.icase); if (query != NULL && *query != '\0') { reset_scroll_offsets (gscroll); reset_find (); find_t.pattern = xstrdup (query); valid = 0; } if (query != NULL) free (query); touchwin (main_win); close_win (win); wrefresh (main_win); return valid; } static void set_dash_metrics (GDash ** dash, GMetrics * metrics, GModule module, int is_subitem) { GDashData *idata = NULL; GDashMeta *meta = NULL; char *data = NULL; int *idx; if (!metrics->data) return; idx = &(*dash)->module[module].idx_data; idata = &(*dash)->module[module].data[(*idx)]; meta = &(*dash)->module[module].meta; idata->metrics = new_gmetrics (); idata->is_subitem = is_subitem; data = is_subitem ? render_child_node (metrics->data) : metrics->data; /* set maximum values so far for hits/visitors */ set_max_values (meta, metrics); idata->metrics->hits = metrics->hits; idata->metrics->hits_perc = get_percentage (meta->max_hits, metrics->hits); idata->metrics->visitors = metrics->visitors; idata->metrics->visitors_perc = get_percentage (meta->max_visitors, metrics->visitors); idata->metrics->bw.sbw = filesize_str (metrics->bw.nbw); idata->metrics->data = xstrdup (data); if (conf.append_method && metrics->method) idata->metrics->method = metrics->method; if (conf.append_protocol && metrics->protocol) idata->metrics->protocol = metrics->protocol; if (!conf.serve_usecs) goto out; idata->metrics->avgts.sts = usecs_to_str (metrics->avgts.nts); idata->metrics->cumts.sts = usecs_to_str (metrics->cumts.nts); idata->metrics->maxts.sts = usecs_to_str (metrics->maxts.nts); out: if (is_subitem) free (data); set_metrics_len (meta, idata); (*idx)++; } /* Add an item from a sub list to the dashboard. * * If no items on the sub list, the function returns. * On success, sub list data is set into the dashboard structure. */ static void add_sub_item_to_dash (GDash ** dash, GHolderItem item, GModule module, int *i) { GSubList *sub_list = item.sub_list; GSubItem *iter; if (sub_list == NULL) return; for (iter = sub_list->head; iter; iter = iter->next, (*i)++) { set_dash_metrics (dash, iter->metrics, module, 1); } } /* Add a first level item to dashboard. * * On success, data is set into the dashboard structure. */ static void add_item_to_dash (GDash ** dash, GHolderItem item, GModule module) { set_dash_metrics (dash, item.metrics, module, 0); } /* Load holder's data into the dashboard structure. */ void load_data_to_dash (GHolder * h, GDash * dash, GModule module, GScroll * gscroll) { int alloc_size = 0; int i, j; alloc_size = dash->module[module].alloc_data; if (gscroll->expanded && module == gscroll->current) alloc_size += h->sub_items_size; dash->module[module].alloc_data = alloc_size; dash->module[module].data = new_gdata (alloc_size); dash->module[module].holder_size = h->holder_size; memset (&dash->module[module].meta, 0, sizeof (GDashData)); for (i = 0, j = 0; i < alloc_size; i++) { if (h->items[j].metrics->data == NULL) continue; add_item_to_dash (&dash, h->items[j], module); if (gscroll->expanded && module == gscroll->current && h->sub_items_size) add_sub_item_to_dash (&dash, h->items[j], module, &i); j++; } } goaccess-1.3/src/xmalloc.c0000644000000000000000000000451713375657450012453 00000000000000/** * xmalloc.c -- *alloc functions with error handling * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #if !defined __SUNPRO_C #include #endif #include #include #include "error.h" #include "xmalloc.h" /* Self-checking wrapper to malloc() */ void * xmalloc (size_t size) { void *ptr; if ((ptr = malloc (size)) == NULL) FATAL ("Unable to allocate memory - failed."); return (ptr); } char * xstrdup (const char *s) { char *ptr; size_t len; len = strlen (s) + 1; ptr = xmalloc (len); strncpy (ptr, s, len); return (ptr); } /* Self-checking wrapper to calloc() */ void * xcalloc (size_t nmemb, size_t size) { void *ptr; if ((ptr = calloc (nmemb, size)) == NULL) FATAL ("Unable to calloc memory - failed."); return (ptr); } /* Self-checking wrapper to realloc() */ void * xrealloc (void *oldptr, size_t size) { void *newptr; if ((newptr = realloc (oldptr, size)) == NULL) FATAL ("Unable to reallocate memory - failed"); return (newptr); } goaccess-1.3/src/websocket.c0000644000000000000000000023131213375657450012775 00000000000000/** * websocket.c -- An rfc6455-complaint Web Socket Server * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_CONFIG_H #include #endif #include "websocket.h" #include "base64.h" #include "error.h" #include "gslist.h" #include "sha1.h" #include "xmalloc.h" /* *INDENT-OFF* */ /* UTF-8 Decoder */ /* Copyright (c) 2008-2009 Bjoern Hoehrmann * See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. */ #define UTF8_VALID 0 #define UTF8_INVAL 1 static const uint8_t utf8d[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 00..1f */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 20..3f */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40..5f */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 60..7f */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, /* 80..9f */ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* a0..bf */ 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /* c0..df */ 0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, /* e0..ef */ 0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, /* f0..ff */ 0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, /* s0..s0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, /* s1..s2 */ 1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, /* s3..s4 */ 1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, /* s5..s6 */ 1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* s7..s8 */ }; /* *INDENT-ON* */ static int max_file_fd = 0; static WSEState fdstate; static WSConfig wsconfig = { 0 }; static void handle_read_close (int conn, WSClient * client, WSServer * server); static void handle_reads (int conn, WSServer * server); static void handle_writes (int conn, WSServer * server); #ifdef HAVE_LIBSSL static int shutdown_ssl (WSClient * client); #endif /* Determine if the given string is valid UTF-8. * * The state after the by has been processed is returned. */ static uint32_t verify_utf8 (uint32_t * state, const char *str, int len) { int i; uint32_t type; for (i = 0; i < len; ++i) { type = utf8d[(uint8_t) str[i]]; *state = utf8d[256 + (*state) * 16 + type]; if (*state == UTF8_INVAL) break; } return *state; } /* Decode a character maintaining state and a byte, and returns the * state achieved after processing the byte. * * The state after the by has been processed is returned. */ static uint32_t utf8_decode (uint32_t * state, uint32_t * p, uint32_t b) { uint32_t type = utf8d[(uint8_t) b]; *p = (*state != UTF8_VALID) ? (b & 0x3fu) | (*p << 6) : (0xff >> type) & (b); *state = utf8d[256 + *state * 16 + type]; return *state; } /* Replace malformed sequences with a substitute character. * * On success, it replaces the whole sequence and return a malloc'd buffer. */ static char * sanitize_utf8 (const char *str, int len) { char *buf = NULL; uint32_t state = UTF8_VALID, prev = UTF8_VALID, cp = 0; int i = 0, j = 0, k = 0, l = 0; buf = xcalloc (len + 1, sizeof (char)); for (; i < len; prev = state, ++i) { switch (utf8_decode (&state, &cp, (unsigned char) str[i])) { case UTF8_INVAL: /* replace the whole sequence */ if (k) { for (l = i - k; l < i; ++l) buf[j++] = '?'; } else { buf[j++] = '?'; } state = UTF8_VALID; if (prev != UTF8_VALID) i--; k = 0; break; case UTF8_VALID: /* fill i - k valid continuation bytes */ if (k) for (l = i - k; l < i; ++l) buf[j++] = str[l]; buf[j++] = str[i]; k = 0; break; default: /* UTF8_VALID + continuation bytes */ k++; break; } } return buf; } /* Allocate memory for a websocket server */ static WSServer * new_wsserver (void) { WSServer *server = xcalloc (1, sizeof (WSServer)); return server; } /* Allocate memory for a websocket client */ static WSClient * new_wsclient (void) { WSClient *client = xcalloc (1, sizeof (WSClient)); client->status = WS_OK; return client; } /* Allocate memory for a websocket header */ static WSHeaders * new_wsheader (void) { WSHeaders *headers = xcalloc (1, sizeof (WSHeaders)); memset (headers->buf, 0, sizeof (headers->buf)); headers->reading = 1; return headers; } /* Allocate memory for a websocket frame */ static WSFrame * new_wsframe (void) { WSFrame *frame = xcalloc (1, sizeof (WSFrame)); memset (frame->buf, 0, sizeof (frame->buf)); frame->reading = 1; return frame; } /* Allocate memory for a websocket message */ static WSMessage * new_wsmessage (void) { WSMessage *msg = xcalloc (1, sizeof (WSMessage)); return msg; } /* Allocate memory for a websocket pipeout */ static WSPipeOut * new_wspipeout (void) { WSPipeOut *pipeout = xcalloc (1, sizeof (WSPipeOut)); pipeout->fd = -1; return pipeout; } /* Allocate memory for a websocket pipein */ static WSPipeIn * new_wspipein (void) { WSPipeIn *pipein = xcalloc (1, sizeof (WSPipeIn)); pipein->fd = -1; return pipein; } /* Escapes the special characters, e.g., '\n', '\r', '\t', '\' * in the string source by inserting a '\' before them. * * On error NULL is returned. * On success the escaped string is returned */ static char * escape_http_request (const char *src) { char *dest, *q; const unsigned char *p; if (src == NULL || *src == '\0') return NULL; p = (unsigned char *) src; q = dest = xmalloc (strlen (src) * 4 + 1); while (*p) { switch (*p) { case '\\': *q++ = '\\'; *q++ = '\\'; break; case '\n': *q++ = '\\'; *q++ = 'n'; break; case '\r': *q++ = '\\'; *q++ = 'r'; break; case '\t': *q++ = '\\'; *q++ = 't'; break; case '"': *q++ = '\\'; *q++ = '"'; break; default: if ((*p < ' ') || (*p >= 0177)) { /* not ASCII */ } else { *q++ = *p; } break; } p++; } *q = 0; return dest; } /* Make a string uppercase. * * On error the original string is returned. * On success, the uppercased string is returned. */ static char * strtoupper (char *str) { char *p = str; if (str == NULL || *str == '\0') return str; while (*p != '\0') { *p = toupper (*p); p++; } return str; } /* Chop n characters from the beginning of the supplied buffer. * * The new length of the string is returned. */ static size_t chop_nchars (char *str, size_t n, size_t len) { if (n == 0 || str == 0) return 0; if (n > len) n = len; memmove (str, str + n, len - n); return (len - n); } /* Match a client given a socket id and an item from the list. * * On match, 1 is returned, else 0. */ static int ws_find_client_sock_in_list (void *data, void *needle) { WSClient *client = data; return client->listener == (*(int *) needle); } /* Find a client given a socket id. * * On success, an instance of a GSLList node is returned, else NULL. */ static GSLList * ws_get_list_node_from_list (int listener, GSLList ** colist) { GSLList *match = NULL; /* Find the client data for the socket in use */ if (!(match = list_find (*colist, ws_find_client_sock_in_list, &listener))) return NULL; return match; } /* Find a client given a socket id. * * On success, an instance of a WSClient is returned, else NULL. */ static WSClient * ws_get_client_from_list (int listener, GSLList ** colist) { GSLList *match = NULL; /* Find the client data for the socket in use */ if (!(match = list_find (*colist, ws_find_client_sock_in_list, &listener))) return NULL; return (WSClient *) match->data; } /* Free a frame structure and its data for the given client. */ static void ws_free_frame (WSClient * client) { if (client->frame) free (client->frame); client->frame = NULL; } /* Free a message structure and its data for the given client. */ static void ws_free_message (WSClient * client) { if (client->message && client->message->payload) free (client->message->payload); if (client->message) free (client->message); client->message = NULL; } /* Free all HTTP handshake headers data for the given client. */ static void ws_free_header_fields (WSHeaders * headers) { if (headers->connection) free (headers->connection); if (headers->host) free (headers->host); if (headers->agent) free (headers->agent); if (headers->method) free (headers->method); if (headers->origin) free (headers->origin); if (headers->path) free (headers->path); if (headers->protocol) free (headers->protocol); if (headers->upgrade) free (headers->upgrade); if (headers->ws_accept) free (headers->ws_accept); if (headers->ws_key) free (headers->ws_key); if (headers->ws_protocol) free (headers->ws_protocol); if (headers->ws_resp) free (headers->ws_resp); if (headers->ws_sock_ver) free (headers->ws_sock_ver); if (headers->referer) free (headers->referer); } /* Clear the client's sent queue and its data. */ static void ws_clear_queue (WSClient * client) { WSQueue **queue = &client->sockqueue; if (!(*queue)) return; if ((*queue)->queued) free ((*queue)->queued); (*queue)->queued = NULL; (*queue)->qlen = 0; free ((*queue)); (*queue) = NULL; /* done sending the whole queue, stop throttling */ client->status &= ~WS_THROTTLING; /* done sending, close connection if set to close */ if ((client->status & WS_CLOSE) && (client->status & WS_SENDING)) client->status = WS_CLOSE; } /* Free all HTTP handshake headers and structure. */ static void ws_clear_handshake_headers (WSHeaders * headers) { ws_free_header_fields (headers); free (headers); headers = NULL; } /* Remove the given client from the list. */ static void ws_remove_client_from_list (WSClient * client, WSServer * server) { GSLList *node = NULL; if (!(node = ws_get_list_node_from_list (client->listener, &server->colist))) return; if (client->headers) ws_clear_handshake_headers (client->headers); list_remove_node (&server->colist, node); } #if HAVE_LIBSSL /* Attempt to send the TLS/SSL "close notify" shutdown and and removes * the SSL structure pointed to by ssl and frees up the allocated * memory. */ static void ws_shutdown_dangling_clients (WSClient * client) { shutdown_ssl (client); SSL_free (client->ssl); client->ssl = NULL; } /* Attempt to remove the SSL_CTX object pointed to by ctx and frees up * the allocated memory and cleans some more generally used TLS/SSL * memory. */ static void ws_ssl_cleanup (WSServer * server) { if (!wsconfig.use_ssl) return; if (server->ctx) SSL_CTX_free (server->ctx); CRYPTO_cleanup_all_ex_data (); CRYPTO_set_id_callback (NULL); CRYPTO_set_locking_callback (NULL); ERR_free_strings (); #if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_remove_state (0); #endif EVP_cleanup (); } #endif /* Remove all clients that are still hanging out. */ static int ws_remove_dangling_clients (void *value, void *user_data) { WSClient *client = value; (void) (user_data); if (client == NULL) return 1; if (client->headers) ws_clear_handshake_headers (client->headers); if (client->sockqueue) ws_clear_queue (client); #ifdef HAVE_LIBSSL if (client->ssl) ws_shutdown_dangling_clients (client); #endif return 0; } /* Do some housekeeping on the named pipe data packet. */ static void ws_clear_fifo_packet (WSPacket * packet) { if (!packet) return; if (packet->data) free (packet->data); free (packet); } /* Do some housekeeping on the named pipe. */ static void ws_clear_pipein (WSPipeIn * pipein) { WSPacket **packet = &pipein->packet; if (!pipein) return; if (pipein->fd != -1) close (pipein->fd); ws_clear_fifo_packet (*packet); free (pipein); if (wsconfig.pipein && access (wsconfig.pipein, F_OK) != -1) unlink (wsconfig.pipein); } /* Do some housekeeping on the named pipe. */ static void ws_clear_pipeout (WSPipeOut * pipeout) { if (!pipeout) return; if (pipeout->fd != -1) close (pipeout->fd); free (pipeout); if (wsconfig.pipeout && access (wsconfig.pipeout, F_OK) != -1) unlink (wsconfig.pipeout); } /* Stop the server and do some cleaning. */ void ws_stop (WSServer * server) { WSPipeIn **pipein = &server->pipein; WSPipeOut **pipeout = &server->pipeout; ws_clear_pipein (*pipein); ws_clear_pipeout (*pipeout); /* close access log (if any) */ if (wsconfig.accesslog) access_log_close (); /* remove dangling clients */ if (list_count (server->colist) > 0) list_foreach (server->colist, ws_remove_dangling_clients, NULL); if (server->colist) list_remove_nodes (server->colist); #ifdef HAVE_LIBSSL ws_ssl_cleanup (server); #endif free (server); } /* A wrapper to close a socket. */ static void ws_close (int listener) { close (listener); } /* Set the connection status for the given client and return the given * bytes. * * The given number of bytes are returned. */ static int ws_set_status (WSClient * client, WSStatus status, int bytes) { client->status = status; return bytes; } /* Append the source string to destination and reallocates and * updating the destination buffer appropriately. */ static void ws_append_str (char **dest, const char *src) { size_t curlen = strlen (*dest); size_t srclen = strlen (src); size_t newlen = curlen + srclen; char *str = xrealloc (*dest, newlen + 1); memcpy (str + curlen, src, srclen + 1); *dest = str; } #if HAVE_LIBSSL /* Create a new SSL_CTX object as framework to establish TLS/SSL * enabled connections. * * On error 1 is returned. * On success, SSL_CTX object is malloc'd and 0 is returned. */ static int initialize_ssl_ctx (WSServer * server) { int ret = 1; SSL_CTX *ctx = NULL; #if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_library_init (); SSL_load_error_strings (); #endif /* Ciphers and message digests */ OpenSSL_add_ssl_algorithms (); /* ssl context */ if (!(ctx = SSL_CTX_new (SSLv23_server_method ()))) goto out; /* set certificate */ if (!SSL_CTX_use_certificate_file (ctx, wsconfig.sslcert, SSL_FILETYPE_PEM)) goto out; /* ssl private key */ if (!SSL_CTX_use_PrivateKey_file (ctx, wsconfig.sslkey, SSL_FILETYPE_PEM)) goto out; if (!SSL_CTX_check_private_key (ctx)) goto out; /* since we queued up the send data, a retry won't be the same buffer, * thus we need the following flags */ SSL_CTX_set_mode (ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE); server->ctx = ctx; ret = 0; out: if (ret) { SSL_CTX_free (ctx); LOG (("Error: %s\n", ERR_error_string (ERR_get_error (), NULL))); } return ret; } /* Log result code for TLS/SSL I/O operation */ static void log_return_message (int ret, int err, const char *fn) { unsigned long e; switch (err) { case SSL_ERROR_NONE: LOG (("SSL: %s -> SSL_ERROR_NONE\n", fn)); LOG (("SSL: TLS/SSL I/O operation completed\n")); break; case SSL_ERROR_WANT_READ: LOG (("SSL: %s -> SSL_ERROR_WANT_READ\n", fn)); LOG (("SSL: incomplete, data available for reading\n")); break; case SSL_ERROR_WANT_WRITE: LOG (("SSL: %s -> SSL_ERROR_WANT_WRITE\n", fn)); LOG (("SSL: incomplete, data available for writing\n")); break; case SSL_ERROR_ZERO_RETURN: LOG (("SSL: %s -> SSL_ERROR_ZERO_RETURN\n", fn)); LOG (("SSL: TLS/SSL connection has been closed\n")); break; case SSL_ERROR_WANT_X509_LOOKUP: LOG (("SSL: %s -> SSL_ERROR_WANT_X509_LOOKUP\n", fn)); break; case SSL_ERROR_SYSCALL: LOG (("SSL: %s -> SSL_ERROR_SYSCALL\n", fn)); e = ERR_get_error (); if (e > 0) LOG (("SSL: %s -> %s\n", fn, ERR_error_string (e, NULL))); /* call was not successful because a fatal error occurred either at the * protocol level or a connection failure occurred. */ if (ret != 0) { LOG (("SSL bogus handshake interrupt: \n", strerror (errno))); break; } /* call not yet finished. */ LOG (("SSL: handshake interrupted, got EOF\n")); if (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN) LOG (("SSL: %s -> not yet finished %s\n", fn, strerror (errno))); break; default: LOG (("SSL: %s -> failed fatal error code: %d\n", fn, err)); LOG (("SSL: %s\n", ERR_error_string (ERR_get_error (), NULL))); break; } } /* Shut down the client's TLS/SSL connection * * On fatal error, 1 is returned. * If data still needs to be read/written, -1 is returned. * On success, the TLS/SSL connection is closed and 0 is returned */ static int shutdown_ssl (WSClient * client) { int ret = -1, err = 0; /* all good */ if ((ret = SSL_shutdown (client->ssl)) > 0) return ws_set_status (client, WS_CLOSE, 0); err = SSL_get_error (client->ssl, ret); log_return_message (ret, err, "SSL_shutdown"); switch (err) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: client->sslstatus = WS_TLS_SHUTTING; break; case SSL_ERROR_SYSCALL: if (ret == 0) { LOG (("SSL: SSL_shutdown, connection unexpectedly closed by peer.\n")); /* The shutdown is not yet finished. */ if (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN) client->sslstatus = WS_TLS_SHUTTING; break; } LOG (("SSL: SSL_shutdown, probably unrecoverable, forcing close.\n")); case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_WANT_X509_LOOKUP: default: return ws_set_status (client, WS_ERR | WS_CLOSE, 1); } return ret; } /* Wait for a TLS/SSL client to initiate a TLS/SSL handshake * * On fatal error, the connection is shut down. * If data still needs to be read/written, -1 is returned. * On success, the TLS/SSL connection is completed and 0 is returned */ static int accept_ssl (WSClient * client) { int ret = -1, err = 0; /* all good on TLS handshake */ if ((ret = SSL_accept (client->ssl)) > 0) { client->sslstatus &= ~WS_TLS_ACCEPTING; return 0; } err = SSL_get_error (client->ssl, ret); log_return_message (ret, err, "SSL_accept"); switch (err) { case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: client->sslstatus = WS_TLS_ACCEPTING; break; case SSL_ERROR_SYSCALL: /* Wait for more activity else bail out, for instance if the socket is closed * during the handshake. */ if (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) { client->sslstatus = WS_TLS_ACCEPTING; break; } /* The peer notified that it is shutting down through a SSL "close_notify" so * we shutdown too */ case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_WANT_X509_LOOKUP: default: client->sslstatus &= ~WS_TLS_ACCEPTING; return ws_set_status (client, WS_ERR | WS_CLOSE, 1); } return ret; } /* Create a new SSL structure for a connection and perform handshake */ static void handle_accept_ssl (WSClient * client, WSServer * server) { /* attempt to create SSL connection if we don't have one yet */ if (!client->ssl) { if (!(client->ssl = SSL_new (server->ctx))) { LOG (("SSL: SSL_new, new SSL structure failed.\n")); return; } if (!SSL_set_fd (client->ssl, client->listener)) { LOG (("SSL: unable to set file descriptor\n")); return; } } /* attempt to initiate the TLS/SSL handshake */ if (accept_ssl (client) == 0) { LOG (("SSL Accepted: %d %s\n", client->listener, client->remote_ip)); } } /* Given the current status of the SSL buffer, perform that action. * * On error or if no SSL pending status, 1 is returned. * On success, the TLS/SSL pending action is called and 0 is returned */ static int handle_ssl_pending_rw (int conn, WSServer * server, WSClient * client) { if (!wsconfig.use_ssl) return 1; /* trying to write but still waiting for a successful SSL_accept */ if (client->sslstatus & WS_TLS_ACCEPTING) { handle_accept_ssl (client, server); return 0; } /* trying to read but still waiting for a successful SSL_read */ if (client->sslstatus & WS_TLS_READING) { handle_reads (conn, server); return 0; } /* trying to write but still waiting for a successful SSL_write */ if (client->sslstatus & WS_TLS_WRITING) { handle_writes (conn, server); return 0; } /* trying to write but still waiting for a successful SSL_shutdown */ if (client->sslstatus & WS_TLS_SHUTTING) { if (shutdown_ssl (client) == 0) handle_read_close (conn, client, server); return 0; } return 1; } /* Write bytes to a TLS/SSL connection for a given client. * * On error or if no write is performed <=0 is returned. * On success, the number of bytes actually written to the TLS/SSL * connection are returned */ static int send_ssl_buffer (WSClient * client, const char *buffer, int len) { int bytes = 0, err = 0; #if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_clear_error (); #endif if ((bytes = SSL_write (client->ssl, buffer, len)) > 0) return bytes; err = SSL_get_error (client->ssl, bytes); log_return_message (bytes, err, "SSL_write"); switch (err) { case SSL_ERROR_WANT_WRITE: break; case SSL_ERROR_WANT_READ: client->sslstatus = WS_TLS_WRITING; break; case SSL_ERROR_SYSCALL: if ((bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR))) break; /* The connection was shut down cleanly */ case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_WANT_X509_LOOKUP: default: return ws_set_status (client, WS_ERR | WS_CLOSE, -1); } return bytes; } /* Read data from the given client's socket and set a connection * status given the output of recv(). * * On error, -1 is returned and the connection status is set. * On success, the number of bytes read is returned. */ static int read_ssl_socket (WSClient * client, char *buffer, int size) { int bytes = 0, done = 0, err = 0; do { #if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_clear_error (); #endif done = 0; if ((bytes = SSL_read (client->ssl, buffer, size)) > 0) break; err = SSL_get_error (client->ssl, bytes); log_return_message (bytes, err, "SSL_read"); switch (err) { case SSL_ERROR_WANT_WRITE: client->sslstatus = WS_TLS_READING; done = 1; break; case SSL_ERROR_WANT_READ: done = 1; break; case SSL_ERROR_SYSCALL: if ((bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR))) break; case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_WANT_X509_LOOKUP: default: return ws_set_status (client, WS_ERR | WS_CLOSE, -1); } } while (SSL_pending (client->ssl) && !done); return bytes; } #endif /* Get sockaddr, either IPv4 or IPv6 */ static void * ws_get_raddr (struct sockaddr *sa) { if (sa->sa_family == AF_INET) return &(((struct sockaddr_in *) sa)->sin_addr); return &(((struct sockaddr_in6 *) sa)->sin6_addr); } /* Set the given file descriptor as NON BLOCKING. */ void set_nonblocking (int sock) { if (fcntl (sock, F_SETFL, fcntl (sock, F_GETFL, 0) | O_NONBLOCK) == -1) FATAL ("Unable to set socket as non-blocking: %s.", strerror (errno)); } /* Accept a new connection on a socket and add it to the list of * current connected clients. * * The newly assigned socket is returned. */ static int accept_client (int listener, GSLList ** colist) { WSClient *client; struct sockaddr_storage raddr; int newfd; const void *src = NULL; socklen_t alen; alen = sizeof (raddr); if ((newfd = accept (listener, (struct sockaddr *) &raddr, &alen)) == -1) FATAL ("Unable to set accept: %s.", strerror (errno)); if (newfd == -1) { LOG (("Unable to accept: %s.", strerror (errno))); return newfd; } src = ws_get_raddr ((struct sockaddr *) &raddr); /* malloc a new client */ client = new_wsclient (); client->listener = newfd; inet_ntop (raddr.ss_family, src, client->remote_ip, INET6_ADDRSTRLEN); /* add up our new client to keep track of */ if (*colist == NULL) *colist = list_create (client); else *colist = list_insert_prepend (*colist, client); /* make the socket non-blocking */ set_nonblocking (client->listener); return newfd; } /* Extract the HTTP method. * * On error, or if not found, NULL is returned. * On success, the HTTP method is returned. */ static const char * ws_get_method (const char *token) { const char *lookfor = NULL; if ((lookfor = "GET", !memcmp (token, "GET ", 4)) || (lookfor = "get", !memcmp (token, "get ", 4))) return lookfor; return NULL; } /* Parse a request containing the method and protocol. * * On error, or unable to parse, NULL is returned. * On success, the HTTP request is returned and the method and * protocol are assigned to the corresponding buffers. */ static char * ws_parse_request (char *line, char **method, char **protocol) { const char *meth; char *req = NULL, *request = NULL, *proto = NULL; ptrdiff_t rlen; if ((meth = ws_get_method (line)) == NULL) { return NULL; } else { req = line + strlen (meth); if ((proto = strstr (line, " HTTP/1.0")) == NULL && (proto = strstr (line, " HTTP/1.1")) == NULL) return NULL; req++; if ((rlen = proto - req) <= 0) return NULL; request = xmalloc (rlen + 1); strncpy (request, req, rlen); request[rlen] = 0; (*method) = strtoupper (xstrdup (meth)); (*protocol) = strtoupper (xstrdup (++proto)); } return request; } /* Given a pair of key/values, assign it to our HTTP headers * structure. */ static void ws_set_header_key_value (WSHeaders * headers, char *key, char *value) { if (strcasecmp ("Host", key) == 0) headers->host = xstrdup (value); else if (strcasecmp ("Origin", key) == 0) headers->origin = xstrdup (value); else if (strcasecmp ("Upgrade", key) == 0) headers->upgrade = xstrdup (value); else if (strcasecmp ("Connection", key) == 0) headers->connection = xstrdup (value); else if (strcasecmp ("Sec-WebSocket-Protocol", key) == 0) headers->ws_protocol = xstrdup (value); else if (strcasecmp ("Sec-WebSocket-Key", key) == 0) headers->ws_key = xstrdup (value); else if (strcasecmp ("Sec-WebSocket-Version", key) == 0) headers->ws_sock_ver = xstrdup (value); else if (strcasecmp ("User-Agent", key) == 0) headers->agent = xstrdup (value); else if (strcasecmp ("Referer", key) == 0) headers->referer = xstrdup (value); } /* Verify that the given HTTP headers were passed upon doing the * websocket handshake. * * On error, or header missing, 1 is returned. * On success, 0 is returned. */ static int ws_verify_req_headers (WSHeaders * headers) { if (!headers->host) return 1; if (!headers->method) return 1; if (!headers->protocol) return 1; if (!headers->path) return 1; if (wsconfig.origin && !headers->origin) return 1; if (wsconfig.origin && strcasecmp (wsconfig.origin, headers->origin) != 0) return 1; if (!headers->connection) return 1; if (!headers->ws_key) return 1; if (!headers->ws_sock_ver) return 1; return 0; } /* From RFC2616, each header field consists of a name followed by a * colon (":") and the field value. Field names are case-insensitive. * The field value MAY be preceded by any amount of LWS, though a * single SP is preferred */ static int ws_set_header_fields (char *line, WSHeaders * headers) { char *path = NULL, *method = NULL, *proto = NULL, *p, *value; if (line[0] == '\n' || line[0] == '\r') return 1; if ((strstr (line, "GET ")) || (strstr (line, "get "))) { if ((path = ws_parse_request (line, &method, &proto)) == NULL) return 1; headers->path = path; headers->method = method; headers->protocol = proto; return 0; } if ((p = strchr (line, ':')) == NULL) return 1; value = p + 1; while (p != line && isspace ((unsigned char) *(p - 1))) p--; if (p == line) return 1; *p = '\0'; if (strpbrk (line, " \t") != NULL) { *p = ' '; return 1; } while (isspace ((unsigned char) *value)) value++; ws_set_header_key_value (headers, line, value); return 0; } /* Parse the given HTTP headers and set the expected websocket * handshake. * * On error, or 1 is returned. * On success, 0 is returned. */ static int parse_headers (WSHeaders * headers) { char *tmp = NULL; const char *buffer = headers->buf; const char *line = buffer, *next = NULL; int len = 0; while (line) { if ((next = strstr (line, "\r\n")) != NULL) len = (next - line); else len = strlen (line); if (len <= 0) return 1; tmp = xmalloc (len + 1); memcpy (tmp, line, len); tmp[len] = '\0'; if (ws_set_header_fields (tmp, headers) == 1) { free (tmp); return 1; } free (tmp); line = next ? (next + 2) : NULL; if (strcmp (next, "\r\n\r\n") == 0) break; } return 0; } /* Set into a queue the data that couldn't be sent. */ static void ws_queue_sockbuf (WSClient * client, const char *buffer, int len, int bytes) { WSQueue *queue = xcalloc (1, sizeof (WSQueue)); if (bytes < 1) bytes = 0; queue->queued = xcalloc (len - bytes, sizeof (char)); memcpy (queue->queued, buffer + bytes, len - bytes); queue->qlen = len - bytes; client->sockqueue = queue; client->status |= WS_SENDING; } /* Read data from the given client's socket and set a connection * status given the output of recv(). * * On error, -1 is returned and the connection status is set. * On success, the number of bytes read is returned. */ static int read_plain_socket (WSClient * client, char *buffer, int size) { int bytes = 0; bytes = recv (client->listener, buffer, size, 0); if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) return ws_set_status (client, WS_READING, bytes); else if (bytes == -1 || bytes == 0) return ws_set_status (client, WS_ERR | WS_CLOSE, bytes); return bytes; } /* Read data from the given client's socket and set a connection * status given the output of recv(). * * On error, -1 is returned and the connection status is set. * On success, the number of bytes read is returned. */ static int read_socket (WSClient * client, char *buffer, int size) { #ifdef HAVE_LIBSSL if (wsconfig.use_ssl) return read_ssl_socket (client, buffer, size); else return read_plain_socket (client, buffer, size); #else return read_plain_socket (client, buffer, size); #endif } static int send_plain_buffer (WSClient * client, const char *buffer, int len) { return send (client->listener, buffer, len, 0); } static int send_buffer (WSClient * client, const char *buffer, int len) { #ifdef HAVE_LIBSSL if (wsconfig.use_ssl) return send_ssl_buffer (client, buffer, len); else return send_plain_buffer (client, buffer, len); #else return send_plain_buffer (client, buffer, len); #endif } /* Attmpt to send the given buffer to the given socket. * * On error, -1 is returned and the connection status is set. * On success, the number of bytes sent is returned. */ static int ws_respond_data (WSClient * client, const char *buffer, int len) { int bytes = 0; bytes = send_buffer (client, buffer, len); if (bytes == -1 && errno == EPIPE) return ws_set_status (client, WS_ERR | WS_CLOSE, bytes); /* did not send all of it... buffer it for a later attempt */ if (bytes < len || (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))) ws_queue_sockbuf (client, buffer, len, bytes); return bytes; } /* Attempt to send the queued up client's data to the given socket. * * On error, -1 is returned and the connection status is set. * On success, the number of bytes sent is returned. */ static int ws_respond_cache (WSClient * client) { WSQueue *queue = client->sockqueue; int bytes = 0; bytes = send_buffer (client, queue->queued, queue->qlen); if (bytes == -1 && errno == EPIPE) return ws_set_status (client, WS_ERR | WS_CLOSE, bytes); if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) return bytes; if (chop_nchars (queue->queued, bytes, queue->qlen) == 0) ws_clear_queue (client); else queue->qlen -= bytes; return bytes; } /* Attempt to realloc the current sent queue. * * On error, 1 is returned and the connection status is set. * On success, 0 is returned. */ static int ws_realloc_send_buf (WSClient * client, const char *buf, int len) { WSQueue *queue = client->sockqueue; char *tmp = NULL; int newlen = 0; newlen = queue->qlen + len; tmp = realloc (queue->queued, newlen); if (tmp == NULL && newlen > 0) { ws_clear_queue (client); return ws_set_status (client, WS_ERR | WS_CLOSE, 1); } queue->queued = tmp; memcpy (queue->queued + queue->qlen, buf, len); queue->qlen += len; /* client probably too slow, so stop queueing until everything is * sent */ if (queue->qlen >= WS_THROTTLE_THLD) client->status |= WS_THROTTLING; return 0; } /* An entry point to attempt to send the client's data. * * On error, 1 is returned and the connection status is set. * On success, the number of bytes sent is returned. */ static int ws_respond (WSClient * client, const char *buffer, int len) { int bytes = 0; /* attempt to send the whole buffer buffer */ if (client->sockqueue == NULL) bytes = ws_respond_data (client, buffer, len); /* buffer not empty, just append new data iff we're not throttling the * client */ else if (client->sockqueue != NULL && buffer != NULL && !(client->status & WS_THROTTLING)) { if (ws_realloc_send_buf (client, buffer, len) == 1) return bytes; } /* send from cache buffer */ else { bytes = ws_respond_cache (client); } return bytes; } /* Encode a websocket frame (header/message) and attempt to send it * through the client's socket. * * On success, 0 is returned. */ static int ws_send_frame (WSClient * client, WSOpcode opcode, const char *p, int sz) { unsigned char buf[32] = { 0 }; char *frm = NULL; uint64_t payloadlen = 0, u64; int hsize = 2; if (sz < 126) { payloadlen = sz; } else if (sz < (1 << 16)) { payloadlen = WS_PAYLOAD_EXT16; hsize += 2; } else { payloadlen = WS_PAYLOAD_EXT64; hsize += 8; } buf[0] = 0x80 | ((uint8_t) opcode); switch (payloadlen) { case WS_PAYLOAD_EXT16: buf[1] = WS_PAYLOAD_EXT16; buf[2] = (sz & 0xff00) >> 8; buf[3] = (sz & 0x00ff) >> 0; break; case WS_PAYLOAD_EXT64: buf[1] = WS_PAYLOAD_EXT64; u64 = htobe64 (sz); memcpy (buf + 2, &u64, sizeof (uint64_t)); break; default: buf[1] = (sz & 0xff); } frm = xcalloc (hsize + sz, sizeof (unsigned char)); memcpy (frm, buf, hsize); if (p != NULL && sz > 0) memcpy (frm + hsize, p, sz); ws_respond (client, frm, hsize + sz); free (frm); return 0; } /* Send an error message to the given client. * * On success, the number of sent bytes is returned. */ static int ws_error (WSClient * client, unsigned short code, const char *err) { unsigned int len; unsigned short code_be; char buf[128] = { 0 }; len = 2; code_be = htobe16 (code); memcpy (buf, &code_be, 2); if (err) len += snprintf (buf + 2, sizeof buf - 4, "%s", err); return ws_send_frame (client, WS_OPCODE_CLOSE, buf, len); } /* Log hit to the access log. * * On success, the hit/entry is logged. */ static void access_log (WSClient * client, int status_code) { WSHeaders *hdrs = client->headers; char buf[64] = { 0 }; uint32_t elapsed = 0; struct timeval tv; char *req = NULL, *ref = NULL, *ua = NULL; gettimeofday (&tv, NULL); strftime (buf, sizeof (buf) - 1, "[%d/%b/%Y:%H:%M:%S %z]", localtime (&tv.tv_sec)); elapsed = (client->end_proc.tv_sec - client->start_proc.tv_sec) * 1000.0; elapsed += (client->end_proc.tv_usec - client->start_proc.tv_usec) / 1000.0; req = escape_http_request (hdrs->path); ref = escape_http_request (hdrs->referer); ua = escape_http_request (hdrs->agent); ACCESS_LOG (("%s ", client->remote_ip)); ACCESS_LOG (("- - ")); ACCESS_LOG (("%s ", buf)); ACCESS_LOG (("\"%s ", hdrs->method)); ACCESS_LOG (("%s ", req ? req : "-")); ACCESS_LOG (("%s\" ", hdrs->protocol)); ACCESS_LOG (("%d ", status_code)); ACCESS_LOG (("%d ", hdrs->buflen)); ACCESS_LOG (("\"%s\" ", ref ? ref : "-")); ACCESS_LOG (("\"%s\" ", ua ? ua : "-")); ACCESS_LOG (("%zu\n", elapsed)); if (req) free (req); if (ref) free (ref); if (ua) free (ua); } /* Send an HTTP error status to the given client. * * On success, the number of sent bytes is returned. */ static int http_error (WSClient * client, const char *buffer) { /* do access logging */ gettimeofday (&client->end_proc, NULL); if (wsconfig.accesslog) access_log (client, 400); return ws_respond (client, buffer, strlen (buffer)); } /* Compute the SHA1 for the handshake. */ static void ws_sha1_digest (const char *s, int len, unsigned char *digest) { SHA1_CTX sha; SHA1Init (&sha); SHA1Update (&sha, (uint8_t *) s, len); SHA1Final (digest, &sha); } /* Set the parsed websocket handshake headers. */ static void ws_set_handshake_headers (WSHeaders * headers) { size_t klen = strlen (headers->ws_key); size_t mlen = strlen (WS_MAGIC_STR); size_t len = klen + mlen; char *s = xmalloc (klen + mlen + 1); uint8_t digest[SHA_DIGEST_LENGTH]; memset (digest, 0, sizeof *digest); memcpy (s, headers->ws_key, klen); memcpy (s + klen, WS_MAGIC_STR, mlen + 1); ws_sha1_digest (s, len, digest); /* set response headers */ headers->ws_accept = base64_encode ((unsigned char *) digest, sizeof (digest)); headers->ws_resp = xstrdup (WS_SWITCH_PROTO_STR); if (!headers->upgrade) headers->upgrade = xstrdup ("websocket"); if (!headers->connection) headers->upgrade = xstrdup ("Upgrade"); free (s); } /* Send the websocket handshake headers to the given client. * * On success, the number of sent bytes is returned. */ static int ws_send_handshake_headers (WSClient * client, WSHeaders * headers) { int bytes = 0; char *str = xstrdup (""); ws_append_str (&str, headers->ws_resp); ws_append_str (&str, CRLF); ws_append_str (&str, "Upgrade: "); ws_append_str (&str, headers->upgrade); ws_append_str (&str, CRLF); ws_append_str (&str, "Connection: "); ws_append_str (&str, headers->connection); ws_append_str (&str, CRLF); ws_append_str (&str, "Sec-WebSocket-Accept: "); ws_append_str (&str, headers->ws_accept); ws_append_str (&str, CRLF CRLF); bytes = ws_respond (client, str, strlen (str)); free (str); return bytes; } /* Given the HTTP connection headers, attempt to parse the web socket * handshake headers. * * On success, the number of sent bytes is returned. */ static int ws_get_handshake (WSClient * client, WSServer * server) { int bytes = 0, readh = 0; char *buf = NULL; if (client->headers == NULL) client->headers = new_wsheader (); buf = client->headers->buf; readh = client->headers->buflen; /* Probably the connection was closed before finishing handshake */ if ((bytes = read_socket (client, buf + readh, BUFSIZ - readh)) < 1) { if (client->status & WS_CLOSE) http_error (client, WS_BAD_REQUEST_STR); return bytes; } client->headers->buflen += bytes; buf[client->headers->buflen] = '\0'; /* null-terminate */ /* Must have a \r\n\r\n */ if (strstr (buf, "\r\n\r\n") == NULL) { if (strlen (buf) < BUFSIZ) return ws_set_status (client, WS_READING, bytes); http_error (client, WS_BAD_REQUEST_STR); return ws_set_status (client, WS_CLOSE, bytes); } /* Ensure we have valid HTTP headers for the handshake */ if (parse_headers (client->headers) != 0) { http_error (client, WS_BAD_REQUEST_STR); return ws_set_status (client, WS_CLOSE, bytes); } /* Ensure we have the required headers */ if (ws_verify_req_headers (client->headers) != 0) { http_error (client, WS_BAD_REQUEST_STR); return ws_set_status (client, WS_CLOSE, bytes); } ws_set_handshake_headers (client->headers); /* handshake response */ ws_send_handshake_headers (client, client->headers); /* upon success, call onopen() callback */ if (server->onopen && wsconfig.strict && !wsconfig.echomode) server->onopen (server->pipeout, client); client->headers->reading = 0; /* do access logging */ gettimeofday (&client->end_proc, NULL); if (wsconfig.accesslog) access_log (client, 101); LOG (("Active: %d\n", list_count (server->colist))); return ws_set_status (client, WS_OK, bytes); } /* Send a data message to the given client. * * On success, 0 is returned. */ int ws_send_data (WSClient * client, WSOpcode opcode, const char *p, int sz) { char *buf = NULL; buf = sanitize_utf8 (p, sz); ws_send_frame (client, opcode, buf, sz); free (buf); return 0; } /* Read a websocket frame's header. * * On success, the number of bytesr read is returned. */ static int ws_read_header (WSClient * client, WSFrame * frm, int pos, int need) { char *buf = frm->buf; int bytes = 0; /* read the first 2 bytes for basic frame info */ if ((bytes = read_socket (client, buf + pos, need)) < 1) { if (client->status & WS_CLOSE) ws_error (client, WS_CLOSE_UNEXPECTED, "Unable to read header"); return bytes; } frm->buflen += bytes; frm->buf[frm->buflen] = '\0'; /* null-terminate */ return bytes; } /* Read a websocket frame's payload. * * On success, the number of bytesr read is returned. */ static int ws_read_payload (WSClient * client, WSMessage * msg, int pos, int need) { char *buf = msg->payload; int bytes = 0; /* read the first 2 bytes for basic frame info */ if ((bytes = read_socket (client, buf + pos, need)) < 1) { if (client->status & WS_CLOSE) ws_error (client, WS_CLOSE_UNEXPECTED, "Unable to read payload"); return bytes; } msg->buflen += bytes; msg->payloadsz += bytes; return bytes; } /* Set the basic frame headers on a frame structure. * * On success, 0 is returned. */ static int ws_set_front_header_fields (WSClient * client) { WSFrame **frm = &client->frame; char *buf = (*frm)->buf; (*frm)->fin = WS_FRM_FIN (*(buf)); (*frm)->masking = WS_FRM_MASK (*(buf + 1)); (*frm)->opcode = WS_FRM_OPCODE (*(buf)); (*frm)->res = WS_FRM_R1 (*(buf)) || WS_FRM_R2 (*(buf)) || WS_FRM_R3 (*(buf)); /* should be masked and can't be using RESVd bits */ if (!(*frm)->masking || (*frm)->res) return ws_set_status (client, WS_ERR | WS_CLOSE, 1); return 0; } /* Unmask the payload given the current frame's masking key. */ static void ws_unmask_payload (char *buf, int len, int offset, unsigned char mask[]) { int i, j = 0; /* unmask data */ for (i = offset; i < len; ++i, ++j) { buf[i] ^= mask[j % 4]; } } /* Close a websocket connection. */ static int ws_handle_close (WSClient * client) { client->status = WS_ERR | WS_CLOSE; return ws_send_frame (client, WS_OPCODE_CLOSE, NULL, 0); } /* Handle a websocket error. * * On success, the number of bytes sent is returned. */ static int ws_handle_err (WSClient * client, unsigned short code, WSStatus status, const char *m) { client->status = status; return ws_error (client, code, m); } /* Handle a websocket pong. */ static void ws_handle_pong (WSClient * client) { WSFrame **frm = &client->frame; if (!(*frm)->fin) { ws_handle_err (client, WS_CLOSE_PROTO_ERR, WS_ERR | WS_CLOSE, NULL); return; } ws_free_message (client); } /* Handle a websocket ping from the client and it attempts to send * back a pong as soon as possible. */ static void ws_handle_ping (WSClient * client) { WSFrame **frm = &client->frame; WSMessage **msg = &client->message; char *buf = NULL, *tmp = NULL; int pos = 0, len = (*frm)->payloadlen, newlen = 0; /* RFC states that Control frames themselves MUST NOT be * fragmented. */ if (!(*frm)->fin) { ws_handle_err (client, WS_CLOSE_PROTO_ERR, WS_ERR | WS_CLOSE, NULL); return; } /* Control frames are only allowed to have payload up to and * including 125 octets */ if ((*frm)->payloadlen > 125) { ws_handle_err (client, WS_CLOSE_PROTO_ERR, WS_ERR | WS_CLOSE, NULL); return; } /* No payload from ping */ if (len == 0) { ws_send_frame (client, WS_OPCODE_PONG, NULL, 0); return; } /* Copy the ping payload */ pos = (*msg)->payloadsz - len; buf = xcalloc (len, sizeof (char)); memcpy (buf, (*msg)->payload + pos, len); /* Unmask it */ ws_unmask_payload (buf, len, 0, (*frm)->mask); /* Resize the current payload (keep an eye on this realloc) */ newlen = (*msg)->payloadsz - len; tmp = realloc ((*msg)->payload, newlen); if (tmp == NULL && newlen > 0) { free ((*msg)->payload); free (buf); (*msg)->payload = NULL; client->status = WS_ERR | WS_CLOSE; return; } (*msg)->payload = tmp; (*msg)->payloadsz -= len; ws_send_frame (client, WS_OPCODE_PONG, buf, len); (*msg)->buflen = 0; /* done with the current frame's payload */ /* Control frame injected in the middle of a fragmented message. */ if (!(*msg)->fragmented) { ws_free_message (client); } free (buf); } /* Ensure we have valid UTF-8 text payload. * * On error, or if the message is invalid, 1 is returned. * On success, or if the message is valid, 0 is returned. */ int ws_validate_string (const char *str, int len) { uint32_t state = UTF8_VALID; if (verify_utf8 (&state, str, len) == UTF8_INVAL) { LOG (("Invalid UTF8 data!\n")); return 1; } if (state != UTF8_VALID) { LOG (("Invalid UTF8 data!\n")); return 1; } return 0; } /* It handles a text or binary message frame from the client. */ static void ws_handle_text_bin (WSClient * client, WSServer * server) { WSFrame **frm = &client->frame; WSMessage **msg = &client->message; int offset = (*msg)->mask_offset; /* All data frames after the initial data frame must have opcode 0 */ if ((*msg)->fragmented && (*frm)->opcode != WS_OPCODE_CONTINUATION) { client->status = WS_ERR | WS_CLOSE; return; } /* RFC states that there is a new masking key per frame, therefore, * time to unmask... */ ws_unmask_payload ((*msg)->payload, (*msg)->payloadsz, offset, (*frm)->mask); /* Done with the current frame's payload */ (*msg)->buflen = 0; /* Reading a fragmented frame */ (*msg)->fragmented = 1; if (!(*frm)->fin) return; /* validate text data encoded as UTF-8 */ if ((*msg)->opcode == WS_OPCODE_TEXT) { if (ws_validate_string ((*msg)->payload, (*msg)->payloadsz) != 0) { ws_handle_err (client, WS_CLOSE_INVALID_UTF8, WS_ERR | WS_CLOSE, NULL); return; } } if ((*msg)->opcode != WS_OPCODE_CONTINUATION && server->onmessage) { /* just echo the message to the client */ if (wsconfig.echomode) ws_send_data (client, (*msg)->opcode, (*msg)->payload, (*msg)->payloadsz); /* just pipe out the message */ else if (!wsconfig.strict) ws_write_fifo (server->pipeout, (*msg)->payload, (*msg)->payloadsz); else server->onmessage (server->pipeout, client); } ws_free_message (client); } /* Depending on the frame opcode, then we take certain decisions. */ static void ws_manage_payload_opcode (WSClient * client, WSServer * server) { WSFrame **frm = &client->frame; WSMessage **msg = &client->message; switch ((*frm)->opcode) { case WS_OPCODE_CONTINUATION: LOG (("CONTINUATION\n")); /* first frame can't be a continuation frame */ if (!(*msg)->fragmented) { client->status = WS_ERR | WS_CLOSE; break; } ws_handle_text_bin (client, server); break; case WS_OPCODE_TEXT: case WS_OPCODE_BIN: LOG (("TEXT\n")); client->message->opcode = (*frm)->opcode; ws_handle_text_bin (client, server); break; case WS_OPCODE_PONG: LOG (("PONG\n")); ws_handle_pong (client); break; case WS_OPCODE_PING: LOG (("PING\n")); ws_handle_ping (client); break; default: LOG (("CLOSE\n")); ws_handle_close (client); } } /* Set the extended payload length into the given pointer. */ static void ws_set_extended_header_size (const char *buf, int *extended) { uint64_t payloadlen = 0; /* determine the payload length, else read more data */ payloadlen = WS_FRM_PAYLOAD (*(buf + 1)); switch (payloadlen) { case WS_PAYLOAD_EXT16: *extended = 2; break; case WS_PAYLOAD_EXT64: *extended = 8; break; } } /* Set the extended payload length into our frame structure. */ static void ws_set_payloadlen (WSFrame * frm, const char *buf) { uint64_t payloadlen = 0, len64; uint16_t len16; /* determine the payload length, else read more data */ payloadlen = WS_FRM_PAYLOAD (*(buf + 1)); switch (payloadlen) { case WS_PAYLOAD_EXT16: memcpy (&len16, (buf + 2), sizeof (uint16_t)); frm->payloadlen = ntohs (len16); break; case WS_PAYLOAD_EXT64: memcpy (&len64, (buf + 2), sizeof (uint64_t)); frm->payloadlen = be64toh (len64); break; default: frm->payloadlen = payloadlen; } } /* Set the masking key into our frame structure. */ static void ws_set_masking_key (WSFrame * frm, const char *buf) { uint64_t payloadlen = 0; /* determine the payload length, else read more data */ payloadlen = WS_FRM_PAYLOAD (*(buf + 1)); switch (payloadlen) { case WS_PAYLOAD_EXT16: memcpy (&frm->mask, buf + 4, sizeof (frm->mask)); break; case WS_PAYLOAD_EXT64: memcpy (&frm->mask, buf + 10, sizeof (frm->mask)); break; default: memcpy (&frm->mask, buf + 2, sizeof (frm->mask)); } } /* Attempt to read the frame's header and set the relavant data into * our frame structure. * * On error, or if no data available to read, the number of bytes is * returned and the appropriate connection status is set. * On success, the number of bytes is returned. */ static int ws_get_frm_header (WSClient * client) { WSFrame **frm = NULL; int bytes = 0, readh = 0, need = 0, offset = 0, extended = 0; if (client->frame == NULL) client->frame = new_wsframe (); frm = &client->frame; /* Read the first 2 bytes for basic frame info */ readh = (*frm)->buflen; /* read from header so far */ need = 2 - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_header (client, (*frm), readh, need)) < 1) return bytes; if (bytes != need) return ws_set_status (client, WS_READING, bytes); } offset += 2; if (ws_set_front_header_fields (client) != 0) return bytes; ws_set_extended_header_size ((*frm)->buf, &extended); /* read the extended header */ readh = (*frm)->buflen; /* read from header so far */ need = (extended + offset) - readh; /* read from header field so far */ if (need > 0) { if ((bytes = ws_read_header (client, (*frm), readh, need)) < 1) return bytes; if (bytes != need) return ws_set_status (client, WS_READING, bytes); } offset += extended; /* read the masking key */ readh = (*frm)->buflen; /* read from header so far */ need = (4 + offset) - readh; if (need > 0) { if ((bytes = ws_read_header (client, (*frm), readh, need)) < 1) return bytes; if (bytes != need) return ws_set_status (client, WS_READING, bytes); } offset += 4; ws_set_payloadlen ((*frm), (*frm)->buf); ws_set_masking_key ((*frm), (*frm)->buf); if ((*frm)->payloadlen > wsconfig.max_frm_size) { ws_error (client, WS_CLOSE_TOO_LARGE, "Frame is too big"); return ws_set_status (client, WS_ERR | WS_CLOSE, bytes); } (*frm)->buflen = 0; (*frm)->reading = 0; (*frm)->payload_offset = offset; return ws_set_status (client, WS_OK, bytes); } /* Attempt to realloc the message payload. * * On error, 1 is returned. * On success, 0 is returned. */ static int ws_realloc_frm_payload (WSFrame * frm, WSMessage * msg) { char *tmp = NULL; uint64_t newlen = 0; newlen = msg->payloadsz + frm->payloadlen; tmp = realloc (msg->payload, newlen); if (tmp == NULL && newlen > 0) { free (msg->payload); msg->payload = NULL; return 1; } msg->payload = tmp; return 0; } /* Attempt to read the frame's payload and set the relavant data into * our message structure. * * On error, or if no data available to read, the number of bytes is * returned and the appropriate connection status is set. * On success, the number of bytes is returned. */ static int ws_get_frm_payload (WSClient * client, WSServer * server) { WSFrame **frm = NULL; WSMessage **msg = NULL; int bytes = 0, readh = 0, need = 0; if (client->message == NULL) client->message = new_wsmessage (); frm = &client->frame; msg = &client->message; /* message within the same frame */ if ((*msg)->payload == NULL && (*frm)->payloadlen) (*msg)->payload = xcalloc ((*frm)->payloadlen, sizeof (char)); /* handle a new frame */ else if ((*msg)->buflen == 0 && (*frm)->payloadlen) { if (ws_realloc_frm_payload ((*frm), (*msg)) == 1) return ws_set_status (client, WS_ERR | WS_CLOSE, 0); } readh = (*msg)->buflen; /* read from so far */ need = (*frm)->payloadlen - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_payload (client, (*msg), (*msg)->payloadsz, need)) < 0) return bytes; if (bytes != need) return ws_set_status (client, WS_READING, bytes); } (*msg)->mask_offset = (*msg)->payloadsz - (*msg)->buflen; ws_manage_payload_opcode (client, server); ws_free_frame (client); return bytes; } /* Determine if we need to read a frame's header or its payload. * * On success, the number of bytes is returned. */ static int ws_get_message (WSClient * client, WSServer * server) { int bytes = 0; if ((client->frame == NULL) || (client->frame->reading)) if ((bytes = ws_get_frm_header (client)) < 1 || client->frame->reading) return bytes; return ws_get_frm_payload (client, server); } /* Determine if we need to read an HTTP request or a websocket frame. * * On success, the number of bytes is returned. */ static int read_client_data (WSClient * client, WSServer * server) { int bytes = 0; /* Handshake */ if ((!(client->headers) || (client->headers->reading))) bytes = ws_get_handshake (client, server); /* Message */ else bytes = ws_get_message (client, server); return bytes; } /* Handle a tcp close connection. */ static void handle_tcp_close (int conn, WSClient * client, WSServer * server) { #ifdef HAVE_LIBSSL if (client->ssl) shutdown_ssl (client); #endif shutdown (conn, SHUT_RDWR); /* upon close, call onclose() callback */ if (server->onclose && wsconfig.strict && !wsconfig.echomode) (*server->onclose) (server->pipeout, client); /* do access logging */ gettimeofday (&client->end_proc, NULL); if (wsconfig.accesslog) access_log (client, 200); /* errored out while parsing a frame or a message */ if (client->status & WS_ERR) { ws_clear_queue (client); ws_free_frame (client); ws_free_message (client); } server->closing = 0; ws_close (conn); #ifdef HAVE_LIBSSL if (client->ssl) SSL_free (client->ssl); client->ssl = NULL; #endif /* remove client from our list */ ws_remove_client_from_list (client, server); LOG (("Active: %d\n", list_count (server->colist))); } /* Handle a tcp read close connection. */ static void handle_read_close (int conn, WSClient * client, WSServer * server) { if (client->status & WS_SENDING) { server->closing = 1; return; } handle_tcp_close (conn, client, server); } /* Handle a new socket connection. */ static void handle_accept (int listener, WSServer * server) { WSClient *client = NULL; int newfd; newfd = accept_client (listener, &server->colist); if (newfd == -1) return; client = ws_get_client_from_list (newfd, &server->colist); if (newfd > FD_SETSIZE - 1) { LOG (("Too busy: %d %s.\n", newfd, client->remote_ip)); http_error (client, WS_TOO_BUSY_STR); handle_read_close (newfd, client, server); return; } #ifdef HAVE_LIBSSL /* set flag to do TLS handshake */ if (wsconfig.use_ssl) client->sslstatus |= WS_TLS_ACCEPTING; #endif LOG (("Accepted: %d %s\n", newfd, client->remote_ip)); } /* Handle a tcp read. */ static void handle_reads (int conn, WSServer * server) { WSClient *client = NULL; if (!(client = ws_get_client_from_list (conn, &server->colist))) return; #ifdef HAVE_LIBSSL if (handle_ssl_pending_rw (conn, server, client) == 0) return; #endif /* *INDENT-OFF* */ client->start_proc = client->end_proc = (struct timeval) {0}; /* *INDENT-ON* */ gettimeofday (&client->start_proc, NULL); read_client_data (client, server); /* An error ocurred while reading data or connection closed */ if ((client->status & WS_CLOSE)) { handle_read_close (conn, client, server); } } /* Handle a tcp write close connection. */ static void handle_write_close (int conn, WSClient * client, WSServer * server) { handle_tcp_close (conn, client, server); } /* Handle a tcp write. */ static void handle_writes (int conn, WSServer * server) { WSClient *client = NULL; if (!(client = ws_get_client_from_list (conn, &server->colist))) return; #ifdef HAVE_LIBSSL if (handle_ssl_pending_rw (conn, server, client) == 0) return; #endif ws_respond (client, NULL, 0); /* buffered data */ /* done sending data */ if (client->sockqueue == NULL) client->status &= ~WS_SENDING; /* An error ocurred while sending data or while reading data but still * waiting from the last send() from the server to the client. e.g., * sending status code */ if ((client->status & WS_CLOSE) && !(client->status & WS_SENDING)) handle_write_close (conn, client, server); } /* Handle reads/writes on a TCP connection. */ static void ws_listen (int listener, int conn, WSServer * server) { /* handle new connections */ if (FD_ISSET (conn, &fdstate.rfds) && conn == listener) handle_accept (listener, server); /* handle data from a client */ else if (FD_ISSET (conn, &fdstate.rfds) && conn != listener) handle_reads (conn, server); /* handle sending data to a client */ else if (FD_ISSET (conn, &fdstate.wfds) && conn != listener) handle_writes (conn, server); } /* Create named pipe (FIFO) with the given pipe name. * * On error, 1 is returned. * On success, 0 is returned. */ int ws_setfifo (const char *pipename) { struct stat fistat; const char *f = pipename; if (access (f, F_OK) == 0) return 0; if (mkfifo (f, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) < 0) FATAL ("Unable to set fifo: %s.", strerror (errno)); if (stat (f, &fistat) < 0) FATAL ("Unable to stat fifo: %s.", strerror (errno)); if (!S_ISFIFO (fistat.st_mode)) FATAL ("pipe is not a fifo: %s.", strerror (errno)); return 0; } /* Open a named pipe (FIFO) for input to the server (reader). */ static int ws_openfifo_in (WSPipeIn * pipein) { ws_setfifo (wsconfig.pipein); /* we should be able to open it at as reader */ if ((pipein->fd = open (wsconfig.pipein, O_RDWR | O_NONBLOCK)) < 0) FATAL ("Unable to open fifo in: %s.", strerror (errno)); return pipein->fd; } /* Open a named pipe (FIFO) for output from the server (writer). */ static int ws_openfifo_out (WSPipeOut * pipeout) { int status = 0; ws_setfifo (wsconfig.pipeout); status = open (wsconfig.pipeout, O_WRONLY | O_NONBLOCK); /* will attempt on the next write */ if (status == -1 && errno == ENXIO) LOG (("Unable to open fifo out: %s.\n", strerror (errno))); else if (status < 0) FATAL ("Unable to open fifo out: %s.", strerror (errno)); pipeout->fd = status; if (status != -1 && status > max_file_fd) max_file_fd = status; return status; } /* Set a new named pipe for incoming messages and one for outgoing * messages from the client. */ static void ws_fifo (WSServer * server) { wsconfig.pipein = wsconfig.pipein ? wsconfig.pipein : WS_PIPEIN; wsconfig.pipeout = wsconfig.pipeout ? wsconfig.pipeout : WS_PIPEOUT; ws_openfifo_in (server->pipein); ws_openfifo_out (server->pipeout); } /* Clear the queue for an outgoing named pipe. */ static void clear_fifo_queue (WSPipeOut * pipeout) { WSQueue **queue = &pipeout->fifoqueue; if (!(*queue)) return; if ((*queue)->queued) free ((*queue)->queued); (*queue)->queued = NULL; (*queue)->qlen = 0; free ((*queue)); (*queue) = NULL; } /* Attempt to realloc the current sent queue for an outgoing named pip * (FIFO). * * On error, 1 is returned and the connection status is closed and * reopened. * On success, 0 is returned. */ static int ws_realloc_fifobuf (WSPipeOut * pipeout, const char *buf, int len) { WSQueue *queue = pipeout->fifoqueue; char *tmp = NULL; int newlen = 0; newlen = queue->qlen + len; tmp = realloc (queue->queued, newlen); if (tmp == NULL && newlen > 0) { close (pipeout->fd); clear_fifo_queue (pipeout); ws_openfifo_out (pipeout); return 1; } queue->queued = tmp; memcpy (queue->queued + queue->qlen, buf, len); queue->qlen += len; return 0; } /* Set into a queue the data that couldn't be sent in the outgoing * FIFO. */ static void ws_queue_fifobuf (WSPipeOut * pipeout, const char *buffer, int len, int bytes) { WSQueue **queue = &pipeout->fifoqueue; if (bytes < 1) bytes = 0; (*queue) = xcalloc (1, sizeof (WSQueue)); (*queue)->queued = xcalloc (len - bytes, sizeof (char)); memcpy ((*queue)->queued, buffer + bytes, len - bytes); (*queue)->qlen = len - bytes; pipeout->status |= WS_SENDING; } /* Attmpt to send the given buffer to the given outgoing FIFO. * * On error, the data is queued up. * On success, the number of bytes sent is returned. */ static int ws_write_fifo_data (WSPipeOut * pipeout, char *buffer, int len) { int bytes = 0; bytes = write (pipeout->fd, buffer, len); /* At this point, the reader probably closed the pipe, so a cheap *hack* for * this is to close the pipe on our end and attempt to reopen it. If unable to * do so, then let it be -1 and try on the next attempt to write. */ if (bytes == -1 && errno == EPIPE) { close (pipeout->fd); ws_openfifo_out (pipeout); return bytes; } if (bytes < len || (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))) ws_queue_fifobuf (pipeout, buffer, len, bytes); return bytes; } /* Attempt to send the queued up client's data through the outgoing * named pipe (FIFO) . * * On error, 1 is returned and the connection status is set. * On success, the number of bytes sent is returned. */ static int ws_write_fifo_cache (WSPipeOut * pipeout) { WSQueue *queue = pipeout->fifoqueue; int bytes = 0; bytes = write (pipeout->fd, queue->queued, queue->qlen); /* At this point, the reader probably closed the pipe, so a cheap *hack* for * this is to close the pipe on our end and attempt to reopen it. If unable to * do so, then let it be -1 and try on the next attempt to write. */ if (bytes == -1 && errno == EPIPE) { close (pipeout->fd); ws_openfifo_out (pipeout); return bytes; } if (chop_nchars (queue->queued, bytes, queue->qlen) == 0) clear_fifo_queue (pipeout); else queue->qlen -= bytes; return bytes; } /* An entry point to attempt to send the client's data into an * outgoing named pipe (FIFO). * * On success, the number of bytes sent is returned. */ int ws_write_fifo (WSPipeOut * pipeout, char *buffer, int len) { int bytes = 0; if (pipeout->fd == -1 && ws_openfifo_out (pipeout) == -1) return bytes; /* attempt to send the whole buffer buffer */ if (pipeout->fifoqueue == NULL) bytes = ws_write_fifo_data (pipeout, buffer, len); /* buffer not empty, just append new data */ else if (pipeout->fifoqueue != NULL && buffer != NULL) { if (ws_realloc_fifobuf (pipeout, buffer, len) == 1) return bytes; } /* send from cache buffer */ else { bytes = ws_write_fifo_cache (pipeout); } if (pipeout->fifoqueue == NULL) pipeout->status &= ~WS_SENDING; return bytes; } /* Clear an incoming FIFO packet and header data. */ static void clear_fifo_packet (WSPipeIn * pipein) { memset (pipein->hdr, 0, sizeof (pipein->hdr)); pipein->hlen = 0; if (pipein->packet == NULL) return; if (pipein->packet->data) free (pipein->packet->data); free (pipein->packet); pipein->packet = NULL; } /* Broadcast to all connected clients the given message. */ static int ws_broadcast_fifo (void *value, void *user_data) { WSClient *client = value; WSPacket *packet = user_data; if (client == NULL || user_data == NULL) return 1; /* no handshake for this client */ if (client->headers == NULL || client->headers->ws_accept == NULL) return 1; ws_send_data (client, packet->type, packet->data, packet->size); return 0; } /* Send a message from the incoming named pipe to specific client * given the socket id. */ static void ws_send_strict_fifo_to_client (WSServer * server, int listener, WSPacket * pa) { WSClient *client = NULL; if (!(client = ws_get_client_from_list (listener, &server->colist))) return; /* no handshake for this client */ if (client->headers == NULL || client->headers->ws_accept == NULL) return; ws_send_data (client, pa->type, pa->data, pa->len); } /* Attempt to read message from a named pipe (FIFO). * * On error, -1 is returned. * On success, the number of bytes read is returned. */ int ws_read_fifo (int fd, char *buf, int *buflen, int pos, int need) { int bytes = 0; bytes = read (fd, buf + pos, need); if (bytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) return bytes; else if (bytes == -1) return bytes; *buflen += bytes; return bytes; } /* Pack the given value into a network byte order. * * On success, the number size of uint32_t is returned. */ size_t pack_uint32 (void *buf, uint32_t val) { uint32_t v32 = htonl (val); memcpy (buf, &v32, sizeof (uint32_t)); return sizeof (uint32_t); } /* Unpack the given value into a host byte order. * * On success, the number size of uint32_t is returned. */ size_t unpack_uint32 (const void *buf, uint32_t * val) { uint32_t v32 = 0; memcpy (&v32, buf, sizeof (uint32_t)); *val = ntohl (v32); return sizeof (uint32_t); } /* Ensure the fields coming from the named pipe are valid. * * On error, 1 is returned. * On success, 0 is returned. */ static int validate_fifo_packet (uint32_t listener, uint32_t type, int size) { if (listener > FD_SETSIZE) { LOG (("Invalid listener\n")); return 1; } if (type != WS_OPCODE_TEXT && type != WS_OPCODE_BIN) { LOG (("Invalid fifo packet type\n")); return 1; } if (size > wsconfig.max_frm_size) { LOG (("Invalid fifo packet size\n")); return 1; } return 0; } /* Handle reading and sending the incoming data from the named pipe on * strict mode. */ static void handle_strict_fifo (WSServer * server) { WSPipeIn *pi = server->pipein; WSPacket **pa = &pi->packet; int bytes = 0, readh = 0, need = 0; char *ptr = NULL; uint32_t listener = 0, type = 0, size = 0; readh = pi->hlen; /* read from header so far */ need = HDR_SIZE - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_fifo (pi->fd, pi->hdr, &pi->hlen, readh, need)) < 0) return; if (bytes != need) return; } /* unpack size, and type */ ptr = pi->hdr; ptr += unpack_uint32 (ptr, &listener); ptr += unpack_uint32 (ptr, &type); ptr += unpack_uint32 (ptr, &size); if (validate_fifo_packet (listener, type, size) == 1) { close (pi->fd); clear_fifo_packet (pi); ws_openfifo_in (pi); return; } if ((*pa) == NULL) { (*pa) = xcalloc (1, sizeof (WSPacket)); (*pa)->type = type; (*pa)->size = size; (*pa)->data = xcalloc (size, sizeof (char)); } readh = (*pa)->len; /* read from payload so far */ need = (*pa)->size - readh; /* need to read */ if (need > 0) { if ((bytes = ws_read_fifo (pi->fd, (*pa)->data, &(*pa)->len, readh, need)) < 0) return; if (bytes != need) return; } /* no clients to send data to */ if (list_count (server->colist) == 0) { clear_fifo_packet (pi); return; } /* Either send it to a specific client or brodcast message to all * clients */ if (listener != 0) ws_send_strict_fifo_to_client (server, listener, *pa); else list_foreach (server->colist, ws_broadcast_fifo, *pa); clear_fifo_packet (pi); } /* Handle reading and sending the incoming data from the named pipe on * a fixed buffer mode. */ static void handle_fixed_fifo (WSServer * server) { WSPipeIn *pi = server->pipein; WSPacket **pa = &pi->packet; int bytes = 0; char buf[PIPE_BUF] = { 0 }; if ((bytes = read (pi->fd, buf, PIPE_BUF)) < 0) return; buf[bytes] = '\0'; /* null-terminate */ if (ws_validate_string (buf, bytes) != 0) return; (*pa) = xcalloc (1, sizeof (WSPacket)); (*pa)->type = WS_OPCODE_TEXT; (*pa)->size = bytes; (*pa)->data = xstrdup (buf); /* no clients to send data to */ if (list_count (server->colist) == 0) { clear_fifo_packet (pi); return; } /* brodcast message to all clients */ list_foreach (server->colist, ws_broadcast_fifo, *pa); clear_fifo_packet (pi); } /* Determine which mode should use the incoming message from the FIFO. */ static void handle_fifo (WSServer * server) { if (wsconfig.strict) handle_strict_fifo (server); else handle_fixed_fifo (server); } /* Creates an endpoint for communication and start listening for * connections on a socket */ static void ws_socket (int *listener) { int ov = 1; struct addrinfo hints, *ai; /* get a socket and bind it */ memset (&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; /*hints.ai_flags = AI_PASSIVE; */ if (getaddrinfo (wsconfig.host, wsconfig.port, &hints, &ai) != 0) FATAL ("Unable to set server: %s.", gai_strerror (errno)); /* Create a TCP socket. */ *listener = socket (ai->ai_family, ai->ai_socktype, ai->ai_protocol); /* Options */ if (setsockopt (*listener, SOL_SOCKET, SO_REUSEADDR, &ov, sizeof (ov)) == -1) FATAL ("Unable to set setsockopt: %s.", strerror (errno)); /* Bind the socket to the address. */ if (bind (*listener, ai->ai_addr, ai->ai_addrlen) != 0) FATAL ("Unable to set bind: %s.", strerror (errno)); freeaddrinfo (ai); /* Tell the socket to accept connections. */ if (listen (*listener, SOMAXCONN) == -1) FATAL ("Unable to listen: %s.", strerror (errno)); } /* Handle incoming messages through a pipe (let gwsocket be the * reader) and outgoing messages through the pipe (writer). */ static void ws_fifos (WSServer * server, WSPipeIn * pi, WSPipeOut * po) { /* handle data via fifo */ if (pi->fd != -1 && FD_ISSET (pi->fd, &fdstate.rfds)) handle_fifo (server); /* handle data via fifo */ if (po->fd != -1 && FD_ISSET (po->fd, &fdstate.wfds)) ws_write_fifo (po, NULL, 0); } /* Check each client to determine if: * 1. We want to see if it has data for reading * 2. We want to write data to it. * If so, set the client's socket descriptor in the descriptor set. */ static void set_rfds_wfds (int listener, WSServer * server, WSPipeIn * pi, WSPipeOut * po) { WSClient *client = NULL; int conn; /* pipe out */ if (po->fd != -1) { if (po->status & WS_SENDING) FD_SET (po->fd, &fdstate.wfds); } /* pipe in */ if (pi->fd != -1) FD_SET (pi->fd, &fdstate.rfds); /* self-pipe trick to stop the event loop */ FD_SET (server->self_pipe[0], &fdstate.rfds); /* server socket, ready for accept() */ FD_SET (listener, &fdstate.rfds); for (conn = 0; conn < FD_SETSIZE; ++conn) { if (conn == pi->fd || conn == po->fd) continue; if (!(client = ws_get_client_from_list (conn, &server->colist))) continue; /* As long as we are not closing a connection, we assume we always * check a client for reading */ if (!server->closing) { FD_SET (conn, &fdstate.rfds); if (conn > max_file_fd) max_file_fd = conn; } /* Only if we have data to send the client */ if (client->status & WS_SENDING) { FD_SET (conn, &fdstate.wfds); if (conn > max_file_fd) max_file_fd = conn; } } } /* Start the websocket server and start to monitor multiple file * descriptors until we have something to read or write. */ void ws_start (WSServer * server) { WSPipeIn *pipein = server->pipein; WSPipeOut *pipeout = server->pipeout; int listener = 0, conn = 0; #ifdef HAVE_LIBSSL if (wsconfig.sslcert && wsconfig.sslkey) { LOG (("==Using TLS/SSL==\n")); wsconfig.use_ssl = 1; if (initialize_ssl_ctx (server)) { LOG (("Unable to initialize_ssl_ctx\n")); return; } } #endif memset (&fdstate, 0, sizeof fdstate); ws_socket (&listener); while (1) { /* If the pipeout file descriptor was opened after the server socket * was opened, then it's possible the max file descriptor would be the * pipeout fd, in any case we check this here */ max_file_fd = MAX (listener, pipeout->fd); /* Clear out the fd sets for this iteration. */ FD_ZERO (&fdstate.rfds); FD_ZERO (&fdstate.wfds); set_rfds_wfds (listener, server, pipein, pipeout); max_file_fd += 1; /* yep, wait patiently */ /* should it be using epoll/kqueue? will see... */ if (select (max_file_fd, &fdstate.rfds, &fdstate.wfds, NULL, NULL) == -1) { switch (errno) { case EINTR: LOG (("A signal was caught on select(2)\n")); break; default: FATAL ("Unable to select: %s.", strerror (errno)); } } /* handle self-pipe trick */ if (FD_ISSET (server->self_pipe[0], &fdstate.rfds)) { LOG (("Handled self-pipe to close event loop.\n")); break; } /* iterate over existing connections */ for (conn = 0; conn < max_file_fd; ++conn) { if (conn != pipein->fd && conn != pipeout->fd) { ws_listen (listener, conn, server); } } /* handle FIFOs */ ws_fifos (server, pipein, pipeout); } } /* Set the origin so the server can force connections to have the * given HTTP origin. */ void ws_set_config_origin (const char *origin) { wsconfig.origin = origin; } /* Set the the maximum websocket frame size. */ void ws_set_config_frame_size (int max_frm_size) { wsconfig.max_frm_size = max_frm_size; } /* Set specific name for the reader named pipe. */ void ws_set_config_pipein (const char *pipein) { wsconfig.pipein = pipein; } /* Set specific name for the writer named pipe. */ void ws_set_config_pipeout (const char *pipeout) { wsconfig.pipeout = pipeout; } /* Set a path and a file for the access log. */ void ws_set_config_accesslog (const char *accesslog) { wsconfig.accesslog = accesslog; if (access_log_open (wsconfig.accesslog) == 1) FATAL ("Unable to open access log: %s.", strerror (errno)); } /* Set if the server should handle strict named pipe handling. */ void ws_set_config_strict (int strict) { wsconfig.strict = strict; } /* Set the server into echo mode. */ void ws_set_config_echomode (int echomode) { wsconfig.echomode = echomode; } /* Set the server host bind address. */ void ws_set_config_host (const char *host) { wsconfig.host = host; } /* Set the server port bind address. */ void ws_set_config_port (const char *port) { wsconfig.port = port; } /* Set specific name for the SSL certificate. */ void ws_set_config_sslcert (const char *sslcert) { wsconfig.sslcert = sslcert; } /* Set specific name for the SSL key. */ void ws_set_config_sslkey (const char *sslkey) { wsconfig.sslkey = sslkey; } /* Create a new websocket server context. */ WSServer * ws_init (const char *host, const char *port, void (*initopts) (void)) { WSServer *server = new_wsserver (); server->pipein = new_wspipein (); server->pipeout = new_wspipeout (); memset (server->self_pipe, 0, sizeof (server->self_pipe)); wsconfig.accesslog = NULL; wsconfig.host = host; wsconfig.max_frm_size = WS_MAX_FRM_SZ; wsconfig.origin = NULL; wsconfig.pipein = NULL; wsconfig.pipeout = NULL; wsconfig.sslcert = NULL; wsconfig.sslkey = NULL; wsconfig.port = port; wsconfig.strict = 0; wsconfig.use_ssl = 0; initopts (); ws_fifo (server); return server; } goaccess-1.3/src/csv.h0000644000000000000000000000313313375657450011605 00000000000000/** * ______ ___ * / ____/___ / | _____________ __________ * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) * \____/\____/_/ |_\___/\___/\___/____/____/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #if HAVE_CONFIG_H #include #endif #ifndef CSV_H_INCLUDED #define CSV_H_INCLUDED #include #include "parser.h" #include "settings.h" void output_csv (GLog * glog, GHolder * holder, const char *filename); #endif goaccess-1.3/src/gslist.c0000644000000000000000000001015713375657450012316 00000000000000/** * gslist.c -- A Singly link list implementation * _______ _______ __ __ * / ____/ | / / ___/____ _____/ /_____ / /_ * / / __ | | /| / /\__ \/ __ \/ ___/ //_/ _ \/ __/ * / /_/ / | |/ |/ /___/ / /_/ / /__/ ,< / __/ /_ * \____/ |__/|__//____/\____/\___/_/|_|\___/\__/ * * The MIT License (MIT) * Copyright (c) 2009-2016 Gerardo Orellana * * 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 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include "gslist.h" #include "xmalloc.h" /* Instantiate a new Single linked-list node. * * On error, aborts if node can't be malloc'd. * On success, the GSLList node. */ GSLList * list_create (void *data) { GSLList *node = xmalloc (sizeof (GSLList)); node->data = data; node->next = NULL; return node; } /* Create and insert a node after a given node. * * On error, aborts if node can't be malloc'd. * On success, the newly created node. */ GSLList * list_insert_append (GSLList * node, void *data) { GSLList *newnode; newnode = list_create (data); newnode->next = node->next; node->next = newnode; return newnode; } /* Create and insert a node in front of the list. * * On error, aborts if node can't be malloc'd. * On success, the newly created node. */ GSLList * list_insert_prepend (GSLList * list, void *data) { GSLList *newnode; newnode = list_create (data); newnode->next = list; return newnode; } /* Find a node given a pointer to a function that compares them. * * If comparison fails, NULL is returned. * On success, the existing node is returned. */ GSLList * list_find (GSLList * node, int (*func) (void *, void *), void *data) { while (node) { if (func (node->data, data) > 0) return node; node = node->next; } return NULL; } /* Remove all nodes from the list. * * On success, 0 is returned. */ int list_remove_nodes (GSLList * list) { GSLList *tmp; while (list != NULL) { tmp = list->next; if (list->data) free (list->data); free (list); list = tmp; } return 0; } /* Remove the given node from the list. * * On error, 1 is returned. * On success, 0 is returned. */ int list_remove_node (GSLList ** list, GSLList * node) { GSLList **current = list, *next = NULL; for (; *current; current = &(*current)->next) { if ((*current) != node) continue; next = (*current)->next; if ((*current)->data) free ((*current)->data); free (*current); *current = next; return 0; } return 1; } /* Iterate over the single linked-list and call function pointer. * * If function pointer does not return 0, -1 is returned. * On success, 0 is returned. */ int list_foreach (GSLList * node, int (*func) (void *, void *), void *user_data) { while (node) { if (func (node->data, user_data) != 0) return -1; node = node->next; } return 0; } /* Count the number of elements on the linked-list. * * On success, the number of elements is returned. */ int list_count (GSLList * node) { int count = 0; while (node != 0) { count++; node = node->next; } return count; } goaccess-1.3/README0000644000000000000000000001003113350574106010712 00000000000000What is it? ------------- GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. Features ------------------------------- GoAccess parses the specified web log file and outputs the data to the X terminal. Features include: * Completely Real Time All panels and metrics are timed to be updated every 200 ms on the terminal output and every second on the HTML output. * No configuration needed You can just run it against your access log file, pick the log format and let GoAccess parse the access log and show you the stats. * Track Application Response Time Track the time taken to serve the request. Extremely useful if you want to track pages that are slowing down your site. * Nearly All Web Log Formats GoAccess allows any custom log format string. Predefined options include, Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, etc * Incremental Log Processing Need data persistence? GoAccess has the ability to process logs incrementally through the on-disk B+Tree database. * Only one dependency GoAccess is written in C. To run it, you only need ncurses as a dependency. That's it. It even has its own Web Socket server - http://gwsocket.io/. * Visitors Determine the amount of hits, visitors, bandwidth, and metrics for slowest running requests by the hour, or date. * Metrics per Virtual Host Have multiple Virtual Hosts (Server Blocks)? A panel that displays which virtual host is consuming most of the web server resources. * Color Scheme Customizable Tailor GoAccess to suit your own color taste/schemes. Either through the terminal, or by simply updating the stylesheet on the HTML output. * Support for large datasets GoAccess features an on-disk B+Tree storage for large datasets where it is not possible to fit everything in memory. * Docker support GoAccess comes with a default Docker (https://hub.docker.com/r/allinurl/goaccess/) that will listen for HTTP connections on port 7890. Although, you can still fully configure it, by using Volume mapping and editing goaccess.conf. * and more... visit https://goaccess.io for more details. Why GoAccess? ------------- GoAccess was designed to be a fast, terminal-based log analyzer. Its core idea is to quickly analyze and view web server statistics in real time without needing to use your browser (great if you want to do a quick analysis of your access log via SSH, or if you simply love working in the terminal). While the terminal output is the default output, it has the capability to generate a complete real-time HTML report, as well as a JSON, and CSV report. You can see it more of a monitor command tool than anything else. Keys ---- The user can make use of the following keys: * ^F1^ or ^h^ Main help, * ^F5^ Redraw [main window], * ^q^ Quit the program, current window or module, * ^o^ or ^ENTER^ Expand selected module, * ^[Shift]0-9^ Set selected module to active, * ^Up^ arrow Scroll up main dashboard, * ^Down^ arrow Scroll down main dashboard, * ^j^ Scroll down within expanded module, * ^k^ Scroll up within expanded module, * ^c^ Set or change scheme color, * ^CTRL^ + ^f^ Scroll forward one screen within, * active module, * ^CTRL^ + ^b^ Scroll backward one screen within, * active module, * ^TAB^ Iterate modules (forward), * ^SHIFT^ + ^TAB^ Iterate modules (backward), * ^s^ Sort options for current module, * ^/^ Search across all modules, * ^n^ Find position of the next occurrence, * ^g^ Move to the first item or top of screen, * ^G^ Move to the last item or bottom of screen, Examples can be found by running `man goaccess`. goaccess-1.3/config.sub0000755000000000000000000010532713375710677012046 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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 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, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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-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 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | 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 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | 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 \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | 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 \ | 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 ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | 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-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | 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-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | 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-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | 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-* \ | 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 ;; 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 ;; mingw32) basic_machine=i386-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 ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-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) 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* \ | -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* \ | -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* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -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*) # 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 ;; -kaos*) os=-kaos ;; -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 ;; 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: goaccess-1.3/Makefile.am0000644000000000000000000001443413375710662012107 00000000000000#AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = goaccess AUTOMAKE_OPTIONS = subdir-objects dist_noinst_DATA = \ resources/tpls.html \ resources/css/app.css \ resources/css/bootstrap.min.css \ resources/css/fa.min.css \ resources/js/app.js \ resources/js/charts.js \ resources/js/d3.v3.min.js \ resources/js/hogan.min.js noinst_PROGRAMS = bin2c bin2c_SOURCES = src/bin2c.c BUILT_SOURCES = \ tpls.h \ bootstrapcss.h \ facss.h \ appcss.h \ d3js.h \ hoganjs.h \ chartsjs.h \ appjs.h CLEANFILES = \ src/tpls.h \ src/bootstrapcss.h \ src/facss.h \ src/appcss.h \ src/d3js.h \ src/hoganjs.h \ src/chartsjs.h \ src/appjs.h \ resources/tpls.html.tmp \ resources/css/bootstrap.min.css.tmp \ resources/css/fa.min.css.tmp \ resources/css/app.css.tmp \ resources/js/d3.v3.min.js.tmp \ resources/js/hogan.min.js.tmp \ resources/js/charts.js.tmp \ resources/js/app.js.tmp # Tpls tpls.h: bin2c$(EXEEXT) resources/tpls.html if HAS_SEDTR cat resources/tpls.html | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/tpls.html.tmp ./bin2c resources/tpls.html.tmp src/tpls.h tpls else ./bin2c resources/tpls.html src/tpls.h tpls endif # Bootstrap bootstrapcss.h: bin2c$(EXEEXT) resources/css/bootstrap.min.css if HAS_SEDTR cat resources/css/bootstrap.min.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/bootstrap.min.css.tmp ./bin2c resources/css/bootstrap.min.css.tmp src/bootstrapcss.h bootstrap_css else ./bin2c resources/css/bootstrap.min.css src/bootstrapcss.h bootstrap_css endif # Font Awesome facss.h: bin2c$(EXEEXT) resources/css/fa.min.css if HAS_SEDTR cat resources/css/fa.min.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/fa.min.css.tmp ./bin2c resources/css/fa.min.css.tmp src/facss.h fa_css else ./bin2c resources/css/fa.min.css src/facss.h fa_css endif # App.css appcss.h: bin2c$(EXEEXT) resources/css/app.css if HAS_SEDTR cat resources/css/app.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/app.css.tmp ./bin2c resources/css/app.css.tmp src/appcss.h app_css else ./bin2c resources/css/app.css src/appcss.h app_css endif # D3.js d3js.h: bin2c$(EXEEXT) resources/js/d3.v3.min.js if HAS_SEDTR cat resources/js/d3.v3.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/d3.v3.min.js.tmp ./bin2c resources/js/d3.v3.min.js.tmp src/d3js.h d3_js else ./bin2c resources/js/d3.v3.min.js src/d3js.h d3_js endif # Hogan.js hoganjs.h: bin2c$(EXEEXT) resources/js/hogan.min.js if HAS_SEDTR cat resources/js/hogan.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/hogan.min.js.tmp ./bin2c resources/js/hogan.min.js.tmp src/hoganjs.h hogan_js else ./bin2c resources/js/hogan.min.js src/hoganjs.h hogan_js endif # Charts.js chartsjs.h: bin2c$(EXEEXT) resources/js/charts.js if HAS_SEDTR cat resources/js/charts.js | sed -E "s@(,|;)[[:space:]]*//..*@\1@g" | sed -E "s@^[[:space:]]*//..*@@g" | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/charts.js.tmp ./bin2c resources/js/charts.js.tmp src/chartsjs.h charts_js else ./bin2c resources/js/charts.js src/chartsjs.h charts_js endif # App.js appjs.h: bin2c$(EXEEXT) resources/js/app.js if HAS_SEDTR cat resources/js/app.js | sed -E "s@(,|;)[[:space:]]*//..*@\1@g" | sed -E "s@^[[:space:]]*//..*@@g" | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/app.js.tmp ./bin2c resources/js/app.js.tmp src/appjs.h app_js else ./bin2c resources/js/app.js src/appjs.h app_js endif confdir = $(sysconfdir)/goaccess dist_conf_DATA = config/goaccess.conf dist_conf_DATA += config/browsers.list goaccess_SOURCES = \ src/base64.c \ src/base64.h \ src/browsers.c \ src/browsers.h \ src/color.c \ src/color.h \ src/commons.c \ src/commons.h \ src/csv.c \ src/csv.h \ src/error.c \ src/error.h \ src/gdashboard.c \ src/gdashboard.h \ src/gdns.c \ src/gdns.h \ src/gholder.c \ src/gholder.h \ src/gmenu.c \ src/gmenu.h \ src/goaccess.c \ src/goaccess.h \ src/gslist.c \ src/gslist.h \ src/gstorage.c \ src/gstorage.h \ src/gwsocket.c \ src/gwsocket.h \ src/json.c \ src/json.h \ src/labels.h \ src/opesys.c \ src/opesys.h \ src/options.c \ src/options.h \ src/output.c \ src/output.h \ src/parser.c \ src/parser.h \ src/settings.c \ src/settings.h \ src/sha1.c \ src/sha1.h \ src/sort.c \ src/sort.h \ src/ui.c \ src/ui.h \ src/util.c \ src/util.h \ src/websocket.c \ src/websocket.h \ src/xmalloc.c \ src/xmalloc.h if TCB goaccess_SOURCES += \ src/tcabdb.c \ src/tcabdb.h \ src/tcbtdb.c \ src/tcbtdb.h else goaccess_SOURCES += \ src/khash.h \ src/gkhash.c \ src/gkhash.h endif if GEOIP_LEGACY goaccess_SOURCES += \ src/geoip1.c \ src/geoip1.h endif if GEOIP_MMDB goaccess_SOURCES += \ src/geoip2.c \ src/geoip1.h endif if DEBUG AM_CFLAGS = -DDEBUG -O0 -g -DSYSCONFDIR=\"$(sysconfdir)\" else AM_CFLAGS = -O2 -DSYSCONFDIR=\"$(sysconfdir)\" endif if WITH_RDYNAMIC AM_LDFLAGS = -rdynamic endif AM_CFLAGS += -Wno-long-long -Wall -W -Wnested-externs -Wformat=2 AM_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations AM_CFLAGS += -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare AM_CFLAGS += -Wbad-function-cast -Winline -Wcast-align -Wextra AM_CFLAGS += -Wdeclaration-after-statement -Wno-missing-field-initializers dist_man_MANS = goaccess.1 SUBDIRS = po ACLOCAL_AMFLAGS = -I m4 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ EXTRA_DIST = config.rpath goaccess-1.3/AUTHORS0000644000000000000000000000624013375664516011125 00000000000000GoAccess was designed and developed by Gerardo Orellana Special thanks to the following individuals for their great contributions: * Aaditya Bagga * Adam Å tevko * Adrian * Alexander Eifler * Andreas Sommer * Andreas Weigel * Andrew Minion * Antonio Terceiro * Arnie97 * Aslak Raanes * Bjørnar Hansen * Bo Cai * Bob Black * Chilledheart * Chris Downs * Christian Hermann * Christian Moelders * Christopher Meng * Daniel (dmilith) Dettlaff * Daniel Aleksandersen * David Geistert * Enrique Becerra * Florian Forster * Francisco Azevedo * Frederic Cambus * Genki Sugawara * Jeffery Wilkins * Jeremy Burks * Joe Groocock * Joe Winett * Joona * Julian Xhokaxhiu * Justin Mills * Kamino Hiroki <37243867+4f8p@users.noreply.github.com> * Kit Westneat * Maksim Losev * Mark J. Berger * Mathieu Aubin * Mathieu Thoretton * Max Christian Pohle * Michael Vetter * Nicolas * Nicolas Le Manchet * Otto Kekäläinen * Sean Cross * Sebastian Wiedenroth * SjonHortensius * Steely Wing * Stoyan Dimov * Stéphane Péchard * Tatsuyuki Ishi * Thomas Gläßle * Tom Samstag * Viktor Szépe * Ville Skyttä * Vladimir Pavljuchenkov * Vladimir Pavljuchenkov * Yuri D'Elia * Yuriy M. Kaminskiy * abgit * as0n * fqbuild * holys * kyle sloan * m-r-r * mynameiscfed * pravdomil * radoslawc * radoslawc * schoonc * wodev * woobee * zeke goaccess-1.3/configure.ac0000644000000000000000000002100713375662501012331 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([goaccess], [1.3], [goaccess@prosoftcorp.com], [], [http://goaccess.io]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/goaccess.c]) AC_CONFIG_HEADERS([src/config.h]) # Use empty CFLAGS by default so autoconf does not add # CFLAGS="-O2 -g" # NOTE: Needs to go after AC_INIT and before AC_PROG_CC to select an # empty default instead. : ${CFLAGS=""} # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18]) # Fix `undefined reference to `libintl_gettext'` on docker: AC_CHECK_LIB([intl], [libintl_dgettext]) # pthread AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([pthread is missing])]) CFLAGS="$CFLAGS -pthread" # DEBUG AC_ARG_ENABLE(debug, [ --enable-debug Create a debug build. Default is disabled], [debug="$enableval"], debug=no) if test "$debug" = "yes"; then AC_DEFINE([_DEBUG], 1, [Debug option]) fi AM_CONDITIONAL([DEBUG], [test "x$debug" = "xyes"]) # Handle rdynamic only on systems using GNU ld AC_CANONICAL_HOST AC_MSG_CHECKING([whether to build with rdynamic for GNU ld]) with_rdyanimc=yes case "$host_os" in *darwin*|*cygwin*|*aix*|*mingw*) with_rdyanimc=no ;; esac AC_MSG_RESULT([$with_rdyanimc]) AM_CONDITIONAL([WITH_RDYNAMIC], [test "x$with_rdyanimc" = "xyes"]) # Build with OpenSSL AC_ARG_WITH([openssl],AC_HELP_STRING([--with-openssl], [build with OpenSSL support]), [openssl="$withval"],[openssl="no"]) if test "$openssl" = 'yes'; then AC_CHECK_LIB([ssl], [SSL_CTX_new],,[AC_MSG_ERROR([ssl library missing])]) AC_CHECK_LIB([crypto], [CRYPTO_free],,[AC_MSG_ERROR([crypto library missing])]) fi # GeoIP AC_ARG_ENABLE(geoip, [ --enable-geoip Enable GeoIP country lookup. Default is disabled], [geoip="$enableval"], geoip=no) geolocation="N/A" if test "$geoip" = "mmdb"; then AC_CHECK_LIB([maxminddb], [MMDB_open], [], [AC_MSG_ERROR([ *** Missing development files for libmaxminddb library. ])]) geolocation="GeoIP2" AC_DEFINE([HAVE_GEOLOCATION], 1, [Build using GeoIP.]) elif test "$geoip" = "legacy"; then AC_CHECK_LIB([GeoIP], [GeoIP_new], [], [AC_MSG_ERROR([ *** Missing development files for the GeoIP library ])]) geolocation="GeoIP Legacy" AC_DEFINE([HAVE_GEOLOCATION], 1, [Build using GeoIP.]) fi AM_CONDITIONAL([GEOIP_LEGACY], [test "x$geoip" = "xlegacy"]) AM_CONDITIONAL([GEOIP_MMDB], [test "x$geoip" = "xmmdb"]) # GNU getline / POSIX.1-2008 AC_ARG_WITH(getline, [ --with-getline Build using dynamic line buffer.], [with_getline=$withval], [with_getline=no]) if test "$with_getline" = "yes"; then AC_DEFINE([WITH_GETLINE], 1, [Build using GNU getline.]) fi # UTF8 AC_ARG_ENABLE(utf8, [ --enable-utf8 Enable ncurses library that handles wide characters], [utf8="$enableval"], utf8=no) if test "$utf8" = "yes"; then libncursesw=ncursesw # Simply called libncurses on OS X case "$host_os" in *darwin*) libncursesw=ncurses ;; esac AC_CHECK_LIB([$libncursesw], [mvaddwstr], [], [AC_MSG_ERROR([*** Missing development libraries for ncursesw])]) AC_SEARCH_LIBS([tputs], [tinfow], ,[AC_MSG_ERROR([Cannot find a library providing tputs])]) AC_DEFINE([HAVE_LIBNCURSESW], [1], ["ncursesw is present."]) have_ncurses="yes" AC_CHECK_HEADERS([ncursesw/ncurses.h],[have_ncurses=yes], [], [ #ifdef HAVE_NCURSESW_NCURSES_H #include #endif ]) AC_CHECK_HEADERS([ncurses.h],[have_ncurses=yes], [], [ #ifdef HAVE_NCURSES_H #include #endif ]) if test "$have_ncurses" != "yes"; then AC_MSG_ERROR([Missing ncursesw header file]) fi else AC_CHECK_LIB([ncurses], [refresh], [], [AC_MSG_ERROR([*** Missing development libraries for ncurses])]) AC_SEARCH_LIBS([tputs], [tinfo], ,[AC_MSG_ERROR([Cannot find a library providing tputs])]) have_ncurses="yes" AC_CHECK_HEADERS([ncurses/ncurses.h],[have_ncurses=yes], [], [ #ifdef HAVE_NCURSES_NCURSES_H #include #endif ]) AC_CHECK_HEADERS([ncurses.h],[have_ncurses=yes], [], [ #ifdef HAVE_NCURSES_H #include #endif ]) AC_CHECK_HEADERS([curses.h],[have_ncurses=yes], [], [ #ifdef HAVE_CURSES_H #include #endif ]) if test "$have_ncurses" != "yes"; then AC_MSG_ERROR([Missing ncursesw header file]) fi fi # Tokyo Cabinet AC_ARG_ENABLE(tcb, [ --enable-tcb Enable TokyoCabinet database. Default is disabled], [tcb="$enableval"], tcb=no) WITH_TC=no if test "$tcb" = "memhash"; then WITH_TC=yes AC_DEFINE([TCB_MEMHASH], [1], ["Build using on-memory hash database"]) elif test "$tcb" = "btree"; then AC_DEFINE([TCB_BTREE], [1], ["Build using on-disk B+ Tree database"]) WITH_TC=yes fi if test "$WITH_TC" = "yes"; then AC_CHECK_LIB([tokyocabinet], [tchdbnew], [], [AC_MSG_ERROR([*** Missing development libraries for Tokyo Cabinet Database])]) AC_ARG_ENABLE([zlib], [ --disable-zlib Build without ZLIB compression], [zlib="$enableval"], zlib=yes) if test "$zlib" = "yes"; then AC_CHECK_LIB(z, gzread, [Z_FLAG=-lz], AC_MSG_ERROR([ *** zlib is required. If zlib compression is not needed *** you can use --disable-zlib. *** Debian based distributions zlib1g-dev *** Red Hat based distributions zlib-devel ])) AC_DEFINE([HAVE_ZLIB], [1], ["Build using ZLIB"]) LDFLAGS="$LDFLAGS $Z_FLAG" fi AC_ARG_ENABLE([bzip], [ --disable-bzip Build without BZIP2 compression], [bz2="$enableval"], bz2=yes) if test "$bz2" = "yes"; then AC_CHECK_LIB(bz2, BZ2_bzopen, [BZ2_FLAG=-lbz2], AC_MSG_ERROR([ *** BZIP2 is required. If BZIP2 compression is not needed *** you can use --disable-bzip. *** Debian based distributions libbz2-dev *** Red Hat based distributions bzip2-devel ])) AC_DEFINE([HAVE_BZ2], [1], ["Build using BZ2"]) LDFLAGS="$LDFLAGS $BZ2_FLAG" fi case "$host_os" in *darwin*|*bsd*) LDFLAGS="$LDFLAGS -ltokyocabinet -lc" ;; *) LDFLAGS="$LDFLAGS -ltokyocabinet -lrt -lc" ;; esac fi AM_CONDITIONAL([TCB], [test "$WITH_TC" = "yes"]) if test "$tcb" = "memhash"; then storage="In-memory Hash Database (Tokyo Cabinet)" elif test "$tcb" = "btree"; then storage="On-disk B+ Tree Database (Tokyo Cabinet)" else storage="In-memory Hash Database (Default)" fi HAS_SEDTR=no AC_CHECK_PROG([SED_CHECK],[sed],[yes],[no]) if test x"$SED_CHECK" == x"yes" ; then AC_CHECK_PROG([TR_CHECK],[tr],[yes],[no]) if test x"$TR_CHECK" == x"yes" ; then HAS_SEDTR=yes fi fi AM_CONDITIONAL([HAS_SEDTR], [test "x$HAS_SEDTR" = xyes]) # Solaris AC_CHECK_LIB([nsl], [gethostbyname]) AC_CHECK_LIB([socket], [socket]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h]) AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_HEADERS([limits.h]) AC_CHECK_HEADERS([locale.h]) AC_CHECK_HEADERS([netdb.h]) AC_CHECK_HEADERS([netinet/in.h]) AC_CHECK_HEADERS([stddef.h]) AC_CHECK_HEADERS([stdint.h]) AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([string.h]) AC_CHECK_HEADERS([strings.h]) AC_CHECK_HEADERS([sys/socket.h]) AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_CHECK_TYPES([ptrdiff_t]) AC_STRUCT_TM AC_TYPE_INT64_T AC_TYPE_INT8_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_FSEEKO AC_FUNC_MEMCMP AC_FUNC_MKTIME AC_FUNC_STAT AC_FUNC_STRFTIME AC_FUNC_STRTOD AC_CHECK_FUNCS([floor]) AC_CHECK_FUNCS([gethostbyaddr]) AC_CHECK_FUNCS([gethostbyname]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([malloc]) AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([mkfifo]) AC_CHECK_FUNCS([realloc]) AC_CHECK_FUNCS([realpath]) AC_CHECK_FUNCS([regcomp]) AC_CHECK_FUNCS([select]) AC_CHECK_FUNCS([setlocale]) AC_CHECK_FUNCS([socket]) AC_CHECK_FUNCS([strcasecmp]) AC_CHECK_FUNCS([strchr]) AC_CHECK_FUNCS([strcspn]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([strerror]) AC_CHECK_FUNCS([strncasecmp]) AC_CHECK_FUNCS([strpbrk]) AC_CHECK_FUNCS([strrchr]) AC_CHECK_FUNCS([strspn]) AC_CHECK_FUNCS([strstr]) AC_CHECK_FUNCS([strtol]) AC_CHECK_FUNCS([strtoull]) AC_CONFIG_FILES([Makefile po/Makefile.in]) AC_OUTPUT cat << EOF Your build configuration: Prefix : $prefix Package : $PACKAGE_NAME Version : $VERSION Compiler flags : $CFLAGS Linker flags : $LIBS $LDFLAGS Dynamic buffer : $with_getline Geolocation : $geolocation Storage method : $storage TLS/SSL : $openssl Bugs : $PACKAGE_BUGREPORT EOF goaccess-1.3/missing0000755000000000000000000002415213375710677011456 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally 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 run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # 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: goaccess-1.3/COPYING0000644000000000000000000000212613041415706011070 00000000000000The MIT License (MIT) Copyright (c) 2009-2016 Gerardo Orellana 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. goaccess-1.3/Makefile.in0000644000000000000000000013434213375710677012127 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } 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@ bin_PROGRAMS = goaccess$(EXEEXT) noinst_PROGRAMS = bin2c$(EXEEXT) @TCB_TRUE@am__append_1 = \ @TCB_TRUE@ src/tcabdb.c \ @TCB_TRUE@ src/tcabdb.h \ @TCB_TRUE@ src/tcbtdb.c \ @TCB_TRUE@ src/tcbtdb.h @TCB_FALSE@am__append_2 = \ @TCB_FALSE@ src/khash.h \ @TCB_FALSE@ src/gkhash.c \ @TCB_FALSE@ src/gkhash.h @GEOIP_LEGACY_TRUE@am__append_3 = \ @GEOIP_LEGACY_TRUE@ src/geoip1.c \ @GEOIP_LEGACY_TRUE@ src/geoip1.h @GEOIP_MMDB_TRUE@am__append_4 = \ @GEOIP_MMDB_TRUE@ src/geoip2.c \ @GEOIP_MMDB_TRUE@ src/geoip1.h subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_conf_DATA) \ $(dist_man_MANS) $(dist_noinst_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure \ $(top_srcdir)/src/config.h.in ABOUT-NLS AUTHORS COPYING \ ChangeLog INSTALL NEWS TODO compile config.guess config.rpath \ config.sub depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(confdir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_bin2c_OBJECTS = src/bin2c.$(OBJEXT) bin2c_OBJECTS = $(am_bin2c_OBJECTS) bin2c_LDADD = $(LDADD) am__goaccess_SOURCES_DIST = src/base64.c src/base64.h src/browsers.c \ src/browsers.h src/color.c src/color.h src/commons.c \ src/commons.h src/csv.c src/csv.h src/error.c src/error.h \ src/gdashboard.c src/gdashboard.h src/gdns.c src/gdns.h \ src/gholder.c src/gholder.h src/gmenu.c src/gmenu.h \ src/goaccess.c src/goaccess.h src/gslist.c src/gslist.h \ src/gstorage.c src/gstorage.h src/gwsocket.c src/gwsocket.h \ src/json.c src/json.h src/labels.h src/opesys.c src/opesys.h \ src/options.c src/options.h src/output.c src/output.h \ src/parser.c src/parser.h src/settings.c src/settings.h \ src/sha1.c src/sha1.h src/sort.c src/sort.h src/ui.c src/ui.h \ src/util.c src/util.h src/websocket.c src/websocket.h \ src/xmalloc.c src/xmalloc.h src/tcabdb.c src/tcabdb.h \ src/tcbtdb.c src/tcbtdb.h src/khash.h src/gkhash.c \ src/gkhash.h src/geoip1.c src/geoip1.h src/geoip2.c @TCB_TRUE@am__objects_1 = src/tcabdb.$(OBJEXT) src/tcbtdb.$(OBJEXT) @TCB_FALSE@am__objects_2 = src/gkhash.$(OBJEXT) @GEOIP_LEGACY_TRUE@am__objects_3 = src/geoip1.$(OBJEXT) @GEOIP_MMDB_TRUE@am__objects_4 = src/geoip2.$(OBJEXT) am_goaccess_OBJECTS = src/base64.$(OBJEXT) src/browsers.$(OBJEXT) \ src/color.$(OBJEXT) src/commons.$(OBJEXT) src/csv.$(OBJEXT) \ src/error.$(OBJEXT) src/gdashboard.$(OBJEXT) \ src/gdns.$(OBJEXT) src/gholder.$(OBJEXT) src/gmenu.$(OBJEXT) \ src/goaccess.$(OBJEXT) src/gslist.$(OBJEXT) \ src/gstorage.$(OBJEXT) src/gwsocket.$(OBJEXT) \ src/json.$(OBJEXT) src/opesys.$(OBJEXT) src/options.$(OBJEXT) \ src/output.$(OBJEXT) src/parser.$(OBJEXT) \ src/settings.$(OBJEXT) src/sha1.$(OBJEXT) src/sort.$(OBJEXT) \ src/ui.$(OBJEXT) src/util.$(OBJEXT) src/websocket.$(OBJEXT) \ src/xmalloc.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) goaccess_OBJECTS = $(am_goaccess_OBJECTS) goaccess_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(bin2c_SOURCES) $(goaccess_SOURCES) DIST_SOURCES = $(bin2c_SOURCES) $(am__goaccess_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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 = $(dist_conf_DATA) $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) 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__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ 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@ POSUB = @POSUB@ POW_LIB = @POW_LIB@ SED_CHECK = @SED_CHECK@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TR_CHECK = @TR_CHECK@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ 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@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects dist_noinst_DATA = \ resources/tpls.html \ resources/css/app.css \ resources/css/bootstrap.min.css \ resources/css/fa.min.css \ resources/js/app.js \ resources/js/charts.js \ resources/js/d3.v3.min.js \ resources/js/hogan.min.js bin2c_SOURCES = src/bin2c.c BUILT_SOURCES = \ tpls.h \ bootstrapcss.h \ facss.h \ appcss.h \ d3js.h \ hoganjs.h \ chartsjs.h \ appjs.h CLEANFILES = \ src/tpls.h \ src/bootstrapcss.h \ src/facss.h \ src/appcss.h \ src/d3js.h \ src/hoganjs.h \ src/chartsjs.h \ src/appjs.h \ resources/tpls.html.tmp \ resources/css/bootstrap.min.css.tmp \ resources/css/fa.min.css.tmp \ resources/css/app.css.tmp \ resources/js/d3.v3.min.js.tmp \ resources/js/hogan.min.js.tmp \ resources/js/charts.js.tmp \ resources/js/app.js.tmp confdir = $(sysconfdir)/goaccess dist_conf_DATA = config/goaccess.conf config/browsers.list goaccess_SOURCES = src/base64.c src/base64.h src/browsers.c \ src/browsers.h src/color.c src/color.h src/commons.c \ src/commons.h src/csv.c src/csv.h src/error.c src/error.h \ src/gdashboard.c src/gdashboard.h src/gdns.c src/gdns.h \ src/gholder.c src/gholder.h src/gmenu.c src/gmenu.h \ src/goaccess.c src/goaccess.h src/gslist.c src/gslist.h \ src/gstorage.c src/gstorage.h src/gwsocket.c src/gwsocket.h \ src/json.c src/json.h src/labels.h src/opesys.c src/opesys.h \ src/options.c src/options.h src/output.c src/output.h \ src/parser.c src/parser.h src/settings.c src/settings.h \ src/sha1.c src/sha1.h src/sort.c src/sort.h src/ui.c src/ui.h \ src/util.c src/util.h src/websocket.c src/websocket.h \ src/xmalloc.c src/xmalloc.h $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) @DEBUG_FALSE@AM_CFLAGS = -O2 -DSYSCONFDIR=\"$(sysconfdir)\" \ @DEBUG_FALSE@ -Wno-long-long -Wall -W -Wnested-externs \ @DEBUG_FALSE@ -Wformat=2 -Wmissing-prototypes \ @DEBUG_FALSE@ -Wstrict-prototypes -Wmissing-declarations \ @DEBUG_FALSE@ -Wwrite-strings -Wshadow -Wpointer-arith \ @DEBUG_FALSE@ -Wsign-compare -Wbad-function-cast -Winline \ @DEBUG_FALSE@ -Wcast-align -Wextra \ @DEBUG_FALSE@ -Wdeclaration-after-statement \ @DEBUG_FALSE@ -Wno-missing-field-initializers @DEBUG_TRUE@AM_CFLAGS = -DDEBUG -O0 -g -DSYSCONFDIR=\"$(sysconfdir)\" \ @DEBUG_TRUE@ -Wno-long-long -Wall -W -Wnested-externs \ @DEBUG_TRUE@ -Wformat=2 -Wmissing-prototypes \ @DEBUG_TRUE@ -Wstrict-prototypes -Wmissing-declarations \ @DEBUG_TRUE@ -Wwrite-strings -Wshadow -Wpointer-arith \ @DEBUG_TRUE@ -Wsign-compare -Wbad-function-cast -Winline \ @DEBUG_TRUE@ -Wcast-align -Wextra -Wdeclaration-after-statement \ @DEBUG_TRUE@ -Wno-missing-field-initializers @WITH_RDYNAMIC_TRUE@AM_LDFLAGS = -rdynamic dist_man_MANS = goaccess.1 SUBDIRS = po ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = config.rpath all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .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 .PRECIOUS: 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): src/config.h: src/stamp-h1 @if test ! -f $@; then rm -f src/stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1; else :; fi src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(top_srcdir)/src/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/config.h src/stamp-h1 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) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/bin2c.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) bin2c$(EXEEXT): $(bin2c_OBJECTS) $(bin2c_DEPENDENCIES) $(EXTRA_bin2c_DEPENDENCIES) @rm -f bin2c$(EXEEXT) $(LINK) $(bin2c_OBJECTS) $(bin2c_LDADD) $(LIBS) src/base64.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/browsers.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/color.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/commons.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/csv.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/error.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/gdashboard.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gdns.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/gholder.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gmenu.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/goaccess.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gslist.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gstorage.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gwsocket.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/json.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/opesys.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/options.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/output.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/parser.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/settings.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/sha1.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/sort.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/ui.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/util.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/websocket.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/xmalloc.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/tcabdb.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/tcbtdb.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gkhash.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/geoip1.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/geoip2.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) goaccess$(EXEEXT): $(goaccess_OBJECTS) $(goaccess_DEPENDENCIES) $(EXTRA_goaccess_DEPENDENCIES) @rm -f goaccess$(EXEEXT) $(LINK) $(goaccess_OBJECTS) $(goaccess_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/base64.$(OBJEXT) -rm -f src/bin2c.$(OBJEXT) -rm -f src/browsers.$(OBJEXT) -rm -f src/color.$(OBJEXT) -rm -f src/commons.$(OBJEXT) -rm -f src/csv.$(OBJEXT) -rm -f src/error.$(OBJEXT) -rm -f src/gdashboard.$(OBJEXT) -rm -f src/gdns.$(OBJEXT) -rm -f src/geoip1.$(OBJEXT) -rm -f src/geoip2.$(OBJEXT) -rm -f src/gholder.$(OBJEXT) -rm -f src/gkhash.$(OBJEXT) -rm -f src/gmenu.$(OBJEXT) -rm -f src/goaccess.$(OBJEXT) -rm -f src/gslist.$(OBJEXT) -rm -f src/gstorage.$(OBJEXT) -rm -f src/gwsocket.$(OBJEXT) -rm -f src/json.$(OBJEXT) -rm -f src/opesys.$(OBJEXT) -rm -f src/options.$(OBJEXT) -rm -f src/output.$(OBJEXT) -rm -f src/parser.$(OBJEXT) -rm -f src/settings.$(OBJEXT) -rm -f src/sha1.$(OBJEXT) -rm -f src/sort.$(OBJEXT) -rm -f src/tcabdb.$(OBJEXT) -rm -f src/tcbtdb.$(OBJEXT) -rm -f src/ui.$(OBJEXT) -rm -f src/util.$(OBJEXT) -rm -f src/websocket.$(OBJEXT) -rm -f src/xmalloc.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bin2c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/browsers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/color.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/commons.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/csv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gdashboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gdns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/geoip1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/geoip2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gholder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gkhash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/goaccess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gslist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gstorage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gwsocket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/opesys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/output.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/settings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sha1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tcabdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tcbtdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/ui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/websocket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/xmalloc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ 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@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ 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@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 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-dist_confDATA: $(dist_conf_DATA) @$(NORMAL_INSTALL) @list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(confdir)" || 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)$(confdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \ done uninstall-dist_confDATA: @$(NORMAL_UNINSTALL) @list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ 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" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || 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__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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.lzma*) \ lzma -dc $(distdir).tar.lzma | $(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 mkdir $(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 \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(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__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-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(confdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(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-recursive clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf src/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_confDATA install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf src/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_confDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-lzma 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-binPROGRAMS install-data install-data-am \ install-dist_confDATA 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-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dist_confDATA uninstall-man \ uninstall-man1 # Tpls tpls.h: bin2c$(EXEEXT) resources/tpls.html @HAS_SEDTR_TRUE@ cat resources/tpls.html | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/tpls.html.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/tpls.html.tmp src/tpls.h tpls @HAS_SEDTR_FALSE@ ./bin2c resources/tpls.html src/tpls.h tpls # Bootstrap bootstrapcss.h: bin2c$(EXEEXT) resources/css/bootstrap.min.css @HAS_SEDTR_TRUE@ cat resources/css/bootstrap.min.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/bootstrap.min.css.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/css/bootstrap.min.css.tmp src/bootstrapcss.h bootstrap_css @HAS_SEDTR_FALSE@ ./bin2c resources/css/bootstrap.min.css src/bootstrapcss.h bootstrap_css # Font Awesome facss.h: bin2c$(EXEEXT) resources/css/fa.min.css @HAS_SEDTR_TRUE@ cat resources/css/fa.min.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/fa.min.css.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/css/fa.min.css.tmp src/facss.h fa_css @HAS_SEDTR_FALSE@ ./bin2c resources/css/fa.min.css src/facss.h fa_css # App.css appcss.h: bin2c$(EXEEXT) resources/css/app.css @HAS_SEDTR_TRUE@ cat resources/css/app.css | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/css/app.css.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/css/app.css.tmp src/appcss.h app_css @HAS_SEDTR_FALSE@ ./bin2c resources/css/app.css src/appcss.h app_css # D3.js d3js.h: bin2c$(EXEEXT) resources/js/d3.v3.min.js @HAS_SEDTR_TRUE@ cat resources/js/d3.v3.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/d3.v3.min.js.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/js/d3.v3.min.js.tmp src/d3js.h d3_js @HAS_SEDTR_FALSE@ ./bin2c resources/js/d3.v3.min.js src/d3js.h d3_js # Hogan.js hoganjs.h: bin2c$(EXEEXT) resources/js/hogan.min.js @HAS_SEDTR_TRUE@ cat resources/js/hogan.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/hogan.min.js.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/js/hogan.min.js.tmp src/hoganjs.h hogan_js @HAS_SEDTR_FALSE@ ./bin2c resources/js/hogan.min.js src/hoganjs.h hogan_js # Charts.js chartsjs.h: bin2c$(EXEEXT) resources/js/charts.js @HAS_SEDTR_TRUE@ cat resources/js/charts.js | sed -E "s@(,|;)[[:space:]]*//..*@\1@g" | sed -E "s@^[[:space:]]*//..*@@g" | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/charts.js.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/js/charts.js.tmp src/chartsjs.h charts_js @HAS_SEDTR_FALSE@ ./bin2c resources/js/charts.js src/chartsjs.h charts_js # App.js appjs.h: bin2c$(EXEEXT) resources/js/app.js @HAS_SEDTR_TRUE@ cat resources/js/app.js | sed -E "s@(,|;)[[:space:]]*//..*@\1@g" | sed -E "s@^[[:space:]]*//..*@@g" | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > resources/js/app.js.tmp @HAS_SEDTR_TRUE@ ./bin2c resources/js/app.js.tmp src/appjs.h app_js @HAS_SEDTR_FALSE@ ./bin2c resources/js/app.js src/appjs.h app_js # 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: goaccess-1.3/NEWS0000644000000000000000000001054713375662727010563 00000000000000Copyright (C) 2009-2018 Gerardo Orellana * Version history: - 1.3 [Friday, November 23, 2018] . GoAccess 1.3 Released. See ChangeLog for new features/bug-fixes. - 1.2 [Tuesday, March 07, 2017] . GoAccess 1.2 Released. See ChangeLog for new features/bug-fixes. - 1.1.1 [Wednesday, November 23, 2016] . GoAccess 1.1.1 Released. See ChangeLog for new features/bug-fixes. - 1.1 [Tuesday, November 08, 2016] . GoAccess 1.1 Released. See ChangeLog for new features/bug-fixes. - 1.0.2 [Tuesday, July 05, 2016] . GoAccess 1.0.2 Released. See ChangeLog for new features/bug-fixes. - 1.0.1 [Friday, June 17, 2016] . GoAccess 1.0.1 Released. See ChangeLog for new features/bug-fixes. - 1.0 [Thursday, June 09, 2016] . GoAccess 1.0 Released. See ChangeLog for new features/bug-fixes. - 0.9.8 [Monday, February 29, 2016] . GoAccess 0.9.8 Released. See ChangeLog for new features/bug-fixes. - 0.9.7 [Monday, December 21, 2015] . GoAccess 0.9.7 Released. See ChangeLog for new features/bug-fixes. - 0.9.6 [Tuesday, October 27, 2015] . GoAccess 0.9.6 Released. See ChangeLog for new features/bug-fixes. - 0.9.5 [Thursday, October 22, 2015] . GoAccess 0.9.5 Released. See ChangeLog for new features/bug-fixes. - 0.9.4 [Tuesday, September 08 , 2015] . GoAccess 0.9.4 Released. See ChangeLog for new features/bug-fixes. - 0.9.3 [Wednesday, August 28, 2015] . GoAccess 0.9.3 Released. See ChangeLog for new features/bug-fixes. - 0.9.2 [Monday, July 06, 2015] . GoAccess 0.9.2 Released. See ChangeLog for new features/bug-fixes. - 0.9.1 [Tuesday, May 26, 2015] . GoAccess 0.9.1 Released. See ChangeLog for new features/bug-fixes. - 0.9 [Thursday, March 19, 2015] . GoAccess 0.9 Released. See ChangeLog for new features/bug-fixes. - 0.8.5 [Sunday, September 14, 2014] . GoAccess 0.8.5 Released. See ChangeLog for new features/bug-fixes. - 0.8.4 [Monday, September 08, 2014] . GoAccess 0.8.4 Released. See ChangeLog for new features/bug-fixes. - 0.8.3 [Monday, July 28, 2014] . GoAccess 0.8.3 Released. See ChangeLog for new features/bug-fixes. - 0.8.2 [Monday, July 21, 2014] . GoAccess 0.8.2 Released. See ChangeLog for new features/bug-fixes. - 0.8.1 [Monday, June 16, 2014] . GoAccess 0.8.1 Released. See ChangeLog for new features/bug-fixes. - 0.8 [Monday, May 20, 2013] . GoAccess 0.8 Released. See ChangeLog for new features/bug-fixes. - 0.7.1 [Monday, February 17, 2014] . GoAccess 0.7.1 Released. See ChangeLog for new features/bug-fixes. - 0.7 [Monday, December 16, 2013] . GoAccess 0.7 Released. See ChangeLog for new features/bug-fixes. - 0.6.1 [Monday, October 07, 2013] . GoAccess 0.6.1 Released. See ChangeLog for new features/bug-fixes. - 0.6 [Monday, July 15, 2013] . GoAccess 0.6 Released. See ChangeLog for new features/bug-fixes. - 0.5 [Monday, June 04, 2012] . GoAccess 0.5 Released. See ChangeLog for new features/bug-fixes. - 0.4.2 [Monday, January 03, 2011] . GoAccess 0.4.2 Released. See ChangeLog for new features/bug-fixes. - 0.4.1 [Monday, December 13, 2010] . GoAccess 0.4.1 Released. See ChangeLog for new features/bug-fixes. - 0.4 [Tuesday, November 30, 2010] . GoAccess 0.4 Released. See ChangeLog for new features/bug-fixes. - 0.3.3 [Monday, September 27, 2010] . GoAccess 0.3.3 Released. See ChangeLog for new features/bug-fixes. - 0.3.2 [Thursday, September 09 2010] . GoAccess 0.3.2 Released. See ChangeLog for new features/bug-fixes. - 0.3.1 [Friday, September 03, 2010] . GoAccess 0.3.1 Released. See ChangeLog for new features/bug-fixes. - 0.3 [Sunday, August 29, 2010] . GoAccess 0.3 Released. See ChangeLog for new features/bug-fixes. - 0.2 [Sunday, July 25, 2010] . GoAccess 0.2 Released. See ChangeLog for new features/bug-fixes. - 0.1.2 [Tuesday, July 13, 2010] . GoAccess 0.1.2 Released. See ChangeLog for new features/bug-fixes. - 0.1.1 [Saturday, July 10, 2010] . GoAccess 0.1.1 Released. See ChangeLog for new features/bug-fixes. - 0.1 [Wednesday, July 07, 2010] . Welcome to the GoAccess 0.1 Released. goaccess-1.3/TODO0000644000000000000000000000055213375663171010541 000000000000001Copyright (C) 2009-2018 6erardo Orellana For a more comprehensive list of to-do items, please refer to the GitHub site. https://github.com/allinurl/goaccess/issues or visit http://goaccess.io/faq#todo If you are interested in working on any of the items listed in there, email goaccess@prosoftcorp.com or better, open a new issue: goaccess-1.3/config.rpath0000755000000000000000000004401213160075065012347 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2010 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done 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 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 -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` 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-writeable 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 eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob 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` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob 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: goaccess-1.3/ABOUT-NLS0000644000000000000000000027215513160075065011301 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. 1.1 Quick configuration advice ============================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. 1.2 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the included GNU `gettext' library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might not be desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.3 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.4 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.5 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of May 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar as ast az be be@latin bg bn_IN bs ca crh +---------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] [] | iso_639_3 | [] | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ af am ar as ast az be be@latin bg bn_IN bs ca crh 6 0 2 3 19 1 11 3 28 3 1 38 5 cs da de el en en_GB en_ZA eo es et eu fa fi +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] [] [] | bfd | [] [] | bibshelf | [] [] [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] | bombono-dvd | [] [] | buzztard | [] [] [] | cflow | [] [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | [] | cppi | [] | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] [] | flex | [] [] [] | freedink | [] [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] [] | gjay | [] [] | gliv | [] [] [] [] | glunarclock | [] [] [] | gnubiff | () | gnucash | [] () () () () () | gnuedu | [] [] | gnulib | [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] [] [] | gpe-beam | [] [] [] [] [] | gpe-bluetooth | [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] [] | gpe-sketchbook | [] [] [] [] [] | gpe-su | [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] | gpe-todo | [] [] [] [] | gphoto2 | [] [] () [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] | gsasl | [] [] | gss | [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] [] | gstreamer | [] [] [] [] [] [] | gtick | [] () [] [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] [] [] | help2man | [] [] | hylafax | [] [] | idutils | [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] [] | iso_3166 | [] [] [] () [] [] [] () [] | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] [] | iso_639 | [] [] [] () [] [] [] | iso_639_3 | | jwhois | [] [] | kbd | [] [] [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] | klavaro | [] [] [] [] | latrine | [] () [] | ld | [] [] [] | leafpad | [] [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] [] | linkdr | [] [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] [] | mkisofs | [] | myserver | | nano | [] [] [] [] | opcodes | [] [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] [] | psmisc | [] [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] [] | rosegarden | () () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] [] | wget | [] [] [] [] | wyslij-po | [] | xchat | [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ cs da de el en en_GB en_ZA eo es et eu fa fi 64 105 117 18 1 8 0 28 89 18 19 0 104 fr ga gl gu he hi hr hu hy id is it ja ka kn +------------------------------------------------+ a2ps | [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] | bash | [] [] [] | bfd | [] [] | bibshelf | [] [] [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] | bombono-dvd | | buzztard | [] | cflow | [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] [] | cryptsetup | [] [] [] | dfarc | [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] | freedink | [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | () | glunarclock | [] [] [] | gnubiff | () [] () | gnucash | () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] | gpe-beam | [] [] [] | gpe-bluetooth | [] [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] | gpe-su | [] [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] [] | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | [] [] [] [] | gtick | [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] | help2man | [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | () [] [] | iso_3166 | () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | () [] [] [] [] | iso_639 | () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] | keytouch-editor | [] [] [] [] | keytouch-keyboa... | [] [] [] [] | klavaro | [] [] | latrine | [] [] | ld | [] [] [] | leafpad | [] [] [] [] [] [] () | libc | [] [] [] [] | libexif | | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] | linkdr | [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] | psmisc | [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] | rosegarden | () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] | sed | [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] | tar | [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] | xchat | [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | +------------------------------------------------+ fr ga gl gu he hi hr hu hy id is it ja ka kn 121 53 20 4 8 2 5 53 2 120 5 83 66 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 12 48 4 2 2 4 24 10 19 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 61 47 91 3 55 47 8 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] | 11 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 13 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 30 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () () | 9 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 22 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] [] | 25 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 6 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 13 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] | 16 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] | 60 xkeyboard-config | [] [] [] [] | 25 +---------------------------------------------------+ 84 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 2 0 10 66 50 155 17 97 7 41 2610 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If May 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.6 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. goaccess-1.3/compile0000755000000000000000000001615213375710677011436 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 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 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: goaccess-1.3/configure0000755000000000000000000112777513375710675012004 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for goaccess 1.3. # # 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: goaccess@prosoftcorp.com about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a 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='goaccess' PACKAGE_TARNAME='goaccess' PACKAGE_VERSION='1.3' PACKAGE_STRING='goaccess 1.3' PACKAGE_BUGREPORT='goaccess@prosoftcorp.com' PACKAGE_URL='http://goaccess.io' ac_unique_file="src/goaccess.c" gt_needs= # 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_header_list= ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS POW_LIB LIBOBJS HAS_SEDTR_FALSE HAS_SEDTR_TRUE TR_CHECK SED_CHECK TCB_FALSE TCB_TRUE GEOIP_MMDB_FALSE GEOIP_MMDB_TRUE GEOIP_LEGACY_FALSE GEOIP_LEGACY_TRUE WITH_RDYNAMIC_FALSE WITH_RDYNAMIC_TRUE DEBUG_FALSE DEBUG_TRUE POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS EGREP GREP CPP host_os host_vendor host_cpu host build_os build_vendor build_cpu build XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS 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__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_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_dependency_tracking enable_nls with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix enable_debug with_openssl enable_geoip with_getline enable_utf8 enable_tcb enable_zlib enable_bzip ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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 goaccess 1.3 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/goaccess] --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] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of goaccess 1.3:";; 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] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-debug Create a debug build. Default is disabled --enable-geoip Enable GeoIP country lookup. Default is disabled --enable-utf8 Enable ncurses library that handles wide characters --enable-tcb Enable TokyoCabinet database. Default is disabled --disable-zlib Build without ZLIB compression --disable-bzip Build without BZIP2 compression Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-openssl build with OpenSSL support --with-getline Build using dynamic line buffer. 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 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 . goaccess home page: . _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 goaccess configure 1.3 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_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_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_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 goaccess@prosoftcorp.com ## ## --------------------------------------- ##" ) | 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_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_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t # 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 goaccess $as_me 1.3, 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 gt_needs="$gt_needs " as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " alarm" # 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 am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$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\" \"$srcdir/..\" \"$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. # 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; } # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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; } 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 --run true"; then am_missing_run="$MISSING --run " 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}" != 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; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 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='goaccess' VERSION='1.3' 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"} # We need awk for the "check" target. 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}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ac_config_headers="$ac_config_headers src/config.h" # Use empty CFLAGS by default so autoconf does not add # CFLAGS="-O2 -g" # NOTE: Needs to go after AC_INIT and before AC_PROG_CC to select an # empty default instead. : ${CFLAGS=""} # 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 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 8's {/usr,}/bin/sh. touch 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 if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $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; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_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. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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; } && test -f conftest2.$ac_objext && { { 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 eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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; } && test -f conftest2.$ac_objext && { { 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 # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; 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_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; 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_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # 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_GMSGFMT="$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 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; 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_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; 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_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # 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 # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes 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 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" acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" # Fix `undefined reference to `libintl_gettext'` on docker: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libintl_dgettext in -lintl" >&5 $as_echo_n "checking for libintl_dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_libintl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 libintl_dgettext (); int main () { return libintl_dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_libintl_dgettext=yes else ac_cv_lib_intl_libintl_dgettext=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_intl_libintl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_libintl_dgettext" >&6; } if test "x$ac_cv_lib_intl_libintl_dgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi # pthread { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=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_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else as_fn_error $? "pthread is missing" "$LINENO" 5 fi CFLAGS="$CFLAGS -pthread" # DEBUG # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; debug="$enableval" else debug=no fi if test "$debug" = "yes"; then $as_echo "#define _DEBUG 1" >>confdefs.h fi if test "x$debug" = "xyes"; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi # Handle rdynamic only on systems using GNU ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with rdynamic for GNU ld" >&5 $as_echo_n "checking whether to build with rdynamic for GNU ld... " >&6; } with_rdyanimc=yes case "$host_os" in *darwin*|*cygwin*|*aix*|*mingw*) with_rdyanimc=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_rdyanimc" >&5 $as_echo "$with_rdyanimc" >&6; } if test "x$with_rdyanimc" = "xyes"; then WITH_RDYNAMIC_TRUE= WITH_RDYNAMIC_FALSE='#' else WITH_RDYNAMIC_TRUE='#' WITH_RDYNAMIC_FALSE= fi # Build with OpenSSL # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; openssl="$withval" else openssl="no" fi if test "$openssl" = 'yes'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 $as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $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 SSL_CTX_new (); int main () { return SSL_CTX_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_CTX_new=yes else ac_cv_lib_ssl_SSL_CTX_new=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_ssl_SSL_CTX_new" >&5 $as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; } if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" else as_fn_error $? "ssl library missing" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_free in -lcrypto" >&5 $as_echo_n "checking for CRYPTO_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_CRYPTO_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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 CRYPTO_free (); int main () { return CRYPTO_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_CRYPTO_free=yes else ac_cv_lib_crypto_CRYPTO_free=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_crypto_CRYPTO_free" >&5 $as_echo "$ac_cv_lib_crypto_CRYPTO_free" >&6; } if test "x$ac_cv_lib_crypto_CRYPTO_free" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "crypto library missing" "$LINENO" 5 fi fi # GeoIP # Check whether --enable-geoip was given. if test "${enable_geoip+set}" = set; then : enableval=$enable_geoip; geoip="$enableval" else geoip=no fi geolocation="N/A" if test "$geoip" = "mmdb"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMDB_open in -lmaxminddb" >&5 $as_echo_n "checking for MMDB_open in -lmaxminddb... " >&6; } if ${ac_cv_lib_maxminddb_MMDB_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmaxminddb $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 MMDB_open (); int main () { return MMDB_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_maxminddb_MMDB_open=yes else ac_cv_lib_maxminddb_MMDB_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_maxminddb_MMDB_open" >&5 $as_echo "$ac_cv_lib_maxminddb_MMDB_open" >&6; } if test "x$ac_cv_lib_maxminddb_MMDB_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMAXMINDDB 1 _ACEOF LIBS="-lmaxminddb $LIBS" else as_fn_error $? " *** Missing development files for libmaxminddb library. " "$LINENO" 5 fi geolocation="GeoIP2" $as_echo "#define HAVE_GEOLOCATION 1" >>confdefs.h elif test "$geoip" = "legacy"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GeoIP_new in -lGeoIP" >&5 $as_echo_n "checking for GeoIP_new in -lGeoIP... " >&6; } if ${ac_cv_lib_GeoIP_GeoIP_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGeoIP $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 GeoIP_new (); int main () { return GeoIP_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GeoIP_GeoIP_new=yes else ac_cv_lib_GeoIP_GeoIP_new=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_GeoIP_GeoIP_new" >&5 $as_echo "$ac_cv_lib_GeoIP_GeoIP_new" >&6; } if test "x$ac_cv_lib_GeoIP_GeoIP_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEOIP 1 _ACEOF LIBS="-lGeoIP $LIBS" else as_fn_error $? " *** Missing development files for the GeoIP library " "$LINENO" 5 fi geolocation="GeoIP Legacy" $as_echo "#define HAVE_GEOLOCATION 1" >>confdefs.h fi if test "x$geoip" = "xlegacy"; then GEOIP_LEGACY_TRUE= GEOIP_LEGACY_FALSE='#' else GEOIP_LEGACY_TRUE='#' GEOIP_LEGACY_FALSE= fi if test "x$geoip" = "xmmdb"; then GEOIP_MMDB_TRUE= GEOIP_MMDB_FALSE='#' else GEOIP_MMDB_TRUE='#' GEOIP_MMDB_FALSE= fi # GNU getline / POSIX.1-2008 # Check whether --with-getline was given. if test "${with_getline+set}" = set; then : withval=$with_getline; with_getline=$withval else with_getline=no fi if test "$with_getline" = "yes"; then $as_echo "#define WITH_GETLINE 1" >>confdefs.h fi # UTF8 # Check whether --enable-utf8 was given. if test "${enable_utf8+set}" = set; then : enableval=$enable_utf8; utf8="$enableval" else utf8=no fi if test "$utf8" = "yes"; then libncursesw=ncursesw # Simply called libncurses on OS X case "$host_os" in *darwin*) libncursesw=ncurses ;; esac as_ac_Lib=`$as_echo "ac_cv_lib_$libncursesw''_mvaddwstr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mvaddwstr in -l$libncursesw" >&5 $as_echo_n "checking for mvaddwstr in -l$libncursesw... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$libncursesw $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 mvaddwstr (); int main () { return mvaddwstr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_LIB$libncursesw" | $as_tr_cpp` 1 _ACEOF LIBS="-l$libncursesw $LIBS" else as_fn_error $? "*** Missing development libraries for ncursesw" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 $as_echo_n "checking for library containing tputs... " >&6; } if ${ac_cv_search_tputs+:} 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 tputs (); int main () { return tputs (); ; return 0; } _ACEOF for ac_lib in '' tinfow; 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_tputs=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_tputs+:} false; then : break fi done if ${ac_cv_search_tputs+:} false; then : else ac_cv_search_tputs=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5 $as_echo "$ac_cv_search_tputs" >&6; } ac_res=$ac_cv_search_tputs if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "Cannot find a library providing tputs" "$LINENO" 5 fi $as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h have_ncurses="yes" for ac_header in ncursesw/ncurses.h do : ac_fn_c_check_header_compile "$LINENO" "ncursesw/ncurses.h" "ac_cv_header_ncursesw_ncurses_h" " #ifdef HAVE_NCURSESW_NCURSES_H #include #endif " if test "x$ac_cv_header_ncursesw_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSESW_NCURSES_H 1 _ACEOF have_ncurses=yes fi done for ac_header in ncurses.h do : ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" " #ifdef HAVE_NCURSES_H #include #endif " if test "x$ac_cv_header_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_H 1 _ACEOF have_ncurses=yes fi done if test "$have_ncurses" != "yes"; then as_fn_error $? "Missing ncursesw header file" "$LINENO" 5 fi 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 : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNCURSES 1 _ACEOF LIBS="-lncurses $LIBS" else as_fn_error $? "*** Missing development libraries for ncurses" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5 $as_echo_n "checking for library containing tputs... " >&6; } if ${ac_cv_search_tputs+:} 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 tputs (); int main () { return tputs (); ; return 0; } _ACEOF for ac_lib in '' tinfo; 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_tputs=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_tputs+:} false; then : break fi done if ${ac_cv_search_tputs+:} false; then : else ac_cv_search_tputs=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5 $as_echo "$ac_cv_search_tputs" >&6; } ac_res=$ac_cv_search_tputs if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "Cannot find a library providing tputs" "$LINENO" 5 fi have_ncurses="yes" for ac_header in ncurses/ncurses.h do : ac_fn_c_check_header_compile "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" " #ifdef HAVE_NCURSES_NCURSES_H #include #endif " if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_NCURSES_H 1 _ACEOF have_ncurses=yes fi done for ac_header in ncurses.h do : ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" " #ifdef HAVE_NCURSES_H #include #endif " if test "x$ac_cv_header_ncurses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NCURSES_H 1 _ACEOF have_ncurses=yes fi done for ac_header in curses.h do : ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" " #ifdef HAVE_CURSES_H #include #endif " if test "x$ac_cv_header_curses_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CURSES_H 1 _ACEOF have_ncurses=yes fi done if test "$have_ncurses" != "yes"; then as_fn_error $? "Missing ncursesw header file" "$LINENO" 5 fi fi # Tokyo Cabinet # Check whether --enable-tcb was given. if test "${enable_tcb+set}" = set; then : enableval=$enable_tcb; tcb="$enableval" else tcb=no fi WITH_TC=no if test "$tcb" = "memhash"; then WITH_TC=yes $as_echo "#define TCB_MEMHASH 1" >>confdefs.h elif test "$tcb" = "btree"; then $as_echo "#define TCB_BTREE 1" >>confdefs.h WITH_TC=yes fi if test "$WITH_TC" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tchdbnew in -ltokyocabinet" >&5 $as_echo_n "checking for tchdbnew in -ltokyocabinet... " >&6; } if ${ac_cv_lib_tokyocabinet_tchdbnew+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltokyocabinet $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 tchdbnew (); int main () { return tchdbnew (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tokyocabinet_tchdbnew=yes else ac_cv_lib_tokyocabinet_tchdbnew=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_tokyocabinet_tchdbnew" >&5 $as_echo "$ac_cv_lib_tokyocabinet_tchdbnew" >&6; } if test "x$ac_cv_lib_tokyocabinet_tchdbnew" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTOKYOCABINET 1 _ACEOF LIBS="-ltokyocabinet $LIBS" else as_fn_error $? "*** Missing development libraries for Tokyo Cabinet Database" "$LINENO" 5 fi # Check whether --enable-zlib was given. if test "${enable_zlib+set}" = set; then : enableval=$enable_zlib; zlib="$enableval" else zlib=yes fi if test "$zlib" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 $as_echo_n "checking for gzread in -lz... " >&6; } if ${ac_cv_lib_z_gzread+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $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 gzread (); int main () { return gzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_gzread=yes else ac_cv_lib_z_gzread=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_z_gzread" >&5 $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : Z_FLAG=-lz else as_fn_error $? " *** zlib is required. If zlib compression is not needed *** you can use --disable-zlib. *** Debian based distributions zlib1g-dev *** Red Hat based distributions zlib-devel " "$LINENO" 5 fi $as_echo "#define HAVE_ZLIB 1" >>confdefs.h LDFLAGS="$LDFLAGS $Z_FLAG" fi # Check whether --enable-bzip was given. if test "${enable_bzip+set}" = set; then : enableval=$enable_bzip; bz2="$enableval" else bz2=yes fi if test "$bz2" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzopen in -lbz2" >&5 $as_echo_n "checking for BZ2_bzopen in -lbz2... " >&6; } if ${ac_cv_lib_bz2_BZ2_bzopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $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 BZ2_bzopen (); int main () { return BZ2_bzopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bz2_BZ2_bzopen=yes else ac_cv_lib_bz2_BZ2_bzopen=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_bz2_BZ2_bzopen" >&5 $as_echo "$ac_cv_lib_bz2_BZ2_bzopen" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzopen" = xyes; then : BZ2_FLAG=-lbz2 else as_fn_error $? " *** BZIP2 is required. If BZIP2 compression is not needed *** you can use --disable-bzip. *** Debian based distributions libbz2-dev *** Red Hat based distributions bzip2-devel " "$LINENO" 5 fi $as_echo "#define HAVE_BZ2 1" >>confdefs.h LDFLAGS="$LDFLAGS $BZ2_FLAG" fi case "$host_os" in *darwin*|*bsd*) LDFLAGS="$LDFLAGS -ltokyocabinet -lc" ;; *) LDFLAGS="$LDFLAGS -ltokyocabinet -lrt -lc" ;; esac fi if test "$WITH_TC" = "yes"; then TCB_TRUE= TCB_FALSE='#' else TCB_TRUE='#' TCB_FALSE= fi if test "$tcb" = "memhash"; then storage="In-memory Hash Database (Tokyo Cabinet)" elif test "$tcb" = "btree"; then storage="On-disk B+ Tree Database (Tokyo Cabinet)" else storage="In-memory Hash Database (Default)" fi HAS_SEDTR=no # Extract the first word of "sed", so it can be a program name with args. set dummy sed; 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_SED_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SED_CHECK"; then ac_cv_prog_SED_CHECK="$SED_CHECK" # 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_SED_CHECK="yes" $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 test -z "$ac_cv_prog_SED_CHECK" && ac_cv_prog_SED_CHECK="no" fi fi SED_CHECK=$ac_cv_prog_SED_CHECK if test -n "$SED_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED_CHECK" >&5 $as_echo "$SED_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$SED_CHECK" == x"yes" ; then # Extract the first word of "tr", so it can be a program name with args. set dummy tr; 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_TR_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TR_CHECK"; then ac_cv_prog_TR_CHECK="$TR_CHECK" # 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_TR_CHECK="yes" $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 test -z "$ac_cv_prog_TR_CHECK" && ac_cv_prog_TR_CHECK="no" fi fi TR_CHECK=$ac_cv_prog_TR_CHECK if test -n "$TR_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR_CHECK" >&5 $as_echo "$TR_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$TR_CHECK" == x"yes" ; then HAS_SEDTR=yes fi fi if test "x$HAS_SEDTR" = xyes; then HAS_SEDTR_TRUE= HAS_SEDTR_FALSE='#' else HAS_SEDTR_TRUE='#' HAS_SEDTR_FALSE= fi # Solaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=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_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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 socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=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_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi # Checks for header files. { $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 for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in locale.h do : ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETDB_H 1 _ACEOF fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETINET_IN_H 1 _ACEOF fi done for ac_header in stddef.h do : ac_fn_c_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" if test "x$ac_cv_header_stddef_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDDEF_H 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF fi done for ac_header in strings.h do : ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" if test "x$ac_cv_header_strings_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRINGS_H 1 _ACEOF fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SOCKET_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $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" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" if test "x$ac_cv_type_ptrdiff_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=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_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in $ac_header_list 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 for ac_func in $ac_func_list 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } if ${ac_cv_func_working_mktime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static const char *tz_strings[] = { (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (;;) { t = (time_t_max << 1) + 1; if (t <= time_t_max) break; time_t_max = t; } time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; ; j <<= 1) if (! bigtime_test (j)) return 1; else if (INT_MAX / 2 < j) break; if (! bigtime_test (INT_MAX)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else ac_cv_func_working_mktime=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; esac fi { $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 strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $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 strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=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_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if ${ac_cv_func_strtod+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} 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 pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=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_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in floor do : ac_fn_c_check_func "$LINENO" "floor" "ac_cv_func_floor" if test "x$ac_cv_func_floor" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLOOR 1 _ACEOF fi done for ac_func in gethostbyaddr do : ac_fn_c_check_func "$LINENO" "gethostbyaddr" "ac_cv_func_gethostbyaddr" if test "x$ac_cv_func_gethostbyaddr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYADDR 1 _ACEOF fi done for ac_func in gethostbyname do : ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYNAME 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in malloc do : ac_fn_c_check_func "$LINENO" "malloc" "ac_cv_func_malloc" if test "x$ac_cv_func_malloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC 1 _ACEOF fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMSET 1 _ACEOF fi done for ac_func in mkfifo do : ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" if test "x$ac_cv_func_mkfifo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKFIFO 1 _ACEOF fi done for ac_func in realloc do : ac_fn_c_check_func "$LINENO" "realloc" "ac_cv_func_realloc" if test "x$ac_cv_func_realloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REALLOC 1 _ACEOF fi done for ac_func in realpath do : ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" if test "x$ac_cv_func_realpath" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REALPATH 1 _ACEOF fi done for ac_func in regcomp do : ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" if test "x$ac_cv_func_regcomp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_REGCOMP 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SELECT 1 _ACEOF fi done for ac_func in setlocale do : ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" if test "x$ac_cv_func_setlocale" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETLOCALE 1 _ACEOF fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKET 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strchr do : ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" if test "x$ac_cv_func_strchr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCHR 1 _ACEOF fi done for ac_func in strcspn do : ac_fn_c_check_func "$LINENO" "strcspn" "ac_cv_func_strcspn" if test "x$ac_cv_func_strcspn" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCSPN 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strncasecmp do : ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNCASECMP 1 _ACEOF fi done for ac_func in strpbrk do : ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk" if test "x$ac_cv_func_strpbrk" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRPBRK 1 _ACEOF fi done for ac_func in strrchr do : ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" if test "x$ac_cv_func_strrchr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRRCHR 1 _ACEOF fi done for ac_func in strspn do : ac_fn_c_check_func "$LINENO" "strspn" "ac_cv_func_strspn" if test "x$ac_cv_func_strspn" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRSPN 1 _ACEOF fi done for ac_func in strstr do : ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" if test "x$ac_cv_func_strstr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRSTR 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOL 1 _ACEOF fi done for ac_func in strtoull do : ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" if test "x$ac_cv_func_strtoull" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOULL 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile po/Makefile.in" 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 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 "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_RDYNAMIC_TRUE}" && test -z "${WITH_RDYNAMIC_FALSE}"; then as_fn_error $? "conditional \"WITH_RDYNAMIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GEOIP_LEGACY_TRUE}" && test -z "${GEOIP_LEGACY_FALSE}"; then as_fn_error $? "conditional \"GEOIP_LEGACY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GEOIP_MMDB_TRUE}" && test -z "${GEOIP_MMDB_FALSE}"; then as_fn_error $? "conditional \"GEOIP_MMDB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TCB_TRUE}" && test -z "${TCB_FALSE}"; then as_fn_error $? "conditional \"TCB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAS_SEDTR_TRUE}" && test -z "${HAS_SEDTR_FALSE}"; then as_fn_error $? "conditional \"HAS_SEDTR\" 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 goaccess $as_me 1.3, 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 . goaccess home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ goaccess config.status 1.3 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" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _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 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; *) 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"" || { # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 } ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac 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 cat << EOF Your build configuration: Prefix : $prefix Package : $PACKAGE_NAME Version : $VERSION Compiler flags : $CFLAGS Linker flags : $LIBS $LDFLAGS Dynamic buffer : $with_getline Geolocation : $geolocation Storage method : $storage TLS/SSL : $openssl Bugs : $PACKAGE_BUGREPORT EOF goaccess-1.3/goaccess.10000644000000000000000000011005113375662433011716 00000000000000.TH goaccess 1 "NOVEMBER 2018" Linux "User Manuals" .SH NAME goaccess \- fast web log analyzer and interactive viewer. .SH SYNOPSIS .LP .B goaccess [filename] [options...] [-c][-M][-H][-q][-d][...] .SH DESCRIPTION .B goaccess GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a .I terminal in *nix systems or through your .I browser. .P It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. .P GoAccess parses the specified web log file and outputs the data to the X terminal. Features include: .IP "General Statistics:" This panel gives a summary of several metrics, such as the number of valid and invalid requests, time taken to analyze the dataset, unique visitors, requested files, static files (CSS, ICO, JPG, etc) HTTP referrers, 404s, size of the parsed log file and bandwidth consumption. .IP "Unique visitors" This panel shows metrics such as hits, unique visitors and cumulative bandwidth per date. HTTP requests containing the same IP, the same date, and the same user agent are considered a unique visitor. By default, it includes web crawlers/spiders. .IP Optionally, date specificity can be set to the hour level using .I --date-spec=hr which will display dates such as 05/Jun/2016:16. This is great if you want to track your daily traffic at the hour level. .IP "Requested files" This panel displays the most requested files on your web server. It shows hits, unique visitors, and percentage, along with the cumulative bandwidth, protocol, and the request method used. .IP "Requested static files" Lists the most frequently static files such as: JPG, CSS, SWF, JS, GIF, and PNG file types, along with the same metrics as the last panel. Additional static files can be added to the configuration file. .IP "404 or Not Found" Displays the same metrics as the previous request panels, however, its data contains all pages that were not found on the server, or commonly known as 404 status code. .IP "Hosts" This panel has detailed information on the hosts themselves. This is great for spotting aggressive crawlers and identifying who's eating your bandwidth. Expanding the panel can display more information such as host's reverse DNS lookup result, country of origin and city. If the .I -a argument is enabled, a list of user agents can be displayed by selecting the desired IP address, and then pressing ENTER. .IP "Operating Systems" This panel will report which operating system the host used when it hit the server. It attempts to provide the most specific version of each operating system. .IP "Browsers" This panel will report which browser the host used when it hit the server. It attempts to provide the most specific version of each browser. .IP "Visit Times" This panel will display an hourly report. This option displays 24 data points, one for each hour of the day. .IP Optionally, hour specificity can be set to the tenth of an hour level using .I --hour-spec=min which will display hours as 16:4 This is great if you want to spot peaks of traffic on your server. .IP "Virtual Hosts" This panel will display all the different virtual hosts parsed from the access log. This panel is displayed if .I %v is used within the log-format string. .IP "Referrers URLs" If the host in question accessed the site via another resource, or was linked/diverted to you from another host, the URL they were referred from will be provided in this panel. See `--ignore-panel` in your configuration file to enable it. .I disabled by default. .IP "Referring Sites" This panel will display only the host part but not the whole URL. The URL where the request came from. .IP "Keyphrases" It reports keyphrases used on Google search, Google cache, and Google translate that have lead to your web server. At present, it only supports Google search queries via HTTP. See `--ignore-panel` in your configuration file to enable it. .I disabled by default. .IP "Geo Location" Determines where an IP address is geographically located. Statistics are broken down by continent and country. It needs to be compiled with GeoLocation support. .IP "HTTP Status Codes" The values of the numeric status code to HTTP requests. .IP "Remote User (HTTP authentication)" This is the userid of the person requesting the document as determined by HTTP authentication. If the document is not password protected, this part will be "-" just like the previous one. This panel is not enabled unless .I %e is given within the log-format variable. .P .I NOTE: Optionally and if configured, all panels can display the average time taken to serve the request. .SH STORAGE .P There are three storage options that can be used with GoAccess. Choosing one will depend on your environment and needs. .TP Default Hash Tables In-memory storage provides better performance at the cost of limiting the dataset size to the amount of available physical memory. By default GoAccess uses in-memory hash tables. If your dataset can fit in memory, then this will perform fine. It has very good memory usage and pretty good performance. .TP Tokyo Cabinet On-Disk B+ Tree Use this storage method for large datasets where it is not possible to fit everything in memory. The B+ tree database is slower than any of the hash databases since data has to be committed to disk. However, using an SSD greatly increases the performance. You may also use this storage method if you need data persistence to quickly load statistics at a later date. .TP Tokyo Cabinet In-memory Hash Database An alternative to the default hash tables. It uses generic typing and thus it's performance in terms of memory and speed is average. .SH CONFIGURATION .P Multiple options can be used to configure GoAccess. For a complete up-to-date list of configure options, run .I ./configure --help .TP \fB\-\-enable-debug Compile with debugging symbols and turn off compiler optimizations. .TP \fB\-\-enable-utf8 Compile with wide character support. Ncursesw is required. .TP \fB\-\-enable-geoip= Compile with GeoLocation support. MaxMind's GeoIP is required. .I legacy will utilize the original GeoIP databases. .I mmdb will utilize the enhanced GeoIP2 databases. .TP \fB\-\-enable-tcb= Compile with Tokyo Cabinet storage support. .I memhash will utilize Tokyo Cabinet's on-memory hash database. .I btree will utilize Tokyo Cabinet's on-disk B+ Tree database. .TP \fB\-\-disable-zlib Disable zlib compression on B+ Tree database. .TP \fB\-\-disable-bzip Disable bzip2 compression on B+ Tree database. .TP \fB\-\-with-getline Dynamically expands line buffer in order to parse full line requests instead of using a fixed size buffer of 4096. .TP \fB\-\-with-openssl Compile GoAccess with OpenSSL support for its WebSocket server. .SH OPTIONS .P The following options can be supplied to the command or specified in the configuration file. If specified in the configuration file, long options need to be used without prepending -- and without using the equal sign =. .SS LOG/DATE/TIME FORMAT .TP \fB\-\-time-format= The time-format variable followed by a space, specifies the log format time containing either a name of a predefined format (see options below) or any combination of regular characters and special format specifiers. .IP They all begin with a percentage (%) sign. See `man strftime`. .I %T or %H:%M:%S. .IP Note that if a timestamp is given in microseconds, .I %f must be used as time-format .TP \fB\-\-date-format= The date-format variable followed by a space, specifies the log format time containing either a name of a predefined format (see options below) or any combination of regular characters and special format specifiers. .IP They all begin with a percentage (%) sign. See `man strftime`. .I %Y-%m-%d. .IP Note that if a timestamp is given in microseconds, .I %f must be used as date-format .TP \fB\-\-log-format= The log-format variable followed by a space or .I \\\\t for tab-delimited, specifies the log format string. Note that if there are spaces within the format, the string needs to be enclosed in single/double quotes. Inner quotes need to be escaped. .IP In addition to specifying the raw log/date/time formats, for simplicity, any of the following predefined log format names can be supplied to the log/date/time-format variables. GoAccess can also handle one predefined name in one variable and another predefined name in another variable. .IP COMBINED - Combined Log Format, VCOMBINED - Combined Log Format with Virtual Host, COMMON - Common Log Format, VCOMMON - Common Log Format with Virtual Host, W3C - W3C Extended Log File Format, SQUID - Native Squid Log Format, CLOUDFRONT - Amazon CloudFront Web Distribution, CLOUDSTORAGE - Google Cloud Storage, AWSELB - Amazon Elastic Load Balancing, AWSS3 - Amazon Simple Storage Service (S3) .IP .I Note: Piping data into GoAccess won't prompt a log/date/time configuration dialog, you will need to previously define it in your configuration file or in the command line. .SS USER INTERFACE OPTIONS .TP \fB\-c \-\-config-dialog Prompt log/time/date configuration window on program start. Only when curses is initialized. .TP \fB\-i \-\-hl-header Color highlight active terminal panel. .TP \fB\-m \-\-with-mouse Enable mouse support on main terminal dashboard. .TP \fB\-\-\-color= Specify custom colors for the terminal output. .I Color Syntax DEFINITION space/tab colorFG#:colorBG# [attributes,PANEL] FG# = foreground color [-1...255] (-1 = default term color) BG# = background color [-1...255] (-1 = default term color) Optionally, it is possible to apply color attributes (multiple attributes are comma separated), such as: .I bold, .I underline, .I normal, .I reverse, .I blink If desired, it is possible to apply custom colors per panel, that is, a metric in the REQUESTS panel can be of color A, while the same metric in the BROWSERS panel can be of color B. .I Available color definitions: COLOR_MTRC_HITS COLOR_MTRC_VISITORS COLOR_MTRC_DATA COLOR_MTRC_BW COLOR_MTRC_AVGTS COLOR_MTRC_CUMTS COLOR_MTRC_MAXTS COLOR_MTRC_PROT COLOR_MTRC_MTHD COLOR_MTRC_HITS_PERC COLOR_MTRC_HITS_PERC_MAX COLOR_MTRC_VISITORS_PERC COLOR_MTRC_VISITORS_PERC_MAX COLOR_PANEL_COLS COLOR_BARS COLOR_ERROR COLOR_SELECTED COLOR_PANEL_ACTIVE COLOR_PANEL_HEADER COLOR_PANEL_DESC COLOR_OVERALL_LBLS COLOR_OVERALL_VALS COLOR_OVERALL_PATH COLOR_ACTIVE_LABEL COLOR_BG COLOR_DEFAULT COLOR_PROGRESS See configuration file for a sample color scheme. .TP \fB\-\-color-scheme=<1|2|3> Choose among color schemes. .I 1 for the default grey scheme. .I 2 for the green scheme. .I 3 for the Monokai scheme (shown only if terminal supports 256 colors). .TP \fB\-\-crawlers-only Parse and display only crawlers (bots). .TP \fB\-\-html-custom-css= Specifies a custom CSS file path to load in the HTML report. .TP \fB\-\-html-custom-js= Specifies a custom JS file path to load in the HTML report. .TP \fB\-\-html-report-title= Set HTML report page title and header. .TP \fB\-\-html-prefs=<JSON> Set HTML report default preferences. Supply a valid JSON object containing the HTML preferences. It allows the ability to customize each panel plot. See example below. .IP .I Note: The JSON object passed needs to be a one line JSON string. For instance, .IP \-\-html-prefs='{"theme":"bright","perPage":5,"layout":"horizontal","showTables":true,"visitors":{"plot":{"chartType":"bar"}}}' .TP \fB\-\-json-pretty-print Format JSON output using tabs and newlines. .IP .I Note: This is not recommended when outputting a real-time HTML report since the WebSocket payload will much much larger. .TP \fB\-\-max-items=<number> The maximum number of items to display per panel. The maximum can be a number between 1 and n. .IP .I Note: Only the CSV and JSON output allow a maximum number greater than the default value of 366 (or 50 in the real-time HTML output) items per panel. .TP \fB\-\-no-color Turn off colored output. This is the default output on terminals that do not support colors. .TP \fB\-\-no-column-names Don't write column names in the terminal output. By default, it displays column names for each available metric in every panel. .TP \fB\-\-no-csv-summary Disable summary metrics on the CSV output. .TP \fB\-\-no-progress Disable progress metrics [total requests/requests per second]. .TP \fB\-\-no-tab-scroll Disable scrolling through panels when TAB is pressed or when a panel is selected using a numeric key. .TP \fB\-\-no-html-last-updated Do not show the last updated field displayed in the HTML generated report. .TP \fB\-\-no-parsing-spinner Do now show the progress metrics and parsing spinner. .SS SERVER OPTIONS .TP \fB\-\-addr Specify IP address to bind the server to. Otherwise it binds to 0.0.0.0. .IP Usually there is no need to specify the address, unless you intentionally would like to bind the server to a different address within your server. .TP \fB\-\-daemonize Run GoAccess as daemon (only if \fB\-\-real-time-html enabled). .IP Note: It's important to make use of absolute paths across GoAccess' configuration. .TP \fB\-\-origin=<url> Ensure clients send the specified origin header upon the WebSocket handshake. .TP \fB\-\-pid-file=<path/goaccess.pid> Write the daemon PID to a file when used along the --daemonize option. .TP \fB\-\-port=<port> Specify the port to use. By default GoAccess' WebSocket server listens on port 7890. .TP \fB\-\-real-time-html Enable real-time HTML output. .IP GoAccess uses its own WebSocket server to push the data from the server to the client. See http://gwsocket.io for more details how the WebSocket server works. .TP \fB\-\-ws-url=<[scheme://]url[:port]> URL to which the WebSocket server responds. This is the URL supplied to the WebSocket constructor on the client side. .IP Optionally, it is possible to specify the WebSocket URI scheme, such as .I ws:// or .I wss:// for unencrypted and encrypted connections. e.g., .I wss://goaccess.io .IP If GoAccess is running behind a proxy, you could set the client side to connect to a different port by specifying the host followed by a colon and the port. e.g., .I goaccess.io:9999 . e.g., .IP By default, it will attempt to connect to the generated report's hostname. If GoAccess is running on a remote server, the host of the remote server should be specified here. Also, make sure it is a valid host and NOT an http address. .TP \fB\-\-fifo-in=<path/file> Creates a named pipe (FIFO) that reads from on the given path/file. .TP \fB\-\-fifo-out=<path/file> Creates a named pipe (FIFO) that writes to the given path/file. .TP \fB\-\-ssl-cert=<cert.crt> Path to TLS/SSL certificate. In order to enable TLS/SSL support, GoAccess requires that \-\-ssl-cert and \-\-ssl-key are used. Only if configured using --with-openssl .TP \fB\-\-ssl-key=<priv.key> Path to TLS/SSL private key. In order to enable TLS/SSL support, GoAccess requires that \-\-ssl-cert and \-\-ssl-key are used. Only if configured using --with-openssl .SS FILE OPTIONS .TP \fB\-f \-\-log-file=<logfile> Specify the path to the input log file. If set in the config file, it will take priority over -f from the command line. .TP \fB\-S \-\-log-size=<bytes> Specify the log size in bytes. This is useful when piping in logs for processing in which the log size can be explicitly set. .TP \fB\-l \-\-debug-file=<debugfile> Send all debug messages to the specified file. .TP \fB\-p \-\-config-file=<configfile> Specify a custom configuration file to use. If set, it will take priority over the global configuration file (if any). .TP \fB\-\-invalid-requests=<filename> Log invalid requests to the specified file. .TP \fB\-\-no-global-config Do not load the global configuration file. This directory should normally be /usr/local/etc, unless specified with .I --sysconfdir=/dir. See --dcf option for finding the default configuration file. .SS PARSE OPTIONS .TP \fB\-a \-\-agent-list Enable a list of user-agents by host. For faster parsing, do not enable this flag. .TP \fB\-d \-\-with-output-resolver Enable IP resolver on HTML|JSON output. .TP \fB\-e \-\-exclude-ip=<IP|IP-range> Exclude an IPv4 or IPv6 from being counted. Ranges can be included as well using a dash in between the IPs (start-end). .IP .I Examples: exclude-ip 127.0.0.1 exclude-ip 192.168.0.1-192.168.0.100 exclude-ip ::1 exclude-ip 0:0:0:0:0:ffff:808:804-0:0:0:0:0:ffff:808:808 .TP \fB\-H \-\-http-protocol=<yes|no> Set/unset HTTP request protocol. This will create a request key containing the request protocol + the actual request. .TP \fB\-M \-\-http-method=<yes|no> Set/unset HTTP request method. This will create a request key containing the request method + the actual request. .TP \fB\-o \-\-output=<path/file.[json|csv|html]> Write output to stdout given one of the following files and the corresponding extension for the output format: .IP /path/file.csv - Comma-separated values (CSV) /path/file.json - JSON (JavaScript Object Notation) /path/file.html - HTML .TP \fB\-q \-\-no-query-string Ignore request's query string. i.e., www.google.com/page.htm?query => www.google.com/page.htm. .IP .I Note: Removing the query string can greatly decrease memory consumption, especially on timestamped requests. .TP \fB\-r \-\-no-term-resolver Disable IP resolver on terminal output. .TP \fB\-\-444-as-404 Treat non-standard status code 444 as 404. .TP \fB\-\-4xx-to-unique-count Add 4xx client errors to the unique visitors count. .TP \fB\-\-accumulated-time Store accumulated processing time from parsing day-by-day logs. Only if configured with --enable-tcb=btree .TP \fB\-\-anonymize-ip Anonymize the client IP address. The IP anonymization option sets the last octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to zeros. e.g., 192.168.20.100 => 192.168.20.0 e.g., 2a03:2880:2110:df07:face:b00c::1 => 2a03:2880:2110:df07:: .TP \fB\-\-all-static-files Include static files that contain a query string. e.g., /fonts/fontawesome-webfont.woff?v=4.0.3 .TP \fB\-\-browsers-file=<path> Include an additional delimited list of browsers/crawlers/feeds etc. See config/browsers.list for an example or https://raw.githubusercontent.com/allinurl/goaccess/master/config/browsers.list .TP \fB\-\-date-spec=<date|hr> Set the date specificity to either date (default) or hr to display hours appended to the date. .IP This is used in the visitors panel. It's useful for tracking visitors at the hour level. For instance, an hour specificity would yield to display traffic as 18/Dec/2010:19 .TP \fB\-\-double-decode Decode double-encoded values. This includes, user-agent, request, and referer. .TP \fB\-\-enable-panel=<PANEL> Enable parsing and displaying the given panel. .IP .I Available panels: VISITORS REQUESTS REQUESTS_STATIC NOT_FOUND HOSTS OS BROWSERS VISIT_TIMES VIRTUAL_HOSTS REFERRERS REFERRING_SITES KEYPHRASES STATUS_CODES REMOTE_USER GEO_LOCATION .TP \fB\-\-hide-referer=<NEEDLE> Hide a referer but still count it. Wild cards are allowed in the needle. i.e., *.bing.com. .TP \fB\-\-hour-spec=<hr|min> Set the time specificity to either hour (default) or min to display the tenth of an hour appended to the hour. .IP This is used in the time distribution panel. It's useful for tracking peaks of traffic on your server at specific times. .TP \fB\-\-ignore-crawlers Ignore crawlers from being counted. .TP \fB\-\-ignore-panel=<PANEL> Ignore parsing and displaying the given panel. .IP .I Available panels: VISITORS REQUESTS REQUESTS_STATIC NOT_FOUND HOSTS OS BROWSERS VISIT_TIMES VIRTUAL_HOSTS REFERRERS REFERRING_SITES KEYPHRASES STATUS_CODES REMOTE_USER .TP \fB\-\-ignore-referer=<referer> Ignore referers from being counted. Wildcards allowed. e.g., .I *.domain.com .I ww?.domain.* .TP \fB\-\-ignore-status=<CODE> Ignore parsing and displaying one or multiple status code(s). For multiple status codes, use this option multiple times. .TP \fB\-\-num-tests=<number> Number of lines from the access log to test against the provided log/date/time format. By default, the parser is set to test 10 lines. If set to 0, the parser won't test any lines and will parse the whole access log. If a line matches the given log/date/time format before it reaches .I <number>, the parser will consider the log to be valid, otherwise GoAccess will return EXIT_FAILURE and display the relevant error messages. .TP \fB\-\-process-and-exit Parse log and exit without outputting data. Useful if we are looking to only add new data to the on-disk database without outputting to a file or a terminal. .TP \fB\-\-real-os Display real OS names. e.g, Windows XP, Snow Leopard. .TP \fB\-\-sort-panel=<PANEL,FIELD,ORDER> Sort panel on initial load. Sort options are separated by comma. Options are in the form: PANEL,METRIC,ORDER .IP .I Available metrics: BY_HITS - Sort by hits BY_VISITORS - Sort by unique visitors BY_DATA - Sort by data BY_BW - Sort by bandwidth BY_AVGTS - Sort by average time served BY_CUMTS - Sort by cumulative time served BY_MAXTS - Sort by maximum time served BY_PROT - Sort by http protocol BY_MTHD - Sort by http method .IP .I Available orders: ASC DESC .TP \fB\-\-static-file=<extension> Add static file extension. e.g.: .I .mp3 Extensions are case sensitive. .SS GEOLOCATION OPTIONS .TP \fB\-g \-\-std-geoip Standard GeoIP database for less memory usage. .TP \fB\-\-geoip-database=<geofile> Specify path to GeoIP database file. i.e., GeoLiteCity.dat. If using GeoIP2, you will need to download the GeoLite2 City or Country database from MaxMind.com and use the option --geoip-database to specify the database. You can also get updated database files for GeoIP legacy, you can find these as GeoLite Legacy Databases from MaxMind.com. IPv4 and IPv6 files are supported as well. For updated DB URLs, please see the default GoAccess configuration file. .I Note: --geoip-city-data is an alias of --geoip-database. .SS OTHER OPTIONS .TP \fB\-h \-\-help The help. .TP \fB\-s \-\-storage Display current storage method. i.e., B+ Tree, Hash. .TP \fB\-V \-\-version Display version information and exit. .TP \fB\-\-dcf Display the path of the default config file when `-p` is not used. .SS ON-DISK STORAGE OPTIONS .TP \fB\-\-keep-db-files Persist parsed data into disk. If database files exist, files will be overwritten. This should be set to the first dataset. Setting it to false will delete all database files when exiting the program. See examples below. Only if configured with --enable-tcb=btree .TP \fB\-\-load-from-disk Load previously stored data from disk. If reading persisted data only, the database files need to exist. See .I keep-db-files and examples below. Only if configured with --enable-tcb=btree .TP \fB\-\-db-path=<dir> Path where the on-disk database files are stored. The default value is the .I /tmp/goaccess<PID> directory (created on-demand). Only if configured with --enable-tcb=btree .TP \fB\-\-xmmap=<num> Set the size in bytes of the extra mapped memory. The default value is 0. Only if configured with --enable-tcb=btree .TP \fB\-\-cache-lcnum=<num> Specifies the maximum number of leaf nodes to be cached. If it is not more than 0, the default value is specified. The default value is 1024. Setting a larger value will increase speed performance, however, memory consumption will increase. Lower value will decrease memory consumption. Only if configured with --enable-tcb=btree .TP \fB\-\-cache-ncnum=<num> Specifies the maximum number of non-leaf nodes to be cached. If it is not more than 0, the default value is specified. The default value is 512. Only if configured with --enable-tcb=btree .TP \fB\-\-tune-lmemb=<num> Specifies the number of members in each leaf page. If it is not more than 0, the default value is specified. The default value is 128. Only if configured with --enable-tcb=btree .TP \fB\-\-tune-nmemb=<num> Specifies the number of members in each non-leaf page. If it is not more than 0, the default value is specified. The default value is 256. Only if configured with --enable-tcb=btree .TP \fB\-\-tune-bnum=<num> Specifies the number of elements of the bucket array. If it is not more than 0, the default value is specified. The default value is 32749. Suggested size of the bucket array is about from 1 to 4 times of the number of all pages to be stored. Only if configured with --enable-tcb=btree .TP \fB\-\-compression=<zlib|bz2> Specifies that each page is compressed with ZLIB|BZ2 encoding. Only if configured with --enable-tcb=btree .SH CUSTOM LOG/DATE FORMAT GoAccess can parse virtually any web log format. .P Predefined options include, Common Log Format (CLF), Combined Log Format (XLF/ELF), including virtual host, Amazon CloudFront (Download Distribution), Google Cloud Storage and W3C format (IIS). .P GoAccess allows any custom format string as well. .P There are two ways to configure the log format. The easiest is to run GoAccess with .I -c to prompt a configuration window. Otherwise, it can be configured under ~/.goaccessrc or the %sysconfdir%. .IP "time-format" The .I time-format variable followed by a space, specifies the log format time containing any combination of regular characters and special format specifiers. They all begin with a percentage (%) sign. See `man strftime`. .I %T or %H:%M:%S. .IP .I Note: If a timestamp is given in microseconds, .I %f must be used as .I time-format .IP "date-format" The .I date-format variable followed by a space, specifies the log format date containing any combination of regular characters and special format specifiers. They all begin with a percentage (%) sign. See `man strftime`. e.g., .I %Y-%m-%d. .IP .I Note: If a timestamp is given in microseconds, .I %f must be used as .I date-format .IP "log-format" The .I log-format variable followed by a space or .I \\\\t , specifies the log format string. .IP %x A date and time field matching the .I time-format and .I date-format variables. This is used when given a timestamp or the date & time are concatenated as a single string (e.g., 1501647332 or 20170801235000) instead of the date and time being in two separated variables. .IP %t time field matching the .I time-format variable. .IP %d date field matching the .I date-format variable. .IP %v The canonical Server Name of the server serving the request (Virtual Host). .IP %e This is the userid of the person requesting the document as determined by HTTP authentication. .IP %h host (the client IP address, either IPv4 or IPv6) .IP %r The request line from the client. This requires specific delimiters around the request (as single quotes, double quotes, or anything else) to be parsable. If not, we have to use a combination of special format specifiers as %m %U %H. .IP %q The query string. .IP %m The request method. .IP %U The URL path requested. .I Note: If the query string is in %U, there is no need to use .I %q. However, if the URL path, does not include any query string, you may use .I %q and the query string will be appended to the request. .IP %H The request protocol. .IP %s The status code that the server sends back to the client. .IP %b The size of the object returned to the client. .IP %R The "Referrer" HTTP request header. .IP %u The user-agent HTTP request header. .IP %D The time taken to serve the request, in microseconds as a decimal number. .IP %T The time taken to serve the request, in seconds with milliseconds resolution. .IP %L The time taken to serve the request, in milliseconds as a decimal number. .IP %^ Ignore this field. .IP %~ Move forward through the log string until a non-space (!isspace) char is found. .IP ~h The host (the client IP address, either IPv4 or IPv6) in a X-Forwarded-For (XFF) field. It uses a special specifier which consists of a tilde before the host specifier, followed by the character(s) that delimit the XFF field, which are enclosed by curly braces (i.e., ~h{," }) For example, ~h{," } is used in order to parse "11.25.11.53, 17.68.33.17" field which is delimited by a double quote, a comma, and a space. .P .I Note: In order to get the average, cumulative and maximum time served in GoAccess, you will need to start logging response times in your web server. In Nginx you can add .I $request_time to your log format, or .I %D in Apache. .P .I Important: If multiple time served specifiers are used at the same time, the first option specified in the format string will take priority over the other specifiers. .P GoAccess .I requires the following fields: .IP .I %h a valid IPv4/6 .IP .I %d a valid date .IP .I %r the request .SH INTERACTIVE MENU .IP "F1 or h" Main help. .IP "F5" Redraw main window. .IP "q" Quit the program, current window or collapse active module .IP "o or ENTER" Expand selected module or open window .IP "0-9 and Shift + 0" Set selected module to active .IP "j" Scroll down within expanded module .IP "k" Scroll up within expanded module .IP "c" Set or change scheme color. .IP "TAB" Forward iteration of modules. Starts from current active module. .IP "SHIFT + TAB" Backward iteration of modules. Starts from current active module. .IP "^f" Scroll forward one screen within an active module. .IP "^b" Scroll backward one screen within an active module. .IP "s" Sort options for active module .IP "/" Search across all modules (regex allowed) .IP "n" Find the position of the next occurrence across all modules. .IP "g" Move to the first item or top of screen. .IP "G" Move to the last item or bottom of screen. .SH EXAMPLES .I Note: Piping data into GoAccess won't prompt a log/date/time configuration dialog, you will need to previously define it in your configuration file or in the command line. .SS DIFFERENT OUTPUTS .P To output to a terminal and generate an interactive report: .IP # goaccess access.log .P To generate an HTML report: .IP # goaccess access.log -a -o report.html .P To generate a JSON report: .IP # goaccess access.log -a -d -o report.json .P To generate a CSV file: .IP # goaccess access.log --no-csv-summary -o report.csv .P GoAccess also allows great flexibility for real-time filtering and parsing. For instance, to quickly diagnose issues by monitoring logs since goaccess was started: .IP # tail -f access.log | goaccess - .P And even better, to filter while maintaining opened a pipe to preserve real-time analysis, we can make use of .I tail -f and a matching pattern tool such as .I grep, awk, sed, etc: .IP # tail -f access.log | grep -i --line-buffered 'firefox' | goaccess --log-format=COMBINED - .P or to parse from the beginning of the file while maintaining the pipe opened and applying a filter .IP # tail -f -n +0 access.log | grep -i --line-buffered 'firefox' | goaccess --log-format=COMBINED -o report.html --real-time-html - .SS MULTIPLE LOG FILES .P There are several ways to parse multiple logs with GoAccess. The simplest is to pass multiple log files to the command line: .IP # goaccess access.log access.log.1 .P It's even possible to parse files from a pipe while reading regular files: .IP # cat access.log.2 | goaccess access.log access.log.1 - .P .I Note that the single dash is appended to the command line to let GoAccess know that it should read from the pipe. .P Now if we want to add more flexibility to GoAccess, we can do a series of pipes. For instance, if we would like to process all compressed log files .I access.log.*.gz in addition to the current log file, we can do: .IP # zcat access.log.*.gz | goaccess access.log - .P .I Note: On Mac OS X, use gunzip -c instead of zcat. .SS REAL TIME HTML OUTPUT .P GoAccess has the ability to output real-time data in the HTML report. You can even email the HTML file since it is composed of a single file with no external file dependencies, how neat is that! .P The process of generating a real-time HTML report is very similar to the process of creating a static report. Only --real-time-html is needed to make it real-time. .IP # goaccess access.log -o /usr/share/nginx/html/site/report.html --real-time-html .P By default, GoAccess will use the host name of the generated report. Optionally, you can specify the URL to which the client's browser will connect to. See https://goaccess.io/faq for a more detailed example. .IP # goaccess access.log -o report.html --real-time-html --ws-url=goaccess.io .P By default, GoAccess listens on port 7890, to use a different port other than 7890, you can specify it as (make sure the port is opened): .IP # goaccess access.log -o report.html --real-time-html --port=9870 .P And to bind the WebSocket server to a different address other than 0.0.0.0, you can specify it as: .IP # goaccess access.log -o report.html --real-time-html --addr=127.0.0.1 .P .I Note: To output real time data over a TLS/SSL connection, you need to use .I --ssl-cert=<cert.crt> and .I --ssl-key=<priv.key>. .SS WORKING WITH DATES .P Another useful pipe would be filtering dates out of the web log .P The following will get all HTTP requests starting on 05/Dec/2010 until the end of the file. .IP # sed -n '/05\/Dec\/2010/,$ p' access.log | goaccess -a - .P or using relative dates such as yesterdays or tomorrows day: .IP # sed -n '/'$(date '+%d\/%b\/%Y' -d '1 week ago')'/,$ p' access.log | goaccess -a - .P If we want to parse only a certain time-frame from DATE a to DATE b, we can do: .IP # sed -n '/5\/Nov\/2010/,/5\/Dec\/2010/ p' access.log | goaccess -a - .SS VIRTUAL HOSTS .P Assuming your log contains the virtual host (server blocks) field. For instance: .IP vhost.com:80 10.131.40.139 - - [02/Mar/2016:08:14:04 -0600] "GET /shop/bag-p-20 HTTP/1.1" 200 6715 "-" "Apache (internal dummy connection)" .P And you would like to append the virtual host to the request in order to see which virtual host the top urls belong to .IP awk '$8=$1$8' access.log | goaccess -a - .P To exclude a list of virtual hosts you can do the following: .IP # grep -v "`cat exclude_vhost_list_file`" vhost_access.log | goaccess - .SS FILES & STATUS CODES .P To parse specific pages, e.g., page views, html, htm, php, etc. within a request: .IP # awk '$7~/\.html|\.htm|\.php/' access.log | goaccess - .P Note, .I $7 is the request field for the common and combined log format, (without Virtual Host), if your log includes Virtual Host, then you probably want to use .I $8 instead. It's best to check which field you are shooting for, e.g.: .IP # tail -10 access.log | awk '{print $8}' .P Or to parse a specific status code, e.g., 500 (Internal Server Error): .IP # awk '$9~/500/' access.log | goaccess - .SS SERVER .P Also, it is worth pointing out that if we want to run GoAccess at lower priority, we can run it as: .IP # nice -n 19 goaccess -f access.log -a .P and if you don't want to install it on your server, you can still run it from your local machine: .IP # ssh root@server 'cat /var/log/apache2/access.log' | goaccess -a - .SS INCREMENTAL LOG PROCESSING .P GoAccess has the ability to process logs incrementally through the on-disk B+Tree database. It works in the following way: .nr step 1 1 .IP \n[step] 3 A dataset must be persisted first with .I --keep-db-files, then the same dataset can be loaded with .I --load-from-disk. .IP \n+[step] If new data is passed (piped or through a log file), it will append it to the original dataset. .IP \n+[step] To preserve the data at all times, .I --keep-db-files must be used. .IP \n+[step] If .I --load-from-disk is used without .I --keep-db-files, database files will be deleted upon closing the program. .P For instance: .IP // last month access log .br goaccess access.log.1 --keep-db-files .P then, load it with .IP // append this month access log, and preserve new data .br goaccess access.log --load-from-disk --keep-db-files .P To read persisted data only (without parsing new data) .IP goaccess --load-from-disk --keep-db-files .P .SH NOTES Each active panel has a total of 366 items or 50 in the real-time HTML report. The number of items is customizable using .I max-items However, only the CSV and JSON output allow a maximum number greater than the default value of 366 items per panel. .P When analyzing the same log file twice using the on-disk B+Tree and using .I --keep-db-files and .I --load-from-disk on each run, GoAccess will count each entry twice. Issue #334 will address this issue. .P A hit is a request (line in the access log), e.g., 10 requests = 10 hits. HTTP requests with the same IP, date, and user agent are considered a unique visit. .SH BUGS If you think you have found a bug, please send me an email to .I goaccess@prosoftcorp.com or use the issue tracker in https://github.com/allinurl/goaccess/issues .SH AUTHOR Gerardo Orellana <goaccess@prosoftcorp.com> For more details about it, or new releases, please visit https://goaccess.io ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/INSTALL��������������������������������������������������������������������������������0000644�0000000�0000000�00000036600�13375710677�011111� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 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 commands `./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 `<wchar.h>' 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 bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /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. ��������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/������������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�13375711133�010535� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/Makevars����������������������������������������������������������������������������0000644�0000000�0000000�00000006564�13350574106�012164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. AM_CPPFLAGS = -I. -I$(srcdir) # These options get passed to xgettext. XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = hello@goaccess.io # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = yes # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = yes ��������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/LINGUAS�����������������������������������������������������������������������������0000644�0000000�0000000�00000000017�13373306365�011505� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������fr es zh_CN ja �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/en@quot.header����������������������������������������������������������������������0000644�0000000�0000000�00000002263�13160075065�013244� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/zh_CN.gmo���������������������������������������������������������������������������0000644�0000000�0000000�00000043005�13375711133�012164� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Þ•����Ò������¬����< ������ �����¡��?���º��;���ú�����6��7���H��9���€��<���º��@���÷��4���8��B���m��:���°��$���ë��(����� ���9��9���E��7�����"���·��<���Ú��2�����7���J��4���‚�����·��7���Ç��5���ÿ�����5��4���L��6�����6���¸�����ï��#�����?���(��'���h��5�����-���Æ��=���ô�����2�����J��9���e��A���Ÿ�����á�����ú��9�����3���N�����‚��D���¢�����ç��<�����%���@��;���f��#���¢��&���Æ��*���í��/�����-���H��B���v�����¹�����Ë�����ç��A���ý��>���?��A���~�� ���À��;���á��%�����'���C��(���k��%���”�����º�� ���Ì�����Ø��1���ó�� ���%�����/�����3�����:��2���C��*���v��0���¡�����Ò�� ���Ø�����æ��A���ë�����-�� ���5�� ���?�� ���I�� ���S��%���]�����ƒ��+���ˆ��+���´��$���à�� ��� ����� �� ��� �� ���? �� ���M �����X �����g �� ���w �����„ �����ž ��0���µ �� ���æ �����ó �����!�����!�����!��;���#!�� ���_!�� ���m!�����x!�����!�����‡!�����˜!�� ���§!��&���²!�� ���Ù!�����æ!��#���í!�����"�����*"�� ���3"�� ���>"�����H"�����O"�����S"��+���X"�����„"��*���¢"��+���Í"�� ���ù"�����#�����#�����#�����.#�� ���H#�����V#�����]#��.���o#�� ���ž#�����ª#�����³#�����¹#�����Â#�� ���Ç#�����Ñ#�����à#��.���ð#�� ���$��!���+$�����M$�����]$�����t$�����}$�����’$�����¨$�����½$�����Ó$�����å$�� ���û$�����%�� ���%�� ���%%�����3%��9���:%�����t%�����z%�����%��$���‘%��3���¶%��<���ê%��5���'&��<���]&��:���š&��>���Õ&��F���'��@���['��G���œ'��8���ä'�����(�����#(�����2(�����7(�����G(��+���_(�����‹(����� (�����¯(�� ���¸(�����Æ(�����Ë(�����å(��7���î(�����&)�����?)�����P)�����c)�����)��$���”)�����¹)��4���Ø)��)��� *��!���7*�����Y*�����i*�����z*�����*�����*��ˆ��¯*�����8,��/���O,��A���,�� ���Á,�����Ì,��A���ç,��9���)-��`���c-��)���Ä-��N���î-��;���=.��!���y.��!���›.�� ���½.��>���È.��8���/�����@/��J���S/��#���ž/��2���Â/��2���õ/�����(0��)���90��/���c0�����“0��)���¦0��)���Ð0��5���ú0�����01�����C1��5���\1��5���’1��/���È1��.���ø1��G���'2�����o2�����ˆ2�����¡2��!���À2�����â2�����û2��<���3�����Q3�����m3��;���ƒ3�����¿3��2���Ø3����� 4��2���'4�����Z4�����y4��#���—4��&���»4��2���â4��5���5�����K5�����\5�����u5��X���ˆ5��,���á5��U���6�����d6��4���6��"���¶6�����Ù6��(���ù6��(���"7�����K7�����\7�����m7��!���‰7�����«7�� ���»7�����Å7�� ���Ì7��4���Ö7��0��� 8��0���<8�����m8�� ���t8�����8��W���ˆ8�����à8�����ç8�����÷8�����þ8�����9����� 9�����,9��Q���39��N���…9��%���Ô9�� ���ú9�� ���:��$���:�����::�� ���U:�����b:�����v:�� ���†:��$���“:�����¸:��8���Î:�� ���;�����;�� ���);�����7;�� ���>;��N���H;�����—;�����¨;�� ���¯;�����¹;�����À;�� ���Ö;�� ���ã;�����í;�� ���<�����<��%���<�����=<�� ���P<�����]<�����s<�� ���ƒ<�� ���<�����<��'���¤<�����Ì<��'���ë<��'���=�����;=�����J=�� ���[=�� ���h=�����u=�� ���Ž=�����›=�����¢=��8���µ=�� ���î=�����û=�����>����� >�����>�� ���>�����$>�� ���5>��5���B>�����x>��$���ˆ>�����­>�����½>�����Í>�����Ô>�����ç>�����ú>����� ?����� ?�����6?�� ���O?�� ���\?�� ���i?�� ���s?�����}?��+���„?�����°?�����·?�� ���¾?��%���Ë?��Q���ñ?��U���C@��Q���™@��T���ë@��T���@A��T���•A��n���êA��d���YB��j���¾B��T���)C�����~C�� ���…C�����’C�� ���™C�����¦C��*���¹C�����äC�����öC�����D�� ��� D�����D�����!D�����<D��6���CD�����zD�����–D�����¬D�����ÀD�����ßD��(���öD�� ���E��+���@E��!���lE��!���ŽE�����°E�����ÂE�����ØE�����ìE�����òE���������v���¯������K����������q���8�����������¼����������d���J������4��� ���5������������������½�������³������6���›������#������$������±��� �������Ã���¥�������%���1���������-���G���C�������&���3���Â���¢���y���†�������|���"����������N���F�������z������Î���¿�������«���w���P���¾��� ���´���Ð�������„������������������������–�������É���W�������Ë���R���Ï�������x�������~����������+������� ���n���/���Ê���¨���l���A���¦���I���š�������i���¸���D�������º���€���Æ�����������‘������7����������[�������°���E���—�������œ����������������������Y���‰�����������2�������”���“���!���Ñ���Z�������Ä���¤���*���a���·�������™���H�������}���ž���²���V���Q���������������o�������Š���h���È���‚��� ���Í���u���m���À���’������������������� ������t���,���¶���Ÿ������{���¹���;���X�������g���S���­���¡���L������…���ˆ���e���®���^�������•���>�������(���<������f���`���\���_������Ç�������������Å���0���‡��� ���O�����������Á���©���B���b���Ò�������)�������T�������Œ���˜���Ž���=���§���¬���£�������c�������»�������ª���:������?���‹�����������9���r���]���j�����������µ����������ƒ���'���k������U���Ì���p���.�����������s����������M���@����'%1$s' panel is disabled�100 - Continue: Server received the initial part of the request�101 - Switching Protocols: Client asked to switch protocols�1xx Informational�200 - OK: The request sent by the client was successful�201 - Created: The request has been fulfilled and created�202 - Accepted: The request has been accepted for processing�203 - Non-authoritative Information: Response from a third party�204 - No Content: Request did not return any content�205 - Reset Content: Server asked the client to reset the document�206 - Partial Content: The partial GET has been successful�207 - Multi-Status: WebDAV; RFC 4918�208 - Already Reported: WebDAV; RFC 5842�2xx Success�300 - Multiple Choices: Multiple options for the resource�301 - Moved Permanently: Resource has permanently moved�302 - Moved Temporarily (redirect)�303 - See Other Document: The response is at a different URI�304 - Not Modified: Resource has not been modified�305 - Use Proxy: Can only be accessed through the proxy�307 - Temporary Redirect: Resource temporarily moved�3xx Redirection�400 - Bad Request: The syntax of the request is invalid�401 - Unauthorized: Request needs user authentication�402 - Payment Required�403 - Forbidden: Server is refusing to respond to it�404 - Not Found: Requested resource could not be found�405 - Method Not Allowed: Request method not supported�406 - Not Acceptable�407 - Proxy Authentication Required�408 - Request Timeout: Server timed out waiting for the request�409 - Conflict: Conflict in the request�410 - Gone: Resource requested is no longer available�411 - Length Required: Invalid Content-Length�412 - Precondition Failed: Server does not meet preconditions�413 - Payload Too Large�414 - Request-URI Too Long�415 - Unsupported Media Type: Media type is not supported�416 - Requested Range Not Satisfiable: Cannot supply that portion�417 - Expectation Failed�421 - Misdirected Request�422 - Unprocessable Entity due to semantic errors: WebDAV�423 - The resource that is being accessed is locked�424 - Failed Dependency: WebDAV�426 - Upgrade Required: Client should switch to a different protocol�428 - Precondition Required�429 - Too Many Requests: The user has sent too many requests�431 - Request Header Fields Too Large�444 - (Nginx) Connection closed without sending any headers�451 - Unavailable For Legal Reasons�494 - (Nginx) Request Header Too Large�495 - (Nginx) SSL client certificate error�496 - (Nginx) Client didn't provide certificate�497 - (Nginx) HTTP request sent to HTTPS port�499 - (Nginx) Connection closed by client while processing request�4xx Client Errors�500 - Internal Server Error�501 - Not Implemented�502 - Bad Gateway: Received an invalid response from the upstream�503 - Service Unavailable: The server is currently unavailable�504 - Gateway Timeout: The upstream server failed to send request�505 - HTTP Version Not Supported�520 - CloudFlare - Web server is returning an unknown error�521 - CloudFlare - Web server is down�522 - CloudFlare - Connection timed out�523 - CloudFlare - Origin is unreachable�524 - CloudFlare - A timeout occurred�5xx Server Errors�Area Spline�Auto-Hide on Small Devices�Automatically hide tables on small screen devices�Avg. T.S.�Bar�Bright�Browsers�Built using Tokyo Cabinet in-memory hash database.�Built using Tokyo Cabinet on-disk B+ Tree.�Built using the default in-memory hash database.�Chart�Chart Options�City�Continent > Country sorted by unique hits [, avgts, cumts, maxts]�Country�Cum. T.S.�Dark Blue�Dark Gray�Dashboard�Dashboard - Overall Analyzed Requests�Data�Data sorted by hits [, avgts, cumts, maxts]�Data sorted by hour [, avgts, cumts, maxts]�Date Format - [d] to add/edit format�Date/Time�Display Tables�Examples can be found by running�Excl. IP Hits�Exp. Panel�Export as JSON�Failed Requests�File Options�Find pattern in all views�For more details visit�Format Errors - Verify your log/date/time format�Geo Location�GoAccess Quick Help�HTTP Status Codes�Help�Hits�Hits having the same IP, date and agent are a unique visit.�Hits/Visitors�Horizontal�Hostname�Hosts�Init. Proc. Time�Items per Page�Keyphrases�Keyphrases from Google's search engine�Last Updated�Layout�Log Format - [c] to add/edit format�Log Format Configuration�Log Size�Log Source�Max. T.S.�Method�Mtd�Next�No date format was found on your conf file.�No default config file found.�No log format was found on your conf file.�No time format was found on your conf file.�Not Found�Not Found URLs (404s)�OS�Operating Systems�Overall Analyzed Requests�Panel Options�Panels�Parsed %1$d lines�Please report it by opening an issue on GitHub�Plot Metric�Previous�Proto�Protocol�Quit�Referrers�Referrers URLs�Referring Sites�Regex allowed - ^g to cancel - TAB switch case�Remote User�Remote User (HTTP authentication)�Requested Files�Requested Files (URLs)�Requests�Scheme Configuration�Select a date format.�Select a log format.�Select a time format.�Server Statistics�Sort active module by�Static Files�Static Requests�Status Codes�Table Columns�Tables�The following options can also be supplied to the command�Theme�Time�Time Distribution�Time Format - [t] to add/edit format�Top Browsers sorted by hits [, avgts, cumts, maxts]�Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]�Top Keyphrases sorted by hits [, avgts, cumts, maxts]�Top Operating Systems sorted by hits [, avgts, cumts, maxts]�Top Referring Sites sorted by hits [, avgts, cumts, maxts]�Top Requested Referrers sorted by hits [, avgts, cumts, maxts]�Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top visitor hosts sorted by hits [, avgts, cumts, maxts]�Total�Total Requests�Type�Unique Visitors�Unique visitors per day�Unique visitors per day - Including spiders�User Agents for %1$s�Valid Requests�Vertical�Virtual Hosts�Vis.�Visitor Hostnames and IPs�Visitors�WebSocket server ready to accept new client connections�You may specify one with�[ ] ASC [x] DESC�[ ] case sensitive�[?] Help [Enter] Exp. Panel�[Active Panel: %1$s]�[ENTER] select - [TAB] sort - [q]uit�[ENTER] to use scheme - [q]uit�[SPACE] to toggle - [ENTER] to proceed - [q] to quit�[UP/DOWN] to scroll - [q] to close window�[UP/DOWN] to scroll - [q] to quit�[q]uit GoAccess�[x] ASC [ ] DESC�[x] case sensitive�en�producing the following errors�Project-Id-Version: goaccess 1.2 Report-Msgid-Bugs-To: hello@goaccess.io POT-Creation-Date: 2018-11-22 23:38-0600 PO-Revision-Date: 2017-04-03 09:43+0200 Last-Translator: Ai<hello@goaccess.io> Language-Team: Ai Language: zh_CN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Gtranslator 2.91.7 �'%1$s' 颿¿å·²ç¦ç”¨�100 - ç»§ç»­: æœåŠ¡å™¨å·²ç»æŽ¥æ”¶åˆ°è¯·æ±‚å¤´�101 - 更改åè®®: å®¢æˆ·ç«¯è¢«é€šçŸ¥å˜æ›´åè®®æ¥å®Œæˆè¯·æ±‚�1xx 消æ¯�200 - æˆåŠŸ: 请求æˆåŠŸ�201 - 已创建: 请求æˆåŠŸå¹¶ä¸”æœåŠ¡å™¨åˆ›å»ºäº†æ–°çš„èµ„æº�202 - 已接收: æœåŠ¡å™¨å·²æŽ¥å—请求,但尚未处ç†�203 - éžæŽˆæƒä¿¡æ¯: æœåС噍已æˆåŠŸå¤„ç†è¯·æ±‚ 但返回的信æ¯å¯èƒ½æ¥è‡ªå¦ä¸€æ¥æº�204 - 无内容: 没有返回任何内容�205 - é‡ç½®å†…容: æœåС噍已æˆåŠŸå¤„ç†è¯·æ±‚ 但没有返回任何内容�206 - 部分内容: æœåС噍æˆåŠŸå¤„ç†äº†éƒ¨åˆ†GET请求�207 - 多状æ€: WebDAV; RFC 4918�208 - 已报告: WebDAV; RFC 5842�2xx æˆåŠŸ�300 - 多é‡é€‰æ‹©: èµ„æºæä¾›å¤šç§é€‰é¡¹è®©å®¢æˆ·ç«¯é€‰æ‹©�301 - 永久移除: 资æºå·²è¢«æ°¸ä¹…移动到新ä½ç½®�302 - 临时移动�303 - 查看其他ä½ç½®: 当å‰è¯·æ±‚çš„å“应在å¦ä¸€ä¸ªURI上被找到�304 - 未修改: èµ„æºæœªè¢«ä¿®æ”¹�305 - 使用代ç†: åªèƒ½é€šè¿‡ä»£ç†è®¿é—®èµ„æº�307 - 临时é‡å®šå‘: 临时从å¦å¤–çš„URIå“应�3xx Urlé‡å®šå‘�400 - 错误请求: 客户端语法错误�401 - 未授æƒ: 当å‰è¯·æ±‚需è¦ç”¨æˆ·æŽˆæƒ�402 - éœ€è¦æ”¯ä»˜�403 - ç¦æ­¢: æœåŠ¡å™¨æ‹’ç»å“应请求�404 - 未找到: 找ä¸åˆ°è¯·æ±‚的资æº�405 - 方法ç¦ç”¨: 䏿”¯æŒè¯·æ±‚中指定的方法�406 - 无法接收�407 - 需è¦ä»£ç†æŽˆæƒ�408 - 请求超时: æœåŠ¡å™¨åœ¨ç­‰å€™è¯·æ±‚æ—¶è¶…æ—¶�409 - 冲çª: æœåŠ¡å™¨åœ¨å®Œæˆè¯·æ±‚æ—¶å‘生冲çª�410 - 已删除: 请求的资æºå·²æ°¸ä¹…删除�411 - éœ€è¦æœ‰æ•ˆé•¿åº¦: Content-Length无效�412 - æœªæ»¡è¶³å‰ææ¡ä»¶: æœåŠ¡å™¨æœªæ»¡è¶³è¯·æ±‚ä¸­çš„å‰ææ¡ä»¶�413 - 请求实体过大�414 - 请求的URI过长�415 - 䏿”¯æŒçš„媒体类型�416 - 请求范围ä¸ç¬¦åˆè¦æ±‚�417 - 未满足期望值�421 - 被误导的请求�422 - è¯·æ±‚æ ¼å¼æ­£ç¡®ä½†å› å­˜åœ¨è¯­æ³•错而无法å“应�423 - 当å‰èµ„æºè¢«é”定�424 - 失败的ä¾èµ–�426 - 需è¦å‡çº§: 客户端应该切æ¢åˆ°å…¶ä»–çš„åè®®�428 - 需è¦å‰ææ¡ä»¶�429 - 请求过多: 客户端å‘é€äº†å¤ªå¤šè¯·æ±‚�431 - 请求头字段太长�444 - (Nginx) 未å‘é€å“应头且连接已关闭�451 - 因法律原因ä¸å¯ç”¨�494 - (Nginx) 请求头太大�495 - (Nginx) SSL客户端è¯ä¹¦é”™�496 - (Nginx) 客户端未æä¾›è¯ä¹¦�497 - (Nginx) HTTP请求被å‘é€åˆ°äº†HTTPS端å£�499 - (Nginx) 处ç†è¯·æ±‚时连接被客户端关闭�4xx 客户端错�500 - æœåŠ¡å™¨å†…éƒ¨é”™�501 - 尚未实施�502 - 错误网关: æœåŠ¡å™¨ä½œä¸ºç½‘å…³æˆ–ä»£ç†, 从上游æœåŠ¡å™¨æ”¶åˆ°æ— æ•ˆå“应�503 - æœåŠ¡ä¸å¯ç”¨: æœåŠ¡å™¨æ— æ³•ä½¿ç”¨�504 - 网关超时: æœåŠ¡å™¨ä½œä¸ºç½‘å…³æˆ–ä»£ç†, 未从上游æœåŠ¡å™¨æ”¶åˆ°è¯·æ±‚�505 - HTTP版本ä¸å—支æŒ�520 - CloudFlare - æœåŠ¡å™¨è¿”å›žä¸€ä¸ªæœªçŸ¥é”™è¯¯�521 - CloudFlare - æœåŠ¡å™¨æŒ‚äº†�522 - CloudFlare - 连接超时�523 - CloudFlare - æœåŠ¡å™¨æ— æ³•è®¿é—®�524 - CloudFlare - æœåС噍å“应超时�5xx æœåС噍错�AreaSpline图表�å±å¹•è¿‡å°æ—¶è‡ªåЍéšè—�å±å¹•è¿‡å°æ—¶è‡ªåЍéšè—表格�å¹³å‡å“应时�æ¡å½¢å›¾�明亮�æµè§ˆå™¨�使用Tokyo Cabinetçš„å†…å­˜ä¸­çš„å“ˆå¸Œè¡¨æ¥æž„建�使用Tokyo Cabinet在ç£ç›˜ä¸­çš„B+æ ‘æ¥æž„建�ä½¿ç”¨é»˜è®¤çš„åœ¨å†…å­˜ä¸­çš„å“ˆå¸Œè¡¨æ¥æž„建�图表�图表选项�城市�大陆 > å›½å®¶æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�国家�总共å“应时�æ·±è“�深黑�概览�概览-所有已分æžçš„请求�æ•°æ®�æ•°æ®åˆ—æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�æ•°æ®åˆ—æŽ’åºæŒ‰ [å°æ—¶, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�æ—¥æœŸæ ¼å¼ - [d]新建/修改格å¼�时期/æ—¶é—´�显示表格�è¿è¡Œä¸€ä¸‹æŒ‡ä»¤æŸ¥çœ‹æ›´å¤šç¤ºä¾‹�过滤æ¥è‡ªæ­¤IP的请求�展开颿¿�导出为JSON文件�失败的请求�文件选项�在所有界é¢ä¸­æŸ¥æ‰¾åŒ¹é…模å¼�更多信æ¯è¯·è®¿é—®�æ ¼å¼é”™è¯¯ - 请检查你的日志/日期/æ—¶é—´æ ¼å¼�地ç†ä½ç½®�GoAccess快速帮助�HTTP状æ€ç �帮助�点击é‡�æ¥è‡ªåŒä¸€IPã€æ—¶é—´å’ŒHttp用户代ç†çš„多次点击被视作一次访问�点击é‡/访客�横å‘�主机å�主机�第一次处ç†è€—æ—¶�æ¯é¡µé¡¹ç›®�关键字�è°·æ­Œæœç´¢å…³é”®å­—�最近更新�布局�æ—¥å¿—æ ¼å¼ - [c]新建/修改格å¼�日志格å¼è®¾ç½®�日志大å°�日志文件夹地å€�最高å“应时�请求方法�请求方法�å‰è¿›�未在é…置文件中设置日期格å¼�未找到默认的é…置文件�未在é…置文件中设置日志格å¼�未在é…置文件中设置时间格å¼�未找到(404)�未找到的URLs�æ“作系统�æ“作系统�所有已分æžçš„请求�颿¿é€‰é¡¹�颿¿�å·²è§£æž %1$d 行�请在GitHub中添加一个issueæ¥ç»™æˆ‘们å馈信æ¯�绘制度é‡�åŽé€€�åè®®�åè®®�退出�æ¥æºåœ°å€�æ¥æºåœ°å€URLs�推è网站�å…è®¸æ­£åˆ™è¡¨è¾¾å¼ - ^g退出 - TAB改å˜å¤§å°å†™�已认è¯ç”¨æˆ·�已认è¯ç”¨æˆ·(HTTP authentication)�请求的文件�请求的文件�请求�颜色方案设置�选择日期格å¼�选择日志格å¼�选择时间格å¼�æœåŠ¡å™¨ç»Ÿè®¡ä¿¡æ¯�当å‰é€‰æ‹©æ ç›®æŽ’åº�陿€æ–‡ä»¶�陿€è¯·æ±‚�状æ€ç �表格列�表格�你也å¯ä»¥åœ¨command中选择以下选项�主题�æ—¶é—´�时间分é…�æ—¶é—´æ ¼å¼ - [t]新建/修改格å¼�æµè§ˆå™¨æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�HTTP状æ€ç æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�å…³é”®å­—æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�æ“ä½œç³»ç»ŸæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�推èç½‘ç«™æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�æ¥æºåœ°å€æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�未找到的URLsæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, åè®®]�è¯·æ±‚æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, åè®®]�陿€è¯·æ±‚æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, åè®®]�è®¿å®¢ä¸»æœºæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]�总共�所有请求�类型�独立访客�æ¯æ—¥ç‹¬ç«‹è®¿å®¢�æ¯æ—¥ç‹¬ç«‹è®¿å®¢ - 包括网络机器人�ç”¨æˆ·ä»£ç† %1$s�有效的请求�纵å‘�虚拟主机�访客�访客主机åå’ŒIP地å€�访客�WebSocketæœåŠ¡å™¨å·²å‡†å¤‡æŽ¥æ”¶æ¥è‡ªå®¢æˆ·çš„连接�ä½ å¯ä»¥æŒ‡å®šé…置文件�[ ] 递增 [x] 递å‡�[ ] 区分大å°å†™�[?]帮助 [回车]展开颿¿�[当å‰é¢æ¿ï¼š %1$s]�[回车]选择 - [TAB]æŽ’åº - [q]退出�[回车]选喿–¹æ¡ˆ - [q]退出�[空格]åˆ‡æ¢ - [回车]ç»§ç»­ - [q]退出�[UP/DOWN]上下滚动 - [q]退出�[UP/DOWN]上下滚动 - [q]退出�[q]退出GoAccess�[x] 递增 [ ] 递å‡�[x] 区分大å°å†™�zh-CN�出现以下错误����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/en@boldquot.header������������������������������������������������������������������0000644�0000000�0000000�00000002471�13160075065�014106� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/ja.gmo������������������������������������������������������������������������������0000644�0000000�0000000�00000052504�13375711133�011561� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Þ•����Õ������Ä��%��l ��������������?�����;���Z�����–��7���¨��9���à��<�����@���W��4���˜��B���Í��:�����$���K��(���p�� ���™��9���¥��7���ß��"�����<���:��2���w��7���ª��4���â�������7���'��5���_�����•��4���¬��6���á��6��������O��#���d��?���ˆ��'���È��5���ð��-���&��=���T�����’�����ª��9���Å��A���ÿ�����A�����Z��9���t��3���®�����â��D��������G��<���c��%��� ��;���Æ��#�����&���&��*���M��/���x��-���¨��B���Ö����������+�����G��A���]��>���Ÿ��A���Þ�� ��� ��;���A��%���}��'���£��(���Ë��%���ô������� ���,�����8��1���S�� ���…����������“�����š��2���£��*���Ö��0��������2�� ���8�����F��A���K������� ���•�� ���Ÿ�� ���©�� ���³��%���½�����ã��+���è��+��� ��$���@ �� ���e �����o �� ���~ �� ���Ÿ �� ���­ �����¸ �����Ç �� ���× �����ä �����þ ��0���!�� ���F!�����S!�����g!�����y!�����~!��;���ƒ!�� ���¿!�� ���Í!�����Ø!�����á!�����ç!�����ø!�� ���"��&���"�� ���9"�����F"��#���M"�����q"�����Š"�� ���“"�� ���ž"�����¨"�����¯"�����³"��+���¸"�����ä"��*���#��+���-#�� ���Y#�����c#�����y#�����|#�����Ž#�� ���¨#�����¶#�����½#��.���Ï#�� ���þ#����� $�����$�����$�����"$�� ���'$�����1$�����@$��.���P$�� ���$��!���‹$�����­$�����½$�����Ô$�����Ý$�����ò$�����%�����%�����3%�����E%�� ���[%�����h%�� ���x%�� ���…%�����“%��9���š%�����Ô%�����Ú%�����ß%��$���ñ%��3���&��<���J&��5���‡&��<���½&��:���ú&��>���5'��F���t'��@���»'��G���ü'��8���D(�����}(�����ƒ(�� ���’(�����(�����¢(�����²(��+���Ê(�����ö(����� )�����)�� ���#)�����1)�����6)�����P)��7���Y)�����‘)�����ª)�����»)�����Î)�����ê)��$���ÿ)�����$*��4���C*��)���x*��!���¢*�����Ä*�����Ô*�����å*�����ø*�����û*�����þ*�����+��…�� +��.���¦,��>���Õ,��l���-�� ���-��2���Œ-��_���¿-��M���.��¡���m.��t���/��›���„/��•��� 0��4���¶0��+���ë0�� ���1��z���"1��_���1��b���ý1��e���`2��V���Æ2��n���3��b���Œ3�����ï3��G��� 4��V���T4��W���«4��\���5��S���`5��q���´5��-���&6��'���T6��J���|6��2���Ç6��S���ú6��/���N7��€���~7��'���ÿ7�����'8��9���C8��k���}8��6���é8����� 9��H���?9��6���ˆ9��H���¿9��k���:��B���t:��e���·:��(���;��M���F;��B���”;��0���×;��5���<��J���><��G���‰<��h���Ñ<�����:=��!���Z=��?���|=��›���¼=��D���X>��˜���>��s���6?��I���ª?��@���ô?��R���5@��U���ˆ@��[���Þ@�����:A�����TA��*���gA��E���’A�����ØA�� ���ëA�� ���øA�� ���B��O���B��9���_B��Q���™B�� ���ëB�����õB�����C��`��� C�����mC�����tC�����‡C�����šC�����­C��9���ÃC�� ���ýC��]���D��l���eD�� ���ÒD�� ���óD�����E�� ���E�����E�� ���.E�����;E�����[E�����tE��3���E�����ÄE��h���×E�� ���@F�����MF�����kF�� ���ˆF�� ���’F��Œ���ŸF�����,G�����IG�� ���PG�� ���]G�����jG�����†G�����¥G��*���¸G�����ãG�����öG�� ���H�����'H�����:H�����VH�����fH�����yH�����€H�����‡H��H���ŽH��?���×H��H���I��H���`I�����©I�����¹I�����ØI��$���ÛI��!����J�����"J�� ���;J�����EJ��8���\J�����•J�����«J�����²J�����ÂJ�����ÒJ�����ÙJ�����ìJ�����ÿJ��G���K�����ZK��+���vK�����¢K��-���ÁK�����ïK�����L��!���L��!���7L��!���YL�����{L��$���—L�����¼L��$���ÒL�����÷L�����M�� ���&M��H���3M�� ���|M�����†M�� ���M�� ���šM��Z���»M��j���N��`���N��P���âN��`���3O��c���”O��f���øO��]���_P��o���½P��Z���-Q�����ˆQ�����Q�����¨Q�� ���»Q�����ÅQ��-���áQ��K���R��&���[R�����‚R�����›R�����¢R�����»R��,���ËR�����øR��*���S��$���3S�����XS��(���nS��"���—S�����ºS��-���ØS��'���T��2���.T��;���aT��&���T�����ÄT�����ÝT��(���óT�����U�����U�����"U�����AU���������º�������{�����������Z���Å���ž����������������������������²���M���1���¼�����������¥���)���É�������T���W�����������Ð�������Ñ���R���q���y���V������� �������E���~���¬���]���¸������� ���X���š����������ˆ������Õ�������Á�������4���0���?���!�������¨�������¶���%���5��������������������������������������$���‹���`���|���Ô�������_���P���/���6���@�������>���p�������(���£���µ��� ����������ª���&�������,���J�������7���»���������������¯���"���©�������}���G���t���H���Ä���*���Ì������Q���½��� ���c������������������Ã�����������‘���—���„�������Y��������������‡������Ÿ���=���K���9�������������È�������†���œ����������Î���®���¾����������� ���^���s���¦���³���v���¡��� ���«���A������O���À���w���€�������i���+�������j�������������������8������˜���3���\���a��������������ƒ���‰���l���–���…���I�������f���k���h���#���Š���U���Í���¢������›���´������S���.���z��������������Ò������;�������•���¹���r���B���Æ���D���‚������§�������<����������Ó���Ë���Ê���Ç���u���Ž���Ï�����������¿���F���­�������[���g������������������������n���L�������°���e�������N��� ���:�������Œ���¤�������’�����������”���±�������Â���o�������x���·�������™���“�������2���b���-���'���C������m���d����'%1$s' panel is disabled�100 - Continue: Server received the initial part of the request�101 - Switching Protocols: Client asked to switch protocols�1xx Informational�200 - OK: The request sent by the client was successful�201 - Created: The request has been fulfilled and created�202 - Accepted: The request has been accepted for processing�203 - Non-authoritative Information: Response from a third party�204 - No Content: Request did not return any content�205 - Reset Content: Server asked the client to reset the document�206 - Partial Content: The partial GET has been successful�207 - Multi-Status: WebDAV; RFC 4918�208 - Already Reported: WebDAV; RFC 5842�2xx Success�300 - Multiple Choices: Multiple options for the resource�301 - Moved Permanently: Resource has permanently moved�302 - Moved Temporarily (redirect)�303 - See Other Document: The response is at a different URI�304 - Not Modified: Resource has not been modified�305 - Use Proxy: Can only be accessed through the proxy�307 - Temporary Redirect: Resource temporarily moved�3xx Redirection�400 - Bad Request: The syntax of the request is invalid�401 - Unauthorized: Request needs user authentication�402 - Payment Required�403 - Forbidden: Server is refusing to respond to it�404 - Not Found: Requested resource could not be found�405 - Method Not Allowed: Request method not supported�406 - Not Acceptable�407 - Proxy Authentication Required�408 - Request Timeout: Server timed out waiting for the request�409 - Conflict: Conflict in the request�410 - Gone: Resource requested is no longer available�411 - Length Required: Invalid Content-Length�412 - Precondition Failed: Server does not meet preconditions�413 - Payload Too Large�414 - Request-URI Too Long�415 - Unsupported Media Type: Media type is not supported�416 - Requested Range Not Satisfiable: Cannot supply that portion�417 - Expectation Failed�421 - Misdirected Request�422 - Unprocessable Entity due to semantic errors: WebDAV�423 - The resource that is being accessed is locked�424 - Failed Dependency: WebDAV�426 - Upgrade Required: Client should switch to a different protocol�428 - Precondition Required�429 - Too Many Requests: The user has sent too many requests�431 - Request Header Fields Too Large�444 - (Nginx) Connection closed without sending any headers�451 - Unavailable For Legal Reasons�494 - (Nginx) Request Header Too Large�495 - (Nginx) SSL client certificate error�496 - (Nginx) Client didn't provide certificate�497 - (Nginx) HTTP request sent to HTTPS port�499 - (Nginx) Connection closed by client while processing request�4xx Client Errors�500 - Internal Server Error�501 - Not Implemented�502 - Bad Gateway: Received an invalid response from the upstream�503 - Service Unavailable: The server is currently unavailable�504 - Gateway Timeout: The upstream server failed to send request�505 - HTTP Version Not Supported�520 - CloudFlare - Web server is returning an unknown error�521 - CloudFlare - Web server is down�522 - CloudFlare - Connection timed out�523 - CloudFlare - Origin is unreachable�524 - CloudFlare - A timeout occurred�5xx Server Errors�Area Spline�Auto-Hide on Small Devices�Automatically hide tables on small screen devices�Avg. T.S.�Bar�Bright�Browsers�Built using Tokyo Cabinet in-memory hash database.�Built using Tokyo Cabinet on-disk B+ Tree.�Built using the default in-memory hash database.�Chart�Chart Options�City�Continent > Country sorted by unique hits [, avgts, cumts, maxts]�Country�Cum. T.S.�Dark Blue�Dark Gray�Dashboard�Dashboard - Overall Analyzed Requests�Data�Data sorted by hits [, avgts, cumts, maxts]�Data sorted by hour [, avgts, cumts, maxts]�Date Format - [d] to add/edit format�Date/Time�Display Tables�Examples can be found by running�Excl. IP Hits�Exp. Panel�Export as JSON�Failed Requests�File Options�Find pattern in all views�For more details visit�Format Errors - Verify your log/date/time format�Geo Location�GoAccess Quick Help�HTTP Status Codes�Help�Hits�Hits having the same IP, date and agent are a unique visit.�Hits/Visitors�Horizontal�Hostname�Hosts�Init. Proc. Time�Items per Page�Keyphrases�Keyphrases from Google's search engine�Last Updated�Layout�Log Format - [c] to add/edit format�Log Format Configuration�Log Size�Log Source�Max. T.S.�Method�Mtd�Next�No date format was found on your conf file.�No default config file found.�No log format was found on your conf file.�No time format was found on your conf file.�Not Found�Not Found URLs (404s)�OS�Operating Systems�Overall Analyzed Requests�Panel Options�Panels�Parsed %1$d lines�Please report it by opening an issue on GitHub�Plot Metric�Previous�Proto�Protocol�Quit�Referrers�Referrers URLs�Referring Sites�Regex allowed - ^g to cancel - TAB switch case�Remote User�Remote User (HTTP authentication)�Requested Files�Requested Files (URLs)�Requests�Scheme Configuration�Select a date format.�Select a log format.�Select a time format.�Server Statistics�Sort active module by�Static Files�Static Requests�Status Codes�Table Columns�Tables�The following options can also be supplied to the command�Theme�Time�Time Distribution�Time Format - [t] to add/edit format�Top Browsers sorted by hits [, avgts, cumts, maxts]�Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]�Top Keyphrases sorted by hits [, avgts, cumts, maxts]�Top Operating Systems sorted by hits [, avgts, cumts, maxts]�Top Referring Sites sorted by hits [, avgts, cumts, maxts]�Top Requested Referrers sorted by hits [, avgts, cumts, maxts]�Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top visitor hosts sorted by hits [, avgts, cumts, maxts]�Total�Total Requests�Tx. Amount�Type�Unique Visitors�Unique visitors per day�Unique visitors per day - Including spiders�User Agents for %1$s�Valid Requests�Vertical�Virtual Hosts�Vis.�Visitor Hostnames and IPs�Visitors�WebSocket server ready to accept new client connections�You may specify one with�[ ] ASC [x] DESC�[ ] case sensitive�[?] Help [Enter] Exp. Panel�[Active Panel: %1$s]�[ENTER] select - [TAB] sort - [q]uit�[ENTER] to use scheme - [q]uit�[SPACE] to toggle - [ENTER] to proceed - [q] to quit�[UP/DOWN] to scroll - [q] to close window�[UP/DOWN] to scroll - [q] to quit�[q]uit GoAccess�[x] ASC [ ] DESC�[x] case sensitive�en�h%�producing the following errors�v%�Project-Id-Version: goaccess 1.2 Report-Msgid-Bugs-To: hello@goaccess.io POT-Creation-Date: 2018-11-22 23:38-0600 PO-Revision-Date: 2018-10-26 22:00+0900 Last-Translator: Kamino Hiroki <37243867+4f8p@users.noreply.github.com> Language-Team: Japanese Language: ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; �'%1$s' パãƒãƒ«ã¯ç„¡åŠ¹åŒ–ã•れã¦ã„ã¾ã™�100 - 継続: リクエストヘッダーをå—ç†ã—ã¾ã—ãŸ�101 - プロトコル変更: HTTPヘッダーã§ãƒªã‚¯ã‚¨ã‚¹ãƒˆã•れãŸãƒ—ロトコルã«åˆ‡ã‚Šæ›¿ãˆã¾ã™�1xx 情報�200 - æˆåŠŸ: ãƒªã‚¯ã‚¨ã‚¹ãƒˆã«æˆåŠŸã—ã¾ã—ãŸ�201 - 作æˆ: ãƒªã‚¯ã‚¨ã‚¹ãƒˆãŒæˆåŠŸã—ã¦æ–°ãŸãªãƒªã‚½ãƒ¼ã‚¹ã®ä½œæˆãŒå®Œäº†ã—ã¾ã—ãŸ�202 - å—ç†: リクエストをå—ã‘å–ã£ãŸãŒå‡¦ç†ã•れã¦ã„ã¾ã›ã‚“�203 - èªè¨¼ã•れã¦ã„ãªã„情報: リクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸãŒã€è¿”ã•れる情報ã¯åˆ¥ã®é€ä¿¡å…ƒã‹ã‚‰æ¥ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™�204 - コンテンツ無ã—: リクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸãŒã€è¿”ã™ã¹ã情報ãŒã‚りã¾ã›ã‚“�205 - ãƒªã‚»ãƒƒãƒˆè¦æ±‚: リクエストを行ã£ãŸã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã«å¯¾ã—ã¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆãƒ“ューã®ãƒªã‚»ãƒƒãƒˆã‚’行ã†ã‚ˆã†æŒ‡ç¤ºã—ã¾ã™�206 - 部分的ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ: GETリクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸï¼ˆãƒªã‚½ãƒ¼ã‚¹ãŒåˆ†å‰²ã•れã¦ã„ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼‰�207 - 複数ステータス: (WebDAVæ‹¡å¼µ) RFC 4918�208 - 報告済ã¿: (WebDAVæ‹¡å¼µ) RFC 5842�2xx æˆåŠŸ�300 - é¸æŠžãŒå¿…è¦: 複数ã®ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆå…ˆãŒã‚りã€ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆå´ãŒé¸æŠžã™ã‚‹å¿…è¦ãŒã‚りã¾ã™�301 - æ’ä¹…çš„ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å®Œå…¨ã«ç§»å‹•ã•れã¾ã—ãŸ�302 - 一時的ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ä¸€æ™‚çš„ã«ç§»å‹•ã•れã¾ã—ãŸ�303 - 別コンテンツ: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯åˆ¥ã®URLã§æä¾›ã•れã¦ã„ã¾ã™�304 - æ›´æ–°ç„¡ã—: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯æ›´æ–°ã•れã¦ã„ã¾ã›ã‚“�305 - プロキシ使用: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ãƒ—ロキシを使用ã—ã¦å–å¾—ã§ãã¾ã™�307 - 一時的ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ä¸€æ™‚çš„ã«ç§»å‹•ã•れã¾ã—ãŸ�3xx リダイレクション�400 - 䏿­£ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ: リクエストを処ç†ã§ãã¾ã›ã‚“�401 - èªè¨¼ãŒå¿…è¦: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã«ã¯èªè¨¼ãŒå¿…è¦ã§ã™�402 - ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã«ã¯æ–™é‡‘を支払ã†å¿…è¦ãŒã‚りã¾ã™�403 - ã‚¢ã‚¯ã‚»ã‚¹ç¦æ­¢: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ç¦æ­¢ã•れã¦ã„ã¾ã™�404 - ãƒªã‚½ãƒ¼ã‚¹ä¸æ˜Ž: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å­˜åœ¨ã—ã¾ã›ã‚“�405 - 許å¯ã•れã¦ã„ãªã„: リクエストã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã§ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ç¦æ­¢ã•れã¦ã„ã¾ã™�406 - リクエストをå—ç†ã§ãã¾ã›ã‚“�407 - プロキシèªè¨¼ãŒå¿…è¦ã§ã™�408 - タイムアウト: リクエストãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ�409 - è¡çª: リクエストãŒè¡çªã—ã¾ã—ãŸ�410 - 消滅: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å®Œå…¨ã«å‰Šé™¤ã•れã¾ã—ãŸ�411 - Content-LengthヘッダーãŒå¿…è¦ã§ã™�412 - 剿æ¡ä»¶ãŒæº€ãŸã•れã¦ã„ãªã„: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯ã‚µãƒ¼ãƒãƒ¼å´ã®å‰ææ¡ä»¶ã‚’満ãŸã—ã¦ã„ã¾ã›ã‚“�413 - ペイロードãŒé•·ã™ãŽã¾ã™�414 - URLãŒé•·ã™ãŽã¾ã™�415 - サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„メディアタイプ�416 - リクエストã•れãŸContent-Lengthヘッダーã®ç¯„囲ãŒãƒªã‚½ãƒ¼ã‚¹ã‚ˆã‚Šè¶…éŽã—ã¦ã„ã¾ã™�417 - 拡張ステータスコードãŒä½¿ãˆã¾ã›ã‚“�421 - 䏿˜Žãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ�422 - リクエストをå—ç†ã—ãŸãŒã€å‡¦ç†ã‚’継続ã§ãã¾ã›ã‚“�423 - ã“ã®ãƒªã‚½ãƒ¼ã‚¹ã¯ãƒ­ãƒƒã‚¯ã•れã¦ã„ã¾ã™�424 - ä¾å­˜ã™ã‚‹ä»–ã®å‡¦ç†ãŒå¤±æ•—ã—ãŸãŸã‚処ç†ã§ãã¾ã›ã‚“�426 - アップグレードãŒå¿…è¦: プロトコルãŒå¤ã™ãŽã¦ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã§ãã¾ã›ã‚“�428 - リクエストをæ¡ä»¶ä»˜ãã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™�429 - éŽé‡ãƒªã‚¯ã‚¨ã‚¹ãƒˆ: 制é™ã•れãŸãƒªã‚¯ã‚¨ã‚¹ãƒˆæ•°ã‚’è¶…ãˆãŸã®ã§å‡¦ç†ã§ãã¾ã›ã‚“�431 - HTTPヘッダーãŒé•·ã™ãŽã¾ã™�444 - (nginx) ヘッダーを返ã•ãšã‚³ãƒã‚¯ã‚·ãƒ§ãƒ³ã‚’切断ã—ã¾ã—ãŸ�451 - 法律上ã®ç†ç”±ã§ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã§ãã¾ã›ã‚“�494 - (nginx) HTTPヘッダーãŒé•·ã™ãŽã¾ã™�495 - (nginx) SSLクライアント証明書エラー�496 - (nginx) クライアントãŒè¨¼æ˜Žæ›¸ã‚’æä¾›ã—ã¾ã›ã‚“ã§ã—ãŸ�497 - (nginx) HTTPリクエストをHTTPSãƒãƒ¼ãƒˆã«é€ä¿¡ã—ã¾ã—ãŸ�499 - (nginx) リクエストを処ç†ä¸­ã«ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã«ã‚ˆã£ã¦æŽ¥ç¶šã‚’é–‰ã˜ã‚‰ã‚Œã¾ã—ãŸ�4xx クライアントエラー�500 - 内部サーãƒãƒ¼ã‚¨ãƒ©ãƒ¼�501 - サーãƒãƒ¼ã§ãƒ¡ã‚½ãƒƒãƒ‰ãŒå®Ÿè£…ã•れã¦ã„ã¾ã›ã‚“�502 - 䏿­£ãªã‚²ãƒ¼ãƒˆã‚¦ã‚§ã‚¤: 上æµã«ã‚るゲートウェイã¾ãŸã¯ãƒ—ロキシサーãƒãƒ¼ã‹ã‚‰ä¸æ­£ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’å—ã‘å–りã¾ã—ãŸ�503 - サービス利用ä¸å¯: サーãƒãƒ¼ãŒãƒ€ã‚¦ãƒ³ã—ã¾ã—ãŸ�504 - ゲートウェイタイムアウト: 上æµã«ã‚るゲートウェイã¾ãŸã¯ãƒ—ロキシサーãƒãƒ¼ãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã‚’èµ·ã“ã—ã¾ã—ãŸ�505 - リクエストã§ä½¿ç”¨ã•れã¦ã„ã‚‹HTTPãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒã‚µãƒ¼ãƒãƒ¼ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“�520 - CloudFlare - Originサーãƒãƒ¼ã‹ã‚‰ã‚¨ãƒ©ãƒ¼ãŒè¿”ã•れã¾ã—ãŸ�521 - CloudFlare - Originサーãƒãƒ¼ãŒãƒ€ã‚¦ãƒ³ã—ã¦ã„ã¾ã™�522 - CloudFlare - Originサーãƒãƒ¼ã¸ã®æŽ¥ç¶šãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ�523 - CloudFlare - Originサーãƒãƒ¼ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“(到é”ä¸èƒ½ï¼‰�524 - CloudFlare - Originサーãƒãƒ¼ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“(タイムアウト)�5xx サーãƒãƒ¼ã‚¨ãƒ©ãƒ¼�平滑é¢ã‚°ãƒ©ãƒ•�自動éžè¡¨ç¤ºè¨­å®šï¼ˆå°åž‹ç«¯æœ«ç”¨ï¼‰�ç”»é¢ãŒå°ã•ã„å ´åˆã«è‡ªå‹•ã§ãƒ†ãƒ¼ãƒ–ルをéžè¡¨ç¤ºã«ã™ã‚‹�å¹³å‡å‡¦ç†æ™‚é–“�棒グラフ�ライト�ブラウザ�Tokyo Cabinetã®ã‚¤ãƒ³ãƒ¡ãƒ¢ãƒªãƒãƒƒã‚·ãƒ¥ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’使用ã™ã‚‹ã€‚�Tokyo Cabinetã®B+木データベースを使用ã™ã‚‹ã€‚�デフォルトã®ã‚¤ãƒ³ãƒ¡ãƒ¢ãƒªãƒãƒƒã‚·ãƒ¥ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’使用ã™ã‚‹ã€‚�グラフ�グラフ設定�地域�地ç†åŒºåˆ† > 国別ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�国å�åˆè¨ˆå‡¦ç†æ™‚é–“�ダークブルー�ダークグレー�ダッシュボード�ダッシュボード - è§£æžæ¸ˆã¿ãƒªã‚¯ã‚¨ã‚¹ãƒˆå…¨ä½“�データ�リクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�リクエストã•ã‚ŒãŸæ™‚刻順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�æ—¥ä»˜å½¢å¼ - [d] 追加/編集�日付/時刻�テーブル表示�実行例�除外対象数�詳細表示�JSONå½¢å¼ã§ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ�無効リクエスト数�ファイルオプション�ã™ã¹ã¦ã®ãƒ“ューã§ãƒ‘ターン検索を行ã†�詳細ã¯ã“ã¡ã‚‰�è§£æžã«å¤±æ•—ã—ã¾ã—㟠- ログ/日付/時刻ã®ãƒ•ォーマット設定を確èªã—ã¦ãã ã•ã„�ä½ç½®æƒ…å ±�GoAccessクイックヘルプ�HTTPステータスコード�ヘルプ�ヒット数�IPã‚¢ãƒ‰ãƒ¬ã‚¹ã€æ—¥ä»˜ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆãŒå…¨ã¦åŒä¸€ã ã£ãŸå ´åˆã€ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¨ã—ã¦æ‰±ã‚れã¾ã™ã€‚�ヒット数/ユーザー数�æ°´å¹³�ホストå�ホストå�è§£æžã«ã‹ã‹ã£ãŸæ™‚é–“�ページã‚ãŸã‚Šã®è¡¨ç¤ºæ•°�キーフレーズ�キーフレーズ(Google検索ã‹ã‚‰ï¼‰�最終更新日時�レイアウト�ãƒ­ã‚°å½¢å¼ - [c] 追加/編集�ログ形å¼è¨­å®š�ログファイルサイズ�ログå–å¾—å…ƒ�æœ€å¤§å‡¦ç†æ™‚é–“�è¦æ±‚�è¦æ±‚�次ã¸�è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«å†…ã§æ—¥ä»˜å½¢å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。�デフォルトã®è¨­å®šãƒ•ァイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。�設定ファイル内ã§ãƒ­ã‚°å½¢å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。�è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«å†…ã§æ™‚刻形å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。�404エラー数�404エラーãŒè¿”ã•れãŸURL�OS�オペレーティングシステム�è§£æžæ¸ˆã¿ãƒªã‚¯ã‚¨ã‚¹ãƒˆå…¨ä½“�パãƒãƒ«ã‚ªãƒ—ション�パãƒãƒ«�è§£æžæ¸ˆã¿: %1$d 行�GitHub上ã®Issueã‹ã‚‰å•題を報告ã—ã¦ãã ã•ã„�表示ã™ã‚‹ãƒ‡ãƒ¼ã‚¿�å‰ã¸�プロトコル�プロトコル�終了�リファラー数�å‚照元(URL)�å‚照元サイト�æ­£è¦è¡¨ç¾ã‚’許å¯ã™ã‚‹ - [^g] キャンセル - [TAB] 切り替ãˆ�èªè¨¼ã•れãŸãƒ¦ãƒ¼ã‚¶ãƒ¼�èªè¨¼ã•れãŸãƒ¦ãƒ¼ã‚¶ãƒ¼ï¼ˆHTTPèªè¨¼ï¼‰�è¦æ±‚ã•れãŸãƒ•ァイル数�リクエストã•れãŸãƒ•ァイル(URL)�リクエスト数�スキーム設定�日付形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚�ログ形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚�時刻形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚�サーãƒãƒ¼ã®çµ±è¨ˆæƒ…å ±�é¸æŠžã—ãŸã‚«ãƒ©ãƒ ã§ä¸¦ã³æ›¿ãˆ�é™çš„ファイル数�é™çš„ファイルリクエスト数�ステータスコード�テーブルカラム�テーブル�次ã®ã‚ªãƒ—ションã¯ã‚³ãƒžãƒ³ãƒ‰ã§æŒ‡å®šã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™�テーマ�時刻�時間分布�æ™‚åˆ»å½¢å¼ - [t] 追加/編集�ブラウザ順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�HTTPステータスコード順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�キーフレーズ順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�OSé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�å‚照元サイト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�é€ä¿¡å…ƒã‚¢ãƒ‰ãƒ¬ã‚¹é †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�エラーã¨ãªã£ãŸURLé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�リクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�é™çš„ファイルリクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�ホストåé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]�åˆè¨ˆ�åˆè¨ˆãƒªã‚¯ã‚¨ã‚¹ãƒˆæ•°�データ転é€é‡�タイプ�ユニークユーザー数�一日ã‚ãŸã‚Šã®ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼æ•°�一日ã‚ãŸã‚Šã®ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼æ•°ï¼ˆã‚¯ãƒ­ãƒ¼ãƒ©ã‚‚å«ã‚る)�%1$s ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆ�有効リクエスト数�垂直�ãƒãƒ¼ãƒãƒ£ãƒ«ãƒ›ã‚¹ãƒˆ�ユーザー数�ユーザーã®ãƒ›ã‚¹ãƒˆåã¨IPアドレス�ユーザー数�WebSocketæŽ¥ç¶šã®æº–å‚™ãŒã§ãã¾ã—ãŸ�ã„ãšã‚Œã‹æŒ‡å®šã—ã¦ãã ã•ã„�[ ] 昇順 [x] é™é †�[ ] 大文字ã¨å°æ–‡å­—を区別ã™ã‚‹�[?] ヘルプ [Enter] 詳細表示�[表示中ã®ãƒ‘ãƒãƒ«: %1$s]�[ENTER] é¸æŠž - [TAB] ソート - [q] 終了�[ENTER] ã‚¹ã‚­ãƒ¼ãƒ é¸æŠž - [q] 終了�[SPACE] 切り替㈠- [ENTER] 決定 - [q] 終了�[↑/↓] スクロール - [q] ウィンドウを閉ã˜ã‚‹�[↑/↓] スクロール - [q] 終了�[q] GoAccessã‚’é–‰ã˜ã‚‹�[x] 昇順 [ ] é™é †�[x] 大文字ã¨å°æ–‡å­—を区別ã™ã‚‹�ja�h%�エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ�v%���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/insert-header.sin�������������������������������������������������������������������0000644�0000000�0000000�00000001240�13160075065�013716� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/goaccess.pot������������������������������������������������������������������������0000644�0000000�0000000�00000036410�13375711133�012774� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: goaccess 1.3\n" "Report-Msgid-Bugs-To: hello@goaccess.io\n" "POT-Creation-Date: 2018-11-22 23:38-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/labels.h:40 msgid "en" msgstr "" #: src/labels.h:43 msgid "Exp. Panel" msgstr "" #: src/labels.h:44 msgid "Help" msgstr "" #: src/labels.h:45 msgid "Quit" msgstr "" #: src/labels.h:46 msgid "Total" msgstr "" #: src/labels.h:49 msgid "[x] ASC [ ] DESC" msgstr "" #: src/labels.h:50 msgid "[ ] ASC [x] DESC" msgstr "" #: src/labels.h:53 #, c-format msgid "[Active Panel: %1$s]" msgstr "" #: src/labels.h:54 msgid "[q]uit GoAccess" msgstr "" #: src/labels.h:55 msgid "[?] Help [Enter] Exp. Panel" msgstr "" #: src/labels.h:56 msgid "Dashboard" msgstr "" #: src/labels.h:57 msgid "Dashboard - Overall Analyzed Requests" msgstr "" #: src/labels.h:58 msgid "Overall Analyzed Requests" msgstr "" #: src/labels.h:60 src/labels.h:81 msgid "Tx. Amount" msgstr "" #: src/labels.h:61 msgid "Date/Time" msgstr "" #: src/labels.h:62 msgid "Excl. IP Hits" msgstr "" #: src/labels.h:63 msgid "Failed Requests" msgstr "" #: src/labels.h:64 msgid "Init. Proc. Time" msgstr "" #: src/labels.h:65 msgid "Log Size" msgstr "" #: src/labels.h:66 msgid "Log Source" msgstr "" #: src/labels.h:67 src/labels.h:174 msgid "Referrers" msgstr "" #: src/labels.h:68 msgid "Total Requests" msgstr "" #: src/labels.h:69 msgid "Static Files" msgstr "" #: src/labels.h:70 src/labels.h:146 msgid "Not Found" msgstr "" #: src/labels.h:71 msgid "Requested Files" msgstr "" #: src/labels.h:72 msgid "Unique Visitors" msgstr "" #: src/labels.h:73 msgid "Valid Requests" msgstr "" #: src/labels.h:76 msgid "Hits" msgstr "" #: src/labels.h:77 msgid "h%" msgstr "" #: src/labels.h:78 src/labels.h:104 msgid "Visitors" msgstr "" #: src/labels.h:79 msgid "Vis." msgstr "" #: src/labels.h:80 msgid "v%" msgstr "" #: src/labels.h:82 msgid "Avg. T.S." msgstr "" #: src/labels.h:83 msgid "Cum. T.S." msgstr "" #: src/labels.h:84 msgid "Max. T.S." msgstr "" #: src/labels.h:85 msgid "Method" msgstr "" #: src/labels.h:86 msgid "Mtd" msgstr "" #: src/labels.h:87 msgid "Protocol" msgstr "" #: src/labels.h:88 msgid "Proto" msgstr "" #: src/labels.h:89 msgid "City" msgstr "" #: src/labels.h:90 msgid "Country" msgstr "" #: src/labels.h:91 msgid "Hostname" msgstr "" #: src/labels.h:92 msgid "Data" msgstr "" #: src/labels.h:94 msgid "Hits/Visitors" msgstr "" #: src/labels.h:98 msgid "Unique visitors per day" msgstr "" #: src/labels.h:100 msgid "Unique visitors per day - Including spiders" msgstr "" #: src/labels.h:102 msgid "Hits having the same IP, date and agent are a unique visit." msgstr "" #: src/labels.h:107 msgid "Requested Files (URLs)" msgstr "" #: src/labels.h:109 msgid "Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" #: src/labels.h:111 msgid "Requests" msgstr "" #: src/labels.h:114 src/labels.h:118 msgid "Static Requests" msgstr "" #: src/labels.h:116 msgid "Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" #: src/labels.h:121 msgid "Time Distribution" msgstr "" #: src/labels.h:123 msgid "Data sorted by hour [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:125 msgid "Time" msgstr "" #: src/labels.h:128 src/labels.h:132 msgid "Virtual Hosts" msgstr "" #: src/labels.h:130 src/labels.h:137 msgid "Data sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:135 msgid "Remote User (HTTP authentication)" msgstr "" #: src/labels.h:139 msgid "Remote User" msgstr "" #: src/labels.h:142 msgid "Not Found URLs (404s)" msgstr "" #: src/labels.h:144 msgid "Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" #: src/labels.h:149 msgid "Visitor Hostnames and IPs" msgstr "" #: src/labels.h:151 msgid "Top visitor hosts sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:153 msgid "Hosts" msgstr "" #: src/labels.h:156 msgid "Operating Systems" msgstr "" #: src/labels.h:158 msgid "Top Operating Systems sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:160 msgid "OS" msgstr "" #: src/labels.h:163 src/labels.h:167 msgid "Browsers" msgstr "" #: src/labels.h:165 msgid "Top Browsers sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:170 msgid "Referrers URLs" msgstr "" #: src/labels.h:172 msgid "Top Requested Referrers sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:177 src/labels.h:181 msgid "Referring Sites" msgstr "" #: src/labels.h:179 msgid "Top Referring Sites sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:184 msgid "Keyphrases from Google's search engine" msgstr "" #: src/labels.h:186 msgid "Top Keyphrases sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:188 msgid "Keyphrases" msgstr "" #: src/labels.h:191 src/labels.h:195 msgid "Geo Location" msgstr "" #: src/labels.h:193 msgid "Continent > Country sorted by unique hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:198 msgid "HTTP Status Codes" msgstr "" #: src/labels.h:200 msgid "Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]" msgstr "" #: src/labels.h:202 msgid "Status Codes" msgstr "" #: src/labels.h:206 msgid "[ ] case sensitive" msgstr "" #: src/labels.h:208 msgid "[x] case sensitive" msgstr "" #: src/labels.h:210 msgid "Regex allowed - ^g to cancel - TAB switch case" msgstr "" #: src/labels.h:212 msgid "Find pattern in all views" msgstr "" #: src/labels.h:216 msgid "Log Format Configuration" msgstr "" #: src/labels.h:218 msgid "[SPACE] to toggle - [ENTER] to proceed - [q] to quit" msgstr "" #: src/labels.h:220 msgid "Log Format - [c] to add/edit format" msgstr "" #: src/labels.h:222 msgid "Date Format - [d] to add/edit format" msgstr "" #: src/labels.h:224 msgid "Time Format - [t] to add/edit format" msgstr "" #: src/labels.h:226 src/labels.h:230 msgid "[UP/DOWN] to scroll - [q] to close window" msgstr "" #: src/labels.h:232 #, c-format msgid "User Agents for %1$s" msgstr "" #: src/labels.h:236 msgid "Scheme Configuration" msgstr "" #: src/labels.h:238 msgid "[ENTER] to use scheme - [q]uit" msgstr "" #: src/labels.h:242 msgid "Sort active module by" msgstr "" #: src/labels.h:244 msgid "[ENTER] select - [TAB] sort - [q]uit" msgstr "" #: src/labels.h:248 msgid "GoAccess Quick Help" msgstr "" #: src/labels.h:250 msgid "[UP/DOWN] to scroll - [q] to quit" msgstr "" #: src/labels.h:254 msgid "Built using Tokyo Cabinet on-disk B+ Tree." msgstr "" #: src/labels.h:256 msgid "Built using Tokyo Cabinet in-memory hash database." msgstr "" #: src/labels.h:258 msgid "Built using the default in-memory hash database." msgstr "" #: src/labels.h:262 msgid "Format Errors - Verify your log/date/time format" msgstr "" #: src/labels.h:264 msgid "No date format was found on your conf file." msgstr "" #: src/labels.h:266 msgid "No log format was found on your conf file." msgstr "" #: src/labels.h:268 msgid "No time format was found on your conf file." msgstr "" #: src/labels.h:270 msgid "No default config file found." msgstr "" #: src/labels.h:272 msgid "You may specify one with" msgstr "" #: src/labels.h:274 msgid "producing the following errors" msgstr "" #: src/labels.h:276 #, c-format msgid "Parsed %1$d lines" msgstr "" #: src/labels.h:278 msgid "Please report it by opening an issue on GitHub" msgstr "" #: src/labels.h:280 msgid "Select a time format." msgstr "" #: src/labels.h:282 msgid "Select a date format." msgstr "" #: src/labels.h:284 msgid "Select a log format." msgstr "" #: src/labels.h:286 #, c-format msgid "'%1$s' panel is disabled" msgstr "" #: src/labels.h:290 msgid "For more details visit" msgstr "" #: src/labels.h:292 msgid "Last Updated" msgstr "" #: src/labels.h:294 msgid "WebSocket server ready to accept new client connections" msgstr "" #: src/labels.h:297 msgid "The following options can also be supplied to the command" msgstr "" #: src/labels.h:299 msgid "Examples can be found by running" msgstr "" #: src/labels.h:302 msgid "Server Statistics" msgstr "" #: src/labels.h:304 msgid "Theme" msgstr "" #: src/labels.h:306 msgid "Dark Gray" msgstr "" #: src/labels.h:308 msgid "Bright" msgstr "" #: src/labels.h:310 msgid "Dark Blue" msgstr "" #: src/labels.h:312 msgid "Dark Purple" msgstr "" #: src/labels.h:314 msgid "Panels" msgstr "" #: src/labels.h:316 msgid "Items per Page" msgstr "" #: src/labels.h:318 msgid "Tables" msgstr "" #: src/labels.h:320 msgid "Display Tables" msgstr "" #: src/labels.h:322 msgid "Auto-Hide on Small Devices" msgstr "" #: src/labels.h:324 msgid "Automatically hide tables on small screen devices" msgstr "" #: src/labels.h:326 msgid "Layout" msgstr "" #: src/labels.h:328 msgid "Horizontal" msgstr "" #: src/labels.h:330 msgid "Vertical" msgstr "" #: src/labels.h:332 msgid "File Options" msgstr "" #: src/labels.h:334 msgid "Export as JSON" msgstr "" #: src/labels.h:336 msgid "Panel Options" msgstr "" #: src/labels.h:338 msgid "Previous" msgstr "" #: src/labels.h:340 msgid "Next" msgstr "" #: src/labels.h:342 msgid "First" msgstr "" #: src/labels.h:344 msgid "Last" msgstr "" #: src/labels.h:346 msgid "Chart Options" msgstr "" #: src/labels.h:348 msgid "Chart" msgstr "" #: src/labels.h:350 msgid "Type" msgstr "" #: src/labels.h:352 msgid "Area Spline" msgstr "" #: src/labels.h:354 msgid "Bar" msgstr "" #: src/labels.h:356 msgid "Plot Metric" msgstr "" #: src/labels.h:358 msgid "Table Columns" msgstr "" #: src/labels.h:362 msgid "1xx Informational" msgstr "" #: src/labels.h:364 msgid "2xx Success" msgstr "" #: src/labels.h:366 msgid "3xx Redirection" msgstr "" #: src/labels.h:368 msgid "4xx Client Errors" msgstr "" #: src/labels.h:370 msgid "5xx Server Errors" msgstr "" #: src/labels.h:373 msgid "100 - Continue: Server received the initial part of the request" msgstr "" #: src/labels.h:375 msgid "101 - Switching Protocols: Client asked to switch protocols" msgstr "" #: src/labels.h:377 msgid "200 - OK: The request sent by the client was successful" msgstr "" #: src/labels.h:379 msgid "201 - Created: The request has been fulfilled and created" msgstr "" #: src/labels.h:381 msgid "202 - Accepted: The request has been accepted for processing" msgstr "" #: src/labels.h:383 msgid "203 - Non-authoritative Information: Response from a third party" msgstr "" #: src/labels.h:385 msgid "204 - No Content: Request did not return any content" msgstr "" #: src/labels.h:387 msgid "205 - Reset Content: Server asked the client to reset the document" msgstr "" #: src/labels.h:389 msgid "206 - Partial Content: The partial GET has been successful" msgstr "" #: src/labels.h:391 msgid "207 - Multi-Status: WebDAV; RFC 4918" msgstr "" #: src/labels.h:393 msgid "208 - Already Reported: WebDAV; RFC 5842" msgstr "" #: src/labels.h:395 msgid "300 - Multiple Choices: Multiple options for the resource" msgstr "" #: src/labels.h:397 msgid "301 - Moved Permanently: Resource has permanently moved" msgstr "" #: src/labels.h:399 msgid "302 - Moved Temporarily (redirect)" msgstr "" #: src/labels.h:401 msgid "303 - See Other Document: The response is at a different URI" msgstr "" #: src/labels.h:403 msgid "304 - Not Modified: Resource has not been modified" msgstr "" #: src/labels.h:405 msgid "305 - Use Proxy: Can only be accessed through the proxy" msgstr "" #: src/labels.h:407 msgid "307 - Temporary Redirect: Resource temporarily moved" msgstr "" #: src/labels.h:409 msgid "400 - Bad Request: The syntax of the request is invalid" msgstr "" #: src/labels.h:411 msgid "401 - Unauthorized: Request needs user authentication" msgstr "" #: src/labels.h:413 msgid "402 - Payment Required" msgstr "" #: src/labels.h:415 msgid "403 - Forbidden: Server is refusing to respond to it" msgstr "" #: src/labels.h:417 msgid "404 - Not Found: Requested resource could not be found" msgstr "" #: src/labels.h:419 msgid "405 - Method Not Allowed: Request method not supported" msgstr "" #: src/labels.h:421 msgid "406 - Not Acceptable" msgstr "" #: src/labels.h:423 msgid "407 - Proxy Authentication Required" msgstr "" #: src/labels.h:425 msgid "408 - Request Timeout: Server timed out waiting for the request" msgstr "" #: src/labels.h:427 msgid "409 - Conflict: Conflict in the request" msgstr "" #: src/labels.h:429 msgid "410 - Gone: Resource requested is no longer available" msgstr "" #: src/labels.h:431 msgid "411 - Length Required: Invalid Content-Length" msgstr "" #: src/labels.h:433 msgid "412 - Precondition Failed: Server does not meet preconditions" msgstr "" #: src/labels.h:435 msgid "413 - Payload Too Large" msgstr "" #: src/labels.h:437 msgid "414 - Request-URI Too Long" msgstr "" #: src/labels.h:439 msgid "415 - Unsupported Media Type: Media type is not supported" msgstr "" #: src/labels.h:441 msgid "416 - Requested Range Not Satisfiable: Cannot supply that portion" msgstr "" #: src/labels.h:443 msgid "417 - Expectation Failed" msgstr "" #: src/labels.h:445 msgid "421 - Misdirected Request" msgstr "" #: src/labels.h:447 msgid "422 - Unprocessable Entity due to semantic errors: WebDAV" msgstr "" #: src/labels.h:449 msgid "423 - The resource that is being accessed is locked" msgstr "" #: src/labels.h:451 msgid "424 - Failed Dependency: WebDAV" msgstr "" #: src/labels.h:453 msgid "426 - Upgrade Required: Client should switch to a different protocol" msgstr "" #: src/labels.h:455 msgid "428 - Precondition Required" msgstr "" #: src/labels.h:457 msgid "429 - Too Many Requests: The user has sent too many requests" msgstr "" #: src/labels.h:459 msgid "431 - Request Header Fields Too Large" msgstr "" #: src/labels.h:461 msgid "451 - Unavailable For Legal Reasons" msgstr "" #: src/labels.h:463 msgid "444 - (Nginx) Connection closed without sending any headers" msgstr "" #: src/labels.h:465 msgid "494 - (Nginx) Request Header Too Large" msgstr "" #: src/labels.h:467 msgid "495 - (Nginx) SSL client certificate error" msgstr "" #: src/labels.h:469 msgid "496 - (Nginx) Client didn't provide certificate" msgstr "" #: src/labels.h:471 msgid "497 - (Nginx) HTTP request sent to HTTPS port" msgstr "" #: src/labels.h:473 msgid "499 - (Nginx) Connection closed by client while processing request" msgstr "" #: src/labels.h:475 msgid "500 - Internal Server Error" msgstr "" #: src/labels.h:477 msgid "501 - Not Implemented" msgstr "" #: src/labels.h:479 msgid "502 - Bad Gateway: Received an invalid response from the upstream" msgstr "" #: src/labels.h:481 msgid "503 - Service Unavailable: The server is currently unavailable" msgstr "" #: src/labels.h:483 msgid "504 - Gateway Timeout: The upstream server failed to send request" msgstr "" #: src/labels.h:485 msgid "505 - HTTP Version Not Supported" msgstr "" #: src/labels.h:487 msgid "520 - CloudFlare - Web server is returning an unknown error" msgstr "" #: src/labels.h:489 msgid "521 - CloudFlare - Web server is down" msgstr "" #: src/labels.h:491 msgid "522 - CloudFlare - Connection timed out" msgstr "" #: src/labels.h:493 msgid "523 - CloudFlare - Origin is unreachable" msgstr "" #: src/labels.h:495 msgid "524 - CloudFlare - A timeout occurred" msgstr "" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/fr.gmo������������������������������������������������������������������������������0000644�0000000�0000000�00000021606�13375711133�011575� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Þ•����y������ä��£���¬������8 �� ���9 �����E ��1���` �� ���’ �����œ �����  �����§ ��2���° ��*���ã ��0��� �����? �� ���E �����S ��A���X �����š �� ���¢ �� ���¬ �� ���¶ �� ���À ��%���Ê �����ð ��+���õ ��+���! �� ���M �����W �� ���f �� ���‡ �� ���• �����  �����¯ �� ���¿ �����Ì �����æ ��0���ý �� ���. �����; �����M �����R ��;���W �� ���“ �����ž �����§ �����­ �����¾ �� ���Í ��&���Ø �� ���ÿ ����� ������� ����� ���'�����1�����8�����<��+���A�����m��*���‹��+���¶�� ���â�����ì����������������� ���1�����?�����F��.���X�� ���‡�����“�����œ�����¢�����«�� ���°�����º�����É��.���Ù�� �����!��������6�����M�����V�� ���h�����u�� ���…�� ���’����� ��9���§�����á�����ç�����ì��3���þ��<���2��5���o��<���¥��:���â��>�����F���\��@���£��G���ä��8���,�����e�����k�����z������������+���§�����Ó�����â�� ���ë�����ù�����þ�������7���!�����Y�����r�����ƒ�����–�����§�����º�����½��–��Ü�����s�����†��K���¥�� ���ñ�����û������� ��� ��a�����?���x��R���¸�� ��� ����������*��>���0�����o�� ���t�� ���~�� ���Š�����–��6���¦�����Ý��1���æ��2����� ���K�����V��9���l�� ���¦�� ���´�����Á�����Û�����ð��,��������0��D���O�����”�� ���¦�����²�����·��L���¼�� ��� �� �������� �����'�����8�� ���H�����R�����c�� ���z�� ���†�����”�� ���£�����­�����¶�����º��>���Â��3�����A���5��A���w�� ���¹�����Å�����ß�����â��$���û����� �����3�����<��@���Q�����’�� ���£�����¯�� ���µ�����¿�����Ç�����Ï�����Þ��6���î�����%��+���8�����d�� ���~�����ˆ����� �����³�� ���Ç�����Ó�����ç��F���ð�����7�����>�����D��:���\��:���—��8���Ò��1��� ��>���= ��=���| ��N���º ��E��� !��O���O!��8���Ÿ!�����Ø!�����Þ!�����ð!�����õ!�����"��'���""�����J"�� ���\"�����f"�����v"��#���{"�� ���Ÿ"��C���©"�� ���í"�����#�����#�����8#�����I#�����b#�� ���e#�����H���E���S�������%������������������:���O���R��������������C���@���������<������ �����������8�������7���M��������������V�������I�����������;�������b���$���U���_���>���1���'�������s�����������x��� ���L�������?��������������q�������"��� ���y���u���)�������d���Q���j���+���v���=���#�������G����������h������.���������P���Z���6���J���N��������������D���o���T���5���r���B��� ���k���l���,�����������`���9����������� ��������������e���n���g�����������2����������Y���*���K���/���i��� ���a������W���!������(������^���]���X���f���t���w������m���F���������������������\������0���3�������c�������������4���[������&���-���p���A�����������Area Spline�Auto-Hide on Small Devices�Automatically hide tables on small screen devices�Avg. T.S.�Bar�Bright�Browsers�Built using Tokyo Cabinet in-memory hash database.�Built using Tokyo Cabinet on-disk B+ Tree.�Built using the default in-memory hash database.�Chart�Chart Options�City�Continent > Country sorted by unique hits [, avgts, cumts, maxts]�Country�Cum. T.S.�Dark Blue�Dark Gray�Dashboard�Dashboard - Overall Analyzed Requests�Data�Data sorted by hits [, avgts, cumts, maxts]�Data sorted by hour [, avgts, cumts, maxts]�Date/Time�Display Tables�Examples can be found by running�Excl. IP Hits�Exp. Panel�Export as JSON�Failed Requests�File Options�Find pattern in all views�For more details visit�Format Errors - Verify your log/date/time format�Geo Location�HTTP Status Codes�Help�Hits�Hits having the same IP, date and agent are a unique visit.�Horizontal�Hostname�Hosts�Init. Proc. Time�Items per Page�Keyphrases�Keyphrases from Google's search engine�Last Updated�Layout�Log Size�Log Source�Max. T.S.�Method�Mtd�Next�No date format was found on your conf file.�No default config file found.�No log format was found on your conf file.�No time format was found on your conf file.�Not Found�Not Found URLs (404s)�OS�Operating Systems�Overall Analyzed Requests�Panel Options�Panels�Parsed %1$d lines�Please report it by opening an issue on GitHub�Plot Metric�Previous�Proto�Protocol�Quit�Referrers�Referrers URLs�Referring Sites�Regex allowed - ^g to cancel - TAB switch case�Remote User�Remote User (HTTP authentication)�Requested Files (URLs)�Requests�Server Statistics�Static Files�Static Requests�Status Codes�Table Columns�Tables�The following options can also be supplied to the command�Theme�Time�Time Distribution�Top Browsers sorted by hits [, avgts, cumts, maxts]�Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]�Top Keyphrases sorted by hits [, avgts, cumts, maxts]�Top Operating Systems sorted by hits [, avgts, cumts, maxts]�Top Referring Sites sorted by hits [, avgts, cumts, maxts]�Top Requested Referrers sorted by hits [, avgts, cumts, maxts]�Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top visitor hosts sorted by hits [, avgts, cumts, maxts]�Total�Total Requests�Type�Unique Visitors�Unique visitors per day�Unique visitors per day - Including spiders�Valid Requests�Vertical�Virtual Hosts�Vis.�Visitor Hostnames and IPs�Visitors�WebSocket server ready to accept new client connections�You may specify one with�[ ] ASC [x] DESC�[ ] case sensitive�[x] ASC [ ] DESC�[x] case sensitive�en�producing the following errors�Project-Id-Version: goaccess 1.2 Report-Msgid-Bugs-To: hello@goaccess.io POT-Creation-Date: 2018-11-22 23:38-0600 PO-Revision-Date: 2017-04-03 09:43+0200 Last-Translator: Nicolas P <np.pascal@gmail.com> Language-Team: français Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Gtranslator 2.91.7 �Courbe vectorielle�Masquage-auto/Petits appareils�Masquer automatiquement les tableaux sur les appareils avec un petit écran�Avg. T.S.�Barre�Brillant�Navigateurs�Construit en mémoire avec une base de données de la table de hachage en utilisant Tokyo Cabinet�Construit sur le disque en arbre B+ en utilisant Tokyo Cabinet.�Construit par défaut en mémoire avec une base de données de la table de hachage�Graphique�Options du graphique�Ville�Continent > Pays trié par hits unique [, avgts, cumts, maxts]�Pays�Cum. T.S.�Bleu foncé�Gris foncé�Tableau de bord�Tableau de bord - Requêtes analysées, vue d'ensemble�Données�Données triées par hits [, avgts, cumts, maxts]�Données triées par heure [, avgts, cumts, maxts]�Date/Heure�Afficher les tableaux�Des exemples peuvent être trouvés en cours d'exécution�Excl. IP Hits�Dev. Panneau�Exporter en tant que JSON�Requêtes échouées�Options de fichier�Trouver tous les motifs dans toutes les vues�Pour plus de détails, visitez�Erreurs de format - Vérifiez votre format de journal / date / heure�Géo Localisation�Status HTTP�Aide�Hits�Les hits depuis la même IP, date et user-agent comptent comme visite unique�Horizontal�Nom d'hôte�Hôtes�Init. Proc. Time�Objets par page�Mot-clés�Mot-clés Google�Dernière mise à jour�Disposition�Taille du log�Fichier de log�Max. T.S.�Méthode�Mtd�Suivant�Aucun format de date n'a été trouvé sur votre fichier conf.�Aucun fichier de configuration par défaut trouvé.�Aucun format de journal n'a été trouvé sur votre fichier conf.�Aucun format de journal n'a été trouvé sur votre fichier conf.�Non Trouvé�URLs Non trouvées (404s)�SE�Systèmes d'exploitation�Requêtes analysées, vue d'ensemble�Options du panneau�Panneaux�Analysé %1$d lignes�Si vous plaît, rapporter cela en ouvrant un probleme sur GitHub�Tracé métrique�Précédent�Proto�Protocole�Quitter�Origine�URLs d'origine�Sites d'origine�Regex OK - ^g pour annuler - TAB pour changer la casse�Remote Utilisateur�Utilisateur distant (authentification HTTP)�Fichiers demandés (URLs)�Requêtes�Statistiques du serveur�Fichiers statiques�Requêtes statiques�Status HTTP�Colonnes de tableau�Tableaux�Les options suivantes peuvent également être fournies à la commande�Thème�Temps�Distribution temporelle�Top des Navigateurs trié par hits [, avgts, cumts, maxts]�Top des status HTTP trié par hits [, avgts, cumts, maxts]�Top des Mot-clés trié par hits [, avgts, cumts, maxts]�Top des SE trié par hits [, avgts, cumts, maxts]�Top des sites d'origine trié par hits [, avgts, cumts, maxts]�Top des URLs d'origine trié par hits [, avgts, cumts, maxts]�Top des URLs non trouvées trié par hits [, avgts, cumts, maxts, mthd, proto]�Top des requêtes trié par hits [, avgts, cumts, maxts, mthd, proto]�Top des requêtes statiques trié par hits [, avgts, cumts, maxts, mthd, proto]�Top des visiteurs trié par hits [, avgts, cumts, maxts]�Total�Requêtes totales�Type�Visiteurs uniques�Visiteurs uniques par jour�Visiteurs uniques/jour - Y compris bots�Requêtes valides�Verticale�Hôtes virtuels�Vis.�Nom de machine et IPs des visiteurs�Visiteurs�WebSocket serveur prêt à accepter les nouvelles connexions client�Vous pouvez en préciser un avec�[ ] ASC [x] DESC�[ ] sensible à la casse�[x] ASC [ ] DESC�[x] sensible à la casse�fr�produisant les erreurs suivantes���������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/ja.po�������������������������������������������������������������������������������0000644�0000000�0000000�00000062444�13375711133�011421� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file is distributed under the same license as the goaccess package. # Kamino Hiroki, 2019. # msgid "" msgstr "" "Project-Id-Version: goaccess 1.2\n" "Report-Msgid-Bugs-To: hello@goaccess.io\n" "POT-Creation-Date: 2018-11-22 23:38-0600\n" "PO-Revision-Date: 2018-10-26 22:00+0900\n" "Last-Translator: Kamino Hiroki <37243867+4f8p@users.noreply.github.com>\n" "Language-Team: Japanese\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: src/labels.h:40 msgid "en" msgstr "ja" #: src/labels.h:43 msgid "Exp. Panel" msgstr "詳細表示" #: src/labels.h:44 msgid "Help" msgstr "ヘルプ" #: src/labels.h:45 msgid "Quit" msgstr "終了" #: src/labels.h:46 msgid "Total" msgstr "åˆè¨ˆ" #: src/labels.h:49 msgid "[x] ASC [ ] DESC" msgstr "[x] 昇順 [ ] é™é †" #: src/labels.h:50 msgid "[ ] ASC [x] DESC" msgstr "[ ] 昇順 [x] é™é †" #: src/labels.h:53 #, c-format msgid "[Active Panel: %1$s]" msgstr "[表示中ã®ãƒ‘ãƒãƒ«: %1$s]" #: src/labels.h:54 msgid "[q]uit GoAccess" msgstr "[q] GoAccessã‚’é–‰ã˜ã‚‹" #: src/labels.h:55 msgid "[?] Help [Enter] Exp. Panel" msgstr "[?] ヘルプ [Enter] 詳細表示" #: src/labels.h:56 msgid "Dashboard" msgstr "ダッシュボード" #: src/labels.h:57 msgid "Dashboard - Overall Analyzed Requests" msgstr "ダッシュボード - è§£æžæ¸ˆã¿ãƒªã‚¯ã‚¨ã‚¹ãƒˆå…¨ä½“" #: src/labels.h:58 msgid "Overall Analyzed Requests" msgstr "è§£æžæ¸ˆã¿ãƒªã‚¯ã‚¨ã‚¹ãƒˆå…¨ä½“" #: src/labels.h:60 src/labels.h:81 msgid "Tx. Amount" msgstr "データ転é€é‡" #: src/labels.h:61 msgid "Date/Time" msgstr "日付/時刻" #: src/labels.h:62 msgid "Excl. IP Hits" msgstr "除外対象数" #: src/labels.h:63 msgid "Failed Requests" msgstr "無効リクエスト数" #: src/labels.h:64 msgid "Init. Proc. Time" msgstr "è§£æžã«ã‹ã‹ã£ãŸæ™‚é–“" #: src/labels.h:65 msgid "Log Size" msgstr "ログファイルサイズ" #: src/labels.h:66 msgid "Log Source" msgstr "ログå–å¾—å…ƒ" #: src/labels.h:67 src/labels.h:174 msgid "Referrers" msgstr "リファラー数" #: src/labels.h:68 msgid "Total Requests" msgstr "åˆè¨ˆãƒªã‚¯ã‚¨ã‚¹ãƒˆæ•°" #: src/labels.h:69 msgid "Static Files" msgstr "é™çš„ファイル数" #: src/labels.h:70 src/labels.h:146 msgid "Not Found" msgstr "404エラー数" #: src/labels.h:71 msgid "Requested Files" msgstr "è¦æ±‚ã•れãŸãƒ•ァイル数" #: src/labels.h:72 msgid "Unique Visitors" msgstr "ユニークユーザー数" #: src/labels.h:73 msgid "Valid Requests" msgstr "有効リクエスト数" #: src/labels.h:76 msgid "Hits" msgstr "ヒット数" #: src/labels.h:77 msgid "h%" msgstr "h%" #: src/labels.h:78 src/labels.h:104 msgid "Visitors" msgstr "ユーザー数" #: src/labels.h:79 msgid "Vis." msgstr "ユーザー数" #: src/labels.h:80 msgid "v%" msgstr "v%" #: src/labels.h:82 msgid "Avg. T.S." msgstr "å¹³å‡å‡¦ç†æ™‚é–“" #: src/labels.h:83 msgid "Cum. T.S." msgstr "åˆè¨ˆå‡¦ç†æ™‚é–“" #: src/labels.h:84 msgid "Max. T.S." msgstr "æœ€å¤§å‡¦ç†æ™‚é–“" #: src/labels.h:85 msgid "Method" msgstr "è¦æ±‚" #: src/labels.h:86 msgid "Mtd" msgstr "è¦æ±‚" #: src/labels.h:87 msgid "Protocol" msgstr "プロトコル" #: src/labels.h:88 msgid "Proto" msgstr "プロトコル" #: src/labels.h:89 msgid "City" msgstr "地域" #: src/labels.h:90 msgid "Country" msgstr "国å" #: src/labels.h:91 msgid "Hostname" msgstr "ホストå" #: src/labels.h:92 msgid "Data" msgstr "データ" #: src/labels.h:94 msgid "Hits/Visitors" msgstr "ヒット数/ユーザー数" #: src/labels.h:98 msgid "Unique visitors per day" msgstr "一日ã‚ãŸã‚Šã®ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼æ•°" #: src/labels.h:100 msgid "Unique visitors per day - Including spiders" msgstr "一日ã‚ãŸã‚Šã®ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼æ•°ï¼ˆã‚¯ãƒ­ãƒ¼ãƒ©ã‚‚å«ã‚る)" #: src/labels.h:102 msgid "Hits having the same IP, date and agent are a unique visit." msgstr "" "IPã‚¢ãƒ‰ãƒ¬ã‚¹ã€æ—¥ä»˜ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆãŒå…¨ã¦åŒä¸€ã ã£ãŸå ´åˆã€ãƒ¦ãƒ‹ãƒ¼ã‚¯ãƒ¦ãƒ¼ã‚¶ãƒ¼" "ã¨ã—ã¦æ‰±ã‚れã¾ã™ã€‚" #: src/labels.h:107 msgid "Requested Files (URLs)" msgstr "リクエストã•れãŸãƒ•ァイル(URL)" #: src/labels.h:109 msgid "Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "リクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:111 msgid "Requests" msgstr "リクエスト数" #: src/labels.h:114 src/labels.h:118 msgid "Static Requests" msgstr "é™çš„ファイルリクエスト数" #: src/labels.h:116 msgid "Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "é™çš„ファイルリクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:121 msgid "Time Distribution" msgstr "時間分布" #: src/labels.h:123 msgid "Data sorted by hour [, avgts, cumts, maxts]" msgstr "" "リクエストã•ã‚ŒãŸæ™‚刻順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:125 msgid "Time" msgstr "時刻" #: src/labels.h:128 src/labels.h:132 msgid "Virtual Hosts" msgstr "ãƒãƒ¼ãƒãƒ£ãƒ«ãƒ›ã‚¹ãƒˆ" #: src/labels.h:130 src/labels.h:137 msgid "Data sorted by hits [, avgts, cumts, maxts]" msgstr "リクエスト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:135 msgid "Remote User (HTTP authentication)" msgstr "èªè¨¼ã•れãŸãƒ¦ãƒ¼ã‚¶ãƒ¼ï¼ˆHTTPèªè¨¼ï¼‰" #: src/labels.h:139 msgid "Remote User" msgstr "èªè¨¼ã•れãŸãƒ¦ãƒ¼ã‚¶ãƒ¼" #: src/labels.h:142 msgid "Not Found URLs (404s)" msgstr "404エラーãŒè¿”ã•れãŸURL" #: src/labels.h:144 msgid "Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "エラーã¨ãªã£ãŸURLé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:149 msgid "Visitor Hostnames and IPs" msgstr "ユーザーã®ãƒ›ã‚¹ãƒˆåã¨IPアドレス" #: src/labels.h:151 msgid "Top visitor hosts sorted by hits [, avgts, cumts, maxts]" msgstr "ホストåé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:153 msgid "Hosts" msgstr "ホストå" #: src/labels.h:156 msgid "Operating Systems" msgstr "オペレーティングシステム" #: src/labels.h:158 msgid "Top Operating Systems sorted by hits [, avgts, cumts, maxts]" msgstr "OSé †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:160 msgid "OS" msgstr "OS" #: src/labels.h:163 src/labels.h:167 msgid "Browsers" msgstr "ブラウザ" #: src/labels.h:165 msgid "Top Browsers sorted by hits [, avgts, cumts, maxts]" msgstr "ブラウザ順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:170 msgid "Referrers URLs" msgstr "å‚照元(URL)" #: src/labels.h:172 msgid "Top Requested Referrers sorted by hits [, avgts, cumts, maxts]" msgstr "é€ä¿¡å…ƒã‚¢ãƒ‰ãƒ¬ã‚¹é †ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:177 src/labels.h:181 msgid "Referring Sites" msgstr "å‚照元サイト" #: src/labels.h:179 msgid "Top Referring Sites sorted by hits [, avgts, cumts, maxts]" msgstr "å‚照元サイト順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:184 msgid "Keyphrases from Google's search engine" msgstr "キーフレーズ(Google検索ã‹ã‚‰ï¼‰" #: src/labels.h:186 msgid "Top Keyphrases sorted by hits [, avgts, cumts, maxts]" msgstr "キーフレーズ順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:188 msgid "Keyphrases" msgstr "キーフレーズ" #: src/labels.h:191 src/labels.h:195 msgid "Geo Location" msgstr "ä½ç½®æƒ…å ±" #: src/labels.h:193 msgid "Continent > Country sorted by unique hits [, avgts, cumts, maxts]" msgstr "地ç†åŒºåˆ† > 国別ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:198 msgid "HTTP Status Codes" msgstr "HTTPステータスコード" #: src/labels.h:200 msgid "Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]" msgstr "" "HTTPステータスコード順ã«ã‚½ãƒ¼ãƒˆ [å¹³å‡å‡¦ç†æ™‚é–“ã€åˆè¨ˆå‡¦ç†æ™‚é–“ã€æœ€å¤§å‡¦ç†æ™‚é–“]" #: src/labels.h:202 msgid "Status Codes" msgstr "ステータスコード" #: src/labels.h:206 msgid "[ ] case sensitive" msgstr "[ ] 大文字ã¨å°æ–‡å­—を区別ã™ã‚‹" #: src/labels.h:208 msgid "[x] case sensitive" msgstr "[x] 大文字ã¨å°æ–‡å­—を区別ã™ã‚‹" #: src/labels.h:210 msgid "Regex allowed - ^g to cancel - TAB switch case" msgstr "æ­£è¦è¡¨ç¾ã‚’許å¯ã™ã‚‹ - [^g] キャンセル - [TAB] 切り替ãˆ" #: src/labels.h:212 msgid "Find pattern in all views" msgstr "ã™ã¹ã¦ã®ãƒ“ューã§ãƒ‘ターン検索を行ã†" #: src/labels.h:216 msgid "Log Format Configuration" msgstr "ログ形å¼è¨­å®š" #: src/labels.h:218 msgid "[SPACE] to toggle - [ENTER] to proceed - [q] to quit" msgstr "[SPACE] 切り替㈠- [ENTER] 決定 - [q] 終了" #: src/labels.h:220 msgid "Log Format - [c] to add/edit format" msgstr "ãƒ­ã‚°å½¢å¼ - [c] 追加/編集" #: src/labels.h:222 msgid "Date Format - [d] to add/edit format" msgstr "æ—¥ä»˜å½¢å¼ - [d] 追加/編集" #: src/labels.h:224 msgid "Time Format - [t] to add/edit format" msgstr "æ™‚åˆ»å½¢å¼ - [t] 追加/編集" #: src/labels.h:226 src/labels.h:230 msgid "[UP/DOWN] to scroll - [q] to close window" msgstr "[↑/↓] スクロール - [q] ウィンドウを閉ã˜ã‚‹" #: src/labels.h:232 #, c-format msgid "User Agents for %1$s" msgstr "%1$s ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆ" #: src/labels.h:236 msgid "Scheme Configuration" msgstr "スキーム設定" #: src/labels.h:238 msgid "[ENTER] to use scheme - [q]uit" msgstr "[ENTER] ã‚¹ã‚­ãƒ¼ãƒ é¸æŠž - [q] 終了" #: src/labels.h:242 msgid "Sort active module by" msgstr "é¸æŠžã—ãŸã‚«ãƒ©ãƒ ã§ä¸¦ã³æ›¿ãˆ" #: src/labels.h:244 msgid "[ENTER] select - [TAB] sort - [q]uit" msgstr "[ENTER] é¸æŠž - [TAB] ソート - [q] 終了" #: src/labels.h:248 msgid "GoAccess Quick Help" msgstr "GoAccessクイックヘルプ" #: src/labels.h:250 msgid "[UP/DOWN] to scroll - [q] to quit" msgstr "[↑/↓] スクロール - [q] 終了" #: src/labels.h:254 msgid "Built using Tokyo Cabinet on-disk B+ Tree." msgstr "Tokyo Cabinetã®B+木データベースを使用ã™ã‚‹ã€‚" #: src/labels.h:256 msgid "Built using Tokyo Cabinet in-memory hash database." msgstr "Tokyo Cabinetã®ã‚¤ãƒ³ãƒ¡ãƒ¢ãƒªãƒãƒƒã‚·ãƒ¥ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’使用ã™ã‚‹ã€‚" #: src/labels.h:258 msgid "Built using the default in-memory hash database." msgstr "デフォルトã®ã‚¤ãƒ³ãƒ¡ãƒ¢ãƒªãƒãƒƒã‚·ãƒ¥ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’使用ã™ã‚‹ã€‚" #: src/labels.h:262 msgid "Format Errors - Verify your log/date/time format" msgstr "" "è§£æžã«å¤±æ•—ã—ã¾ã—㟠- ログ/日付/時刻ã®ãƒ•ォーマット設定を確èªã—ã¦ãã ã•ã„" #: src/labels.h:264 msgid "No date format was found on your conf file." msgstr "è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«å†…ã§æ—¥ä»˜å½¢å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。" #: src/labels.h:266 msgid "No log format was found on your conf file." msgstr "設定ファイル内ã§ãƒ­ã‚°å½¢å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。" #: src/labels.h:268 msgid "No time format was found on your conf file." msgstr "è¨­å®šãƒ•ã‚¡ã‚¤ãƒ«å†…ã§æ™‚刻形å¼ãŒã‚»ãƒƒãƒˆã•れã¦ã„ã¾ã›ã‚“。" #: src/labels.h:270 msgid "No default config file found." msgstr "デフォルトã®è¨­å®šãƒ•ァイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。" #: src/labels.h:272 msgid "You may specify one with" msgstr "ã„ãšã‚Œã‹æŒ‡å®šã—ã¦ãã ã•ã„" #: src/labels.h:274 msgid "producing the following errors" msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ" #: src/labels.h:276 #, c-format msgid "Parsed %1$d lines" msgstr "è§£æžæ¸ˆã¿: %1$d 行" #: src/labels.h:278 msgid "Please report it by opening an issue on GitHub" msgstr "GitHub上ã®Issueã‹ã‚‰å•題を報告ã—ã¦ãã ã•ã„" #: src/labels.h:280 msgid "Select a time format." msgstr "時刻形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚" #: src/labels.h:282 msgid "Select a date format." msgstr "日付形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚" #: src/labels.h:284 msgid "Select a log format." msgstr "ログ形å¼ã‚’é¸æŠžã—ã¾ã™ã€‚" #: src/labels.h:286 #, c-format msgid "'%1$s' panel is disabled" msgstr "'%1$s' パãƒãƒ«ã¯ç„¡åŠ¹åŒ–ã•れã¦ã„ã¾ã™" #: src/labels.h:290 msgid "For more details visit" msgstr "詳細ã¯ã“ã¡ã‚‰" #: src/labels.h:292 msgid "Last Updated" msgstr "最終更新日時" #: src/labels.h:294 msgid "WebSocket server ready to accept new client connections" msgstr "WebSocketæŽ¥ç¶šã®æº–å‚™ãŒã§ãã¾ã—ãŸ" #: src/labels.h:297 msgid "The following options can also be supplied to the command" msgstr "次ã®ã‚ªãƒ—ションã¯ã‚³ãƒžãƒ³ãƒ‰ã§æŒ‡å®šã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™" #: src/labels.h:299 msgid "Examples can be found by running" msgstr "実行例" #: src/labels.h:302 msgid "Server Statistics" msgstr "サーãƒãƒ¼ã®çµ±è¨ˆæƒ…å ±" #: src/labels.h:304 msgid "Theme" msgstr "テーマ" #: src/labels.h:306 msgid "Dark Gray" msgstr "ダークグレー" #: src/labels.h:308 msgid "Bright" msgstr "ライト" #: src/labels.h:310 msgid "Dark Blue" msgstr "ダークブルー" #: src/labels.h:312 #, fuzzy msgid "Dark Purple" msgstr "ダークブルー" #: src/labels.h:314 msgid "Panels" msgstr "パãƒãƒ«" #: src/labels.h:316 msgid "Items per Page" msgstr "ページã‚ãŸã‚Šã®è¡¨ç¤ºæ•°" #: src/labels.h:318 msgid "Tables" msgstr "テーブル" #: src/labels.h:320 msgid "Display Tables" msgstr "テーブル表示" #: src/labels.h:322 msgid "Auto-Hide on Small Devices" msgstr "自動éžè¡¨ç¤ºè¨­å®šï¼ˆå°åž‹ç«¯æœ«ç”¨ï¼‰" #: src/labels.h:324 msgid "Automatically hide tables on small screen devices" msgstr "ç”»é¢ãŒå°ã•ã„å ´åˆã«è‡ªå‹•ã§ãƒ†ãƒ¼ãƒ–ルをéžè¡¨ç¤ºã«ã™ã‚‹" #: src/labels.h:326 msgid "Layout" msgstr "レイアウト" #: src/labels.h:328 msgid "Horizontal" msgstr "æ°´å¹³" #: src/labels.h:330 msgid "Vertical" msgstr "垂直" #: src/labels.h:332 msgid "File Options" msgstr "ファイルオプション" #: src/labels.h:334 msgid "Export as JSON" msgstr "JSONå½¢å¼ã§ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆ" #: src/labels.h:336 msgid "Panel Options" msgstr "パãƒãƒ«ã‚ªãƒ—ション" #: src/labels.h:338 msgid "Previous" msgstr "å‰ã¸" #: src/labels.h:340 msgid "Next" msgstr "次ã¸" #: src/labels.h:342 msgid "First" msgstr "" #: src/labels.h:344 msgid "Last" msgstr "" #: src/labels.h:346 msgid "Chart Options" msgstr "グラフ設定" #: src/labels.h:348 msgid "Chart" msgstr "グラフ" #: src/labels.h:350 msgid "Type" msgstr "タイプ" #: src/labels.h:352 msgid "Area Spline" msgstr "平滑é¢ã‚°ãƒ©ãƒ•" #: src/labels.h:354 msgid "Bar" msgstr "棒グラフ" #: src/labels.h:356 msgid "Plot Metric" msgstr "表示ã™ã‚‹ãƒ‡ãƒ¼ã‚¿" #: src/labels.h:358 msgid "Table Columns" msgstr "テーブルカラム" #: src/labels.h:362 msgid "1xx Informational" msgstr "1xx 情報" #: src/labels.h:364 msgid "2xx Success" msgstr "2xx æˆåŠŸ" #: src/labels.h:366 msgid "3xx Redirection" msgstr "3xx リダイレクション" #: src/labels.h:368 msgid "4xx Client Errors" msgstr "4xx クライアントエラー" #: src/labels.h:370 msgid "5xx Server Errors" msgstr "5xx サーãƒãƒ¼ã‚¨ãƒ©ãƒ¼" #: src/labels.h:373 msgid "100 - Continue: Server received the initial part of the request" msgstr "100 - 継続: リクエストヘッダーをå—ç†ã—ã¾ã—ãŸ" #: src/labels.h:375 msgid "101 - Switching Protocols: Client asked to switch protocols" msgstr "" "101 - プロトコル変更: HTTPヘッダーã§ãƒªã‚¯ã‚¨ã‚¹ãƒˆã•れãŸãƒ—ロトコルã«åˆ‡ã‚Šæ›¿ãˆã¾ã™" #: src/labels.h:377 msgid "200 - OK: The request sent by the client was successful" msgstr "200 - æˆåŠŸ: ãƒªã‚¯ã‚¨ã‚¹ãƒˆã«æˆåŠŸã—ã¾ã—ãŸ" #: src/labels.h:379 msgid "201 - Created: The request has been fulfilled and created" msgstr "201 - 作æˆ: ãƒªã‚¯ã‚¨ã‚¹ãƒˆãŒæˆåŠŸã—ã¦æ–°ãŸãªãƒªã‚½ãƒ¼ã‚¹ã®ä½œæˆãŒå®Œäº†ã—ã¾ã—ãŸ" #: src/labels.h:381 msgid "202 - Accepted: The request has been accepted for processing" msgstr "202 - å—ç†: リクエストをå—ã‘å–ã£ãŸãŒå‡¦ç†ã•れã¦ã„ã¾ã›ã‚“" #: src/labels.h:383 msgid "203 - Non-authoritative Information: Response from a third party" msgstr "" "203 - èªè¨¼ã•れã¦ã„ãªã„情報: リクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸãŒã€è¿”ã•れる情報ã¯" "別ã®é€ä¿¡å…ƒã‹ã‚‰æ¥ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™" #: src/labels.h:385 msgid "204 - No Content: Request did not return any content" msgstr "" "204 - コンテンツ無ã—: リクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸãŒã€è¿”ã™ã¹ã情報ãŒã‚りã¾" "ã›ã‚“" #: src/labels.h:387 msgid "205 - Reset Content: Server asked the client to reset the document" msgstr "" "205 - ãƒªã‚»ãƒƒãƒˆè¦æ±‚: リクエストを行ã£ãŸã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã«å¯¾ã—ã¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆãƒ“ュー" "ã®ãƒªã‚»ãƒƒãƒˆã‚’行ã†ã‚ˆã†æŒ‡ç¤ºã—ã¾ã™" #: src/labels.h:389 msgid "206 - Partial Content: The partial GET has been successful" msgstr "" "206 - 部分的ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ: GETリクエストを正常ã«å‡¦ç†ã—ã¾ã—ãŸï¼ˆãƒªã‚½ãƒ¼ã‚¹ãŒåˆ†å‰²ã•" "れã¦ã„ã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼‰" #: src/labels.h:391 msgid "207 - Multi-Status: WebDAV; RFC 4918" msgstr "207 - 複数ステータス: (WebDAVæ‹¡å¼µ) RFC 4918" #: src/labels.h:393 msgid "208 - Already Reported: WebDAV; RFC 5842" msgstr "208 - 報告済ã¿: (WebDAVæ‹¡å¼µ) RFC 5842" #: src/labels.h:395 msgid "300 - Multiple Choices: Multiple options for the resource" msgstr "" "300 - é¸æŠžãŒå¿…è¦: 複数ã®ãƒªãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆå…ˆãŒã‚りã€ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆå´ãŒé¸æŠžã™ã‚‹å¿…è¦ãŒ" "ã‚りã¾ã™" #: src/labels.h:397 msgid "301 - Moved Permanently: Resource has permanently moved" msgstr "301 - æ’ä¹…çš„ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å®Œå…¨ã«ç§»å‹•ã•れã¾ã—ãŸ" #: src/labels.h:399 msgid "302 - Moved Temporarily (redirect)" msgstr "302 - 一時的ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ä¸€æ™‚çš„ã«ç§»å‹•ã•れã¾ã—ãŸ" #: src/labels.h:401 msgid "303 - See Other Document: The response is at a different URI" msgstr "" "303 - 別コンテンツ: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯åˆ¥ã®URLã§æä¾›ã•れã¦ã„ã¾ã™" #: src/labels.h:403 msgid "304 - Not Modified: Resource has not been modified" msgstr "304 - æ›´æ–°ç„¡ã—: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯æ›´æ–°ã•れã¦ã„ã¾ã›ã‚“" #: src/labels.h:405 msgid "305 - Use Proxy: Can only be accessed through the proxy" msgstr "" "305 - プロキシ使用: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ãƒ—ロキシを使用ã—ã¦å–å¾—ã§ãã¾ã™" #: src/labels.h:407 msgid "307 - Temporary Redirect: Resource temporarily moved" msgstr "307 - 一時的ãªç§»å‹•: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯ä¸€æ™‚çš„ã«ç§»å‹•ã•れã¾ã—ãŸ" #: src/labels.h:409 msgid "400 - Bad Request: The syntax of the request is invalid" msgstr "400 - 䏿­£ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ: リクエストを処ç†ã§ãã¾ã›ã‚“" #: src/labels.h:411 msgid "401 - Unauthorized: Request needs user authentication" msgstr "401 - èªè¨¼ãŒå¿…è¦: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã«ã¯èªè¨¼ãŒå¿…è¦ã§ã™" #: src/labels.h:413 msgid "402 - Payment Required" msgstr "402 - ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã™ã‚‹ã«ã¯æ–™é‡‘を支払ã†å¿…è¦ãŒã‚りã¾ã™" #: src/labels.h:415 msgid "403 - Forbidden: Server is refusing to respond to it" msgstr "403 - ã‚¢ã‚¯ã‚»ã‚¹ç¦æ­¢: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ç¦æ­¢ã•れã¦ã„ã¾ã™" #: src/labels.h:417 msgid "404 - Not Found: Requested resource could not be found" msgstr "404 - ãƒªã‚½ãƒ¼ã‚¹ä¸æ˜Ž: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å­˜åœ¨ã—ã¾ã›ã‚“" #: src/labels.h:419 msgid "405 - Method Not Allowed: Request method not supported" msgstr "" "405 - 許å¯ã•れã¦ã„ãªã„: リクエストã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã§ã®ã‚¢ã‚¯ã‚»ã‚¹ã¯ç¦æ­¢ã•れã¦ã„ã¾" "ã™" #: src/labels.h:421 msgid "406 - Not Acceptable" msgstr "406 - リクエストをå—ç†ã§ãã¾ã›ã‚“" #: src/labels.h:423 msgid "407 - Proxy Authentication Required" msgstr "407 - プロキシèªè¨¼ãŒå¿…è¦ã§ã™" #: src/labels.h:425 msgid "408 - Request Timeout: Server timed out waiting for the request" msgstr "408 - タイムアウト: リクエストãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ" #: src/labels.h:427 msgid "409 - Conflict: Conflict in the request" msgstr "409 - è¡çª: リクエストãŒè¡çªã—ã¾ã—ãŸ" #: src/labels.h:429 msgid "410 - Gone: Resource requested is no longer available" msgstr "410 - 消滅: リクエストã•れãŸãƒªã‚½ãƒ¼ã‚¹ã¯å®Œå…¨ã«å‰Šé™¤ã•れã¾ã—ãŸ" #: src/labels.h:431 msgid "411 - Length Required: Invalid Content-Length" msgstr "411 - Content-LengthヘッダーãŒå¿…è¦ã§ã™" #: src/labels.h:433 msgid "412 - Precondition Failed: Server does not meet preconditions" msgstr "" "412 - 剿æ¡ä»¶ãŒæº€ãŸã•れã¦ã„ãªã„: ã“ã®ãƒªã‚¯ã‚¨ã‚¹ãƒˆã¯ã‚µãƒ¼ãƒãƒ¼å´ã®å‰ææ¡ä»¶ã‚’満ãŸ" "ã—ã¦ã„ã¾ã›ã‚“" #: src/labels.h:435 msgid "413 - Payload Too Large" msgstr "413 - ペイロードãŒé•·ã™ãŽã¾ã™" #: src/labels.h:437 msgid "414 - Request-URI Too Long" msgstr "414 - URLãŒé•·ã™ãŽã¾ã™" #: src/labels.h:439 msgid "415 - Unsupported Media Type: Media type is not supported" msgstr "415 - サãƒãƒ¼ãƒˆã•れã¦ã„ãªã„メディアタイプ" #: src/labels.h:441 msgid "416 - Requested Range Not Satisfiable: Cannot supply that portion" msgstr "" "416 - リクエストã•れãŸContent-Lengthヘッダーã®ç¯„囲ãŒãƒªã‚½ãƒ¼ã‚¹ã‚ˆã‚Šè¶…éŽã—ã¦ã„ã¾" "ã™" #: src/labels.h:443 msgid "417 - Expectation Failed" msgstr "417 - 拡張ステータスコードãŒä½¿ãˆã¾ã›ã‚“" #: src/labels.h:445 msgid "421 - Misdirected Request" msgstr "421 - 䏿˜Žãªãƒªã‚¯ã‚¨ã‚¹ãƒˆ" #: src/labels.h:447 msgid "422 - Unprocessable Entity due to semantic errors: WebDAV" msgstr "422 - リクエストをå—ç†ã—ãŸãŒã€å‡¦ç†ã‚’継続ã§ãã¾ã›ã‚“" #: src/labels.h:449 msgid "423 - The resource that is being accessed is locked" msgstr "423 - ã“ã®ãƒªã‚½ãƒ¼ã‚¹ã¯ãƒ­ãƒƒã‚¯ã•れã¦ã„ã¾ã™" #: src/labels.h:451 msgid "424 - Failed Dependency: WebDAV" msgstr "424 - ä¾å­˜ã™ã‚‹ä»–ã®å‡¦ç†ãŒå¤±æ•—ã—ãŸãŸã‚処ç†ã§ãã¾ã›ã‚“" #: src/labels.h:453 msgid "426 - Upgrade Required: Client should switch to a different protocol" msgstr "" "426 - アップグレードãŒå¿…è¦: プロトコルãŒå¤ã™ãŽã¦ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã§ãã¾ã›ã‚“" #: src/labels.h:455 msgid "428 - Precondition Required" msgstr "428 - リクエストをæ¡ä»¶ä»˜ãã«ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™" #: src/labels.h:457 msgid "429 - Too Many Requests: The user has sent too many requests" msgstr "429 - éŽé‡ãƒªã‚¯ã‚¨ã‚¹ãƒˆ: 制é™ã•れãŸãƒªã‚¯ã‚¨ã‚¹ãƒˆæ•°ã‚’è¶…ãˆãŸã®ã§å‡¦ç†ã§ãã¾ã›ã‚“" #: src/labels.h:459 msgid "431 - Request Header Fields Too Large" msgstr "431 - HTTPヘッダーãŒé•·ã™ãŽã¾ã™" #: src/labels.h:461 msgid "451 - Unavailable For Legal Reasons" msgstr "451 - 法律上ã®ç†ç”±ã§ãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’処ç†ã§ãã¾ã›ã‚“" #: src/labels.h:463 msgid "444 - (Nginx) Connection closed without sending any headers" msgstr "444 - (nginx) ヘッダーを返ã•ãšã‚³ãƒã‚¯ã‚·ãƒ§ãƒ³ã‚’切断ã—ã¾ã—ãŸ" #: src/labels.h:465 msgid "494 - (Nginx) Request Header Too Large" msgstr "494 - (nginx) HTTPヘッダーãŒé•·ã™ãŽã¾ã™" #: src/labels.h:467 msgid "495 - (Nginx) SSL client certificate error" msgstr "495 - (nginx) SSLクライアント証明書エラー" #: src/labels.h:469 msgid "496 - (Nginx) Client didn't provide certificate" msgstr "496 - (nginx) クライアントãŒè¨¼æ˜Žæ›¸ã‚’æä¾›ã—ã¾ã›ã‚“ã§ã—ãŸ" #: src/labels.h:471 msgid "497 - (Nginx) HTTP request sent to HTTPS port" msgstr "497 - (nginx) HTTPリクエストをHTTPSãƒãƒ¼ãƒˆã«é€ä¿¡ã—ã¾ã—ãŸ" #: src/labels.h:473 msgid "499 - (Nginx) Connection closed by client while processing request" msgstr "" "499 - (nginx) リクエストを処ç†ä¸­ã«ã‚¯ãƒ©ã‚¤ã‚¢ãƒ³ãƒˆã«ã‚ˆã£ã¦æŽ¥ç¶šã‚’é–‰ã˜ã‚‰ã‚Œã¾ã—ãŸ" #: src/labels.h:475 msgid "500 - Internal Server Error" msgstr "500 - 内部サーãƒãƒ¼ã‚¨ãƒ©ãƒ¼" #: src/labels.h:477 msgid "501 - Not Implemented" msgstr "501 - サーãƒãƒ¼ã§ãƒ¡ã‚½ãƒƒãƒ‰ãŒå®Ÿè£…ã•れã¦ã„ã¾ã›ã‚“" #: src/labels.h:479 msgid "502 - Bad Gateway: Received an invalid response from the upstream" msgstr "" "502 - 䏿­£ãªã‚²ãƒ¼ãƒˆã‚¦ã‚§ã‚¤: 上æµã«ã‚るゲートウェイã¾ãŸã¯ãƒ—ロキシサーãƒãƒ¼ã‹ã‚‰ä¸" "æ­£ãªãƒªã‚¯ã‚¨ã‚¹ãƒˆã‚’å—ã‘å–りã¾ã—ãŸ" #: src/labels.h:481 msgid "503 - Service Unavailable: The server is currently unavailable" msgstr "503 - サービス利用ä¸å¯: サーãƒãƒ¼ãŒãƒ€ã‚¦ãƒ³ã—ã¾ã—ãŸ" #: src/labels.h:483 msgid "504 - Gateway Timeout: The upstream server failed to send request" msgstr "" "504 - ゲートウェイタイムアウト: 上æµã«ã‚るゲートウェイã¾ãŸã¯ãƒ—ロキシサーãƒãƒ¼" "ãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã‚’èµ·ã“ã—ã¾ã—ãŸ" #: src/labels.h:485 msgid "505 - HTTP Version Not Supported" msgstr "" "505 - リクエストã§ä½¿ç”¨ã•れã¦ã„ã‚‹HTTPãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒã‚µãƒ¼ãƒãƒ¼ã§ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾" "ã›ã‚“" #: src/labels.h:487 msgid "520 - CloudFlare - Web server is returning an unknown error" msgstr "520 - CloudFlare - Originサーãƒãƒ¼ã‹ã‚‰ã‚¨ãƒ©ãƒ¼ãŒè¿”ã•れã¾ã—ãŸ" #: src/labels.h:489 msgid "521 - CloudFlare - Web server is down" msgstr "521 - CloudFlare - Originサーãƒãƒ¼ãŒãƒ€ã‚¦ãƒ³ã—ã¦ã„ã¾ã™" #: src/labels.h:491 msgid "522 - CloudFlare - Connection timed out" msgstr "522 - CloudFlare - Originサーãƒãƒ¼ã¸ã®æŽ¥ç¶šãŒã‚¿ã‚¤ãƒ ã‚¢ã‚¦ãƒˆã—ã¾ã—ãŸ" #: src/labels.h:493 msgid "523 - CloudFlare - Origin is unreachable" msgstr "523 - CloudFlare - Originサーãƒãƒ¼ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“(到é”ä¸èƒ½ï¼‰" #: src/labels.h:495 msgid "524 - CloudFlare - A timeout occurred" msgstr "524 - CloudFlare - Originサーãƒãƒ¼ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“(タイムアウト)" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/es.po�������������������������������������������������������������������������������0000644�0000000�0000000�00000053735�13375711133�011441� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: Goaccess\n" "Report-Msgid-Bugs-To: hello@goaccess.io\n" "POT-Creation-Date: 2018-11-22 23:38-0600\n" "PO-Revision-Date: 2017-08-04 13:00-0300\n" "Last-Translator: Enrique Becerra <kabeza@gmail.com>\n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.4\n" #: src/labels.h:40 msgid "en" msgstr "es" #: src/labels.h:43 msgid "Exp. Panel" msgstr "Exp. Panel" #: src/labels.h:44 msgid "Help" msgstr "Ayuda" #: src/labels.h:45 msgid "Quit" msgstr "Salir" #: src/labels.h:46 msgid "Total" msgstr "Total" #: src/labels.h:49 msgid "[x] ASC [ ] DESC" msgstr "[x] ASC [ ] DESC" #: src/labels.h:50 msgid "[ ] ASC [x] DESC" msgstr "[ ] ASC [x] DESC" #: src/labels.h:53 #, c-format msgid "[Active Panel: %1$s]" msgstr "[Panel Activo: %1$s]" #: src/labels.h:54 msgid "[q]uit GoAccess" msgstr "[q]Salir GoAccess" #: src/labels.h:55 msgid "[?] Help [Enter] Exp. Panel" msgstr "[?] Ayuda [Enter] Exp. Panel" #: src/labels.h:56 msgid "Dashboard" msgstr "Panel de Control" #: src/labels.h:57 msgid "Dashboard - Overall Analyzed Requests" msgstr "Panel de Control - Peticiones Analizadas En General" #: src/labels.h:58 msgid "Overall Analyzed Requests" msgstr "Peticiones Analizadas en General" #: src/labels.h:60 src/labels.h:81 msgid "Tx. Amount" msgstr "" #: src/labels.h:61 msgid "Date/Time" msgstr "Fecha/Hora" #: src/labels.h:62 msgid "Excl. IP Hits" msgstr "Accesos IP Excl." #: src/labels.h:63 msgid "Failed Requests" msgstr "Peticiones Fallidas" #: src/labels.h:64 msgid "Init. Proc. Time" msgstr "Hora Inicio Proc." #: src/labels.h:65 msgid "Log Size" msgstr "Tamaño Log" #: src/labels.h:66 msgid "Log Source" msgstr "Origen de Log" #: src/labels.h:67 src/labels.h:174 msgid "Referrers" msgstr "Referidos" #: src/labels.h:68 msgid "Total Requests" msgstr "Peticiones Totales" #: src/labels.h:69 msgid "Static Files" msgstr "Archivos Estaticos" #: src/labels.h:70 src/labels.h:146 msgid "Not Found" msgstr "No Encontrado" #: src/labels.h:71 #, fuzzy msgid "Requested Files" msgstr "Archivos Requeridos (URLs)" #: src/labels.h:72 msgid "Unique Visitors" msgstr "Visitantes Unicos" #: src/labels.h:73 msgid "Valid Requests" msgstr "Peticiones Validas" #: src/labels.h:76 msgid "Hits" msgstr "Hits" #: src/labels.h:77 msgid "h%" msgstr "h%" #: src/labels.h:78 src/labels.h:104 msgid "Visitors" msgstr "Visitantes" #: src/labels.h:79 msgid "Vis." msgstr "Vis." #: src/labels.h:80 msgid "v%" msgstr "v%" #: src/labels.h:82 msgid "Avg. T.S." msgstr "Prom. T.S." #: src/labels.h:83 msgid "Cum. T.S." msgstr "Cum. T.S." #: src/labels.h:84 msgid "Max. T.S." msgstr "Max. T.S." #: src/labels.h:85 msgid "Method" msgstr "Metodo" #: src/labels.h:86 msgid "Mtd" msgstr "Mtd" #: src/labels.h:87 msgid "Protocol" msgstr "Protocolo" #: src/labels.h:88 msgid "Proto" msgstr "Proto" #: src/labels.h:89 msgid "City" msgstr "Ciudad" #: src/labels.h:90 msgid "Country" msgstr "Pais" #: src/labels.h:91 msgid "Hostname" msgstr "Hostname" #: src/labels.h:92 msgid "Data" msgstr "Datos" #: src/labels.h:94 msgid "Hits/Visitors" msgstr "Hits/Visitas" #: src/labels.h:98 msgid "Unique visitors per day" msgstr "Visitantes unicos por dia" #: src/labels.h:100 msgid "Unique visitors per day - Including spiders" msgstr "Visitantes unicos por dia - Incluyendo M.Busqueda" #: src/labels.h:102 msgid "Hits having the same IP, date and agent are a unique visit." msgstr "Hits con el mismo IP, fecha y agente son unica visita" #: src/labels.h:107 msgid "Requested Files (URLs)" msgstr "Archivos Requeridos (URLs)" #: src/labels.h:109 msgid "Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "Peticiones Top ordenadas por hits [, avgts, cumts, maxts, mthd, proto]" #: src/labels.h:111 msgid "Requests" msgstr "Peticiones" #: src/labels.h:114 src/labels.h:118 msgid "Static Requests" msgstr "Peticiones Estaticas" #: src/labels.h:116 msgid "Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "Peticiones estaticas top ordenadas por hits [, avgts, cumts, maxts, mthd, " "proto]" #: src/labels.h:121 msgid "Time Distribution" msgstr "Distribucion Horaria" #: src/labels.h:123 msgid "Data sorted by hour [, avgts, cumts, maxts]" msgstr "Datos ordenados por hora [, avgts, cumts, maxts]" #: src/labels.h:125 msgid "Time" msgstr "Hora" #: src/labels.h:128 src/labels.h:132 msgid "Virtual Hosts" msgstr "Hosts Virtuales" #: src/labels.h:130 src/labels.h:137 msgid "Data sorted by hits [, avgts, cumts, maxts]" msgstr "Datos ordenados por hits [, avgts, cumts, maxts]" #: src/labels.h:135 msgid "Remote User (HTTP authentication)" msgstr "Usuario Remoto (Autenticacion HTTP)" #: src/labels.h:139 msgid "Remote User" msgstr "Usuario Remoto" #: src/labels.h:142 msgid "Not Found URLs (404s)" msgstr "URLs no encontradas (404)" #: src/labels.h:144 msgid "Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "URLs no encontradas top ordenadas por hits [, avgts, cumts, maxts, mthd, " "proto]" #: src/labels.h:149 msgid "Visitor Hostnames and IPs" msgstr "Hosts e IPs de los Visitantes" #: src/labels.h:151 msgid "Top visitor hosts sorted by hits [, avgts, cumts, maxts]" msgstr "Hosts de visitante top ordenado por hits [, avgts, cumts, maxts]" #: src/labels.h:153 msgid "Hosts" msgstr "Hosts" #: src/labels.h:156 msgid "Operating Systems" msgstr "Sistemas Operativos" #: src/labels.h:158 msgid "Top Operating Systems sorted by hits [, avgts, cumts, maxts]" msgstr "Sistemas Operativos top ordenados por hits [, avgts, cumts, maxts]" #: src/labels.h:160 msgid "OS" msgstr "SO" #: src/labels.h:163 src/labels.h:167 msgid "Browsers" msgstr "Navegadores" #: src/labels.h:165 msgid "Top Browsers sorted by hits [, avgts, cumts, maxts]" msgstr "Navegadores top ordenados por hits [, avgts, cumts, maxts]" #: src/labels.h:170 msgid "Referrers URLs" msgstr "URLs Referidos" #: src/labels.h:172 msgid "Top Requested Referrers sorted by hits [, avgts, cumts, maxts]" msgstr "Peticiones top de referidos ordenadas por hits [, avgts, cumts, maxts]" #: src/labels.h:177 src/labels.h:181 msgid "Referring Sites" msgstr "Sitios Referidos" #: src/labels.h:179 msgid "Top Referring Sites sorted by hits [, avgts, cumts, maxts]" msgstr "Sitios Referidos top ordenados por hits [, avgts, cumts, maxts]" #: src/labels.h:184 msgid "Keyphrases from Google's search engine" msgstr "Frases de busqueda de motor de busqueda Google" #: src/labels.h:186 msgid "Top Keyphrases sorted by hits [, avgts, cumts, maxts]" msgstr "Frases de busqueda top ordenadas por hits [, avgts, cumts, maxts]" #: src/labels.h:188 msgid "Keyphrases" msgstr "Frases Clave" #: src/labels.h:191 src/labels.h:195 msgid "Geo Location" msgstr "Geo Localizacion" #: src/labels.h:193 msgid "Continent > Country sorted by unique hits [, avgts, cumts, maxts]" msgstr "Continente > Pais ordenado por hits unicos [, avgts, cumts, maxts]" #: src/labels.h:198 msgid "HTTP Status Codes" msgstr "Codigos de Estado HTTP" #: src/labels.h:200 msgid "Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]" msgstr "Codigos de Estado HTTP top ordenados por hits [, avgts, cumts, maxts]" #: src/labels.h:202 msgid "Status Codes" msgstr "Codigos de Estado" #: src/labels.h:206 msgid "[ ] case sensitive" msgstr "[ ] distinguir mayusculas" #: src/labels.h:208 msgid "[x] case sensitive" msgstr "[x] distinguir mayusculas" #: src/labels.h:210 msgid "Regex allowed - ^g to cancel - TAB switch case" msgstr "Permitido Regex - ^g para cancelar - TAB cambiar case" #: src/labels.h:212 msgid "Find pattern in all views" msgstr "Encontrar patron en todas las vistas" #: src/labels.h:216 msgid "Log Format Configuration" msgstr "Configuracion de Formato de Log" #: src/labels.h:218 msgid "[SPACE] to toggle - [ENTER] to proceed - [q] to quit" msgstr "[ESPACIO] para alternar - [ENTER] para proceder - [q] para salir" #: src/labels.h:220 msgid "Log Format - [c] to add/edit format" msgstr "Formato de Log - [c] para agregar/editar formato" #: src/labels.h:222 msgid "Date Format - [d] to add/edit format" msgstr "Formato de Fecha - [d] para agregar/editar formato" #: src/labels.h:224 msgid "Time Format - [t] to add/edit format" msgstr "Formato de Hora - [t] para agregar/editar formato" #: src/labels.h:226 src/labels.h:230 msgid "[UP/DOWN] to scroll - [q] to close window" msgstr "[ARRIBA/ABAJO] para scrollear - [q] para cerrar ventana" #: src/labels.h:232 #, c-format msgid "User Agents for %1$s" msgstr "Agentes de Usuario para %1$s" #: src/labels.h:236 msgid "Scheme Configuration" msgstr "Configuracion de Esquema" #: src/labels.h:238 msgid "[ENTER] to use scheme - [q]uit" msgstr "[ENTER] para usar esquema - [q]Salir" #: src/labels.h:242 msgid "Sort active module by" msgstr "Ordenar modulo activo por" #: src/labels.h:244 msgid "[ENTER] select - [TAB] sort - [q]uit" msgstr "[ENTER] seleccionar - [TAB] ordenar - [q]Salir" #: src/labels.h:248 msgid "GoAccess Quick Help" msgstr "Ayuda Rapida de GoAccess" #: src/labels.h:250 msgid "[UP/DOWN] to scroll - [q] to quit" msgstr "[ARRIBA/ABAJO] para scrollear - [q] para salir" #: src/labels.h:254 msgid "Built using Tokyo Cabinet on-disk B+ Tree." msgstr "Construido usando Tokyo Cabinet on-disk B+ Tree." #: src/labels.h:256 msgid "Built using Tokyo Cabinet in-memory hash database." msgstr "Construido usando Tokyo Cabinet in-memory hash database." #: src/labels.h:258 msgid "Built using the default in-memory hash database." msgstr "Construido usando base de datos hash por defecto en-memoria" #: src/labels.h:262 msgid "Format Errors - Verify your log/date/time format" msgstr "Errores de Formato - Verifique su formato de log/fecha/hora" #: src/labels.h:264 msgid "No date format was found on your conf file." msgstr "No se encontro formato de fecha en su archivo de configuracion" #: src/labels.h:266 msgid "No log format was found on your conf file." msgstr "No se encontro formato de log en su archivo de configuracion" #: src/labels.h:268 msgid "No time format was found on your conf file." msgstr "No se encontro formato de hora en su archivo de configuracion" #: src/labels.h:270 msgid "No default config file found." msgstr "No se encontro archivo de configuracion por defecto." #: src/labels.h:272 msgid "You may specify one with" msgstr "Ud. puede especificar un ancho" #: src/labels.h:274 msgid "producing the following errors" msgstr "produciendo los siguientes errores" #: src/labels.h:276 #, c-format msgid "Parsed %1$d lines" msgstr "Analizadas %1$d lineas" #: src/labels.h:278 msgid "Please report it by opening an issue on GitHub" msgstr "Por favor avise abriendo un issue en GitHub" #: src/labels.h:280 msgid "Select a time format." msgstr "Elija un formato de hora." #: src/labels.h:282 msgid "Select a date format." msgstr "Elija un formato de fecha." #: src/labels.h:284 msgid "Select a log format." msgstr "Elija un formato de log." #: src/labels.h:286 #, c-format msgid "'%1$s' panel is disabled" msgstr "'%1$s' panel esta desactivado" #: src/labels.h:290 msgid "For more details visit" msgstr "Para mas detalles visite" #: src/labels.h:292 msgid "Last Updated" msgstr "Ultima actualizacion" #: src/labels.h:294 msgid "WebSocket server ready to accept new client connections" msgstr "Servidor WebSocket listo para aceptar nuevas conexiones de clientes" #: src/labels.h:297 msgid "The following options can also be supplied to the command" msgstr "Las siguientes opciones pueden ser ademas suplirse en el comando" #: src/labels.h:299 msgid "Examples can be found by running" msgstr "Ejemplos pueden encontrarse ejecutando" #: src/labels.h:302 msgid "Server Statistics" msgstr "Estadisticas de Servidor" #: src/labels.h:304 msgid "Theme" msgstr "Skin" #: src/labels.h:306 msgid "Dark Gray" msgstr "Gris Oscuro" #: src/labels.h:308 msgid "Bright" msgstr "Clara" #: src/labels.h:310 msgid "Dark Blue" msgstr "Azul Oscuro" #: src/labels.h:312 #, fuzzy msgid "Dark Purple" msgstr "Azul Oscuro" #: src/labels.h:314 msgid "Panels" msgstr "Paneles" #: src/labels.h:316 msgid "Items per Page" msgstr "Items por pagina" #: src/labels.h:318 msgid "Tables" msgstr "Tablas" #: src/labels.h:320 msgid "Display Tables" msgstr "Mostrar Tablas" #: src/labels.h:322 msgid "Auto-Hide on Small Devices" msgstr "Auto-ocultar en Pequeños Dispositivos" #: src/labels.h:324 msgid "Automatically hide tables on small screen devices" msgstr "Automaticamente ocultar tablas en pequeños dispositivos" #: src/labels.h:326 msgid "Layout" msgstr "Diseño" #: src/labels.h:328 msgid "Horizontal" msgstr "Horizontal" #: src/labels.h:330 msgid "Vertical" msgstr "Vertical" #: src/labels.h:332 msgid "File Options" msgstr "Opciones de Archivo" #: src/labels.h:334 msgid "Export as JSON" msgstr "Exportar como JSON" #: src/labels.h:336 msgid "Panel Options" msgstr "Opciones de Panel" #: src/labels.h:338 msgid "Previous" msgstr "Anterior" #: src/labels.h:340 msgid "Next" msgstr "Siguiente" #: src/labels.h:342 msgid "First" msgstr "" #: src/labels.h:344 msgid "Last" msgstr "" #: src/labels.h:346 msgid "Chart Options" msgstr "Opciones de Grafico" #: src/labels.h:348 msgid "Chart" msgstr "Grafico" #: src/labels.h:350 msgid "Type" msgstr "Tipo" #: src/labels.h:352 msgid "Area Spline" msgstr "Area Ranura" #: src/labels.h:354 msgid "Bar" msgstr "Bar" #: src/labels.h:356 msgid "Plot Metric" msgstr "Trazado" #: src/labels.h:358 msgid "Table Columns" msgstr "Columnas de Tabla" #: src/labels.h:362 msgid "1xx Informational" msgstr "1xx Informativo" #: src/labels.h:364 msgid "2xx Success" msgstr "2xx Exito" #: src/labels.h:366 msgid "3xx Redirection" msgstr "3xx Redireccion" #: src/labels.h:368 msgid "4xx Client Errors" msgstr "4xx Errores de Cliente" #: src/labels.h:370 msgid "5xx Server Errors" msgstr "5xx Errores de Servidor" #: src/labels.h:373 msgid "100 - Continue: Server received the initial part of the request" msgstr "100 - Continuar: Servidor recibio la parte inicial de la peticion" #: src/labels.h:375 msgid "101 - Switching Protocols: Client asked to switch protocols" msgstr "101 - Cambiando Protocolos: Cliente pidio cambiar protocolos" #: src/labels.h:377 msgid "200 - OK: The request sent by the client was successful" msgstr "200 - OK: La peticion enviada por el cliente fue exitosa" #: src/labels.h:379 msgid "201 - Created: The request has been fulfilled and created" msgstr "201 - Creada: La peticion ha sido completada y creada" #: src/labels.h:381 msgid "202 - Accepted: The request has been accepted for processing" msgstr "202 - Aceptada: La peticion fue aceptada para procesar" #: src/labels.h:383 msgid "203 - Non-authoritative Information: Response from a third party" msgstr "203 - No-autoritario Informativo: Respuesta de una 3er. parte" #: src/labels.h:385 msgid "204 - No Content: Request did not return any content" msgstr "204 - Sin Contenido: Peticion no retorno ningun contenido" #: src/labels.h:387 msgid "205 - Reset Content: Server asked the client to reset the document" msgstr "" "205 - Resetear Contenido: Servidor pidio al cliente resetear el documento" #: src/labels.h:389 msgid "206 - Partial Content: The partial GET has been successful" msgstr "206 - Contenido Parcial: el GET parcial fue exitoso" #: src/labels.h:391 msgid "207 - Multi-Status: WebDAV; RFC 4918" msgstr "207 - Multi-Estado: WebDAV; RFC 4918" #: src/labels.h:393 msgid "208 - Already Reported: WebDAV; RFC 5842" msgstr "208 - Ya Reportado: WebDAV; RFC 5842" #: src/labels.h:395 msgid "300 - Multiple Choices: Multiple options for the resource" msgstr "300 - Multiples Opciones: Multiples opciones para el recurso" #: src/labels.h:397 msgid "301 - Moved Permanently: Resource has permanently moved" msgstr "301 - Movido Permanente: Recurso ha sido permanentemente movido" #: src/labels.h:399 msgid "302 - Moved Temporarily (redirect)" msgstr "302 - Movido Temporalmente (redireccion)" #: src/labels.h:401 msgid "303 - See Other Document: The response is at a different URI" msgstr "303 - Ver Otro Documento: La respuesta es en una URI diferente" #: src/labels.h:403 msgid "304 - Not Modified: Resource has not been modified" msgstr "304 - No Modificado: Recurso no ha sido modificado" #: src/labels.h:405 msgid "305 - Use Proxy: Can only be accessed through the proxy" msgstr "305 - Usar Proxy: Puede ser accedido solo a traves de proxy" #: src/labels.h:407 msgid "307 - Temporary Redirect: Resource temporarily moved" msgstr "307 - Redireccion Temporal: Recurso movido temporalmente" #: src/labels.h:409 msgid "400 - Bad Request: The syntax of the request is invalid" msgstr "400 - Peticion Mala: La sintaxis de la peticion es invalida" #: src/labels.h:411 msgid "401 - Unauthorized: Request needs user authentication" msgstr "401 - Sin Autorizacion: Peticion necesita autenticacion de usuario" #: src/labels.h:413 msgid "402 - Payment Required" msgstr "402 - Pago Requerido" #: src/labels.h:415 msgid "403 - Forbidden: Server is refusing to respond to it" msgstr "403 - Prohibido: Servidor esta rechazando respuesta" #: src/labels.h:417 msgid "404 - Not Found: Requested resource could not be found" msgstr "404 - No Encontrado: Peticion de recurso no pudo encontrarse" #: src/labels.h:419 msgid "405 - Method Not Allowed: Request method not supported" msgstr "405 - Metodo No Permitido: Metodo de Peticion no soportado" #: src/labels.h:421 msgid "406 - Not Acceptable" msgstr "406 - No Aceptable" #: src/labels.h:423 msgid "407 - Proxy Authentication Required" msgstr "407 - Autenticacion de Proxy Requerida" #: src/labels.h:425 msgid "408 - Request Timeout: Server timed out waiting for the request" msgstr "408 - Timeout de Peticion: Tiempo agotado de espera para la solicitud" #: src/labels.h:427 msgid "409 - Conflict: Conflict in the request" msgstr "409 - Conflicto: Conflicto en la peticion" #: src/labels.h:429 msgid "410 - Gone: Resource requested is no longer available" msgstr "410 - Fue: Recurso requerido no esta mas disponible" #: src/labels.h:431 msgid "411 - Length Required: Invalid Content-Length" msgstr "411 - Longitud Requerida: Content-Length Invalido" #: src/labels.h:433 msgid "412 - Precondition Failed: Server does not meet preconditions" msgstr "412 - Precondicion Fallida: Servidor no cumple precondiciones" #: src/labels.h:435 msgid "413 - Payload Too Large" msgstr "413 - Carga Util Demasiado larga" #: src/labels.h:437 msgid "414 - Request-URI Too Long" msgstr "414 - Request-URI demasiado larga" #: src/labels.h:439 msgid "415 - Unsupported Media Type: Media type is not supported" msgstr "415 - Tipo de medios no soportado: El tipo de medios no es soportado" #: src/labels.h:441 msgid "416 - Requested Range Not Satisfiable: Cannot supply that portion" msgstr "416 - Rango requerido no satisfacible: No puede proveer esa porcion" #: src/labels.h:443 msgid "417 - Expectation Failed" msgstr "417 - Expectativa Fallida" #: src/labels.h:445 msgid "421 - Misdirected Request" msgstr "" #: src/labels.h:447 msgid "422 - Unprocessable Entity due to semantic errors: WebDAV" msgstr "" #: src/labels.h:449 msgid "423 - The resource that is being accessed is locked" msgstr "" #: src/labels.h:451 msgid "424 - Failed Dependency: WebDAV" msgstr "" #: src/labels.h:453 msgid "426 - Upgrade Required: Client should switch to a different protocol" msgstr "" #: src/labels.h:455 #, fuzzy msgid "428 - Precondition Required" msgstr "402 - Pago Requerido" #: src/labels.h:457 msgid "429 - Too Many Requests: The user has sent too many requests" msgstr "" #: src/labels.h:459 #, fuzzy msgid "431 - Request Header Fields Too Large" msgstr "494 - (Nginx) Cabecera de Peticion demasiada larga" #: src/labels.h:461 msgid "451 - Unavailable For Legal Reasons" msgstr "" #: src/labels.h:463 msgid "444 - (Nginx) Connection closed without sending any headers" msgstr "444 - (Nginx) Conexion cerrada sin enviar cabeceras" #: src/labels.h:465 msgid "494 - (Nginx) Request Header Too Large" msgstr "494 - (Nginx) Cabecera de Peticion demasiada larga" #: src/labels.h:467 msgid "495 - (Nginx) SSL client certificate error" msgstr "495 - (Nginx) Cliente SSL certificado erroneo" #: src/labels.h:469 msgid "496 - (Nginx) Client didn't provide certificate" msgstr "496 - (Nginx) Client no proveyo certificado" #: src/labels.h:471 msgid "497 - (Nginx) HTTP request sent to HTTPS port" msgstr "497 - (Nginx) Peticion HTTP enviada a puerto HTTPS" #: src/labels.h:473 msgid "499 - (Nginx) Connection closed by client while processing request" msgstr "499 - (Nginx) Conexion cerrada por cliente mientras procesaba peticion" #: src/labels.h:475 msgid "500 - Internal Server Error" msgstr "500 - Error Interno de Servidor" #: src/labels.h:477 msgid "501 - Not Implemented" msgstr "501 - No Implementado" #: src/labels.h:479 msgid "502 - Bad Gateway: Received an invalid response from the upstream" msgstr "502 - Entrada Erronea: Recibio respuesta invalida" #: src/labels.h:481 msgid "503 - Service Unavailable: The server is currently unavailable" msgstr "" "503 - Servicio no disponible: El servidor actualmente no esta disponible" #: src/labels.h:483 msgid "504 - Gateway Timeout: The upstream server failed to send request" msgstr "" "504 - Timeout de Gateway: El servidor upstream fallo al enviar peticion" #: src/labels.h:485 msgid "505 - HTTP Version Not Supported" msgstr "505 - Version HTTP no soportada" #: src/labels.h:487 msgid "520 - CloudFlare - Web server is returning an unknown error" msgstr "520 - CloudFlare - El servidor esta retornando un error desconocido" #: src/labels.h:489 msgid "521 - CloudFlare - Web server is down" msgstr "521 - CloudFlare - Servidor Web caido" #: src/labels.h:491 msgid "522 - CloudFlare - Connection timed out" msgstr "522 - CloudFlare - Tiempo de espera de conexion agotado " #: src/labels.h:493 msgid "523 - CloudFlare - Origin is unreachable" msgstr "523 - CloudFlare - Origen es inaccesible" #: src/labels.h:495 msgid "524 - CloudFlare - A timeout occurred" msgstr "524 - CloudFlare - Ocurrio cese de tiempo" #~ msgid "Bandwidth" #~ msgstr "Ancho de Banda" #~ msgid "Unique Files" #~ msgstr "Archivos Unicos" #~ msgid "Unique 404" #~ msgstr "404 Unico" �����������������������������������goaccess-1.3/po/es.gmo������������������������������������������������������������������������������0000644�0000000�0000000�00000042042�13375711133�011572� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Þ•����Ê������l�� ��¼ ������ð�����ñ��?��� ��;���J�����†��7���˜��9���Ð��<��� ��@���G��4���ˆ��B���½��:������$���;��(���`�� ���‰��9���•��7���Ï��"�����<���*��2���g��7���š��4���Ò�������7�����5���O�����…��4���œ��6���Ñ��6��������?��#���T��?���x��'���¸��5���à��-�����=���D�����‚�����š��9���µ��A���ï�����1��;���J��&���†��*���­��/���Ø��-�����B���6�����y�����‹�����§��A���½��>���ÿ��A���>�� ���€��;���¡��%���Ý��'�����(���+��%���T�����z�� ���Œ�����˜��1���³�� ���å�����ï�����ó�����ú��2�����*���6��0���a�����’�� ���˜�����¦��A���«�����í�� ���õ�� ���ÿ�� ��� �� �����%��������C��+���H��+���t��$��� �� ���Å�����Ï�� ���Þ�� ���ÿ�� ��� ����������'�� ���7�����D�����^��0���u�� ���¦�����³�����Ç�����Ù�����Þ��;���ã�� ����� ���-�����8�����A�����G�����X�� ���g��&���r�� ���™�����¦��#���­�����Ñ�����ê�� ���ó�� ���þ����� ����� ����� ��+��� �����D ��*���b ��+��� �� ���¹ �����à �����Ù �����Ü �����î �� ���!�����!�����!��.���/!�� ���^!�����j!�����s!�����y!�����‚!�� ���‡!�����‘!����� !��.���°!�� ���ß!��!���ë!����� "�����$"�����-"�����B"�����X"�����m"�����ƒ"�����•"�� ���«"�����¸"�� ���È"�� ���Õ"�����ã"��9���ê"�����$#�����*#�����/#��$���A#��3���f#��<���š#��5���×#��<��� $��:���J$��>���…$��F���Ä$��@��� %��G���L%��8���”%�����Í%�����Ó%�����â%�����ç%�����÷%��+���&�����;&�����P&�����_&�� ���h&�����v&�����{&�����•&��7���ž&�����Ö&�����ï&������'�����'�����/'��$���D'�����i'��4���ˆ'��)���½'��!���ç'����� (�����(�����*(�����=(�����@(�����C(�����b(��[��e(�����Á)��A���ß)��<���!*�����^*��8���n*��5���§*��6���Ý*��=���+��9���R+��I���Œ+��3���Ö+��$��� ,��$���/,�� ���T,��<���^,��?���›,��(���Û,��>���-��2���C-��;���v-��8���²-�����ë-��;���û-��B���7.�����z.��3���.��<���Ã.��:����/�����;/��&���N/��E���u/��)���»/��3���å/��1���0��=���K0�� ���‰0��!���ª0��D���Ì0��C���1�����U1��3���o1��2���£1��-���Ö1��+���2��2���02��F���c2�����ª2�����Á2�����á2��1���÷2��H���)3��G���r3�����º3��C���Ú3��%���4��8���D4��(���}4��)���¦4�����Ð4�� ���è4��&���ô4��8���5�� ���T5�����_5�����c5�� ���i5��8���u5��0���®5��;���ß5�����6�����#6�����76��B���>6�����6�� ���†6�� ���6�� ���œ6�����¨6��3���¹6�����í6��0���ó6��0���$7��2���U7�� ���ˆ7�����“7��&���¢7�����É7�� ���Ú7�����å7�����ø7����� 8��$��� 8�����E8��;���^8�����š8�����«8�����Ä8�����Û8�����á8��5���æ8�� ���9�� ���)9�����49�����=9�����C9�����U9�� ���f9��.���s9�����¢9�����·9��0���¿9�����ð9�� ���:�� ���:�� ���*:�����4:�����;:�� ���?:��>���I:��4���ˆ:��<���½:��=���ú:�� ���8;�����F;�����`;�����c;�� ���w;�����˜;�����ª;�����²;��+���É;�����õ;�����ý;�����<�� ��� <�����<�� ���<�����&<�����5<��5���F<�����|<��#���‹<�����¯<�� ���Ê<�����Õ<�����î<����� =�����"=�����<=�����U=�����o=�����‚=�����—=�����©=�����»=��@���Â=�����>�����>����� >��1���">��:���T>��E���>��A���Õ>��B���?��?���Z?��F���š?��O���á?��F���1@��P���x@��@���É@����� A�����A�����#A�����(A�����:A��1���TA�����†A�����£A�����¶A�����¿A�����ÏA�����ÔA�� ���òA��C���ýA�����AB�����`B�����qB�����‹B�����¨B��.���½B��$���ìB��@���C��7���RC��.���ŠC�����¹C�����ËC�����ÜC�����öC�����ùC��"���üC�����D�����A��������������‚���O����������D���¨�������m���&���±���N���‡������b���…���¢���»�������8���¿���•���Â���p���~�������†���y���:������������� ������2���´���S���k���Š�����������{���‘������µ�������Ž�����������¡���G���@���[���������º���œ���Y�����������®���e���}��������������¦������C������� ���¸���i���E���]��� ���ª���Œ��������������T������a���6������ž���„���³���Ã�������Ä��������������Ê���¼���w���I���.���ˆ���^���™�������q�������9������‰�����������­���’������W�����������¤��� ������ ���Æ���4���É����������§��� ���¶���������������B���\���«������¯���¬���Ç���t����������'�������P�������_���M���Å���)���z���X���5������K�������*���?�����������©�������²���¾���£�����������–���F���‹�������o���l���!�������°������g���-���"���Á���—�������È�����������V���À���u����������r���<�����������J��� �������˜���$���>���ƒ�������d���/���3������f���(���½�����������¹���=���;���U���›����������c���Ÿ��������������Z���%�������H���v���j������h���š���¥����������x���#���+���1���0���·���,�����������`�������€�������”�������n�������7����������R�������L���s���“���|�������Q�������'%1$s' panel is disabled�100 - Continue: Server received the initial part of the request�101 - Switching Protocols: Client asked to switch protocols�1xx Informational�200 - OK: The request sent by the client was successful�201 - Created: The request has been fulfilled and created�202 - Accepted: The request has been accepted for processing�203 - Non-authoritative Information: Response from a third party�204 - No Content: Request did not return any content�205 - Reset Content: Server asked the client to reset the document�206 - Partial Content: The partial GET has been successful�207 - Multi-Status: WebDAV; RFC 4918�208 - Already Reported: WebDAV; RFC 5842�2xx Success�300 - Multiple Choices: Multiple options for the resource�301 - Moved Permanently: Resource has permanently moved�302 - Moved Temporarily (redirect)�303 - See Other Document: The response is at a different URI�304 - Not Modified: Resource has not been modified�305 - Use Proxy: Can only be accessed through the proxy�307 - Temporary Redirect: Resource temporarily moved�3xx Redirection�400 - Bad Request: The syntax of the request is invalid�401 - Unauthorized: Request needs user authentication�402 - Payment Required�403 - Forbidden: Server is refusing to respond to it�404 - Not Found: Requested resource could not be found�405 - Method Not Allowed: Request method not supported�406 - Not Acceptable�407 - Proxy Authentication Required�408 - Request Timeout: Server timed out waiting for the request�409 - Conflict: Conflict in the request�410 - Gone: Resource requested is no longer available�411 - Length Required: Invalid Content-Length�412 - Precondition Failed: Server does not meet preconditions�413 - Payload Too Large�414 - Request-URI Too Long�415 - Unsupported Media Type: Media type is not supported�416 - Requested Range Not Satisfiable: Cannot supply that portion�417 - Expectation Failed�444 - (Nginx) Connection closed without sending any headers�494 - (Nginx) Request Header Too Large�495 - (Nginx) SSL client certificate error�496 - (Nginx) Client didn't provide certificate�497 - (Nginx) HTTP request sent to HTTPS port�499 - (Nginx) Connection closed by client while processing request�4xx Client Errors�500 - Internal Server Error�501 - Not Implemented�502 - Bad Gateway: Received an invalid response from the upstream�503 - Service Unavailable: The server is currently unavailable�504 - Gateway Timeout: The upstream server failed to send request�505 - HTTP Version Not Supported�520 - CloudFlare - Web server is returning an unknown error�521 - CloudFlare - Web server is down�522 - CloudFlare - Connection timed out�523 - CloudFlare - Origin is unreachable�524 - CloudFlare - A timeout occurred�5xx Server Errors�Area Spline�Auto-Hide on Small Devices�Automatically hide tables on small screen devices�Avg. T.S.�Bar�Bright�Browsers�Built using Tokyo Cabinet in-memory hash database.�Built using Tokyo Cabinet on-disk B+ Tree.�Built using the default in-memory hash database.�Chart�Chart Options�City�Continent > Country sorted by unique hits [, avgts, cumts, maxts]�Country�Cum. T.S.�Dark Blue�Dark Gray�Dashboard�Dashboard - Overall Analyzed Requests�Data�Data sorted by hits [, avgts, cumts, maxts]�Data sorted by hour [, avgts, cumts, maxts]�Date Format - [d] to add/edit format�Date/Time�Display Tables�Examples can be found by running�Excl. IP Hits�Exp. Panel�Export as JSON�Failed Requests�File Options�Find pattern in all views�For more details visit�Format Errors - Verify your log/date/time format�Geo Location�GoAccess Quick Help�HTTP Status Codes�Help�Hits�Hits having the same IP, date and agent are a unique visit.�Hits/Visitors�Horizontal�Hostname�Hosts�Init. Proc. Time�Items per Page�Keyphrases�Keyphrases from Google's search engine�Last Updated�Layout�Log Format - [c] to add/edit format�Log Format Configuration�Log Size�Log Source�Max. T.S.�Method�Mtd�Next�No date format was found on your conf file.�No default config file found.�No log format was found on your conf file.�No time format was found on your conf file.�Not Found�Not Found URLs (404s)�OS�Operating Systems�Overall Analyzed Requests�Panel Options�Panels�Parsed %1$d lines�Please report it by opening an issue on GitHub�Plot Metric�Previous�Proto�Protocol�Quit�Referrers�Referrers URLs�Referring Sites�Regex allowed - ^g to cancel - TAB switch case�Remote User�Remote User (HTTP authentication)�Requested Files (URLs)�Requests�Scheme Configuration�Select a date format.�Select a log format.�Select a time format.�Server Statistics�Sort active module by�Static Files�Static Requests�Status Codes�Table Columns�Tables�The following options can also be supplied to the command�Theme�Time�Time Distribution�Time Format - [t] to add/edit format�Top Browsers sorted by hits [, avgts, cumts, maxts]�Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]�Top Keyphrases sorted by hits [, avgts, cumts, maxts]�Top Operating Systems sorted by hits [, avgts, cumts, maxts]�Top Referring Sites sorted by hits [, avgts, cumts, maxts]�Top Requested Referrers sorted by hits [, avgts, cumts, maxts]�Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]�Top visitor hosts sorted by hits [, avgts, cumts, maxts]�Total�Total Requests�Type�Unique Visitors�Unique visitors per day�Unique visitors per day - Including spiders�User Agents for %1$s�Valid Requests�Vertical�Virtual Hosts�Vis.�Visitor Hostnames and IPs�Visitors�WebSocket server ready to accept new client connections�You may specify one with�[ ] ASC [x] DESC�[ ] case sensitive�[?] Help [Enter] Exp. Panel�[Active Panel: %1$s]�[ENTER] select - [TAB] sort - [q]uit�[ENTER] to use scheme - [q]uit�[SPACE] to toggle - [ENTER] to proceed - [q] to quit�[UP/DOWN] to scroll - [q] to close window�[UP/DOWN] to scroll - [q] to quit�[q]uit GoAccess�[x] ASC [ ] DESC�[x] case sensitive�en�h%�producing the following errors�v%�Project-Id-Version: Goaccess Report-Msgid-Bugs-To: hello@goaccess.io POT-Creation-Date: 2018-11-22 23:38-0600 PO-Revision-Date: 2017-08-04 13:00-0300 Last-Translator: Enrique Becerra <kabeza@gmail.com> Language-Team: Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: Poedit 1.5.4 �'%1$s' panel esta desactivado�100 - Continuar: Servidor recibio la parte inicial de la peticion�101 - Cambiando Protocolos: Cliente pidio cambiar protocolos�1xx Informativo�200 - OK: La peticion enviada por el cliente fue exitosa�201 - Creada: La peticion ha sido completada y creada�202 - Aceptada: La peticion fue aceptada para procesar�203 - No-autoritario Informativo: Respuesta de una 3er. parte�204 - Sin Contenido: Peticion no retorno ningun contenido�205 - Resetear Contenido: Servidor pidio al cliente resetear el documento�206 - Contenido Parcial: el GET parcial fue exitoso�207 - Multi-Estado: WebDAV; RFC 4918�208 - Ya Reportado: WebDAV; RFC 5842�2xx Exito�300 - Multiples Opciones: Multiples opciones para el recurso�301 - Movido Permanente: Recurso ha sido permanentemente movido�302 - Movido Temporalmente (redireccion)�303 - Ver Otro Documento: La respuesta es en una URI diferente�304 - No Modificado: Recurso no ha sido modificado�305 - Usar Proxy: Puede ser accedido solo a traves de proxy�307 - Redireccion Temporal: Recurso movido temporalmente�3xx Redireccion�400 - Peticion Mala: La sintaxis de la peticion es invalida�401 - Sin Autorizacion: Peticion necesita autenticacion de usuario�402 - Pago Requerido�403 - Prohibido: Servidor esta rechazando respuesta�404 - No Encontrado: Peticion de recurso no pudo encontrarse�405 - Metodo No Permitido: Metodo de Peticion no soportado�406 - No Aceptable�407 - Autenticacion de Proxy Requerida�408 - Timeout de Peticion: Tiempo agotado de espera para la solicitud�409 - Conflicto: Conflicto en la peticion�410 - Fue: Recurso requerido no esta mas disponible�411 - Longitud Requerida: Content-Length Invalido�412 - Precondicion Fallida: Servidor no cumple precondiciones�413 - Carga Util Demasiado larga�414 - Request-URI demasiado larga�415 - Tipo de medios no soportado: El tipo de medios no es soportado�416 - Rango requerido no satisfacible: No puede proveer esa porcion�417 - Expectativa Fallida�444 - (Nginx) Conexion cerrada sin enviar cabeceras�494 - (Nginx) Cabecera de Peticion demasiada larga�495 - (Nginx) Cliente SSL certificado erroneo�496 - (Nginx) Client no proveyo certificado�497 - (Nginx) Peticion HTTP enviada a puerto HTTPS�499 - (Nginx) Conexion cerrada por cliente mientras procesaba peticion�4xx Errores de Cliente�500 - Error Interno de Servidor�501 - No Implementado�502 - Entrada Erronea: Recibio respuesta invalida�503 - Servicio no disponible: El servidor actualmente no esta disponible�504 - Timeout de Gateway: El servidor upstream fallo al enviar peticion�505 - Version HTTP no soportada�520 - CloudFlare - El servidor esta retornando un error desconocido�521 - CloudFlare - Servidor Web caido�522 - CloudFlare - Tiempo de espera de conexion agotado �523 - CloudFlare - Origen es inaccesible�524 - CloudFlare - Ocurrio cese de tiempo�5xx Errores de Servidor�Area Ranura�Auto-ocultar en Pequeños Dispositivos�Automaticamente ocultar tablas en pequeños dispositivos�Prom. T.S.�Bar�Clara�Navegadores�Construido usando Tokyo Cabinet in-memory hash database.�Construido usando Tokyo Cabinet on-disk B+ Tree.�Construido usando base de datos hash por defecto en-memoria�Grafico�Opciones de Grafico�Ciudad�Continente > Pais ordenado por hits unicos [, avgts, cumts, maxts]�Pais�Cum. T.S.�Azul Oscuro�Gris Oscuro�Panel de Control�Panel de Control - Peticiones Analizadas En General�Datos�Datos ordenados por hits [, avgts, cumts, maxts]�Datos ordenados por hora [, avgts, cumts, maxts]�Formato de Fecha - [d] para agregar/editar formato�Fecha/Hora�Mostrar Tablas�Ejemplos pueden encontrarse ejecutando�Accesos IP Excl.�Exp. Panel�Exportar como JSON�Peticiones Fallidas�Opciones de Archivo�Encontrar patron en todas las vistas�Para mas detalles visite�Errores de Formato - Verifique su formato de log/fecha/hora�Geo Localizacion�Ayuda Rapida de GoAccess�Codigos de Estado HTTP�Ayuda�Hits�Hits con el mismo IP, fecha y agente son unica visita�Hits/Visitas�Horizontal�Hostname�Hosts�Hora Inicio Proc.�Items por pagina�Frases Clave�Frases de busqueda de motor de busqueda Google�Ultima actualizacion�Diseño�Formato de Log - [c] para agregar/editar formato�Configuracion de Formato de Log�Tamaño Log�Origen de Log�Max. T.S.�Metodo�Mtd�Siguiente�No se encontro formato de fecha en su archivo de configuracion�No se encontro archivo de configuracion por defecto.�No se encontro formato de log en su archivo de configuracion�No se encontro formato de hora en su archivo de configuracion�No Encontrado�URLs no encontradas (404)�SO�Sistemas Operativos�Peticiones Analizadas en General�Opciones de Panel�Paneles�Analizadas %1$d lineas�Por favor avise abriendo un issue en GitHub�Trazado�Anterior�Proto�Protocolo�Salir�Referidos�URLs Referidos�Sitios Referidos�Permitido Regex - ^g para cancelar - TAB cambiar case�Usuario Remoto�Usuario Remoto (Autenticacion HTTP)�Archivos Requeridos (URLs)�Peticiones�Configuracion de Esquema�Elija un formato de fecha.�Elija un formato de log.�Elija un formato de hora.�Estadisticas de Servidor�Ordenar modulo activo por�Archivos Estaticos�Peticiones Estaticas�Codigos de Estado�Columnas de Tabla�Tablas�Las siguientes opciones pueden ser ademas suplirse en el comando�Skin�Hora�Distribucion Horaria�Formato de Hora - [t] para agregar/editar formato�Navegadores top ordenados por hits [, avgts, cumts, maxts]�Codigos de Estado HTTP top ordenados por hits [, avgts, cumts, maxts]�Frases de busqueda top ordenadas por hits [, avgts, cumts, maxts]�Sistemas Operativos top ordenados por hits [, avgts, cumts, maxts]�Sitios Referidos top ordenados por hits [, avgts, cumts, maxts]�Peticiones top de referidos ordenadas por hits [, avgts, cumts, maxts]�URLs no encontradas top ordenadas por hits [, avgts, cumts, maxts, mthd, proto]�Peticiones Top ordenadas por hits [, avgts, cumts, maxts, mthd, proto]�Peticiones estaticas top ordenadas por hits [, avgts, cumts, maxts, mthd, proto]�Hosts de visitante top ordenado por hits [, avgts, cumts, maxts]�Total�Peticiones Totales�Tipo�Visitantes Unicos�Visitantes unicos por dia�Visitantes unicos por dia - Incluyendo M.Busqueda�Agentes de Usuario para %1$s�Peticiones Validas�Vertical�Hosts Virtuales�Vis.�Hosts e IPs de los Visitantes�Visitantes�Servidor WebSocket listo para aceptar nuevas conexiones de clientes�Ud. puede especificar un ancho�[ ] ASC [x] DESC�[ ] distinguir mayusculas�[?] Ayuda [Enter] Exp. Panel�[Panel Activo: %1$s]�[ENTER] seleccionar - [TAB] ordenar - [q]Salir�[ENTER] para usar esquema - [q]Salir�[ESPACIO] para alternar - [ENTER] para proceder - [q] para salir�[ARRIBA/ABAJO] para scrollear - [q] para cerrar ventana�[ARRIBA/ABAJO] para scrollear - [q] para salir�[q]Salir GoAccess�[x] ASC [ ] DESC�[x] distinguir mayusculas�es�h%�produciendo los siguientes errores�v%�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/POTFILES.in�������������������������������������������������������������������������0000644�0000000�0000000�00000000110�13350574106�012222� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# List of source files which contain translatable strings. src/labels.h ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/zh_CN.po����������������������������������������������������������������������������0000644�0000000�0000000�00000053313�13375711133�012023� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file is distributed under the same license as the goaccess package. # Ai, 2018. # msgid "" msgstr "" "Project-Id-Version: goaccess 1.2\n" "Report-Msgid-Bugs-To: hello@goaccess.io\n" "POT-Creation-Date: 2018-11-22 23:38-0600\n" "PO-Revision-Date: 2017-04-03 09:43+0200\n" "Last-Translator: Ai<hello@goaccess.io>\n" "Language-Team: Ai\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Gtranslator 2.91.7\n" #: src/labels.h:40 msgid "en" msgstr "zh-CN" #: src/labels.h:43 msgid "Exp. Panel" msgstr "展开颿¿" #: src/labels.h:44 msgid "Help" msgstr "帮助" #: src/labels.h:45 msgid "Quit" msgstr "退出" #: src/labels.h:46 msgid "Total" msgstr "总共" #: src/labels.h:49 msgid "[x] ASC [ ] DESC" msgstr "[x] 递增 [ ] 递å‡" #: src/labels.h:50 msgid "[ ] ASC [x] DESC" msgstr "[ ] 递增 [x] 递å‡" #: src/labels.h:53 #, c-format msgid "[Active Panel: %1$s]" msgstr "[当å‰é¢æ¿ï¼š %1$s]" #: src/labels.h:54 msgid "[q]uit GoAccess" msgstr "[q]退出GoAccess" #: src/labels.h:55 msgid "[?] Help [Enter] Exp. Panel" msgstr "[?]帮助 [回车]展开颿¿" #: src/labels.h:56 msgid "Dashboard" msgstr "概览" #: src/labels.h:57 msgid "Dashboard - Overall Analyzed Requests" msgstr "概览-所有已分æžçš„请求" #: src/labels.h:58 msgid "Overall Analyzed Requests" msgstr "所有已分æžçš„请求" #: src/labels.h:60 src/labels.h:81 msgid "Tx. Amount" msgstr "" #: src/labels.h:61 msgid "Date/Time" msgstr "时期/æ—¶é—´" #: src/labels.h:62 msgid "Excl. IP Hits" msgstr "过滤æ¥è‡ªæ­¤IP的请求" #: src/labels.h:63 msgid "Failed Requests" msgstr "失败的请求" #: src/labels.h:64 msgid "Init. Proc. Time" msgstr "第一次处ç†è€—æ—¶" #: src/labels.h:65 msgid "Log Size" msgstr "日志大å°" #: src/labels.h:66 msgid "Log Source" msgstr "日志文件夹地å€" #: src/labels.h:67 src/labels.h:174 msgid "Referrers" msgstr "æ¥æºåœ°å€" #: src/labels.h:68 msgid "Total Requests" msgstr "所有请求" #: src/labels.h:69 msgid "Static Files" msgstr "陿€æ–‡ä»¶" #: src/labels.h:70 src/labels.h:146 msgid "Not Found" msgstr "未找到(404)" #: src/labels.h:71 msgid "Requested Files" msgstr "请求的文件" #: src/labels.h:72 msgid "Unique Visitors" msgstr "独立访客" #: src/labels.h:73 msgid "Valid Requests" msgstr "有效的请求" #: src/labels.h:76 msgid "Hits" msgstr "点击é‡" #: src/labels.h:77 msgid "h%" msgstr "" #: src/labels.h:78 src/labels.h:104 msgid "Visitors" msgstr "访客" #: src/labels.h:79 msgid "Vis." msgstr "访客" #: src/labels.h:80 msgid "v%" msgstr "" #: src/labels.h:82 msgid "Avg. T.S." msgstr "å¹³å‡å“应时" #: src/labels.h:83 msgid "Cum. T.S." msgstr "总共å“应时" #: src/labels.h:84 msgid "Max. T.S." msgstr "最高å“应时" #: src/labels.h:85 msgid "Method" msgstr "请求方法" #: src/labels.h:86 msgid "Mtd" msgstr "请求方法" #: src/labels.h:87 msgid "Protocol" msgstr "åè®®" #: src/labels.h:88 msgid "Proto" msgstr "åè®®" #: src/labels.h:89 msgid "City" msgstr "城市" #: src/labels.h:90 msgid "Country" msgstr "国家" #: src/labels.h:91 msgid "Hostname" msgstr "主机å" #: src/labels.h:92 msgid "Data" msgstr "æ•°æ®" #: src/labels.h:94 msgid "Hits/Visitors" msgstr "点击é‡/访客" #: src/labels.h:98 msgid "Unique visitors per day" msgstr "æ¯æ—¥ç‹¬ç«‹è®¿å®¢" #: src/labels.h:100 msgid "Unique visitors per day - Including spiders" msgstr "æ¯æ—¥ç‹¬ç«‹è®¿å®¢ - 包括网络机器人" #: src/labels.h:102 msgid "Hits having the same IP, date and agent are a unique visit." msgstr "æ¥è‡ªåŒä¸€IPã€æ—¶é—´å’ŒHttp用户代ç†çš„多次点击被视作一次访问" #: src/labels.h:107 msgid "Requested Files (URLs)" msgstr "请求的文件" #: src/labels.h:109 msgid "Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "è¯·æ±‚æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, åè®®]" #: src/labels.h:111 msgid "Requests" msgstr "请求" #: src/labels.h:114 src/labels.h:118 msgid "Static Requests" msgstr "陿€è¯·æ±‚" #: src/labels.h:116 msgid "Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "陿€è¯·æ±‚æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, åè®®]" #: src/labels.h:121 msgid "Time Distribution" msgstr "时间分é…" #: src/labels.h:123 msgid "Data sorted by hour [, avgts, cumts, maxts]" msgstr "æ•°æ®åˆ—æŽ’åºæŒ‰ [å°æ—¶, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:125 msgid "Time" msgstr "æ—¶é—´" #: src/labels.h:128 src/labels.h:132 msgid "Virtual Hosts" msgstr "虚拟主机" #: src/labels.h:130 src/labels.h:137 msgid "Data sorted by hits [, avgts, cumts, maxts]" msgstr "æ•°æ®åˆ—æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:135 msgid "Remote User (HTTP authentication)" msgstr "已认è¯ç”¨æˆ·(HTTP authentication)" #: src/labels.h:139 msgid "Remote User" msgstr "已认è¯ç”¨æˆ·" #: src/labels.h:142 msgid "Not Found URLs (404s)" msgstr "未找到的URLs" #: src/labels.h:144 msgid "Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "未找到的URLsæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时, 请求方法, å" "è®®]" #: src/labels.h:149 msgid "Visitor Hostnames and IPs" msgstr "访客主机åå’ŒIP地å€" #: src/labels.h:151 msgid "Top visitor hosts sorted by hits [, avgts, cumts, maxts]" msgstr "è®¿å®¢ä¸»æœºæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:153 msgid "Hosts" msgstr "主机" #: src/labels.h:156 msgid "Operating Systems" msgstr "æ“作系统" #: src/labels.h:158 msgid "Top Operating Systems sorted by hits [, avgts, cumts, maxts]" msgstr "æ“ä½œç³»ç»ŸæŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:160 msgid "OS" msgstr "æ“作系统" #: src/labels.h:163 src/labels.h:167 msgid "Browsers" msgstr "æµè§ˆå™¨" #: src/labels.h:165 msgid "Top Browsers sorted by hits [, avgts, cumts, maxts]" msgstr "æµè§ˆå™¨æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:170 msgid "Referrers URLs" msgstr "æ¥æºåœ°å€URLs" #: src/labels.h:172 msgid "Top Requested Referrers sorted by hits [, avgts, cumts, maxts]" msgstr "æ¥æºåœ°å€æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:177 src/labels.h:181 msgid "Referring Sites" msgstr "推è网站" #: src/labels.h:179 msgid "Top Referring Sites sorted by hits [, avgts, cumts, maxts]" msgstr "推èç½‘ç«™æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:184 msgid "Keyphrases from Google's search engine" msgstr "è°·æ­Œæœç´¢å…³é”®å­—" #: src/labels.h:186 msgid "Top Keyphrases sorted by hits [, avgts, cumts, maxts]" msgstr "å…³é”®å­—æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:188 msgid "Keyphrases" msgstr "关键字" #: src/labels.h:191 src/labels.h:195 msgid "Geo Location" msgstr "地ç†ä½ç½®" #: src/labels.h:193 msgid "Continent > Country sorted by unique hits [, avgts, cumts, maxts]" msgstr "大陆 > å›½å®¶æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:198 msgid "HTTP Status Codes" msgstr "HTTP状æ€ç " #: src/labels.h:200 msgid "Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]" msgstr "HTTP状æ€ç æŽ’åºæŒ‰ [点击é‡, å¹³å‡å“应时, 总共å“应时, 最高å“应时]" #: src/labels.h:202 msgid "Status Codes" msgstr "状æ€ç " #: src/labels.h:206 msgid "[ ] case sensitive" msgstr "[ ] 区分大å°å†™" #: src/labels.h:208 msgid "[x] case sensitive" msgstr "[x] 区分大å°å†™" #: src/labels.h:210 msgid "Regex allowed - ^g to cancel - TAB switch case" msgstr "å…è®¸æ­£åˆ™è¡¨è¾¾å¼ - ^g退出 - TAB改å˜å¤§å°å†™" #: src/labels.h:212 msgid "Find pattern in all views" msgstr "在所有界é¢ä¸­æŸ¥æ‰¾åŒ¹é…模å¼" #: src/labels.h:216 msgid "Log Format Configuration" msgstr "日志格å¼è®¾ç½®" #: src/labels.h:218 msgid "[SPACE] to toggle - [ENTER] to proceed - [q] to quit" msgstr "[空格]åˆ‡æ¢ - [回车]ç»§ç»­ - [q]退出" #: src/labels.h:220 msgid "Log Format - [c] to add/edit format" msgstr "æ—¥å¿—æ ¼å¼ - [c]新建/修改格å¼" #: src/labels.h:222 msgid "Date Format - [d] to add/edit format" msgstr "æ—¥æœŸæ ¼å¼ - [d]新建/修改格å¼" #: src/labels.h:224 msgid "Time Format - [t] to add/edit format" msgstr "æ—¶é—´æ ¼å¼ - [t]新建/修改格å¼" #: src/labels.h:226 src/labels.h:230 msgid "[UP/DOWN] to scroll - [q] to close window" msgstr "[UP/DOWN]上下滚动 - [q]退出" #: src/labels.h:232 #, c-format msgid "User Agents for %1$s" msgstr "ç”¨æˆ·ä»£ç† %1$s" #: src/labels.h:236 msgid "Scheme Configuration" msgstr "颜色方案设置" #: src/labels.h:238 msgid "[ENTER] to use scheme - [q]uit" msgstr "[回车]选喿–¹æ¡ˆ - [q]退出" #: src/labels.h:242 msgid "Sort active module by" msgstr "当å‰é€‰æ‹©æ ç›®æŽ’åº" #: src/labels.h:244 msgid "[ENTER] select - [TAB] sort - [q]uit" msgstr "[回车]选择 - [TAB]æŽ’åº - [q]退出" #: src/labels.h:248 msgid "GoAccess Quick Help" msgstr "GoAccess快速帮助" #: src/labels.h:250 msgid "[UP/DOWN] to scroll - [q] to quit" msgstr "[UP/DOWN]上下滚动 - [q]退出" #: src/labels.h:254 msgid "Built using Tokyo Cabinet on-disk B+ Tree." msgstr "使用Tokyo Cabinet在ç£ç›˜ä¸­çš„B+æ ‘æ¥æž„建" #: src/labels.h:256 msgid "Built using Tokyo Cabinet in-memory hash database." msgstr "使用Tokyo Cabinetçš„å†…å­˜ä¸­çš„å“ˆå¸Œè¡¨æ¥æž„建" #: src/labels.h:258 msgid "Built using the default in-memory hash database." msgstr "ä½¿ç”¨é»˜è®¤çš„åœ¨å†…å­˜ä¸­çš„å“ˆå¸Œè¡¨æ¥æž„建" #: src/labels.h:262 msgid "Format Errors - Verify your log/date/time format" msgstr "æ ¼å¼é”™è¯¯ - 请检查你的日志/日期/æ—¶é—´æ ¼å¼" #: src/labels.h:264 msgid "No date format was found on your conf file." msgstr "未在é…置文件中设置日期格å¼" #: src/labels.h:266 msgid "No log format was found on your conf file." msgstr "未在é…置文件中设置日志格å¼" #: src/labels.h:268 msgid "No time format was found on your conf file." msgstr "未在é…置文件中设置时间格å¼" #: src/labels.h:270 msgid "No default config file found." msgstr "未找到默认的é…置文件" #: src/labels.h:272 msgid "You may specify one with" msgstr "ä½ å¯ä»¥æŒ‡å®šé…置文件" #: src/labels.h:274 msgid "producing the following errors" msgstr "出现以下错误" #: src/labels.h:276 #, c-format msgid "Parsed %1$d lines" msgstr "å·²è§£æž %1$d 行" #: src/labels.h:278 msgid "Please report it by opening an issue on GitHub" msgstr "请在GitHub中添加一个issueæ¥ç»™æˆ‘们å馈信æ¯" #: src/labels.h:280 msgid "Select a time format." msgstr "选择时间格å¼" #: src/labels.h:282 msgid "Select a date format." msgstr "选择日期格å¼" #: src/labels.h:284 msgid "Select a log format." msgstr "选择日志格å¼" #: src/labels.h:286 #, c-format msgid "'%1$s' panel is disabled" msgstr "'%1$s' 颿¿å·²ç¦ç”¨" #: src/labels.h:290 msgid "For more details visit" msgstr "更多信æ¯è¯·è®¿é—®" #: src/labels.h:292 msgid "Last Updated" msgstr "最近更新" #: src/labels.h:294 msgid "WebSocket server ready to accept new client connections" msgstr "WebSocketæœåŠ¡å™¨å·²å‡†å¤‡æŽ¥æ”¶æ¥è‡ªå®¢æˆ·çš„连接" #: src/labels.h:297 msgid "The following options can also be supplied to the command" msgstr "你也å¯ä»¥åœ¨command中选择以下选项" #: src/labels.h:299 msgid "Examples can be found by running" msgstr "è¿è¡Œä¸€ä¸‹æŒ‡ä»¤æŸ¥çœ‹æ›´å¤šç¤ºä¾‹" #: src/labels.h:302 msgid "Server Statistics" msgstr "æœåŠ¡å™¨ç»Ÿè®¡ä¿¡æ¯" #: src/labels.h:304 msgid "Theme" msgstr "主题" #: src/labels.h:306 msgid "Dark Gray" msgstr "深黑" #: src/labels.h:308 msgid "Bright" msgstr "明亮" #: src/labels.h:310 msgid "Dark Blue" msgstr "æ·±è“" #: src/labels.h:312 #, fuzzy msgid "Dark Purple" msgstr "æ·±è“" #: src/labels.h:314 msgid "Panels" msgstr "颿¿" #: src/labels.h:316 msgid "Items per Page" msgstr "æ¯é¡µé¡¹ç›®" #: src/labels.h:318 msgid "Tables" msgstr "表格" #: src/labels.h:320 msgid "Display Tables" msgstr "显示表格" #: src/labels.h:322 msgid "Auto-Hide on Small Devices" msgstr "å±å¹•è¿‡å°æ—¶è‡ªåЍéšè—" #: src/labels.h:324 msgid "Automatically hide tables on small screen devices" msgstr "å±å¹•è¿‡å°æ—¶è‡ªåЍéšè—表格" #: src/labels.h:326 msgid "Layout" msgstr "布局" #: src/labels.h:328 msgid "Horizontal" msgstr "横å‘" #: src/labels.h:330 msgid "Vertical" msgstr "纵å‘" #: src/labels.h:332 msgid "File Options" msgstr "文件选项" #: src/labels.h:334 msgid "Export as JSON" msgstr "导出为JSON文件" #: src/labels.h:336 msgid "Panel Options" msgstr "颿¿é€‰é¡¹" #: src/labels.h:338 msgid "Previous" msgstr "åŽé€€" #: src/labels.h:340 msgid "Next" msgstr "å‰è¿›" #: src/labels.h:342 msgid "First" msgstr "" #: src/labels.h:344 msgid "Last" msgstr "" #: src/labels.h:346 msgid "Chart Options" msgstr "图表选项" #: src/labels.h:348 msgid "Chart" msgstr "图表" #: src/labels.h:350 msgid "Type" msgstr "类型" #: src/labels.h:352 msgid "Area Spline" msgstr "AreaSpline图表" #: src/labels.h:354 msgid "Bar" msgstr "æ¡å½¢å›¾" #: src/labels.h:356 msgid "Plot Metric" msgstr "绘制度é‡" # change #: src/labels.h:358 msgid "Table Columns" msgstr "表格列" #: src/labels.h:362 msgid "1xx Informational" msgstr "1xx 消æ¯" #: src/labels.h:364 msgid "2xx Success" msgstr "2xx æˆåŠŸ" #: src/labels.h:366 msgid "3xx Redirection" msgstr "3xx Urlé‡å®šå‘" #: src/labels.h:368 msgid "4xx Client Errors" msgstr "4xx 客户端错" #: src/labels.h:370 msgid "5xx Server Errors" msgstr "5xx æœåС噍错" #: src/labels.h:373 msgid "100 - Continue: Server received the initial part of the request" msgstr "100 - ç»§ç»­: æœåŠ¡å™¨å·²ç»æŽ¥æ”¶åˆ°è¯·æ±‚å¤´" #: src/labels.h:375 msgid "101 - Switching Protocols: Client asked to switch protocols" msgstr "101 - 更改åè®®: å®¢æˆ·ç«¯è¢«é€šçŸ¥å˜æ›´åè®®æ¥å®Œæˆè¯·æ±‚" #: src/labels.h:377 msgid "200 - OK: The request sent by the client was successful" msgstr "200 - æˆåŠŸ: 请求æˆåŠŸ" #: src/labels.h:379 msgid "201 - Created: The request has been fulfilled and created" msgstr "201 - 已创建: 请求æˆåŠŸå¹¶ä¸”æœåŠ¡å™¨åˆ›å»ºäº†æ–°çš„èµ„æº" #: src/labels.h:381 msgid "202 - Accepted: The request has been accepted for processing" msgstr "202 - 已接收: æœåŠ¡å™¨å·²æŽ¥å—请求,但尚未处ç†" #: src/labels.h:383 msgid "203 - Non-authoritative Information: Response from a third party" msgstr "203 - éžæŽˆæƒä¿¡æ¯: æœåС噍已æˆåŠŸå¤„ç†è¯·æ±‚ 但返回的信æ¯å¯èƒ½æ¥è‡ªå¦ä¸€æ¥æº" #: src/labels.h:385 msgid "204 - No Content: Request did not return any content" msgstr "204 - 无内容: 没有返回任何内容" #: src/labels.h:387 msgid "205 - Reset Content: Server asked the client to reset the document" msgstr "205 - é‡ç½®å†…容: æœåС噍已æˆåŠŸå¤„ç†è¯·æ±‚ 但没有返回任何内容" #: src/labels.h:389 msgid "206 - Partial Content: The partial GET has been successful" msgstr "206 - 部分内容: æœåС噍æˆåŠŸå¤„ç†äº†éƒ¨åˆ†GET请求" #: src/labels.h:391 msgid "207 - Multi-Status: WebDAV; RFC 4918" msgstr "207 - 多状æ€: WebDAV; RFC 4918" #: src/labels.h:393 msgid "208 - Already Reported: WebDAV; RFC 5842" msgstr "208 - 已报告: WebDAV; RFC 5842" #: src/labels.h:395 msgid "300 - Multiple Choices: Multiple options for the resource" msgstr "300 - 多é‡é€‰æ‹©: èµ„æºæä¾›å¤šç§é€‰é¡¹è®©å®¢æˆ·ç«¯é€‰æ‹©" #: src/labels.h:397 msgid "301 - Moved Permanently: Resource has permanently moved" msgstr "301 - 永久移除: 资æºå·²è¢«æ°¸ä¹…移动到新ä½ç½®" #: src/labels.h:399 msgid "302 - Moved Temporarily (redirect)" msgstr "302 - 临时移动" #: src/labels.h:401 msgid "303 - See Other Document: The response is at a different URI" msgstr "303 - 查看其他ä½ç½®: 当å‰è¯·æ±‚çš„å“应在å¦ä¸€ä¸ªURI上被找到" #: src/labels.h:403 msgid "304 - Not Modified: Resource has not been modified" msgstr "304 - 未修改: èµ„æºæœªè¢«ä¿®æ”¹" #: src/labels.h:405 msgid "305 - Use Proxy: Can only be accessed through the proxy" msgstr "305 - 使用代ç†: åªèƒ½é€šè¿‡ä»£ç†è®¿é—®èµ„æº" #: src/labels.h:407 msgid "307 - Temporary Redirect: Resource temporarily moved" msgstr "307 - 临时é‡å®šå‘: 临时从å¦å¤–çš„URIå“应" #: src/labels.h:409 msgid "400 - Bad Request: The syntax of the request is invalid" msgstr "400 - 错误请求: 客户端语法错误" #: src/labels.h:411 msgid "401 - Unauthorized: Request needs user authentication" msgstr "401 - 未授æƒ: 当å‰è¯·æ±‚需è¦ç”¨æˆ·æŽˆæƒ" #: src/labels.h:413 msgid "402 - Payment Required" msgstr "402 - éœ€è¦æ”¯ä»˜" #: src/labels.h:415 msgid "403 - Forbidden: Server is refusing to respond to it" msgstr "403 - ç¦æ­¢: æœåŠ¡å™¨æ‹’ç»å“应请求" #: src/labels.h:417 msgid "404 - Not Found: Requested resource could not be found" msgstr "404 - 未找到: 找ä¸åˆ°è¯·æ±‚的资æº" #: src/labels.h:419 msgid "405 - Method Not Allowed: Request method not supported" msgstr "405 - 方法ç¦ç”¨: 䏿”¯æŒè¯·æ±‚中指定的方法" #: src/labels.h:421 msgid "406 - Not Acceptable" msgstr "406 - 无法接收" #: src/labels.h:423 msgid "407 - Proxy Authentication Required" msgstr "407 - 需è¦ä»£ç†æŽˆæƒ" #: src/labels.h:425 msgid "408 - Request Timeout: Server timed out waiting for the request" msgstr "408 - 请求超时: æœåŠ¡å™¨åœ¨ç­‰å€™è¯·æ±‚æ—¶è¶…æ—¶" #: src/labels.h:427 msgid "409 - Conflict: Conflict in the request" msgstr "409 - 冲çª: æœåŠ¡å™¨åœ¨å®Œæˆè¯·æ±‚æ—¶å‘生冲çª" #: src/labels.h:429 msgid "410 - Gone: Resource requested is no longer available" msgstr "410 - 已删除: 请求的资æºå·²æ°¸ä¹…删除" #: src/labels.h:431 msgid "411 - Length Required: Invalid Content-Length" msgstr "411 - éœ€è¦æœ‰æ•ˆé•¿åº¦: Content-Length无效" #: src/labels.h:433 msgid "412 - Precondition Failed: Server does not meet preconditions" msgstr "412 - æœªæ»¡è¶³å‰ææ¡ä»¶: æœåŠ¡å™¨æœªæ»¡è¶³è¯·æ±‚ä¸­çš„å‰ææ¡ä»¶" #: src/labels.h:435 msgid "413 - Payload Too Large" msgstr "413 - 请求实体过大" #: src/labels.h:437 msgid "414 - Request-URI Too Long" msgstr "414 - 请求的URI过长" #: src/labels.h:439 msgid "415 - Unsupported Media Type: Media type is not supported" msgstr "415 - 䏿”¯æŒçš„媒体类型" #: src/labels.h:441 msgid "416 - Requested Range Not Satisfiable: Cannot supply that portion" msgstr "416 - 请求范围ä¸ç¬¦åˆè¦æ±‚" #: src/labels.h:443 msgid "417 - Expectation Failed" msgstr "417 - 未满足期望值" #: src/labels.h:445 msgid "421 - Misdirected Request" msgstr "421 - 被误导的请求" #: src/labels.h:447 msgid "422 - Unprocessable Entity due to semantic errors: WebDAV" msgstr "422 - è¯·æ±‚æ ¼å¼æ­£ç¡®ä½†å› å­˜åœ¨è¯­æ³•错而无法å“应" #: src/labels.h:449 msgid "423 - The resource that is being accessed is locked" msgstr "423 - 当å‰èµ„æºè¢«é”定" #: src/labels.h:451 msgid "424 - Failed Dependency: WebDAV" msgstr "424 - 失败的ä¾èµ–" #: src/labels.h:453 msgid "426 - Upgrade Required: Client should switch to a different protocol" msgstr "426 - 需è¦å‡çº§: 客户端应该切æ¢åˆ°å…¶ä»–çš„åè®®" #: src/labels.h:455 msgid "428 - Precondition Required" msgstr "428 - 需è¦å‰ææ¡ä»¶" #: src/labels.h:457 msgid "429 - Too Many Requests: The user has sent too many requests" msgstr "429 - 请求过多: 客户端å‘é€äº†å¤ªå¤šè¯·æ±‚" #: src/labels.h:459 msgid "431 - Request Header Fields Too Large" msgstr "431 - 请求头字段太长" #: src/labels.h:461 msgid "451 - Unavailable For Legal Reasons" msgstr "451 - 因法律原因ä¸å¯ç”¨" #: src/labels.h:463 msgid "444 - (Nginx) Connection closed without sending any headers" msgstr "444 - (Nginx) 未å‘é€å“应头且连接已关闭" #: src/labels.h:465 msgid "494 - (Nginx) Request Header Too Large" msgstr "494 - (Nginx) 请求头太大" #: src/labels.h:467 msgid "495 - (Nginx) SSL client certificate error" msgstr "495 - (Nginx) SSL客户端è¯ä¹¦é”™" #: src/labels.h:469 msgid "496 - (Nginx) Client didn't provide certificate" msgstr "496 - (Nginx) 客户端未æä¾›è¯ä¹¦" #: src/labels.h:471 msgid "497 - (Nginx) HTTP request sent to HTTPS port" msgstr "497 - (Nginx) HTTP请求被å‘é€åˆ°äº†HTTPS端å£" #: src/labels.h:473 msgid "499 - (Nginx) Connection closed by client while processing request" msgstr "499 - (Nginx) 处ç†è¯·æ±‚时连接被客户端关闭" #: src/labels.h:475 msgid "500 - Internal Server Error" msgstr "500 - æœåŠ¡å™¨å†…éƒ¨é”™" #: src/labels.h:477 msgid "501 - Not Implemented" msgstr "501 - 尚未实施" #: src/labels.h:479 msgid "502 - Bad Gateway: Received an invalid response from the upstream" msgstr "502 - 错误网关: æœåŠ¡å™¨ä½œä¸ºç½‘å…³æˆ–ä»£ç†, 从上游æœåŠ¡å™¨æ”¶åˆ°æ— æ•ˆå“应" #: src/labels.h:481 msgid "503 - Service Unavailable: The server is currently unavailable" msgstr "503 - æœåŠ¡ä¸å¯ç”¨: æœåŠ¡å™¨æ— æ³•ä½¿ç”¨" #: src/labels.h:483 msgid "504 - Gateway Timeout: The upstream server failed to send request" msgstr "504 - 网关超时: æœåŠ¡å™¨ä½œä¸ºç½‘å…³æˆ–ä»£ç†, 未从上游æœåŠ¡å™¨æ”¶åˆ°è¯·æ±‚" #: src/labels.h:485 msgid "505 - HTTP Version Not Supported" msgstr "505 - HTTP版本ä¸å—支æŒ" #: src/labels.h:487 msgid "520 - CloudFlare - Web server is returning an unknown error" msgstr "520 - CloudFlare - æœåŠ¡å™¨è¿”å›žä¸€ä¸ªæœªçŸ¥é”™è¯¯" #: src/labels.h:489 msgid "521 - CloudFlare - Web server is down" msgstr "521 - CloudFlare - æœåŠ¡å™¨æŒ‚äº†" #: src/labels.h:491 msgid "522 - CloudFlare - Connection timed out" msgstr "522 - CloudFlare - 连接超时" #: src/labels.h:493 msgid "523 - CloudFlare - Origin is unreachable" msgstr "523 - CloudFlare - æœåŠ¡å™¨æ— æ³•è®¿é—®" #: src/labels.h:495 msgid "524 - CloudFlare - A timeout occurred" msgstr "524 - CloudFlare - æœåС噍å“应超时" #~ msgid "Bandwidth" #~ msgstr "带宽" #~ msgid "Unique Files" #~ msgstr "唯一的文件" #~ msgid "Unique 404" #~ msgstr "唯一的404" #~ msgid " - Including spiders" #~ msgstr "- 包括网络机器人" ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/quot.sed����������������������������������������������������������������������������0000644�0000000�0000000�00000000231�13160075065�012135� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/boldquot.sed������������������������������������������������������������������������0000644�0000000�0000000�00000000331�13160075065�012777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/stamp-po����������������������������������������������������������������������������0000644�0000000�0000000�00000000012�13375711133�012131� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������timestamp ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/Makefile.in.in����������������������������������������������������������������������0000644�0000000�0000000�00000037442�13160075065�013140� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu> # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/fr.po�������������������������������������������������������������������������������0000644�0000000�0000000�00000045314�13375711133�011433� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file is distributed under the same license as the goaccess package. # Nicolas P <np>, 2017. # msgid "" msgstr "" "Project-Id-Version: goaccess 1.2\n" "Report-Msgid-Bugs-To: hello@goaccess.io\n" "POT-Creation-Date: 2018-11-22 23:38-0600\n" "PO-Revision-Date: 2017-04-03 09:43+0200\n" "Last-Translator: Nicolas P <np.pascal@gmail.com>\n" "Language-Team: français\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Gtranslator 2.91.7\n" #: src/labels.h:40 msgid "en" msgstr "fr" #: src/labels.h:43 msgid "Exp. Panel" msgstr "Dev. Panneau" #: src/labels.h:44 msgid "Help" msgstr "Aide" #: src/labels.h:45 msgid "Quit" msgstr "Quitter" #: src/labels.h:46 msgid "Total" msgstr "Total" #: src/labels.h:49 msgid "[x] ASC [ ] DESC" msgstr "[x] ASC [ ] DESC" #: src/labels.h:50 msgid "[ ] ASC [x] DESC" msgstr "[ ] ASC [x] DESC" #: src/labels.h:53 #, c-format msgid "[Active Panel: %1$s]" msgstr "" #: src/labels.h:54 msgid "[q]uit GoAccess" msgstr "" #: src/labels.h:55 msgid "[?] Help [Enter] Exp. Panel" msgstr "" #: src/labels.h:56 msgid "Dashboard" msgstr "Tableau de bord" #: src/labels.h:57 msgid "Dashboard - Overall Analyzed Requests" msgstr "Tableau de bord - Requêtes analysées, vue d'ensemble" #: src/labels.h:58 msgid "Overall Analyzed Requests" msgstr "Requêtes analysées, vue d'ensemble" #: src/labels.h:60 src/labels.h:81 msgid "Tx. Amount" msgstr "" #: src/labels.h:61 msgid "Date/Time" msgstr "Date/Heure" #: src/labels.h:62 msgid "Excl. IP Hits" msgstr "Excl. IP Hits" #: src/labels.h:63 msgid "Failed Requests" msgstr "Requêtes échouées" #: src/labels.h:64 msgid "Init. Proc. Time" msgstr "Init. Proc. Time" #: src/labels.h:65 msgid "Log Size" msgstr "Taille du log" #: src/labels.h:66 msgid "Log Source" msgstr "Fichier de log" #: src/labels.h:67 src/labels.h:174 msgid "Referrers" msgstr "Origine" #: src/labels.h:68 msgid "Total Requests" msgstr "Requêtes totales" #: src/labels.h:69 msgid "Static Files" msgstr "Fichiers statiques" #: src/labels.h:70 src/labels.h:146 msgid "Not Found" msgstr "Non Trouvé" #: src/labels.h:71 #, fuzzy msgid "Requested Files" msgstr "Fichiers demandés (URLs)" #: src/labels.h:72 msgid "Unique Visitors" msgstr "Visiteurs uniques" #: src/labels.h:73 msgid "Valid Requests" msgstr "Requêtes valides" #: src/labels.h:76 msgid "Hits" msgstr "Hits" #: src/labels.h:77 msgid "h%" msgstr "" #: src/labels.h:78 src/labels.h:104 msgid "Visitors" msgstr "Visiteurs" #: src/labels.h:79 msgid "Vis." msgstr "Vis." #: src/labels.h:80 msgid "v%" msgstr "" #: src/labels.h:82 msgid "Avg. T.S." msgstr "Avg. T.S." #: src/labels.h:83 msgid "Cum. T.S." msgstr "Cum. T.S." #: src/labels.h:84 msgid "Max. T.S." msgstr "Max. T.S." #: src/labels.h:85 msgid "Method" msgstr "Méthode" #: src/labels.h:86 msgid "Mtd" msgstr "Mtd" #: src/labels.h:87 msgid "Protocol" msgstr "Protocole" #: src/labels.h:88 msgid "Proto" msgstr "Proto" #: src/labels.h:89 msgid "City" msgstr "Ville" #: src/labels.h:90 msgid "Country" msgstr "Pays" #: src/labels.h:91 msgid "Hostname" msgstr "Nom d'hôte" #: src/labels.h:92 msgid "Data" msgstr "Données" #: src/labels.h:94 #, fuzzy msgid "Hits/Visitors" msgstr "Visiteurs" #: src/labels.h:98 msgid "Unique visitors per day" msgstr "Visiteurs uniques par jour" #: src/labels.h:100 msgid "Unique visitors per day - Including spiders" msgstr "Visiteurs uniques/jour - Y compris bots" #: src/labels.h:102 msgid "Hits having the same IP, date and agent are a unique visit." msgstr "" "Les hits depuis la même IP, date et user-agent comptent comme visite unique" #: src/labels.h:107 msgid "Requested Files (URLs)" msgstr "Fichiers demandés (URLs)" #: src/labels.h:109 msgid "Top requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "Top des requêtes trié par hits [, avgts, cumts, maxts, mthd, proto]" #: src/labels.h:111 msgid "Requests" msgstr "Requêtes" #: src/labels.h:114 src/labels.h:118 msgid "Static Requests" msgstr "Requêtes statiques" #: src/labels.h:116 msgid "Top static requests sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "Top des requêtes statiques trié par hits [, avgts, cumts, maxts, mthd, proto]" #: src/labels.h:121 msgid "Time Distribution" msgstr "Distribution temporelle" #: src/labels.h:123 msgid "Data sorted by hour [, avgts, cumts, maxts]" msgstr "Données triées par heure [, avgts, cumts, maxts]" #: src/labels.h:125 msgid "Time" msgstr "Temps" #: src/labels.h:128 src/labels.h:132 msgid "Virtual Hosts" msgstr "Hôtes virtuels" #: src/labels.h:130 src/labels.h:137 msgid "Data sorted by hits [, avgts, cumts, maxts]" msgstr "Données triées par hits [, avgts, cumts, maxts]" #: src/labels.h:135 msgid "Remote User (HTTP authentication)" msgstr "Utilisateur distant (authentification HTTP)" #: src/labels.h:139 msgid "Remote User" msgstr "Remote Utilisateur" #: src/labels.h:142 msgid "Not Found URLs (404s)" msgstr "URLs Non trouvées (404s)" #: src/labels.h:144 msgid "Top not found URLs sorted by hits [, avgts, cumts, maxts, mthd, proto]" msgstr "" "Top des URLs non trouvées trié par hits [, avgts, cumts, maxts, mthd, proto]" #: src/labels.h:149 msgid "Visitor Hostnames and IPs" msgstr "Nom de machine et IPs des visiteurs" #: src/labels.h:151 msgid "Top visitor hosts sorted by hits [, avgts, cumts, maxts]" msgstr "Top des visiteurs trié par hits [, avgts, cumts, maxts]" #: src/labels.h:153 msgid "Hosts" msgstr "Hôtes" #: src/labels.h:156 msgid "Operating Systems" msgstr "Systèmes d'exploitation" #: src/labels.h:158 msgid "Top Operating Systems sorted by hits [, avgts, cumts, maxts]" msgstr "Top des SE trié par hits [, avgts, cumts, maxts]" #: src/labels.h:160 msgid "OS" msgstr "SE" #: src/labels.h:163 src/labels.h:167 msgid "Browsers" msgstr "Navigateurs" #: src/labels.h:165 msgid "Top Browsers sorted by hits [, avgts, cumts, maxts]" msgstr "Top des Navigateurs trié par hits [, avgts, cumts, maxts]" #: src/labels.h:170 msgid "Referrers URLs" msgstr "URLs d'origine" #: src/labels.h:172 msgid "Top Requested Referrers sorted by hits [, avgts, cumts, maxts]" msgstr "Top des URLs d'origine trié par hits [, avgts, cumts, maxts]" #: src/labels.h:177 src/labels.h:181 msgid "Referring Sites" msgstr "Sites d'origine" #: src/labels.h:179 msgid "Top Referring Sites sorted by hits [, avgts, cumts, maxts]" msgstr "Top des sites d'origine trié par hits [, avgts, cumts, maxts]" #: src/labels.h:184 msgid "Keyphrases from Google's search engine" msgstr "Mot-clés Google" #: src/labels.h:186 msgid "Top Keyphrases sorted by hits [, avgts, cumts, maxts]" msgstr "Top des Mot-clés trié par hits [, avgts, cumts, maxts]" #: src/labels.h:188 msgid "Keyphrases" msgstr "Mot-clés" #: src/labels.h:191 src/labels.h:195 msgid "Geo Location" msgstr "Géo Localisation" #: src/labels.h:193 msgid "Continent > Country sorted by unique hits [, avgts, cumts, maxts]" msgstr "Continent > Pays trié par hits unique [, avgts, cumts, maxts]" #: src/labels.h:198 msgid "HTTP Status Codes" msgstr "Status HTTP" #: src/labels.h:200 msgid "Top HTTP Status Codes sorted by hits [, avgts, cumts, maxts]" msgstr "Top des status HTTP trié par hits [, avgts, cumts, maxts]" #: src/labels.h:202 msgid "Status Codes" msgstr "Status HTTP" #: src/labels.h:206 msgid "[ ] case sensitive" msgstr "[ ] sensible à la casse" #: src/labels.h:208 msgid "[x] case sensitive" msgstr "[x] sensible à la casse" #: src/labels.h:210 msgid "Regex allowed - ^g to cancel - TAB switch case" msgstr "Regex OK - ^g pour annuler - TAB pour changer la casse" #: src/labels.h:212 msgid "Find pattern in all views" msgstr "Trouver tous les motifs dans toutes les vues" #: src/labels.h:216 msgid "Log Format Configuration" msgstr "" #: src/labels.h:218 msgid "[SPACE] to toggle - [ENTER] to proceed - [q] to quit" msgstr "" #: src/labels.h:220 msgid "Log Format - [c] to add/edit format" msgstr "" #: src/labels.h:222 msgid "Date Format - [d] to add/edit format" msgstr "" #: src/labels.h:224 msgid "Time Format - [t] to add/edit format" msgstr "" #: src/labels.h:226 src/labels.h:230 msgid "[UP/DOWN] to scroll - [q] to close window" msgstr "" #: src/labels.h:232 #, c-format msgid "User Agents for %1$s" msgstr "" #: src/labels.h:236 msgid "Scheme Configuration" msgstr "" #: src/labels.h:238 msgid "[ENTER] to use scheme - [q]uit" msgstr "" #: src/labels.h:242 msgid "Sort active module by" msgstr "" #: src/labels.h:244 msgid "[ENTER] select - [TAB] sort - [q]uit" msgstr "" #: src/labels.h:248 msgid "GoAccess Quick Help" msgstr "" #: src/labels.h:250 msgid "[UP/DOWN] to scroll - [q] to quit" msgstr "" #: src/labels.h:254 msgid "Built using Tokyo Cabinet on-disk B+ Tree." msgstr "Construit sur le disque en arbre B+ en utilisant Tokyo Cabinet." #: src/labels.h:256 msgid "Built using Tokyo Cabinet in-memory hash database." msgstr "" "Construit en mémoire avec une base de données de la table de hachage en " "utilisant Tokyo Cabinet" #: src/labels.h:258 msgid "Built using the default in-memory hash database." msgstr "" "Construit par défaut en mémoire avec une base de données de la table de " "hachage" #: src/labels.h:262 msgid "Format Errors - Verify your log/date/time format" msgstr "Erreurs de format - Vérifiez votre format de journal / date / heure" #: src/labels.h:264 msgid "No date format was found on your conf file." msgstr "Aucun format de date n'a été trouvé sur votre fichier conf." #: src/labels.h:266 msgid "No log format was found on your conf file." msgstr "Aucun format de journal n'a été trouvé sur votre fichier conf." #: src/labels.h:268 msgid "No time format was found on your conf file." msgstr "Aucun format de journal n'a été trouvé sur votre fichier conf." #: src/labels.h:270 msgid "No default config file found." msgstr "Aucun fichier de configuration par défaut trouvé." #: src/labels.h:272 msgid "You may specify one with" msgstr "Vous pouvez en préciser un avec" #: src/labels.h:274 msgid "producing the following errors" msgstr "produisant les erreurs suivantes" #: src/labels.h:276 #, c-format msgid "Parsed %1$d lines" msgstr "Analysé %1$d lignes" #: src/labels.h:278 msgid "Please report it by opening an issue on GitHub" msgstr "Si vous plaît, rapporter cela en ouvrant un probleme sur GitHub" #: src/labels.h:280 msgid "Select a time format." msgstr "" #: src/labels.h:282 msgid "Select a date format." msgstr "" #: src/labels.h:284 msgid "Select a log format." msgstr "" #: src/labels.h:286 #, c-format msgid "'%1$s' panel is disabled" msgstr "" #: src/labels.h:290 msgid "For more details visit" msgstr "Pour plus de détails, visitez" #: src/labels.h:292 msgid "Last Updated" msgstr "Dernière mise à jour" #: src/labels.h:294 msgid "WebSocket server ready to accept new client connections" msgstr "WebSocket serveur prêt à accepter les nouvelles connexions client" #: src/labels.h:297 msgid "The following options can also be supplied to the command" msgstr "Les options suivantes peuvent également être fournies à la commande" #: src/labels.h:299 msgid "Examples can be found by running" msgstr "Des exemples peuvent être trouvés en cours d'exécution" #: src/labels.h:302 msgid "Server Statistics" msgstr "Statistiques du serveur" #: src/labels.h:304 msgid "Theme" msgstr "Thème" #: src/labels.h:306 msgid "Dark Gray" msgstr "Gris foncé" #: src/labels.h:308 msgid "Bright" msgstr "Brillant" #: src/labels.h:310 msgid "Dark Blue" msgstr "Bleu foncé" #: src/labels.h:312 #, fuzzy msgid "Dark Purple" msgstr "Bleu foncé" #: src/labels.h:314 msgid "Panels" msgstr "Panneaux" #: src/labels.h:316 msgid "Items per Page" msgstr "Objets par page" #: src/labels.h:318 msgid "Tables" msgstr "Tableaux" #: src/labels.h:320 msgid "Display Tables" msgstr "Afficher les tableaux" #: src/labels.h:322 msgid "Auto-Hide on Small Devices" msgstr "Masquage-auto/Petits appareils" #: src/labels.h:324 msgid "Automatically hide tables on small screen devices" msgstr "" "Masquer automatiquement les tableaux sur les appareils avec un petit écran" #: src/labels.h:326 msgid "Layout" msgstr "Disposition" #: src/labels.h:328 msgid "Horizontal" msgstr "Horizontal" #: src/labels.h:330 msgid "Vertical" msgstr "Verticale" #: src/labels.h:332 msgid "File Options" msgstr "Options de fichier" #: src/labels.h:334 msgid "Export as JSON" msgstr "Exporter en tant que JSON" #: src/labels.h:336 msgid "Panel Options" msgstr "Options du panneau" #: src/labels.h:338 msgid "Previous" msgstr "Précédent" #: src/labels.h:340 msgid "Next" msgstr "Suivant" #: src/labels.h:342 msgid "First" msgstr "" #: src/labels.h:344 msgid "Last" msgstr "" #: src/labels.h:346 msgid "Chart Options" msgstr "Options du graphique" #: src/labels.h:348 msgid "Chart" msgstr "Graphique" #: src/labels.h:350 msgid "Type" msgstr "Type" #: src/labels.h:352 msgid "Area Spline" msgstr "Courbe vectorielle" #: src/labels.h:354 msgid "Bar" msgstr "Barre" #: src/labels.h:356 msgid "Plot Metric" msgstr "Tracé métrique" #: src/labels.h:358 msgid "Table Columns" msgstr "Colonnes de tableau" #: src/labels.h:362 msgid "1xx Informational" msgstr "" #: src/labels.h:364 msgid "2xx Success" msgstr "" #: src/labels.h:366 msgid "3xx Redirection" msgstr "" #: src/labels.h:368 msgid "4xx Client Errors" msgstr "" #: src/labels.h:370 msgid "5xx Server Errors" msgstr "" #: src/labels.h:373 msgid "100 - Continue: Server received the initial part of the request" msgstr "" #: src/labels.h:375 msgid "101 - Switching Protocols: Client asked to switch protocols" msgstr "" #: src/labels.h:377 msgid "200 - OK: The request sent by the client was successful" msgstr "" #: src/labels.h:379 msgid "201 - Created: The request has been fulfilled and created" msgstr "" #: src/labels.h:381 msgid "202 - Accepted: The request has been accepted for processing" msgstr "" #: src/labels.h:383 msgid "203 - Non-authoritative Information: Response from a third party" msgstr "" #: src/labels.h:385 msgid "204 - No Content: Request did not return any content" msgstr "" #: src/labels.h:387 msgid "205 - Reset Content: Server asked the client to reset the document" msgstr "" #: src/labels.h:389 msgid "206 - Partial Content: The partial GET has been successful" msgstr "" #: src/labels.h:391 msgid "207 - Multi-Status: WebDAV; RFC 4918" msgstr "" #: src/labels.h:393 msgid "208 - Already Reported: WebDAV; RFC 5842" msgstr "" #: src/labels.h:395 msgid "300 - Multiple Choices: Multiple options for the resource" msgstr "" #: src/labels.h:397 msgid "301 - Moved Permanently: Resource has permanently moved" msgstr "" #: src/labels.h:399 msgid "302 - Moved Temporarily (redirect)" msgstr "" #: src/labels.h:401 msgid "303 - See Other Document: The response is at a different URI" msgstr "" #: src/labels.h:403 msgid "304 - Not Modified: Resource has not been modified" msgstr "" #: src/labels.h:405 msgid "305 - Use Proxy: Can only be accessed through the proxy" msgstr "" #: src/labels.h:407 msgid "307 - Temporary Redirect: Resource temporarily moved" msgstr "" #: src/labels.h:409 msgid "400 - Bad Request: The syntax of the request is invalid" msgstr "" #: src/labels.h:411 msgid "401 - Unauthorized: Request needs user authentication" msgstr "" #: src/labels.h:413 msgid "402 - Payment Required" msgstr "" #: src/labels.h:415 msgid "403 - Forbidden: Server is refusing to respond to it" msgstr "" #: src/labels.h:417 msgid "404 - Not Found: Requested resource could not be found" msgstr "" #: src/labels.h:419 msgid "405 - Method Not Allowed: Request method not supported" msgstr "" #: src/labels.h:421 msgid "406 - Not Acceptable" msgstr "" #: src/labels.h:423 msgid "407 - Proxy Authentication Required" msgstr "" #: src/labels.h:425 msgid "408 - Request Timeout: Server timed out waiting for the request" msgstr "" #: src/labels.h:427 msgid "409 - Conflict: Conflict in the request" msgstr "" #: src/labels.h:429 msgid "410 - Gone: Resource requested is no longer available" msgstr "" #: src/labels.h:431 msgid "411 - Length Required: Invalid Content-Length" msgstr "" #: src/labels.h:433 msgid "412 - Precondition Failed: Server does not meet preconditions" msgstr "" #: src/labels.h:435 msgid "413 - Payload Too Large" msgstr "" #: src/labels.h:437 msgid "414 - Request-URI Too Long" msgstr "" #: src/labels.h:439 msgid "415 - Unsupported Media Type: Media type is not supported" msgstr "" #: src/labels.h:441 msgid "416 - Requested Range Not Satisfiable: Cannot supply that portion" msgstr "" #: src/labels.h:443 msgid "417 - Expectation Failed" msgstr "" #: src/labels.h:445 msgid "421 - Misdirected Request" msgstr "" #: src/labels.h:447 msgid "422 - Unprocessable Entity due to semantic errors: WebDAV" msgstr "" #: src/labels.h:449 msgid "423 - The resource that is being accessed is locked" msgstr "" #: src/labels.h:451 msgid "424 - Failed Dependency: WebDAV" msgstr "" #: src/labels.h:453 msgid "426 - Upgrade Required: Client should switch to a different protocol" msgstr "" #: src/labels.h:455 msgid "428 - Precondition Required" msgstr "" #: src/labels.h:457 msgid "429 - Too Many Requests: The user has sent too many requests" msgstr "" #: src/labels.h:459 msgid "431 - Request Header Fields Too Large" msgstr "" #: src/labels.h:461 msgid "451 - Unavailable For Legal Reasons" msgstr "" #: src/labels.h:463 msgid "444 - (Nginx) Connection closed without sending any headers" msgstr "" #: src/labels.h:465 msgid "494 - (Nginx) Request Header Too Large" msgstr "" #: src/labels.h:467 msgid "495 - (Nginx) SSL client certificate error" msgstr "" #: src/labels.h:469 msgid "496 - (Nginx) Client didn't provide certificate" msgstr "" #: src/labels.h:471 msgid "497 - (Nginx) HTTP request sent to HTTPS port" msgstr "" #: src/labels.h:473 msgid "499 - (Nginx) Connection closed by client while processing request" msgstr "" #: src/labels.h:475 msgid "500 - Internal Server Error" msgstr "" #: src/labels.h:477 msgid "501 - Not Implemented" msgstr "" #: src/labels.h:479 msgid "502 - Bad Gateway: Received an invalid response from the upstream" msgstr "" #: src/labels.h:481 msgid "503 - Service Unavailable: The server is currently unavailable" msgstr "" #: src/labels.h:483 msgid "504 - Gateway Timeout: The upstream server failed to send request" msgstr "" #: src/labels.h:485 msgid "505 - HTTP Version Not Supported" msgstr "" #: src/labels.h:487 msgid "520 - CloudFlare - Web server is returning an unknown error" msgstr "" #: src/labels.h:489 msgid "521 - CloudFlare - Web server is down" msgstr "" #: src/labels.h:491 msgid "522 - CloudFlare - Connection timed out" msgstr "" #: src/labels.h:493 msgid "523 - CloudFlare - Origin is unreachable" msgstr "" #: src/labels.h:495 msgid "524 - CloudFlare - A timeout occurred" msgstr "" #~ msgid "Bandwidth" #~ msgstr "Bande passante" #~ msgid "Unique Files" #~ msgstr "Fichiers uniques" #~ msgid "Unique 404" #~ msgstr "Unique 404" #~ msgid " - Including spiders" #~ msgstr "- Inclus robots d'indexation" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/po/remove-potcdate.sin�����������������������������������������������������������������0000644�0000000�0000000�00000000660�13160075065�014267� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } ��������������������������������������������������������������������������������goaccess-1.3/po/Rules-quot��������������������������������������������������������������������������0000644�0000000�0000000�00000003400�13160075065�012454� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/config.guess���������������������������������������������������������������������������0000755�0000000�0000000�00000127432�13375710677�012404� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # 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 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, see <http://www.gnu.org/licenses/>. # # 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 Per Bothner. Please send patches (context # diff format) to <config-patches@gnu.org> and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # 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 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 <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 # 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 ;; *: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 <stdio.h> /* 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 <sys/systemcfg.h> 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/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` 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 <stdlib.h> #include <unistd.h> 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 <unistd.h> 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 ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*: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-gnu`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/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu 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="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu 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-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # 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 ;; 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 case $UNAME_PROCESSOR in i386) eval $set_cc_for_build 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 UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac 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 #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> # include <sys/utsname.h> #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include <sys/param.h> # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/aclocal.m4�����������������������������������������������������������������������������0000644�0000000�0000000�00000107127�13375710674�011720� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 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_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'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 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. # serial 1 # 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.11' 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.11.6], [], [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.11.6])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, 2003, 2005, 2011 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. # serial 1 # 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], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 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. # serial 12 # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" 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 8's {/usr,}/bin/sh. touch 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) 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, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 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"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 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. # serial 16 # 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. # 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.62])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], [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], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [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([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. 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)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl 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 ]) 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, 2003, 2005, 2008, 2011 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. # serial 1 # 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}" != 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, 2005 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. # serial 2 # 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, 2002, 2003, 2005, 2009 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. # serial 4 # 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 ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # 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. # serial 6 # 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 supports --run. # If it does, 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 --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 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. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 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. # serial 5 # _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])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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)]) # Copyright (C) 2001, 2003, 2005, 2011 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. # serial 1 # 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, 2008, 2010 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. # serial 3 # _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, 2005, 2012 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. # serial 2 # _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}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. 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 <conftest.tar]) grep GrepMe conftest.dir/file >/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 m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/������������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�13375711132�010436� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/intlmacosx.m4�����������������������������������������������������������������������0000644�0000000�0000000�00000004575�13375124437�013022� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# intlmacosx.m4 serial 3 (gettext-0.18) dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) �����������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/progtest.m4�������������������������������������������������������������������������0000644�0000000�0000000�00000005573�13375124437�012507� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# progtest.m4 serial 6 (gettext-0.18) dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) �������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/lib-prefix.m4�����������������������������������������������������������������������0000644�0000000�0000000�00000020422�13375124437�012667� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/iconv.m4����������������������������������������������������������������������������0000644�0000000�0000000�00000015226�13375124437�011752� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# iconv.m4 serial 9 (gettext-0.18) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <stdlib.h> #include <iconv.h>], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include <iconv.h> #include <string.h> int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include <stdlib.h> #include <iconv.h> extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/gettext.m4��������������������������������������������������������������������������0000644�0000000�0000000�00000035132�13375124437�012316� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# gettext.m4 serial 63 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/lib-ld.m4���������������������������������������������������������������������������0000644�0000000�0000000�00000006603�13375124437�011776� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# lib-ld.m4 serial 4 (gettext-0.18) dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) acl_cv_prog_gnu_ld=yes ;; *) acl_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], [AC_ARG_WITH([gnu-ld], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT([$LD]) else AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) �����������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/lib-link.m4�������������������������������������������������������������������������0000644�0000000�0000000�00000100202�13375124437�012322� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# lib-link.m4 serial 21 (gettext-0.18) dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/nls.m4������������������������������������������������������������������������������0000644�0000000�0000000�00000002315�13375124437�011423� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������goaccess-1.3/m4/po.m4�������������������������������������������������������������������������������0000644�0000000�0000000�00000044616�13375124437�011257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# po.m4 serial 17 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat <<EOT $* EOT } gt_echo='echo_func' fi fi # A sed script that extracts the value of VARIABLE from a Makefile. sed_x_variable=' # Test if the hold space is empty. x s/P/P/ x ta # Yes it was empty. Look if we have the expected variable definition. /^[ ]*VARIABLE[ ]*=/{ # Seen the first line of the variable definition. s/^[ ]*VARIABLE[ ]*=// ba } bd :a # Here we are processing a line from the variable definition. # Remove comment, more precisely replace it with a space. s/#.*$/ / # See if the line ends in a backslash. tb :b s/\\$// # Print the line, without the trailing backslash. p tc # There was no trailing backslash. The end of the variable definition is # reached. Clear the hold space. s/^.*$// x bd :c # A trailing backslash means that the variable definition continues in the # next line. Put a nonempty string into the hold space to indicate this. s/^.*$/P/ x :d ' changequote([,])dnl # Set POTFILES to the value of the Makefile variable POTFILES. sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` # Compute POTFILES_DEPS as # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS= for file in $POTFILES; do POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file" done POMAKEFILEDEPS="" if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) # Compute PROPERTIESFILES # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) # Compute CLASSFILES # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) # Compute QMFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) # Compute MSGFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) # Compute RESOURCESDLLFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= PROPERTIESFILES= CLASSFILES= QMFILES= MSGFILES= RESOURCESDLLFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" QMFILES="$QMFILES $srcdirpre$lang.qm" frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= JAVACATALOGS= QTCATALOGS= TCLCATALOGS= CSHARPCATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties" QTCATALOGS="$QTCATALOGS $lang.qm" frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" done fi sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <<EOF $frobbedlang.msg: $lang.po @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } EOF done fi if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <<EOF $frobbedlang/\$(DOMAIN).resources.dll: $lang.po @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } EOF done fi if test -n "$POMAKEFILEDEPS"; then cat >> "$ac_file.tmp" <<EOF Makefile: $POMAKEFILEDEPS EOF fi mv "$ac_file.tmp" "$ac_file" ]) dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. AC_DEFUN([AM_XGETTEXT_OPTION_INIT], [ XGETTEXT_EXTRA_OPTIONS= ]) dnl Registers an option to be passed to xgettext in the po subdirectory. AC_DEFUN([AM_XGETTEXT_OPTION], [ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" ]) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������