Stefan Schuermans
removed version information from file headers (manged via git now)
Stefan Schuermans commited aa3270a at 2011-09-11 17:30:15
/*
* FlexiPix library
*
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info>
*
* 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, version 3 of the License.
*
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <string.h>
#include <intern/net.h>
#include <intern/parse.h>
/**
* \brief parse two comma-separated numbers
*
* \param[in] text text to parse
* \param[out] no1 first number parsed from text
* \param[out] no2 second number parsed from text
* \param[out] end location in text where parsing ended
* \return 0 in case of success, -1 in case of error
*/
int flp_parse_two_nos(char *text, unsigned int *no1, unsigned int *no2,
char **end)
{
char *ptr1, *ptr2;
unsigned long val1, val2;
/* parse first number */
val1 = strtoul(text, &ptr1, 0);
if (ptr1 == text || *ptr1 != ',')
return -1;
/* skip comma */
ptr1++;
/* parse second number */
val2 = strtoul(ptr1, &ptr2, 0);
if (ptr2 == ptr1
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX