summaryrefslogtreecommitdiff
path: root/common.h
blob: 3b779a576ca2f330e02d34895bb42f4c896d4f9d (plain)
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
36
/*
 *
 *	Various things common for all utilities
 *
 */

#ifndef _COMMON_H
#define _COMMON_H

#define MY_EMAIL "mvw@planets.elm.net, jack@suse.cz"

/* Finish programs being */
void die(int, char *, ...);

/* malloc() with error check */
void *smalloc(size_t);

/* Safe strncpy - always finishes string */
void sstrncpy(char *, const char *, int);

/* Safe strncat - always finishes string */
void sstrncat(char *, const char *, int);

/* Safe version of strdup() */
char *sstrdup(const char *s);

/* Test whether two file names are for the same device */
int devcmp(const char *mtab_dev, char *user_dev);

/* Test whether two file names are for the same directory */
int dircmp(char *mtab_dir, char *user_dir);

/* Print version string */
void version(void);

#endif /* _COMMON_H */