Miscellaneous utility functions


The remaining functions in this section are simple utility functions that can be used to facilitate the programming effort. These functions may or may not be required by an application program. In some cases, users may wish to substitute their own commands and functions, depending upon the requirements of the application.

Function

Description

int SG_get_date (char *date)

Get the date and time, in yyyy/mm/dd hh:mm:ss format. This date and time is the standard time element used by the Sigma library, and is used by the SG_diff_date() function described below. 

int SG_diff_date (char *date1, char *date2)

Return the number of elapsed seconds between the two dates, where each date is the format described by the SG_get_date() function above. This is useful for determining the elapsed time between any two timestamps. 

int SG_run_program (char *syscmd)

This function operates similar to a "system()" function call, but should be used to launch any program within Sigma. In certain situations, the command makes use of a system server process to actually execute the command (required for proper IIS operation.) Otherwise, the above program operates identically to the standard system() function call. 

int SG_smatch (char *patt, char *string)

Return True (1) if the specified pattern exists in the specified string. The pattern can contain the standard "^", "*", and "?" wildcards. This is a way of quickly testing whether a specified pattern exists in a specified string. 

int SG_get_basename (char *path, char *basename)

Given a pathname, return the basename, which is the name of a file without the leading path or trailing suffix. This provides general utility in processing filenames, in particular configuration file names. 

char *SG_get_tab_on_color ()

Return a pointer to a string indicating the color of selected navigation tabs configured on the Sigma Framework "Parms" screen. This function should be used to acquire color values when creating HTML components. 

char *SG_get_tab_off_color ()

Return a pointer to a string indicating the color of UNSELECTED navigation tabs configured on the Sigma Framework "Parms" screen. This function should be used to acquire color values when creating HTML components. 

char *SG_get_text_on_color ()

Return a pointer to a string indicating the color of selected navigation tab text configured on the Sigma Framework "Parms" screen. This function should be used to acquire color values when creating HTML components. 

char *SG_get_text_off_color ()

Return a pointer to a string indicating the color of UNSELECTED navigation tabs text configured on the Sigma Framework "Parms" screen. This function should be used to acquire color values when creating HTML components. 

char *SG_get_default_access()

Return a pointer to a string indicating the particular default user name, configured on the Sigma Framework "Parms" screen. This function is provided for completeness. 

char *SG_get_email_contact()

Return a pointer to a string indicating the particular System e-mail contact, configured on the Sigma Framework "Parms" screen. This function is provided for completeness. 

void SG_require_admin ()

Check the current S_ACCESS value. If it does not indicate that the currently logged in user is an administrator is logged into the system, immediately exit the program and display the "s-html/error-access.html" screen. This function can be placed at the start of a CGI program to ensure only Administrators can access the screen. 

void SG_deny_guest ()

Check the current S_ACCESS value. If it indicates that the currently logged in user is a guest, immediately exit the program and display the "s-html/error-access.html" screen. This function can be placed at the start of a CGI program to ensure guest logins cannot access the screen. 



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*