]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/crc.h
tableprinter: manpage is now installed into /usr/share/man/man1
[libucw.git] / ucw / crc.h
index 73363ddb77ca17ea91552a85b177a18ecdf04917..1aa73dcce7f38594a91519b24f02707b207b0488 100644 (file)
--- a/ucw/crc.h
+++ b/ucw/crc.h
 #ifndef _UCW_CRC_H
 #define _UCW_CRC_H
 
 #ifndef _UCW_CRC_H
 #define _UCW_CRC_H
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define crc32_hash_buffer ucw_crc32_hash_buffer
+#define crc32_init ucw_crc32_init
+#endif
+
 /**
  * Internal CRC calculator context.
  * You should use it just as an opaque handle only.
  */
 typedef struct crc32_context {
   u32 state;
 /**
  * Internal CRC calculator context.
  * You should use it just as an opaque handle only.
  */
 typedef struct crc32_context {
   u32 state;
-  void (*update_func)(struct crc32_context *ctx, const byte *buf, uns len);
+  void (*update_func)(struct crc32_context *ctx, const byte *buf, uint len);
 } crc32_context;
 
 /**
  * Initialize new calculation of CRC in a given context.
  * @crc_mode selects which algorithm should be used.
  **/
 } crc32_context;
 
 /**
  * Initialize new calculation of CRC in a given context.
  * @crc_mode selects which algorithm should be used.
  **/
-void crc32_init(crc32_context *ctx, uns crc_mode);
+void crc32_init(crc32_context *ctx, uint crc_mode);
 
 /**
  * Algorithm used for CRC calculation. The algorithms differ by the amount
 
 /**
  * Algorithm used for CRC calculation. The algorithms differ by the amount
@@ -47,7 +52,7 @@ enum crc_mode {
 };
 
 /** Feed @len bytes starting at @buf to the CRC calculator. **/
 };
 
 /** Feed @len bytes starting at @buf to the CRC calculator. **/
-static inline void crc32_update(crc32_context *ctx, const byte *buf, uns len)
+static inline void crc32_update(crc32_context *ctx, const byte *buf, uint len)
 {
   ctx->update_func(ctx, buf, len);
 }
 {
   ctx->update_func(ctx, buf, len);
 }
@@ -67,6 +72,6 @@ static inline u32 crc32_final(crc32_context *ctx)
  *  crc32_update(&ctx, buf, len);
  *  return crc32_final(&ctx);
  */
  *  crc32_update(&ctx, buf, len);
  *  return crc32_final(&ctx);
  */
-u32 crc32_hash_buffer(const byte *buf, uns len);
+u32 crc32_hash_buffer(const byte *buf, uint len);
 
 #endif
 
 #endif