/***************************************************************************
 *   Copyright (C) 2004 by Johnny Mast                                     *
 *   rave@rosiello.org                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "global.h"




extern int ircSprintf(char *dest, char *fmt, ...);
extern int ircVnprintf(char *dest, size_t max, char *fmt, va_list  args);






int s_split (char *msg)
{
char *data, tmp [MX];
int j, len;

clean(tmp);

data = msg;
j = 0;
len = strnlen(data,MXR);

do 
{

	if ( *data == '\r' && *(++data) == '\n' )
	{		
		
		++ data;
		
		clean(msg);
		strcpy(msg,  data);

		return tmp;
	} else {

	tmp[j] = *data;
	
	data++; ++j;
	}


} while ( j <= len );


	return NULL;

}


int s_send(char *to, char *fmt, ...)
{
char buf[MR];
int len;

va_list  args;
va_start (args, fmt);


clean(buf);
len = ircVnprintf ( buf , MR, fmt, args );

 return 0;
}



