Skip to content

Commit

Permalink
Fix prototype locations
Browse files Browse the repository at this point in the history
  • Loading branch information
morrone committed Nov 11, 2011
1 parent 0072f26 commit e7fea4f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 44 deletions.
2 changes: 0 additions & 2 deletions src/aiori-HDF5.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@
/**************************** P R O T O T Y P E S *****************************/

static IOR_offset_t SeekOffset_HDF5(void *, IOR_offset_t, IOR_param_t *);
void SetHints(MPI_Info *, char *);
void SetupDataSet_HDF5(void *, IOR_param_t *);
void ShowHints(MPI_Info *);

void *IOR_Create_HDF5(char *, IOR_param_t *);
void *IOR_Open_HDF5(char *, IOR_param_t *);
Expand Down
2 changes: 0 additions & 2 deletions src/aiori-MPIIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
/**************************** P R O T O T Y P E S *****************************/

static IOR_offset_t SeekOffset_MPIIO(MPI_File, IOR_offset_t, IOR_param_t *);
void SetHints(MPI_Info *, char *);
void ShowHints(MPI_Info *);

void *IOR_Create_MPIIO(char *, IOR_param_t *);
void *IOR_Open_MPIIO(char *, IOR_param_t *);
Expand Down
2 changes: 0 additions & 2 deletions src/aiori-NCMPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
/**************************** P R O T O T Y P E S *****************************/

static int GetFileMode(IOR_param_t *);
void SetHints(MPI_Info *, char *);
void ShowHints(MPI_Info *);

void *IOR_Create_NCMPI(char *, IOR_param_t *);
void *IOR_Open_NCMPI(char *, IOR_param_t *);
Expand Down
2 changes: 2 additions & 0 deletions src/aiori.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,7 @@ typedef struct ior_aiori {
} ior_aiori_t;

void init_IOR_Param_t(IOR_param_t *p);
void SetHints (MPI_Info *, char *);
void ShowHints (MPI_Info *);

#endif /* not _AIORI_H */
3 changes: 0 additions & 3 deletions src/ior.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ void WriteTimes (IOR_param_t *, double **, int, int);
char * CurrentTimeString(void);
void DumpBuffer (void *, size_t);
void ExtractHint (char *, char *, char *);
void SetHints (MPI_Info *, char *);
void ShowHints (MPI_Info *);
IOR_offset_t StringToBytes (char *);

#if USE_UNDOC_OPT
void CorruptFile (char *, IOR_param_t *, int, int);
void ModifyByteInFile (char *, IOR_offset_t, int);
#endif /* USE_UNDOC_OPTS */
void SeedRandGen (MPI_Comm);

Expand Down
69 changes: 34 additions & 35 deletions src/utilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,40 @@ int Regex(char *string, char *pattern)
}

#if USE_UNDOC_OPT /* corruptFile */
/*
* Modify byte in file - used to testing write/read data checking.
*/
static void ModifyByteInFile(char *fileName, IOR_offset_t offset, int byteValue)
{
int fd;
int rc;
char old;
char new;

new = (char)byteValue;

/* open file, show old value, update to new value */
fd = open(fileName, O_RDWR);
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
goto out;
rc = read(fd, &old, 1);
if (rc == -1)
goto out;
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
goto out;
rc = write(fd, &new, 1);
if (rc == -1)
goto out;
fprintf(stdout,
"** DEBUG: offset %lld in %s changed from %d to %d **\n",
offset, fileName, (unsigned char)old, (unsigned char)new);

out:
close(fd);
return;
}
/*
* Corrupt file to testing data checking options.
*/
Expand Down Expand Up @@ -417,41 +451,6 @@ void CorruptFile(char *testFileName, IOR_param_t * test, int rep, int access)

return;
}

/*
* Modify byte in file - used to testing write/read data checking.
*/
void ModifyByteInFile(char *fileName, IOR_offset_t offset, int byteValue)
{
int fd;
int rc;
char old;
char new;

new = (char)byteValue;

/* open file, show old value, update to new value */
fd = open(fileName, O_RDWR);
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
goto out;
rc = read(fd, &old, 1);
if (rc == -1)
goto out;
rc = lseek(fd, offset, SEEK_SET);
if (rc == -1)
goto out;
rc = write(fd, &new, 1);
if (rc == -1)
goto out;
fprintf(stdout,
"** DEBUG: offset %lld in %s changed from %d to %d **\n",
offset, fileName, (unsigned char)old, (unsigned char)new);

out:
close(fd);
return;
}
#endif /* USE_UNDOC_OPT - corruptFile */

/*
Expand Down

0 comments on commit e7fea4f

Please sign in to comment.