libcmdline.git
12 years agocmdline: new build system master
Olivier Matz [Fri, 17 Feb 2012 19:20:31 +0000 (20:20 +0100)]
cmdline: new build system

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: specify to use stdout for output when parsing a file
Olivier Matz [Thu, 27 Oct 2011 20:46:15 +0000 (22:46 +0200)]
cmdline: specify to use stdout for output when parsing a file

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: break the interact loop if it returns EOF
Olivier Matz [Thu, 27 Oct 2011 20:45:02 +0000 (22:45 +0200)]
cmdline: break the interact loop if it returns EOF

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: don't display prompt if stopped by user
Olivier Matz [Thu, 27 Oct 2011 20:44:38 +0000 (22:44 +0200)]
rdline: don't display prompt if stopped by user

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: don't include '\n' in rdline buffer when user validates
Olivier Matz [Sun, 31 Jul 2011 19:51:59 +0000 (21:51 +0200)]
rdline: don't include '\n' in rdline buffer when user validates

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agoexamples: add getopt argument parsing for client and server
Olivier Matz [Sun, 31 Jul 2011 19:48:13 +0000 (21:48 +0200)]
examples: add getopt argument parsing for client and server

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agomisc: fix compilation with new gcc (unused variables warnings)
Olivier Matz [Fri, 29 Jul 2011 18:45:11 +0000 (20:45 +0200)]
misc: fix compilation with new gcc (unused variables warnings)

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: parse ip/ether addr, don't write in result if NULL
Olivier Matz [Thu, 30 Jun 2011 16:21:17 +0000 (18:21 +0200)]
cmdline: parse ip/ether addr, don't write in result if NULL

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: save return status before paging, and return it once finished
Olivier Matz [Sun, 8 May 2011 16:02:09 +0000 (18:02 +0200)]
rdline: save return status before paging, and return it once finished

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: basic support of completion for nodes starting with "//"
Olivier Matz [Sun, 8 May 2011 16:00:54 +0000 (18:00 +0200)]
genconf: basic support of completion for nodes starting with "//"

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: "comment" nodes don't have name, add the flag
Olivier Matz [Sun, 8 May 2011 16:00:01 +0000 (18:00 +0200)]
genconf: "comment" nodes don't have name, add the flag

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: display prompt and previous command after pager
Olivier Matz [Sun, 8 May 2011 15:32:49 +0000 (17:32 +0200)]
cmdline: display prompt and previous command after pager

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: clear line when exiting pager
Olivier Matz [Fri, 6 May 2011 10:16:57 +0000 (12:16 +0200)]
cmdline: clear line when exiting pager

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline-examples: remove basic_char_loop() and use cmdline_interact()
Olivier Matz [Fri, 6 May 2011 10:11:51 +0000 (12:11 +0200)]
cmdline-examples: remove basic_char_loop() and use cmdline_interact()

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agoevent_server: add an example that uses libevent
Olivier Matz [Fri, 18 Mar 2011 09:06:52 +0000 (10:06 +0100)]
event_server: add an example that uses libevent

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: fix buffer when user validates with the cursor at the middle
Olivier Matz [Sun, 13 Mar 2011 17:39:22 +0000 (18:39 +0100)]
rdline: fix buffer when user validates with the cursor at the middle

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: add an opaque pointer in cmdline
Olivier Matz [Sun, 13 Mar 2011 17:29:11 +0000 (18:29 +0100)]
cmdline: add an opaque pointer in cmdline

