Browse Prior Art Database

Efficient Way to Separate Keyword=Value to Keyword and Value String

IP.com Disclosure Number: IPCOM000111314D
Original Publication Date: 1994-Feb-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 35K

Publishing Venue

IBM

Related People

McGuill, AL: AUTHOR [+3]

Abstract

Disclosed is a method for separating a single string value (keyword=value) into two strings (keyword and value) for processing purposes. Following is a step by step explanation.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Efficient Way to Separate Keyword=Value to Keyword and Value String

Disclosed is a method for separating a single string value
(keyword=value) into two strings (keyword and value) for processing
purposes.  Following is a step by step explanation.

     1) Use strchr to find the pointer value of the equal.

                              EqualPtr
                                  |
                                  V
                           Keyword=Value\0

     2) Set the keyword string pointer equal to the original string
          pointer.
                        KeywordPtr
                            |
                            V
                            Keyword=Value\0

     3) Set the Value string pointer equal to the equal sign pointer
        plus 1.
                               ValuePtr
                                  |
                                  V
                          Keyword=Value\0

     4) Change the equal sign to a NULL.

                            *EqualPtr='\0'
                                  |
                                  V
                       ...