Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

src/lib/util.c: remove some unused functions

 ...and their prototypes from include/util.h.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit c2d2206b5ced535c4914698e2ade70efd748fed4 1 parent 9ef6496
Kirill Kolyshkin kolyshkin authored
Showing with 0 additions and 70 deletions.
  1. +0 −4 include/util.h
  2. +0 −66 src/lib/util.c
4 include/util.h
View
@@ -43,7 +43,6 @@ void free_arg(char **arg);
unsigned long min_ul(unsigned long val1, unsigned long val2);
int yesno2id(const char *str);
int get_netaddr(const char *ip_str, void *ip);
-const char *get_netname(unsigned int *ip, int family);
char *subst_VEID(envid_t veid, char *src);
int get_pagesize();
int get_mem(unsigned long long *mem);
@@ -52,9 +51,6 @@ int get_swap(unsigned long long *swap);
int get_num_cpu();
int get_lowmem(unsigned long long *mem);
unsigned long max_ul(unsigned long val1, unsigned long val2);
-void str_tolower(const char *from, char *to);
-char *get_file_name(char *str);
-const char *get_vps_state_str(int vps_state);
int get_dump_file(unsigned veid, const char *dumpdir, char *buf, int size);
int set_not_blk(int fd);
void close_fds(int close_std, ...);
66 src/lib/util.c
View
@@ -171,20 +171,6 @@ int parse_ul(const char *str, unsigned long *val)
return 0;
}
-void str_tolower(const char *from, char *to)
-{
- if (from == NULL || to == NULL)
- return;
- while ((*to++ = tolower(*from++)));
-}
-
-void str_toupper(const char *from, char *to)
-{
- if (from == NULL || to == NULL)
- return;
- while ((*to++ = toupper(*from++)));
-}
-
int check_var(const void *val, const char *message)
{
if (val != NULL)
@@ -297,13 +283,6 @@ int get_netaddr(const char *ip_str, void *ip)
return AF_INET;
}
-const char *get_netname(unsigned int *ip, int family)
-{
- static char buf[INET6_ADDRSTRLEN];
-
- return inet_ntop(family, ip, buf, sizeof(buf));
-}
-
char *subst_VEID(envid_t veid, char *src)
{
char *srcp;
@@ -458,51 +437,6 @@ int get_lowmem(unsigned long long *mem)
return 0;
}
-char *get_file_name(char *str)
-{
- char *p;
- int len;
-
- len = strlen(str) - sizeof(".conf") + 1;
- if (len <= 0)
- return NULL;
- if (strcmp(str + len, ".conf"))
- return NULL;
- if ((p = malloc(len + 1)) == NULL)
- return NULL;
- strncpy(p, str, len);
- p[len] = 0;
-
- return p;
-}
-
-const char *get_vps_state_str(int vps_state)
-{
- const char *p = NULL;
-
- switch (vps_state) {
- case STATE_RUNNING:
- p = "running";
- break;
- case STATE_STARTING:
- p = "starting";
- break;
- case STATE_STOPPED:
- p = "stopped";
- break;
- case STATE_STOPPING:
- p = "stopping";
- break;
- case STATE_RESTORING:
- p = "restoring";
- break;
- case STATE_CHECKPOINTING:
- p = "checkpointing";
- break;
- }
- return p;
-}
-
int get_dump_file(unsigned veid, const char *dumpdir, char *buf, int size)
{
return snprintf(buf, size, "%s/" DEF_DUMPFILE,
Please sign in to comment.
Something went wrong with that request. Please try again.