this pointer is never modified by lib, it can be modified by the user
to store some interresting value.

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: update TODO file
Olivier Matz [Sun, 13 Mar 2011 09:55:09 +0000 (10:55 +0100)]
cmdline: update TODO file

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: support pager during completion
Olivier Matz [Sun, 13 Mar 2011 09:48:46 +0000 (10:48 +0100)]
rdline: support pager during completion

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agotrivial_rdline: use the pager in this example
Olivier Matz [Fri, 11 Mar 2011 19:41:19 +0000 (20:41 +0100)]
trivial_rdline: use the pager in this example

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agordline: add a pager that can be used by user-defined commands
Olivier Matz [Fri, 11 Mar 2011 19:40:27 +0000 (20:40 +0100)]
rdline: add a pager that can be used by user-defined commands

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agotrivial_rdline: rename binary
Olivier Matz [Fri, 11 Mar 2011 19:29:22 +0000 (20:29 +0100)]
trivial_rdline: rename binary

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: use the new file token for load/save
Olivier Matz [Mon, 21 Feb 2011 23:00:13 +0000 (00:00 +0100)]
genconf: use the new file token for load/save

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: add a new 'file' token
Olivier Matz [Mon, 21 Feb 2011 22:59:47 +0000 (23:59 +0100)]
cmdline: add a new 'file' token

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: display "[Return]" when there is no more token to complete
Olivier Matz [Mon, 21 Feb 2011 22:59:14 +0000 (23:59 +0100)]
cmdline: display "[Return]" when there is no more token to complete

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: parse() method does not return token_len anymore
Olivier Matz [Mon, 21 Feb 2011 22:58:38 +0000 (23:58 +0100)]
cmdline: parse() method does not return token_len anymore

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdine:: allow non-final completion (will be used by file token)
Olivier Matz [Sun, 20 Feb 2011 16:58:40 +0000 (17:58 +0100)]
cmdine:: allow non-final completion (will be used by file token)

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: fix memory corruption in error cases
Olivier Matz [Sun, 20 Feb 2011 16:58:01 +0000 (17:58 +0100)]
genconf: fix memory corruption in error cases

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: fix completion in some conditions (partial token len > 1)
Olivier Matz [Sun, 20 Feb 2011 16:57:29 +0000 (17:57 +0100)]
cmdline: fix completion in some conditions (partial token len > 1)

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: add the incomplete token string as an argument of iter_start()
Olivier Matz [Fri, 18 Feb 2011 17:33:44 +0000 (18:33 +0100)]
cmdline: add the incomplete token string as an argument of iter_start()

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: display help and completion on different lines
Olivier Matz [Fri, 18 Feb 2011 17:18:36 +0000 (18:18 +0100)]
cmdline: display help and completion on different lines

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: display help even if iterate() callback return -1
Olivier Matz [Fri, 18 Feb 2011 17:04:14 +0000 (18:04 +0100)]
cmdline: display help even if iterate() callback return -1

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: fix crash in confnode token completion
Olivier Matz [Fri, 18 Feb 2011 17:02:31 +0000 (18:02 +0100)]
genconf: fix crash in confnode token completion

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: add trivial_rdline example
Olivier Matz [Fri, 11 Feb 2011 21:43:56 +0000 (22:43 +0100)]
cmdline: add trivial_rdline example

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: big rework and clean of cmdline library
Olivier Matz [Sat, 25 Dec 2010 18:36:01 +0000 (19:36 +0100)]
cmdline: big rework and clean of cmdline library

