code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
#ifndef _konf_net_h #define _konf_net_h #include <konf/buf.h> typedef struct konf_client_s konf_client_t; #define KONFD_SOCKET_PATH "/tmp/konfd.socket" konf_client_t *konf_client_new(const char *path); void konf_client_free(konf_client_t *instance); int konf_client_connect(konf_client_t *instance); void konf_client...
zzysjtu-klish
konf/net.h
C
bsd
685
/* * conf_dump.c */ #include "private.h" #include "lub/dump.h" /*--------------------------------------------------------- */ /*void clish_conf_dump(clish_conf_t * this) { clish_command_t *c; lub_bintree_iterator_t iter; unsigned i; lub_dump_printf("view(%p)\n", this); lub_dump_indent(); c = lub_bintree_find...
zzysjtu-klish
konf/tree/tree_dump.c
C
bsd
880
/* * tree.c * * This file provides the implementation of a konf_tree class */ #include "private.h" #include "lub/argv.h" #include "lub/string.h" #include "lub/ctype.h" #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <sys/types.h> #include <regex.h> /*----------------------...
zzysjtu-klish
konf/tree/tree.c
C
bsd
9,942
/* * konf/tree/private.h */ #ifndef _konf_tree_private_h #define _konf_tree_private_h #include "konf/tree.h" #include "lub/types.h" #include "lub/list.h" /*--------------------------------------------------------- * PRIVATE TYPES *--------------------------------------------------------- */ struct konf_tree_s { ...
zzysjtu-klish
konf/tree/private.h
C
bsd
468
#ifndef _konf_query_h #define _konf_query_h #include <lub/types.h> typedef enum { KONF_QUERY_OP_NONE, KONF_QUERY_OP_OK, KONF_QUERY_OP_ERROR, KONF_QUERY_OP_SET, KONF_QUERY_OP_UNSET, KONF_QUERY_OP_STREAM, KONF_QUERY_OP_DUMP } konf_query_op_t; typedef struct konf_query_s konf_query_t; konf_query_t *konf_...
zzysjtu-klish
konf/query.h
C
bsd
1,263
/* * buf.h */ /** \ingroup clish \defgroup clish_conf config @{ \brief This class is a config in memory container. Use it to implement config in memory. */ #ifndef _konf_buf_h #define _konf_buf_h #include <stdio.h> #include <lub/bintree.h> typedef struct konf_buf_s konf_buf_t; /*==============================...
zzysjtu-klish
konf/buf.h
C
bsd
1,443
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> #include <assert.h> #include <sys/socket.h> #include <string.h> #include <sys/un.h> #include "konf/buf.h" #include "konf/query.h" #include "lub/string.h" #include "private.h" /* UNIX socket name ...
zzysjtu-klish
konf/net/net.c
C
bsd
4,639
#ifndef _konf_net_private_h #define _konf_net_private_h #include "konf/net.h" struct konf_client_s { int sock; char *path; }; #endif
zzysjtu-klish
konf/net/private.h
C
bsd
138
#! /bin/sh # Start conf server /usr/bin/konfd >/dev/null 2>/dev/null & # Initialize system with startup-config /usr/bin/clish -x /etc/clish-enable -w configure-view /etc/startup-config
zzysjtu-klish
xml-examples/klish/etc/init.d/klish-init
Shell
bsd
188
/** \ingroup tinyrl \defgroup tinyrl_class tinyrl @{ \brief This class provides instances which are capable of handling user input from a CLI in a "readline" like fashion. */ #ifndef _tinyrl_tinyrl_h #define _tinyrl_tinyrl_h #include <stdio.h> #include "lub/types.h" #include "lub/c_decl.h" #include "tinyrl/history....
zzysjtu-klish
tinyrl/tinyrl.h
C
bsd
7,043
/* * tinyrl.c */ /* make sure we can get fileno() */ #undef __STRICT_ANSI__ /* LIBC HEADERS */ #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <errno.h> /* POSIX HEADERS */ #include <unistd.h> #include "lub/string.h" #include "private.h" /*-------------...
zzysjtu-klish
tinyrl/tinyrl.c
C
bsd
38,140
#undef __STRICT_ANSI__ /* we need to use fileno() */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <sys/select.h> #include <errno.h> #include "private.h" typedef struct { const char* sequ...
zzysjtu-klish
tinyrl/vt100/vt100.c
C
bsd
11,676
#include "tinyrl/vt100.h" struct _tinyrl_vt100 { FILE *istream; FILE *ostream; int timeout; /* Input timeout in seconds */ };
zzysjtu-klish
tinyrl/vt100/private.h
C
bsd
132
/* * vt100.h * * A simple class representing a vt100 terminal */ /** \ingroup tinyrl \defgroup tinyrl_vt100 vt100 @{ \brief A simple class for controlling and interacting with a VT100 compatible terminal. This class has been implemented pragmatically in an as needed fashion, so doesn't support all the features...
zzysjtu-klish
tinyrl/vt100.h
C
bsd
6,361
#include <termios.h> #include "tinyrl/tinyrl.h" #include "tinyrl/vt100.h" /* define the class member data and virtual methods */ struct _tinyrl { const char *line; unsigned max_line_length; char *prompt; size_t prompt_size; /* strlen() */ size_t prompt_len; /* Symbol positions */ char *buffer; size_t buffer_si...
zzysjtu-klish
tinyrl/private.h
C
bsd
1,305
/* tinyrl_history_entry.c */ #include "private.h" #include "lub/string.h" #include <stdlib.h> struct _tinyrl_history_entry { char *line; unsigned index; }; /*------------------------------------- */ static void entry_init(tinyrl_history_entry_t * this, const char *line, unsigned index) { this->line = lub_string_dup...
zzysjtu-klish
tinyrl/history/history_entry.c
C
bsd
1,268
/* private.h */ #include "tinyrl/history.h" /************************************** * protected interface to tinyrl_history_entry class ************************************** */ extern tinyrl_history_entry_t *tinyrl_history_entry_new(const char *line, unsigned index); extern void tinyrl_history_entry_delete(t...
zzysjtu-klish
tinyrl/history/private.h
C
bsd
355
/* * history.c * * Simple non-readline hooks for the cli library */ #include <stdlib.h> #include <string.h> #include <stdio.h> #include <assert.h> #include <errno.h> #include "private.h" #include "lub/string.h" #include "tinyrl/history.h" struct _tinyrl_history { tinyrl_history_entry_t **entries; /* pointer ent...
zzysjtu-klish
tinyrl/history/history.c
C
bsd
11,573
/** \ingroup tinyrl \defgroup tinyrl_history history @{ \brief This class handles the maintenance of a historical list of command lines. */ #ifndef _tinyrl_history_h #define _tinyrl_history_h #include "lub/c_decl.h" #include "lub/types.h" _BEGIN_C_DECL /************************************** * tinyrl_history_entr...
zzysjtu-klish
tinyrl/history.h
C
bsd
3,017
## Process this file with automake to generate Makefile.in AUTOMAKE_OPTIONS = foreign nostdinc ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I. -I$(top_srcdir) AM_LD = $(CC) if DEBUG DEBUG_CFLAGS = -DDEBUG endif AM_CFLAGS = -pedantic -Wall $(DEBUG_CFLAGS) #AM_CFLAGS = -ansi -pedantic -Werror -Wall -D_POSIX_C_SOURCE=19930...
zzysjtu-klish
Makefile.am
Makefile
bsd
808
/* * dump.c * Provides indented printf functionality */ #include "private.h" #include <stdio.h> #include <stdarg.h> static int indent = 0; /*--------------------------------------------------------- */ int lub_dump_printf(const char *fmt, ...) { va_list args; int len; va_start(args, fmt); fprintf(stderr, "%*...
zzysjtu-klish
lub/dump/dump.c
C
bsd
955
/* * private.h */ #include "lub/dump.h"
zzysjtu-klish
lub/dump/private.h
C
bsd
42
/* * argv_new.c */ #include "private.h" #include "lub/string.h" #include <stdlib.h> #include <string.h> #include <assert.h> /*--------------------------------------------------------- */ static void lub_argv_init(lub_argv_t * this, const char *line, size_t offset) { size_t len; const char *word; lub_arg_t *arg; ...
zzysjtu-klish
lub/argv/argv_new.c
C
bsd
2,155
/* * argv__get_arg.c */ #include "private.h" /*--------------------------------------------------------- */ const char *lub_argv__get_arg(const lub_argv_t * this, unsigned index) { const char *result = NULL; if (this->argc > index) result = this->argv[index].arg; return result; } /*--------------------------...
zzysjtu-klish
lub/argv/argv__get_arg.c
C
bsd
355
/* * argv_nextword.c */ #include <stddef.h> #include <ctype.h> #include "private.h" #include "lub/types.h" /*--------------------------------------------------------- */ const char *lub_argv_nextword(const char *string, size_t * len, size_t * offset, size_t * quoted) { const char *word; *quoted = 0; /* find t...
zzysjtu-klish
lub/argv/argv_nextword.c
C
bsd
1,533
/* * private.h * * Class to deal with splitting a command line into multiple arguments. * This class deals with full quoted text "like this" as a single argument. */ #include "lub/argv.h" typedef struct lub_arg_s lub_arg_t; struct lub_arg_s { char *arg; size_t offset; bool_t quoted; }; struct lub_argv_s { un...
zzysjtu-klish
lub/argv/private.h
C
bsd
563
/* * argv__get_argv.c */ #include <stdlib.h> #include <ctype.h> #include <string.h> #include "lub/string.h" #include "private.h" /*--------------------------------------------------------- */ char *lub_argv__get_line(const lub_argv_t * this) { int space = 0; const char *p; unsigned i; char *line = NULL; for ...
zzysjtu-klish
lub/argv/argv__get_argv.c
C
bsd
1,383
/* * argv__get_count.c */ #include "private.h" /*--------------------------------------------------------- */ unsigned lub_argv__get_count(const lub_argv_t * this) { return this->argc; } /*--------------------------------------------------------- */
zzysjtu-klish
lub/argv/argv__get_count.c
C
bsd
254
/* * argv__get_offset.c */ #include "private.h" /*--------------------------------------------------------- */ size_t lub_argv__get_offset(const lub_argv_t * this, unsigned index) { size_t result = 0; if (this->argc > index) result = this->argv[index].offset; return result; } /*------------------------------...
zzysjtu-klish
lub/argv/argv__get_offset.c
C
bsd
351
/* * argv__get_quoted.c */ #include "private.h" /*--------------------------------------------------------- */ bool_t lub_argv__get_quoted(const lub_argv_t * this, unsigned index) { bool_t result = BOOL_FALSE; if (this->argc > index) result = this->argv[index].quoted; return result; } /*---------------------...
zzysjtu-klish
lub/argv/argv__get_quoted.c
C
bsd
360
/** \ingroup lub \defgroup lub_bintree bintree @{ \brief This interface provides a facility which enables a client to order and access a set of arbitary data in a binary "tree" Each "tree" is defined by a number of "clientnodes" which are ordered according to a client defined "key". A "clientkey" is a client ...
zzysjtu-klish
lub/bintree.h
C
bsd
13,947
/* It must be here to include config.h before another headers */ #include "lub/db.h" #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <pwd.h> #include <grp.h> #include <unistd.h> struct passwd *lub_db_getpwnam(const char *name) { size_t size; char *buf; struct passwd *pwbuf; struct passwd *...
zzysjtu-klish
lub/db/db.c
C
bsd
2,266
#ifndef _lub_list_h #define _lub_list_h #include <stddef.h> #include "lub/c_decl.h" /**************************************************************** * TYPE DEFINITIONS **************************************************************** */ typedef struct lub_list_node_s lub_list_node_t; /** * This type defines a ca...
zzysjtu-klish
lub/list.h
C
bsd
2,021
/* * string.h */ /** \ingroup lub \defgroup lub_string string @{ \brief This utility provides some simple string manipulation functions which augment those found in the standard ANSI-C library. As a rule of thumb if a function returns "char *" then the calling client becomes responsible for invoking lub_string_fre...
zzysjtu-klish
lub/string.h
C
bsd
7,077
#include <stdlib.h> #include <assert.h> #include <string.h> #include "private.h" /*--------------------------------------------------------- */ static inline void lub_list_init(lub_list_t * this, lub_list_compare_fn compareFn) { this->head = NULL; this->compareFn = compareFn; } /*---------------------------------...
zzysjtu-klish
lub/list/list.c
C
bsd
3,917
#include "lub/list.h" struct lub_list_node_s { lub_list_node_t *prev; lub_list_node_t *next; void *data; }; struct lub_list_s { lub_list_node_t *head; lub_list_node_t *tail; lub_list_compare_fn *compareFn; };
zzysjtu-klish
lub/list/private.h
C
bsd
217
/* * types.h */ /** \ingroup lub \defgroup lub_types types \brief This provides some primative types not found in ANSI-C. @{ */ #ifndef _lub_types_h #define _lub_types_h /** * A boolean type for ANSI-C */ typedef enum { BOOL_FALSE, BOOL_TRUE } bool_t; /** @} */ #endif /* _lub_types_h */
zzysjtu-klish
lub/types.h
C
bsd
302
/* * argv.h */ /** \ingroup lub \defgroup lub_argv argv @{ \brief This utility provides a simple means of manipulating a vector of command textual words. A word is either separated by whitespace, or if quotes are used a word is defined by the scope of the quotes. e.g. \verbatim one two "this is the third word" fo...
zzysjtu-klish
lub/argv.h
C
bsd
2,366
/* * ctype_isspace.c */ #include "lub/ctype.h" #include <ctype.h> /*--------------------------------------------------------- */ bool_t lub_ctype_isspace(char c) { unsigned char tmp = (unsigned char)c; return isspace(tmp) ? BOOL_TRUE : BOOL_FALSE; } /*--------------------------------------------------------- */
zzysjtu-klish
lub/ctype/ctype_isspace.c
C
bsd
319
/* * ctype_isdigit.c */ #include "lub/ctype.h" #include <ctype.h> /*--------------------------------------------------------- */ bool_t lub_ctype_isdigit(char c) { unsigned char tmp = (unsigned char)c; return isdigit(tmp) ? BOOL_TRUE : BOOL_FALSE; } /*--------------------------------------------------------- */
zzysjtu-klish
lub/ctype/ctype_isdigit.c
C
bsd
319
/* * ctype_toupper.c */ #include "lub/ctype.h" #include <ctype.h> /*--------------------------------------------------------- */ char lub_ctype_toupper(char c) { unsigned char tmp = (unsigned char)c; return toupper(tmp); } /*--------------------------------------------------------- */
zzysjtu-klish
lub/ctype/ctype_toupper.c
C
bsd
292
/* * ctype_tolower.c */ #include "lub/ctype.h" #include <ctype.h> /*--------------------------------------------------------- */ char lub_ctype_tolower(char c) { unsigned char tmp = (unsigned char)c; return tolower(tmp); } /*--------------------------------------------------------- */
zzysjtu-klish
lub/ctype/ctype_tolower.c
C
bsd
292
/* * string_free.c */ #include "private.h" #include <stdlib.h> /*--------------------------------------------------------- */ void lub_string_free(char *ptr) { free(ptr); } /*--------------------------------------------------------- */
zzysjtu-klish
lub/string/string_free.c
C
bsd
242
/* * string_nocasecmp.c */ #include <string.h> #include <ctype.h> #include "private.h" #include "lub/ctype.h" /*--------------------------------------------------------- */ int lub_string_nocasecmp(const char *cs, const char *ct) { int result = 0; while ((0 == result) && *cs && *ct) { /*lint -e155 Ignoring { }...
zzysjtu-klish
lub/string/string_nocasecmp.c
C
bsd
1,084
/* * string_escape.c */ #include "private.h" #include <stdlib.h> #include <string.h> const char *lub_string_esc_default = "`|$<>&()#;\\\"!"; const char *lub_string_esc_regex = "^$.*+[](){}"; const char *lub_string_esc_quoted = "\\\""; /*--------------------------------------------------------- */ char *lub_string_...
zzysjtu-klish
lub/string/string_escape.c
C
bsd
1,879
/* * string_nocasestr.c * * Find a string within another string in a case insensitive manner */ #include "private.h" #include "lub/ctype.h" /*--------------------------------------------------------- */ const char *lub_string_nocasestr(const char *cs, const char *ct) { const char *p = NULL; const char *result =...
zzysjtu-klish
lub/string/string_nocasestr.c
C
bsd
1,404
/* * string_dup.c */ #include <stdlib.h> #include <string.h> #include "private.h" /*--------------------------------------------------------- */ char *lub_string_dup(const char *string) { if (!string) return NULL; return strdup(string); } /*--------------------------------------------------------- */ char *lub...
zzysjtu-klish
lub/string/string_dup.c
C
bsd
572
/* * string_cat.c */ #include "private.h" #include <string.h> /*--------------------------------------------------------- */ void lub_string_cat(char **string, const char *text) { size_t len = text ? strlen(text) : 0; lub_string_catn(string, text, len); } /*--------------------------------------------------------...
zzysjtu-klish
lub/string/string_cat.c
C
bsd
325
/* * private.h */ #include "lub/string.h"
zzysjtu-klish
lub/string/private.h
C
bsd
44
/* * string_cat.c */ #include "private.h" #include <string.h> #include <stdlib.h> /*--------------------------------------------------------- */ void lub_string_catn(char **string, const char *text, size_t len) { if (text) { char *q; size_t length, initlen, textlen = strlen(text); /* make sure the client can...
zzysjtu-klish
lub/string/string_catn.c
C
bsd
845
/* * string_suffix.c */ #include "private.h" #include "lub/ctype.h" /*--------------------------------------------------------- */ const char *lub_string_suffix(const char *string) { const char *p1, *p2; p1 = p2 = string; while (*p1) { if (lub_ctype_isspace(*p1)) { p2 = p1; p2++; } p1++; } return p2...
zzysjtu-klish
lub/string/string_suffix.c
C
bsd
388
/* * system_file.c */ #include <stdlib.h> #include <string.h> #include "private.h" #include "lub/string.h" /*-------------------------------------------------------- */ /* perform a simple tilde substitution for the home directory * defined in HOME */ char *lub_system_tilde_expand(const char *path) { char *home...
zzysjtu-klish
lub/system/system_file.c
C
bsd
578
/* * system_test.c */ #include <stdlib.h> #include "private.h" /*--------------------------------------------------------- */ bool_t lub_system_test(int argc, char **argv) { return testcmd(argc, argv) ? BOOL_FALSE : BOOL_TRUE; } /*--------------------------------------------------------- */ bool_t lub_system_lin...
zzysjtu-klish
lub/system/system_test.c
C
bsd
926
/* * private.h */ #include "lub/types.h" #include "lub/argv.h" #include "lub/system.h" int testcmd(int argc, char *argv[]);
zzysjtu-klish
lub/system/private.h
C
bsd
127
/* $OpenBSD: test.c,v 1.11 2009/10/27 23:59:22 deraadt Exp $ */ /* $NetBSD: test.c,v 1.15 1995/03/21 07:04:06 cgd Exp $ */ /* * test(1); version 7-like -- author Erik Baalbergen * modified by Eric Gisin to be used as built-in. * modified by Arnold Robbins to add SVR3 compatibility * (-x -c -b -p -u -g -k) plus K...
zzysjtu-klish
lub/system/test.c
C
bsd
8,753
#ifndef _lub_passwd_h #define _lub_passwd_h #include <stddef.h> #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_PWD_H #include <pwd.h> #endif #ifdef HAVE_GRP_H #include <grp.h> #endif /* Wrappers for ugly getpwnam_r()-like functions */ #ifdef HAVE_PWD_H struct passwd *lub_db_getpwnam...
zzysjtu-klish
lub/db.h
C
bsd
515
/* * bintree_dump.c */ #include <stdio.h> #include "private.h" /*--------------------------------------------------------- */ void _lub_bintree_dump(lub_bintree_t * this, lub_bintree_node_t * node) { if (node->left) { _lub_bintree_dump(this, node->left); } printf(" %s%p", (this->root == node) ? "(R)" : ...
zzysjtu-klish
lub/bintree/bintree_dump.c
C
bsd
674
/*********************** -*- Mode: C -*- *********************** * File : bintree_findprevious.c *--------------------------------------------------------------- * Description * =========== * This operation searches the specified "tree" for a "clientnode" which is * the one which logically preceeds the...
zzysjtu-klish
lub/bintree/bintree_findprevious.c
C
bsd
2,178
/*********************** -*- Mode: C -*- *********************** * File : bintree_init.c *--------------------------------------------------------------- * Description * =========== * This operations initialise an instance of a binary tree at runtime. * * this - the "tree" instance to initialise...
zzysjtu-klish
lub/bintree/bintree_init.c
C
bsd
1,808
/*********************** -*- Mode: C -*- *********************** * File : bintree_splay.c *--------------------------------------------------------------- * Description * =========== * An implementation of top-down splaying * D. Sleator <sleator@cs.cmu.edu> * ...
zzysjtu-klish
lub/bintree/bintree_splay.c
C
bsd
4,778
/*********************** -*- Mode: C -*- *********************** * File : bintree_iterator_previous.c *--------------------------------------------------------------- * Description * =========== * This operation returns the previous "clientnode" in an iteration. * * iter - the iterator instance to inv...
zzysjtu-klish
lub/bintree/bintree_iterator_previous.c
C
bsd
1,585
/*********************** -*- Mode: C -*- *********************** * File : bintree_findnext.c *--------------------------------------------------------------- * Description * =========== * This operation searches the specified "tree" for a "clientnode" which is * the one which logically follows the spec...
zzysjtu-klish
lub/bintree/bintree_findnext.c
C
bsd
2,173
/*********************** -*- Mode: C -*- *********************** * File : bintree_iterator_init.c *--------------------------------------------------------------- * Description * =========== * This operation initialises an iterator. This can then be * subsequently used for iterating through a tree. Thi...
zzysjtu-klish
lub/bintree/bintree_iterator_init.c
C
bsd
2,047
/*********************** -*- Mode: C -*- *********************** * File : bintree_findlast.c *--------------------------------------------------------------- * Description * =========== * This operation returns the last "clientnode" present in the * specified "tree" * * tree - the "tree" instance to ...
zzysjtu-klish
lub/bintree/bintree_findlast.c
C
bsd
2,473
/*********************** -*- Mode: C -*- *********************** * File : bintree_findfirst.c *--------------------------------------------------------------- * Description * =========== * This operation returns the first "clientnode" present in the specified "tree" * * tree - the "tree" instance to i...
zzysjtu-klish
lub/bintree/bintree_findfirst.c
C
bsd
2,464
/*********************** -*- Mode: C -*- *********************** * File : bintree_insert.c *--------------------------------------------------------------- * Description * =========== * This operation adds a client node to the specified tree. * * tree - the "tree" instance to invoke this operati...
zzysjtu-klish
lub/bintree/bintree_insert.c
C
bsd
3,208
/*********************** -*- Mode: C -*- *********************** * File : bintree_remove.c *--------------------------------------------------------------- * Description * =========== * This operation removes a "node" from the specified "tree" * * tree - the "tree" instance to invoke this operat...
zzysjtu-klish
lub/bintree/bintree_remove.c
C
bsd
2,539
/*********************** -*- Mode: C -*- *********************** * File : private.h *--------------------------------------------------------------- * Description * =========== * This defines the private interface used internally by this component *------------------------------------------------------...
zzysjtu-klish
lub/bintree/private.h
C
bsd
2,843
/*********************** -*- Mode: C -*- *********************** * File : bintree_find.c *--------------------------------------------------------------- * Description * =========== * This operation searches the specified "tree" for a "clientnode" * which matches the specified "key" * * tree - the "t...
zzysjtu-klish
lub/bintree/bintree_find.c
C
bsd
1,711
/*********************** -*- Mode: C -*- *********************** * File : bintree_node_init.c *--------------------------------------------------------------- * Description * =========== * This operation is called to initialise a "clientnode" ready for * insertion into a tree. This is only required onc...
zzysjtu-klish
lub/bintree/bintree_node_init.c
C
bsd
1,516
/*********************** -*- Mode: C -*- *********************** * File : bintree_iterator_next.c *--------------------------------------------------------------- * Description * =========== * This operation returns the next "clientnode" in an iteration. * * iter - the iterator instance to invoke this...
zzysjtu-klish
lub/bintree/bintree_iterator_next.c
C
bsd
1,563
/* * system.h * */ #ifndef _lub_system_h #define _lub_system_h #include <stddef.h> #include "lub/c_decl.h" #include "lub/types.h" #include "lub/argv.h" _BEGIN_C_DECL bool_t lub_system_test(int argc, char **argv); bool_t lub_system_argv_test(const lub_argv_t * argv); bool_t lub_system_line_test(const char *line); ...
zzysjtu-klish
lub/system.h
C
bsd
412
/* * dump.h */ /** \ingroup lub \defgroup lub_dump dump @{ \brief This utility provides a simple hierachical debugging mechanism. By indenting and undenting the output, printing nested debug messages is made easy. */ #ifndef _lub_dump_h #define _lub_dump_h #include <stdarg.h> /*====================================...
zzysjtu-klish
lub/dump.h
C
bsd
1,758
/* * c_decl.h * * a simple set of macros to ease declaration of C interfaces. */ /** \ingroup lub \defgroup lub_c_decl C linkage macros @{ These two macros are used to simplify the declaration of C-linkage code. Rather than worry about preprocessor directives similar to \code #ifdef __cplusplus extern "C" { #en...
zzysjtu-klish
lub/c_decl.h
C
bsd
814
# # Copyright (C) 2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=klish PKG_VERSION:=1.5.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://klish.googlecode.co...
zzysjtu-klish
contrib/openwrt/Makefile
Makefile
bsd
2,849
############################################################# # # klish # ############################################################# ifeq ($(BR2_PACKAGE_KLISH_SVN),y) KLISH_VERSION:=HEAD KLISH_SITE:=http://klish.googlecode.com/svn/trunk KLISH_SITE_METHOD:=svn else KLISH_VERSION = 1.6.0 KLISH_SOURCE = klish-$(KLISH_...
zzysjtu-klish
contrib/buildroot/klish.mk
Makefile
bsd
534
#!/bin/sh # Check for missing binaries BIN=/usr/bin/konfd test -x $BIN || exit 5 PID=/var/run/konfd.pid case "$1" in start) echo "Starting konfd daemon..." test -r $PID && { echo "The service is already running."; exit 1; } $BIN -p $PID ;; stop) echo "Stopping konfd daemon..." test ! -r $PID && { echo "The ser...
zzysjtu-klish
contrib/konfd.init
Shell
bsd
426
/* * callback_log.c * * Callback hook to log users's commands */ #include <stdio.h> #include <stdlib.h> #include <syslog.h> #include <sys/types.h> #include <pwd.h> #include "internal.h" #define SYSLOG_IDENT "klish" #define SYSLOG_FACILITY LOG_LOCAL0 /*--------------------------------------------------------- */ ...
zzysjtu-klish
clish/callback_log.c
C
bsd
766
#ifndef _clish_var_h #define _clish_var_h #include "lub/types.h" #include "lub/bintree.h" #include "clish/action.h" typedef struct clish_var_s clish_var_t; /*===================================== * VAR INTERFACE *===================================== */ /*----------------- * meta functions *----------------- */ ...
zzysjtu-klish
clish/var.h
C
bsd
1,291
/* * shell.h */ /** \ingroup clish \defgroup clish_shell shell @{ \brief This class represents the top level container for a CLI session. */ #ifndef _clish_shell_h #define _clish_shell_h #include <stdio.h> #include <sys/types.h> #include <pwd.h> #include "lub/c_decl.h" #include "lub/types.h" #include "lub/argv.h...
zzysjtu-klish
clish/shell.h
C
bsd
13,595
/* * nspace.h */ /** \ingroup clish \defgroup clish_nspace nspace @{ \brief This class represents an instance of a namespace type. Namespace instances are assocated with a view to make view's commands available within current view. */ #ifndef _clish_nspace_h #define _clish_nspace_h typedef struct clish_nspace_s c...
zzysjtu-klish
clish/nspace.h
C
bsd
2,411
/* * nspace.c * * This file provides the implementation of the "nspace" class */ #include "private.h" #include "lub/string.h" #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <sys/types.h> #include <regex.h> #include <ctype.h> /*----------------------------------------------...
zzysjtu-klish
clish/nspace/nspace.c
C
bsd
10,174
/* * nspace.h */ #include <regex.h> #include "clish/nspace.h" /*--------------------------------------------------------- * PRIVATE TYPES *--------------------------------------------------------- */ struct clish_nspace_s { lub_bintree_t tree; /* Tree of command links */ clish_view_t *view; /* The view to impor...
zzysjtu-klish
clish/nspace/private.h
C
bsd
536
/* * nspace_dump.c */ #include "private.h" #include "lub/dump.h" /*--------------------------------------------------------- */ void clish_nspace_dump(const clish_nspace_t * this) { lub_dump_printf("nspace(%p)\n", this); lub_dump_indent(); lub_dump_printf("view : %s\n", clish_view__get_name(this->view...
zzysjtu-klish
clish/nspace/nspace_dump.c
C
bsd
808
/* * param.c * * This file provides the implementation of the "param" class */ #include "private.h" #include "lub/string.h" #include "clish/types.h" #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> /*--------------------------------------------------------- * PRIVATE METHODS *-----...
zzysjtu-klish
clish/param/param.c
C
bsd
10,132
/* * param_dump.c */ #include "private.h" #include "lub/dump.h" /*--------------------------------------------------------- */ void clish_param_dump(const clish_param_t * this) { unsigned i; char *mode; lub_dump_printf("param(%p)\n", this); lub_dump_indent(); lub_dump_printf("name : %s\n", this->name); ...
zzysjtu-klish
clish/param/param_dump.c
C
bsd
1,449
/* * param.h */ #include "clish/param.h" /*--------------------------------------------------------- * PRIVATE TYPES *--------------------------------------------------------- */ struct clish_paramv_s { unsigned paramc; clish_param_t **paramv; }; struct clish_param_s { char *name; char *text; char *value; ...
zzysjtu-klish
clish/param/private.h
C
bsd
635
/* * types.h */ #ifndef _clish_types_h #define _clish_types_h #include "lub/c_decl.h" #include "lub/argv.h" struct clish_help_s { lub_argv_t *name; lub_argv_t *help; lub_argv_t *detail; }; typedef struct clish_help_s clish_help_t; #endif /* _clish_types_h */
zzysjtu-klish
clish/types.h
C
bsd
268
/* * clish_config_callback.c * * * Callback hook to execute config operations. */ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <assert.h> #include <sys/socket.h> #include <sys/un.h> #include <limits.h> #include <string.h> #include "internal.h" #include "konf/net.h" #include "konf/buf.h"...
zzysjtu-klish
clish/callback_config.c
C
bsd
5,083
/* * view.c * * This file provides the implementation of a view class */ #include "private.h" #include "lub/argv.h" #include "lub/string.h" #include "lub/ctype.h" #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> /*--------------------------------------------------------- * PRIVATE M...
zzysjtu-klish
clish/view/view.c
C
bsd
10,361
/* * view.h */ #include "clish/view.h" #include "lub/bintree.h" /*--------------------------------------------------------- * PRIVATE TYPES *--------------------------------------------------------- */ struct clish_view_s { lub_bintree_t tree; lub_bintree_node_t bt_node; char *name; char *prompt; unsigned int...
zzysjtu-klish
clish/view/private.h
C
bsd
412
/* * view_dump.c */ #include "private.h" #include "lub/dump.h" /*--------------------------------------------------------- */ void clish_view_dump(clish_view_t * this) { clish_command_t *c; lub_bintree_iterator_t iter; unsigned i; lub_dump_printf("view(%p)\n", this); lub_dump_indent(); lub_dump_printf("name ...
zzysjtu-klish
clish/view/view_dump.c
C
bsd
861
/* * internal.h */ #ifndef _clish_internal_h #define _clish_internal_h #include "lub/c_decl.h" #include "clish/shell.h" _BEGIN_C_DECL /* storage */ extern struct termios clish_default_tty_termios; /* Standard clish callback functions */ extern clish_shell_access_fn_t clish_access_callback; extern clish_shell_scri...
zzysjtu-klish
clish/internal.h
C
bsd
552
/* * shell_word_generator.c */ #include <string.h> #include "private.h" #include "lub/string.h" #include "lub/argv.h" /*-------------------------------------------------------- */ void clish_shell_iterator_init(clish_shell_iterator_t * iter, clish_nspace_visibility_t field) { iter->last_cmd = NULL; iter->field =...
zzysjtu-klish
clish/shell/shell_command.c
C
bsd
4,468
/* * shell_new.c */ #include "private.h" #include "lub/string.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <unistd.h> /*-------------------------------------------------------- */ int clish_shell_loop(clish_shell_t *this) { int running = 0; int retval = SHELL_STATE_OK...
zzysjtu-klish
clish/shell/shell_spawn.c
C
bsd
1,262
/* * shell_find_create_view.c */ #include <assert.h> #include "private.h" /*--------------------------------------------------------- */ clish_view_t *clish_shell_find_create_view(clish_shell_t * this, const char *name, const char *prompt) { clish_view_t *view = lub_bintree_find(&this->view_tree, name); if (!v...
zzysjtu-klish
clish/shell/shell_view.c
C
bsd
1,386
/* * shell_find_create_ptype.c */ #include <assert.h> #include "private.h" /*--------------------------------------------------------- */ clish_ptype_t *clish_shell_find_ptype(clish_shell_t *this, const char *name) { return lub_bintree_find(&this->ptype_tree, name); } /*-----------------------------------------...
zzysjtu-klish
clish/shell/shell_ptype.c
C
bsd
1,315
/* * ------------------------------------------------------ * shell_roxml.c * * This file implements the means to read an XML encoded file * and populate the CLI tree based on the contents. It implements * the clish_xml API using roxml * ------------------------------------------------------ */ #ifdef HAVE_CO...
zzysjtu-klish
clish/shell/shell_libxml2.c
C
bsd
5,095
/* * shell_startup.c */ #include "private.h" #include <assert.h> #include "lub/string.h" /*----------------------------------------------------------- */ int clish_shell_startup(clish_shell_t *this) { const char *banner; clish_context_t context; int res = 0; assert(this->startup); banner = clish_command__get_...
zzysjtu-klish
clish/shell/shell_startup.c
C
bsd
1,809
/* * shell_execute.c */ #include "private.h" #include "lub/string.h" #include "lub/argv.h" #include <assert.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/file.h> #include <signal.h> #include <fcntl.h> /...
zzysjtu-klish
clish/shell/shell_execute.c
C
bsd
13,133