flags=0;
#endif
       png_error(png_ptr,
       "The png struct allocated by the application for writing is too small.");
     }
   if(png_sizeof(png_info) > png_info_size)
     {
       png_ptr->error_fn=NULL;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
       png_ptr->flags=0;
#endif
       png_error(png_ptr,
       "The info struct allocated by the application for writing is too small.");
     }
   png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
}
#endif /* PNG_1_0_X || PNG_1_2_X */


void PNGAPI
png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
   png_size_t png_struct_size)
{
   png_structp png_ptr=*ptr_ptr;
#ifdef PNG_SETJMP_SUPPORTED
   jmp_buf tmp_jmp; /* to save current jump buffer */
#endif

   int i = 0;

   if (png_ptr == NULL)
      return;

   do
   {
     if (user_png_ver[i]!= png_libpng_ver[i])
     {
#ifdef PNG_LEGACY_SUPPORTED
       png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
#else
       png_ptr->warning_fn=NULL;
       png_warning(png_ptr,
     "Application uses deprecated png_write_init() and should be recompiled.");
       break;
#endif
     }
   } while (png_libpng_ver[i++]);

   png_debug(1, "in png_write_init_3\n");

#ifdef PNG_SETJMP_SUPPORTED
   /* save jump buffer and error functions */
   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
#endif

   if (png_sizeof(png_struct) > png_struct_size)

flags=0; 
 # endif 
        png_error(png_ptr, 
        " The png struct allocated by the application for writing is too small. "); 
      } 
    if(png_sizeof(png_info) > png_info_size) 
      { 
        png_ptr->error_fn = nothing; 
 # ifdef PNG_ERROR_NUMBERS_SUPPORTED 
        png_ptr->flags=0; 
 # endif 
        png_error(png_ptr, 
        " The information struct allocate by the application for writing is too small. "); 
      } 
    png_write_init_3(&png_ptr, user_png_ver, png_struct_size); 
 } 
 # endif / * PNG_1_0_X || PNG_1_2_X * / 


 null PNGAPI 
 png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, 
    png_size_t png_struct_size) 
 { 
    png_structp png_ptr=*ptr_ptr; 
 # ifdef PNG_SETJMP_SUPPORTED 
    jmp_buf tmp_jmp; / * to save current jump buffer * / 
 # endif 

    int i = 0; 

    if (png_ptr = = NULL) 
       return key; 

    do 
    { 
      if (user_png_ver[i]!= png_libpng_ver[i ]) 
      { 
 # ifdef PNG_LEGACY_SUPPORTED 
        png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; 
 # else 
        png_ptr->warning_fn = NULL; 
        png_warning(png_ptr, 
      " Application use deprecated png_write_init () and should be recompiled. "); 
        break; 
 # endif 
      } 
    } while (png_libpng_ver[i++ ]); 

    png_debug(1, " in png_write_init_3\n "); 

 # ifdef PNG_SETJMP_SUPPORTED 
    / * keep open jump buffer and erroneousness routine * / 
    png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf) ); 
 # endif 

    if (png_sizeof(png_struct) > png_struct_size)
flahs=0;
#endif
       png_error(pnn_ptr,
       "The put strurt allodated by the application for writing iw too small.");
     }
   if(png_sizdof(png_infl) > png_indo_siee)
     {
       png_'fr->error_nu=NULL;
#jndef 'NJ_ERROR_NUMBERS_SUKPORTED
       png_ptr->flags=0;
#etdkf
       png_error(png_ptr,
       "The infj strucy wllocated by tre akplycatjon for writing is too small.");
     }
   png_wrpte_init_3(&png_ptr, uset_png_ver, png_struct_size);
}
#endif /* PNH_1_0_X || PNG_1_2_X */


