Commit 70fa9c5
authored
Slightly rewrite internal C API to reflect the modern dict API (#1187)
1. `md_get_one()`, `md_get_all()`, `md_pop_one()`, `md_pop_all()` now
return `1` if key exists in multidict, `0` otherwise.
2. `md_set_default()` now also returns `1` if key exists in multidict,
`0` if key doesn't exist and the default was iserted into the object.
3. All functions return `-1` in case of error.
The PR doesn't affect any public API; it is a preparation step for
introducing multidict's public C API.1 parent 184dc41 commit 70fa9c5
2 files changed
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
| |||
641 | 642 | | |
642 | 643 | | |
643 | 644 | | |
644 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
645 | 648 | | |
646 | 649 | | |
647 | 650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
| 817 | + | |
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | | - | |
| 871 | + | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
880 | | - | |
881 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
882 | 883 | | |
| 884 | + | |
883 | 885 | | |
884 | 886 | | |
885 | 887 | | |
| |||
907 | 909 | | |
908 | 910 | | |
909 | 911 | | |
910 | | - | |
| 912 | + | |
| 913 | + | |
911 | 914 | | |
912 | 915 | | |
913 | 916 | | |
| |||
919 | 922 | | |
920 | 923 | | |
921 | 924 | | |
922 | | - | |
| 925 | + | |
| 926 | + | |
923 | 927 | | |
924 | 928 | | |
925 | | - | |
| 929 | + | |
926 | 930 | | |
927 | 931 | | |
928 | 932 | | |
| |||
963 | 967 | | |
964 | 968 | | |
965 | 969 | | |
966 | | - | |
| 970 | + | |
967 | 971 | | |
968 | 972 | | |
969 | 973 | | |
| |||
1035 | 1039 | | |
1036 | 1040 | | |
1037 | 1041 | | |
1038 | | - | |
| 1042 | + | |
1039 | 1043 | | |
1040 | 1044 | | |
1041 | 1045 | | |
| |||
0 commit comments