tools/trace-malloc/formdata.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #if !defined(__formdata_H__)
     8 #define __formdata_H__
    10 /*
    11 **  formdata.h
    12 **
    13 **  Play (quick and dirty) utility API to parse up form get data into
    14 **      name value pairs.
    15 */
    17 typedef struct __struct_FormData
    18 /*
    19 **  Structure to hold the breakdown of any form data.
    20 **
    21 **  mNArray     Each form datum is a name value pair.
    22 **              This array holds the names.
    23 **              You can find the corresponding value at the same index in
    24 **                  mVArray.
    25 **              Never NULL, but perhpas an empty string.
    26 **  mVArray     Each form datum is a name value pair.
    27 **              This array holds the values.
    28 **              You can find the corresponding name at the same index in
    29 **                  mNArray.
    30 **              Never NULL, but perhpas an empty string.
    31 **  mNVCount    Count of array items in both mNArray and mVArray.
    32 **  mStorage    Should be ignored by users of this API.
    33 **              In reality holds the duped and decoded form data.
    34 */
    35 {
    36     char** mNArray;
    37     char** mVArray;
    38     unsigned mNVCount;
    39     char* mStorage;
    40 }
    41 FormData;
    43 FormData* FormData_Create(const char* inFormData)
    44 /*
    45 **  Take a contiguous string of form data, possibly hex encoded, and return
    46 **      the name value pairs parsed up and decoded.
    47 **  A caller of this routine should call FormData_Destroy at some point.
    48 **
    49 **  inFormData          The form data to parse up and decode.
    50 **  returns FormData*   The result of our effort.
    51 **                      This should be passed to FormData_Destroy at some
    52 **                          point of the memory will be leaked.
    53 */
    54 ;
    56 void FormData_Destroy(FormData* inDestroy)
    57 /*
    58 **  Release to the heap the structure previously created via FormData_Create.
    59 **
    60 **  inDestroy   The object to free off.
    61 */
    62 ;
    64 #endif /* __formdata_H__ */

mercurial