Changeset c64e4ed4 in rtems for c/src/libmisc/assoc


Ignore:
Timestamp:
01/15/96 21:50:28 (27 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
a625ccd
Parents:
5c491aef
Message:

updates from Tony Bennett for PA and UNIX ports

Location:
c/src/libmisc/assoc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/libmisc/assoc/assoc.c

    r5c491aef rc64e4ed4  
    11/*
    2  *      @(#)assoc.c     1.4 - 95/08/02
    3  *     
     2 *      @(#)assoc.c     1.6 - 95/10/25
     3 *
    44 *
    55 * assoc.c
     
    99 */
    1010
    11 
    1211#include <rtems.h>
    1312#include "assoc.h"
     
    1918#define rtems_assoc_is_default(ap)  ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME))
    2019
    21 rtems_assoc_t *
     20const rtems_assoc_t *
    2221rtems_assoc_ptr_by_name(
    23     rtems_assoc_t *ap,
    24     char *name
    25   )
    26 {
    27     rtems_assoc_t *default_ap = 0;
     22    const rtems_assoc_t *ap,
     23    const char *name
     24  )
     25{
     26    const rtems_assoc_t *default_ap = 0;
    2827
    2928    if (rtems_assoc_is_default(ap))
     
    3736}
    3837
    39 rtems_assoc_t *
     38const rtems_assoc_t *
    4039rtems_assoc_ptr_by_local(
    41     rtems_assoc_t *ap,
    42     unsigned32     local_value
    43   )
    44 {
    45     rtems_assoc_t *default_ap = 0;
     40    const rtems_assoc_t *ap,
     41    unsigned32     local_value
     42  )
     43{
     44    const rtems_assoc_t *default_ap = 0;
    4645
    4746    if (rtems_assoc_is_default(ap))
     
    5655
    5756
    58 rtems_assoc_t *
     57const rtems_assoc_t *
    5958rtems_assoc_ptr_by_remote(
    60     rtems_assoc_t *ap,
    61     unsigned32     remote_value
    62   )
    63 {
    64     rtems_assoc_t *default_ap = 0;
     59    const rtems_assoc_t *ap,
     60    unsigned32     remote_value
     61  )
     62{
     63    const rtems_assoc_t *default_ap = 0;
    6564
    6665    if (rtems_assoc_is_default(ap))
     
    8180unsigned32
    8281rtems_assoc_remote_by_local(
    83     rtems_assoc_t *ap,
    84     unsigned32     local_value
    85   )
    86 {
    87     rtems_assoc_t *nap;
     82    const rtems_assoc_t *ap,
     83    unsigned32     local_value
     84  )
     85{
     86    const rtems_assoc_t *nap;
    8887    nap = rtems_assoc_ptr_by_local(ap, local_value);
    8988    if (nap)
     
    9594unsigned32
    9695rtems_assoc_local_by_remote(
    97     rtems_assoc_t *ap,
    98     unsigned32     remote_value
    99   )
    100 {
    101     rtems_assoc_t *nap;
     96    const rtems_assoc_t *ap,
     97    unsigned32     remote_value
     98  )
     99{
     100    const rtems_assoc_t *nap;
    102101    nap = rtems_assoc_ptr_by_remote(ap, remote_value);
    103102    if (nap)
     
    109108unsigned32
    110109rtems_assoc_remote_by_name(
    111     rtems_assoc_t *ap,
    112     char          *name
    113   )
    114 {
    115     rtems_assoc_t *nap;
     110    const rtems_assoc_t *ap,
     111    const char          *name
     112  )
     113{
     114    const rtems_assoc_t *nap;
    116115    nap = rtems_assoc_ptr_by_name(ap, name);
    117116    if (nap)
     
    123122unsigned32
    124123rtems_assoc_local_by_name(
    125     rtems_assoc_t *ap,
    126     char          *name
    127   )
    128 {
    129     rtems_assoc_t *nap;
     124    const rtems_assoc_t *ap,
     125    const char          *name
     126  )
     127{
     128    const rtems_assoc_t *nap;
    130129    nap = rtems_assoc_ptr_by_name(ap, name);
    131130    if (nap)
     
    140139 */
    141140
    142 char *
     141const char *
    143142rtems_assoc_name_bad(
    144143    unsigned32 bad_value
    145144)
    146145{
     146#ifdef RTEMS_DEBUG
    147147    static char bad_buffer[32];
    148148
    149149    sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value);
     150#else
     151    static char bad_buffer[32] = "<assoc.c: BAD NAME>";
     152#endif
    150153    return bad_buffer;
    151154}
    152155
    153156
    154 char *
     157const char *
    155158rtems_assoc_name_by_local(
    156     rtems_assoc_t *ap,
    157     unsigned32     local_value
    158   )
    159 {
    160     rtems_assoc_t *nap;
     159    const rtems_assoc_t *ap,
     160    unsigned32     local_value
     161  )
     162{
     163    const rtems_assoc_t *nap;
    161164    nap = rtems_assoc_ptr_by_local(ap, local_value);
    162165    if (nap)
     
    166169}
    167170
    168 char *
     171const char *
    169172rtems_assoc_name_by_remote(
    170     rtems_assoc_t *ap,
    171     unsigned32     remote_value
    172   )
    173 {
    174     rtems_assoc_t *nap;
     173    const rtems_assoc_t *ap,
     174    unsigned32     remote_value
     175  )
     176{
     177    const rtems_assoc_t *nap;
    175178    nap = rtems_assoc_ptr_by_remote(ap, remote_value);
    176179    if (nap)
     
    186189
    187190unsigned32 rtems_assoc_remote_by_local_bitfield(
    188     rtems_assoc_t *ap,
     191    const rtems_assoc_t *ap,
    189192    unsigned32     local_value
    190193  )
     
    202205
    203206unsigned32 rtems_assoc_local_by_remote_bitfield(
    204     rtems_assoc_t *ap,
     207    const rtems_assoc_t *ap,
    205208    unsigned32     remote_value
    206209  )
     
    216219}
    217220
    218 char *rtems_assoc_name_by_remote_bitfield(
    219     rtems_assoc_t *ap,
     221char *
     222rtems_assoc_name_by_remote_bitfield(
     223    const rtems_assoc_t *ap,
    220224    unsigned32     value,
    221225    char          *buffer
     
    237241}
    238242
    239 char *rtems_assoc_name_by_local_bitfield(
    240     rtems_assoc_t *ap,
     243char *
     244rtems_assoc_name_by_local_bitfield(
     245    const rtems_assoc_t *ap,
    241246    unsigned32     value,
    242247    char          *buffer
  • c/src/libmisc/assoc/assoc.h

    r5c491aef rc64e4ed4  
    11/*
    2  *      @(#)assoc.h     1.2 - 95/06/28
     2 *      @(#)assoc.h     1.4 - 95/10/25
    33 *     
    44 *
     
    1414
    1515typedef struct {
    16     char *name;
     16    const char  *name;
    1717    unsigned32   local_value;
    1818    unsigned32   remote_value;
     
    2525#define RTEMS_ASSOC_DEFAULT_NAME "(default)"
    2626
    27 rtems_assoc_t *rtems_assoc_ptr_by_name(rtems_assoc_t *, char *);
    28 rtems_assoc_t *rtems_assoc_ptr_by_value(rtems_assoc_t *, unsigned32);
    29 rtems_assoc_t *rtems_assoc_ptr_by_remote(rtems_assoc_t *, unsigned32);
     27const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *);
     28const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32);
     29const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32);
    3030
    31 unsigned32   rtems_assoc_remote_by_local(rtems_assoc_t *, unsigned32);
    32 unsigned32   rtems_assoc_local_by_remote(rtems_assoc_t *, unsigned32);
    33 unsigned32   rtems_assoc_remote_by_name(rtems_assoc_t *, char *);
    34 unsigned32   rtems_assoc_local_by_name(rtems_assoc_t *, char *);
    35 char        *rtems_assoc_name_by_local(rtems_assoc_t *, unsigned32);
    36 char        *rtems_assoc_name_by_remote(rtems_assoc_t *, unsigned32);
     31unsigned32   rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32);
     32unsigned32   rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32);
     33unsigned32   rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *);
     34unsigned32   rtems_assoc_local_by_name(const rtems_assoc_t *, const char *);
     35const char  *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32);
     36const char  *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32);
    3737
    38 unsigned32   rtems_assoc_remote_by_local_bitfield(rtems_assoc_t *, unsigned32);
    39 char        *rtems_assoc_name_by_local_bitfield(rtems_assoc_t *, unsigned32, char *);
    40 char        *rtems_assoc_name_by_remote_bitfield(rtems_assoc_t *, unsigned32, char *);
    41 unsigned32   rtems_assoc_local_by_remote_bitfield(rtems_assoc_t *ap, unsigned32);
     38unsigned32   rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32);
     39char  *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *);
     40char  *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *);
     41unsigned32   rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32);
    4242
    4343
Note: See TracChangeset for help on using the changeset viewer.