-/* error codes */
-#define E_OK 0 /* everything was OK */
-#define E_ARCHIVO -1 /* error opening file */
-#define E_FORMATO -2 /* error in gif header */
-#define E_MEMORIA -3 /* error allocating memory */
+#if wxUSE_PALETTE
+static bool wxGIFHandler_GetPalette(const wxImage& image,
+ wxRGB *pal, int *palCount, int *mask_index);
+#endif
+static
+int wxGIFHandler_PaletteFind(const wxRGB& clr, const wxRGB *array, int count);
+
+static bool wxGIFHandler_Write(wxOutputStream *, const void *buf, size_t len);
+static bool wxGIFHandler_WriteByte(wxOutputStream *, wxUint8);
+static bool wxGIFHandler_WriteWord(wxOutputStream *, wxUint16);
+static bool wxGIFHandler_WriteHeader(wxOutputStream *, int width, int height,
+ bool loop, const wxRGB *pal, int palCount);
+static bool wxGIFHandler_WriteRect(wxOutputStream *, int width, int height);
+#if wxUSE_PALETTE
+static bool wxGIFHandler_WriteTerm(wxOutputStream *);
+#endif
+static bool wxGIFHandler_WriteZero(wxOutputStream *);
+static bool wxGIFHandler_WritePalette(wxOutputStream *,
+ const wxRGB *pal, size_t palCount, int bpp);
+static bool wxGIFHandler_WriteControl(wxOutputStream *,
+ int maskIndex, int delayMilliSecs);
+static bool wxGIFHandler_WriteComment(wxOutputStream *, const wxString&);
+static bool wxGIFHandler_WriteLoop(wxOutputStream *);