37 static int is_valid_label(
char *
label) {
38 #define ALLOW_CHAR_FIRST "_"
39 #define ALLOW_CHAR "_-+"
105 int i_step,
char *header,
char *comment) {
116 if (header ==
NULL) {
124 while (len <
sizeof(
head) - 1 && *p && *p !=
'\n') {
130 if (comment ==
NULL) {
138 while (len <
sizeof(
comment_line) - 1 && *p && *p !=
'\n') {
147 static int add_to_global_list(
struct result_list *result) {
162 static int add_to_node_list(
struct result_list *result) {
177 static int add_to_elem_list(
struct result_list *result) {
198 if (result ==
NULL) {
204 if (new_label ==
NULL) {
209 result->
label = new_label;
224 if (dtype < 1 && dtype > 3) {
229 if (!is_valid_label(
label)) {
235 if (result ==
NULL) {
241 if (add_to_node_list(result))
goto error;
242 }
else if (dtype == 2) {
244 if (add_to_elem_list(result))
goto error;
247 if (add_to_global_list(result))
goto error;
int HECMW_set_error(int errorno, const char *fmt,...)
#define HECMW_malloc(size)
int HECMW_result_init_body(int n_node, int n_elem, int *nodeID, int *elemID, int i_step, char *header, char *comment)
struct result_list * node_list
struct result_list * elem_list
char line_buf[LINEBUF_SIZE+1]
int HECMW_result_count_ne_comp(void)
int HECMW_result_count_ng_comp(void)
struct result_list * global_list
int HECMW_result_add(int dtype, int n_dof, char *label, double *ptr)
void HECMW_result_clear()
char comment_line[HECMW_MSG_LEN+1]
int HECMW_result_count_nn_comp(void)
char head[HECMW_HEADER_LEN+1]
struct result_list * next