+/* Default I/O operations for ordinary files. */
+static size_t file_read(void *buf, size_t size, void *handle)
+{
+ return fread(buf, 1, size, (FILE *)handle);
+}
+
+static int file_seek(void *handle, long offset, int whence)
+{
+ return fseek((FILE *)handle, offset, whence);
+}
+
+static long file_tell(void *handle)
+{
+ return ftell((FILE *)handle);
+}
+
+static int file_eof(void *handle)
+{
+ return feof((FILE *)handle);
+}
+
+static int file_close(void *handle)
+{
+ return fclose((FILE *)handle);
+}
+
+const struct upkg_file_ops upkg_default_fops = {
+ .read = file_read,
+ .seek = file_seek,
+ .tell = file_tell,
+ .eof = file_eof,
+};
+