The main change is that we use the same structure to define a token.
The old method (parse, complete_get_nb, complete_get_elt, get_help) is
deprecated. We now have (parse, complete_start, complete_iterate,
complete_end, help) that will allow to do more complex tokens, like
a file token with completion.

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: check size of result buffer to avoid overflow
Olivier Matz [Sun, 2 Jan 2011 18:45:51 +0000 (19:45 +0100)]
cmdline: check size of result buffer to avoid overflow

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: use a macro for maximum token size
Olivier Matz [Sun, 2 Jan 2011 18:44:04 +0000 (19:44 +0100)]
cmdline: use a macro for maximum token size

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: allow quoted strings
Olivier Matz [Tue, 28 Dec 2010 22:49:35 +0000 (23:49 +0100)]
cmdline: allow quoted strings

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: rename return values of vt100
Olivier Matz [Sat, 25 Dec 2010 18:11:36 +0000 (19:11 +0100)]
cmdline: rename return values of vt100

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agocmdline: fix prototype of cmdline_tcpv6_listen() in header
Olivier Matz [Sat, 25 Dec 2010 17:47:09 +0000 (18:47 +0100)]
cmdline: fix prototype of cmdline_tcpv6_listen() in header

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: fix dotconfig_write methods
Olivier Matz [Fri, 24 Dec 2010 12:16:18 +0000 (13:16 +0100)]
genconf: fix dotconfig_write methods

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: a menu confnode is always enabled
Olivier Matz [Fri, 24 Dec 2010 12:16:02 +0000 (13:16 +0100)]
genconf: a menu confnode is always enabled

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: properly read the value of the "if" node
Olivier Matz [Fri, 24 Dec 2010 12:15:30 +0000 (13:15 +0100)]
genconf: properly read the value of the "if" node

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: in choice node, when value is "", it means no value
Olivier Matz [Fri, 24 Dec 2010 12:14:56 +0000 (13:14 +0100)]
genconf: in choice node, when value is "", it means no value

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: take quote in account in confnode_set_user_strvalue()
Olivier Matz [Fri, 24 Dec 2010 12:14:10 +0000 (13:14 +0100)]
genconf: take quote in account in confnode_set_user_strvalue()

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: enhance short and long display of confnodes
Olivier Matz [Fri, 24 Dec 2010 12:13:25 +0000 (13:13 +0100)]
genconf: enhance short and long display of confnodes

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: fix path display (no slash at the end)
Olivier Matz [Fri, 24 Dec 2010 12:10:13 +0000 (13:10 +0100)]
genconf: fix path display (no slash at the end)

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: properly check retval of confnode_strvalue_to_boolvalue()
Olivier Matz [Fri, 24 Dec 2010 12:05:16 +0000 (13:05 +0100)]
genconf: properly check retval of confnode_strvalue_to_boolvalue()

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: enable long and short display of nodes
Olivier Matz [Fri, 24 Dec 2010 11:46:36 +0000 (12:46 +0100)]
genconf: enable long and short display of nodes

Signed-off-by: Olivier Matz <zer0@droids-corp.org>
13 years agogenconf: typo and comments
Olivier Matz [Fri, 24 Dec 2010 11:46:17 +0000 (12:46 +0100)]
genconf: typo and comments

13 years agocmdline: support parsing of 64-bit values
Olivier Matz [Sun, 2 Jan 2011 20:34:00 +0000 (21:34 +0100)]
cmdline: support parsing of 64-bit values

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
13 years agocmdline (merge-intel): don't free the cmdline struct in cmdline_interact()
Olivier Matz [Fri, 24 Dec 2010 12:56:30 +0000 (13:56 +0100)]
cmdline (merge-intel): don't free the cmdline struct in cmdline_interact()

This function is not supposed to free the 'cl' structure, as it may
be reused by cmdline_stdin_exit().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix format string in snprintf()
Olivier Matz [Fri, 24 Dec 2010 12:56:26 +0000 (13:56 +0100)]
cmdline (merge-intel): fix format string in snprintf()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): add new bindings; ctrl-p, ctrl-n, alt-d
Olivier Matz [Fri, 24 Dec 2010 12:56:21 +0000 (13:56 +0100)]
cmdline (merge-intel): add new bindings; ctrl-p, ctrl-n, alt-d

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix warnings when compiing with -D_FORTIFY_SOURCE=2
Olivier Matz [Fri, 24 Dec 2010 12:56:16 +0000 (13:56 +0100)]
cmdline (merge-intel): fix warnings when compiing with -D_FORTIFY_SOURCE=2

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): don't limit output len of cmdline_printf()
Olivier Matz [Fri, 24 Dec 2010 12:56:06 +0000 (13:56 +0100)]
cmdline (merge-intel): don't limit output len of cmdline_printf()

