📄 mnmainlp.h
字号:
#endif /* not ICAPI *//********************************************************************************FORTRAN callable version call MnFtnRemoveRequestHandler (service, request) integer service integer requestDESCRIPTION The MnRemoveRequestHandler procedure removes an event handler to becalled when a softbus order is received requesting the specified serviceand request.INPUT VALUES service - requested service id. request - requested request id.OUTPUT VALUES noneNOTES Values for the input parameters must be the same as whenMnSetRequestHandler was called in order to remove the proper handler.********************************************************************************FUNCTION END */#endif /* _WIN32 *//* FUNCTION START*******************************************************************************NAME MnAddTimeOutHandler - Set timeout event handler to be called everytime specified number of milliseconds have elapsed.SYNOPSIS #include <def_c/mnmainloop.h>********************************************************************************/#if defined(__STDC__) || defined(_WIN32)mnTimerIdType MnAddTimeOutHandler ( int milliseconds, mnTimeOutHandlerType eventHandler, mnUserDataType userData);#elsemnTimerIdType MnAddTimeOutHandler ();#endif/********************************************************************************FORTRAN callable version call MnFtnAddTimeOutHandler (milliseconds, ftnFunc, userData, mnTimerId) integer milliseconds function ftnFunc "pointer to any thing" userData integer mnTimerIdDESCRIPTION The MnAddTimeOutHandler procedure adds a timeout handler to becalled every time the indicated number of milliseconds have elapsed.INPUT VALUES milliseconds - number of milliseconds to elapse between calls. eventHandler - event handler. userData - user data (anything that is the same size as a pointer).OUTPUT VALUES return value - TimerId for use on remove or restart.NOTES MnMainLoop timers are only periodic in nature. The expiration isprocessed within the limits of the underlying system. For example, aone second expiration might be delayed for several tenths of a secondby other processes executing on the same system. MnMainLoop assumes that processes need to make up for smalloccurances of expiration delay. For example, a .2 second delay on a .5seond timer is made up by next calling the user timeout handler in .3seconds. The user calls MnRestartTimeOut if making up for the delay isnot desired. UNIX does not provide a true elapsed time capability, therefore,Periodic timers are based on time of day. Operational changes in timeof day such as day light savings time and leap year must be detected.Any change in time forward by more than 10 seconds or backward by 1second is assumed to be an operational time change. An approximationof elapsed time must then be made, i.e. one second has passed. Use SbAlarm if your process has timer demands not met by theabove criteria.********************************************************************************FUNCTION END *//* FUNCTION START*******************************************************************************NAME MnRemoveTimeOutHandler - Remove timeout event handler to be called everytime specified number of milliseconds have elapsed.SYNOPSIS #include <def_c/mnmainloop.h>********************************************************************************/#if defined(__STDC__) || defined(_WIN32)void MnRemoveTimeOutHandler( mnTimerIdType TimerId);#elsevoid MnRemoveTimeOutHandler();#endif/********************************************************************************FORTRAN callable version call MnFtnRemoveTimeOutHandler (mnTimerId) integer mnTimerIdDESCRIPTION The MnRemoveTimeOutHandler procedure removes a timeout handler to becalled every time the indicated number of milliseconds have elapsed.INPUT VALUES TimerId - id of timer returned on MnAddTimeOutHandler or passed on call to timeout handler.OUTPUT VALUES noneNOTES Removal of a non-existent timer is ignored.********************************************************************************FUNCTION END */#ifndef _WIN32 /* The functions below are not supported on NT *//* FUNCTION START*******************************************************************************NAME MnReuseTimeOut - Set new timeout and userData into an existing periodic timer and restart timeout for event handler to be called every time the specified number of milliseconds have elapsed.SYNOPSIS #include <def_c/mnmainloop.h>NOTESThis function is not supported for the ICCP SDK. See the ICCP Software Development Kit User's Guide for information on the supported functions.********************************************************************************/#ifndef ICAPI#ifdef __STDC__void MnReuseTimeOut( mnTimerIdType TimerId, int milliseconds, mnUserDataType userData);#elsevoid MnReuseTimeOut();#endif#endif /* not ICAPI *//********************************************************************************FORTRAN callable version call MnFtnReuseTimeOut (mnTimerId, milliseconds, userData) integer mnTimerId integer milliseconds "pointer to any thing" userDataDESCRIPTION The MnReuseTimeOut procedure restarts a timeout. Guarantees thatat least the number of milliseconds specified will elapse before theuser timeout handler is called again.INPUT VALUES TimerId - id of timer returned on MnAddTimeOutHandler or passed on call to timeout handler. milliseconds - number of milliseconds to elapse between calls. userData - user data (anything that is the same size as a pointer).OUTPUT VALUES noneNOTES Changes the next timeout period to start from the moment of call. Equivalent to the combination of a remove and add, but with lessoverhead.********************************************************************************FUNCTION END */#endif /* _WIN32 *//* FUNCTION START*******************************************************************************NAME MnRestartTimeOut - Restart timeout for event handler to be called everytime specified number of milliseconds have elapsed.SYNOPSIS #include <def_c/mnmainloop.h>********************************************************************************/#ifdef __STDC__void MnRestartTimeOut( mnTimerIdType TimerId);#elsevoid MnRestartTimeOut();#endif/********************************************************************************FORTRAN callable version call MnFtnRestartTimeOut (mnTimerId) integer mnTimerIdDESCRIPTION The MnRestartTimeOut procedure restarts a timeout. Guarantees thatat least the number of milliseconds specified on the call toMnAddTimeOutHandler will elapse before the user timeout handler iscalled again.INPUT VALUES TimerId - id of timer returned on MnAddTimeOutHandler or passed on call to timeout handler.OUTPUT VALUES noneNOTES Changes the next timeout period to start from the moment of call.Can be used to NOT include the timer call overhead or any delays inprocess scheduling that have occurred to this point. Equivalent to the combination of a remove and add, but with lessoverhead.********************************************************************************FUNCTION END */#ifndef _WIN32 /* The functions below are not supported on NT *//* * UNIX signal handling capabilities */#include <sys/signal.h>#include <sys/wait.h>/* SISCO_START */#include <sys/resource.h> /* for rusage struct def *//* SISCO_END *//* * UnixData * Define the structure passed back to the user handler. */typedef union{ struct { int status; pid_t pid; struct rusage resources; } data;/* SISCO_START sigcontext struct not defined on SUN Solaris 2.5 SISCO_END */#if !defined(sun) struct sigcontext context;#endif} UnixData;typedef void (*mnUnixSignalHandler)(UnixData *, mnUserDataType);/* * NOTE * The UNIX signal functions prototyped below are not supported for the * ICCP SDK. See the ICCP Software Development Kit User's Guide for * information on the supported functions.*/#ifndef ICAPI/* * Use this to register a service handler for the specified UNIX signal. */boolean MnSetUnixSignalHandler( int sig, mnUnixSignalHandler EventHandler, mnUserDataType userData);/* * Use this to remove a service handler for the specified UNIX signal. */boolean MnRemoveUnixSignalHandler(int sig);#endif /* ICAPI */#endif /* _WIN32 */#ifdef _WIN32/* FUNCTION START*******************************************************************************NAME mnAddBackgroundTask - Add background task to be called just beforesleeping for events.SYNOPSIS #include <mnMainLoop.h>********************************************************************************/extern void mnAddBackgroundTask ( mnBackgroundType backgroundTask, mnUserDataType userData);/********************************************************************************DESCRIPTION The mnAddBackgroundTask procedure adds a background task to becalled just before sleeping for events.INPUT VALUES backgroundTask - callback of backgroundTask. userData - user data (anything that is the same size as a pointer).OUTPUT VALUES noneNOTES ********************************************************************************FUNCTION END *//* FUNCTION START*******************************************************************************NAME mnRemoveBackgroundTask - Remove background task.SYNOPSIS #include <mnMainLoop.h>********************************************************************************/extern void mnRemoveBackgroundTask( mnBackgroundType backgroundTask, mnUserDataType userData);/********************************************************************************DESCRIPTION The mnRemoveBackgroundTask procedure removes a background task to becalled just before sleeping for events.INPUT VALUES backgroundTask - callback of backgroundTask. userData - user data (anything that is the same size as a pointer).OUTPUT VALUES noneNOTES * *******************************************************************************FUNCTION END */#endif /* _WIN32 */#ifdef _WIN32/******************************************************************NAME MnSetWindowsNtHandler - Set event handler to be called when a Windows/NT object is signaled.PARAMETERS objectHandle - the handle of the requested object. handler - The function to call when the object is signaled. userData - user data (anything that is the same size as a pointer).RETURN VALUES Returns TRUE if no errors were detected, FALSE if otherwise.DESIGN DESCRIPTION The MnSetWindowsNtHandler procedure adds an event handler to be called when a Windows/NT object is signaled.NOTES This function does not check to ensure that a new entry is unique, so calling this function a second time with the same objectHandle will result in two entries. The behaviour in this case is undefined.******************************************************************/int MnSetWindowsNtHandler ( MnHandle objectHandle, mnWinNtObjectHandlerType handler, mnUserDataType userData);/******************************************************************NAME MnRemoveWindowsNtHandler - Remove a Windows/NT object handler.PARAMETERS objectHandle - The handle of the requested object.RETURN VALUES Returns TRUE if no errors were found, FALSE otherwise.DESIGN DESCRIPTION The MnRemoveWindowsNtHandler procedure removes a Windows/NT object handler.NOTES None.******************************************************************/int MnRemoveWindowsNtHandler( MnHandle objectHandle);/* for applications that receive windows messages */extern void (*uWinMessageHandler) (void);#endif /* _WIN32 *//* SISCO_START */#if defined (POWERICCP) || defined (AXS4ICCP)int icProcessTimers (void);#endif/* SISCO_END */#ifdef __cplusplus}#endif#endif /* __MnMainLoop_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -