rename library and API prefix
library is now called libsocketcan, API carry the prefix can_ Signed-off-by: Luotao Fu <l.fu@pengutronix.de>pull/106/head^2
parent
1751269c33
commit
257877f315
|
|
@ -4,14 +4,14 @@ GNUmakefile
|
|||
GNUmakefile.in
|
||||
|
||||
aclocal.m4
|
||||
config/libsocketcan-nl.pc
|
||||
config/libsocketcan.pc
|
||||
config/m4/libtool.m4
|
||||
config/m4/ltoptions.m4
|
||||
config/m4/ltsugar.m4
|
||||
config/m4/ltversion.m4
|
||||
config/m4/lt~obsolete.m4
|
||||
include/libsocketcan-nl_config.h
|
||||
include/libsocketcan-nl_config.h.in
|
||||
include/libsocketcan_config.h
|
||||
include/libsocketcan_config.h.in
|
||||
include/stamp-h1
|
||||
|
||||
config.log
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
EXTRA_DIST = \
|
||||
libsocketcan-nl.pc.in
|
||||
libsocketcan.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libsocketcan-nl.pc
|
||||
pkgconfig_DATA = libsocketcan.pc
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
GNUmakefile.in
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ exec_prefix=@exec_prefix@
|
|||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libsocketcan-nl
|
||||
Description: provides access to socketcan netlink interface
|
||||
Name: libsocketcan
|
||||
Description: provides access to socketcan configuration interface
|
||||
Requires:
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lsocketcan-nl
|
||||
Libs: -L${libdir} -lsocketcan
|
||||
#Libs.private: -lm -lpthread ...etc...
|
||||
Cflags: -I${includedir}
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
AC_INIT([libsocketcan-nl], [trunk], [bugs@pengutronix.de])
|
||||
AC_CONFIG_HEADERS([include/libsocketcan-nl_config.h])
|
||||
AC_CONFIG_SRCDIR([src/socketcan_netlink.c])
|
||||
AC_INIT([libsocketcan], [trunk], [bugs@pengutronix.de])
|
||||
AC_CONFIG_HEADERS([include/libsocketcan_config.h])
|
||||
AC_CONFIG_SRCDIR([src/libsocketcan.c])
|
||||
AC_CONFIG_MACRO_DIR([config/m4])
|
||||
AC_CONFIG_AUX_DIR([config/autoconf])
|
||||
AC_CANONICAL_BUILD
|
||||
|
|
@ -110,7 +110,7 @@ fi
|
|||
|
||||
AC_CONFIG_FILES([
|
||||
GNUmakefile
|
||||
config/libsocketcan-nl.pc
|
||||
config/libsocketcan.pc
|
||||
config/GNUmakefile
|
||||
include/GNUmakefile
|
||||
src/GNUmakefile
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
noinst_HEADERS = \
|
||||
libsocketcan-nlstuff.h
|
||||
# noinst_HEADERS = \
|
||||
# libsocketcan-stuff.h
|
||||
|
||||
nobase_include_HEADERS = \
|
||||
socketcan_netlink.h
|
||||
libsocketcan.h
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
libsocketcan-nl_config.h.in \
|
||||
libsocketcan_config.h.in \
|
||||
GNUmakefile.in
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
#ifndef LIBSOCKETCAN-NL_H
|
||||
#define LIBSOCKETCAN-NL_H
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#ifndef LIBSOCKETCAN-NL_H
|
||||
#define LIBSOCKETCAN-NL_H
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* socketcan_netlink.h
|
||||
* libsocketcan.h
|
||||
*
|
||||
* (C) 2009 Luotao Fu <l.fu@pengutronix.de>
|
||||
*
|
||||
|
|
@ -23,19 +23,19 @@
|
|||
|
||||
#include <linux/can/netlink.h>
|
||||
|
||||
int scan_do_restart(const char *name);
|
||||
int scan_do_stop(const char *name);
|
||||
int scan_do_start(const char *name);
|
||||
int can_do_restart(const char *name);
|
||||
int can_do_stop(const char *name);
|
||||
int can_do_start(const char *name);
|
||||
|
||||
int scan_set_restart_ms(const char *name, __u32 restart_ms);
|
||||
int scan_set_bittiming(const char *name, struct can_bittiming *bt);
|
||||
int scan_set_ctrlmode(const char *name, struct can_ctrlmode *cm);
|
||||
int scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point);
|
||||
int can_set_restart_ms(const char *name, __u32 restart_ms);
|
||||
int can_set_bittiming(const char *name, struct can_bittiming *bt);
|
||||
int can_set_ctrlmode(const char *name, struct can_ctrlmode *cm);
|
||||
int can_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point);
|
||||
|
||||
int scan_get_restart_ms(const char *name, __u32 *restart_ms);
|
||||
int scan_get_bittiming(const char *name, struct can_bittiming *bt);
|
||||
int scan_get_ctrlmode(const char *name, struct can_ctrlmode *cm);
|
||||
int scan_get_state(const char *name, int *state);
|
||||
int scan_get_clock(const char *name, struct can_clock *clock);
|
||||
int can_get_restart_ms(const char *name, __u32 *restart_ms);
|
||||
int can_get_bittiming(const char *name, struct can_bittiming *bt);
|
||||
int can_get_ctrlmode(const char *name, struct can_ctrlmode *cm);
|
||||
int can_get_state(const char *name, int *state);
|
||||
int can_get_clock(const char *name, struct can_clock *clock);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
lib_LTLIBRARIES = libsocketcan-nl.la
|
||||
lib_LTLIBRARIES = libsocketcan.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/include
|
||||
|
||||
libsocketcan_nl_la_SOURCES = socketcan_netlink.c
|
||||
libsocketcan_la_SOURCES = libsocketcan.c
|
||||
|
||||
libsocketcan_nl_la_LDFLAGS = \
|
||||
libsocketcan_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
# -no-undefined # win32_dll stuff only
|
||||
|
||||
#libsocketcan-nl_LDADD = \
|
||||
#libsocketcan_LDADD = \
|
||||
# $(librn_LIBS)
|
||||
#
|
||||
MAINTAINERCLEANFILES = \
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* socketcan_netlink.c
|
||||
* libsocketcan.c
|
||||
*
|
||||
* (C) 2009 Luotao Fu <l.fu@pengutronix.de>
|
||||
*
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include <linux/rtnetlink.h>
|
||||
#include <linux/netlink.h>
|
||||
|
||||
#include <socketcan_netlink.h>
|
||||
#include <libsocketcan.h>
|
||||
|
||||
#define parse_rtattr_nested(tb, max, rta) \
|
||||
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
|
||||
|
|
@ -508,18 +508,18 @@ err_out:
|
|||
return err;
|
||||
}
|
||||
|
||||
int scan_do_start(const char *name)
|
||||
int can_do_start(const char *name)
|
||||
{
|
||||
return set_link(name, IF_UP, NULL);
|
||||
}
|
||||
|
||||
int scan_do_stop(const char *name)
|
||||
int can_do_stop(const char *name)
|
||||
{
|
||||
|
||||
return set_link(name, IF_DOWN, NULL);
|
||||
}
|
||||
|
||||
int scan_do_restart(const char *name)
|
||||
int can_do_restart(const char *name)
|
||||
{
|
||||
int fd;
|
||||
int err = -1;
|
||||
|
|
@ -527,7 +527,7 @@ int scan_do_restart(const char *name)
|
|||
__u32 restart_ms;
|
||||
|
||||
/* first we check if we can restart the device at all */
|
||||
if ((scan_get_state(name, &state)) < 0) {
|
||||
if ((can_get_state(name, &state)) < 0) {
|
||||
fprintf(stderr, "cannot get bustate, "
|
||||
"something is seriously wrong\n");
|
||||
goto err_out;
|
||||
|
|
@ -538,7 +538,7 @@ int scan_do_restart(const char *name)
|
|||
goto err_out;
|
||||
}
|
||||
|
||||
if ((scan_get_restart_ms(name, &restart_ms)) < 0) {
|
||||
if ((can_get_restart_ms(name, &restart_ms)) < 0) {
|
||||
fprintf(stderr, "cannot get restart_ms, "
|
||||
"something is seriously wrong\n");
|
||||
goto err_out;
|
||||
|
|
@ -567,7 +567,7 @@ err_out:
|
|||
return err;
|
||||
}
|
||||
|
||||
int scan_set_restart_ms(const char *name, __u32 restart_ms)
|
||||
int can_set_restart_ms(const char *name, __u32 restart_ms)
|
||||
{
|
||||
struct req_info req_info = {
|
||||
.restart_ms = restart_ms,
|
||||
|
|
@ -579,7 +579,7 @@ int scan_set_restart_ms(const char *name, __u32 restart_ms)
|
|||
return set_link(name, 0, &req_info);
|
||||
}
|
||||
|
||||
int scan_set_ctrlmode(const char *name, struct can_ctrlmode *cm)
|
||||
int can_set_ctrlmode(const char *name, struct can_ctrlmode *cm)
|
||||
{
|
||||
struct req_info req_info = {
|
||||
.ctrlmode = cm,
|
||||
|
|
@ -588,7 +588,7 @@ int scan_set_ctrlmode(const char *name, struct can_ctrlmode *cm)
|
|||
return set_link(name, 0, &req_info);
|
||||
}
|
||||
|
||||
int scan_set_bittiming(const char *name, struct can_bittiming *bt)
|
||||
int can_set_bittiming(const char *name, struct can_bittiming *bt)
|
||||
{
|
||||
struct req_info req_info = {
|
||||
.bittiming = bt,
|
||||
|
|
@ -597,7 +597,7 @@ int scan_set_bittiming(const char *name, struct can_bittiming *bt)
|
|||
return set_link(name, 0, &req_info);
|
||||
}
|
||||
|
||||
int scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
|
||||
int can_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
|
||||
{
|
||||
struct can_bittiming bt;
|
||||
|
||||
|
|
@ -605,30 +605,30 @@ int scan_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
|
|||
bt.bitrate = bitrate;
|
||||
bt.sample_point = sample_point;
|
||||
|
||||
return scan_set_bittiming(name, &bt);
|
||||
return can_set_bittiming(name, &bt);
|
||||
}
|
||||
|
||||
int scan_get_state(const char *name, int *state)
|
||||
int can_get_state(const char *name, int *state)
|
||||
{
|
||||
return get_link(name, GET_STATE, state);
|
||||
}
|
||||
|
||||
int scan_get_restart_ms(const char *name, __u32 *restart_ms)
|
||||
int can_get_restart_ms(const char *name, __u32 *restart_ms)
|
||||
{
|
||||
return get_link(name, GET_RESTART_MS, restart_ms);
|
||||
}
|
||||
|
||||
int scan_get_bittiming(const char *name, struct can_bittiming *bt)
|
||||
int can_get_bittiming(const char *name, struct can_bittiming *bt)
|
||||
{
|
||||
return get_link(name, GET_BITTIMING, bt);
|
||||
}
|
||||
|
||||
int scan_get_ctrlmode(const char *name, struct can_ctrlmode *cm)
|
||||
int can_get_ctrlmode(const char *name, struct can_ctrlmode *cm)
|
||||
{
|
||||
return get_link(name, GET_CTRLMODE, cm);
|
||||
}
|
||||
|
||||
int scan_get_clock(const char *name, struct can_clock *clock)
|
||||
int can_get_clock(const char *name, struct can_clock *clock)
|
||||
{
|
||||
return get_link(name, GET_CLOCK, clock);
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ noinst_PROGRAMS = \
|
|||
test_SOURCES = \
|
||||
test.c
|
||||
test_LDADD = \
|
||||
$(top_builddir)/src/libsocketcan-nl.la
|
||||
$(top_builddir)/src/libsocketcan.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
|
|
|
|||
Loading…
Reference in New Issue