aboutsummaryrefslogblamecommitdiffstats
path: root/src/actionhelper.h
blob: 0c96a8a11bd077fe8d63d0325f4202dc4a9e4d5a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                                                                               









                                                                                
                                               

                                                                                


                      
                    
                   
                   
                    
 



          
                                          
 






                                                   



                                                        



          
                                                             
 


          
                                        
 


             
                                                 
 


                          
                                                 

                                          

          
 

                              
 
                           
/* actionhelper.h - helper routines for ck actions --------------------*- C -*-
 *
 * This file is part of ck, the config keeper
 *
 * -----------------------------------------------------------------------------
 *
 * Copyright (C) 2018  Anastasis Grammenos
 * GPLv3 (see LICENCE for the full notice)
 *
 * -----------------------------------------------------------------------------
 *
 * Here reside helper routines for the actions.
 *
 * -------------------------------------------------------------------------- */
#ifndef ACTIONHELPER_H
#define ACTIONHELPER_H

#include "actions.h"
#include "ckutil.h"
#include "cklist.h"
#include "dblayer.h"

/********/
/* INIT */
/********/

int init_create_config_file(UserOpt *opt);

/*******/
/* ADD */
/*******/

/* if add_err is set, return true
 * along with a copy of the error message.
 * Pass NULL if you don't care about the message */
int add_err_message(char *err);
AddOpt add_make_options(cklist *args);
void add_print_opts(AddOpt *opt);
void add_make_link(const AddOpt *opt, const Conf *conf);

/********/
/* EDIT */
/********/
void edit_print_suggested_configs(DB *db, const char *pName);

/********/
/* LIST */
/********/
ListOpt list_make_options(cklist *args);

/***********/
/* RESTORE */
/***********/
int restore_make_links(cklist *from, cklist *to);

/************************/
/* PRINT RESULTS & HELP */
/************************/
#define X(ACTION)                               \
  void print_##ACTION##_result(int err); \
  void print_##ACTION##_help(void);
CK_ACTIONS
#undef X

void print_conf_help(void);
void print_verbose_help(void);

#endif /* ACTIONHELPER_H */