1. 문자열 ngxstr_t

원본 코드 경로: src/core/ngx_string.h
typedef struct {
    size_t      len;       //        
    u_char     *data;      //     ,    c        \0
} ngx_str_t;

실례
 #include 
 #include 
 #include 
 #include 
 
 int
 main(int argc, char *argv[])
 {
     ngx_str_t t;
     char *str = "hello ngx";
     t.len = sizeof(str) - 1;
     t.data = (u_char *)str;
     
     printf("t.len = %lu
", t.len); printf("t.data = %s
", t.data); return 0; }

운행 하 다.
gcc ./j_str.c 
      -I ../../objs/ 
      -I ../core/ 
      -I ../os/unix/ 
      -I /usr/local/opt/pcre/include 
      -o ./j_str
(  :pcre     pcre    ) 

./j_str

결실
t.len = 9
t.data = hello ngx

좋은 웹페이지 즐겨찾기