---
name: "XmDirectionMatch"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmDirectionMatch"
---

# XmDirectionMatch(3)

A function that checks for a specified direction component

## NAME

**XmDirectionMatch** — A function that checks for a specified direction component

## SYNOPSIS

```
#include <Xm/Xm.h>
Boolean XmDirectionMatch (d1, d2)
        XmDirection     d1;
        XmDirection     d2;
(void)
```

## DESCRIPTION

**XmDirectionMatch** compares two **XmDirection** values. The function returns a Boolean value depending on whether or not the two input values "match." The simplest match is when *d1* and *d2* are identical. However, other matches are possible. **XmDirectionMatch** attempts to compare specified bits only; nonspecified bits automatically match.

For example, suppose that *d1* equals **XmTOP\_TO\_BOTTOM\_RIGHT\_TO\_LEFT**. In this case, the function will return True if *d2* equals either **XmRIGHT\_TO\_LEFT** or **XmTOP\_TO\_BOTTOM**. However, the function will return False if *d2* equals **XmTOP\_TO\_BOTTOM\_LEFT\_TO\_RIGHT**, **XmBOTTOM\_TO\_TOP\_RIGHT\_TO\_LEFT**, or **XmBOTTOM\_TO\_TOP\_LEFT\_TO\_RIGHT**.

Note that direction can be thought of as having three components, a horizontal component, a vertical component, and the precedence among them. This means that in addition to the previously mentioned directions, the function will still return False if *d1* equals **XmTOP\_TO\_BOTTOM\_RIGHT\_TO\_LEFT** and *d2* equals **XmRIGHT\_TO\_LEFT\_TOP\_TO\_BOTTOM**.

- *d1*

  Specifies an **XmDirection** value.

- *d2*

  Specifies an **XmDirection** value.

## RETURN VALUES

Returns True if *d1* "matches" *d2*; otherwise, returns False.

## RELATED INFORMATION

[**XmDirection**(3)](/XmDirection/3.md), [**XmDirectionMatchPartial**(3)](/XmDirectionMatchPartial/3.md), [**XmDirectionToStringDirection**(3)](/XmDirectionToStringDirection/3.md), [**XmString**(3)](/XmString/3.md), [**XmStringDirection**(3)](/XmStringDirection/3.md), and [**XmStringDirectionToDirection**(3)](/XmStringDirectionToDirection/3.md).
