/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Helper functions to skip white spaces, find tokens, find separators and free
* memory.
*/
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sdp.h>
#include "sdp_parse.h"
#include "commp_util.h"
void
{
}
}
void
{
}
}
void
{
}
}
void
{
}
}
void
{
media = next_media;
}
}
void
{
}
}
void
{
}
}
void
{
}
}
void
{
}
}
void
{
}
}
void
{
return;
}
/*
* Adds text of a given length to a linked list. If the list is NULL to
* start with it builds the new list
*/
int
{
return (ENOMEM);
if (text)
else
return (ENOMEM);
}
if (text) {
} else {
return (EINVAL);
}
}
} else {
}
return (0);
}
/*
* Given a linked list converts it to space separated string.
*/
int
{
int size = 0;
int wrote = 0;
char *ret;
char c[1];
return (EINVAL);
}
if (text)
else
size++;
}
if (size > 0) {
return (ENOMEM);
if (text) {
} else {
}
}
} else {
return (EINVAL);
}
return (0);
}
/*
* Given a space separated string, converts it into linked list. SDP field
* repeat and media can have undefined number of offsets or formats
* respectively. We need to capture it in a linked list.
*/
int
{
const char *begin;
const char *current;
const char *end;
int ret = 0;
if (len == 0)
return (EINVAL);
/* takes care of strings with just spaces */
return (EINVAL);
break;
++current;
}
return (ret);
}
}
}
return (0);
}