[liboping-changes] octo's ping library: Changes to 'master'

Florian Forster octo at verplant.org
Thu Sep 25 01:57:10 CEST 2014


 configure.ac       |   22 ++++--
 src/Makefile.am    |    2 
 src/mans/oping.pod |    5 +
 src/oping.c        |  194 +++++++++++++++++++++++++++++++++++++++++++++++++----
 4 files changed, 207 insertions(+), 16 deletions(-)

New commits:
commit 4710e5477bfa3902b5f5600475ea21c44fabf446
Merge: 7387822 6c682f9
Author: Florian Forster <octo at verplant.org>
Date:   Wed Sep 24 16:55:36 2014 -0700

    Merge branch 'ab/prettyping'

commit 6c682f99f7b995e1c155ab2627687cece54dbfbc
Author: Florian Forster <ff at octo.it>
Date:   Wed Sep 24 16:44:58 2014 -0700

    Make the prettyping output work with and without colors.

commit 94a8bf0d6c869b1e6bde637dd25666d2f4cb7052
Author: Florian Forster <ff at octo.it>
Date:   Fri Jan 10 12:28:02 2014 +0100

    Add support for both, ncurses and ncursesw.

commit 564bf1c1751ffca23848510a8a9559a14b9559ee
Author: Florian Forster <ff at octo.it>
Date:   Fri Dec 6 11:02:35 2013 +0100

    Add documentation for the "-u" and "-U" options.

commit 000eb200d0863e81e34dd19aa44103f2b44c4abe
Author: Florian Forster <ff at octo.it>
Date:   Fri Dec 6 10:52:22 2013 +0100

    src/oping.h: Don't use the ncurses internal _nc_unicode_locale() function.
    
    The "-u" and "-U" options are now handled in a single variable so that the
    last option "wins".

commit a58f361afd7a6e0d2b112806bd280d173faf9bef
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Fri Dec 6 00:16:28 2013 -0500

    add commandline flag for forcing or disabling unicode
    
    note that "forcing" may not work: ncurses still expects your locale to
    be correct, so maybe the force flag should also explicitely set a utf8
    locale?

commit 2dcbbf2cd80f1f2c5b9ce1aed67d28093929ccaa
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Fri Dec 6 00:07:09 2013 -0500

    move unicode detection to a separate function
    
    this will ease transition to a commandline option override

commit c286d66c1ac5fb899040437057b614856c99822d
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Thu Dec 5 23:35:00 2013 -0500

    autodetect unicode, and fallback to ACS scancodes on failure
    
    this is fairly ugly - we use a hidden ncurses function to detect
    unicode (but at least we don't reimplement it), then we mess around
    with the character arrays to display the rights symbols
    
    i am not sure i like this, but i prefer to braindump than to stall, so
    let's move forward.

commit 44e296d605a06a782f4520ace6cb67a2cbe85525
Author: Florian Forster <ff at octo.it>
Date:   Thu Dec 5 18:15:52 2013 +0100

    Refactor the graph printing into its own function.
    
    This makes it much easier and cleaner to add a second, non-Unicode
    implementation and possibly even a non-color version.

commit 317c34a7127472526825a850b03b71b0119a09ed
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Tue Dec 3 00:33:39 2013 -0500

    switch to ncursesw in the build chain

commit 59786b990da7a6c6593cd94ef3384d143940ff91
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 23:15:13 2013 -0500

    better wrapping: add a cursor and respect inner borders

commit faa01e58cd5b3863bc5891c25176ea0ae2d71679
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:57:00 2013 -0500

    rework scaling algorithm so it covers the whole range
    
    i did this after some stress testing, now it covers the whole range on input

commit 3885683edb804a976b89b95d8e5adf041e8912d7
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:32:46 2013 -0500

    cleanup safety checks
    
    make sure that if we go beyond the max ratio, we just mark it as one

commit 00c587beea7459830100c3d7beffdebb6ee316dc
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:32:15 2013 -0500

    wrap around the window once the histogram grows too big

commit d5a3fc99f5587e63e0c80e8a29f8d59430f3b7b9
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:29:53 2013 -0500

    remove a little quirk i introduced by mistake
    
    this was breaking the border

commit f379d7a19072d3fde41b760c5148313cdc210919
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:29:24 2013 -0500

    make histogram colors with a nicer background

commit 36037039417eee9a7feebb723a2272a64438a22a
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:10:41 2013 -0500

    restore usual ping display, now that histograms are in a different window

commit d64c11378cef748cc6697f8e54c0051432153e6d
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 22:06:26 2013 -0500

    put histograms into the independent window, to eventually restore ping times display

commit 68d713ec1a7027113f1fa20df598a63539511593
Author: Antoine Beaupré <anarcat at koumbit.org>
Date:   Mon Dec 2 20:45:58 2013 -0500

    implement some prettyping-inspired display instead of textual
    
    this is a first stab at porting "prettyping.sh" into noping. the idea
    is to show a histogram of ping times instead of numerical values. with
    some work, we could actually show both, but this focuses on
    implementing the hard part (the histogram) properly.
    
    it is very rudimentary for now:
    
     * the math may be wrong for the size of the bar, I was mostly in a
       rush to make unicode work and have something pretty quickly.
    
     * all hosts are on the same line: each should have its own line
    
     * the histogram should be displayed in a separate window
    
     * it should use background colors as well
    
     * it should fallback when the terminal is not unicode-capable
    
     * the scaling logic is fully automatic, which necessarily gives weird
       results at first
    
    this requires switching to the ncursesw library and other unicode
    ncurses hackery described in this post:
    
    http://newsgroups.derkeiler.com/Archive/Rec/rec.games.roguelike.development/2010-09/msg00050.html
    
    pretty ping is a awk/bash script, MIT-licensed, available here:
    
    https://bitbucket.org/denilsonsa/small_scripts/src/tip/prettyping.sh




More information about the liboping-changes mailing list