---
name: "roy"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/roy"
---

# roy(3)

the roy library

## NAME

roy - the roy library

## SYNOPSIS

\#include \<roy.h\>

## DESCRIPTION

Roy is a multipurpose user-space library implementation for some of the common datatypes people use as well as helper functions for dealing with the underlying system.

The goal was a combination of speed, ease of use, and correctness. The license is also very liberal, allowing use in basically any situation.

See [*rinit*(3)](/rinit/3.md) on how to initalize the roy library.

Much of the API is implmented using C macros as well as regular function calls.

- Linking

  To link with the roy code, a shell script, [*roy-config*(1)](/roy-config/1.md) is included. This utility allows proper linking regardless of installation location.

- Data Structures

  RList - doublely linked list, [*rlist*(3)](/rlist/3.md).

  RBuf - string/data buffer, [*rbuf*(3)](/rbuf/3.md).

  RHash - hash table, [*rhash*(3)](/rhash/3.md).

  RBHash - hash table with rbuf keys, [*rbhash*(3)](/rbhash/3.md).

  RArray - bucketized array implementation, [*rarray*(3)](/rarray/3.md).

- System Helpers

  RFlag - simple integer flag setter/getter, [*rflag*(3)](/rflag/3.md).

  RChunk - fast memory allocator, [*rchunk*(3)](/rchunk/3.md).

  RBucket - even faster memory allocator with different behavior, [*rbucket*(3)](/rbucket/3.md).

  RMem - memory management, [*rmem*(3)](/rmem/3.md).

  RDebug - debugging message helper, [*rdebug*(3)](/rdebug/3.md).

  RXp - cross platform encoding/decoding, [*rxp*(3)](/rxp/3.md).

  RMain - cross platform mainloop (Win32 and UNIX) [*rmain*(3)](/rmain/3.md).

  RThread - cross platform threading (Win32 and UNIX) [*rthread*(3)](/rthread/3.md).

  RTherml - THERML markup parser (similar to XML).

- Linking

  If you use Roy, you should look at [*roy-config*(1)](/roy-config/1.md) for  details on how to properly (and portably) link Roy  into your application.

- RFOREACH\_CLOSE

  This macro is used to close the foreach style iterations used in several places within Roy.

  For example, this is the way to run down an rlist of entries.

  ```
          RLIST_FOREACH (list, entry) {
                  /* Code goes here. */
          } RFOREACH_CLOSE;
  ```

## LICENSE

The roy library is provided under the X/MIT license as follows:

Copyright (c) 1999-2003, Ian Main \<ian4@stemwinder.org\> All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## SEE ALSO

[*rarray*(3)](/rarray/3.md), [*rbhash*(3)](/rbhash/3.md),  [*rbucket*(3)](/rbucket/3.md), [*rbuf*(3)](/rbuf/3.md),  [*rchunk*(3)](/rchunk/3.md), [*rdebug*(3)](/rdebug/3.md),  [*rflag*(3)](/rflag/3.md), [*rhash*(3)](/rhash/3.md),  [*rinit*(3)](/rinit/3.md), [*rlist*(3)](/rlist/3.md),  [*rmain*(3)](/rmain/3.md), [*rmdbg*(3)](/rmdbg/3.md),  [*rmem*(3)](/rmem/3.md), [*rthread*(3)](/rthread/3.md),  [*rxp*(3)](/rxp/3.md), [*roy-config*(1)](/roy-config/1.md)
