Commit faa6248d authored by Alessandro Rubini's avatar Alessandro Rubini

diag: kill diag subdirectory and diag-yes.c

This finally removes the diag directory by folding two one-line
functions into diag.h.  The dir is a relic of ptp-proposal that
hosted pp_printf, but now we have it separate anyways.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ac468805
......@@ -46,8 +46,6 @@ pp_printf/pp-printf.o: $(wildcard pp_printf/*.[ch])
$(MAKE) -C pp_printf pp-printf.o
endif
include diag/Makefile
# proto-standard is always included, as it provides default function
# so the extension can avoid duplication of code.
ifdef PROTO_EXT
......
# Alessandro Rubini for CERN, 2011 -- public domain
# This changed in 2013-02, and it's incompatible with what we had
OBJ-y += diag/diag-yes.o
ifdef HAS_DIAG
SAY := $(shell echo "WARNING: ppsi doesn't use \$$HAS_DIAG any more" >&2)
endif
ifdef HAS_FULL_DIAG
SAY := $(shell echo "WARNING: ppsi doesn't use \$$HAS_FULL_DIAG any more" >&2)
endif
\ No newline at end of file
/*
* Alessandro Rubini for CERN, 2011 -- public domain
*/
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
/*
* This has diagnostics. It calls pp_printf (which one, we don't know)
*/
void pp_diag_error(struct pp_instance *ppi, int err)
{
pp_printf("ERR for %p: %i\n", ppi, err);
}
void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2)
{
pp_printf("ERR for %p: %s %s\n", ppi, s1, s2);
}
......@@ -5,15 +5,6 @@
#define __PPSI_DIAG_H__
#include <ppsi/ppsi.h>
/*
* The diagnostic functions
*
* error gets an integer, the other ones two strings (so we can
* strerror(errno) together with the explanation. Avoid diag_printf if
* possible, for size reasons, but here it is anyways.
*/
extern void pp_diag_error(struct pp_instance *ppi, int err);
extern void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2);
/* Our printf, that is implemented internally */
extern int pp_printf(const char *fmt, ...)
......@@ -23,4 +14,22 @@ extern int pp_vprintf(const char *fmt, va_list args)
extern int pp_vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
/*
* The diagnostic functions
*
* error gets an integer, the other ones two strings (so we can
* strerror(errno) together with the explanation. Avoid diag_printf if
* possible, for size reasons, but here it is anyways.
*/
static inline void pp_diag_error(struct pp_instance *ppi, int err)
{
pp_printf("ERR for %p: %i\n", ppi, err);
}
static inline void pp_diag_error_str2(struct pp_instance *ppi,
char *s1, char *s2)
{
pp_printf("ERR for %p: %s %s\n", ppi, s1, s2);
}
#endif /* __PPSI_DIAG_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment