Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCError.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
24
25#ifndef _WRAPS_C_TFCERROR_H_
26#define _WRAPS_C_TFCERROR_H_
27
28#include "tf_port_c.h"
29
30// Handles
31
36struct CAPI_EXPORT tfErrorHandle {
37 void *tfObj;
38};
39
40
42// Error //
44
45
53CAPI_FUNC(HRESULT) tfError_getErr(struct tfErrorHandle *handle, HRESULT *err);
54
63CAPI_FUNC(HRESULT) tfError_getMsg(struct tfErrorHandle *handle, char **msg, unsigned int *numChars);
64
72CAPI_FUNC(HRESULT) tfError_getLineno(struct tfErrorHandle *handle, int *lineno);
73
82CAPI_FUNC(HRESULT) tfError_getFname(struct tfErrorHandle *handle, char **fname, unsigned int *numChars);
83
92CAPI_FUNC(HRESULT) tfError_getFunc(struct tfErrorHandle *handle, char **func, unsigned int *numChars);
93
94
96// Module functions //
98
102CAPI_FUNC(HRESULT) tfErrSet(HRESULT code, const char* msg, int line, const char* file, const char* func);
103
107CAPI_FUNC(bool) tfErrOccurred();
108
112CAPI_FUNC(void) tfErrClear();
113
117CAPI_FUNC(HRESULT) tfErrStr(struct tfErrorHandle *handle, char **str, unsigned int *numChars);
118
126CAPI_FUNC(HRESULT) tfErrGetAll(struct tfErrorHandle ***handles, unsigned int *numErrors);
127
131CAPI_FUNC(HRESULT) tfErrGetFirst(struct tfErrorHandle **handle);
132
136CAPI_FUNC(void) tfErrClearFirst();
137
141CAPI_FUNC(HRESULT) tfErrPopFirst(struct tfErrorHandle **handle);
142
143
144#endif // _WRAPS_C_TFCERROR_H_
Handle to a Error instance.
Definition tfCError.h:36
HRESULT tfErrSet(HRESULT code, const char *msg, int line, const char *file, const char *func)
HRESULT tfError_getFunc(struct tfErrorHandle *handle, char **func, unsigned int *numChars)
Get the originating function name.
HRESULT tfError_getLineno(struct tfErrorHandle *handle, int *lineno)
Get the originating line number.
HRESULT tfErrGetFirst(struct tfErrorHandle **handle)
HRESULT tfErrGetAll(struct tfErrorHandle ***handles, unsigned int *numErrors)
Get all error indicators.
HRESULT tfError_getMsg(struct tfErrorHandle *handle, char **msg, unsigned int *numChars)
Get the error message.
void tfErrClear()
HRESULT tfError_getErr(struct tfErrorHandle *handle, HRESULT *err)
Get the error code.
HRESULT tfErrPopFirst(struct tfErrorHandle **handle)
void tfErrClearFirst()
HRESULT tfError_getFname(struct tfErrorHandle *handle, char **fname, unsigned int *numChars)
Get the originating file name.
HRESULT tfErrStr(struct tfErrorHandle *handle, char **str, unsigned int *numChars)
bool tfErrOccurred()