⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strutil.lst

📁 世纪民生公司的带网络功能的单片机CS6209开发http服务器的演示源代码。
💻 LST
字号:
C51 COMPILER V7.50   STRUTIL                                                               10/12/2006 15:31:42 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE STRUTIL
OBJECT MODULE PLACED IN .\Release\Strutil.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\lib\httpserver\Strutil.c LARGE OPTIMIZE(9,SIZE) BROWSE ORDER MODDP2 I
                    -NCDIR(..\..\inc\) DEBUG OBJECTEXTEND PRINT(.\Release\Strutil.lst) OBJECT(.\Release\Strutil.obj)

line level    source

   1          /*
   2           * 
   3           * strutil.c
   4           * 
   5           * Part of the Myson Century CS620X     demo program.
   6           *
   7           * Authors: LY Lin, WM Wang, IJ Chen, WH Lee
   8           *
   9           * strutil.c contains HTTP string utility routines.
  10           *
  11           * This program was developed using the Keil 8051 C uVision 2 system.
  12           * The Keil compiler MUST be used if working with Myson Century supplied
  13           * firmware.
  14           *
  15           * 
  16           *
  17          */
  18          
  19          #include <stdio.h>
  20          #include <string.h>
  21          #include <strutil.h>
  22          /************************************************************************
  23          /*      Function Name : strtok                                                                                          *
  24          /*                                                                                                                                              *
  25          /*      Arguments :                                                                                                             *
  26          /*                      char * str: Point to a source string,                                           *
  27          /*                                              if NULL it will use the previous string.                *
  28          /*                      char * control:Point to a string containing control             *
  29          /*                                                      characters.                                                                     *
  30          /*                                                                                                                                              *
  31          /*      Return :                                                                                                                        *
  32          /*                      The substring of source string end at the first appear of       *
  33          /*                      control characters.                                                                             *
  34          /*                      If source string doesn't contain any of control characters      *
  35          /*                      ,return NULL.                                                                                           *
  36          /*                                                                                                                                              *
  37          /*  Comment :                                                                                                                   *
  38          /*                      Find a minimal substring of source string containing any        *
  39          /*                      characters in control string.                                                           *
  40          /*                                                                                                                                              *
  41          /************************************************************************/
  42          char * strtok ( char * str, char * control ) 
  43          {
  44   1              static  char * s;
  45   1              char * s1;
  46   1      
  47   1              if ( str )
  48   1                      s = str ;
  49   1      
  50   1              s1 = s ;
  51   1      
  52   1              while (*s) {
  53   2                      if (strchr(control,*s)) {
  54   3                              *s++ = '\0';
C51 COMPILER V7.50   STRUTIL                                                               10/12/2006 15:31:42 PAGE 2   

  55   3                              return s1 ;
  56   3                      }
  57   2                      s++ ;
  58   2              }
  59   1              return (NULL);
  60   1      }  
  61          
  62          /************************************************************************
  63          /*      Function Name : __strcspn                                                                                       *
  64          /*                                                                                                                                              *
  65          /*      Arguments :                                                                                                             *
  66          /*                      char * s1: Source string.                                                                       *
  67          /*                      char * s2: Characters to find.                                                          *
  68          /*                                                                                                                                              *
  69          /*      Return :                                                                                                                        *
  70          /*                      Strcspn returns the length of the initial segment of string *
  71          /*          str1 that consists entirely of characters not from string   *
  72          /*                      str2.                                                                                                           *
  73          /*                                                                                                                                              *
  74          /*  Comment :                                                                                                                   *
  75          /*                      Scans a string for the first segment not containing any         *
  76          /*                      subset of a given set of characters.                                            *
  77          /*                                                                                                                                              *
  78          /************************************************************************/
  79          int __strcspn(char *s1, char *s2)
  80          {
  81   1              char *srchs2;
  82   1              int len;
  83   1      
  84   1              for (len = 0; *s1; s1++, len++)
  85   1                      for (srchs2 = s2; *srchs2; srchs2++)
  86   1                              if (*s1 == *srchs2) goto bye;
  87   1      bye:
  88   1              return (len);
  89   1      }
  90          char * strstr ( char * str1, char * str2) 
  91          {
  92   1              char * cp = str1;
  93   1              char * s1;
  94   1              char * s2;
  95   1      
  96   1              if ( !*str2 )
  97   1                  return str1;
  98   1      
  99   1              while (*cp)
 100   1              {
 101   2                      s1 = cp;
 102   2                      s2 = str2;
 103   2      
 104   2                      while ( *s1 && *s2 && !(*s1-*s2) )
 105   2                              s1++, s2++;
 106   2      
 107   2                      if (!*s2)
 108   2                              return(cp);
 109   2      
 110   2                      cp++;
 111   2              }
 112   1      
 113   1              return (NULL) ;
 114   1      }
 115          

C51 COMPILER V7.50   STRUTIL                                                               10/12/2006 15:31:42 PAGE 3   


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    277    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =      3      33
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -