Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
cedb0d17
Commit
cedb0d17
authored
May 06, 2015
by
npzacs
Browse files
Cosmetics
parent
e79a54b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/file/dirs_win32.c
View file @
cedb0d17
...
...
@@ -28,8 +28,8 @@
#include <stdio.h>
#include <string.h>
#include <shlobj.h>
#include <windows.h>
#include <shlobj.h>
#include <limits.h>
#include <direct.h>
...
...
src/file/dirs_xdg.c
View file @
cedb0d17
...
...
@@ -26,7 +26,6 @@
#include "util/strutl.h"
#include "util/logging.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
src/file/file.h
View file @
cedb0d17
...
...
@@ -20,10 +20,10 @@
#ifndef FILE_H_
#define FILE_H_
#include "util/attributes.h"
#include "filesystem.h"
#include "util/attributes.h"
#include <stdint.h>
#ifdef _WIN32
...
...
@@ -38,9 +38,9 @@
* file access
*/
#define file_close(X) X->close(X)
#define file_close(X)
X->close(X)
#define file_seek(X,Y,Z) X->seek(X,Y,Z)
#define file_tell(X) X->tell(X)
#define file_tell(X)
X->tell(X)
#define file_read(X,Y,Z) X->read(X,Y,Z)
BD_PRIVATE
int64_t
file_size
(
AACS_FILE_H
*
fp
);
...
...
src/file/file_posix.c
View file @
cedb0d17
...
...
@@ -32,7 +32,7 @@
#include <sys/stat.h>
#include <sys/types.h>
static
void
file_close
_linux
(
AACS_FILE_H
*
file
)
static
void
_
file_close
(
AACS_FILE_H
*
file
)
{
if
(
file
)
{
fclose
((
FILE
*
)
file
->
internal
);
...
...
@@ -43,17 +43,17 @@ static void file_close_linux(AACS_FILE_H *file)
}
}
static
int64_t
file_seek
_linux
(
AACS_FILE_H
*
file
,
int64_t
offset
,
int32_t
origin
)
static
int64_t
_
file_seek
(
AACS_FILE_H
*
file
,
int64_t
offset
,
int32_t
origin
)
{
return
fseeko
((
FILE
*
)
file
->
internal
,
offset
,
origin
);
}
static
int64_t
file_tell
_linux
(
AACS_FILE_H
*
file
)
static
int64_t
_
file_tell
(
AACS_FILE_H
*
file
)
{
return
ftello
((
FILE
*
)
file
->
internal
);
}
static
int64_t
file_read
_linux
(
AACS_FILE_H
*
file
,
uint8_t
*
buf
,
int64_t
size
)
static
int64_t
_
file_read
(
AACS_FILE_H
*
file
,
uint8_t
*
buf
,
int64_t
size
)
{
if
(
size
<=
0
||
size
>=
BD_MAX_SSIZE
)
{
BD_DEBUG
(
DBG_FILE
|
DBG_CRIT
,
"Ignoring invalid read of size %"
PRId64
" (%p)
\n
"
,
size
,
(
void
*
)
file
);
...
...
@@ -63,16 +63,16 @@ static int64_t file_read_linux(AACS_FILE_H *file, uint8_t *buf, int64_t size)
return
fread
(
buf
,
1
,
size
,
(
FILE
*
)
file
->
internal
);
}
static
AACS_FILE_H
*
file_open
_linux
(
const
char
*
filename
,
const
char
*
mode
)
static
AACS_FILE_H
*
_
file_open
(
const
char
*
filename
,
const
char
*
mode
)
{
FILE
*
fp
=
NULL
;
AACS_FILE_H
*
file
=
calloc
(
1
,
sizeof
(
AACS_FILE_H
));
BD_DEBUG
(
DBG_FILE
,
"Opening LINUX file %s... (%p)
\n
"
,
filename
,
(
void
*
)
file
);
file
->
close
=
file_close
_linux
;
file
->
seek
=
file_seek
_linux
;
file
->
read
=
file_read
_linux
;
file
->
tell
=
file_tell
_linux
;
file
->
close
=
_
file_close
;
file
->
seek
=
_
file_seek
;
file
->
read
=
_
file_read
;
file
->
tell
=
_
file_tell
;
if
((
fp
=
fopen
(
filename
,
mode
)))
{
file
->
internal
=
fp
;
...
...
@@ -87,7 +87,7 @@ static AACS_FILE_H *file_open_linux(const char* filename, const char *mode)
return
NULL
;
}
AACS_FILE_H
*
(
*
file_open
)(
const
char
*
filename
,
const
char
*
mode
)
=
file_open
_linux
;
AACS_FILE_H
*
(
*
file_open
)(
const
char
*
filename
,
const
char
*
mode
)
=
_
file_open
;
int
file_mkdir
(
const
char
*
dir
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment