aboutsummaryrefslogtreecommitdiffstats
path: root/examples/print-memory.c
blob: c1cf9c49ce434f7742edaa8e3f0e19911f7638fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ==========================================================================
    Licensed under BSD 2clause license See LICENSE file for more information
    Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
   ========================================================================== */

#include "embedlog.h"

#ifdef EMBEDLOG_DEMO_LIBRARY
int el_demo_print_memory_main(void)
#else
int main(void)
#endif
{
	char   s[] = "some message\0that contains\0null characters";
	char   ascii[128];
	int    i;
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


	for (i = 0; i != 128; ++i)  ascii[i] = (char)i;

	el_init();

	el_pmemory(ELI, ascii, sizeof(ascii));
	el_pmemory(ELI, s, sizeof(s));

	return 0;
}