FTAM/9000 Programmer's Guide

378 Chapter 10
Example Programs
Setting Ae_dir_dn and P_address Utility Example
/*
** Reset the counters and flags for the next field.
*/
i = 0;
++j;
while (name[j] == ‘.’) {
/*
** Move to the next field in the p_addr
** and the next character in the string.
*/
++index;
++j;
}
}
else {
/*
** Move to the next field in the p_addr and the next
** character in the string.
*/
++j;
++index;
}
}
}
}
/*
** char_to_hex
**
** DESCRIPTION:
** Convert a character string of hex characters into a p_addr
** string.
**
** PARAMETERS
** Inputs:
** ch_string: char hex string
** ch_length: char string length
**
** Outputs:
** padr_string: P_address byte string
** padr_length: P_address string length
**
** ALGORITHM:
** Fill the P_address byte string with zeros.
** For each two hex characters in the character string:
** Convert the first character to a 4 bit value.
** Put the value in the 1st 4 bits of the next P_address byte.
** Convert the second character to a 4 bit value.
** Put the value in the last 4 bits of the P_address byte.
** Set the length of the P_address byte string.
**
*/