nl_types.h(0P)

πŸ’– nl_types.h β€” data types πŸ’–

okay bestie, so this one is a header from the POSIX Programmer's Manual β€” it's nl_types.h(0P) if you're keeping track β€” and it's literally just the little corner of POSIX that hands you the types and constants you need for message catalogs. no cap, it's short and it's cute. let's get into it. πŸ¦‹


🌸 PROLOG 🌸

bestie, heads up: this page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so if you're on Linux, go consult the corresponding Linux manual page for the details on Linux behavior), or β€” plot twist β€” the interface might not even be implemented on Linux at all. 😭 so vibe check your platform first.


✨ NAME ✨

nl_types.h β€” data types. that's it. that's the whole name section. iconic, honestly. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <nl_types.h>

just the one include, we love a low-maintenance header. 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so the <nl_types.h> header shall define at least the following types:

  • nl_catd β€” used by the message catalog functions catopen(), catgets(), and catclose() to identify a catalog descriptor. think of it as the little name tag your open catalog wears. 🏷️
  • nl_item β€” used by nl_langinfo() to identify items of langinfo data. the values of objects of type nl_item are defined over in <langinfo.h>, so that's where you go lookin' when you need them. πŸ‘€

and <nl_types.h> shall define at least the following symbolic constants too:

  • NL_SETD β€” used by gencat when no $set directive is specified in a message text source file. you can pass this constant as the value of set_id on subsequent calls to catgets() (that is, to retrieve messages from the default message set). the value of NL_SETD is implementation-defined, so don't go assuming a number, bestie. πŸ™ˆ
  • NL_CAT_LOCALE β€” the value that must be passed as the oflag argument to catopen() to make sure message catalog selection depends on the LC_MESSAGES locale category, rather than directly on the LANG environment variable. yes, this matters. yes, it's the whole point. periodt. πŸ’…

the following shall be declared as functions and may also be defined as macros. function prototypes shall be provided:

int       catclose(nl_catd);
char     *catgets(nl_catd, int, int, const char *);
nl_catd   catopen(const char *, int);
ngl, "may also be defined as macros" is the kind of detail that will humble you at 3am when your function pointer doesn't link. just saying. πŸ’€

the following sections are informative β€” aka the chill, non-normative part of the page.


🌈 APPLICATION USAGE 🌈

None.

literally nothing. the void. empty. we stan a section with zero homework. 😌


🧚 RATIONALE 🧚

None.

again: nothing. no thoughts, head empty. πŸ“


⭐ FUTURE DIRECTIONS ⭐

None.

nothing's changing, bestie. it's giving stability. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

  • <langinfo.h>
  • the System Interfaces volume of POSIX.1‐2017: catclose(), catgets(), catopen(), nl_langinfo()
  • the Shell and Utilities volume of POSIX.1‐2017: gencat

go read those if you want the full lore, iykyk. πŸ“š


okay so legally speaking, portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. and if there's ever any discrepancy between this version and the original IEEE and The Open Group Standard β€” bestie, the original IEEE and The Open Group Standard is the referee document. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors hanging out in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! this manual came to you from IEEE/The Open Group, 2017 β€” nl_types.h(0P), out. πŸ’–βœ¨ mwah, go read your catalogs, ily. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from