File indexing completed on 2024-10-13 12:14:23

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Waldo Bastian <bastian@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef _KLAUNCHER_CMDS_H_
0009 #define _KLAUNCHER_CMDS_H_
0010 
0011 #define KDED_EXENAME "kded5"
0012 
0013 typedef struct {
0014     long cmd;
0015     long arg_length;
0016 } klauncher_header;
0017 
0018 /* Launcher commands: */
0019 
0020 #define LAUNCHER_EXEC   1
0021 /*
0022  * LAUNCHER_EXEC
0023  *
0024  * Start a new process. Try using LAUNCHER_EXEC_NEW instead.
0025  * There will be no app startup notification.
0026  *
0027  * long argc: number of arguments
0028  * char *args: arguments, argument 0 is the program to start.
0029  */
0030 
0031 #define LAUNCHER_SETENV 2
0032 /*
0033  * LAUNCHER_SETENV
0034  *
0035  * Change environment of future processes launched via kdeinit.
0036  * DON'T use this if you want to change environment only for one
0037  * application you're going to start.
0038  *
0039  * char *env_name;
0040  * char *env_value;
0041  */
0042 
0043 #define LAUNCHER_CHILD_DIED 3
0044 /*
0045  * LAUNCHER_CHILD_DIED
0046  *
0047  * Notification A child of kdeinit died.
0048  *
0049  * long pid;
0050  * long exit_code;
0051  */
0052 
0053 #define LAUNCHER_OK 4
0054 /*
0055  * LAUNCHER_OK
0056  *
0057  * Notification Last process launched ok.
0058  *
0059  * long pid;
0060  */
0061 
0062 #define LAUNCHER_ERROR 5
0063 /*
0064  * LAUNCHER_ERROR
0065  *
0066  * Notification Last process could not be launched.
0067  *
0068  * char *error msg (utf8)
0069  */
0070 
0071 #define LAUNCHER_SHELL  6
0072 /*
0073  * LAUNCHER_SHELL
0074  *
0075  * Start a new process and use given environment.
0076  * Starts app-startup notification.
0077  *
0078  * long argc: number of arguments
0079  * char *args: arguments, argument 0 is the program to start.
0080  * char *cwd: Working directory.
0081  * long envc: number of environment vars
0082  * char *envs: environment strings.
0083  * int avoid_loops : avoid using the first path in $PATH where
0084  *    this process binary is found in order to avoid
0085  *    infinite loop by binary->kdeinit_wrapper link in $PATH
0086  * char* startup_id: app startup notification id, "0" for none,
0087  *   "" ( empty string ) is the default
0088  */
0089 
0090 #define LAUNCHER_TERMINATE_KDE 7
0091 
0092 /*
0093  * LAUNCHER_TERMINATE_KDEINIT
0094  *
0095  * Suicide is painless
0096  */
0097 #define LAUNCHER_TERMINATE_KDEINIT  8
0098 
0099 #define LAUNCHER_DEBUG_WAIT     9
0100 /*
0101  * LAUNCHER_DEBUG_WAIT
0102  *
0103  * Next process started will do a sleep(1000000)
0104  * before calling main()/kdemain()
0105  *
0106  * (Used for debugging io-slaves)
0107  */
0108 
0109 #define LAUNCHER_EXT_EXEC   10
0110 /*
0111  * LAUNCHER_EXT_EXEC
0112  *
0113  * Start a new process. The given environment variables will
0114  * be added to its environment before starting it.
0115  * Starts app-startup notification.
0116  *
0117  * long argc: number of arguments
0118  * char *args: arguments, argument 0 is the program to start.
0119  * long envc: number of environment vars
0120  * char *envs: environment strings.
0121  * int avoid_loops : avoid using the first path in $PATH where
0122  *    this process binary is found in order to avoid
0123  *    infinite loop by binary->kdeinit_wrapper link in $PATH
0124  * char* startup_id: app startup notification id, "0" for none,
0125  *   "" ( empty string ) is the default
0126  *
0127  */
0128 
0129 #define LAUNCHER_KWRAPPER   11
0130 /*
0131  * LAUNCHER_KWRAPPER
0132  *
0133  * Start a new process, use given environment, pass signals and output.
0134  * Starts app-startup notification.
0135  *
0136  * long argc: number of arguments
0137  * char *args: arguments, argument 0 is the program to start.
0138  * char *cwd: Working directory.
0139  * long envc: number of environment vars
0140  * char *envs: environment strings.
0141  * char *tty: tty to redirect stdout/stderr to.
0142  * int avoid_loops : avoid using the first path in $PATH where
0143  *    this process binary is found in order to avoid
0144  *    infinite loop by binary->kdeinit_wrapper link in $PATH
0145  * char* startup_id: app startup notification id, "0" for none,
0146  *   "" ( empty string ) is the default
0147  */
0148 
0149 #define LAUNCHER_EXEC_NEW   12
0150 /*
0151  * LAUNCHER_EXEC_NEW
0152  *
0153  * Start a new process. An improved version of LAUNCHER_EXEC.
0154  * The given environment variables will be added
0155  *  to its environment before starting it.
0156  * There will be no app startup notification.
0157  *
0158  * long argc: number of arguments
0159  * char *args: arguments, argument 0 is the program to start.
0160  * long envc: number of environment vars
0161  * char *envs: environment strings.
0162  * int avoid_loops : avoid using the first path in $PATH where
0163  *    this process binary is found in order to avoid
0164  *    infinite loop by binary->kdeinit_wrapper link in $PATH
0165  * char *cwd: Working directory (optional).
0166  */
0167 
0168 const char *commandToString(int command);
0169 
0170 #endif