Module QM_MAINT_TABLES

  Define Type QM_VIEW_TYPES
    Keyword DATABASE, Nonnegatable
    Keyword DIRECTORY_TREE, Nonnegatable

  Define Type QM_MATCH_TYPES
    Keyword AND
    Keyword OR

  Define Verb CLEAN
    Routine CLEAN
    Parameter P1, Prompt = "Channel", Label = CHANNEL, Value
    Qualifier CONTENT, Nonnegatable, Value (Required)
    Qualifier DELETE, Nonnegatable
    Qualifier DATABASE, Nonnegatable
    Qualifier DIRECTORY_TREE, Nonnegatable
    Qualifier DOMAIN_TO, Nonnegatable, Value (Required)
    Qualifier ENV_FROM, Nonnegatable, Value (Required)
    Qualifier ENV_TO, Nonnegatable, Value (Required)
    Qualifier FROM, Nonnegatable, Value (Required)
    Qualifier HOLD, Nonnegatable, Default
    Qualifier IGNORE_ZZ
    Qualifier MATCH, Nonnegatable, Value (Required, Type = QM_MATCH_TYPES)
    Qualifier MIN_LENGTH, Nonnegatable, Value (Required)
    Qualifier NOTHREADS, Nonnegatable, Default
    Qualifier SUBJECT, Nonnegatable, Value (Required)
    Qualifier THREADS, Nonnegatable, Value (Required)
    Qualifier TO, Nonnegatable, Value (Required)
    Qualifier VERBOSE, Default
    Disallow DATABASE and DIRECTORY_TREE
    Disallow THREADS and NOTHREADS
    Disallow HOLD and DELETE

  Define Type COUNTER_OPS
    Keyword CLEAR, Syntax = COUNTERS_CLEAR
    Keyword CREATE, Syntax = COUNTERS_CREATE
    Keyword DELETE, Syntax = COUNTERS_DELETE
    Keyword SHOW, Syntax = COUNTERS_SHOW
    Keyword TODAY, Syntax = COUNTERS_TODAY
!+!%ifdef __VMS
    Keyword CRDB, Syntax = COUNTERS_CRDB
    Keyword SYNCHRONIZE, Syntax = COUNTERS_SYNC
!+!%endif

  Define Syntax COUNTERS_CLEAR
    Routine C_CLEAR
    Parameter P1, Value (Required, Type = COUNTER_OPS)
    Qualifier CHANNELS, Default
    Qualifier ASSOCIATIONS, Default

!+!%ifdef __VMS
  Define Syntax COUNTERS_CRDB
    Routine C_CRDB
    Parameter P1, Value (Required, Type = COUNTER_OPS)

  Define Syntax COUNTERS_SYNC
    Routine C_SYNC
    Parameter P1, Value (Required, Type = COUNTER_OPS)
    Qualifier TIMEOUT, Nonnegatable, Value (Required)
!+!%endif

  Define Syntax COUNTERS_CREATE
    Routine C_CREATE
    Parameter P1, Value (Required, Type = COUNTER_OPS)
    Qualifier MAX_CHANNELS, Nonnegatable, Value (Required)

  Define Syntax COUNTERS_DELETE
    Routine C_DELETE
    Parameter P1, Value (Required, Type = COUNTER_OPS)

  Define Syntax COUNTERS_SHOW
    Routine C_SHOW
    Parameter P1, Value (Required, Type = COUNTER_OPS)
    Parameter P2, Label = CHANNEL, Value
    Qualifier HEADERS
    Qualifier OUTPUT, Nonnegatable, Value (Required, Type = $OUTFILE)
!+!%ifdef __VMS
    Qualifier TIMEOUT, Nonnegatable, Value (Required)
    Qualifier SYNCHRONIZE, Default
!+!%endif

  Define Syntax COUNTERS_TODAY
    Routine C_TODAY
    Parameter P1, Value (Required, Type = COUNTER_OPS)

  Define Verb COUNTERS
    Routine C_SHOW
    Parameter P1, Value (Type = COUNTER_OPS)
    Parameter P2, Value
    Qualifier HEADERS
    Qualifier OUTPUT, Nonnegatable, Value (Required, Type = $OUTFILE)
!+!%ifdef __VMS
    Qualifier TIMEOUT, Nonnegatable, Value (Required)
    Qualifier SYNCHRONIZE
