summaryrefslogtreecommitdiff
path: root/src/seek.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 14:41:53 +0200
commit5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (patch)
tree684758441f5b431d0008253243034b6a4a29417c /src/seek.c
parent249866e3d1e11dc72eaa1305f4bb479ded92ef38 (diff)
initial clang-format
Diffstat (limited to 'src/seek.c')
-rw-r--r--src/seek.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/seek.c b/src/seek.c
index ac761a9..b402625 100644
--- a/src/seek.c
+++ b/src/seek.c
@@ -1,6 +1,7 @@
-#include <sys/types.h>
#include "seek.h"
+#include <sys/types.h>
+
/**
@file seek.c
@author djb
@@ -8,23 +9,33 @@
@brief seek in an open file descritor
*/
-off_t lseek(int fd,off_t offset,int whence);
+off_t lseek(int fd, off_t offset, int whence);
int ftruncate(int fd, off_t length);
#define CUR 1 /* sigh */
seek_pos seek_cur(int fd)
-{ return lseek(fd,(off_t) 0,CUR); }
+{
+ return lseek(fd, (off_t)0, CUR);
+}
#define END 2 /* sigh */
int seek_end(int fd)
-{ if (lseek(fd,(off_t) 0,END) == -1) return -1; return 0; }
+{
+ if (lseek(fd, (off_t)0, END) == -1) return -1;
+ return 0;
+}
#define SET 0 /* sigh */
-int seek_set(int fd,seek_pos pos)
-{ if (lseek(fd,(off_t) pos,SET) == -1) return -1; return 0; }
+int seek_set(int fd, seek_pos pos)
+{
+ if (lseek(fd, (off_t)pos, SET) == -1) return -1;
+ return 0;
+}
-int seek_trunc(int fd,seek_pos pos)
-{ return ftruncate(fd,(off_t) pos); }
+int seek_trunc(int fd, seek_pos pos)
+{
+ return ftruncate(fd, (off_t)pos);
+}