/*
* 2ooM: The Master of Orion II Reverse Engineering Project
* Library for working with LBX archive files.
- * Copyright (C) 2006-2008 Nick Bowler
+ * Copyright (C) 2006-2010 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return lbx->nfiles;
}
-int lbx_stat(struct lbx_state *lbx, size_t index, struct lbx_statbuf *buf)
+int
+lbx_file_stat(struct lbx_state *lbx, unsigned fileno, struct lbx_statbuf *buf)
{
static char str[256]; /* FIXME */
- if (index >= lbx->nfiles) {
+ if (fileno >= lbx->nfiles) {
buf->name = NULL;
lbx_errno = LBX_ERANGE;
return -1;
}
- snprintf(str, sizeof str, "%s.%03zu", lbx->name, index);
+ snprintf(str, sizeof str, "%s.%03u", lbx->name, fileno);
buf->name = str;
- buf->size = lbx->offsets[index+1] - lbx->offsets[index];
+ buf->size = lbx->offsets[fileno+1] - lbx->offsets[fileno];
return 0;
}