aboutsummaryrefslogtreecommitdiffstats
path: root/doxygen/dir.dox.sample
AgeCommit message (Collapse)AuthorFilesLines
2016-09-21Refactor pre-Doxy siphon scripts; VPP-396Chris Luke1-0/+1
- Modularize the code to make the Siphon process easier to maintain. - Move much of the output rendering into Jinja2 templates. - Add syscfg siphon type for startup config documentation. - Add sample syscfg documentation. - Add clicfg and syscfg preamble docs, adapted from their wiki pages. - Fix sorting of CLI items across multiple directories. Change-Id: Ib8288fe005adfea68ceed75a38ff8eba25d3cc79 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-08-31VPP-221 CLI auto-documentation infrastructureChris Luke1-1/+2
As a step before Doxygen, extract CLI-related struct initializers from the code and parse that into a summary of the CLI commands available with the provided help text, such as it is. At the moment this only renders this into an indexed Markdown file that Doxygen then picks up but later we can use this information to enrich the existing VLIB_CLI_COMMAND macro documentor as well as provide runtime documentation to VPP that is stored on disk outside the binary image. Additionally support a comment block immediately prior to VLIB_CLI_COMMAND CLI command definitions in the form /*? ... ?*/ that can be used to include long-form documentation without having it compiled into VPP. Examples of documenting CLI commands can be found in vlib/vlib/unix/cli.c which, whilst not perfect, should provide a starting point. Screen captures of sample output can be seen at https://chrisy.flirble.org/vpp/doxy-cli-example.png and https://chrisy.flirble.org/vpp/doxy-cli-index.png . Next, shift the Doxygen root makefile targets to their own Makefile. The primary reason for this is that the siphon targets do dependency tracking which means it needs to generate those dependencies whenever make is run; that is pointless if we're not going to generate any documentation. This includes the package dependencies since they since they sometimes unnecessarily interfere with the code build in some cases at the moment; later we will look to building a Python venv to host the Python modules we use. One final remark: In future we may consider deprecating .long_help in the VLIB_CLI_COMMAND structure entirely but add perhaps .usage_help. .short_help would be reserved for a summary of the command function and .usage_help provide the syntax of that command. These changes would provide great semantic value to the automaticly generated CLI documentation. I could also see having .long_help replaced by a mechanism that reads it from disk at runtime with a rudimentary Markdown/Doxygen filter so that we can use the same text that is used in the published documentation. Change-Id: I80d6fe349b47dce649fa77d21ffec0ddb45c7bbf Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-16VPP-57 Add missing license headers in doc filesChris Luke1-0/+22
Change-Id: Icd1f8952f66d3cee027c59f3148c67f1839de306 Signed-off-by: Chris Luke <chrisy@flirble.org>
2016-05-13VPP-57 Add Doxygen to VPPChris Luke1-0/+6
- Configures Doxygen. - Adds a source filter to do magic on our use of the preprocessor to do constructor stuff to make Doxygen grok it better. - Adds a convenience helper to the root Makefile. - Adds a README.md to the root directory (and which Doxygem uses as its "mainpage". - Add several other documentative files. - Currently using SVG for call graphs, though this may have a load-time performance impact in browsers. Change-Id: I25fc6fb5bf634319dcb36a7f0e32031921c125ac Signed-off-by: Chris Luke <chrisy@flirble.org>
highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright (c) 2015 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef included_vlib_lex_h
#define included_vlib_lex_h

#include <vppinfra/hash.h>
#include <vppinfra/bitmap.h>
#include <vppinfra/error.h>
#include <vppinfra/pool.h>

#define foreach_vlib_lex_global_token           \
  _ (invalid)                                   \
  _ (eof)                                       \
  _ (word)                                      \
  _ (number)                                    \
  _ (lt)                                        \
  _ (gt)                                        \
  _ (dot)                                       \
  _ (slash)                                     \
  _ (qmark)                                     \
  _ (equals)                                    \
  _ (plus)                                      \
  _ (minus)                                     \
  _ (star)                                      \
  _ (lpar)                                      \
  _ (rpar)

typedef enum
{
#define _(f) VLIB_LEX_##f,
  foreach_vlib_lex_global_token
#undef _
} vlib_lex_global_token_t;

typedef enum
{
  VLIB_LEX_IGNORE,
  VLIB_LEX_ADD_TO_TOKEN,
  VLIB_LEX_RETURN,
  VLIB_LEX_RETURN_AND_RESCAN,
  VLIB_LEX_KEYWORD_CHECK,
  VLIB_LEX_START_NUMBER,
  VLIB_LEX_ADD_TO_NUMBER,
} vlib_lex_action_t;

typedef struct
{
  u16 action;
  u16 next_table_index;
  u16 token;
} vlib_lex_table_entry_t;

typedef struct
{
  char *name;
  vlib_lex_table_entry_t entries[128];
} vlib_lex_table_t;

typedef struct
{
  u32 token;

  union
  {
    uword as_uword;
    void *as_pointer;
    char *as_string;
  } value;
} vlib_lex_token_t;

typedef struct
{
  vlib_lex_table_t *lex_tables;
  uword *lex_tables_by_name;

  /* Vector of token strings. */
  char **lex_token_names;

  /* Hash mapping c string name to token index. */
  uword *lex_tokens_by_name;

  /* Hash mapping c string keyword name to token index. */
  uword *lex_keywords;

  vlib_lex_token_t *pushback_vector;

  i32 pushback_sp;

  u32 current_table_index;

  uword current_token_value;

  uword current_number_base;

  /* Input string we are lex-ing. */
  u8 *input_vector;

  /* Current index into input vector. */
  u32 current_index;

  /* Re-used vector for forming token strings and hashing them. */
  u8 *token_buffer;
} vlib_lex_main_t;

extern vlib_lex_main_t vlib_lex_main;

always_inline void
vlib_lex_cleanup_token (vlib_lex_token_t * t)
{
  if (t->token == VLIB_LEX_word)
    {
      u8 *tv = t->value.as_pointer;
      vec_free (tv);
    }
}

u16 vlib_lex_add_table (char *name);
void vlib_lex_get_token (vlib_lex_main_t * lm, vlib_lex_token_t * result);
u16 vlib_lex_add_token (vlib_lex_main_t * lm, char *token_name);
void vlib_lex_set_action_range (u32 table_index, u8 lo, u8 hi, u16 action,
				u16 token, u32 next_table_index);
void vlib_lex_reset (vlib_lex_main_t * lm, u8 * input_vector);
format_function_t format_vlib_lex_token;

#endif /* included_vlib_lex_h */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */