-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.h
35 lines (21 loc) · 690 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef UTILS_H
#define UTILS_H
#include "ring.h"
#include "node.h"
extern int verb, disp_info;
void disp_header();
void command_list(int i, char *ip, char *port);
void log_info(char *str, char *mode);
void verbose(char *str);
void clean_args(char **args, int size);
// calculates the distance from node/key i to node/key j
int dist(int i, int j);
//
int check_dist(Node_struct *node, int key);
// prompts user for a command (and its args) and returns the number of args read
int get_command(char **args);
// checks if a command is valid
int check_command(char **args, int num_read, Node_struct *node);
void INThandler(int sig);
void check_call(int argc, char **argv);
#endif