MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / remove_history

Function remove_history

extern/editline/src/readline.c:1441–1463  ·  view source on GitHub ↗

* remove the specified entry from the history list and return it. */

Source from the content-addressed store, hash-verified

1439 * remove the specified entry from the history list and return it.
1440 */
1441HIST_ENTRY *
1442remove_history(int num)
1443{
1444 HIST_ENTRY *he;
1445 HistEvent ev;
1446
1447 if (h == NULL || e == NULL)
1448 rl_initialize();
1449
1450 if ((he = el_malloc(sizeof(*he))) == NULL)
1451 return NULL;
1452
1453 if (history(h, &ev, H_DELDATA, num, &he->data) != 0) {
1454 el_free(he);
1455 return NULL;
1456 }
1457
1458 he->line = ev.str;
1459 if (history(h, &ev, H_GETSIZE) == 0)
1460 history_length = ev.num;
1461
1462 return he;
1463}
1464
1465
1466/*

Callers

nothing calls this directly

Calls 2

rl_initializeFunction · 0.85
historyClass · 0.85

Tested by

no test coverage detected