Logo Search packages:      
Sourcecode: uaputl version File versions  Download package

int fparse_for_hex ( FILE *  fp,
u8 dst 
)

parse hex data

Parameters:
fpA pointer to FILE stream
dstA pointer to receive hex data
Returns:
length of hex data

Definition at line 4576 of file uapcmd.c.

References convert2hex().

Referenced by apcmd_cfg_data().

{
    char *ptr;
    u8 *dptr;
    char buf[256];

    dptr = dst;
    while (fgets(buf, sizeof(buf), fp)) {
        ptr = buf;

        while (*ptr) {
            /* skip leading spaces */
            while (*ptr && (isspace(*ptr) || *ptr == '\t'))
                ptr++;

            /* skip blank lines and lines beginning with '#' */
            if (*ptr == '\0' || *ptr == '#')
                break;

            if (isxdigit(*ptr)) {
                ptr = convert2hex(ptr, dptr++);
            } else {
                /* Invalid character on data line */
                ptr++;
            }
        }
    }

    return (dptr - dst);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index