Commit 0177a213 authored by Alessandro Rubini's avatar Alessandro Rubini

include: rename dep.h to lib.h, and add pp_printf to diag.h

This removes <dep/dep.h> by renaming it to <pproto/lib.h>, since those
functions are library ones, though pp_ prefixed.

<pproto/pproto.h> includes <pproto/lib.h>, since they are always needed,
and C files are fixed by not including <dep/dep.h>. Sometimes I included
<pproto/diag.h> to fix some compile warnings for implicit declaration of
pp_printf.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent ca2f8041
......@@ -6,6 +6,7 @@
*/
#include <stdarg.h>
#include <pproto/pproto.h>
#include <pproto/diag.h>
#define PP_BUF 128 /* We prefer small targets */
......
......@@ -2,6 +2,7 @@
* Alessandro Rubini for CERN, 2011 -- public domain
*/
#include <pproto/pproto.h>
#include <pproto/diag.h>
/*
* This has diagnostics. It calls pp_printf (which one, we don't know)
......
/*
* FIXME
* Alessandro Rubini for CERN, 2011 -- public domain
*/
#ifndef __PTP_DIAG_H__
#define __PTP_DIAG_H__
......@@ -20,4 +20,11 @@ extern void pp_diag_fatal(struct pp_instance *ppi, char *s1, char *s2);
extern void pp_diag_printf(struct pp_instance *ppi, char *fmt, ...)
__attribute__((format(printf,2,3)));
/* Our printf, that is implemented internally */
extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf,1,2)));
extern int pp_vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
#endif /* __PTP_DIAG_H__ */
/*
* FIXME: header
* Alessandro Rubini and Aurelio Colosimo for CERN, 2011 -- public domain
*/
#ifndef __PTP_DEP_H__
#define __PTP_DEP_H__
/* Our printf, that is implemented internally */
extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf,1,2)));
extern int pp_vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
#ifndef __PTP_LIB_H__
#define __PTP_LIB_H__
/* We base on puts and a few more functions: each arch must have it */
extern void pp_puts(const char *s);
......
......@@ -7,6 +7,7 @@
#include <stdint.h>
#include <stdarg.h>
#include <arch/arch.h> /* ntohs and so on */
#include <pproto/lib.h>
#include <pproto/ieee1588_types.h>
#include <pproto/constants.h>
......
......@@ -2,9 +2,6 @@
* FIXME header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
/* Local clock is becoming Master. Table 13 (9.3.5) of the spec. */
void m1(struct pp_instance *ppi)
......
......@@ -3,8 +3,6 @@
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
/* Unpack header from in buffer to msg_tmp_header field */
void msg_unpack_header(void *buf, struct pp_instance *ppi)
......
......@@ -2,7 +2,6 @@
* FIXME: header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
#include "state-common-fun.h"
void st_com_execute_slave(struct pp_instance *ppi)
......
......@@ -2,7 +2,7 @@
* FIXME: header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
#include <pproto/diag.h>
/*
* Fault troubleshooting. Now only prints an error messages and comes back to
......
......@@ -2,7 +2,7 @@
* FIXME: header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
#include <pproto/diag.h>
/*
* Initializes network and other stuff
......
......@@ -2,7 +2,6 @@
* FIXME: header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
#include "state-common-fun.h"
int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
......
......@@ -2,7 +2,6 @@
* FIXME: header
*/
#include <pproto/pproto.h>
#include <dep/dep.h>
#include "state-common-fun.h"
int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
......
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