Ignore:
Timestamp:
01/11/17 10:03:24 (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
b7f1fc3b
Parents:
fa9f964f
git-author:
Sebastian Huber <sebastian.huber@…> (01/11/17 10:03:24)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/12/17 06:44:36)
Message:

Add rtems_assoc_32_to_string()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/include/rtems/assoc.h

    rfa9f964f r0c43130  
    1717/**@{*/
    1818
    19 #include <stdint.h> /* uint32_t */
     19#include <stddef.h>
     20#include <stdint.h>
    2021
    2122#ifdef __cplusplus
     
    151152#endif
    152153
     154typedef struct {
     155  uint32_t    bits;
     156  const char *name;
     157} rtems_assoc_32_pair;
     158
     159/**
     160 * @brief Converts the specified value into a text representation.
     161 *
     162 * @param[in] value The value to convert.
     163 * @param[in] buffer The buffer for the text representation.
     164 * @param[in] buffer_size The buffer size in characters.
     165 * @param[in] pairs Names for particular bits.
     166 * @param[in] pair_count Count of pairs.
     167 * @param[in] separator Separator between individual names.
     168 * @param[in] fallback Fallback value in case no bits contained in the pairs
     169 *   are set in the value.
     170 *
     171 * @retval The length of the text representation.  May be greater than the
     172 * buffer size if truncation occurred.
     173 */
     174size_t rtems_assoc_32_to_string(
     175  uint32_t                   value,
     176  char                      *buffer,
     177  size_t                     buffer_size,
     178  const rtems_assoc_32_pair *pairs,
     179  size_t                     pair_count,
     180  const char                *separator,
     181  const char                *fallback
     182);
     183
    153184#ifdef __cplusplus
    154185}
Note: See TracChangeset for help on using the changeset viewer.