-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix status bar being on side in portriat
- Loading branch information
SeanOMik
committed
Sep 7, 2019
1 parent
5dec89c
commit d4b1c38
Showing
10 changed files
with
235 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EBOOK_READER_CONFIG_H | ||
#define EBOOK_READER_CONFIG_H | ||
|
||
extern bool configDarkMode; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef NX_SHELL_FS_H | ||
#define NX_SHELL_FS_H | ||
|
||
#include <switch.h> | ||
|
||
int FS_MakeDir(const char *path); | ||
int FS_RecursiveMakeDir(const char * dir); | ||
bool FS_FileExists(const char *path); | ||
bool FS_DirExists(const char *path); | ||
const char *FS_GetFileExt(const char *filename); | ||
char *FS_GetFileModifiedTime(const char *filename); | ||
u64 FS_GetFileSize(const char *filename); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef EBOOK_READER_STATUS_BAR_H | ||
#define EBOOK_READER_STATUS_BAR_H | ||
|
||
void StatusBar_DisplayTime(void); | ||
void StatusBar_DisplayTime(bool portriat); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <sys/stat.h> | ||
#include <switch.h> | ||
|
||
#include "fs.h" | ||
|
||
int FS_MakeDir(const char *path) | ||
{ | ||
if (!path) | ||
return -1; | ||
|
||
return mkdir(path, 0777); | ||
} | ||
|
||
int FS_RecursiveMakeDir(const char * dir) | ||
{ | ||
int ret = 0; | ||
char buf[256]; | ||
char *p = NULL; | ||
size_t len; | ||
|
||
snprintf(buf, sizeof(buf), "%s",dir); | ||
len = strlen(buf); | ||
|
||
if (buf[len - 1] == '/') | ||
buf[len - 1] = 0; | ||
|
||
for (p = buf + 1; *p; p++) | ||
{ | ||
if (*p == '/') | ||
{ | ||
*p = 0; | ||
|
||
ret = FS_MakeDir(buf); | ||
|
||
*p = '/'; | ||
} | ||
|
||
ret = FS_MakeDir(buf); | ||
} | ||
|
||
return ret; | ||
} | ||
|
||
bool FS_FileExists(const char *path) | ||
{ | ||
FILE *temp = fopen(path, "r"); | ||
|
||
if (temp == NULL) | ||
return false; | ||
|
||
fclose(temp); | ||
return true; | ||
} | ||
|
||
bool FS_DirExists(const char *path) | ||
{ | ||
struct stat info; | ||
|
||
if (stat(path, &info) != 0) | ||
return false; | ||
else if (info.st_mode & S_IFDIR) | ||
return true; | ||
else | ||
return false; | ||
} | ||
|
||
const char *FS_GetFileExt(const char *filename) | ||
{ | ||
const char *dot = strrchr(filename, '.'); | ||
|
||
if (!dot || dot == filename) | ||
return ""; | ||
|
||
return dot + 1; | ||
} | ||
|
||
char *FS_GetFileModifiedTime(const char *filename) | ||
{ | ||
struct stat attr; | ||
stat(filename, &attr); | ||
|
||
return ctime(&attr.st_mtime); | ||
} | ||
|
||
u64 FS_GetFileSize(const char *filename) | ||
{ | ||
struct stat st; | ||
stat(filename, &st); | ||
|
||
return st.st_size; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters