summaryrefslogtreecommitdiffstats
path: root/c/src/libmisc/assoc
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/libmisc/assoc')
-rw-r--r--c/src/libmisc/assoc/Makefile.in69
-rw-r--r--c/src/libmisc/assoc/assoc.c250
-rw-r--r--c/src/libmisc/assoc/assoc.h42
-rw-r--r--c/src/libmisc/assoc/assocnamebad.c37
4 files changed, 0 insertions, 398 deletions
diff --git a/c/src/libmisc/assoc/Makefile.in b/c/src/libmisc/assoc/Makefile.in
deleted file mode 100644
index 7708eb42e1..0000000000
--- a/c/src/libmisc/assoc/Makefile.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ..
-subdir = assoc
-
-RTEMS_ROOT = @RTEMS_ROOT@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-VPATH = @srcdir@
-
-LIB = ${ARCH}/libassoc-tmp.a
-
-# C source names, if any, go here -- minus the .c
-C_PIECES = assoc assocnamebad
-C_FILES = $(C_PIECES:%=%.c)
-C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
-
-H_FILES = $(srcdir)/assoc.h
-
-SRCS = $(C_FILES) $(H_FILES) $(INSTALLED_H_FILES)
-OBJS = $(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-INSTALL_CHANGE = @INSTALL_CHANGE@
-mkinstalldirs = $(SHELL) $(top_srcdir)/@RTEMS_TOPdir@/mkinstalldirs
-
-INSTALLDIRS = $(PROJECT_INCLUDE)/rtems
-
-$(INSTALLDIRS):
- @$(mkinstalldirs) $(INSTALLDIRS)
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS += -I.
-CFLAGS +=
-
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here. The config files
-# already know how to delete some stuff, so you may want
-# to just run 'make clean' first to see what gets missed.
-# 'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-${LIB}: ${SRCS} ${OBJS}
- $(make-library)
-
-all: ${ARCH} $(SRCS) $(LIB)
- @$(INSTALL_CHANGE) -m 644 $(H_FILES) $(PROJECT_INCLUDE)/rtems
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/c/src/libmisc/assoc/assoc.c b/c/src/libmisc/assoc/assoc.c
deleted file mode 100644
index 5a24bd43a7..0000000000
--- a/c/src/libmisc/assoc/assoc.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (strcmp(ap->name, name) == 0)
- return ap;
-
- return default_ap;
-}
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->local_value == local_value)
- return ap;
-
- return default_ap;
-}
-
-
-const rtems_assoc_t *
-rtems_assoc_ptr_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *default_ap = 0;
-
- if (rtems_assoc_is_default(ap))
- default_ap = ap++;
-
- for ( ; ap->name; ap++)
- if (ap->remote_value == remote_value)
- return ap;
-
- return default_ap;
-}
-
-
-/*
- * Get values
- */
-
-unsigned32
-rtems_assoc_remote_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_remote_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->remote_value;
-
- return 0;
-}
-
-unsigned32
-rtems_assoc_local_by_name(
- const rtems_assoc_t *ap,
- const char *name
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_name(ap, name);
- if (nap)
- return nap->local_value;
-
- return 0;
-}
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *rtems_assoc_name_bad(
- unsigned32 bad_value
-);
-
-/* body in separate file to reduce dependency on printf */
-
-
-const char *
-rtems_assoc_name_by_local(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_local(ap, local_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(local_value);
-}
-
-const char *
-rtems_assoc_name_by_remote(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- const rtems_assoc_t *nap;
- nap = rtems_assoc_ptr_by_remote(ap, remote_value);
- if (nap)
- return nap->name;
-
- return rtems_assoc_name_bad(remote_value);
-}
-
-/*
- * Bitfield functions assume just 1 bit set in each of remote and local
- * entries; they do not check for this.
- */
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 local_value
- )
-{
- unsigned32 b;
- unsigned32 remote_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & local_value)
- remote_value |= rtems_assoc_remote_by_local(ap, b);
-
- return remote_value;
-}
-
-
-unsigned32 rtems_assoc_local_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 remote_value
- )
-{
- unsigned32 b;
- unsigned32 local_value = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & remote_value)
- local_value |= rtems_assoc_local_by_remote(ap, b);
-
- return local_value;
-}
-
-char *
-rtems_assoc_name_by_remote_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_remote(ap, b));
- }
-
- return buffer;
-}
-
-char *
-rtems_assoc_name_by_local_bitfield(
- const rtems_assoc_t *ap,
- unsigned32 value,
- char *buffer
- )
-{
- unsigned32 b;
-
- *buffer = 0;
-
- for (b = 1; b; b <<= 1)
- if (b & value)
- {
- if (*buffer)
- strcat(buffer, " ");
- strcat(buffer, rtems_assoc_name_by_local(ap, b));
- }
-
- return buffer;
-}
diff --git a/c/src/libmisc/assoc/assoc.h b/c/src/libmisc/assoc/assoc.h
deleted file mode 100644
index 1982d654ac..0000000000
--- a/c/src/libmisc/assoc/assoc.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Rtems associativity routines. Mainly used to convert a value from
- * one space to another (eg: our errno's to host errno's and v.v)
- *
- *
- * $Id$
- */
-
-#ifndef _INCLUDE_ASSOC_H
-#define _INCLUDE_ASSOC_H
-
-typedef struct {
- const char *name;
- unsigned32 local_value;
- unsigned32 remote_value;
-} rtems_assoc_t;
-
-/*
- * Flag/marker for optional default value in each table
- */
-
-#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
-const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
-unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
-unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
-const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
-const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
-
-unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
-char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
-char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
-unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
-
-
-#endif /* ! _INCLUDE_ASSOC_H */
diff --git a/c/src/libmisc/assoc/assocnamebad.c b/c/src/libmisc/assoc/assocnamebad.c
deleted file mode 100644
index e336c39cc7..0000000000
--- a/c/src/libmisc/assoc/assocnamebad.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * assoc.c
- * rtems assoc routines
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include "assoc.h"
-
-#include <stdio.h> /* sprintf */
-#include <string.h> /* strcat, strcmp */
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-#define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
-
-/*
- * what to return if a value is not found
- * this is not reentrant, but it really shouldn't be invoked anyway
- */
-
-const char *
-rtems_assoc_name_bad(
- unsigned32 bad_value
-)
-{
-#ifdef RTEMS_DEBUG
- static char bad_buffer[32];
-
- sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
-#else
- static char bad_buffer[32] = "<assoc.c: BAD NAME>";
-#endif
- return bad_buffer;
-}
-
-