OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
rad_umat_input_read.c
Go to the documentation of this file.
1//Copyright> OpenRadioss
2//Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3//Copyright>
4//Copyright> This program is free software: you can redistribute it and/or modify
5//Copyright> it under the terms of the GNU Affero General Public License as published by
6//Copyright> the Free Software Foundation, either version 3 of the License, or
7//Copyright> (at your option) any later version.
8//Copyright>
9//Copyright> This program is distributed in the hope that it will be useful,
10//Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11//Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12//Copyright> GNU Affero General Public License for more details.
13//Copyright>
14//Copyright> You should have received a copy of the GNU Affero General Public License
15//Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16//Copyright>
17//Copyright>
18//Copyright> Commercial Alternative: Altair Radioss Software
19//Copyright>
20//Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21//Copyright> software under a commercial license. Contact Altair to discuss further if the
22//Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26
27#define _FCALL
28
30char * cfilename;
31
32void rad_umat_open_(char * filename,int * length,int * result);
33void rad_umat_input_read_(char * line,int * len,int *size_read );
36
37
38
39#ifdef _WIN64
40#define rad_umat_input_open_ RAD_UMAT_INPUT_OPEN
41#endif
42void _FCALL rad_umat_input_open_(char * filename,int * length,int * result){
43 int i;
44
45 *result = 0;
46 cfilename=malloc(sizeof(char)*(*length+1));
47 for (i=0;i< *length;i++) { cfilename[i] = filename[i] ; }
48 cfilename[*length]='\0';
49
50 userlib_input=fopen(cfilename,"r");
51
52 if (userlib_input==NULL){
53 *result=0;
54 }else{
55 *result=1;
56 }
57
58 return;
59}
60
61
62#ifdef _WIN64
63#define rad_umat_input_read_ RAD_UMAT_INPUT_READ
64#endif
65void rad_umat_input_read_(char * line,int * len,int *size_read)
66{
67 int i;
68 *size_read=0;
69 for (i=0;i<*len;i++) line[i] = ' ' ;
70 fgets(line,*len, userlib_input);
71 line[strlen(line)-1]='\0';
72 *size_read=strlen(line);
73}
74
75#ifdef _WIN64
76#define rad_umat_input_rewind_ RAD_UMAT_INPUT_REWIND
77#endif
78
80 rewind (userlib_input);
81}
82
83#ifdef _WIN64
84#define rad_umat_close_input_ RAD_UMAT_CLOSE_INPUT
85#endif
86
88 fclose( userlib_input);
89 userlib_input=NULL;
90 remove (cfilename);
91}
92
93
94
#define _FCALL
void rad_umat_input_rewind_()
void rad_umat_close_input_()
void rad_umat_open_(char *filename, int *length, int *result)
void rad_umat_input_read_(char *line, int *len, int *size_read)
FILE * userlib_input
char * cfilename
void ad_umat_input_rewind_()
void _FCALL rad_umat_input_open_(char *filename, int *length, int *result)