# rtai_nam2num.h File Reference

## Detailed Description

Conversion between characters strings and unsigned long identifiers.

Convert a 6 characters string to un unsigned long, and vice versa, to be used as an identifier for RTAI services symmetrically available in user and kernel space, e.g. shared memory and LXRT and LXRT-INFORMED.

Author:
  Paolo Mantegazza

Note:
  Copyright © 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Include dependency graph for rtai_nam2num.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

unsigned long | nam2num (const char *name)
| Convert a 6 characters string to an unsigned long.
void | num2nam (unsigned long num, char *name)
| Convert an unsigned long to a 6 characters string.

## Function Documentation

unsigned long nam2num | ( | const char * | name | ) | `[inline, static]`

Convert a 6 characters string to an unsigned long.

Converts a 6 characters string name containing an alpha numeric identifier to its corresponding unsigned long identifier.

Parameters:

  | name | is the name to be converted.

Allowed characters are:

- english letters (no difference between upper and lower case);
- decimal digits;
- underscore (_) and another character of your choice. The latter will be always converted back to a $ by num2nam().

Returns:
  the unsigned long associated with name.

void num2nam | ( | unsigned long | num,
|  | char * | name
| ) | `[inline, static]`

Convert an unsigned long to a 6 characters string.

Parameters:

  | num | is the unsigned long identifier whose alphanumeric name string has to be evaluated;
  | name | is a pointer to a 6 characters buffer where the identifier will be returned.