/*      @(#)pm_proto.h	1.9 9/14/91 SMI      */

/*
 *	(c) Copyright 1990 Sun Microsystems, Inc. Sun design patents 
 *	pending in the U.S. and foreign countries. See LEGAL NOTICE 
 *	file for terms of the license.
 */

#ifndef _pm_proto_h
#define _pm_proto_h

/*
 * A description of the ToolTalk protocol used by the Process Manager.
 */

/* Well known ptypes (these should move to another file someday.) */

#define SUN_PROCESS_MANAGER		"Sun_Process_Manager"
#define SUN_UNIX_TASK_MANAGER		"Sun_Unix_Task_Manager"
#define SUN_BACKGROUND_TASK_MANAGER	"Sun_Background_Task_Manager"

/* Messages to Process Manager */

#define SUN_PM_REGISTER			"Sun_PM_Register"
#define SUN_PM_REGISTER_ARG_ATTRS	0
#define SUN_PM_REGISTER_ARG_STATUS	1
#define SUN_PM_REGISTER_N_ARGS		2

#define SUN_PM_UNREGISTER		"Sun_PM_Unregister"

#define SUN_PM_REGISTER_TASK		"Sun_PM_Register_Task"
#define SUN_PM_REGISTER_TASK_ARG_TASKID	0
#define SUN_PM_REGISTER_TASK_ARG_ATTRS	1
#define SUN_PM_REGISTER_TASK_ARG_STATUS 2
#define SUN_PM_REGISTER_TASK_N_ARGS	3

#define SUN_PM_UNREGISTER_TASK  	"Sun_PM_Unregister_Task"
#define SUN_PM_UNREGISTER_TASK_ARG_TASKID 0

#define SUN_PM_UNREGISTER_ALL_TASKS	"Sun_PM_Unregister_All_Tasks"

#define SUN_PM_SET_TASK_ATTRS		"Sun_PM_Set_Task_Attrs"
#define SUN_PM_SET_TASK_ATTRS_ARG_TASKID 0
#define SUN_PM_SET_TASK_ATTRS_ARG_ATTRS 1

#define SUN_PM_LOG			"Sun_PM_Log"
#define SUN_PM_LOG_ARG_TASKID		0
#define SUN_PM_LOG_ARG_TIME		1
#define SUN_PM_LOG_ARG_PRIORITY		2
#define SUN_PM_LOG_ARG_MESSAGE		3

/* Messages from Process Manager */

#define SUN_PM_PLEASE_REGISTER		"Sun_PM_Please_Register"
#define SUN_PM_PLEASE_UPDATE		"Sun_PM_Please_Update"
#define SUN_PM_GOOD_BYE			"Sun_PM_Good_Bye"

#define SUN_PM_UNIX_MANAGE		"Sun_Unix_PM_Manage_Unix_Processes"

/* Task commands. */

#define SUN_PM_CANCEL_TASK		"Sun_PM_Cancel_Task"
#define SUN_PM_RESTART_TASK		"Sun_PM_Restart_Task"
#define SUN_PM_CONTINUE_TASK		"Sun_PM_Continue_Task"
#define SUN_PM_FINISH_TASK		"Sun_PM_Finish_Task"
#define SUN_PM_SUSPEND_TASK		"Sun_PM_Suspend_Task"

#define SUN_PM_TASK_ATTR_NAME		"Name"
#define SUN_PM_TASK_ATTR_STATE		"State"
#define SUN_PM_TASK_ATTR_OPERATIONS	"Operations"

#define SUN_PM_TASK_STATE_RUNNING	"Running"
#define SUN_PM_TASK_STATE_SUSPENDED	"Suspended"
#define SUN_PM_TASK_STATE_UNKNOWN	"Unknown"

#define SUN_PM_MANAGER_ATTR_NAME	"Name"
#define SUN_PM_MANAGER_ATTR_X_WINDOW_ID "X_Window_ID"

/* Status values for SUN_PM_REGISTER and SUN_PM_REGISTER_TASK */

#define SUN_PM_STATUS_OK		0
#define SUN_PM_STATUS_BAD_ALLOC		-1
#define SUN_PM_STATUS_TASK_ID_IN_USE	-2
#define SUN_PM_STATUS_NOT_REGISTERED	-3

/* Operations are separated by ... */

#define PM_OPERATIONS_SEPARATOR_CHAR	':'
#define PM_OPERATIONS_SEPARATOR_STRING	":"

/* Log entry priorities and types. */

#define PM_TASK_LOG_PRI_EMERG	0
#define PM_TASK_LOG_PRI_ALERT	1
#define PM_TASK_LOG_PRI_CRIT	2
#define PM_TASK_LOG_PRI_ERR	3
#define PM_TASK_LOG_PRI_WARNING	4
#define PM_TASK_LOG_PRI_NOTICE	5
#define PM_TASK_LOG_PRI_INFO	6
#define PM_TASK_LOG_PRI_DEBUG	7

#endif /* _pm_proto_h */
