• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osip_strncpy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osip_strncpy函数的典型用法代码示例。如果您正苦于以下问题:C++ osip_strncpy函数的具体用法?C++ osip_strncpy怎么用?C++ osip_strncpy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osip_strncpy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: osip_cseq_parse

/* returns -1 on error. */
int
osip_cseq_parse (osip_cseq_t * cseq, const char *hvalue)
{
  char *method = NULL;
  const char *end = NULL;

  cseq->number = NULL;
  cseq->method = NULL;

  method = strchr (hvalue, ' ');	/* SEARCH FOR SPACE */
  end = hvalue + strlen (hvalue);

  if (method == NULL)
    return -1;

  if (method - hvalue + 1 < 2)
    return -1;
  cseq->number = (char *) osip_malloc (method - hvalue + 1);
  if (cseq->number == NULL)
    return -1;
  osip_strncpy (cseq->number, hvalue, method - hvalue);
  osip_clrspace (cseq->number);

  if (end - method + 1 < 2)
    return -1;
  cseq->method = (char *) osip_malloc (end - method + 1);
  if (cseq->method == NULL)
    return -1;
  osip_strncpy (cseq->method, method + 1, end - method);
  osip_clrspace (cseq->method);

  return 0;			/* ok */
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:34,代码来源:osip_cseq.c


示例2: groups_load_members

static int groups_load_members(grp_t *grp, char *members)
{
    char *dest;
    int index = 0;

    char *tmp = members;
    char *sep;
    sep = strchr(members, '|'); /* find beginning of prefix */

    while (sep!=NULL && index<MAX_MEMBERS)
    {
        dest = grp->members[index];
        if (sep-tmp<254)
            osip_strncpy(dest, tmp, sep-tmp);
        else
        {
            OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,
                                  "groups plugin: members url must be shorter than 254\n"));
        }

        index++;
        tmp = sep+1;
        sep = strchr(tmp, '|'); /* find beginning of prefix */
    }

    dest = grp->members[index];
    if (tmp!=NULL && strlen(tmp)<254)
    {
        osip_strncpy(dest, tmp, strlen(tmp));
    }

    for (index=0; index<MAX_MEMBERS; index++)
    {
        int i;
        osip_uri_t *uri;

        dest = grp->members[index];
        if (dest[0]=='\0')
            break;
        OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,
                              "groups plugin: members of %s: %s\n",
                              grp->group,
                              dest));

        osip_uri_init(&uri);
        i = osip_uri_parse(uri, dest);
        osip_uri_free(uri);
        if (i!=0)
        {
            OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,
                                  "groups plugin: Malformed members URL in group %s!\n",
                                  grp->group));
            return -1;
        }
    }

    return 0;
}
开发者ID:gozfree,项目名称:src,代码行数:58,代码来源:groups.c


示例3: osip_content_type_parse

