Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 361 → Rev 362

/pcivme-3.2/lib/pcivme_ni.c
155,7 → 155,7
return 0;
}
 
int VMEopen(const char *cszDeviceName, unsigned char ubAddressModifier, int *pnHandle)
int VMEopen(const char *cszDeviceName, unsigned char ubAddressModifier, ptrdiff_t *pnHandle)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)NULL;
int error;
177,7 → 177,7
}
 
dev->cAddressModifier = ubAddressModifier;
*pnHandle = (int)dev;
*pnHandle = (ptrdiff_t)dev;
 
error = initHardware(dev);
if (error)
188,7 → 188,7
return setAccessProperties(*pnHandle, dev->cAddressModifier, BYTE_ACCESS); // set access properties to default
}
 
int VMEinit(const char *cszDeviceName, unsigned short nVMEMM, unsigned char ubAddressModifier, int *pnHandle)
int VMEinit(const char *cszDeviceName, unsigned short nVMEMM, unsigned char ubAddressModifier, ptrdiff_t *pnHandle)
{
char *szLocalDeviceName = szDeviceName(cszDeviceName, nVMEMM);
 
195,7 → 195,7
return VMEopen(szLocalDeviceName, ubAddressModifier, pnHandle);
}
 
int setAccessProperties(int nHandle, unsigned char bModifier, unsigned char bAccessType)
int setAccessProperties(ptrdiff_t nHandle, unsigned char bModifier, unsigned char bAccessType)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
 
218,7 → 218,7
return 0;
}
 
int VMEread(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer)
int VMEread(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
size_t count = (size_t)(ulElementCount * ubAccessWidth);
263,7 → 263,7
return 0;
}
 
int VMEwrite(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer)
int VMEwrite(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
size_t count = (size_t)(ulElementCount * ubAccessWidth);
307,7 → 307,7
return 0;
}
 
int VMEaccessVIC(int nHandle, unsigned char ubAccessMode, unsigned short uwAddress, unsigned char *ubContent)
int VMEaccessVIC(ptrdiff_t nHandle, unsigned char ubAccessMode, unsigned short uwAddress, unsigned char *ubContent)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_VIC68A_ACTION vic68a_action;
327,7 → 327,7
return 0;
}
 
int VMEreset(int nHandle)
int VMEreset(ptrdiff_t nHandle)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_RESET_COMMAND reset_command;
363,7 → 363,7
return 0;
}
 
int VMETAS(int nHandle, unsigned long ulAddress, unsigned char *ubResult)
int VMETAS(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char *ubResult)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_TAS_STRUCT tas;
383,7 → 383,7
return 0;
}
 
int VMEinterrupt(int nHandle, unsigned char *ubVector)
int VMEinterrupt(ptrdiff_t nHandle, unsigned char *ubVector)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_VECTOR_LEVEL ubLocalVector;
399,7 → 399,7
return 0;
}
 
int VMEsysfailGet(int nHandle, BOOLEAN *bResult)
int VMEsysfailGet(ptrdiff_t nHandle, BOOLEAN *bResult)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_VIC68A_ACTION sAction; // structure to access vic chip
419,7 → 419,7
return 0;
}
 
int VMEsysfailSet(int nHandle, BOOLEAN bForce)
int VMEsysfailSet(ptrdiff_t nHandle, BOOLEAN bForce)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_VIC68A_ACTION sAction; // structure to access vic chip
437,7 → 437,7
return 0;
}
 
int VMEerror(int nHandle)
int VMEerror(ptrdiff_t nHandle)
{
__u8 ubVector;
 
449,7 → 449,7
return 0;
}
 
int VMEclose(int nHandle)
int VMEclose(ptrdiff_t nHandle)
{
int error = 0;
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
469,7 → 469,7
return error;
}
 
int VMEcontrolInterrupt(int nHandle, BOOLEAN *bEnable)
int VMEcontrolInterrupt(ptrdiff_t nHandle, BOOLEAN *bEnable)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
PCIVME_IRQ_CONTROL control;
488,7 → 488,7
return 0;
}
 
int GetLastError(int nHandle)
int GetLastError(ptrdiff_t nHandle)
{
VMEMM_DEVICE *dev = (VMEMM_DEVICE *)nHandle;
int nLocalError;
/pcivme-3.2/lib/pcivme_ni.h
1,6 → 1,6
#ifndef __PCIVME_NI_H__
#define __PCIVME_NI_H__
 
#include <stddef.h>
//-------------------------------------------------------------------------------------------
// pcivme_ni.h - header for ni-labview shared library or dll for ARW pcivme interface
// this library can also be used for other purposes aside from labview
15,9 → 15,9
//
// Please announce changes and hints to ARW Elektronik
//
// $Log: pcivme_ni.h,v $
// Revision 1.8 2004/08/13 19:23:45 klaus
// conversion to kernel-version 2.6, released version 3.0
// $Log: pcivme_ni.h,v $
// Revision 1.8 2004/08/13 19:23:45 klaus
// conversion to kernel-version 2.6, released version 3.0
//
// Revision 1.7 2002/10/20 18:07:18 klaus
// changed error handling
62,21 → 62,21
extern "C"
{
#endif
int VMEopen(const char *cszDeviceName, unsigned char ubAddressModifier, int *pnHandle);
int VMEinit(const char *cszDeviceName, unsigned short nVMEMM, unsigned char ubAddressModifier, int *pnHandle);
int setAccessProperties(int nHandle, unsigned char bModifier, unsigned char bAccessType);
int VMEread(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer);
int VMEwrite(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer);
int VMEaccessVIC(int nHandle, unsigned char ubAccessMode, unsigned short uwAddress, unsigned char *ubContent);
int VMEreset(int nHandle);
int VMETAS(int nHandle, unsigned long ulAddress, unsigned char *ubResult);
int VMEcontrolInterrupt(int nHandle, BOOLEAN *bEnable);
int VMEinterrupt(int nHandle, unsigned char *ubVector);
int VMEsysfailGet(int nHandle, BOOLEAN *bResult);
int VMEsysfailSet(int nHandle, BOOLEAN bForce);
int VMEerror(int nHandle);
int VMEclose(int nHandle);
int GetLastError(int nHandle);
int VMEopen(const char *cszDeviceName, unsigned char ubAddressModifier, ptrdiff_t *pnHandle);
int VMEinit(const char *cszDeviceName, unsigned short nVMEMM, unsigned char ubAddressModifier, ptrdiff_t *pnHandle);
int setAccessProperties(ptrdiff_t nHandle, unsigned char bModifier, unsigned char bAccessType);
int VMEread(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer);
int VMEwrite(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer);
int VMEaccessVIC(ptrdiff_t nHandle, unsigned char ubAccessMode, unsigned short uwAddress, unsigned char *ubContent);
int VMEreset(ptrdiff_t nHandle);
int VMETAS(ptrdiff_t nHandle, unsigned long ulAddress, unsigned char *ubResult);
int VMEcontrolInterrupt(ptrdiff_t nHandle, BOOLEAN *bEnable);
int VMEinterrupt(ptrdiff_t nHandle, unsigned char *ubVector);
int VMEsysfailGet(ptrdiff_t nHandle, BOOLEAN *bResult);
int VMEsysfailSet(ptrdiff_t nHandle, BOOLEAN bForce);
int VMEerror(ptrdiff_t nHandle);
int VMEclose(ptrdiff_t nHandle);
int GetLastError(ptrdiff_t nHandle);
#ifdef __cplusplus
}
#endif