Commit 2c617e4
committed
libjob: add convenience idf58() function
Problem: The F58 representation of a Flux jobid is now the de facto
default representation of a jobid, but converting the flux_jobid_t
representation to this format for logging and other purposes is a bit
awkward. This makes it less likely for in-tree users to represent a
job in this format, and when they do, this requires a local buffer,
a call to flux_job_id_encode(3), etc.
Add a very simple, header-only conversion function to libjob for
this purpose
const char *idf58 (flux_jobid_t id);
This function uses a thread-local buffer to avoid requiring callers
to allocate their own on the stack. This makes it much easier (and
thus much more likely) to log jobids in F58, since this function can
just be placed around the jobid, instead of requiring a local buffer
and previous function call the encode the id.1 parent 2e502e8 commit 2c617e4
2 files changed
+37
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments