source: rtems/cpukit/rtems/src/rtemsobjectgetapiclassname.c @ 6b5f22dc

Last change on this file since 6b5f22dc was 6b5f22dc, checked in by Sebastian Huber <sebastian.huber@…>, on 11/26/20 at 10:45:47

rtems: Canonicalize Doxygen @file comments

Use common phrases for the file brief descriptions.

Update #3706.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSImplClassicObject
5 *
6 * @brief This source file contains the implementation of
7 *   rtems_object_get_api_class_name().
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2008.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <rtems/rtems/object.h>
24#include <rtems/score/objectimpl.h>
25
26#include <rtems/assoc.h>
27
28static const rtems_assoc_t rtems_object_api_internal_assoc[] = {
29  { "Thread",                  OBJECTS_INTERNAL_THREADS, 0},
30  { NULL,                      0, 0}
31};
32
33static const rtems_assoc_t rtems_object_api_classic_assoc[] = {
34  { "Task",                    OBJECTS_RTEMS_TASKS, 0},
35  { "Timer",                   OBJECTS_RTEMS_TIMERS, 0},
36  { "Semaphore",               OBJECTS_RTEMS_SEMAPHORES, 0},
37  { "Message Queue",           OBJECTS_RTEMS_MESSAGE_QUEUES, 0},
38  { "Partition",               OBJECTS_RTEMS_PARTITIONS, 0},
39  { "Region",                  OBJECTS_RTEMS_REGIONS, 0},
40  { "Port",                    OBJECTS_RTEMS_PORTS, 0},
41  { "Period",                  OBJECTS_RTEMS_PERIODS, 0},
42  { "Extension",               OBJECTS_RTEMS_EXTENSIONS, 0},
43  { "Barrier",                 OBJECTS_RTEMS_BARRIERS, 0},
44  { NULL,                      0, 0}
45};
46
47static const rtems_assoc_t rtems_object_api_posix_assoc[] = {
48  { "Thread",                  OBJECTS_POSIX_THREADS, 0},
49  { "Key",                     OBJECTS_POSIX_KEYS, 0},
50  { "Message Queue",           OBJECTS_POSIX_MESSAGE_QUEUES, 0},
51  { "Semaphore",               OBJECTS_POSIX_SEMAPHORES, 0},
52#ifdef RTEMS_POSIX_API
53  { "Timer",                   OBJECTS_POSIX_TIMERS, 0},
54#endif
55  { "Shared Memory",           OBJECTS_POSIX_SHMS, 0},
56  { NULL,                      0, 0}
57};
58
59const char *rtems_object_get_api_class_name(
60  int the_api,
61  int the_class
62)
63{
64  const rtems_assoc_t *api_assoc;
65  const rtems_assoc_t *class_assoc;
66
67  if ( the_api == OBJECTS_INTERNAL_API )
68    api_assoc = rtems_object_api_internal_assoc;
69  else if ( the_api == OBJECTS_CLASSIC_API )
70    api_assoc = rtems_object_api_classic_assoc;
71  else if ( the_api == OBJECTS_POSIX_API )
72    api_assoc = rtems_object_api_posix_assoc;
73  else
74    return "BAD API";
75  class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
76  if ( class_assoc )
77    return class_assoc->name;
78  return "BAD CLASS";
79}
Note: See TracBrowser for help on using the repository browser.