-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.h
More file actions
75 lines (66 loc) · 1.34 KB
/
util.h
File metadata and controls
75 lines (66 loc) · 1.34 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "define.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <openssl/md5.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/file.h>
#include <sys/ipc.h>
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
/**
* trim()
* Trim a string
*
* Source: http://stackoverflow.com/questions/656542/trim-a-string-in-c
* Input: (Char*) str: The String
* Return: String
*/
char * trim(char *str);
/**
* showHelp()
* Show the program help
* Input: (Char*) app: The app name
* Input: (Char*) method: The method used
*/
void showHelp(char * app, char * method);
/**
* exitProgram()
* Stop program due to error
*
* Input: (int) err: The error code
* Input: (Char*) str: The Message to display
*/
void exitProgram(int err, char * msg);
/**
* isFile()
* Check if the file is a file
*
* Input: (Char*) file: The full path of the file
* Return: Int
*/
unsigned int isFile(char * file);
/**
* isDir()
* Check if the file is a directory
*
* Input: (Char*) dir: The full path of the dir
* Return: Int
*/
unsigned int isDir(char * dir);
/**
* getMD5()
* Get the MD5 of a string
*
* Input: (Char*) string: The string
* Input: (Char*) md5: The md5 string
*/
char * getMD5(char * string);