shotloglib_h

/*
**	Copyright 2003-2013, Fermi Research Alliance, LLC.  All rights reserved.
*/
/******************************************************************************/
/* shotloglib.h
**  
**	prototypes and defined constants for argument values for
**	ul_shotloglib library routines
**
*/
/******************************************************************************/

#ifndef SHOTLOGLIB_DEFINED			/* do this only once */
#define	SHOTLOGLIB_DEFINED

#include "web_logs.h"

/******************************************************************************/
/* 
**	macros
*/
/******************************************************************************/

/******************************************************************************/
/* 
**	defined constants for argument values and structure definitions
*/
/******************************************************************************/

#define	SL_LOG_TYPE_COMMENT	1	/* comment string */
#define	SL_LOG_TYPE_IMAGE	2	/* embedded image */
#define	SL_LOG_TYPE_CHAPTER	3	/* new chapter */
#define	SL_LOG_TYPE_URL		4	/* display URL */
#define	SL_LOG_TYPE_URL_SVG	5	/* display URL (with SVG image) */
#define	SL_LOG_TYPE_URL_PNG	6	/* display URL (with PNG image) */
#define	SL_LOG_TYPE_URL_GIF	7	/* display URL (with GIF image) */
#define	SL_LOG_TYPE_JOB_STATUS	8	/* request job status */

#define	SL_LOG_NAME_LEN		32	/* number of characters in a log name */
#define	SL_PAGE_NAME_LEN	16	/* number of characters in a page name */
#define	SL_SOURCE_NAME_LEN	32	/* number of characters in a source name */
#define	SL_SUBSOURCE_NAME_LEN	2	/* number of characters in a subsource name */
#define	SL_MIN_SUBSOURCE_VALUE	0
#define	SL_MAX_SUBSOURCE_VALUE	99
#define	SL_NUM_SUBSOURCES	(SL_MAX_SUBSOURCE_VALUE - SL_MIN_SUBSOURCE_VALUE + 1)
#define	SL_AUTHOR_NAME_LEN	16	/* number of characters in an author name */
#define	SL_SERVER_NAME_LEN	32	/* number of characters in a server name */
#define	SL_ERROR_STRING_LEN	132	/* number of characters in an error string */
#define	SL_LOG_TYPE_NAME_LEN	32	/* number of characters in a log type name */

#define	SL_MAX_IMAGES		9	/* maximum number of images to capture */

#define	SL_SCREEN_TITLE_LEN	40	/* number of characters in a screen title */

#define	SL_SELECT_WINDOW_BY_NUMBER	1	/* use console window constants to specify window */
#define	SL_SELECT_WINDOW_BY_TITLE	2	/* select console window by title */

#define	SL_OPT_NONE		0	/* no options selected */
#define	SL_OPT_SVG_URL		1	/* URL points to an SVG image */
#define	SL_OPT_PNG_URL		2	/* URL points to a PNG image */
#define	SL_OPT_GIF_URL		4	/* URL points to a GIF image */

#define	SL_ENTRY_ID_NONE	(-2)	/* no entry ID provided */
#define	SL_ENTRY_ID_LAST	(-1)	/* use last entry ID */

#define	SL_VISIBILITY_NORMAL	0	/* normal visibility */
#define	SL_VISIBILITY_IMPORTANT	1	/* highlighted entry */
#define	SL_VISIBILITY_HIDDEN	2	/* hidden from other users */

/******************************************************************************/
/* 
**	data structures
*/
/******************************************************************************/


/******************************************************************************/
/*
**	function prototypes
*/
/******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

int shotlog_get_default_server_host(char *server_name);
int shotlog_get_last_entry_id(int *last_entry_id);
int shotlog_get_log(char *log_name, int *log_type=(int *) NULL);
int shotlog_get_server_host(char *server_name);
int shotlog_get_test_server_host(char *server_name);
int shotlog_insert_chapter_c(char *comment, unsigned int options,
			     char *error_string);
int shotlog_insert_comment_c(char *comment, unsigned int options,
			     char *error_string, int entry_id=SL_ENTRY_ID_NONE,
			     int visibility=SL_VISIBILITY_NORMAL);
int shotlog_insert_url_c(char *url, unsigned int options,
			 char *error_string, int entry_id=SL_ENTRY_ID_NONE,
			 int visibility=SL_VISIBILITY_NORMAL);
int shotlog_insert_window_image_c(int num_images, int *consoles,
				  int select_type, void *screens,
				  char *comment, unsigned int options,
				  char *error_string,
				  int entry_id=SL_ENTRY_ID_NONE,
				  int visibility=SL_VISIBILITY_NORMAL);
int shotlog_is_valid_log_type_c(int log_type, char *type_string=(char *) NULL);
int shotlog_request_job_status(int *num_queued, int *num_processing,
			       char *error_string);
int shotlog_set_author(char *author_name);
int shotlog_set_log_c(char *log_name, unsigned int options,
		      int log_type=WEBLOG_LOGTYPE_DEFAULT);
int shotlog_set_server_host(char *server_name);
int shotlog_set_source_c(char *source_name, char *subsource_name,
			 unsigned int options);
int shotlog_translate_log_name_c(char *alias_name, char *log_name,
				 int accept_no_match,
				 int *log_type=(int *) NULL);

#ifdef __cplusplus
}
    #endif

/******************************************************************************/
/*
**	equivalent name definitions
*/
/******************************************************************************/

#define	SHOTLOG_GET_DEFAULT_SERVER_HOST	shotlog_get_default_server_host
#define	SHOTLOG_GET_LAST_ENTRY_ID	shotlog_get_last_entry_id
#define	SHOTLOG_GET_LOG			shotlog_get_log
#define	SHOTLOG_GET_SERVER_HOST		shotlog_get_server_host
#define	SHOTLOG_GET_TEST_SERVER_HOST	shotlog_get_test_server_host
#define	SHOTLOG_INSERT_CHAPTER_C	shotlog_insert_chapter_c
#define	SHOTLOG_INSERT_COMMENT_C	shotlog_insert_comment_c
#define	SHOTLOG_INSERT_URL_C		shotlog_insert_url_c
#define	SHOTLOG_INSERT_WINDOW_IMAGE_C	shotlog_insert_window_image_c
#define	SHOTLOG_IS_VALID_LOG_TYPE_C	shotlog_is_valid_log_type_c
#define	SHOTLOG_REQUEST_JOB_STATUS	shotlog_request_job_status	
#define	SHOTLOG_SET_AUTHOR		shotlog_set_author
#define	SHOTLOG_SET_LOG_C		shotlog_set_log_c
#define	SHOTLOG_SET_SERVER_HOST		shotlog_set_server_host
#define	SHOTLOG_SET_SOURCE_C		shotlog_set_source_c
#define	SHOTLOG_TRANSLATE_LOG_NAME_C	shotlog_translate_log_name_c 

#endif