| 53 | }; |
| 54 | |
| 55 | static enum deprecation_level deprecation(const char *start, |
| 56 | const char *end) |
| 57 | { |
| 58 | long cur; |
| 59 | long startnum; |
| 60 | long endnum; |
| 61 | |
| 62 | /* Versions are hard. Consider these: |
| 63 | * v23.05 |
| 64 | * -- A released version |
| 65 | * v23.05rc1 |
| 66 | * -- A release candidate |
| 67 | * v23.05rc4-11-g1e96146 |
| 68 | * -- Development off rc4, OR a user's local mods. |
| 69 | * v23.05-1-gf165dc0-modded |
| 70 | * -- Development off 23.05, OR a user's local mods. |
| 71 | */ |
| 72 | |
| 73 | /* If master has moved since release, we want to increment |
| 74 | * deprecations. If a user has made local mods, we don't! |
| 75 | * Fortunately, the Makefile sets "CLN_NEXT_VERSION", and |
| 76 | * we can simply use this. |
| 77 | */ |
| 78 | cur = version_to_number(CLN_NEXT_VERSION); |
| 79 | assert(cur); |
| 80 | startnum = version_to_number(start); |
| 81 | assert(startnum); |
| 82 | if (end) { |
| 83 | endnum = version_to_number(end); |
| 84 | assert(endnum); |
| 85 | assert(endnum >= startnum); |
| 86 | } else /* 6 months later */ |
| 87 | endnum = startnum + 6 * MONTH_VAL; |
| 88 | |
| 89 | if (cur < startnum) |
| 90 | return DEPRECATED_SOON; |
| 91 | if (cur < endnum) |
| 92 | return DEPRECATED; |
| 93 | if (cur == endnum) |
| 94 | return DEPRECATED_COMPLAIN; |
| 95 | return DEPRECATED_BEG; |
| 96 | } |
| 97 | |
| 98 | bool deprecated_ok_(bool deprecated_apis, |
| 99 | const char *feature, |