Go to the source code of this file.
Namespaces | |
namespace | motoman |
namespace | motoman::trajectory_job |
Defines | |
#define | APPEND_LINE(dest, dest_max_size, src) |
Performs a safe line append using STRCAT and APPEND_LINE. See STRCAT for explanation of macro use. | |
#define | APPEND_LINEFEED(dest, dest_max_size) SAFE_STRCAT(dest, dest_max_size, "\r\n"); |
Performs a safe line feed and carriage return appending using STRCAT. See STRCAT for explanation of macro use. | |
#define | SAFE_STRCAT(dest, dest_max_size, src) |
Performs a safe string concat. by checking the destination size before performing the string concat. A function return of "false" occurs if the desination is not large enough to receive the src string. A macro is used so that the function returns immediately from the calling function. This cleans up the code and does not result in lots of if/else statements. |
#define APPEND_LINE | ( | dest, | |
dest_max_size, | |||
src | |||
) |
do \ { \ SAFE_STRCAT(dest, dest_max_size, src); \ APPEND_LINEFEED(dest, dest_max_size); \ } while (0)
Performs a safe line append using STRCAT and APPEND_LINE. See STRCAT for explanation of macro use.
Definition at line 96 of file trajectory_job.cpp.
#define APPEND_LINEFEED | ( | dest, | |
dest_max_size | |||
) | SAFE_STRCAT(dest, dest_max_size, "\r\n"); |
Performs a safe line feed and carriage return appending using STRCAT. See STRCAT for explanation of macro use.
Definition at line 89 of file trajectory_job.cpp.
#define SAFE_STRCAT | ( | dest, | |
dest_max_size, | |||
src | |||
) |
do \ { \ if (strlen(src) < dest_max_size - strlen(dest) - 1) \ { \ strcat(dest, src); \ } \ else \ { \ LOG_ERROR("STRCAT failed to append %s to %s", src, dest); \ return false; \ } \ } while (0)
Performs a safe string concat. by checking the destination size before performing the string concat. A function return of "false" occurs if the desination is not large enough to receive the src string. A macro is used so that the function returns immediately from the calling function. This cleans up the code and does not result in lots of if/else statements.
Definition at line 70 of file trajectory_job.cpp.