9a212dc06c
Currently the sample app user guides use hard coded code snippets, this patch changes these to use literalinclude which will dynamically update the snippets as changes are made to the code. This was introduced in commit 413c75c33c40 ("doc: show how to include code in guides"). Comments within the sample apps were updated to accommodate this as part of this patch. This will help to ensure that the code within the sample app user guides is up to date and not out of sync with the actual code. Signed-off-by: Conor Fogarty <conor.fogarty@intel.com> Signed-off-by: Conor Walsh <conor.walsh@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(c) 2010-2014 Intel Corporation.
|
|
* Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
#include <errno.h>
|
|
#include <sys/queue.h>
|
|
|
|
#include <cmdline_rdline.h>
|
|
#include <cmdline_parse.h>
|
|
#include <cmdline_socket.h>
|
|
#include <cmdline.h>
|
|
|
|
#include <rte_memory.h>
|
|
#include <rte_eal.h>
|
|
#include <rte_debug.h>
|
|
|
|
#include "commands.h"
|
|
|
|
/* Initialization of the Environment Abstraction Layer (EAL). 8< */
|
|
int main(int argc, char **argv)
|
|
{
|
|
int ret;
|
|
struct cmdline *cl;
|
|
|
|
ret = rte_eal_init(argc, argv);
|
|
if (ret < 0)
|
|
rte_panic("Cannot init EAL\n");
|
|
/* >8 End of initialization of Environment Abstraction Layer (EAL). */
|
|
|
|
/* Creating a new command line object. 8< */
|
|
cl = cmdline_stdin_new(main_ctx, "example> ");
|
|
if (cl == NULL)
|
|
rte_panic("Cannot create cmdline instance\n");
|
|
cmdline_interact(cl);
|
|
cmdline_stdin_exit(cl);
|
|
/* >8 End of creating a new command line object. */
|
|
|
|
/* clean up the EAL */
|
|
rte_eal_cleanup();
|
|
|
|
return 0;
|
|
}
|