Skip to content

Commit aa2b1ca

Browse files
committed
Mark v0 functions deprecated
1 parent d2e65c4 commit aa2b1ca

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

pineappl_capi/src/lib.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub unsafe extern "C" fn pineappl_grid_clone(grid: *const Grid) -> Box<Grid> {
368368
/// See [`pineappl_grid_convolve_with_one`].
369369
#[deprecated(
370370
since = "0.8.0",
371-
note = "please use `pineappl_grid_convolve_with_one` instead"
371+
note = "use `pineappl_grid_convolve_with_one` instead"
372372
)]
373373
#[no_mangle]
374374
pub unsafe extern "C" fn pineappl_grid_convolute_with_one(
@@ -406,7 +406,7 @@ pub unsafe extern "C" fn pineappl_grid_convolute_with_one(
406406
/// See [`pineappl_grid_convolve_with_two`].
407407
#[deprecated(
408408
since = "0.8.0",
409-
note = "please use `pineappl_grid_convolve_with_two` instead"
409+
note = "use `pineappl_grid_convolve_with_two` instead"
410410
)]
411411
#[no_mangle]
412412
pub unsafe extern "C" fn pineappl_grid_convolute_with_two(
@@ -601,6 +601,7 @@ pub extern "C" fn pineappl_grid_delete(grid: Option<Box<Grid>>) {}
601601
///
602602
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
603603
/// this function is not safe to call.
604+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_fill2` instead")]
604605
#[no_mangle]
605606
pub unsafe extern "C" fn pineappl_grid_fill(
606607
grid: *mut Grid,
@@ -625,6 +626,7 @@ pub unsafe extern "C" fn pineappl_grid_fill(
625626
///
626627
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
627628
/// this function is not safe to call.
629+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_fill_all2` instead")]
628630
#[no_mangle]
629631
pub unsafe extern "C" fn pineappl_grid_fill_all(
630632
grid: *mut Grid,
@@ -650,6 +652,7 @@ pub unsafe extern "C" fn pineappl_grid_fill_all(
650652
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
651653
/// this function is not safe to call. Additionally, all remaining pointer parameters must be
652654
/// arrays as long as specified by `size`.
655+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_fill_array2` instead")]
653656
#[no_mangle]
654657
pub unsafe extern "C" fn pineappl_grid_fill_array(
655658
grid: *mut Grid,
@@ -684,6 +687,7 @@ pub unsafe extern "C" fn pineappl_grid_fill_array(
684687
///
685688
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
686689
/// this function is not safe to call.
690+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_channels` instead")]
687691
#[no_mangle]
688692
pub unsafe extern "C" fn pineappl_grid_lumi(grid: *const Grid) -> Box<Lumi> {
689693
let grid = unsafe { &*grid };
@@ -698,6 +702,7 @@ pub unsafe extern "C" fn pineappl_grid_lumi(grid: *const Grid) -> Box<Lumi> {
698702
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
699703
/// this function is not safe to call. The pointer `order_params` must point to an array as large
700704
/// as four times the number of orders in `grid`.
705+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_order_params2` instead")]
701706
#[no_mangle]
702707
pub unsafe extern "C" fn pineappl_grid_order_params(grid: *const Grid, order_params: *mut u32) {
703708
let grid = unsafe { &*grid };
@@ -750,6 +755,7 @@ pub unsafe extern "C" fn pineappl_grid_order_count(grid: *const Grid) -> usize {
750755
/// # Panics
751756
///
752757
/// TODO
758+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_new2` instead")]
753759
#[no_mangle]
754760
#[must_use]
755761
pub unsafe extern "C" fn pineappl_grid_new(
@@ -890,6 +896,7 @@ pub unsafe extern "C" fn pineappl_grid_scale(grid: *mut Grid, factor: f64) {
890896
///
891897
/// If `grid` does not point to a valid `Grid` object, for example when `grid` is the null pointer,
892898
/// this function is not safe to call.
899+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_split_channels` instead")]
893900
#[no_mangle]
894901
pub unsafe extern "C" fn pineappl_grid_split_lumi(grid: *mut Grid) {
895902
let grid = unsafe { &mut *grid };
@@ -1005,6 +1012,7 @@ pub unsafe extern "C" fn pineappl_grid_scale_by_order(
10051012
/// # Panics
10061013
///
10071014
/// TODO
1015+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_metadata` instead")]
10081016
#[no_mangle]
10091017
pub unsafe extern "C" fn pineappl_grid_key_value(
10101018
grid: *const Grid,
@@ -1043,6 +1051,7 @@ pub unsafe extern "C" fn pineappl_grid_key_value(
10431051
/// # Panics
10441052
///
10451053
/// TODO
1054+
#[deprecated(since = "1.0.0", note = "use `pineappl_grid_set_metadata` instead")]
10461055
#[no_mangle]
10471056
pub unsafe extern "C" fn pineappl_grid_set_key_value(
10481057
grid: *mut Grid,
@@ -1153,6 +1162,7 @@ pub unsafe extern "C" fn pineappl_grid_write(grid: *const Grid, filename: *const
11531162
/// The parameter `lumi` must point to a valid `Lumi` object created by `pineappl_lumi_new`.
11541163
/// `pdg_id_pairs` must be an array with length `2 * combinations`, and `factors` with length of
11551164
/// `combinations`.
1165+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_add` instead")]
11561166
#[no_mangle]
11571167
pub unsafe extern "C" fn pineappl_lumi_add(
11581168
lumi: *mut Lumi,
@@ -1183,6 +1193,7 @@ pub unsafe extern "C" fn pineappl_lumi_add(
11831193
///
11841194
/// The parameter `lumi` must point to a valid `Lumi` object created by `pineappl_lumi_new` or
11851195
/// `pineappl_grid_lumi`.
1196+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_combinations` instead")]
11861197
#[no_mangle]
11871198
pub unsafe extern "C" fn pineappl_lumi_combinations(lumi: *const Lumi, entry: usize) -> usize {
11881199
let lumi = unsafe { &*lumi };
@@ -1196,6 +1207,7 @@ pub unsafe extern "C" fn pineappl_lumi_combinations(lumi: *const Lumi, entry: us
11961207
///
11971208
/// The parameter `lumi` must point to a valid `Lumi` object created by `pineappl_lumi_new` or
11981209
/// `pineappl_grid_lumi`.
1210+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_count` instead")]
11991211
#[no_mangle]
12001212
pub unsafe extern "C" fn pineappl_lumi_count(lumi: *const Lumi) -> usize {
12011213
let lumi = unsafe { &*lumi };
@@ -1204,6 +1216,7 @@ pub unsafe extern "C" fn pineappl_lumi_count(lumi: *const Lumi) -> usize {
12041216
}
12051217

12061218
/// Delete luminosity function previously created with `pineappl_lumi_new`.
1219+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_delete` instead")]
12071220
#[no_mangle]
12081221
#[allow(unused_variables)]
12091222
pub extern "C" fn pineappl_lumi_delete(lumi: Option<Box<Lumi>>) {}
@@ -1217,6 +1230,7 @@ pub extern "C" fn pineappl_lumi_delete(lumi: Option<Box<Lumi>>) {}
12171230
/// `pineappl_grid_lumi`. The parameter `factors` must point to an array as long as the size
12181231
/// returned by `pineappl_lumi_combinations` and `pdg_ids` must point to an array that is twice as
12191232
/// long.
1233+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_entry` instead")]
12201234
#[no_mangle]
12211235
pub unsafe extern "C" fn pineappl_lumi_entry(
12221236
lumi: *const Lumi,
@@ -1243,6 +1257,7 @@ pub unsafe extern "C" fn pineappl_lumi_entry(
12431257

12441258
/// Creates a new luminosity function and returns a pointer to it. If no longer needed, the object
12451259
/// should be deleted using `pineappl_lumi_delete`.
1260+
#[deprecated(since = "1.0.0", note = "use `pineappl_channels_new` instead")]
12461261
#[no_mangle]
12471262
#[must_use]
12481263
pub extern "C" fn pineappl_lumi_new() -> Box<Lumi> {
@@ -1260,6 +1275,7 @@ pub struct KeyVal {
12601275
}
12611276

12621277
/// Delete the previously created object pointed to by `key_vals`.
1278+
#[deprecated(since = "1.0.0", note = "")]
12631279
#[no_mangle]
12641280
#[allow(unused_variables)]
12651281
pub extern "C" fn pineappl_keyval_delete(key_vals: Option<Box<KeyVal>>) {}
@@ -1270,6 +1286,7 @@ pub extern "C" fn pineappl_keyval_delete(key_vals: Option<Box<KeyVal>>) {}
12701286
///
12711287
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
12721288
/// `pineappl_keyval_new`. `key` must be a valid C string.
1289+
#[deprecated(since = "1.0.0", note = "")]
12731290
#[no_mangle]
12741291
#[must_use]
12751292
pub unsafe extern "C" fn pineappl_keyval_bool(key_vals: *const KeyVal, key: *const c_char) -> bool {
@@ -1285,6 +1302,7 @@ pub unsafe extern "C" fn pineappl_keyval_bool(key_vals: *const KeyVal, key: *con
12851302
///
12861303
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
12871304
/// `pineappl_keyval_new`. `key` must be a valid C string.
1305+
#[deprecated(since = "1.0.0", note = "")]
12881306
#[no_mangle]
12891307
#[must_use]
12901308
pub unsafe extern "C" fn pineappl_keyval_double(
@@ -1303,6 +1321,7 @@ pub unsafe extern "C" fn pineappl_keyval_double(
13031321
///
13041322
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
13051323
/// `pineappl_keyval_new`. `key` must be a valid C string.
1324+
#[deprecated(since = "1.0.0", note = "")]
13061325
#[no_mangle]
13071326
#[must_use]
13081327
pub unsafe extern "C" fn pineappl_keyval_int(key_vals: *const KeyVal, key: *const c_char) -> i32 {
@@ -1318,6 +1337,7 @@ pub unsafe extern "C" fn pineappl_keyval_int(key_vals: *const KeyVal, key: *cons
13181337
///
13191338
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
13201339
/// `pineappl_keyval_new`. `key` must be a valid C string.
1340+
#[deprecated(since = "1.0.0", note = "")]
13211341
#[no_mangle]
13221342
#[must_use]
13231343
pub unsafe extern "C" fn pineappl_keyval_string(
@@ -1331,6 +1351,7 @@ pub unsafe extern "C" fn pineappl_keyval_string(
13311351
}
13321352

13331353
/// Return a pointer to newly-created `pineappl_keyval` object.
1354+
#[deprecated(since = "1.0.0", note = "")]
13341355
#[no_mangle]
13351356
#[must_use]
13361357
pub extern "C" fn pineappl_keyval_new() -> Box<KeyVal> {
@@ -1343,6 +1364,7 @@ pub extern "C" fn pineappl_keyval_new() -> Box<KeyVal> {
13431364
///
13441365
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
13451366
/// `pineappl_keyval_new`. `key` must be a valid C string.
1367+
#[deprecated(since = "1.0.0", note = "")]
13461368
#[no_mangle]
13471369
pub unsafe extern "C" fn pineappl_keyval_set_bool(
13481370
key_vals: *mut KeyVal,
@@ -1363,6 +1385,7 @@ pub unsafe extern "C" fn pineappl_keyval_set_bool(
13631385
///
13641386
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
13651387
/// `pineappl_keyval_new`. `key` must be a valid C string.
1388+
#[deprecated(since = "1.0.0", note = "")]
13661389
#[no_mangle]
13671390
pub unsafe extern "C" fn pineappl_keyval_set_double(
13681391
key_vals: *mut KeyVal,
@@ -1383,6 +1406,7 @@ pub unsafe extern "C" fn pineappl_keyval_set_double(
13831406
///
13841407
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
13851408
/// `pineappl_keyval_new`. `key` must be a valid C string.
1409+
#[deprecated(since = "1.0.0", note = "")]
13861410
#[no_mangle]
13871411
pub unsafe extern "C" fn pineappl_keyval_set_int(
13881412
key_vals: *mut KeyVal,
@@ -1403,6 +1427,7 @@ pub unsafe extern "C" fn pineappl_keyval_set_int(
14031427
///
14041428
/// The parameter `key_vals` must point to a valid `KeyVal` object created by
14051429
/// `pineappl_keyval_new`. `key` must be a valid C string.
1430+
#[deprecated(since = "1.0.0", note = "")]
14061431
#[no_mangle]
14071432
pub unsafe extern "C" fn pineappl_keyval_set_string(
14081433
key_vals: *mut KeyVal,

0 commit comments

Comments
 (0)