Due to the DLL boundary cross problem on Windows we are forced to have the following, otherwise defined as macros, implemented as functions. However, macros proved to be problematic too on Unixes, so now we have functions only. */
| 6151 | defined as macros, implemented as functions. However, macros proved to be problematic too |
| 6152 | on Unixes, so now we have functions only. */ |
| 6153 | int PSL_command (struct PSL_CTRL *C, const char *format, ...) { |
| 6154 | va_list args; |
| 6155 | va_start (args, format); |
| 6156 | if (C->internal.memory) { /* Send command to memory buffer */ |
| 6157 | char tmp_buffer[4096] = {""}; /* Have to use this large array because sometimes we get the char encoding array, which is large. */ |
| 6158 | size_t len = vsnprintf (tmp_buffer, 4096, format, args); |
| 6159 | psl_prepare_buffer (C, len); |
| 6160 | C->internal.buffer[C->internal.n] = '\0'; /* Play safe before the strcat of next line. Otherwise trash in the middle may occur */ |
| 6161 | strncat (&(C->internal.buffer[C->internal.n]), tmp_buffer, len); |
| 6162 | C->internal.n += len; |
| 6163 | } |
| 6164 | else /* Write command to stream */ |
| 6165 | vfprintf (C->internal.fp, format, args); |
| 6166 | va_end (args); |
| 6167 | return (0); |
| 6168 | } |
| 6169 | |
| 6170 | int PSL_comment (struct PSL_CTRL *C, const char *format, ...) { |
| 6171 | va_list args; |
no test coverage detected