Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / core / src / fxcodec / lgif / fx_gif.h
index 10aaf5f..031e4a4 100644 (file)
@@ -8,10 +8,10 @@
 \r
 #include "../../../include/fxcrt/fx_basic.h"\r
 \r
-extern FX_WORD _GetWord_LSBFirst(FX_LPBYTE p);\r
-extern void _SetWord_LSBFirst(FX_LPBYTE p, FX_WORD v);\r
-extern void _BpcConvert(FX_LPCBYTE src_buf, FX_DWORD src_len, int32_t src_bpc, int32_t dst_bpc,\r
-                        FX_LPBYTE& dst_buf, FX_DWORD& dst_len);\r
+extern FX_WORD _GetWord_LSBFirst(uint8_t* p);\r
+extern void _SetWord_LSBFirst(uint8_t* p, FX_WORD v);\r
+extern void _BpcConvert(const uint8_t* src_buf, FX_DWORD src_len, int32_t src_bpc, int32_t dst_bpc,\r
+                        uint8_t*& dst_buf, FX_DWORD& dst_len);\r
 #define GIF_SUPPORT_COMMENT_EXTENSION\r
 #define GIF_SUPPORT_GRAPHIC_CONTROL_EXTENSION\r
 #define GIF_SUPPORT_PLAIN_TEXT_EXTENSION\r
@@ -110,7 +110,7 @@ typedef struct tagGifImage {
     GifImageInfo*      image_info_ptr;\r
     uint8_t                    image_code_size;\r
     FX_DWORD           image_data_pos;\r
-    FX_LPBYTE          image_row_buf;\r
+    uint8_t*           image_row_buf;\r
     int32_t            image_row_num;\r
 } GifImage;\r
 typedef struct tagGifPlainText {\r
@@ -125,15 +125,15 @@ public:
         FX_WORD prefix;\r
         uint8_t suffix;\r
     };\r
-    CGifLZWDecoder(FX_LPSTR error_ptr = NULL)\r
+    CGifLZWDecoder(FX_CHAR* error_ptr = NULL)\r
     {\r
         err_msg_ptr = error_ptr;\r
     }\r
     void               InitTable(uint8_t code_len);\r
 \r
-    int32_t    Decode(FX_LPBYTE des_buf, FX_DWORD& des_size);\r
+    int32_t    Decode(uint8_t* des_buf, FX_DWORD& des_size);\r
 \r
-    void               Input(FX_LPBYTE src_buf, FX_DWORD src_size);\r
+    void               Input(uint8_t* src_buf, FX_DWORD src_size);\r
     FX_DWORD   GetAvailInput();\r
 \r
 private:\r
@@ -151,13 +151,13 @@ private:
     tag_Table  code_table[GIF_MAX_LZW_CODE];\r
     FX_WORD            code_old;\r
 \r
-    FX_LPBYTE  next_in;\r
+    uint8_t*   next_in;\r
     FX_DWORD   avail_in;\r
 \r
     uint8_t            bits_left;\r
     FX_DWORD   code_store;\r
 \r
-    FX_LPSTR   err_msg_ptr;\r
+    FX_CHAR*   err_msg_ptr;\r
 };\r
 class CGifLZWEncoder\r
 {\r
@@ -168,14 +168,14 @@ public:
     };\r
     CGifLZWEncoder();\r
     ~CGifLZWEncoder();\r
