*/
-/****h* silcutil/SILC Errno
+/****h* silcutil/Errno Interface
*
* DESCRIPTION
*
#ifndef SILCERRNO_H
#define SILCERRNO_H
-/****d* silcutil/SilcErrnoAPI/SilcResult
+/****d* silcutil/SilcResult
*
* NAME
*
} SilcResult;
/***/
-/****d* silcutil/SilcErrnoAPI/silc_errno
+/****d* silcutil/silc_errno
*
* NAME
*
***/
#define silc_errno silc_get_errno()
-/****f* silcutil/SilcErrnoAPI/silc_errno_string
+/****f* silcutil/silc_errno_string
*
* NAME
*
***/
const char *silc_errno_string(SilcResult error);
-/****d* silcutil/SilcErrnoAPI/silc_errno_string
+/****d* silcutil/silc_errno_reason
*
* NAME
*
***/
const char *silc_errno_reason(void);
-/* Low-level routines for the error handling. */
+/****d* silcutil/silc_errno_location
+ *
+ * NAME
+ *
+ * SilcBool silc_errno_location(const char **filename,
+ * SilcUInt32 *current_line,
+ * SilcUInt32 *current_column);
+ *
+ * DESCRIPTION
+ *
+ * Returns the error location information. The filename where the error
+ * occurred is returned to `filename'. The line and columns where the
+ * error occurred is returned to `current_line' and `current_column',
+ * respectively, or 0 is returned if the information is not present.
+ *
+ * Returns FALSE if the location information is not available.
+ *
+ ***/
+SilcBool silc_errno_location(const char **filename,
+ SilcUInt32 *current_line,
+ SilcUInt32 *current_column);
-/* Return last error */
-SilcResult silc_get_errno(void);
+/* Low-level routines for the error handling. */
-/* Set error */
+/****d* silcutil/silc_set_errno
+ *
+ * NAME
+ *
+ * void silc_set_errno(SilcResult error);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error for current thread.
+ *
+ ***/
void silc_set_errno(SilcResult error);
-/* Set error, cannot fail. */
+/****d* silcutil/silc_set_errno_nofail
+ *
+ * NAME
+ *
+ * void silc_set_errno_nofail(SilcResult error);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error for current thread. This call
+ * itself cannot cause setting of errno.
+ *
+ ***/
void silc_set_errno_nofail(SilcResult error);
-/* Set error and reason string. */
+/****d* silcutil/silc_set_errno_reason
+ *
+ * NAME
+ *
+ * void silc_set_errno_reason(SilcResult error, const char *format, ...);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error reason for current thread.
+ *
+ ***/
void silc_set_errno_reason(SilcResult error, const char *format, ...);
-/* Set error and reason string, cannot fail. */
+/****d* silcutil/silc_set_errno_reason_nofail
+ *
+ * NAME
+ *
+ * void silc_set_errno_reason_nofail(SilcResult error,
+ * const char *format, ...);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error reason for current thread. This
+ * call itself cannot cause setting of errno.
+ *
+ ***/
void silc_set_errno_reason_nofail(SilcResult error, const char *format, ...);
-/* Set error from POSIX errno */
+/****d* silcutil/silc_set_errno_posix
+ *
+ * NAME
+ *
+ * void silc_set_errno_posix(int error);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error for current thread from POSIX
+ * errno.
+ *
+ ***/
void silc_set_errno_posix(int error);
+/****d* silcutil/silc_set_errno_location
+ *
+ * NAME
+ *
+ * void silc_set_errno_location(const char *filename,
+ * SilcUInt32 current_line_number,
+ * SilcUInt32 current_column_number);
+ *
+ * DESCRIPTION
+ *
+ * A low level routine to set the error location in a file indicated by
+ * the `filename'. The `current_line_number' is the line where the
+ * error occurred. The `current_column_number' number if the column in
+ * the line where the error occurred or 0 if so such information is
+ * present. The errno must be set before calling this function.
+ *
+ ***/
+void silc_set_errno_location(const char *filename,
+ SilcUInt32 current_line_number,
+ SilcUInt32 current_column_number);
+
+/* Return last error */
+SilcResult silc_get_errno(void);
+
#endif /* SILCERRNO_H */