============ Cbuf_ExecuteText ============ */
| 143 | ============ |
| 144 | */ |
| 145 | void Cbuf_ExecuteText (int exec_when, const char *text) |
| 146 | { |
| 147 | switch (exec_when) |
| 148 | { |
| 149 | case EXEC_NOW: |
| 150 | if (text && strlen(text) > 0) { |
| 151 | Com_DPrintf(S_COLOR_YELLOW "EXEC_NOW %s\n", text); |
| 152 | Cmd_ExecuteString (text); |
| 153 | } else { |
| 154 | Cbuf_Execute(); |
| 155 | Com_DPrintf(S_COLOR_YELLOW "EXEC_NOW %s\n", cmd_text.data); |
| 156 | } |
| 157 | break; |
| 158 | case EXEC_INSERT: |
| 159 | Cbuf_InsertText (text); |
| 160 | break; |
| 161 | case EXEC_APPEND: |
| 162 | Cbuf_AddText (text); |
| 163 | break; |
| 164 | default: |
| 165 | Com_Error (ERR_FATAL, "Cbuf_ExecuteText: bad exec_when"); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | /* |
| 170 | ============ |
no test coverage detected