aboutsummaryrefslogblamecommitdiffstats
path: root/sock_conn.c
blob: c06bcb29b73a2098d6cfc6840d2f5ee13587819b (plain) (tree)




























                                                 





                                 




                                                   





                                   









                                                 






                                               
                                              



                                            





                                                    
                                                                  
                               
                                             
                                              
         
                                           


                         







                                                                                               


                                                                   
                                                                      


                                                                       

                                                         
                 

                                                                                                  
                                                   



                                              






                                               
                                          

                                               
                                                                      



                                                                                     
                                   



                              
                            
 














































                                                   
                   


















































































                                                            
                    


                                   











                             


                                       


                                                          
                                                         

                          
                                                                        



                                                          
                                  

                          
 
                          





                  


                                                        
                                                           
 



































                                                                      


                                     








                                                                        


                                     









                                                          


                                     










                                       

                          


















































                                                                      

                                            

                   

                                       


                                                  


                                                                                          




                                                                                









































                                                                                             













                             





                                                 
                       
         
                      




                                                     
 
                      

         



                              


                                                
 
 













                             

                 

 
#include "sock_conn.h"

/*mvar things*/
//shitty macro
#define MVAR_ALLOC_STRC(VNAME,VTYPE,VRET)\
VTYPE *VNAME;\
VNAME=malloc(sizeof(VTYPE));\
if ((VNAME)==NULL){\
VRET\
}\
memset(VNAME,0,sizeof(VTYPE));

#define MVAR_ALLOC_ARR(VNAME,VTYPE,VSZ,VRET)\
VTYPE *VNAME;\
VNAME=malloc(sizeof(VTYPE)*(VSZ));\
if ((VNAME)==NULL){\
VRET\
}\
memset(VNAME,0,sizeof(VTYPE)*(VSZ));

irc_buf* irc_buf_create()
{
	MVAR_ALLOC_STRC(ret,irc_buf,{
		return NULL;
	});

	ret->out_size = 0;
	ret->max_out_size = IRC_BUF_OUT_SIZE;
	ret->buf_out = malloc(ret->max_out_size);
	if (ret->buf_out == NULL)
	{
		free(ret);
		PERM();
		return NULL;
	}
	memset