/* returns -1 on error. */
int
osip_content_type_parse (osip_content_type_t * content_type,
			 const char *hvalue)
{
  char *subtype;
  char *osip_content_type_params;

  /* How to parse:

     we'll place the pointers:
     subtype              =>  beginning of subtype
     osip_content_type_params  =>  beginning of params

     examples:

     application/multipart ; boundary=
     ^          ^
   */

  subtype = strchr (hvalue, '/');
  osip_content_type_params = strchr (hvalue, ';');

  if (subtype == NULL)
    return -1;			/* do we really mind such an error */

  if (osip_content_type_params != NULL)
    {
      if (__osip_generic_param_parseall (content_type->gen_params,
					 osip_content_type_params) == -1)
	return -1;
    }
  else
    osip_content_type_params = subtype + strlen (subtype);

  if (subtype - hvalue + 1 < 2)
    return -1;
  content_type->type = (char *) osip_malloc (subtype - hvalue + 1);
  if (content_type->type == NULL)
    return -1;
  osip_strncpy (content_type->type, hvalue, subtype - hvalue);
  osip_clrspace (content_type->type);

  if (osip_content_type_params - subtype < 2)
    return -1;
  content_type->subtype =
    (char *) osip_malloc (osip_content_type_params - subtype);
  if (content_type->subtype == NULL)
    return -1;
  osip_strncpy (content_type->subtype, subtype + 1,
		osip_content_type_params - subtype - 1);
  osip_clrspace (content_type->subtype);

  return 0;
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:55,代码来源:osip_content_type.c


示例4: osip_strdup_without_quote

char *
osip_strdup_without_quote (const char *ch)
{
  char *copy = (char *) osip_malloc (strlen (ch) + 1);

  /* remove leading and trailing " */
  if ((*ch == '\"'))
    {
      osip_strncpy (copy, ch + 1, strlen (ch + 1));
      osip_strncpy (copy + strlen (copy) - 1, "\0", 1);
  } else
    osip_strncpy (copy, ch, strlen (ch));
  return copy;
}
开发者ID:tibastral,项目名称:symphonie,代码行数:14,代码来源:osip_port.c


示例5: jcall_new

int jcall_new(eXosip_event_t *je)
{
    jcall_t *ca;
    int k;

    if (___call_init==0)
    {
        ___call_init = -1;
        __call_init();
    }

    for (k=0; k<MAX_NUMBER_OF_CALLS; k++)
    {
        if (jcalls[k].state == NOT_USED)
            break;
    }
    if (k==MAX_NUMBER_OF_CALLS)
        return -1;

    ca = &(jcalls[k]);
    memset(&(jcalls[k]), 0, sizeof(jcall_t));

    ca->cid = je->cid;
    ca->did = je->did;

    if (ca->did<1 && ca->cid<1)
    {
        exit(0);
        return -1; /* not enough information for this event?? */
    }

    osip_strncpy(ca->textinfo,   je->textinfo, 255);
    osip_strncpy(ca->req_uri,    je->req_uri, 255);
    osip_strncpy(ca->local_uri,  je->local_uri, 255);
    osip_strncpy(ca->remote_uri, je->remote_uri, 255);
    osip_strncpy(ca->subject,    je->subject, 255);

    if (ca->remote_sdp_audio_ip[0]=='\0')
    {
        osip_strncpy(ca->remote_sdp_audio_ip, je->remote_sdp_audio_ip, 49);
        ca->remote_sdp_audio_port = je->remote_sdp_audio_port;
        ca->payload = je->payload;
        osip_strncpy(ca->payload_name, je->payload_name, 49);

        os_sound_init();
    }

    if (je->reason_phrase[0]!='\0')
    {
        osip_strncpy(ca->reason_phrase, je->reason_phrase, 49);
        ca->status_code = je->status_code;
    }

    eXosip_answer_call(ca->did, 180, NULL);

    ca->state = je->type;
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:58,代码来源:jcalls.c


示例6: __osip_set_next_token

/* __osip_set_next_token:
   dest is the place where the value will be allocated
   buf is the string where the value is searched
   end_separator is the character that MUST be found at the end of the value
   next is the final location of the separator + 1

   the element MUST be found before any "\r" "\n" "\0" and
   end_separator

   return -1 on error
   return 1 on success
*/
int __osip_set_next_token(char **dest, char *buf, int end_separator, char **next)
{
	char *sep;					/* separator */

	*next = NULL;

	sep = buf;
	while ((*sep != end_separator) && (*sep != '\0') && (*sep != '\r')
		   && (*sep != '\n'))
		sep++;
	if ((*sep == '\r') || (*sep == '\n')) {	/* we should continue normally only if this is the separator asked! */
		if (*sep != end_separator)
			return OSIP_UNDEFINED_ERROR;
	}
	if (*sep == '\0')
		return OSIP_UNDEFINED_ERROR;	/* value must not end with this separator! */
	if (sep == buf)
		return OSIP_UNDEFINED_ERROR;	/* empty value (or several space!) */

	*dest = osip_malloc(sep - (buf) + 1);
	if (*dest == NULL)
		return OSIP_NOMEM;
	osip_strncpy(*dest, buf, sep - buf);

	*next = sep + 1;			/* return the position right after the separator */
	return OSIP_SUCCESS;
}
开发者ID:avis,项目名称:osip,代码行数:39,代码来源:osip_port.c


示例7: jidentity_get_and_set_next_token

static int
jidentity_get_and_set_next_token (char **dest, char *buf, char **next)
{
  char *end;
  char *start;

  *next = NULL;

  /* find first non space and tab element */
  start = buf;
  while (((*start == ' ') || (*start == '\t')) && (*start != '\0')
         && (*start != '\r') && (*start != '\n') )
    start++;
  end = start+1;
  while ((*end != '\0') && (*end != '\r') && (*end != '\n')
         && (*end != '\t') && (*end != '|'))
    end++;
  
  if ((*end == '\r') || (*end == '\n'))
    /* we should continue normally only if this is the separator asked! */
    return -1;
  if (end == start)
    return -1;                  /* empty value (or several space!) */

  *dest = osip_malloc (end - (start) + 1);
  osip_strncpy (*dest, start, end - start);

  *next = end + 1;   /* return the position right after the separator
 */
  return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:31,代码来源:jidentity.c


示例8: osip_clrncpy

char *
osip_clrncpy (char *dst, const char *src, size_t len)
{
   osip_strncpy ( dst, src, len);
   osip_clrspace ( dst );
   return dst;
}
开发者ID:tws67,项目名称:bayonne-base-windows,代码行数:7,代码来源:osip_port.c


示例9: sdp_message_parse_v

int
sdp_message_parse_v (sdp_message_t * sdp, char *buf, char **next)
{
  char *equal;
  char *crlf;

  *next = buf;

  equal = buf;
  while ((*equal != '=') && (*equal != '\0'))
    equal++;
  if (*equal == '\0')
    return ERR_ERROR;

  /* check if header is "v" */
  if (equal[-1] != 'v')
    return ERR_DISCARD;

  crlf = equal + 1;

  while ((*crlf != '\r') && (*crlf != '\n') && (*crlf != '\0'))
    crlf++;
  if (*crlf == '\0')
    return ERR_ERROR;
  if (crlf == equal + 1)
    return ERR_ERROR;		/*v=\r ?? bad header */
  sdp->v_version = osip_malloc (crlf - (equal + 1) + 1);
  osip_strncpy (sdp->v_version, equal + 1, crlf - (equal + 1));

  if (crlf[1] == '\n')
    *next = crlf + 2;
  else
    *next = crlf + 1;
  return WF;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:35,代码来源:sdp_message.c


示例10: __osip_set_next_token_better

/*  not yet done!!! :-)
 */
int
__osip_set_next_token_better (char **dest, char *buf, int end_separator,
                              int *forbidden_tab[], int size_tab, char **next)
{
  char *sep;                    /* separator */

  *next = NULL;

  sep = buf;
  while ((*sep != end_separator) && (*sep != '\0') && (*sep != '\r')
         && (*sep != '\n'))
    sep++;
  if ((*sep == '\r') && (*sep == '\n'))
    {                           /* we should continue normally only if this is the separator asked! */
      if (*sep != end_separator)
        return -1;
    }
  if (*sep == '\0')
    return -1;                  /* value must not end with this separator! */
  if (sep == buf)
    return -1;                  /* empty value (or several space!) */

  *dest = osip_malloc (sep - (buf) + 1);
  osip_strncpy (*dest, buf, sep - buf);

  *next = sep + 1;              /* return the position right after the separator */
  return 1;
}
开发者ID:tibastral,项目名称:symphonie,代码行数:30,代码来源:osip_port.c


示例11: eXosip_register_build_initial_register_withqvalue

int
eXosip_register_build_initial_register_withqvalue(const char *from, const char *proxy,
									   const char *contact, int expires,
									   const char *qvalue,
									   osip_message_t ** reg)
{
	eXosip_reg_t *jr = NULL;
	int i;

	*reg = NULL;

	if (from == NULL || proxy == NULL)
		return OSIP_BADPARAMETER;

#ifdef REJECT_DOUBLE_REGISTRATION
	/* Avoid adding the same registration info twice to prevent mem leaks */
	for (jr = eXosip.j_reg; jr != NULL; jr = jr->next) {
		if (strcmp(jr->r_aor, from) == 0 && strcmp(jr->r_registrar, proxy) == 0) {
			REMOVE_ELEMENT(eXosip.j_reg, jr);
			eXosip_reg_free(jr);
			jr = NULL;
			break;
		}
	}
#endif

	if (jr == NULL) {
		/* Add new registration info */
		i = eXosip_reg_init(&jr, from, proxy, contact);
		if (i != 0) {
			OSIP_TRACE(osip_trace
					   (__FILE__, __LINE__, OSIP_ERROR, NULL,
						"eXosip: cannot register! "));
			return i;
		}
		ADD_ELEMENT(eXosip.j_reg, jr);
	}

	/* build register */
	jr->r_reg_period = expires;
	if (jr->r_reg_period <= 0)	/* too low */
		jr->r_reg_period = 0;
	else if (jr->r_reg_period < 30)	/* too low */
		jr->r_reg_period = 30;

	if(qvalue)
		osip_strncpy(jr->r_qvalue, qvalue, sizeof(jr->r_qvalue));

	i = _eXosip_register_build_register(jr, reg);
	if (i != 0) {
		OSIP_TRACE(osip_trace
				   (__FILE__, __LINE__, OSIP_ERROR, NULL,
					"eXosip: cannot build REGISTER!\n"));
		*reg = NULL;
		return i;
	}

	return jr->r_id;
}
开发者ID:AirDev,项目名称:linphone-android,代码行数:59,代码来源:eXregister_api.c


示例12: jcall_ack

int jcall_ack(eXosip_event_t *je)
{
    jcall_t *ca;
    int k;

    if (___call_init==0)
    {
        ___call_init = -1;
        __call_init();
    }

    for (k=0; k<MAX_NUMBER_OF_CALLS; k++)
    {
        if (jcalls[k].state != NOT_USED
                && jcalls[k].cid==je->cid
                && jcalls[k].did==je->did)
            break;
    }
    if (k==MAX_NUMBER_OF_CALLS)
        return -1;

    ca = &(jcalls[k]);

    if (je->remote_sdp_audio_ip[0]!='\0')
    {
        osip_strncpy(ca->remote_sdp_audio_ip, je->remote_sdp_audio_ip, 49);
        ca->remote_sdp_audio_port = je->remote_sdp_audio_port;
        ca->payload = je->payload;
        osip_strncpy(ca->payload_name, je->payload_name, 49);
    }
    if (ca->remote_sdp_audio_ip[0]!='\0')
    {
        if (0==os_sound_start(ca, atoi(je->jc->c_sdp_port)))
        {
            ca->enable_audio=1; /* audio is started */
        }
    }

    if (je->reason_phrase[0]!='\0')
    {
        osip_strncpy(ca->reason_phrase, je->reason_phrase, 49);
        ca->status_code = je->status_code;
    }
    ca->state = je->type;
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:46,代码来源:jcalls.c


示例13: sdp_message_parse_i

static int
sdp_message_parse_i (sdp_message_t * sdp, char *buf, char **next)
{
  char *equal;
  char *crlf;
  int i;
  char *i_info;

  *next = buf;

  equal = buf;
  while ((*equal != '=') && (*equal != '\0'))
    equal++;
  if (*equal == '\0')
    return ERR_ERROR;

  /* check if header is "i" */
  if (equal[-1] != 'i')
    return ERR_DISCARD;

  crlf = equal + 1;

  while ((*crlf != '\r') && (*crlf != '\n') && (*crlf != '\0'))
    crlf++;
  if (*crlf == '\0')
    return ERR_ERROR;
  if (crlf == equal + 1)
    return ERR_ERROR;		/* o=\r ?? bad header */

  /* s=text */

  /* text is interpreted as ISO-10646 UTF8! */
  /* using ISO 8859-1 requires "a=charset:ISO-8859-1 */
  i_info = osip_malloc (crlf - (equal + 1) + 1);
  osip_strncpy (i_info, equal + 1, crlf - (equal + 1));

  /* add the bandwidth at the correct place:
     if there is no media line yet, then the "b=" is the
     global one.
   */
  i = osip_list_size (sdp->m_medias);
  if (i == 0)
    sdp->i_info = i_info;
  else
    {
      sdp_media_t *last_sdp_media =
	(sdp_media_t *) osip_list_get (sdp->m_medias, i - 1);
      last_sdp_media->i_info = i_info;
    }

  if (crlf[1] == '\n')
    *next = crlf + 2;
  else
    *next = crlf + 1;
  return WF;
}
开发者ID:samm-git,项目名称:e3372h-vendor-src,代码行数:56,代码来源:sdp_message.c


示例14: eXosip_subscribe_init

int
eXosip_subscribe_init(eXosip_subscribe_t **js, char *uri)
{
  if (uri==NULL) return -1;
  *js = (eXosip_subscribe_t *)osip_malloc(sizeof(eXosip_subscribe_t));
  if (*js == NULL) return -1;
  memset(*js, 0, sizeof(eXosip_subscribe_t));
  osip_strncpy((*js)->s_uri, uri, strlen(uri));
  return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:10,代码来源:jsubscribe.c


示例15: osip_message_set_topheader

/* returns -1 on error. */
int
osip_message_set_topheader (osip_message_t * sip, const char *hname, const char *hvalue)
{
  osip_header_t *h;
  int i;

  if (hname == NULL)
    return -1;

  i = osip_header_init (&h);
  if (i != 0)
    return -1;

  h->hname = (char *) osip_malloc (strlen (hname) + 1);

  if (h->hname == NULL)
    {
      osip_header_free (h);
      return -1;
    }
  osip_strncpy (h->hname, hname, strlen (hname));
  osip_clrspace (h->hname);

  if (hvalue != NULL)
    {				/* some headers can be null ("subject:") */
      h->hvalue = (char *) osip_malloc (strlen (hvalue) + 1);
      if (h->hvalue == NULL)
	{
	  osip_header_free (h);
	  return -1;
	}
      osip_strncpy (h->hvalue, hvalue, strlen (hvalue));
      osip_clrspace (h->hvalue);
    }
  else
    h->hvalue = NULL;
#ifdef USE_TMP_BUFFER
  sip->message_property = 2;
#endif
  osip_list_add (sip->headers, h, 0);
  return 0;			/* ok */
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:43,代码来源:osip_header.c


示例16: osip_strdup

char *
osip_strdup (const char *ch)
{
  char *copy;
  size_t length;
  if (ch == NULL)
    return NULL;
  length = strlen (ch);
  copy = (char *) osip_malloc (length + 1);
  osip_strncpy (copy, ch, length);
  return copy;
}
开发者ID:samm-git,项目名称:e3372h-vendor-src,代码行数:12,代码来源:osip_port.c


示例17: _eXosip_default_gateway_ipv4

/* This is a portable way to find the default gateway.
 * The ip of the default interface is returned.
 */
static int _eXosip_default_gateway_ipv4(char *address, int size)
{
#ifdef __APPLE_CC__
	int len;
#else
	unsigned int len;
#endif
	int sock_rt, on = 1;

	struct sockaddr_in iface_out;

	struct sockaddr_in remote;

	memset(&remote, 0, sizeof(struct sockaddr_in));

	remote.sin_family = AF_INET;
	remote.sin_addr.s_addr = inet_addr(eXosip.ipv4_for_gateway);
	remote.sin_port = htons(11111);

	memset(&iface_out, 0, sizeof(iface_out));
	sock_rt = socket(AF_INET, SOCK_DGRAM, 0);

	if (setsockopt(sock_rt, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) == -1) {
		perror("DEBUG: [get_output_if] setsockopt(SOL_SOCKET, SO_BROADCAST");
		close(sock_rt);
		snprintf(address, size, "127.0.0.1");
		return OSIP_NO_NETWORK;
	}

	if (connect
		(sock_rt, (struct sockaddr *) &remote, sizeof(struct sockaddr_in)) == -1) {
		perror("DEBUG: [get_output_if] connect");
		close(sock_rt);
		snprintf(address, size, "127.0.0.1");
		return OSIP_NO_NETWORK;
	}

	len = sizeof(iface_out);
	if (getsockname(sock_rt, (struct sockaddr *) &iface_out, &len) == -1) {
		perror("DEBUG: [get_output_if] getsockname");
		close(sock_rt);
		snprintf(address, size, "127.0.0.1");
		return OSIP_NO_NETWORK;
	}

	close(sock_rt);
	if (iface_out.sin_addr.s_addr == 0) {	/* what is this case?? */
		snprintf(address, size, "127.0.0.1");
		return OSIP_NO_NETWORK;
	}
	osip_strncpy(address, inet_ntoa(iface_out.sin_addr), size - 1);
	return OSIP_SUCCESS;
}
开发者ID:flybird119,项目名称:meetphone,代码行数:56,代码来源:eXutils.c


示例18: main

int
main (int argc, char **argv)
{
  FILE *vias_file;


  osip_via_t *via;
  char *a_via;
  char *dest;
  char *res;

  vias_file = fopen (argv[1], "r");
  if (vias_file == NULL)
    {
      fprintf (stdout, "Failed to open %s file.\nUsage: tvia vias.txt\n", argv[1]);
      exit (0);
    }

  a_via = (char *) osip_malloc (200);
  res = fgets (a_via, 200, vias_file);  /* lines are under 200 */
  while (res != NULL)
    {

      int errcode;

      /* remove the last '\n' before parsing */
      osip_strncpy (a_via + strlen (a_via) - 1, "\0", 1);

      if (0 != strncmp (a_via, "#", 1))
        {
          /* allocate & init via */
          osip_via_init (&via);
          printf ("=================================================\n");
          printf ("VIA TO PARSE: |%s|\n", a_via);
          errcode = osip_via_parse (via, a_via);
          if (errcode != -1)
            {
              if (osip_via_to_str (via, &dest) != -1)
                {
                  printf ("result:       |%s|\n", dest);
                  osip_free (dest);
                }
          } else
            printf ("Bad via format: %s\n", a_via);
          osip_via_free (via);
          printf ("=================================================\n");
        }
      res = fgets (a_via, 200, vias_file);      /* lines are under 200 */
    }
  osip_free (a_via);

  return 0;
}
开发者ID:LaughingAngus,项目名称:linphone-vs2008,代码行数:53,代码来源:tvia.c


示例19: eXosip_notify_init

int
eXosip_notify_init (eXosip_notify_t ** jn, osip_message_t * inc_subscribe)
{
  osip_contact_t *co;
  char *uri;
  int i;
  char locip[50];

#ifdef SM
  eXosip_get_localip_from_via (inc_subscribe, locip, 49);
#else
  i = _eXosip_find_protocol (inc_subscribe);
  if (i == IPPROTO_UDP)
    {
      eXosip_guess_ip_for_via (eXosip.net_interfaces[0].net_ip_family, locip, 49);
  } else if (i == IPPROTO_TCP)
    {
      eXosip_guess_ip_for_via (eXosip.net_interfaces[1].net_ip_family, locip, 49);
  } else
    {
      OSIP_TRACE (osip_trace
                  (__FILE__, __LINE__, OSIP_ERROR, NULL,
                   "eXosip: unsupported protocol (default to UDP)\n"));
      eXosip_guess_ip_for_via (eXosip.net_interfaces[0].net_ip_family, locip, 49);
      return -1;
    }

#endif
  if (inc_subscribe == NULL
      || inc_subscribe->to == NULL || inc_subscribe->to->url == NULL)
    return -1;
  co = (osip_contact_t *) osip_list_get (inc_subscribe->contacts, 0);
  if (co == NULL || co->url == NULL)
    return -1;

  *jn = (eXosip_notify_t *) osip_malloc (sizeof (eXosip_notify_t));
  if (*jn == NULL)
    return -1;
  memset (*jn, 0, sizeof (eXosip_notify_t));

  i = osip_uri_to_str (co->url, &uri);
  if (i != 0)
    {
      osip_free (*jn);
      *jn = NULL;
      return -1;
    }
  osip_strncpy ((*jn)->n_uri, uri, 254);
  osip_free (uri);

  return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:52,代码来源:jnotify.c


示例20: jcall_offhold

int jcall_offhold(eXosip_event_t *je)
{
    jcall_t *ca;
    int k;

    if (___call_init==0)
    {
        ___call_init = -1;
        __call_init();
    }

    for (k=0; k<MAX_NUMBER_OF_CALLS; k++)
    {
        if (jcalls[k].state != NOT_USED
                && jcalls[k].cid==je->cid
                && jcalls[k].did==je->did)
            break;
    }
    if (k==MAX_NUMBER_OF_CALLS)
        return -1;

    ca = &(jcalls[k]);
    osip_strncpy(ca->textinfo,   je->textinfo, 255);

    if (ca->remote_sdp_audio_ip[0]=='\0')
    {
        osip_strncpy(ca->remote_sdp_audio_ip, je->remote_sdp_audio_ip, 49);
        ca->remote_sdp_audio_port = je->remote_sdp_audio_port;
    }

    if (je->reason_phrase[0]!='\0')
    {
        osip_strncpy(ca->reason_phrase, je->reason_phrase, 49);
        ca->status_code = je->status_code;
    }
    ca->state = je->type;
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:38,代码来源:jcalls.c



注:本文中的osip_strncpy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osip_trace函数代码示例发布时间:2022-05-30
下一篇:
C++ osip_strdup函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap