OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
tmpenv_c.c File Reference
#include "hardware.inc"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>

Go to the source code of this file.

Macros

#define _FCALL
#define my_getpid   getpid()

Functions

char * tmpenv_c ()
void tmpenvf_ (char *tmpdir, int *tmplen)
void tmpenvf (char *tmpdir, int *tmplen)
void tmpenvf__ (char *tmpdir, int *tmplen)
void _FCALL TMPENVF (char *tmpdir, int *tmplen)
void fgetpid_ (int *pid)
void fgetpid__ (int *pid)
void fgetpid (int *pid)
void _FCALL FGETPID (int *pid)

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 30 of file tmpenv_c.c.

◆ my_getpid

#define my_getpid   getpid()

Definition at line 47 of file tmpenv_c.c.

Function Documentation

◆ FGETPID()

void _FCALL FGETPID ( int * pid)

Definition at line 182 of file tmpenv_c.c.

182 {
183 *pid=my_getpid;
184}
#define my_getpid
Definition tmpenv_c.c:47

◆ fgetpid()

void fgetpid ( int * pid)

Definition at line 178 of file tmpenv_c.c.

178 {
179 *pid=my_getpid;
180}

◆ fgetpid_()

void fgetpid_ ( int * pid)

Definition at line 170 of file tmpenv_c.c.

170 {
171 *pid=my_getpid;
172}

◆ fgetpid__()

void fgetpid__ ( int * pid)

Definition at line 174 of file tmpenv_c.c.

174 {
175 *pid=my_getpid;
176}

◆ tmpenv_c()

char * tmpenv_c ( )

Definition at line 100 of file tmpenv_c.c.

100 {
101
102 char * tmpdir;
103 DIR* directory;
104
105 tmpdir = getenv("TMPDIR");
106
107 if (tmpdir != NULL){
108 directory = opendir(tmpdir); // check if directory exists
109
110 if (directory == NULL){
111 tmpdir=NULL;
112 }else{
113 closedir(directory);
114 }
115 }
116
117 /* second trial get current working directory */
118 if (tmpdir==NULL){
119 tmpdir = (char *)calloc(200,sizeof(char));
120 getcwd(tmpdir,200);
121 }
122
123 return tmpdir;
124}

◆ TMPENVF()

void _FCALL TMPENVF ( char * tmpdir,
int * tmplen )

Definition at line 157 of file tmpenv_c.c.

157 {
158 tmpenvf_(tmpdir,tmplen);
159}
void tmpenvf_(char *tmpdir, int *tmplen)
Definition tmpenv_c.c:138

◆ tmpenvf()

void tmpenvf ( char * tmpdir,
int * tmplen )

Definition at line 149 of file tmpenv_c.c.

149 {
150 tmpenvf_(tmpdir,tmplen);
151}

◆ tmpenvf_()

void tmpenvf_ ( char * tmpdir,
int * tmplen )

Definition at line 138 of file tmpenv_c.c.

138 {
139
140 char * tdir= tmpenv_c();
141 int slen=strlen(tdir);
142 int i;
143
144 for (i=0;i<slen;i++) tmpdir[i]=tdir[i];
145 tmpdir[slen]='\0';
146 *tmplen = slen;
147}
subroutine slen(x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, j, area, aream)
Definition slen.F:31
char * tmpenv_c()
Definition tmpenv_c.c:100

◆ tmpenvf__()

void tmpenvf__ ( char * tmpdir,
int * tmplen )

Definition at line 153 of file tmpenv_c.c.

153 {
154 tmpenvf_(tmpdir,tmplen);
155}