It was using a big buffer in stack. Now use vdprintf() if _GNU_SOURCE
is defined, or a malloc + free if not.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): reverse compilation flags for floats and socket
Olivier Matz [Fri, 24 Dec 2010 12:55:43 +0000 (13:55 +0100)]
cmdline (merge-intel): reverse compilation flags for floats and socket

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): support ctrl-w in librte_cmdline
Olivier Matz [Fri, 24 Dec 2010 12:55:33 +0000 (13:55 +0100)]
cmdline (merge-intel): support ctrl-w in librte_cmdline

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix display of last char when using backspace
Olivier Matz [Fri, 24 Dec 2010 12:55:28 +0000 (13:55 +0100)]
cmdline (merge-intel): fix display of last char when using backspace

This was introduced by previous commit on this file.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): don't display control character at the end of line
Olivier Matz [Fri, 24 Dec 2010 12:55:19 +0000 (13:55 +0100)]
cmdline (merge-intel): don't display control character at the end of line

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): add cmdline_quit()
Olivier Matz [Fri, 24 Dec 2010 12:55:04 +0000 (13:55 +0100)]
cmdline (merge-intel): add cmdline_quit()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): cosmetic fixes, conform to coding rules
Olivier Matz [Fri, 24 Dec 2010 12:54:37 +0000 (13:54 +0100)]
cmdline (merge-intel): cosmetic fixes, conform to coding rules

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): remove duplicated definitions of vt100 codes
Olivier Matz [Fri, 24 Dec 2010 12:54:34 +0000 (13:54 +0100)]
cmdline (merge-intel): remove duplicated definitions of vt100 codes

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): replace harcoded return values with defines
Olivier Matz [Fri, 24 Dec 2010 12:54:31 +0000 (13:54 +0100)]
cmdline (merge-intel): replace harcoded return values with defines

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): move basic_char_loop() in cmdline lib, as cmdline_interact()
Olivier Matz [Fri, 24 Dec 2010 12:54:25 +0000 (13:54 +0100)]
cmdline (merge-intel): move basic_char_loop() in cmdline lib, as cmdline_interact()

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix compilation with icc
Olivier Matz [Fri, 24 Dec 2010 12:54:22 +0000 (13:54 +0100)]
cmdline (merge-intel): fix compilation with icc

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): compilation under baremetal environment
Olivier Matz [Fri, 24 Dec 2010 12:54:19 +0000 (13:54 +0100)]
cmdline (merge-intel): compilation under baremetal environment

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): add intel licences
Olivier Matz [Fri, 24 Dec 2010 12:53:59 +0000 (13:53 +0100)]
cmdline (merge-intel): add intel licences

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): use maximum int values defines from stdint.h
Olivier Matz [Fri, 24 Dec 2010 12:53:20 +0000 (13:53 +0100)]
cmdline (merge-intel): use maximum int values defines from stdint.h

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): cmdline: disable float parsing
Olivier Matz [Fri, 24 Dec 2010 12:53:16 +0000 (13:53 +0100)]
cmdline (merge-intel): cmdline: disable float parsing

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix compilation warnings
Olivier Matz [Fri, 24 Dec 2010 12:52:49 +0000 (13:52 +0100)]
cmdline (merge-intel): fix compilation warnings

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agocmdline (merge-intel): fix whitespaces
Olivier Matz [Fri, 24 Dec 2010 12:52:24 +0000 (13:52 +0100)]
cmdline (merge-intel): fix whitespaces

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
13 years agoInitial import from http://www.droids-corp.org/hg/libcmdline/rev/db316e4289a1
Olivier Matz [Fri, 24 Dec 2010 11:35:58 +0000 (12:35 +0100)]
Initial import from droids-corp.org/hg/libcmdline/rev/db316e4289a1

Signed-off-by: Olivier Matz <zer0@droids-corp.org>