#ifndef LAUNCHER_H
#define LAUNCHER_H

#include <sys/types.h>  /* pid_t */
#include "desktop_parser.h"

/* Launch an application from a DesktopEntry.
   Forks a child, exec's the command via /bin/sh.
   If entry->terminal is set, wraps in x-terminal-emulator.
   Returns the child pid on success, -1 on error. */
pid_t launcher_launch(const DesktopEntry *entry);

/* Reap any finished child processes (call from SIGCHLD handler or main loop).
   Returns number of reaped children. */
int launcher_reap_children(void);

/* Install SIGCHLD handler that calls launcher_reap_children() */
void launcher_install_sigchld(void);

#endif /* LAUNCHER_H */