source: rtems/cpukit/score/src/objectidtoname.c @ b2b143f4

4.104.114.84.9
Last change on this file since b2b143f4 was b2b143f4, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 5, 2004 at 5:58:51 PM

2004-03-05 Joel Sherrill <joel@…>

  • libblock/src/bdbuf.c, libblock/src/ramdisk.c, libcsupport/src/newlibc.c, libcsupport/src/sync.c, libmisc/cpuuse/cpuuse.c, libmisc/monitor/mon-symbols.c, libmisc/shell/cmds.c, libmisc/shell/shell.c, libnetworking/kern/kern_sysctl.c, libnetworking/lib/ftpfs.c, libnetworking/lib/tftpDriver.c, libnetworking/libc/gethostbydns.c, libnetworking/libc/gethostbyht.c, libnetworking/libc/gethostnamadr.c, libnetworking/libc/getnetbyht.c, libnetworking/libc/getnetnamadr.c, libnetworking/libc/inet_addr.c, libnetworking/libc/linkaddr.c, libnetworking/libc/map_v4v6.c, libnetworking/libc/ns_print.c, libnetworking/libc/ns_ttl.c, libnetworking/libc/nsap_addr.c, libnetworking/libc/rcmd.c, libnetworking/libc/res_debug.c, libnetworking/libc/res_mkupdate.c, libnetworking/libc/res_query.c, libnetworking/libc/res_send.c, libnetworking/libc/res_update.c, libnetworking/net/radix.c, libnetworking/rtems/mkrootfs.c, librpc/src/rpc/clnt_perror.c, librpc/src/rpc/rtems_rpc.c, librpc/src/rpc/svc.c, sapi/include/confdefs.h, score/macros/rtems/score/chain.inl, score/src/objectidtoname.c:
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  Obtain Object Name Given ID
3 *
4 *
5 *  COPYRIGHT (c) 1989-2003.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/score/object.h>
17
18/*PAGE
19 *
20 *  _Objects_Id_to_name
21 *
22 *  DESCRIPTION:
23 *
24 *  This routine returns the name associated with the given ID.
25 *
26 *  INPUT:
27 *
28 *  id   - id of object to lookup name
29 *  name - pointer to location in which to store name
30 *
31 */
32
33
34Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
35  Objects_Id      id,
36  Objects_Name   *name
37)
38{
39  unsigned32           the_api;
40  unsigned32           the_class;
41  Objects_Information *information;
42  Objects_Control     *the_object = (Objects_Control *) 0;
43  Objects_Locations    ignored_location;
44 
45  if ( !name )
46    return OBJECTS_INVALID_NAME;
47
48  the_api = _Objects_Get_API( id );
49  if ( the_api && the_api > OBJECTS_APIS_LAST )
50    return OBJECTS_INVALID_ID;
51 
52  the_class = _Objects_Get_class( id );
53
54  information = _Objects_Information_table[ the_api ][ the_class ];
55  if ( !information )
56    return OBJECTS_INVALID_ID;
57 
58  if ( information->is_string )
59    return OBJECTS_INVALID_ID;
60
61  the_object = _Objects_Get( information, id, &ignored_location  );
62  if (!the_object)
63    return OBJECTS_INVALID_ID;
64
65  *name = the_object->name;
66  return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
67}
Note: See TracBrowser for help on using the repository browser.