source: rtems/cpukit/score/src/objectnametoidstring.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 *  Object Handler - Object ID to Name (String)
3 *
4 *  COPYRIGHT (c) 1989-2010.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <string.h>
17
18#include <rtems/system.h>
19#include <rtems/score/address.h>
20#include <rtems/score/chain.h>
21#include <rtems/score/object.h>
22#if defined(RTEMS_MULTIPROCESSING)
23#include <rtems/score/objectmp.h>
24#endif
25#include <rtems/score/thread.h>
26#include <rtems/score/wkspace.h>
27#include <rtems/score/sysstate.h>
28#include <rtems/score/isr.h>
29
30#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
31/*
32 *  _Objects_Name_to_id_string
33 *
34 *  These kernel routines search the object table(s) for the given
35 *  object name and returns the associated object id.
36 *
37 *  Input parameters:
38 *    information - object information
39 *    name        - user defined object name
40 *    id          - address of return ID
41 *
42 *  Output parameters:
43 *    id                                   - object id
44 *    OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL - if successful
45 *    error code                           - if unsuccessful
46 */
47
48Objects_Name_or_id_lookup_errors _Objects_Name_to_id_string(
49  Objects_Information *information,
50  const char          *name,
51  Objects_Id          *id
52)
53{
54  Objects_Control           *the_object;
55  uint32_t                   index;
56
57  /* ASSERT: information->is_string == true */
58
59  if ( !id )
60    return OBJECTS_INVALID_ADDRESS;
61
62  if ( !name )
63    return OBJECTS_INVALID_NAME;
64
65  if ( information->maximum != 0 ) {
66
67    for ( index = 1; index <= information->maximum; index++ ) {
68      the_object = information->local_table[ index ];
69      if ( !the_object )
70        continue;
71
72      if ( !the_object->name.name_p )
73        continue;
74
75      if (!strncmp( name, the_object->name.name_p, information->name_length)) {
76        *id = the_object->id;
77        return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
78      }
79    }
80  }
81
82  return OBJECTS_INVALID_NAME;
83}
84#endif
Note: See TracBrowser for help on using the repository browser.