!+!%endif

  Define Verb DATE
    Routine DATE

  Define Verb DELETE
    Routine DELETE
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Qualifier LOG
    Disallow (ALL and MSGID)
    Disallow (not ALL) and (not MSGID)

  Define Verb DIRECTORY
    Routine DIRECTORY
    Parameter P1, Label = CHANNEL, Value
    Qualifier FROM, Value (Required)
    Qualifier HELD
    Qualifier DATABASE, Nonnegatable
    Qualifier DIRECTORY_TREE, Nonnegatable
    Qualifier ENVELOPE, Nonnegatable
    Qualifier FILE_INFO, Default
    Qualifier MATCH, Value (Type = QM_MATCH_TYPES)
    Qualifier OWNER, Value (Required)
    Qualifier TOTAL
    Qualifier TO, Value (Required)
    Disallow (DATABASE or OWNER) and (HELD or DIRECTORY_TREE)
    Disallow (MATCH) and not (FROM or TO)

  Define Verb EXIT
    Routine EXIT

  Define Verb HELD
    Routine HELD
    Parameter P1, Label = CHANNEL, Value
    Qualifier FROM, Value (Required)
    Qualifier ENVELOPE, Nonnegatable
    Qualifier FILE_INFO, Default
    Qualifier MATCH, Value (Type = QM_MATCH_TYPES)
    Qualifier TOTAL
    Qualifier TO, Value (Required)

  Define Verb HELP
    Routine HELP
    Parameter P1, Label = TOPIC, Value (Type = $REST_OF_LINE)

  Define Verb HISTORY
    Routine HISTORY
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Disallow (ALL and MSGID)
    Disallow (not ALL) and (not MSGID)

  Define Verb HOLD
    Routine HOLD
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Qualifier LOG
    Disallow (ALL and MSGID)
    Disallow (not ALL) and (not MSGID)

  Define Verb MESSAGES
    Routine MESSAGES
    Parameter P1, Label = CHANNEL, Value

  Define Verb QUIT
    Routine EXIT

  Define Verb READ
    Routine READ
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Qualifier CONTENT
    Disallow (ALL and MSGID)
    Disallow (not ALL) and (not MSGID)

  Define Verb RELEASE
    Routine RELEASE
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Qualifier LOG
    Disallow (ALL and MSGID)
    Disallow (not ALL) and (not MSGID)

  Define Verb RETURN
    Routine RETURN
    Parameter P1, Label = MSGID, Value (List)
    Qualifier ALL, Nonnegatable
    Qualifier CHANNEL, Nonnegatable, Value (Required)
    Qualifier CONFIRM
    Qualifier LOG
    Qualifier DEBUG
    Disallow (ALL and MSGID)
!    Disallow (not ALL) and (not MSGID)

  Define Verb RUN
    Routine RUN
    Parameter P1, Label = INFILE, Value (Required, Type = $INFILE)
    Qualifier IGNORE
    Qualifier LOG, Default

  Define Verb START
    Routine START
    Parameter P1, Prompt = "Channel", Label = CHANNEL, Value

  Define Verb STOP
    Routine STOP
    Parameter P1, Prompt = "Channel", Label = CHANNEL, Value

  Define Verb SUMMARIZE
    Routine SUMMARY
    Parameter P1, Prompt = "Channel", Label = CHANNEL, Value
    Qualifier DATABASE, Nonnegatable
    Qualifier DIRECTORY_TREE, Nonnegatable
    Qualifier HEADING, Negatable, Default
    Qualifier HELD, Negatable
    Qualifier TRAILING, Negatable, Default

  Define Type QSCAN_TYPE_INFO
    Keyword LENGTH, Nonnegatable, Value (Required)
    Keyword START, Nonnegatable, Value (Required)

  Define Verb TOP
    Routine TOP
    Parameter P1, Prompt = "Channel", Label = CHANNEL, Value
    Qualifier CONTENT, Nonnegatable, Value (Type = PMDF_QSCAN_TYPE_INFO, List)
    Qualifier DATABASE, Nonnegatable
    Qualifier DIRECTORY_TREE, Nonnegatable
    Qualifier DOMAIN_TO, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier ENV_FROM, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier ENV_TO, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier FROM, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier HELD
    Qualifier IGNORE_ZZ
    Qualifier MIN_COUNT, Nonnegatable, Value (Required)
    Qualifier NOTHREADS, Nonnegatable, Default
    Qualifier SUBJECT, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier THREADS, Nonnegatable, Value (Required)
    Qualifier TO, Nonnegatable, Value (Type = QSCAN_TYPE_INFO, List)
    Qualifier TOP, Nonnegatable, Value (Required)
    Qualifier VERBOSE, Default
    Disallow DATABASE and DIRECTORY_TREE
    Disallow THREADS and NOTHREADS

  Define Verb VIEW
    Routine VIEW
    Parameter P1, Value (Type = QM_VIEW_TYPES)
