This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| proboard_interface_functions [2023/06/20 07:24] – created admin | proboard_interface_functions [2023/06/20 08:52] (current) – admin | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| Several types have been defined in the file PB_SDK.H | Several types have been defined in the file PB_SDK.H | ||
| - | bool : a boolean value that can have the values TRUE or FALSE | + | |
| - | | + | byte : an unsigned character (8 bits) |
| - | | + | word : an unsigned short integer (16 bits) |
| - | | + | dword : an unsigned long integer (32 bits) |
| - | | + | KEY : used for key scan codes (for sysopkey handlers and the |
| - | | + | ScanKey() function). |
| + | |||
| + | ====== void AddTime( int min ); ====== | ||
| + | Adds ' | ||
| + | number of minutes will be subtracted from the time left. | ||
| + | |||
| + | Examples: | ||
| + | AddTime( 10 ); /* Adds 10 minutes | ||
| + | AddTime( -5 ); /* Subtracts 5 minutes */ | ||
| + | |||
| + | ====== int TimeLeft( void ); ====== | ||
| + | Returns the time left in minutes for the current user. | ||
| + | |||
| + | ====== int TimeOnline( void ); ====== | ||
| + | Returns the time in minutes that the current user is online. | ||
| + | |||
| + | |||
| + | ====== void SuspendTimer( void ); ====== | ||
| + | Suspends the online-timer for the current user. No time will be | ||
| + | subtracted until RestartTimer() is called. | ||
| + | |||
| + | |||
| + | ====== void RestartTimer( void ); ====== | ||
| + | Restarts the timer after a call to SuspendTimer(). | ||
| + | |||
| + | |||
| + | ====== void AdjustTime( void ); ====== | ||
| + | Call this function if you changed the user's level. This recalculates all | ||
| + | limits (time, | ||
| + | |||
| + | |||
| + | ====== void MsgEd( void ); ====== | ||
| + | Fires up the internal message editor or the fullscreen editor, depending | ||
| + | on the settings of the user. The message will be stored in the file | ||
| + | MSGTMP in the current directory. If a message is aborted, the file MSGTMP | ||
| + | will be deleted by the message editor. | ||
| + | before invoking the message editor, this file will be used as a ' | ||
| + | message. | ||
| + | |||
| + | |||
| + | ====== int PostMessage( char *from, char *to, char *subject, int area, bool pvt ); ====== | ||
| + | Posts a message to a user. | ||
| + | |||
| + | from = Name of the sender | ||
| + | to = Name of the user you're sending the message to | ||
| + | subject = Subject of the message | ||
| + | area = Message area number where the message has to be posted in | ||
| + | pvt = Private status (TRUE=private, | ||
| + | |||
| + | No checking is performed on any of the parameters! | ||
| + | |||
| + | Return value: -1 on error | ||
| + | 0 if ok | ||
| + | |||
| + | |||
| + | ====== int PostNetmail( char *from, char *to, char *subject, int area, FIDO_NODE *address, bool attach, bool crash, bool kill ); ====== | ||
| + | Posts a netmail message. | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | FIDO_NODE is a structure with the following fields: | ||
| + | |||
| + | | ||
| + | { | ||
| + | unsigned zone; /* Zone number | ||
| + | unsigned net; /* Net number | ||
| + | unsigned node; /* Node number | ||
| + | unsigned point; | ||
| + | } | ||
| + | |||
| + | No checking is performed on any of the parameters! | ||
| + | |||
| + | Return value: -1 on error | ||
| + | 0 if ok | ||
| + | |||
| + | |||
| + | ====== bool ReadMsgArea( int area, MSGAREA *ma ); ====== | ||
| + | Reads data about a message area. | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | Check the file PB_SDK.H for details about the MSGAREA structure | ||
| + | definition. | ||
| + | |||
| + | Return value: 6 | ||
| + | FALSE if not defined | ||
| + | TRUE if read ok | ||
| + | |||
| + | |||
| + | ====== bool ReadMessage( MESSAGE *msg, long msgid, int areanum ); ====== | ||
| + | Reads message id < | ||
| + | structure. | ||
| + | CreateMessageText(). | ||
| + | MESSAGE structure. | ||
| + | |||
| + | Return value: FALSE if the message does not exists | ||
| + | TRUE if the message is read ok | ||
| + | |||
| + | |||
| + | ====== void WriteMSGTMP( char *text ); ====== | ||
| + | Writes the string < | ||
| + | when using this function. To append text to MSGTMP, use the function | ||
| + | AppendMSGTMP(). You have to insert your own CR/LF pairs in the text if | ||
| + | you want to force a newline. | ||
| + | message processing functions will do a word-wrap if necessary. | ||
| + | insert a single CR or LF in the text. (\r or \n). | ||
| + | |||
| + | |||
| + | ====== void AppendMSGTMP( char *text ); ====== | ||
| + | Same as WriteMSGTMP(), | ||
| + | |||
| + | |||
| + | ====== void ShowMessage( MESSAGE *msg ); ====== | ||
| + | Shows the message <msg> to the user, including header and message text. | ||
| + | |||
| + | See the file PB_SDK.H for an description of the MESSAGE structure. | ||
| + | |||
| + | |||
| + | ====== void CreateMessageText( MESSAGE *msg ); ====== | ||
| + | Reads the text that belongs to message < | ||
| + | called MSGTMP in the current directory. This file can then be accessed as | ||
| + | an ordinary textfile. | ||
| + | |||
| + | |||
| + | ====== void CreateMessageTextString( MESSAGE *msg, char *text, int max); ====== | ||
| + | Reads the text that belongs to message < | ||
| + | < | ||
| + | specify a maximum number of characters that can be stored in < | ||
| + | |||
| + | |||
| + | |||
| + | ====== bool FirstMessage( MESSAGE *msg, int area, int order, long first); ====== | ||
| + | ====== bool NextMessage( | ||
| + | These functions are used to read messages in forward or reverse order. To | ||
| + | start scanning messages, you have to call the FirstMessage() function | ||
| + | first, and the NextMessage() function to read more messages. | ||
| + | |||
| + | | ||
| + | | ||
| + | order = 1 for forward order, -1 for reverse order | ||
| + | first = message to start reading from. This message does NOT need to | ||
| + | | ||
| + | will be read first. | ||
| + | |||
| + | See the file PB_SDK.H for an description of the MESSAGE structure. | ||
| + | |||
| + | Return value: | ||
| + | | ||
| + | |||
| + | This is an example on how to use these functions: | ||
| + | |||
| + | | ||
| + | 5, | ||
| + | +1, | ||
| + | 1 ); | ||
| + | while ( result == TRUE ) | ||
| + | { | ||
| + | /* Do something with the message */ | ||
| + | result | ||
| + | 5, | ||
| + | +1 ); | ||
| + | } | ||
| + | |||
| + | |||
| + | ====== void DeleteMessage( MESSAGE *msg ); ====== | ||
| + | Deletes message < | ||
| + | |||
| + | |||
| + | ====== void MarkMessage( long msgid ); ====== | ||
| + | Marks message < | ||
| + | marked. | ||
| + | |||
| + | |||
| + | ====== void ReadMarkedMessages( void ); ====== | ||
| + | Shows all marked messages to the user, with the option to wait after each | ||
| + | message. If the user selected to wait after each message, the standard | ||
| + | message options menu will be shown to the user. (Next, | ||
| + | |||
| + | In fact, this function is identical to menu function "Read Messages", | ||
| + | with the user selecting " | ||
| + | |||
| + | |||
| + | ====== void ListMarkedMessages( void ); ====== | ||
| + | Is similar to ReadMarkedMessages(), | ||
| + | " | ||
| + | |||
| + | |||
| + | ====== void UnMarkAllMessages( void ); ====== | ||
| + | Unmarks all messages that were previously marked. You have to call this | ||
| + | function before marking any messages, because the list of marked messages | ||
| + | is remembered until a user logs off. | ||
| + | |||
| + | |||
| + | ====== int NumMsgAreas( void ); ====== | ||
| + | Returns the highest message area number that is not empty. | ||
| + | |||
| + | |||
| + | ====== long GetLastRead( int areanum, long user_recno ); ====== | ||
| + | ====== void SetLastRead( int areanum, long user_recno, long msgid ); ====== | ||
| + | Reads / Sets the lastread pointer for a specific user and message area. | ||
| + | If GetLastRead() returns -1, an error occurred. | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | |||
| + | |||
| + | ====== int FuzzySearch( char *text, char *string, int degree ); ====== | ||
| + | Performs a fuzzy search for < | ||
| + | percentage of the characters in < | ||
| + | |||
| + | Return value: -1 if not found | ||
| + | >0 percentage of characters matched | ||
| + | |||
| + | |||
| + | ====== IO_... functions ====== | ||
| + | All functions starting with IO_ are low-level functions to access the | ||
| + | serial port directly. Do NOT use these functions for ordinary I/O | ||
| + | operations. They are intended for writing file transfer protocols. See | ||
| + | the file PB_SDK.H for the prototypes of these functions. | ||
| + | |||
| + | |||
| + | ====== char WaitKey( void ); ====== | ||
| + | Waits for a character to be read from the modem or local keyboard. | ||
| + | |||
| + | Return value: the character read. | ||
| + | |||
| + | |||
| + | ====== char WaitKeys( char *keylist ); ====== | ||
| + | Waits for any character specified in < | ||
| + | |||
| + | Return value: the key from the list that was pressed (converted to | ||
| + | uppercase if the key is a letter). | ||
| + | |||
| + | Example: | ||
| + | |||
| + | | ||
| + | /* Waits for A, | ||
| + | |||
| + | |||
| + | ====== void Input( char *buf, int len, int readmode ); ====== | ||
| + | Asks for a string from the user. The string is stored in < | ||
| + | user will not be allowed to enter more than <len> characters. | ||
| + | |||
| + | < | ||
| + | | ||
| + | converted to uppercase. | ||
| + | | ||
| + | uppercase. | ||
| + | | ||
| + | | ||
| + | modes if you don't want an input- | ||
| + | field background to be displayed. | ||
| + | |||
| + | |||
| + | ====== bool Ask( bool default ); ====== | ||
| + | Asks for a Yes or No response from the user. Pressing ' | ||
| + | and outputs " | ||
| + | Pressing < | ||
| + | < | ||
| + | |||
| + | |||
| + | ====== char PeekChar( void ); ====== | ||
| + | Checks if a character is available in the input buffer, and returns that | ||
| + | character if there is. | ||
| + | |||
| + | Return value: | ||
| + | != 0 the character read (key pressed by user) | ||
| + | |||
| + | |||
| + | |||
| + | ====== void SetColor( char color ); ====== | ||
| + | Changes the current output color. All text that is output after this | ||
| + | function is called will be displayed in the specified color. | ||
| + | function does nothing when the user does not have ANSI or AVATAR enabled. | ||
| + | |||
| + | < | ||
| + | |||
| + | | ||
| + | |||
| + | |||
| + | ====== void SetfullColor( unsigned char color ); ====== | ||
| + | Changes the current foreground & background color. The color code is an | ||
| + | IBM-type screen color code. This function does nothing when the user does | ||
| + | not have ANSI or AVATAR enabled. | ||
| + | |||
| + | Some examples: | ||
| + | |||
| + | 0x1E : Bright yellow on dark blue background. | ||
| + | 0x87 : Blinking white on a black background. | ||
| + | |||
| + | |||
| + | ====== void GotoXY( int x, int y ); ====== | ||
| + | Moves the cursor to position (x,y). The upper left corner of the screen | ||
| + | is (1,1). This function does nothing when the user does not have ANSI or | ||
| + | AVATAR enabled. | ||
| + | |||
| + | |||
| + | ====== void ClrEol(); ====== | ||
| + | Clears from the current cursor position to the end of the line. This | ||
| + | function does nothing when the user does not have ANSI or AVATAR enabled. | ||
| + | |||
| + | |||
| + | ====== void EnableStop( void ); ====== | ||
| + | ====== void DisableStop( void ); ====== | ||
| + | ====== bool Stopped( void ); ====== | ||
| + | Enables stopping of output by pressing ' | ||
| + | press ' | ||
| + | function will immediately return to the caller, en the function Stopped() | ||
| + | will return TRUE to indicate that the user requested to stop output. | ||
| + | |||
| + | | ||
| + | status to FALSE . | ||
| + | | ||
| + | | ||
| + | |||
| + | |||
| + | Example: | ||
| + | |||
| + | | ||
| + | for ( i = 0; i < 100; i++ ) | ||
| + | { | ||
| + | printf( " | ||
| + | if ( Stopped() ) | ||
| + | { | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ====== char ShowHotkeyFile( char *filename, char *hotkeys ); ====== | ||
| + | Shows the file < | ||
| + | are specified in < | ||
| + | function stops output, and returns the hotkey. The " | ||
| + | enabled when sending the file. | ||
| + | |||
| + | Return value: | ||
| + | 1 : ' | ||
| + | 2 : File not found | ||
| + | !=2 : Hotkey detected | ||
| + | |||
| + | |||
| + | ====== char ShowHotkeyANSIFile( char *filename, char *hotkeys ); ====== | ||
| + | This function is identical to ShowKotkeyFile(), | ||
| + | no extension and path can be specified. Depending on the setting of the | ||
| + | user, < | ||
| + | .ANS file is found, it will try to send the .ASC file. If that fails too, | ||
| + | 2 will be returned. | ||
| + | |||
| + | Return value: | ||
| + | 1 : ' | ||
| + | 2 : File not found | ||
| + | !=2 : Hotkey detected | ||
| + | |||
| + | |||
| + | |||
| + | ====== void InitLineCounter( void ); ====== | ||
| + | ====== bool LineCounter( void ); ====== | ||
| + | These functions are used to support page pausing ("More Y/ | ||
| + | InitLineCounter() initializes the line counter to 0. Every time you call | ||
| + | LineCounter(), | ||
| + | reaches the screen length, the user will be asked if he wants to continue | ||
| + | reading. If he selects " | ||
| + | FALSE. | ||
| + | |||
| + | Example: | ||
| + | |||
| + | | ||
| + | for ( ; ; ) | ||
| + | { | ||
| + | printf( " | ||
| + | if ( ! LineCounter() ) | ||
| + | { | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | ====== bool ExternalInput( void ); ====== | ||
| + | Returns TRUE when the last character that was read through any of the | ||
| + | input routings originated from the remote keyboard (ie. the sysop did not | ||
| + | type it). | ||
| + | |||
| + | |||
| + | ====== int ReadUser( USER_REC *rec, int recnr ); ====== | ||
| + | Reads user record number < | ||
| + | in < | ||
| + | |||
| + | Return value: -1 if record does not exist. | ||
| + | 0 if record is read ok. | ||
| + | |||
| + | |||
| + | ====== void WriteUser( USER_REC *rec ); ====== | ||
| + | Writes user record <rec> to the user file. The record number is stored | ||
| + | in the USER_REC structure. | ||
| + | different position in the user file, you have to change the ' | ||
| + | field in the USER_REC structure. | ||
| + | |||
| + | |||
| + | ====== bool SetUser( long recnr ); ====== | ||
| + | Sets the internal ProBoard user record to record number < | ||
| + | function should ONLY be called from _LOGIN.PEX !! | ||
| + | |||
| + | Return value: | ||
| + | FALSE on error | ||
| + | |||
| + | |||
| + | ====== char PlayMusic( char *filename, char *hotkeys ); ====== | ||
| + | Plays a .MUS file. The file has to be located in the ProBoard system | ||
| + | directory. Do not include a path and extension in < | ||
| + | can be stopped if the sysop presses one of the keys specified in | ||
| + | < | ||
| + | |||
| + | Return value: | ||
| + | | ||
| + | > | ||
| + | | ||
| + | |||
| + | |||
| + | ====== void PostInfo( char *filename ); ====== | ||
| + | Does exactly the same as the POSTINFO statement in a .Q-A file. No path | ||
| + | and extension is allowed in < | ||
| + | will be written to will have the extension .ASW and will be placed in the | ||
| + | ProBoard system directory. | ||
| + | |||
| + | |||
| + | ====== int ReadFileArea( int areanum, FILEAREA *fa ); ====== | ||
| + | Reads information about file area number < | ||
| + | |||
| + | Check the file PB_SDK.H for details about the FILEAREA structure. | ||
| + | |||
| + | Return value: | ||
| + | 0 Ok | ||
| + | |||
| + | |||
| + | ====== void MenuFunction( int function, char *data ); ====== | ||
| + | Executes menu function < | ||
| + | functions description in this file. | ||
| + | |||
| + | There are named constants declared for each function in the file | ||
| + | PB_SDK.H. It is recommended that you use these constants instead of | ||
| + | numbers. | ||
| + | |||
| + | |||
| + | ====== void Log( int loglevel, char *fmt, ... ); ====== | ||
| + | With this function you can write information to the ProBoard logfile. The | ||
| + | log entry will be written if the user has a loglevel that is greater than | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | | ||
| + | |||
| + | If you want a log entry to be written regardless of the user's loglevel, | ||
| + | use LOG_FRIEND. | ||
| + | |||
| + | The Log() function works like the printf function: you can use format | ||
| + | specifiers in the <fmt> string, and pass extra parameters. | ||
| + | |||
| + | Example: | ||
| + | Log(LOG_NORMAL," | ||
| + | |||
| + | |||
| + | ====== void HangUp(); ====== | ||
| + | Hangs up the phone, logging off the user. It is exactly the same as | ||
| + | pressing Alt-H. | ||
| + | |||
| + | |||
| + | ====== bool CheckAccess( int level, long flags ); ====== | ||
| + | Checks if the current user can access something that requires < | ||
| + | < | ||
| + | |||
| + | |||
| + | |||
| + | ====== KEY ScanKey( | ||
| + | Checks the LOCAL keyboard for a key, and returns the scan code for that | ||
| + | key. If no key is available, 0 will be returned. | ||
| + | |||
| + | For a list of defined values for scan codes, check the file PB_SDK.H. | ||
| + | |||
| + | |||
| + | |||
| + | ====== bool GetFlag( long flags, char flagchar ); ====== | ||
| + | ====== void SetFlag( long flags, char flagchar ); ====== | ||
| + | ====== void ClearFlag( long flags, char flagchar ); ====== | ||
| + | ====== | ||
| + | Access flags are stored in a long integer (32 bits). You have 3 macros at | ||
| + | your disposal to manipulate access flags: | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | ====== int ErrorLevel( void ); ====== | ||
| + | Returns the errorlevel of the last executed shell command (Through | ||
| + | MenuFunction(MENU_SHELL, | ||
| + | |||
| + | |||
| + | ====== bool GetIniVar( char *fname, char *varname, char *value, int max ); ====== | ||
| + | ====== bool SetIniVar( char *fname, char *varname, char *value ); ====== | ||
| + | These functions can be used to read and write to .INI files. These files | ||
| + | are similar to the files used by MS Windows. They can be used to store | ||
| + | settings for your application (PEX). An example of a .INI file: | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | This is a standard ASCII file, with each line in the form: | ||
| + | |||
| + | < | ||
| + | |||
| + | The value of a specific variable can be read by calling the function | ||
| + | GetIniVar(). Setting a variable (writing to the .INI file or createing it | ||
| + | if it doesn' | ||
| + | |||
| + | The parameters for the functions are: | ||
| + | |||
| + | < | ||
| + | always be changed to .INI by ProBoard. | ||
| + | < | ||
| + | < | ||
| + | variable' | ||
| + | For SetIniVar() : a pointer to the value of the | ||
| + | variable. | ||
| + | < | ||
| + | < | ||
| + | |||
| + | |||
| + | Return value: | ||
| + | |||
| + | |||
| + | ====== void exit( void ); ====== | ||
| + | Exits the current pex-program, | ||
| + | |||
| + | |||
| + | ====== void ExitTSR( void ); ====== | ||
| + | Exits the current pex-program, | ||
| + | important implications: | ||
| + | |||
| + | * All global and static variables keep their values for subsequent executions. | ||
| + | * When the same pex-file is run again through menu function 60, the resident copy will be executed. This will result in faster loading. | ||
| + | * Any handlers that were installed will be called. | ||
| + | |||
| + | |||
| + | ====== void InstallHandler( int handler, function ); ====== | ||
| + | This is probably the most advanced and complicated function in the | ||
| + | ProBoard SDK. With this function you can set up a " | ||
| + | specific action. Right now, only two types of handlers are supported: a | ||
| + | replacement for the sysopkey-handler and a handler to intercept loss of | ||
| + | carrier. This way you can create your own sysopkeys, or change the | ||
| + | behaviour of existing sysopkeys. You could create a handler that | ||
| + | intercepts the Alt-J key, and write your own flavor. In future versions | ||
| + | you will be able to set up handlers for low-level I/O operations. So you | ||
| + | could replace all I/O routines by your own functions. This way you can | ||
| + | support your own exotic hardware or something like that. Anything goes! | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | You can install as many handlers as you want. When the PEX is removed | ||
| + | from memory (when the PEX exits), all handlers that were installed will | ||
| + | be removed by ProBoard. | ||
| + | |||
| + | The handler function is a function that returns an integer. The | ||
| + | parameters depend on the type of handler you are creating. | ||
| + | |||
| + | For HANDLER_SYSOPKEY the handler function has to be declared like this: | ||
| + | |||
| + | int sysopkeyhandler( KEY k ) | ||
| + | { | ||
| + | ... | ||
| + | } | ||
| + | |||
| + | A sysopkey handler intercepts any special key that is pressed by the | ||
| + | sysop. (like F1, | ||
| + | |||
| + | |||
| + | For HANDLER_HANGUP, | ||
| + | |||
| + | int hanguphandler( void ) | ||
| + | { | ||
| + | ... | ||
| + | } | ||
| + | |||
| + | The hangup handler works a little different: it is called whenever | ||
| + | ProBoard exits (carrier lost, sysop hung up,...). It can be used to | ||
| + | perform some cleanup for your running PEX file (like closing files, | ||
| + | writing data, etc..). You can install the handler at the start of your | ||
| + | program and remove it before the program is finished. | ||
| + | |||
| + | If a handler function decides to do anything, it has to return HANDLED. | ||
| + | If the handler wants to leave it up to ProBoard, it must return | ||
| + | NOT_HANDLED. | ||
| + | |||
| + | This asks for an example I suppose: | ||
| + | |||
| + | int keyhandler( KEY k ) | ||
| + | { | ||
| + | if ( k == KEY_ALTJ ) | ||
| + | { | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | main( int | ||
| + | char *argv[] ) | ||
| + | { | ||
| + | InstallHandler( HANDLER_SYSOPKEY, | ||
| + | ExitTSR(); | ||
| + | } | ||
| + | |||
| + | So what does it do? It intercepts the sysopkey-function, | ||
| + | the key pressed is Alt-J. If it is, it shells to DOS with swapping ON, | ||
| + | and it writes its own messages to the screen. | ||
| + | the handler returns HANDLED to let ProBoard know that it does not have to | ||
| + | process the key. You could use this example in an INIT.PEX file. Is this | ||
| + | powerful or what? | ||
| + | |||
| + | |||
| + | ====== void RemoveHandler( int handler, function ); ====== | ||
| + | Removes handler number < | ||
| + | InstallHandler(). | ||
| + | be removed. | ||
| + | |||
| + | |||
| + | ====== long MsgNum( int area, long id ) ====== | ||
| + | Returns the message number for message ' | ||
| + | and *.MSG, this is identical to the message id (but DO NOT rely on | ||
| + | that). | ||
| + | |||
| + | |||
| + | ====== long MsgId( int area, long n ) ====== | ||
| + | Returns the message id for message number ' | ||
| + | and *.MSG, this is identical to the message number (but DO NOT rely on | ||
| + | that). | ||
| + | |||
| + | |||
| + | ====== long HighMsg( int area ) ====== | ||
| + | Returns the message id of the last message in the given area. Note: if | ||
| + | the lastread pointer is higher than what this function returns, DO NOT | ||
| + | use FirstMessage()! | ||
| + | past the end of the area. (if you know what I mean :-) | ||
| + | |||
| + | |||
| + | ====== long NumMsgs( int area ) ====== | ||
| + | Returns the total number of active messages in the given area. | ||
| + | |||
| + | |||
| + | ====== void LocalDisplay( bool showlocal ) ====== | ||
| + | Enables/ | ||
| + | local display" | ||
| + | an example. | ||
| + | |||
| + | |||
| + | ====== void RemoteDisplay( bool showremote ) ====== | ||
| + | Enables/ | ||
| + | remote display" | ||
| + | for an example. | ||
| + | |||
| + | |||
| + | ====== bool RIP() ====== | ||
| + | Returns | ||
| + | FALSE if not... | ||
| + | |||
| + | |||
| + | ====== void ShowRIPscrip( char *name ) ====== | ||
| + | This will send a RIP file located in the RIP directory. | ||
| + | extension should be given. | ||
| + | on the local screen. | ||
| + | |||
| + | |||
| + | ====== void ResetInactivity( void ) ====== | ||
| + | Resets the internal inactivity timeout counter. | ||
| + | used when returning from a shell or after a time-consuming function has | ||
| + | been called. | ||
| + | inactivity. | ||
| + | |||
| + | |||
| + | ====== bool AddTaggedFile( TAGGED_FILE *tag ) ====== | ||
| + | Adds a file to the internal list of tagged files. | ||
| + | |||
| + | Returns | ||
| + | FALSE if the file was already tagged. | ||
| + | |||
| + | |||
| + | ====== bool RemoveTaggedFile( TAGGED_FILE *tag ) ====== | ||
| + | Removes a file from the internal list of tagged files. | ||
| + | the tagged file was found and deleted from the list, or FALSE if the | ||
| + | tagged file was not in the list. | ||
| + | |||
| + | |||
| + | ====== void ClearTaggedFiles( void ) ====== | ||
| + | Clears the internal list of tagged files (all tags are removed). | ||
| + | |||
| + | |||
| + | ====== bool IsTagged( TAGGED_FILE *tag ) ====== | ||
| + | Returns | ||
| + | FALSE if not. | ||
| + | |||
| + | |||
| + | ====== int GetTaggedFiles( TAGGED_FILE *tagarray, int maxitems ) ====== | ||
| + | Fills the given array < | ||
| + | of tagged files (up to a maximum of < | ||
| + | the number of tagged files copied to the array < | ||
| + | |||
| + | |||
| + | ====== bool PutTaggedFiles( TAGGED_FILE *tagarray, int nitems ) ====== | ||
| + | Fills the internal list of tagged files with the files in the given array | ||
| + | < | ||
| + | |||
| + | Returns | ||
| + | FALSE on error | ||
| + | |||
| + | |||
| + | ====== Global ProBoard Variables ====== | ||
| + | You have access to some important ProBoard system variables through | ||
| + | global variables defined in PB_SDK.H. | ||
| + | |||
| + | |||
| + | ====== word PBVersion; ====== | ||
| + | The version number of ProBoard. The high byte is the major version number | ||
| + | (eg. 1). The low byte is the minor version number in hex (eg. 0x30). So | ||
| + | if you're using ProBoard v1.30, PBVersion will be set to 0x0130 . | ||
| + | |||
| + | |||
| + | ====== word Beta; ====== | ||
| + | The beta version number of ProBoard. If this number is 0xFFFF, it means | ||
| + | that the release version is running. Beta numbers start from 1. | ||
| + | |||
| + | For example, when running ProBoard 1.40 Beta/19, PBVersion will be set to | ||
| + | 0x0140, and Beta will be set to 19. | ||
| + | |||
| + | |||
| + | ====== long BaudRate ====== | ||
| + | The current bps rate of the caller. 0 means local. | ||
| + | |||
| + | |||
| + | ====== USER_REC *CurUser; ====== | ||
| + | Pointer to the current user record. You can change any of the field | ||
| + | values in the record, but this will not result in any immediate action by | ||
| + | ProBoard. For example, if you change the user's level, ProBoard will not | ||
| + | know that you changed it, so you will have to tell it by calling | ||
| + | AdjustTime(); | ||
| + | |||
| + | Check the file PB_SDK.H for a description of the USER_REC structure. | ||
| + | |||
| + | |||
| + | ====== int UserRecNr; ====== | ||
| + | The record number of the current user's record in the file USERS.BBS, | ||
| + | starting from 0. This value cannot be changed. | ||
| + | |||
| + | |||
| + | ====== int NumLimits; ====== | ||
| + | The number of user levels defined in ProCFG. You can access the | ||
| + | limit-values through the global array ' | ||
| + | changed. | ||
| + | |||
| + | |||
| + | ====== LIMIT *Limits; ====== | ||
| + | Is an array of all user levels defined, with download and time limits. | ||
| + | Check the file PB_SDK.H for information on the LIMIT structure. | ||
| + | |||
| + | You are not allowed to change any values! (A good compiler should | ||
| + | generate an error or warning if you try to do so) | ||
| + | |||
| + | |||
| + | ====== char *LoginDate; ====== | ||
| + | ====== char *LoginTime; ====== | ||
| + | This is the login date & time of the current user. | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | |||
| + | ====== bool NetEntered; ====== | ||
| + | ====== bool EchoEntered; | ||
| + | These READ-ONLY variables tell you if netmail and/or echomail has been | ||
| + | entered during this session. | ||
| + | |||
| + | |||
| + | ====== int NumUsers; ====== | ||
| + | This READ-ONLY variable is the number of users currently available in the | ||
| + | file USERS.BBS. | ||
| + | |||
| + | |||
| + | ====== int NodeNumber; ====== | ||
| + | This READ-ONLY variable is the current node number. | ||
| + | |||
| + | |||
| + | ====== char *CurMenu; ====== | ||
| + | ====== char *UserFirstname; | ||
| + | ====== char *PrevUser; ====== | ||
| + | ====== char *StartupPath; | ||
| + | ====== char *SysPath; ====== | ||
| + | ====== char *PageReason; | ||
| + | CurMenu | ||
| + | UserFirstName : First name of current user | ||
| + | PrevUser | ||
| + | StartupPath | ||
| + | (with trailing ' | ||
| + | SysPath | ||
| + | PageReason | ||
| + | |||
| + | These are READ-ONLY strings! (except PageReason) | ||
| + | |||
| + | |||
| + | ====== word *PageCount; ====== | ||
| + | POINTER to the number of sysop pages done by the user. This value can be | ||
| + | changed by changing the unsigned integer pointed to by ' | ||
| + | |||
| + | |||
| + | ====== CONFIG *Config; ====== | ||
| + | A pointer to the current ProBoard configuration structure. See the file | ||
| + | PB_SDK.H for a description of the CONFIG structure. | ||
| + | |||
| + | |||
| + | ====== Special-purpose PEX-files ====== | ||
| + | Several pex-files will be loaded automatically (if present). They perform | ||
| + | certain actions like edit a message, set up handlers, etc. | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | order of the numbers. So you can have up to 10 | ||
| + | | ||
| + | | ||
| + | the section explaining this PEX for more information | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | (x = 1 to 9) | ||
| + | | ||
| + | Is run before SECxx.ANS/ | ||
| + | | ||
| + | | ||
| + | date was reached. ProBoard will send one parameter | ||
| + | to this PEX: the original level, before it was | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | will be executed with no parameters. The message | ||
| + | that you create has to be written to a file called | ||
| + | | ||
| + | | ||
| + | the user has aborted a message, delete MSGTMP. | ||
| + | | ||
| + | user has selected the fullsrceen editor. It works | ||
| + | the same way as MSGED.PEX, but ProBoard will create | ||
| + | a MSGTMP file with the original message if a user is | ||
| + | | ||
| + | |||
| + | |||
| + | ====== Using the _LOGIN PEX ====== | ||
| + | By writing a _LOGIN.PEX, ProBoard allows you to replace the normal login | ||
| + | procedure (not including the new user procedure) with your own. It is | ||
| + | the PEX's responsibility to check for validity of the name entered and to | ||
| + | do password checking! | ||
| + | |||
| + | Once you determined the record number of the user, you have to call the | ||
| + | function SetUser() with the record number as parameter, and exit the PEX | ||
| + | immediately. | ||
| + | |||
| + | If the user is not in the user database yet, you should exit without | ||
| + | calling SetUser(), and set the name that was entered by the user in a | ||
| + | memory region supplied by ProBoard to your PEX as the only parameter. | ||
| + | This parameter is a ' | ||
| + | a pointer using the following procedure: | ||
| + | |||
| + | / | ||
| + | | ||
| + | | ||
| + | | ||
| + | for ( s = argv[ 1 ]; *s; s++ ) | ||
| + | { | ||
| + | dwName | ||
| + | } | ||
| + | | ||
| + | / | ||
| + | |||