Match-id-c4316230dc6d4215a0a107038252461f5d998e11

This commit is contained in:
BianTanggui
2020-07-04 18:06:46 +08:00
parent 128c20a53e
commit 70b5d7ff3e
11 changed files with 825 additions and 725 deletions

23
cli/src/utils.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _UTILS_H
#define _UTILS_H
#include <stdbool.h>
#include <limits.h>
#include <sys/types.h>
#include "basic.h"
typedef char *(*ParseFileLine)(char *, const char *);
int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath);
bool CheckFsType(char **pLine);
bool CheckSubStr(char **pLine, const char *subsys);
bool CheckRootDir(char **pLine);
int MakeDir(const char *dir, int mode);
int CheckDirExists(const char *dir);
int GetParentPathStr(const char *path, char *parent, size_t bufSize);
int CreateFile(const char *path, mode_t mode);
int VerfifyPathInfo(const struct PathInfo* pathInfo);
int Mount(const char *src, const char *dst);
int IsStrEqual(const char *s1, const char *s2);
int StrHasPrefix(const char *str, const char *prefix);
#endif