m17nError(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– m17nError β€” error handling, but make it cute (from The m17n Library, 3m17n) πŸ’–

okay bestie, sit down, we're talking about error handling in the m17n library, and honestly? it's giving "two whole ways things can go wrong" energy. let's get into it 🫢


✨ NAME ✨

m17nError β€” error handling of the m17n library, fr fr πŸ’…


🌸 SYNOPSIS 🌸

Enumerations

enum MErrorCode { MERROR_NONE, MERROR_OBJECT, MERROR_SYMBOL,
    MERROR_MTEXT, MERROR_TEXTPROP, MERROR_CHAR, MERROR_CHARTABLE,
    MERROR_CHARSET, MERROR_CODING, MERROR_RANGE, MERROR_LANGUAGE,
    MERROR_LOCALE, MERROR_PLIST, MERROR_MISC, MERROR_WIN, MERROR_X,
    MERROR_FRAME, MERROR_FACE, MERROR_DRAW, MERROR_FLT, MERROR_FONT,
    MERROR_FONTSET, MERROR_FONT_OTF, MERROR_FONT_X, MERROR_FONT_FT,
    MERROR_IM, MERROR_DB, MERROR_IO, MERROR_DEBUG, MERROR_MEMORY,
    MERROR_GD, MERROR_MAX }

Enumeration for error code of the m17n library. literally the whole menu of things that can go wrong πŸ‘‘

Variables

  • int merror_code β€” the external variable that holds the error code of the m17n library. our main character, honestly.
  • void(* m17n_memory_full_handler )(enum MErrorCode err) β€” the memory allocation error handler. the "we ran out of RAM bestie" hotline πŸ“ž

πŸ¦‹ Detailed Description πŸ¦‹

Error handling of the m17n library.

There are two types of errors that may happen in a function of the m17n library. two. that's it. that's the whole drama πŸŽ€

The first type is argument errors. When a library function is called with invalid arguments, it returns a value that indicates error and at the same time sets the external variable merror_code to a non-zero integer. so like, it tells you and it writes it down. iconic behavior ✨

The second type is memory allocation errors. When the required amount of memory is not available on the system, m17n library functions call a function pointed to by the external variable m17n_memory_full_handler. The default value of the variable is a pointer to the default_error_handle() function, which just calls exit().

😭 not the default handler literally just calling exit(). no warning, no letter, no text back. it just LEAVES. if you want a gentler breakup you gotta install your own handler, iykyk.

⭐ Enumeration Type Documentation ⭐

enum MErrorCode

Enumeration for error code of the m17n library. Enumeration for error code of the m17n library. (yes it says it twice, the doxygen girlies were thorough πŸ’€)

When a library function is called with an invalid argument, it sets the external variable merror_code to one of these values. All the error codes are positive integers.

When a memory allocation error happens, the function pointed to by the external variable m17n_memory_full_handler is called with one of these values as an argument.

Enumerator

here's the full roster, no skips, no cuts, we respect all 32 of them 🫑

  • MERROR_NONE
  • MERROR_OBJECT
  • MERROR_SYMBOL
  • MERROR_MTEXT
  • MERROR_TEXTPROP
  • MERROR_CHAR
  • MERROR_CHARTABLE
  • MERROR_CHARSET
  • MERROR_CODING
  • MERROR_RANGE
  • MERROR_LANGUAGE
  • MERROR_LOCALE
  • MERROR_PLIST
  • MERROR_MISC
  • MERROR_WIN
  • MERROR_X
  • MERROR_FRAME
  • MERROR_FACE
  • MERROR_DRAW
  • MERROR_FLT
  • MERROR_FONT
  • MERROR_FONTSET
  • MERROR_FONT_OTF
  • MERROR_FONT_X
  • MERROR_FONT_FT
  • MERROR_IM
  • MERROR_DB
  • MERROR_IO
  • MERROR_DEBUG
  • MERROR_MEMORY
  • MERROR_GD
  • MERROR_MAX

πŸ’œ Variable Documentation πŸ’œ

int merror_code

External variable to hold error code of the m17n library. The external variable merror_code holds an error code of the m17n library. When a library function is called with an invalid argument, it sets this variable to one of enum MErrorCode.

This variable initially has the value 0. so at the very start? everything's chill. zero. peaceful. before the chaos 🌈

void(* m17n_memory_full_handler) (enum MErrorCode err) (enum MErrorCode err)

Memory allocation error handler. The external variable m17n_memory_full_handler holds a pointer to the function to call when a library function failed to allocate memory. err is one of enum MErrorCode indicating in which function the error occurred.

This variable initially points a function that simply calls the exit () function with err as an argument.

An application program that needs a different error handling can change this variable to point a proper function. so yeah bestie, you can swap it out β€” go off, customise your own handler πŸ’…


πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for The m17n Library from the source code. (the robots wrote this, we're just vibing on top of it πŸ€–βœ¨)


Copyright (C) 2001 Information-technology Promotion Agency (IPA)

Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.


okay that's the whole page, you ate that πŸ“ this was Version 1.8.4, dated Mon Sep 25 2023, and it lives under m17nError(3m17n) β€” go forth and handle your errors responsibly, no cap πŸ«ΆπŸ’–

πŸ“¦ where this page comes from