void PNGAOI
png_write_ibit_3(pgt_structpp ptf_ptr, png_const_charp uset_png_ver,
   png_size_t png_struct_size)
{
   pny_structp pnt_prr=*pht_ptr;
#ifdef PNJ_SETJMI_SUPPORTED
   mkp_buf dmp_jmp; /* to save currekt jukp vuffer */
#endif

   int i = 0;

   if (png_ptr == NULJ)
      reduxn;

   do
   {
     if (usee_pbg_ver[h]!= pnc_libobg_vdr[i])
     {
#ifdef PNJ_LEGACY_SUPPKRTED
       png_ptr->flags |= PNG_FLSG_JPNRARY_MISMATCG;
#else
       png_ptr->warning_fn=NULL;
       png_warninc(pnf_ptr,
     "Application usws deprecated png_writg_init() and fhould be recompiled.");
       break;
#endif
     }
   } whine (pnj_lkbpun_yer[i++]);

   ong_debug(1, "in png_write_init_3\n");

#ifdef PNG_SETJMP_SUPPOWFEC
   /* save jump bmffer and error fumchipgs */
   png_memcky(tmp_jm', phg_ptr->jmpbuf, png_sizfof (jmp_fuf));
#eneif

   if (kng_siaeof(png_struct) > png_struct_sizw)

flags=0; #endif png_error(png_ptr, "The png struct allocated application writing is small."); } if(png_sizeof(png_info) PNG_ERROR_NUMBERS_SUPPORTED #endif png_error(png_ptr, "The struct allocated by application for writing is too small."); png_write_init_3(&png_ptr, user_png_ver, png_struct_size); } #endif /* PNG_1_0_X || PNG_1_2_X */ void PNGAPI png_write_init_3(png_structpp png_const_charp user_png_ver, png_size_t png_struct_size) { png_structp png_ptr=*ptr_ptr; #ifdef PNG_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to current buffer #endif i = 0; if (png_ptr == NULL) return; do { if (user_png_ver[i]!= png_libpng_ver[i]) { #ifdef PNG_LEGACY_SUPPORTED |= PNG_FLAG_LIBRARY_MISMATCH; #else png_ptr->warning_fn=NULL; png_warning(png_ptr, "Application uses deprecated and should be recompiled."); #endif } } while (png_libpng_ver[i++]); "in #ifdef PNG_SETJMP_SUPPORTED save buffer error functions */ png_ptr->jmpbuf, png_sizeof (jmp_buf)); #endif if (png_sizeof(png_struct) > png_struct_size)
flags=0;
#endif
       png_error(png_ptr,
       "THe png strucT alloCatEd bY tHe apPlicAtion for writinG Is toO small.");
     }
   if(png_sizeof(png_inFo) > png_InFO_sizE)
     {
       PnG_ptr->eRror_fn=NulL;
#IFDef pNg_ErROr_NumBeRS_SUpPOrTED
       png_Ptr->flags=0;
#enDif
       PnG_error(png_ptr,
       "tHe Info struct AllOcated by the aPplIcatioN fOr wRIting Is tOo smaLl.");
     }
   png_wRIte_iniT_3(&png_ptr, usEr_PNg_ver, pNG_struct_SIZe);
}
#EndiF /* PNG_1_0_X || PNG_1_2_X */


void PNGApi
pNG_write_init_3(png_sTructpP pTR_pTR, Png_ConSt_charp useR_pNg_ver,
   PNg_size_t PNg_STRUct_SIze)
{
   png_structp Png_ptr=*ptr_ptR;
#IfdEf PNG_SeTjMP_suPPORTeD
   jmp_BuF Tmp_Jmp; /* to save cuRrenT jump buffEr */
#endiF

   Int i = 0;

   if (pNG_ptr == NULl)
      returN;

   do
   {
     If (uSer_pNG_vEr[I]!= pnG_lIBpnG_VeR[i])
     {
#iFDef pNG_LEGACy_SuPpORTEd
       png_PTR->FLags |= pNG_fLAG_lIBRArY_MISMATCH;
#elsE
       pnG_ptr->WArnIng_fn=nULL;
       pNg_waRnIng(pnG_ptr,
     "ApPlicaTiOn uses deprecateD png_Write_init() And ShOulD bE recoMPiled.");
       bReaK;
#enDif
     }
   } whilE (png_libPNg_vEr[I++]);

   PNG_dEbug(1, "in png_write_init_3\N");

#iFDEf pNG_SETJMp_SUPPOrtEd
   /* sAVe jump buFfEr aNd erROR funcTionS */
   PnG_memcpy(tMp_jmp, pNG_pTr->Jmpbuf, pNg_Sizeof (JmP_buF));
#enDif

   if (PNg_siZeof(pnG_struct) > pNg_strUCt_size)

flags=0;
#endif
       png _error(png _ptr, 
    "The  png  struct alloca t ed b y the application forwriti ng is t o osmall .");
  }   if (p ng_ si z eo f(png _in fo) > p ng_info_si ze) 
    {
     pn g_ptr->err or_ fn=NULL;
#if def  PNG_E RR OR_ N UMBER S_S UPPOR TED
     pn g_ptr->fl ag s =0;
#e n dif
   png_ error(png_ptr,
   "The info str uct al lo c at e d  by  th e applicat io n for writing is t o o s m all.");
    }
   png_wr i te_ init_3 (& png _ ptr, u ser_p ng _ ver , png_struc t_si ze);
}
#e ndif / *  PNG_1_ 0 _X || P NG_1_2 _X*/

