commit logtop for openSUSE:Factory
Hello community, here is the log from the commit of package logtop for openSUSE:Factory checked in at 2018-12-31 09:47:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/logtop (Old) and /work/SRC/openSUSE:Factory/.logtop.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "logtop" Mon Dec 31 09:47:28 2018 rev:3 rq:662117 version:0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/logtop/logtop.changes 2018-11-22 13:26:52.589915302 +0100 +++ /work/SRC/openSUSE:Factory/.logtop.new.28833/logtop.changes 2018-12-31 09:48:03.886134079 +0100 @@ -1,0 +2,9 @@ +Sun Dec 30 21:21:20 UTC 2018 - sogal@opensuse.org + +- Updated to v0.7 + * applied ncursesw patch + * allow UTF-8 to pass thrue + * README written in markdown +- Dropped logtop-ncursesw.patch (applied upstream gh-PR#7) + +------------------------------------------------------------------- Old: ---- logtop-0.6.tar.gz logtop-ncursesw.patch New: ---- logtop-0.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ logtop.spec ++++++ --- /var/tmp/diff_new_pack.f76bOi/_old 2018-12-31 09:48:04.274133761 +0100 +++ /var/tmp/diff_new_pack.f76bOi/_new 2018-12-31 09:48:04.274133761 +0100 @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: logtop -Version: 0.6 +Version: 0.7 Release: 0 Summary: Statistics generator for logs License: BSD-2-Clause @@ -25,17 +25,18 @@ URL: https://julienpalard.github.io/logtop/ Source: https://github.com/JulienPalard/logtop/archive/%{name}-%{version}.tar.gz BuildRequires: make +BuildRequires: pkgconfig BuildRequires: uthash-devel BuildRequires: pkgconfig(ncursesw) -Patch0: logtop-ncursesw.patch %description Logtop is a basic log analyzer. It allows piping logs into it to obtain statistics. %prep + %setup -q -n %{name}-%{name}-%{version} -%patch0 -p1 + %build export CFLAGS="%{optflags}" make %{?_smp_mflags} @@ -45,7 +46,7 @@ install -D -m0644 doc/logtop.1 %{buildroot}%{_mandir}/man1/%{name}.1 %files -%doc ChangeLog README +%doc ChangeLog README.md %license COPYRIGHT %{_bindir}/%{name} %{_mandir}/man1/%{name}.1%{?ext_man} ++++++ logtop-0.6.tar.gz -> logtop-0.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/.gitignore new/logtop-logtop-0.7/.gitignore --- old/logtop-logtop-0.6/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/logtop-logtop-0.7/.gitignore 2018-12-26 14:58:31.000000000 +0100 @@ -0,0 +1,5 @@ +examples/example1 +liblogtop.* +logtop +src/*.o +src/libavl/*.o \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/ChangeLog new/logtop-logtop-0.7/ChangeLog --- old/logtop-logtop-0.6/ChangeLog 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/ChangeLog 2018-12-26 14:58:31.000000000 +0100 @@ -1,3 +1,87 @@ +2013-08-10 18:04:37 +0200 Julien Palard <julien@eeple.fr> + + * Documentation and example of the Python API + +2013-08-10 17:45:24 +0200 Julien Palard <julien@eeple.fr> + + * Documentation and example of the C API + +2013-08-10 17:44:12 +0200 Julien Palard <julien@eeple.fr> + + * FIX: Style + +2013-08-10 17:44:01 +0200 Julien Palard <julien@eeple.fr> + + * NEW: delete_logtop_state + +2013-08-10 17:43:32 +0200 Julien Palard <julien@eeple.fr> + + * FIX: Makefile to build liblogtop. + +2013-07-26 10:07:37 +0200 Julien Palard <julien@palard.fr> + + * Version from Makefile + +2013-07-26 09:57:55 +0200 Julien Palard <julien@palard.fr> + + * FIX: Memory leak in python binding + +2013-04-12 11:23:33 +0200 Julien Palard <julien@palard.fr> + + * Adding some doc about python module dependencies + +2013-03-20 11:36:33 +0100 Julien Palard <julien@palard.fr> + + * NEW: Give also global frequency to python module + +2013-03-20 11:30:08 +0100 Julien Palard <julien@palard.fr> + + * NEW: Give frequency of every lines to python module + +2013-03-20 10:01:36 +0100 Julien Palard <julien@palard.fr> + + * FIX: Continue to increment time when no new lines are fed + +2013-03-20 09:54:29 +0100 Julien Palard <julien@palard.fr> + + * Cleaning .pyc files + +2013-03-20 09:54:21 +0100 Julien Palard <julien@palard.fr> + + * Adding a test file for python module + +2013-03-19 18:43:40 +0100 Julien Palard <julien@palard.fr> + + * Do not give simplified representation of the string to python, seems useless. + +2013-03-14 00:28:52 +0100 Julien Palard <julien@palard.fr> + + * Adding python module via swig + +2013-03-14 00:25:40 +0100 Julien Palard <julien@palard.fr> + + * Simplier to use a struct for swig + +2013-03-13 23:37:58 +0100 Julien Palard <julien@palard.fr> + + * Adding a logtop_get function + +2013-03-13 23:11:18 +0100 Julien Palard <julien@palard.fr> + + * Provide a logtop_delete function, renames for consistency + +2013-03-13 19:11:18 +0100 Julien Palard <julien@palard.fr> + + * Renaming frequency -> logtop, more consistent + +2013-03-13 19:06:24 +0100 Julien Palard <julien@palard.fr> + + * Renaming logtop -> main (see next commit) + +2013-03-13 18:34:34 +0100 Julien Palard <julien@palard.fr> + + * Splitting code, first step to provide a lib_logtop. + 2012-11-17 23:48:35 +0100 Julien Palard <julien@palard.fr> * UPDATE: Display improvment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/Makefile new/logtop-logtop-0.7/Makefile --- old/logtop-logtop-0.6/Makefile 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/Makefile 2018-12-26 14:58:31.000000000 +0100 @@ -5,26 +5,31 @@ ## Login <logtop@mandark.fr> ## -VERSION = 0.6 +VERSION = 0.7.0 MINOR = 0 RELEASE = 0 NAME = logtop -LINKERNAME = lib$(NAME).so +UNAME=$(shell uname -s) +ifeq ($(UNAME),Darwin) + LINKERNAME = lib$(NAME).dylib +else + LINKERNAME = lib$(NAME).so +endif SONAME=$(LINKERNAME).$(VERSION) REALNAME=$(SONAME).$(MINOR).$(RELEASE) -LIB_SRC = src/avl.c src/history.c src/curses.c \ - src/stdout.c src/logtop.c src/libavl/avl.c -SRC = $(LIB_SRC) src/main.c +LIB_SRC = src/avl.c src/history.c \ + src/logtop.c src/libavl/avl.c +SRC = $(LIB_SRC) src/curses.c src/stdout.c src/main.c LIB_OBJ = $(LIB_SRC:.c=.o) OBJ = $(SRC:.c=.o) CC = gcc -INCLUDE = . -LIB = -lncurses #-lefence -CFLAGS = -O3 -Wall -fPIC -Wextra -ansi -pedantic -Wstrict-prototypes -I$(INCLUDE) +override INCLUDE += . +LIB = $(shell pkg-config --libs ncursesw) #-lefence +CFLAGS += -O3 -Wall -fPIC -Wextra -pedantic -Wstrict-prototypes -I$(INCLUDE) $(shell pkg-config --cflags ncursesw) RM = rm -fr LDFLAGS = @@ -32,7 +37,7 @@ $(CC) -o $(NAME) $(OBJ) $(LIB) $(LDFLAGS) lib$(NAME): $(LIB_OBJ) - $(CC) --shared -o $(LINKERNAME) $(OBJ) $(LIB) $(LDFLAGS) + $(CC) $(CFLAGS) --shared -o $(LINKERNAME) $(OBJ) $(LIB) $(LDFLAGS) install: $(NAME) mkdir -p $(DESTDIR)/usr/bin/ @@ -42,6 +47,10 @@ swig -python *.i python ./setup.py build_ext --inplace +python3-module: + swig -python *.i + python3 ./setup.py build_ext --inplace + all: @make $(NAME) @make lib$(NAME) @@ -51,7 +60,7 @@ clean: $(RM) $(NAME) src/*~ src/#*# src/*.o src/*.core \ - src/libavl/*.o _logtop.so liblogtop.so \ + src/libavl/*.o _logtop.* liblogtop.* \ logtop.py *.pyc build/ logtop_wrap.c re: clean all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/README new/logtop-logtop-0.7/README --- old/logtop-logtop-0.6/README 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -For copyright information, please see the file COPYRIGHT in this -directory or in the files of the source tree. - -This project was initiated on 2010-06-29 by Palard Julien -See http://julien.palard.fr or ask me questions at : -julien at palard in fr - -Compile dependencies : - You will need : - Package: libncurses5-dev - Version: 5.7+20100313-1 - $ aptitude install libncurses5-dev uthash-dev - - Then, to compile just type : - $ make - -Run : - You will need : - $ aptitude install libncurses5 - $ ./logtop - -Usage : - logtop displays real-time count of strings recieved in standard input. - I's useful for some cases, like getting the IP flooding your server : - $ tail -f /var/log/apache2/access.log | cut -d' ' -f1 | logtop - - Or the top buzzing article of your blog : - $ tail -f /var/log/apache2/access.log | cut -d' ' -f7 | grep article | logtop - - -Development : - I use a hashtable to store strings and an AVL tree to store frequencies, - so I can fetch by string or fetch ordered by frequency to display the - top-strings. - -About libavl: - The libavl used here is the Ben Pfaff's one, statically build with logtop, as - Ben want it to be (see INSTALL file and here : - http://lists.debian.org/debian-devel/2001/07/msg01303.html) - So this libavl is NOT packaged as a library for Debian, the libavl you'll - found in Debian repositories is the Wessel Dankers's one. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/README.md new/logtop-logtop-0.7/README.md --- old/logtop-logtop-0.6/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/logtop-logtop-0.7/README.md 2018-12-26 14:58:31.000000000 +0100 @@ -0,0 +1,125 @@ +# Install + +## Debian / Debian based + +``` +apt install logtop +``` + + +## Void Linux + +``` +xbps-install -S logtop +``` + + +## From sources + +Compile dependencies: `libncursesw5-dev`, `uthash-dev`. + +So on a Debian: + +```bash session +$ sudo apt install libncursesw5-dev uthash-dev +Reading package lists... Done +[...skipped for readability...] +Processing triggers for man-db (2.8.2-1) ... +$ make +gcc -c -O3 -DVERSION=0.7.0 -Wall -fPIC -Wextra -ansi -pedantic -Wstrict-prototypes -I. src/avl.c -o src/avl.o +[...skipped for readability...] +$ make install +``` + +# Usage + +`logtop` displays a real-time count of strings received from stdin. +It can be useful in some cases, like getting the IP flooding your server: + +```bash session +$ tail -f /var/log/apache2/access.log | cut -d' ' -f1 | logtop +``` + +Or the top buzzing article of your blog: + +```bash session +$ tail -f /var/log/apache2/access.log | cut -d' ' -f7 | grep article | logtop +``` + + +# Python bindings + +Dependencies: `python-dev`, `swig`. + +```bash session +$ sudo apt install python-dev swig +Reading package lists... Done +[...] +$ make python-module +[...] +$ python setup.py install +``` + + +# Development + +I use a hashtable to store strings and an AVL tree to store frequencies, +so I can fetch by string or fetch ordered by frequency to display the +top-strings. + + +# C API + +Logtop can be used by your C programs, you may to compile against +logtop's sources (`src/{avl.c,history.c,logtop.c,libavl/avl.c}`) or +against `liblogtop`, obtained using `make liblogtop`. + +C API is described in `logtop.h`, you need: + +```C +struct logtop *new_logtop(size_t history_size); +void delete_logtop(struct logtop *this); +void logtop_feed(struct logtop *this, char *line); +struct logtop_state *logtop_get(struct logtop *this, size_t qte); +double logtop_timespan(struct logtop *this); +unsigned int logtop_qte_of_elements(struct logtop *this); +``` + +You can find an example of using the C API in `examples/example1.c`. + + +# Python API + +`logtop` module exposes a logtop class containing: + +```Python +logtop.__init__(history_size) # to build a new logtop keeping + # at most history_size lines. +logtop.feed(line) # to feed a new line in logtop. +logtop.get(qte_of_elements) # to get the top qte_of_elements lines. +logtop.qte_of_elements() # to get the current total number of lines. +logtop.timespan() # to get the duration from the oldest line to now. +``` + +timespan may be less than the runtime, as logtop drop old lines, +to keep, at most, `history_size` lines, given in the constructor of +the logtop class. + + +# About libavl + +The libavl used here is the Ben Pfaff's one, statically build with logtop, as +Ben want it to be (see INSTALL file and here: +http://lists.debian.org/debian-devel/2001/07/msg01303.html) +So this libavl is NOT packaged as a library for Debian, the libavl you'll +found in Debian repositories is the Wessel Dankers's one. + + +# About the project + +For copyright information, please see the file COPYRIGHT in this +directory or in the files of the source tree. + +This project was initiated on 2010-06-29 by Palard Julien +See http://julien.palard.fr or ask me questions at : +julien at palard dot fr. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/examples/example1.c new/logtop-logtop-0.7/examples/example1.c --- old/logtop-logtop-0.6/examples/example1.c 1970-01-01 01:00:00.000000000 +0100 +++ new/logtop-logtop-0.7/examples/example1.c 2018-12-26 14:58:31.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010 Julien Palard. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + +This example is a basic demo of logtop C API. +You may compile it using : +$ cd examples +$ cc example1.c ../src/{avl.c,history.c,logtop.c,libavl/avl.c} -o example1 + +or + +$ make liblogtop +$ cd examples +$ cc example1.c -llogtop -L.. -o example1 +$ LD_LIBRARY_PATH=.. ./example1 + +*/ + +#include <unistd.h> +#include <stdio.h> +#include "../src/logtop.h" + +int main() +{ + struct logtop *logtop; + struct logtop_state *state; + unsigned int i; + + logtop = new_logtop(10000); /* Don't keep more than 10k elements */ + + logtop_feed(logtop, "foo"); + logtop_feed(logtop, "bar"); + logtop_feed(logtop, "foo"); + logtop_feed(logtop, "bar"); + + logtop_feed(logtop, "baz"); + logtop_feed(logtop, "baz"); + logtop_feed(logtop, "baz"); + + state = logtop_get(logtop, 10); /* Get the top 10 */ + + printf("%d lines seen during %.2fs (%.2f lines/s):\n", + state->count, + state->timespan, + state->frequency); + i = 0; + while (state->lines[i] != NULL) + { + printf(" \"%s\" seen %d times (%.2f lines/s)\n", + state->lines[i]->string, + state->lines[i]->count, + state->lines[i]->frequency); + i += 1; + } + delete_logtop_state(state); + delete_logtop(logtop); + return EXIT_SUCCESS; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/examples/example1.py new/logtop-logtop-0.7/examples/example1.py --- old/logtop-logtop-0.6/examples/example1.py 1970-01-01 01:00:00.000000000 +0100 +++ new/logtop-logtop-0.7/examples/example1.py 2018-12-26 14:58:31.000000000 +0100 @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import pprint +import sys +from logtop import logtop + + +""" +This example show a complete usage of the python API, +It can be used like this: + +$ make python-module +$ python3 -m venv logtop_venv +$ . logtop_venv/bin/activate +$ python3 -m pip install . +$ +$ cat /etc/passwd | cut -d: -f7 | python3 examples/example1.py + +""" + +l = logtop(10000) +for line in sys.stdin: + l.feed(line) + +pprint.pprint(l.get(10)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/logtop.i new/logtop-logtop-0.7/logtop.i --- old/logtop-logtop-0.6/logtop.i 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/logtop.i 2018-12-26 14:58:31.000000000 +0100 @@ -9,6 +9,7 @@ int i; PyObject *log_line; PyObject *lines; + PyObject *tmp; $result = PyDict_New(); lines = PyList_New(0); @@ -19,14 +20,21 @@ PyTuple_SetItem(log_line, 1, PyFloat_FromDouble(result->lines[i]->frequency)); PyTuple_SetItem(log_line, 2, PyString_FromString(result->lines[i]->string)); PyList_Append(lines, log_line); + Py_DECREF(log_line); i++; } PyDict_SetItemString($result, "lines", lines); - PyDict_SetItemString($result, "count", PyInt_FromLong(result->count)); - PyDict_SetItemString($result, "timespan", PyFloat_FromDouble(result->timespan)); - PyDict_SetItemString($result, "frequency", PyFloat_FromDouble(result->frequency)); - free(result->lines); - free(result); + Py_DECREF(lines); + tmp = PyInt_FromLong(result->count); + PyDict_SetItemString($result, "count", tmp); + Py_DECREF(tmp); + tmp = PyFloat_FromDouble(result->timespan); + PyDict_SetItemString($result, "timespan", tmp); + Py_DECREF(tmp); + tmp = PyFloat_FromDouble(result->frequency); + PyDict_SetItemString($result, "frequency", tmp); + Py_DECREF(tmp); + delete_logtop_state(result); } struct logtop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/setup.py new/logtop-logtop-0.7/setup.py --- old/logtop-logtop-0.6/setup.py 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/setup.py 2018-12-26 14:58:31.000000000 +0100 @@ -8,17 +8,26 @@ logtop_module = Extension('_logtop', - sources=['logtop_wrap.c', - 'src/logtop.c', - 'src/avl.c', - 'src/history.c', - 'src/libavl/avl.c'] - ) + sources=['logtop_wrap.c', + 'src/logtop.c', + 'src/avl.c', + 'src/history.c', + 'src/libavl/avl.c']) -setup (name = 'logtop', - version = '0.1', - author = "Julien Palard", - description = """Live line frequency analyzer""", - ext_modules = [logtop_module], - py_modules = ["logtop"], - ) +setup(name='logtop', + version='0.2', + author="Julien Palard", + author_email="julien@palard.fr", + description="""Live line frequency analyzer""", + long_description="""logtop is a System Administrator tool analyzing line + rate on stdin. It reads on stdin and print a constantly updated result + displaying, in columns: Line number, count, frequency, + and the actual line.""", + keywords=['log', 'top', 'lines', 'analyzer', 'nginx', 'apache', + 'varnish', 'tail'], + url='https://github.com/JulienPalard/logtop', + classifiers=['Development Status :: 5 - Production/Stable', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: BSD License'], + ext_modules=[logtop_module], + py_modules=["logtop"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/src/avl.c new/logtop-logtop-0.7/src/avl.c --- old/logtop-logtop-0.6/src/avl.c 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/src/avl.c 2018-12-26 14:58:31.000000000 +0100 @@ -63,7 +63,7 @@ if (clean == NULL) return NULL; for (i = 0; clean[i] != '\0'; ++i) - if (clean[i] < ' ' || clean[i] > '~') + if (clean[i] > 0 && clean[i] < ' ') clean[i] = '.'; return clean; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/src/logtop.c new/logtop-logtop-0.7/src/logtop.c --- old/logtop-logtop-0.6/src/logtop.c 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/src/logtop.c 2018-12-26 14:58:31.000000000 +0100 @@ -92,6 +92,12 @@ return NULL; } +void delete_logtop_state(struct logtop_state *this) +{ + free(this->lines); + free(this); +} + double logtop_timespan(struct logtop *this) { history_element_t *oldest_element; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/src/logtop.h new/logtop-logtop-0.7/src/logtop.h --- old/logtop-logtop-0.6/src/logtop.h 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/src/logtop.h 2018-12-26 14:58:31.000000000 +0100 @@ -80,10 +80,12 @@ void (*visitor)(void *data, int index, void *user_data), void *user_data); -struct logtop*new_logtop(size_t history_size); +struct logtop *new_logtop(size_t history_size); void delete_logtop(struct logtop *this); void logtop_feed(struct logtop *this, char *line); struct logtop_state *logtop_get(struct logtop *this, size_t qte); +void delete_logtop_state(struct logtop_state *this); double logtop_timespan(struct logtop *this); unsigned int logtop_qte_of_elements(struct logtop *this); + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/logtop-logtop-0.6/src/main.c new/logtop-logtop-0.7/src/main.c --- old/logtop-logtop-0.6/src/main.c 2013-03-20 11:36:33.000000000 +0100 +++ new/logtop-logtop-0.7/src/main.c 2018-12-26 14:58:31.000000000 +0100 @@ -29,6 +29,7 @@ #include <stdio.h> #include <signal.h> #include <getopt.h> +#include <locale.h> #include "main.h" env_t gl_env; @@ -114,7 +115,9 @@ static void version_and_exit(void) { - fprintf(stdout, "logtop v0.2.2\n"); +#define stringify(v) #v +#define concat_version(v) "logtop v" stringify(v) "\n" + fprintf(stdout, concat_version(VERSION)); exit(EXIT_SUCCESS); } @@ -192,6 +195,7 @@ int main(int ac, char **av) { + setlocale(LC_ALL, ""); parse_args(ac, av); setup_sighandler(SIGINT, 0, on_sigint); setup_sighandler(SIGALRM, SA_RESTART, update_display);
participants (1)
-
root