home *** CD-ROM | disk | FTP | other *** search
- /*============================================================================*/
- /* L a b W i n d o w s / C V I */
- /*----------------------------------------------------------------------------*/
- /* Copyright (c) National Instruments 1987-1996. All Rights Reserved. */
- /*----------------------------------------------------------------------------*/
- /* */
- /* Title: utility.h */
- /* Purpose: Include file for LabWindows/CVI Utility Library. */
- /* */
- /*============================================================================*/
-
- #ifndef UTILITY_HEADER
- #define UTILITY_HEADER
-
- #include "cvidef.h"
- #include "cvirte.h"
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #define VAL_AUTO_CENTER 0x80000000L /* for SetStdioWindowPosition() */
-
- #if defined(_NI_mswin16_)
- #define MAX_PATHNAME_LEN 80 /* includes nul byte */
- #define MAX_DRIVENAME_LEN 3 /* includes nul byte */
- #define MAX_DIRNAME_LEN 66 /* includes nul byte */
- #define MAX_FILENAME_LEN 13 /* includes nul byte */
-
- #elif defined(_NI_mswin32_)
- #define MAX_PATHNAME_LEN 260 /* includes nul byte */
- #define MAX_DRIVENAME_LEN 3 /* includes nul byte */
- #define MAX_DIRNAME_LEN 256 /* includes nul byte */
- #define MAX_FILENAME_LEN 256 /* includes nul byte */
-
- #elif defined(_NI_unix_) || defined(_NI_sparc_)
- #define MAX_PATHNAME_LEN 256 /* recommended buffer size for paths */
- #define MAX_DRIVENAME_LEN 1 /* includes nul byte */
- #define MAX_DIRNAME_LEN 256 /* includes nul byte */
- #define MAX_FILENAME_LEN 256 /* recommended buffer size for file names */
-
- #elif defined(_NI_mac_)
- #define MAX_PATHNAME_LEN 256 /* includes nul byte */
- #define MAX_DRIVENAME_LEN 1 /* includes nul byte */
- #define MAX_DIRNAME_LEN 256 /* includes nul byte */
- #define MAX_FILENAME_LEN 256 /* includes nul byte */
-
- #else
- #error Undefined Platform. You need to add one of the
- #error following to your compiler defines:
- #error Platform Preprocessor directive
- #error Microsoft Windows 3.1 #define _NI_mswin16_
- #error Windows 95/NT #define _NI_mswin32_
- #error Solaris 1 #define _NI_sparc_ 1
- #error Solaris 2 #define _NI_sparc_ 2
- #error
- #error _NI_i386_ has been replaced with _NI_mswin16_.
- #error See Programmers Reference Manual for more information.
-
-
- #endif
-
-
- #if defined(_NI_mswin_) || defined(_NI_mswin16_) || defined(_NI_mswin32_)
- /* LaunchExecutableEx window display options */
- #define LE_HIDE 0
- #define LE_SHOWNORMAL 1
- #define LE_SHOWMINIMIZED 2
- #define LE_SHOWMAXIMIZED 3
- #define LE_SHOWMINNOACTIVE 7
- #define LE_SHOWNA 8
-
- /* SystemHelp commands */
- #if !defined(HELP_CONTEXT) /* prevent warnings when SDK files are used */
- #define HELP_CONTEXT 0x0001
- #define HELP_QUIT 0x0002
- #define HELP_CONTENTS 0x0003
- #define HELP_HELPONHELP 0x0004
- #define HELP_SETCONTENTS 0x0005
- #define HELP_CONTEXTPOPUP 0x0008
- #define HELP_KEY 0x0101
- #define HELP_COMMAND 0x0102
- #define HELP_PARTIALKEY 0x0105
- #if defined(_NI_mswin32_)
- #define HELP_FINDER 0x000b
- #endif /* defined(_NI_mswin32_) */
- #endif /* !defined(HELP_CONTEXT) */
- #define HELP_POPUPID 0x0104 /* not in SDK files */
- #endif /* defined(_NI_mswin_) */
-
- #if defined(_NI_unix_) || defined(_NI_sparc_)
- #define CVI_STDIO_WINDOW 0
- #define HOST_SYSTEM_STDIO 1
- #endif
-
- /* for the GetWindowDisplaySetting zoomState argument */
- #define VAL_NO_ZOOM 0L
- #define VAL_MINIMIZE 1L
- #define VAL_MAXIMIZE 2L
-
-
- /* for the GetCurrentPlatform() function */
- enum _GetCurrentPlatformEnum
- {
- kPlatformWin16 = 1,
- kPlatformWin95,
- kPlatformWinnt,
- kPlatformSunos4,
- kPlatformSunos5,
- kPlatformHPUX9,
- kPlatformHPUX10,
- kPlatformMac
- };
-
-
- /* for the CheckForDuplicateAppInstance() function */
- #define ACTIVATE_OTHER_INSTANCE 1
- #define DO_NOT_ACTIVATE_OTHER_INSTANCE 0
-
-
- #if defined(_NI_mswin_) || defined(_NI_mswin16_) || defined(_NI_mswin32_)
- int CVIFUNC GetDrive (int *currentDriveNum, int *numDrives);
- int CVIFUNC GetFileAttrs (const char fileName[], int *readOnly, int *system,
- int *hidden, int *archive);
- void CVIFUNC DisableTaskSwitching (void);
- void CVIFUNC EnableTaskSwitching (void);
- int CVIFUNC GetInterruptState (void);
- #ifdef _NI_mswin32_
- int CVIFUNC GetModuleDir (void *hInstance, char dirName[]);
- #endif
- void CVIFUNC GetWindowDisplaySetting (int *visible, int *zoomState);
-
- int CVIFUNC CheckForDuplicateAppInstance(int options, int *thereWasAnotherInstance);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(GetSystemTime) (int *hours, int *minutes, int *seconds);
- char CVIFUNC cviprefix(inp) (short port);
- short CVIFUNC cviprefix(inpw) (short port);
- char CVIFUNC cviprefix(outp) (short port, char value);
- short CVIFUNC cviprefix(outpw) (short port, short value);
- #define GetSystemTime cviprefix(GetSystemTime)
- #define inp cviprefix(inp)
- #define inpw cviprefix(inpw)
- #define outp cviprefix(outp)
- #define outpw cviprefix(outpw)
- #else
- int CVIFUNC GetSystemTime (int *hours, int *minutes, int *seconds);
- char CVIFUNC inp (short port);
- short CVIFUNC inpw (short port);
- char CVIFUNC outp (short port, char value);
- short CVIFUNC outpw (short port, short value);
- #endif
- int CVIFUNC GetSystemDate (int *month, int *day, int *year);
- int CVIFUNC SetDrive (int driveNum);
- int CVIFUNC SetFileAttrs (const char fileName[], int readOnly, int system,
- int hidden, int archive);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(SetSystemTime) (int hours, int minutes, int seconds);
- #define SetSystemTime cviprefix(SetSystemTime)
- #else
- int CVIFUNC SetSystemTime (int hours, int minutes, int seconds);
- #endif
- int CVIFUNC SetSystemDate (int month, int day, int year);
- int CVIFUNC SystemHelp (const char *helpFileName, unsigned command, unsigned long longData, const char *stringData);
- int CVIFUNC ReadFromPhysicalMemory (unsigned physicalAddr, void *buffer, unsigned size);
- int CVIFUNC WriteToPhysicalMemory (unsigned physicalAddr, void *buffer, unsigned size);
- int CVIFUNC ReadFromPhysicalMemoryEx (unsigned physicalAddr, void *buffer, unsigned size, int unitSize);
- int CVIFUNC WriteToPhysicalMemoryEx (unsigned physicalAddr, void *buffer, unsigned size, int unitSize);
- int CVIFUNC CVILowLevelSupportDriverLoaded(void);
- #endif /* defined(_NI_mswin_) */
-
- #if defined(_NI_unix_) || defined(_NI_sparc_)
- int CVIFUNC SetStdioPort (int stdioPort);
- void CVIFUNC GetStdioPort (int *stdioPort);
- #endif
-
- #ifdef _NI_mswin32_
- void CVIFUNC cviprefix(Beep) (void);
- #define Beep cviprefix(Beep)
- #else
- void CVIFUNC Beep (void);
- #endif
-
- void CVIFUNC Breakpoint (void);
- void CVIFUNC Cls (void);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(CopyFile) (const char sourceFile[], const char targetFile[]);
- #ifdef CopyFile
- #undef CopyFile
- #endif
- #define CopyFile cviprefix(CopyFile)
- #else
- int CVIFUNC CopyFile (const char sourceFile[], const char targetFile[]);
- #endif
-
- char * CVIFUNC DateStr (void);
- void CVIFUNC Delay (double numSeconds);
- int CVIFUNC DeleteDir (const char dirName[]);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(DeleteFile) (const char fileName[]);
- #ifdef DeleteFile
- #undef DeleteFile
- #endif
- #define DeleteFile cviprefix(DeleteFile)
- #else
- int CVIFUNC DeleteFile (const char fileName[]);
- #endif
-
- void CVIFUNC DisableBreakOnLibraryErrors (void);
- void CVIFUNC DisableInterrupts (void);
- void CVIFUNC EnableBreakOnLibraryErrors (void);
- void CVIFUNC EnableInterrupts (void);
- int CVIFUNC ExecutableHasTerminated (int handle);
- int CVIFUNC GetBreakOnLibraryErrors (void);
- int CVIFUNC GetBreakOnProtectionErrors (void);
- int CVIFUNC GetCVIVersion (void);
- int CVIFUNC GetCurrentPlatform (void);
- int CVIFUNC GetDir (char currentDir[]);
- int CVIFUNC GetKey (void);
- int CVIFUNC GetPersistentVariable (void);
- int CVIFUNC GetProjectDir (char dirName[]);
- int CVIFUNC GetFullPathFromProject (const char fileName[], char fullPathName[]);
- void * CVIFUNC GetExternalModuleAddr (int moduleId, const char symbolName[], int *status);
- int CVIFUNC GetFileDate (const char fileName[], int *month, int *day, int *year);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(GetFileSize) (const char fileName[], long *fileSize);
- int CVIFUNC cviprefix(GetFileTime) (const char fileName[], int *hours, int *minutes, int *seconds);
- #define GetFileSize cviprefix(GetFileSize)
- #define GetFileTime cviprefix(GetFileTime)
- #else
- int CVIFUNC GetFileSize (const char fileName[], long *fileSize);
- int CVIFUNC GetFileTime (const char fileName[], int *hours, int *minutes, int *seconds);
- #endif
- int CVIFUNC GetFirstFile (const char searchPath[], int normal, int readOnly, int system,
- int hidden, int archive, int directory, char fileName[]);
- int CVIFUNC GetNextFile (char fileName[]);
- void CVIFUNC GetStdioWindowOptions (int *maxNumLines, int *bringToFrontWhenModified,
- int *showLineNumbers);
- void CVIFUNC GetStdioWindowPosition (int *top, int *left);
- void CVIFUNC GetStdioWindowSize (int *height, int *width);
- void CVIFUNC GetStdioWindowVisibility (int *visible);
- int CVIFUNC InStandaloneExecutable (void);
- int CVIFUNC KeyHit (void);
- int CVIFUNC LoadExternalModule (const char pathName[]);
- int CVIFUNC LoadExternalModuleEx (const char pathName[], void *hInstance);
- int CVIFUNC LaunchExecutable (const char fileName[]);
- int CVIFUNC LaunchExecutableEx (const char fileName[], int nCmdShow, int *handle);
- int CVIFUNC MakeDir (const char newDirName[]);
- int CVIFUNC MakePathname (const char dirName[], const char fileName[], char pathName[]);
- int CVIFUNC ReleaseExternalModule(int moduleId);
- int CVIFUNC RenameFile (const char existingName[], const char newName[]);
- int CVIFUNC RetireExecutableHandle (int handle);
- long CVIFUNC RoundRealToNearestInteger (double x);
- int CVIFUNC RunExternalModule (int moduleId, const char buffer[]);
- void CVIFUNC SplitPath (const char pathName[], char driveName[], char dirName[], char fileName[]);
- int CVIFUNC SetBreakOnLibraryErrors (int doBreak);
- int CVIFUNC SetBreakOnProtectionErrors (int doBreak);
- int CVIFUNC SetDir (const char dirName[]);
- int CVIFUNC SetFileDate (const char fileName[], int month, int day, int year);
-
- #ifdef _NI_mswin32_
- int CVIFUNC cviprefix(SetFileTime) (const char fileName[], int hours, int minutes, int seconds);
- #define SetFileTime cviprefix(SetFileTime)
- #else
- int CVIFUNC SetFileTime (const char fileName[], int hours, int minutes, int seconds);
- #endif
- void CVIFUNC SetPersistentVariable (int value);
- int CVIFUNC SetStdioWindowOptions (int maxNumLines, int bringToFrontWhenModified,
- int showLineNumbers);
- int CVIFUNC SetStdioWindowPosition (int top, int left);
- int CVIFUNC SetStdioWindowSize (int height, int width);
- void CVIFUNC SetStdioWindowVisibility (int visible);
- void CVIFUNC SyncWait (double beginTime, double interval);
- int CVIFUNC TerminateExecutable (int handle);
- char * CVIFUNC TimeStr (void);
- int CVIFUNC UnloadExternalModule (int moduleId);
-
- double CVIFUNC Timer (void);
- double CVIFUNC TruncateRealNumber (double x);
-
- extern void *__CVIUserHInst;
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* UTILITY_HEADER */
-
-