Mostly trivial stuff. We can't change the magic string though, so this will have to
stay "PARASLASH" for the rest of eternity.
return write_all(fd, buf, &len);
}
-/**
- * Paraslash's version of malloc().
+/*
+ * Wrapper for malloc().
*
* \param size The desired new size.
*
}
/**
- * Paraslash's version of calloc().
+ * Allocate memory and fill with zeros.
*
* \param size The desired new size.
*
# define __printf(p,q) __attribute__ ((format (printf, p, q)))
/*
* as direct use of __printf(p,q) confuses doxygen, here are two extra macros
- * for those values p,q that are actually used by paraslash.
+ * for those values p,q that are actually used by libosl.
*/
#define __printf_1_2 __printf(1,2)
#define __printf_2_3 __printf(2,3)
* \param map The memory mapping of the index file.
* \param desc The values found in the index header are returned here.
*
- * Read the index header, check for the paraslash magic string and the table version number.
- * Read all information stored in the index header into \a desc.
+ * Read the index header, check for the osl magic string and the table version
+ * number. Read all information stored in the index header into \a desc.
*
* \return Standard.
*
if (map->size < MIN_INDEX_HEADER_SIZE(1))
return -E_OSL_SHORT_TABLE;
- if (strncmp(buf + IDX_PARA_MAGIC, PARA_MAGIC, strlen(PARA_MAGIC)))
+ if (strncmp(buf + IDX_OSL_MAGIC, OSL_MAGIC, strlen(OSL_MAGIC)))
return -E_OSL_NO_MAGIC;
version = read_u8(buf + IDX_VERSION);
if (version < MIN_TABLE_VERSION || version > MAX_TABLE_VERSION)
buf = calloc(1, size);
if (!buf)
return -E_OSL_NOMEM;
- sprintf(buf + IDX_PARA_MAGIC, "%s", PARA_MAGIC);
+ sprintf(buf + IDX_OSL_MAGIC, "%s", OSL_MAGIC);
write_u8(buf + IDX_TABLE_FLAGS, t->desc->flags);
write_u8(buf + IDX_DIRTY_FLAG, 0);
write_u8(buf + IDX_VERSION, CURRENT_TABLE_VERSION);
*/
enum index_header_offsets {
/** Bytes 0-8: PARASLASH. */
- IDX_PARA_MAGIC = 0,
+ IDX_OSL_MAGIC = 0,
/** Byte 9: Dirty flag (nonzero if table is mapped). */
IDX_DIRTY_FLAG = 9,
/** Byte 10: osl table version number. */
};
/** Magic string contained in the header of the index file of each osl table. */
-#define PARA_MAGIC "PARASLASH"
+#define OSL_MAGIC "PARASLASH"
/**
* The minimal number of bytes for a column in the index header.