Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3520009
  • 博文数量: 1805
  • 博客积分: 135
  • 博客等级: 入伍新兵
  • 技术积分: 3345
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 20:01
文章分类

全部博文(1805)

文章存档

2017年(19)

2016年(80)

2015年(341)

2014年(438)

2013年(349)

2012年(332)

2011年(248)

分类:

2012-11-16 08:40:17

来自android的hardware/ril/reference-ril/atchannel.c
  1. /** add an intermediate response to sp_response*/
  2. static void addIntermediate(const char *line)
  3. {
  4.     ATLine *p_new;

  5.     p_new = (ATLine *) malloc(sizeof(ATLine));

  6.     p_new->line = strdup(line);

  7.     /* note: this adds to the head of the list, so the list
  8.        will be in reverse order of lines received. the order is flipped
  9.        again before passing on to the command issuer */
  10.     p_new->p_next = sp_response->p_intermediates;
  11.     sp_response->p_intermediates = p_new;
  12. }
  1. /**
  2.  * The line reader places the intermediate responses in reverse order
  3.  * here we flip them back
  4.  */
  5. static void reverseIntermediates(ATResponse *p_response)
  6. {
  7.     ATLine *pcur,*pnext;

  8.     pcur = p_response->p_intermediates;
  9.     p_response->p_intermediates = NULL;

  10.     while (pcur != NULL) {
  11.         pnext = pcur->p_next;
  12.         pcur->p_next = p_response->p_intermediates;
  13.         p_response->p_intermediates = pcur;
  14.         pcur = pnext;
  15.     }
  16. }
阅读(314) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~