- A couple of small fixes for memory and initialization problems.
This is to make valgrind happy SKIPPED: psi/amorscan.c psi/el734hp.c psi/psi.c psi/tasscan.c
This commit is contained in:
100
scanvar.h
Normal file
100
scanvar.h
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Header file for the SICS ScanVariable. This is a support module for
|
||||
the SICS scan system.
|
||||
|
||||
Evolved during refactoring scan in November 2004
|
||||
|
||||
copyright: see file COPYRIGHT
|
||||
|
||||
Mark Koennecke, November 2004
|
||||
-------------------------------------------------------------------------*/
|
||||
#ifndef SICSSCANVAR
|
||||
#define SICSSCANVAR
|
||||
#include "sics.h"
|
||||
|
||||
typedef struct {
|
||||
char Name[132];
|
||||
pIDrivable pInter;
|
||||
pDummy pObject;
|
||||
float fStart;
|
||||
float fStep;
|
||||
float *fData;
|
||||
int dataList;
|
||||
}VarEntry, *pVarEntry;
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* MakeScanVar creates a scan variable. All the necessary checks are
|
||||
* performed
|
||||
* @param pSics The interpreter in order to locate the variable.
|
||||
* @param pCon A connection object for error reporting
|
||||
* @param name The name of the variable to scan
|
||||
* @param start The start position from which to scan
|
||||
* @param step The step width with which to scan.
|
||||
* @return A pointer to a new scan variable object on success, NULL
|
||||
* else
|
||||
*/
|
||||
pVarEntry MakeScanVar(SicsInterp *pSics, SConnection *pCon, char
|
||||
*name, float start, float step);
|
||||
/**
|
||||
* InitScanVar clears the list of scan points
|
||||
* @param pvar The scna variable to clear
|
||||
*/
|
||||
void InitScanVar(pVarEntry pVar);
|
||||
/**
|
||||
* DeleteVarEntry deletes a scan variable.
|
||||
* @param pData The scan variable entry to delete.
|
||||
*/
|
||||
void DeleteVarEntry(void *pData);
|
||||
/**
|
||||
* ScanVarName returns the name of the scan variable
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The name of the scan variable. Do not delete pointer.
|
||||
*/
|
||||
char *ScanVarName(pVarEntry pVar);
|
||||
/**
|
||||
* ScanVarStart returns the start value for the scan
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The start point for the scan.
|
||||
*/
|
||||
float ScanVarStart(pVarEntry pVar);
|
||||
/**
|
||||
* ScanVarStep returns the start value for the scan
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The step width for the scan.
|
||||
*/
|
||||
float ScanVarStep(pVarEntry pVar);
|
||||
/**
|
||||
* StartScanVar starts the scan variable to drive to the next
|
||||
* position.
|
||||
* @param pVar The scan variable to start.
|
||||
* @param pCon The connection to report errors to.
|
||||
* @param i The position number to drive to
|
||||
* @return 1 on success, 0 on failure
|
||||
*/
|
||||
int StartScanVar(pVarEntry pVar, SConnection *pCon, int i);
|
||||
/**
|
||||
* AppendScanVar appends a position to the list of positions
|
||||
* reached while scanning this variable.
|
||||
* @param pVar The scan variable to append to.
|
||||
* @param pos The position to append.
|
||||
*/
|
||||
void AppendScanVar(pVarEntry pVar, float pos);
|
||||
/**
|
||||
* GetScanVarPos returns a position for an index.
|
||||
* @param pVar The scan variable to append to.
|
||||
* @param i The position number to retrieve
|
||||
* @return The positiopn or -99999.99 for an error
|
||||
*/
|
||||
float GetScanVarPos(pVarEntry pVar, int i);
|
||||
/**
|
||||
* CopyScanVar copies the scan positions to the array given.
|
||||
* @param pVar The scan variable to copy from
|
||||
* @param fData The array to copy to.
|
||||
* @param np The number of slots in fData.
|
||||
*/
|
||||
void CopyScanVar(pVarEntry pVar, float *fData, int np);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user