XMTEXTFINDSTRING(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

okay so bestie, this is XmTextFindString β€” a Text function that finds the beginning position of a text string πŸ’– it's giving "where in this whole buffer does my lil string start", and honestly? iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <Xm/Xm.h>
Boolean XmTextFindString(
Widget widget,
XmTextPosition start,
char *string,
XmTextDirection direction,
XmTextPosition *position);

πŸ’… DESCRIPTION πŸ’…

XmTextFindString locates the beginning position of a specified text string. no cap, that's the whole job 🫢

This routine searches forward or backward for the first occurrence of the string, starting from the given start position. If it finds a match, the function returns the position of the first character of the string in position. and here's a lil detail that lowkey matters: if the match string begins at the current position, this routine returns the current position. like, yes, right where you're standing counts πŸ’€

  • widget β€” Specifies the Text widget ID. that's your main character, the Text widget in question πŸ‘‘
  • start β€” Specifies the character position from which the search proceeds. This is an integer number of characters from the beginning of the text buffer. The first character position is 0 (zero). zero-indexed, as the ancients intended ✨
  • string β€” Specifies the search string. the thing you're hunting for πŸ”
  • direction β€” Indicates the search direction. It is relative to the primary direction of the text. The possible values are:
    • XmTEXT_FORWARD β€” The search proceeds toward the end of the text buffer. going forward bestie, onwards and upwards 🌈
    • XmTEXT_BACKWARD β€” The search proceeds toward the beginning of the text buffer. rewinding, scrolling back, nostalgic vibe πŸ¦‹
  • position β€” Specifies the pointer in which the first character position of the string match is returned. This is an integer number of characters from the beginning of the buffer. The first character position is 0 (zero). If the function returns False, this value is undefined.
🚨 bestie listen β€” if the function returns False, position is undefined. don't be out here reading it anyway. that's not a vibe, that's undefined behavior territory πŸ’€

For a complete definition of Text and its associated resources, see XmText(3).


🌸 RETURN 🌸

Returns True if a string match is found; otherwise, returns False. found it = True, no luck = False, periodt πŸ’…



okay that's the whole page, we ate and left no crumbs πŸ“ this was XmTextFindString(library call) β€” yes the manpage footer literally just says the same thing again, the library call title, cute of it, love that for us πŸ’œ go forth and find your strings, bestie πŸ’–