(clientData, offset, buffer, maxBytes)
| 1480 | * requested by someone. It returns part or all of the selection |
| 1481 | * in a buffer provided by the caller. |
| 1482 | * |
| 1483 | * Results: |
| 1484 | * The return value is the number of non-NULL bytes stored |
| 1485 | * at buffer. Buffer is filled (or partially filled) with a |
| 1486 | * NULL-terminated string containing part or all of the selection, |
| 1487 | * as given by offset and maxBytes. |
| 1488 | * |
| 1489 | * Side effects: |
| 1490 | * None. |
| 1491 | * |
| 1492 | *---------------------------------------------------------------------- |
| 1493 | */ |
| 1494 | |
| 1495 | static int |
| 1496 | EntryFetchSelection(clientData, offset, buffer, maxBytes) |
| 1497 | ClientData clientData; /* Information about entry widget. */ |
| 1498 | int offset; /* Offset within selection of first |
| 1499 | * character to be returned. */ |
| 1500 | char *buffer; /* Location in which to place |
| 1501 | * selection. */ |
| 1502 | int maxBytes; /* Maximum number of bytes to place |
| 1503 | * at buffer, not including terminating |
| 1504 | * NULL character. */ |
| 1505 | { |
| 1506 | Entry *entryPtr = (Entry *) clientData; |
| 1507 | int count; |
| 1508 | |
| 1509 | if ((entryPtr->selectFirst < 0) || !(entryPtr->exportSelection)) { |
| 1510 | return -1; |
| 1511 | } |
| 1512 | count = entryPtr->selectLast + 1 - entryPtr->selectFirst - offset; |
nothing calls this directly
no outgoing calls
no test coverage detected