Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prop-fftw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Albrecht
prop-fftw
Commits
c9280b56
Commit
c9280b56
authored
1 year ago
by
Paul Albrecht
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
6fb40fcf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ops_io.cc
+95
-0
95 additions, 0 deletions
ops_io.cc
with
95 additions
and
0 deletions
ops_io.cc
0 → 100644
+
95
−
0
View file @
c9280b56
/********************************************************************************
* CIS3(D) Program suite *
* *
* file: ops_io.cc *
* *
* contains io routines *
* *
* Tillmann Klamroth 2005 *
********************************************************************************/
#include
<fstream>
#include
<math.h>
#include
<limits.h>
#include
<string.h>
#include
<time.h>
#include
<unistd.h>
#include
<stdio.h>
#include
<ctype.h>
#include
<sys/time.h>
#include
<sys/resource.h>
#include
<iostream>
#include
<sstream>
#include
<stdlib.h>
using
namespace
std
;
//Functions
void
status
(
ofstream
*
outf
);
int
rem_com
(
char
*
filename
,
char
*
streamstring
,
int
string_length
);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* STATUS */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
void
status
(
ofstream
*
outf
){
char
str1
[
1024
];
size_t
len
=
1024
;
time_t
curr_time
;
time
(
&
curr_time
);
gethostname
(
str1
,
len
);
*
outf
<<
"Host: "
<<
str1
<<
", Date: "
<<
ctime
(
&
curr_time
);
outf
->
flush
();
}
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* REM COM */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
int
rem_com
(
char
*
filename
,
char
*
streamstring
,
int
string_length
){
const
char
com_B
=
'#'
;
const
char
com_E
=
'\n'
;
int
pos
=
0
;
char
cc
;
ifstream
inf
(
filename
);
while
(
inf
.
get
(
cc
)
&&
pos
<
string_length
-
1
){
if
(
cc
!=
com_B
)
streamstring
[
pos
++
]
=
cc
;
else
{
while
(
cc
!=
com_E
&&
inf
.
get
(
cc
));
streamstring
[
pos
++
]
=
com_E
;
}
}
streamstring
[
pos
]
=
0
;
if
(
pos
==
string_length
-
1
){
cerr
<<
"Buffer size exceeded !
\n
"
;
exit
(
0
);
}
return
(
strlen
(
streamstring
));
}
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* get_sys_size(char* sysfile, int* nroao, int* nroa, */
/* long long int* nrofint) */
/* */
/* Read the system sizes form sysfile. */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
void
get_sys_size
(
char
*
sysfile
,
int
*
nroao
,
int
*
nroa
,
long
long
int
*
nrofint
){
ifstream
inf
(
sysfile
);
inf
.
read
((
char
*
)
nroao
,
sizeof
(
int
));
inf
.
read
((
char
*
)
nroa
,
sizeof
(
int
));
inf
.
read
((
char
*
)
nrofint
,
sizeof
(
long
long
int
));
inf
.
close
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment