#include <stdio.h>
#include <string.h>
typedef struct{
chardev1[32];
chardev2[32];
chardev3[32];
}JIPNC_ID;
int analyze_separator_num(char *src)
{
char*cp_tmp;
int counter= 0;
cp_tmp =strtok(src, ";");
if(cp_tmp)
{
printf("%s\n",cp_tmp);
counter++;
}
while((cp_tmp=strtok(NULL,";"))!=NULL)
{
counter++;
printf("%s\n",cp_tmp);
}
returncounter;
}
void analyze_socket_data(char *dest,char *src)
{
char*cp_tmp;
int counter= 0;
int i =1;
cp_tmp =strtok(src, ";");
if(cp_tmp)
{
strcpy(dest,cp_tmp);
printf("dest is%s\n",dest);
counter++;
}
while((cp_tmp=strtok(NULL,";"))!=NULL)
{
printf("cp_tmp is %s \n",cp_tmp);
strcpy((dest+i*256),cp_tmp);
counter++;
i++;
}
}
int test(char *kj)
{
strcpy(kj,"44");
return0;
}
int main()
{
inttmp,i=0;
charkj[1024] ="9;ipnc000000000001;ipnc000000000002;ipnc000000000003;ipnc000000000004;ipnc000000000005;ipnc000000000006;ipnc000000000007;ipnc000000000008;ipnc000000000009;";
charsrc_tmp[1024];
//chardata_tmp[10][256];
charlm[256];
strcpy(src_tmp,kj);
printf("%s\n",kj);
tmp =analyze_separator_num(kj);
chardata_tmp[tmp][256];
printf("src_tmp is :%s\n",src_tmp);
analyze_socket_data( data_tmp,src_tmp);
printf("thenumber of the ---;--- is %d\n",tmp);
printf("strlen is %d\n",strlen(kj));
printf("sizeof is %d\n",sizeof(kj));
printf("%s\n",kj);
for(i =0;i
{
strcpy(lm,data_tmp+i);
printf("The %dth id is =%s\n",i+1,data_tmp+i);
printf("The LM %dth id is = %s\n",i+1,lm);
printf("THe LM %dth data lenght is =%d\n\n",i+1,strlen(lm));
}
return0;
}