[commands] A bit of cleanup

This commit is contained in:
ejurgensen 2016-10-02 22:05:53 +02:00
parent 8f6033e787
commit a03bc2a4e2
2 changed files with 5 additions and 24 deletions

View File

@ -26,8 +26,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <event2/event.h>
#include "logger.h" #include "logger.h"

View File

@ -1,26 +1,8 @@
/*
* Copyright (C) 2016 Christian Meffert <christian.meffert@googlemail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SRC_COMMANDS_H_ #ifndef SRC_COMMANDS_H_
#define SRC_COMMANDS_H_ #define SRC_COMMANDS_H_
#include <event2/event.h> #include <event2/event.h>
#include <time.h>
enum command_state { enum command_state {
COMMAND_END = 0, COMMAND_END = 0,
@ -30,12 +12,13 @@ enum command_state {
/* /*
* Function that will be executed in the event loop thread. * Function that will be executed in the event loop thread.
* *
* If the function has pending events to complete, it needs to return COMMAND_PENDING with 'ret' set to * If the function has pending events to complete, it needs to return
* the number of pending events to wait for. * COMMAND_PENDING with 'ret' set to the number of pending events to wait for.
* *
* @param arg Opaque pointer passed by command_exec_sync or command_exec_async * @param arg Opaque pointer passed by command_exec_sync or command_exec_async
* @param ret Pointer to the return value for the caller of the command * @param ret Pointer to the return value for the caller of the command
* @return COMMAND_END if there are no pending events (function execution is complete) or COMMAND_PENDING if there are pending events * @return COMMAND_END if there are no pending events (function execution is
* complete) or COMMAND_PENDING if there are pending events
*/ */
typedef enum command_state (*command_function)(void *arg, int *ret); typedef enum command_state (*command_function)(void *arg, int *ret);