/*
dnl  This file is part of GNU APL, a free implementation of the
dnl  ISO/IEC Standard 13751, "Programming Language APL, Extended"
dnl
dnl  Copyright © 2008-2026  Dr. Jürgen Sauermann
dnl
dnl  This program is free software: you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation, either version 3 of the License, or
dnl  (at your option) any later version.
dnl
dnl  This program is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


/// APserver request: ⎕SVO
m4_signal(MAKE_OFFER,       x64,    key)
/// APserver request: ⎕SVR
m4_signal(RETRACT_OFFER,    x64,    key)
/// APserver request: ⎕SVR
m4_signal(RETRACT_VAR,      x64,    key)
m4_signal(DISCONNECT, x64,    key)

/// APserver request: set state of shared var \b key
m4_signal(SET_STATE,        x64,    key,
                            u8,     new_state,
                            string, sloc)

/// APserver request: set control of shared var \b key
m4_signal(SET_CONTROL,      x64,    key,
                            u8,     new_control)

/// APserver request: X←SVAR
m4_signal(GET_VALUE,        x64,    key)

/// APserver result for: X←SVAR
m4_signal(VALUE_IS,         x64,    key,
                            u32,    error,
                            string, error_loc,
                            string, cdr_value)

/// APserver request: SVAR←X
m4_signal(ASSIGN_VALUE,     x64,    key,
                            string, cdr_value)
/// APserver result for: SVAR←X
m4_signal(SVAR_ASSIGNED,    x64,    key,
                            u32,    error,
                            string, error_loc)

/// APserver request: Can svar key be referenced ?
m4_signal(MAY_USE,          x64,    key,
                            i32,    attempt)

/// APserver request: Can svar key be assigned ?
m4_signal(MAY_SET,          x64,    key,
                            i32,    attempt)

/// APserver request: read SVAR database record from APserver
///
///		apl/APnnn	--> READ_SVAR_RECORD		APserver
///				<-- SVAR_RECORD_IS
///
m4_signal(READ_SVAR_RECORD,     x64,    key)
/// APserver result (record) for: read SVAR database record from APserver
m4_signal(SVAR_RECORD_IS,       string, record)

/// APserver request: is ID registered ?
m4_signal(IS_REGISTERED_ID,	u32,    proc,
				u32,    parent,
				u32,    grand)

/// APserver result: yes (1) or no (0)
m4_signal(YES_NO,	        u8,    yes)

/// APserver request: register processor proc in APserver
m4_signal(REGISTER_PROCESSOR,	u32,    proc,
				u32,    parent,
				u32,    grand,
				u8,     evconn,
				string, progname)

/// APserver request: match offered shared variable or make a new offer
m4_signal(MATCH_OR_MAKE,        string, varname,
                                u32,    to_proc,
                                u32,    to_parent,
                                u32,    to_grand,
                                u32,    from_proc,
                                u32,    from_parent,
                                u32,    from_grand)

/// APserver result for: match or make
m4_signal(MATCH_OR_MAKE_RESULT, x64,    key)


/// APserver request: find processor ID that offers \b key
m4_signal(FIND_OFFERING_ID,     x64,    key)

/// APserver result for: find processor ID that offers \b key
m4_signal(OFFERING_ID_IS,       u32,    proc,
                                u32,    parent,
                                u32,    grand)

/// APserver request: get offering processors  (⎕SVQ)
m4_signal(GET_OFFERING_PROCS,   u32,    offered_to_proc)

/// APserver result for: get offering processors  (⎕SVQ)
m4_signal(OFFERING_PROCS_ARE,   string, offering_procs)

/// APserver request: get offered variables  (⎕SVQ)
m4_signal(GET_OFFERED_VARS,     u32,    offered_to_proc,
                                u32,    accepted_by_proc)

/// APserver result for: get offered variables  (⎕SVQ)
m4_signal(OFFERED_VARS_ARE,     string, offered_vars)

/// APserver request: find pairing key (CTL vs. DAT or Cnnn vs. Dnnn) for AP210
m4_signal(FIND_PAIRING_KEY,	x64,    key)

/// APserver result for: find pairing key
m4_signal(PAIRING_KEY_IS,	x64,    pairing_key)

/// APserver result for: find pairing key (CTL vs. DAT or Cnnn vs. Dnnn) for AP210
/// get events for one processor (first shared var with an event)
m4_signal(GET_EVENTS,           u32,    proc,
                                u32,    parent,
                                u32,    grand)

/// APserver request: clear all events for one processor
m4_signal(CLEAR_ALL_EVENTS,     u32,    proc,
                                u32,    parent,
                                u32,    grand)


/// APserver result for: clear all events for one processor (first cleared svar
m4_signal(EVENTS_ARE,           x64,    key,
                                u32,    events)

/// APserver request: add an event for \b key
m4_signal(ADD_EVENT,	        x64,    key,
				u32,    proc,
                                u32,    parent,
                                u32,    grand,
				u32,    event)

/// APserver request: ws-ws SVAR←X
m4_signal(ASSIGN_WSWS_VAR,	x64,    key,
                                string, cdr_value)
/// APserver request: X←ws-ws SVAR
m4_signal(READ_WSWS_VAR,	x64,    key)
/// APserver result for: X←ws-ws SVAR
m4_signal(WSWS_VALUE_IS,	string, cdr_value)

/// APserver request: print the entire database (for command ]SVARS)
m4_signal(PRINT_SVAR_DB)
/// APserver result for: print the entire database
m4_signal(SVAR_DB_PRINTED,      string, printout)

