"Fossies" - the Fresh Open Source Software Archive

Member "burp-2.3.6/src/protocol2/rabin/win.c" (28 Apr 2019, 567 Bytes) of package /linux/privat/burp-2.3.6.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "win.c" see the Fossies "Dox" file reference documentation.

    1 #include "../../burp.h"
    2 #include "win.h"
    3 #include "rconf.h"
    4 #include "../../alloc.h"
    5 
    6 struct win *win_alloc(struct rconf *rconf)
    7 {
    8     struct win *win=NULL;
    9     if(!(win=(struct win *)calloc_w(1, sizeof(struct win), __func__))
   10       || !(win->data=(unsigned char *)calloc_w(
   11         1, sizeof(unsigned char)*rconf->win_size, __func__)))
   12             win_free(&win);
   13     return win;
   14 }
   15 
   16 static void win_free_content(struct win *win)
   17 {
   18     if(!win) return;
   19     free_v((void **)&win->data);
   20 }
   21 
   22 void win_free(struct win **win)
   23 {
   24     if(!win || !*win) return;
   25     win_free_content(*win);
   26     free_v((void **)win);
   27 }