-    void               Start(uint8_t code_len, FX_LPCBYTE src_buf, FX_LPBYTE& dst_buf, FX_DWORD& offset);\r
-    FX_BOOL            Encode(FX_LPCBYTE src_buf, FX_DWORD src_len, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
-    void               Finish(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
+    void               Start(uint8_t code_len, const uint8_t* src_buf, uint8_t*& dst_buf, FX_DWORD& offset);\r
+    FX_BOOL            Encode(const uint8_t* src_buf, FX_DWORD src_len, uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
+    void               Finish(uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
 private:\r
     void               ClearTable();\r
-    FX_BOOL            LookUpInTable(FX_LPCBYTE buf, FX_DWORD& offset, uint8_t& bit_offset);\r
-    void               EncodeString(FX_DWORD index, FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
-    void               WriteBlock(FX_LPBYTE& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
+    FX_BOOL            LookUpInTable(const uint8_t* buf, FX_DWORD& offset, uint8_t& bit_offset);\r
+    void               EncodeString(FX_DWORD index, uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
+    void               WriteBlock(uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);\r
     jmp_buf            jmp;\r
     FX_DWORD   src_offset;\r
     uint8_t            src_bit_offset;\r
@@ -198,8 +198,8 @@ typedef gif_decompress_struct_p *gif_decompress_struct_pp;
 static int32_t s_gif_interlace_step[4] = {8, 8, 4, 2};\r
 struct tag_gif_decompress_struct {\r
     jmp_buf                    jmpbuf;\r
-    FX_LPSTR           err_ptr;\r
-    void                       (*_gif_error_fn)(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg);\r
+    FX_CHAR*           err_ptr;\r
+    void                       (*_gif_error_fn)(gif_decompress_struct_p gif_ptr, const FX_CHAR* err_msg);\r
     void*                      context_ptr;\r
     int                                width;\r
     int                                height;\r
@@ -215,13 +215,13 @@ struct tag_gif_decompress_struct {
     FX_DWORD           img_row_avail_size;\r
     uint8_t                    img_pass_num;\r
     CFX_ArrayTemplate<GifImage*>* img_ptr_arr_ptr;\r
-    FX_LPBYTE          (*_gif_ask_buf_for_pal_fn)(gif_decompress_struct_p gif_ptr, int32_t pal_size);\r
-    FX_LPBYTE          next_in;\r
+    uint8_t*           (*_gif_ask_buf_for_pal_fn)(gif_decompress_struct_p gif_ptr, int32_t pal_size);\r
+    uint8_t*           next_in;\r
     FX_DWORD           avail_in;\r
     int32_t            decode_status;\r
     FX_DWORD           skip_size;\r
     void                       (*_gif_record_current_position_fn)(gif_decompress_struct_p gif_ptr, FX_DWORD* cur_pos_ptr);\r
-    void                       (*_gif_get_row_fn)(gif_decompress_struct_p gif_ptr, int32_t row_num, FX_LPBYTE row_buf);\r
+    void                       (*_gif_get_row_fn)(gif_decompress_struct_p gif_ptr, int32_t row_num, uint8_t* row_buf);\r
     FX_BOOL                    (*_gif_get_record_position_fn)(gif_decompress_struct_p gif_ptr, FX_DWORD cur_pos,\r
             int32_t left, int32_t top, int32_t width, int32_t height,\r
             int32_t pal_num, void* pal_ptr,\r
@@ -231,7 +231,7 @@ struct tag_gif_decompress_struct {
     uint8_t                    app_identify[8];\r
     uint8_t                    app_authentication[3];\r
     FX_DWORD           app_data_size;\r
-    FX_LPBYTE          app_data;\r
+    uint8_t*           app_data;\r
 #endif\r
 #ifdef GIF_SUPPORT_COMMENT_EXTENSION\r
     CFX_ByteString*    cmt_data_ptr;\r
@@ -247,7 +247,7 @@ typedef struct tag_gif_compress_struct gif_compress_struct;
 typedef gif_compress_struct *gif_compress_struct_p;\r
 typedef gif_compress_struct_p *gif_compress_struct_pp;\r
 struct tag_gif_compress_struct {\r
-    FX_LPCBYTE         src_buf;\r
+    const uint8_t*             src_buf;\r
     FX_DWORD           src_pitch;\r
     FX_DWORD           src_width;\r
     FX_DWORD           src_row;\r
@@ -265,11 +265,11 @@ struct tag_gif_compress_struct {
     uint8_t                    app_identify[8];\r
     uint8_t                    app_authentication[3];\r
     FX_DWORD           app_data_size;\r
-    FX_LPBYTE          app_data;\r
+    uint8_t*           app_data;\r
 #endif\r
 \r
 #ifdef GIF_SUPPORT_COMMENT_EXTENSION\r
-    FX_LPBYTE          cmt_data_ptr;\r
+    uint8_t*           cmt_data_ptr;\r
     FX_DWORD           cmt_data_len;\r
 #endif\r
 \r
@@ -279,12 +279,12 @@ struct tag_gif_compress_struct {
 \r
 #ifdef GIF_SUPPORT_PLAIN_TEXT_EXTENSION\r
     GifPTE*                    pte_ptr;\r
-    FX_LPCBYTE         pte_data_ptr;\r
+    const uint8_t*             pte_data_ptr;\r
     FX_DWORD           pte_data_len;\r
 #endif\r
 };\r
-void _gif_error(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg);\r
-void _gif_warn(gif_decompress_struct_p gif_ptr, FX_LPCSTR err_msg);\r
+void _gif_error(gif_decompress_struct_p gif_ptr, const FX_CHAR* err_msg);\r
+void _gif_warn(gif_decompress_struct_p gif_ptr, const FX_CHAR* err_msg);\r
 gif_decompress_struct_p _gif_create_decompress();\r
 void _gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr);\r
 gif_compress_struct_p _gif_create_compress();\r
@@ -296,12 +296,12 @@ int32_t _gif_decode_extension(gif_decompress_struct_p gif_ptr);
 int32_t _gif_decode_image_info(gif_decompress_struct_p gif_ptr);\r
 void _gif_takeover_gce_ptr(gif_decompress_struct_p gif_ptr, GifGCE** gce_ptr_ptr);\r
 int32_t _gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num);\r
-FX_LPBYTE _gif_read_data(gif_decompress_struct_p gif_ptr, FX_LPBYTE* des_buf_pp, FX_DWORD data_size);\r
+uint8_t* _gif_read_data(gif_decompress_struct_p gif_ptr, uint8_t** des_buf_pp, FX_DWORD data_size);\r
 void _gif_save_decoding_status(gif_decompress_struct_p gif_ptr, int32_t status);\r
-void _gif_input_buffer(gif_decompress_struct_p gif_ptr, FX_LPBYTE src_buf, FX_DWORD src_size);\r
-FX_DWORD _gif_get_avail_input(gif_decompress_struct_p gif_ptr, FX_LPBYTE* avial_buf_ptr);\r
-void interlace_buf(FX_LPCBYTE buf, FX_DWORD width, FX_DWORD height);\r
-FX_BOOL _gif_encode( gif_compress_struct_p gif_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_len );\r
+void _gif_input_buffer(gif_decompress_struct_p gif_ptr, uint8_t* src_buf, FX_DWORD src_size);\r
+FX_DWORD _gif_get_avail_input(gif_decompress_struct_p gif_ptr, uint8_t** avial_buf_ptr);\r
+void interlace_buf(const uint8_t* buf, FX_DWORD width, FX_DWORD height);\r
+FX_BOOL _gif_encode( gif_compress_struct_p gif_ptr, uint8_t*& dst_buf, FX_DWORD& dst_len );\r
 #define GIF_PTR_NOT_NULL(ptr,gif_ptr)  if(ptr == NULL){                                                \\r
         _gif_error(gif_ptr,"Out Of Memory");\\r
         return 0;                                                      \\r