#ifndef CMD_H
# define CMD_H 1

# include <Eina.h>
# include <Ecore.h>
# include "efm.h"

// commands:
// file-add // a dile in a dir being monitored has been added
// file-del // a file in a dir being monitored has been deleted
// file-mod // a file in a dir being monitored has been modified
// dir-del  // the dir being monitored/listed has been deleted
// 
// future:
// dir-usage // how much data, number of files, dirs etc.

typedef struct _Cmd
{
   size_t         buf_size;
   char          *buf;
   const char    *command;
   Efm_Sort_Mode  sort_mode;
   const char    *dict[];
} Cmd;

Cmd  *cmd_parse(const char *cmd);
void  cmd_free(Cmd *c);
Cmd  *cmd_dup(const Cmd *c);
void  cmd_dump_sterr(Cmd *c);

Eina_Strbuf *cmd_strbuf_new(const char *command);
void         cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key, const char *val);
void         cmd_strbuf_print_consume(Eina_Strbuf *strbuf);
void         cmd_strbuf_exe_consume(Eina_Strbuf *strbuf, Ecore_Exe *exe);
const char  *cmd_key_find(const Cmd *c, const char *key);

#endif