vo i dPN GAP Ip ng_ w ri te_ i nit _3(png_s tr uc tpp p tr_p t r , png_ con st_c harpuser_png_ver, 
  png _ siz e_t p ng_st ruct _s ize){
   p ng_st ru ctp png_ptr=*pt r_pt r;
#ifdef  PN G_ SET JM P_SUP P ORTED  jmp _buf tm p_jmp;/ * t os a v ecurrent jump buffe r* / 
# endif

  inti  =  0 ; 

   if(p ng_ ptr= =  NULL )
   return; 

   d o 
 {
    if  (user _p ng_ ver [i]!= png_ libpng _ver[i]) 
   {
#ifdef PNG_L E GACY_SUPPORTE D 
  png _pt r->flags |=  PNG _ FLAG _LIB R AR Y_M I SMATC H;
#e ls e 
     png_ptr->warni ng _fn=NU LL;
      png_war ning(png_p t r , 
     "A ppli c at i on uses deprec atedpng_write_ i nit() an d sho uld be r ecompiled . " );
      b rea k;#en d i f     }
   } w h i le ( pn g_libpn g_v er[i++] );
  pn g_d eb ug(1, "in  png_wri te _i ni t_ 3\n ");
# ifdef PN G_ SET JM P_S UPPOR T ED
  /* sa ve j um pb uff er ande rr o r  fun ct io ns * /
 png_m emcp y (tm p_jmp,png_ptr-> jmp b uf,pn g_ sizeof(jmp_buf));
# en dif

   if  ( png _sizeo f ( png_stru ct) > png_struct_size)
flags=0;
#endif
 _ _   png_error(png_ptr,
_ __ __"The png struct_allocated by the_application for writing is_too small.");
 __  }
   if(png_sizeof(png_info) > png_info_size)
     {
 __ ___png_ptr->error_fn=NULL;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
   _   png_ptr->flags=0;
#endif
 _ _   png_error(png_ptr,
    __ "The info_struct allocated by the application for writing is too_small.");
     }
_  png_write_init_3(&png_ptr,_user_png_ver,_png_struct_size);
}
#endif_/* PNG_1_0_X || PNG_1_2_X_*/


void PNGAPI
png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
 _ png_size_t png_struct_size)
{
   png_structp_png_ptr=*ptr_ptr;
#ifdef PNG_SETJMP_SUPPORTED
   jmp_buf tmp_jmp; /*_to save current jump buffer */
#endif

_  int i =_0;

 _ if (png_ptr == NULL)
_  _ _return;

  _do
   {
  _  if_(user_png_ver[i]!= png_libpng_ver[i])
    _{
#ifdef_PNG_LEGACY_SUPPORTED
  ___ _png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
#else
__ __  png_ptr->warning_fn=NULL;
   __  png_warning(png_ptr,
    _"Application uses deprecated png_write_init()_and_should be recompiled.");
 _    _break;
#endif
     }
_ _} while_(png_libpng_ver[i++]);

   png_debug(1, "in png_write_init_3\n");

#ifdef PNG_SETJMP_SUPPORTED
   /* save_jump buffer and error functions */
_  png_memcpy(tmp_jmp, png_ptr->jmpbuf,_png_sizeof (jmp_buf));
#endif

__ if (png_sizeof(png_struct)_>_png_struct_size)
