Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15310167
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: 嵌入式

2011-02-26 12:53:54

来自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. }
阅读(3384) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~