Namespaces | Defines
trajectory_job.cpp File Reference

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 Documentation

#define APPEND_LINE (   dest,
  dest_max_size,
  src 
)
Value:
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 98 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 91 of file trajectory_job.cpp.

#define SAFE_STRCAT (   dest,
  dest_max_size,
  src 
)
Value:
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 72 of file trajectory_job.cpp.



dx100
Author(s): Shaun Edwards (Southwest Research Institute)
autogenerated on Mon Oct 6 2014 02:25:34