source: rtems/cpukit/rtems/src/rtemsobjectsetname.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 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: 1.5 KB
Line 
1/*
2 *  RTEMS Object Helper -- Set Name of Object as String
3 *
4 *  COPYRIGHT (c) 1989-2008.
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#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/object.h>
18#include <rtems/score/thread.h>
19#include <rtems/rtems/status.h>
20#include <rtems/rtems/types.h>
21#include <rtems/rtems/object.h>
22
23/*
24 *  This method will set the object name based upon the user string.
25 *  If the object class uses 32-bit names, then only the first 4 bytes
26 *  of the string will be used.
27 */
28rtems_status_code rtems_object_set_name(
29  rtems_id       id,
30  const char    *name
31)
32{
33  Objects_Information *information;
34  Objects_Locations    location;
35  Objects_Control     *the_object;
36  Objects_Id           tmpId;
37
38  if ( !name )
39    return RTEMS_INVALID_ADDRESS;
40
41  tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
42
43  information  = _Objects_Get_information_id( tmpId );
44  if ( !information )
45    return RTEMS_INVALID_ID;
46
47  the_object = _Objects_Get( information, tmpId, &location );
48  switch ( location ) {
49
50    case OBJECTS_LOCAL:
51      _Objects_Set_name( information, the_object, name );
52      _Thread_Enable_dispatch();
53      return RTEMS_SUCCESSFUL;
54
55#if defined(RTEMS_MULTIPROCESSING)
56    case OBJECTS_REMOTE:
57#endif
58    case OBJECTS_ERROR:
59      break;
60  }
61
62  return RTEMS_INVALID_ID;
63}
Note: See TracBrowser for help on using the repository browser.