WCSCMP(3POSIX)

πŸ’– WCSCMP(3POSIX) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual page for wcscmp β€” yes it's the 3POSIX one, and no, it's not the Linux man page, they are lowkey different, keep reading πŸ‘‘


✨ PROLOG ✨

so like, heads up: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” and by "may differ" I mean please go read the corresponding Linux manual page for the deets on Linux behavior β€” or the interface may not even be implemented on Linux at all. πŸ’€


🌸 NAME 🌸

wcscmp β€” compare two wide-character strings. that's the whole job. iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

int wcscmp(const wchar_t *ws1, const wchar_t *ws2);

πŸ¦‹ DESCRIPTION πŸ¦‹

The functionality described on this reference page is aligned with the ISO C standard. And like, if there's any conflict between the requirements described here and the ISO C standard? That's unintentional, fr fr. This volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

The wcscmp() function shall compare the wide-character string pointed to by ws1 to the wide-character string pointed to by ws2. two strings, one vibe check, let's go 🫢

The sign of a non-zero return value shall be determined by the sign of the difference between the values of the first pair of wide-character codes that differ in the objects being compared. so it's not like, a whole sum or anything β€” it's literally just the first place they disagree, and that's what decides everything. main character moment for that one character tbh ⭐


πŸ”₯ RETURN VALUE πŸ”₯

Upon completion, wcscmp() shall return an integer that is:

  • greater than 0 if the wide-character string pointed to by ws1 is greater than the wide-character string pointed to by ws2
  • equal to 0 if they're equal
  • less than 0 if ws1's string is less than ws2's string

respectively, obviously πŸ’…


πŸ™ˆ ERRORS πŸ™ˆ

No errors are defined. she simply does not fail. slay.

The following sections are informative.

🌈 EXAMPLES 🌈

None. nothing to show bestie, it's giving minimalism 😭


πŸ’œ APPLICATION USAGE πŸ’œ

None. genuinely nothing extra to say here.


🧚 RATIONALE 🧚

None. no lore. no backstory. we move.


⭐ FUTURE DIRECTIONS ⭐

None. the future is unwritten and honestly so is this section.


πŸ‘‘ SEE ALSO πŸ‘‘

  • wcscasecmp()
  • wcsncmp()

And from the Base Definitions volume of POSIX.1‐2017: <wchar.h> πŸ’–


okay legal bestie moment, listen up:

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.

In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. (translation: the og wins, always 🫑) The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear 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 .


so yeah, that's the whole page β€” brought to you by IEEE/The Open Group, dated 2017, and you just read WCSCMP(3POSIX) all the way to the end. not me being proud of you πŸ₯ΉπŸ’– go compare some wide-character strings, you got this βœ¨πŸŒΈπŸ¦‹