ocssw  1.0
Functions | Variables
/disk01/web/ocssw/build/inc/utils/genutils.h File Reference

(r8085/r5806)

#include "time_utils.h"
#include <stdio.h>

Go to the source code of this file.

Functions

int endianess (void)
 determine endianess
void parse_file_name (char *inpath, char *outpath)
int swapc_bytes (char *in, int nbyte, int ntime)
int swapc_bytes2 (const char *in, char *out, int nbyte, int ntime)
int isleap (int year)
size_t fread_swap (int little_endian, void *ptr, size_t size, size_t nmemb, FILE *stream)
size_t fwrite_swap (int little_endian, const void *ptr, size_t size, size_t nmemb, FILE *stream)
void spline (float[], float[], int, float, float, float[])
void splint (float[], float[], float[], int, float, float *)
void lspline (float xin[], float yin[], int32_t nin, float xout[], float yout[], int32_t nout)
float linterp (float xin[], float yin[], int32_t nin, float xout)
int32_t filesize_ (const char *filename)
int32_t filesize (const char *filename)
int getlut_file (char *lut_file, short *rlut, short *glut, short *blut)
char * lowcase (char *instr)
char * upcase (char *instr)

Variables

int want_verbose

Detailed Description

This is a bunch of useful general utilities.

Definition in file genutils.h.


Function Documentation

int endianess ( void  )

determine endianess

Is this machine little endian

Returns:
0 for BIG_ENDIAN machines, 1 for LITTLE_ENDIAN mahcines

Determines if the host calling this routine is a big or little endian machine.

Returns:
A 0 for BIG_ENDIAN machines, 1 for LITTLE_ENDIAN mahcines.

Definition at line 27 of file b128_msk_get.c.

int32_t filesize ( const char *  filename)

Definition at line 92 of file swl0_utils.c.

int32_t filesize_ ( const char *  filename)

Definition at line 20 of file filesize.c.

size_t fread_swap ( int  little_endian,
void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream 
)

read a binary file and swap bytes if necessary

Parameters:
little_endianset to 0 for big endian files, 1 for little endian files
ptrmemory to read into
sizesize of object to read in bytes
nmembnumber of objects to read
streamfile to read from
Returns:
number of objects read

Definition at line 3 of file fread_swap.c.

size_t fwrite_swap ( int  little_endian,
const void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream 
)

write a binary file and swap bytes if necessary

Parameters:
little_endianset to 0 for big endian files, 1 for little endian files
ptrmemory to write
sizesize of object to write in bytes
nmembnumber of objects to write
streamfile to write to
Returns:
number of objects written

Definition at line 16 of file fread_swap.c.

int getlut_file ( char *  lut_file,
short *  rlut,
short *  glut,
short *  blut 
)

Definition at line 8 of file getlut_file.c.

int isleap ( int  year)

Definition at line 29 of file l1_io.cpp.

float linterp ( float  xin[],
float  yin[],
int32_t  nin,
float  xout 
)

Definition at line 60 of file lspline.c.

char* lowcase ( char *  instr)

Definition at line 10 of file lowcase.c.

void lspline ( float  xin[],
float  yin[],
int32_t  nin,
float  xout[],
float  yout[],
int32_t  nout 
)

Definition at line 20 of file lspline.c.

void parse_file_name ( char *  inpath,
char *  outpath 
)

Definition at line 18 of file parse_file_name.c.

void spline ( float  [],
float  [],
int  ,
float  ,
float  ,
float  [] 
)

Definition at line 34 of file nr_spline.c.

void splint ( float  [],
float  [],
float  [],
int  ,
float  ,
float *   
)

Definition at line 76 of file nr_spline.c.

int swapc_bytes ( char *  in,
int  nbyte,
int  ntime 
)

Swap bytes in place

Parameters:
inpointer to memory to byte swap
nbytesize of object to reverse
ntimenumber of objects to swap
Returns:
0 always

Definition at line 34 of file b128_msk_get.c.

int swapc_bytes2 ( const char *  in,
char *  out,
int  nbyte,
int  ntime 
)

Swap bytes from in to out. in and out should not be overlapping memory

Parameters:
inpointer to source memory to byte swap
outpointer to destination memory
nbytesize of object to reverse
ntimenumber of objects to swap
Returns:
0 always

Definition at line 26 of file swapc_bytes.c.

char* upcase ( char *  instr)

Definition at line 10 of file upcase.c.


Variable Documentation

Do we want to print out extra info to stdout

Definition at line 3 of file genutils_globals.c.