Coverage Report

Created: 2026-04-12 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/netcdf-c/libdispatch/dnotnc4.c
Line
Count
Source
1
/* Copyright 2018, UCAR/Unidata See netcdf/COPYRIGHT file for copying
2
 * and redistribution conditions.*/
3
/**
4
 * @file
5
 * @internal This file contains functions that 
6
 * can be used in dispatch tables to handle
7
 * such things as unimplemented functions.
8
 * As a rule, these functions will return NC_ENOTNC4.
9
 * In some cases, the function may succeed and set
10
 * appropriate output parameter values. These are indicated
11
 * by the NC_NOOP prefix to the function name.
12
 *
13
 * @author Ed Hartnett, Dennis Heimbigner
14
 */
15
16
#include "netcdf.h"
17
#include "netcdf_filter.h"
18
#include "netcdf_aux.h"
19
#include "ncdispatch.h"
20
#include "nc4internal.h"
21
22
/**
23
 * @internal Not implemented in some dispatch tables
24
 *
25
 * @param ncid Ignored.
26
 * @param varid Ignored.
27
 * @param quantize_mode Ignored.
28
 * @param nsd Ignored.
29
 *
30
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table
31
 * @author Ed Hartnett
32
 */
33
int
34
NC_NOTNC4_def_var_quantize(int ncid, int varid,  int quantize_mode, int nsd)
35
0
{
36
0
    return NC_ENOTNC4;
37
0
}
38
39
/**
40
 * @internal Not implemented in some dispatch tables
41
 *
42
 * @param ncid Ignored.
43
 * @param varid Ignored.
44
 * @param quantize_modep Ignored.
45
 * @param nsdp Ignored.
46
 *
47
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table
48
 * @author Ed Hartnett
49
 */
50
int
51
NC_NOTNC4_inq_var_quantize(int ncid, int varid,  int *quantize_modep,
52
         int *nsdp)
53
0
{
54
0
    return NC_ENOTNC4;
55
0
}
56
57
/**
58
 * @internal Not implemented in some dispatch tables
59
 *
60
 * @param ncid Ignored.
61
 * @param varid Ignored.
62
 * @param id Ignored.
63
 * @param nparams Ignored.
64
 * @param params Ignored.
65
 *
66
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table
67
 * @author Ed Hartnett
68
 */
69
int
70
NC_NOTNC4_def_var_filter(int ncid, int varid, unsigned int  id, size_t nparams, const unsigned int* params)
71
0
{
72
0
    return NC_ENOTNC4;
73
0
}
74
75
/**
76
 * @internal Not implemented for a dispatch table.
77
 *
78
 * @param ncid Ignored.
79
 * @param varid Ignored.
80
 * @param nfilters Ignored.
81
 * @param filterids Ignored.
82
 *
83
 * @return ::NC_ENOTNC4 Not a netCDF-4 file.
84
 * @author Dennis Heimbigner
85
 */
86
int
87
NC_NOTNC4_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
88
0
{
89
0
    return NC_ENOTNC4;
90
0
}
91
92
/**
93
 * @internal Not implemented for a dispatch table.
94
 *
95
 * @param ncid Ignored.
96
 * @param varid Ignored.
97
 * @param id Ignored.
98
 * @param nparams Ignored.
99
 * @param params Ignored.
100
 *
101
 * @return ::NC_ENOTNC4 Not a netCDF-4 file.
102
 * @author Dennis Heimbigner
103
 */
104
int
105
NC_NOTNC4_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
106
0
{
107
0
    return NC_ENOTNC4;
108
0
}
109
110
/**
111
 * @internal No-op for filter inquiry. Reports zero filters.
112
 *
113
 * @param ncid Ignored.
114
 * @param varid Ignored.
115
 * @param nfilters Gets 0 if non-NULL.
116
 * @param filterids Ignored.
117
 *
118
 * @return ::NC_NOERR No error.
119
 * @author Dennis Heimbigner
120
 */
121
int
122
NC_NOOP_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
123
0
{
124
0
    if(nfilters) *nfilters = 0;
125
0
    return NC_NOERR;
126
0
}
127
128
/**
129
 * @internal No-op for filter info inquiry. Always returns NC_ENOFILTER.
130
 *
131
 * @param ncid Ignored.
132
 * @param varid Ignored.
133
 * @param id Ignored.
134
 * @param nparams Ignored.
135
 * @param params Ignored.
136
 *
137
 * @return ::NC_ENOFILTER No filter defined.
138
 * @author Dennis Heimbigner
139
 */
140
int
141
NC_NOOP_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
142
0
{
143
0
    NC_UNUSED(ncid);
144
0
    return NC_ENOFILTER;
145
0
}
146
147
/**
148
 * @internal No-op for filter availability check. Always returns NC_ENOFILTER.
149
 *
150
 * @param ncid Ignored.
151
 * @param id Ignored.
152
 *
153
 * @return ::NC_ENOFILTER No filter available.
154
 * @author Dennis Heimbigner
155
 */
156
int
157
NC_NOOP_inq_filter_avail(int ncid, unsigned id)
158
0
{
159
0
    NC_UNUSED(ncid);
160
0
    NC_UNUSED(id);
161
0
    return NC_ENOFILTER;
162
0
}
163
164
/**
165
 * @internal Not allowed for classic model.
166
 *
167
 * @param parent_ncid Ignored.
168
 * @param name Ignored.
169
 * @param new_ncid Ignored.
170
 *
171
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
172
 * @author Ed Hartnett
173
 */
174
int
175
NC_NOTNC4_def_grp(int parent_ncid, const char *name, int *new_ncid)
176
0
{
177
0
    return NC_ENOTNC4;
178
0
}
179
180
/**
181
 * @internal Not implemented for a dispatch table.
182
 *
183
 * @param grpid Ignored.
184
 * @param name Ignored.
185
 *
186
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
187
 * @author Ed Hartnett
188
 */
189
int
190
NC_NOTNC4_rename_grp(int grpid, const char *name)
191
0
{
192
0
    return NC_ENOTNC4;
193
0
}
194
195
/**
196
 * @internal Not implemented for a dispatch table.
197
 *
198
 * @param ncid Ignored.
199
 * @param size Ignored.
200
 * @param name Ignored.
201
 * @param typeidp Ignored.
202
 *
203
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
204
 * @author Ed Hartnett
205
 */
206
int
207
NC_NOTNC4_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp)
208
0
{
209
0
    return NC_ENOTNC4;
210
0
}
211
212
/**
213
 * @internal Not implemented for a dispatch table.
214
 *
215
 * @param ncid Ignored.
216
 * @param typeid1 Ignored.
217
 * @param name Ignored.
218
 * @param offset Ignored.
219
 * @param field Ignored.
220
 *
221
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
222
 * @author Ed Hartnett
223
 */
224
int
225
NC_NOTNC4_insert_compound(int ncid, nc_type typeid1, const char *name, size_t offset,
226
                          nc_type field_typeid)
227
0
{
228
0
    return NC_ENOTNC4;
229
0
}
230
231
/**
232
 * @internal Not implemented for a dispatch table.
233
 *
234
 * @param ncid Ignored.
235
 * @param typeid1 Ignored.
236
 * @param name Ignored.
237
 * @param offset Ignored.
238
 * @param field Ignored.
239
 * @param ndims Ignored.
240
 * @param dim Ignored.
241
 *
242
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
243
 * @author Ed Hartnett
244
 */
245
extern int
246
NC_NOTNC4_insert_array_compound(int ncid, int typeid1, const char *name,
247
                                size_t offset, nc_type field_typeid,
248
                                int ndims, const int *dim_sizesp)
249
0
{
250
0
    return NC_ENOTNC4;
251
0
}
252
253
/**
254
 * @internal Not implemented for a dispatch table.
255
 *
256
 * @param ncid Ignored.
257
 * @param typeid1 Ignored.
258
 * @param fieldid Ignored.
259
 * @param name Ignored.
260
 * @param offsetp Ignored.
261
 * @param field Ignored.
262
 * @param ndimsp Ignored.
263
 * @param dim Ignored.
264
 *
265
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
266
 * @author Ed Hartnett
267
 */
268
int
269
NC_NOTNC4_inq_compound_field(int ncid, nc_type typeid1, int fieldid, char *name,
270
                             size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
271
                             int *dim_sizesp)
272
0
{
273
0
    return NC_ENOTNC4;
274
0
}
275
276
/**
277
 * @internal Not implemented for a dispatch table.
278
 *
279
 * @param ncid Ignored.
280
 * @param typeid1 Ignored.
281
 * @param name Ignored.
282
 * @param fieldidp Ignored.
283
 *
284
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
285
 * @author Ed Hartnett
286
 */
287
int
288
NC_NOTNC4_inq_compound_fieldindex(int ncid, nc_type typeid1, const char *name, int *fieldidp)
289
0
{
290
0
    return NC_ENOTNC4;
291
0
}
292
293
/* Opaque type. */
294
295
/**
296
 * @internal Not implemented for a dispatch table.
297
 *
298
 * @param ncid Ignored.
299
 * @param datum Ignored.
300
 * @param name Ignored.
301
 * @param typeidp Ignored.
302
 *
303
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
304
 * @author Ed Hartnett
305
 */
306
int
307
NC_NOTNC4_def_opaque(int ncid, size_t datum_size, const char *name,
308
                     nc_type *typeidp)
309
0
{
310
0
    return NC_ENOTNC4;
311
0
}
312
313
/**
314
 * @internal Not implemented for a dispatch table.
315
 *
316
 * @param ncid Ignored.
317
 * @param name Ignored.
318
 * @param base_typeid Ignored.
319
 * @param typeidp Ignored.
320
 *
321
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
322
 * @author Ed Hartnett
323
 */
324
int
325
NC_NOTNC4_def_vlen(int ncid, const char *name, nc_type base_typeid,
326
                   nc_type *typeidp)
327
0
{
328
0
    return NC_ENOTNC4;
329
0
}
330
331
/**
332
 * @internal Not implemented for a dispatch table.
333
 *
334
 * @param ncid Ignored.
335
 * @param base_typeid Ignored.
336
 * @param name Ignored.
337
 * @param typeidp Ignored.
338
 *
339
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
340
 * @author Ed Hartnett
341
 */
342
int
343
NC_NOTNC4_def_enum(int ncid, nc_type base_typeid, const char *name,
344
                   nc_type *typeidp)
345
0
{
346
0
    return NC_ENOTNC4;
347
0
}
348
349
350
/**
351
 * @internal Not implemented for a dispatch table.
352
 *
353
 * @param ncid Ignored.
354
 * @param xtype Ignored.
355
 * @param value Ignored.
356
 * @param identifier Ignored.
357
 *
358
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
359
 * @author Ed Hartnett
360
 */
361
int
362
NC_NOTNC4_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier)
363
0
{
364
0
    return NC_ENOTNC4;
365
0
}
366
367
/**
368
 * @internal Not implemented for a dispatch table.
369
 *
370
 * @param ncid Ignored.
371
 * @param typeid1 Ignored.
372
 * @param idx Ignored.
373
 * @param identifier Ignored.
374
 * @param value Ignored.
375
 *
376
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
377
 * @author Ed Hartnett
378
 */
379
int
380
NC_NOTNC4_inq_enum_member(int ncid, nc_type typeid1, int idx, char *identifier,
381
                          void *value)
382
0
{
383
0
    return NC_ENOTNC4;
384
0
}
385
386
/**
387
 * @internal Not implemented for a dispatch table.
388
 *
389
 * @param ncid Ignored.
390
 * @param typeid1 Ignored.
391
 * @param identifier Ignored.
392
 * @param value Ignored.
393
 *
394
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
395
 * @author Ed Hartnett
396
 */
397
int
398
NC_NOTNC4_insert_enum(int ncid, nc_type typeid1, const char *identifier,
399
                      const void *value)
400
0
{
401
0
    return NC_ENOTNC4;
402
0
}
403
404
/**
405
 * @internal Not implemented for a dispatch table.
406
 *
407
 * @param ncid Ignored.
408
 * @param typeid1 Ignored.
409
 * @param vlen_element Ignored.
410
 * @param len Ignored.
411
 * @param data Ignored.
412
 *
413
 * @return ::NC_ENOTNC4 Not a netCDF-4 file.
414
 * @author Ed Hartnett
415
 */
416
int
417
NC_NOTNC4_put_vlen_element(int ncid, int typeid1, void *vlen_element,
418
                           size_t len, const void *data)
419
0
{
420
0
    return NC_ENOTNC4;
421
0
}
422
423
/**
424
 * @internal Not implemented for a dispatch table.
425
 *
426
 * @param ncid Ignored.
427
 * @param typeid1 Ignored.
428
 * @param vlen_element Ignored.
429
 * @param len Ignored.
430
 * @param data Ignored.
431
 *
432
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
433
 * @author Ed Hartnett
434
 */
435
int
436
NC_NOTNC4_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
437
                           size_t *len, void *data)
438
0
{
439
0
    return NC_ENOTNC4;
440
0
}
441
442
/**
443
 * @internal Not implemented for a dispatch table.
444
 *
445
 * @param ncid Ignored.
446
 * @param varid Ignored.
447
 * @param size Ignored.
448
 * @param nelems Ignored.
449
 * @param preemption Ignored.
450
 *
451
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
452
 * @author Ed Hartnett
453
 */
454
int
455
NC_NOTNC4_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
456
                              float preemption)
457
0
{
458
0
    return NC_ENOTNC4;
459
0
}
460
461
/**
462
 * @internal Not implemented for a dispatch table.
463
 *
464
 * @param ncid Ignored.
465
 * @param varid Ignored.
466
 * @param sizep Ignored.
467
 * @param nelemsp Ignored.
468
 * @param preemptionp Ignored.
469
 *
470
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
471
 * @author Ed Hartnett
472
 */
473
int
474
NC_NOTNC4_get_var_chunk_cache(int ncid, int varid, size_t *sizep,
475
                              size_t *nelemsp, float *preemptionp)
476
0
{
477
0
    return NC_ENOTNC4;
478
0
}
479
480
/**
481
 * @internal Not implemented for a dispatch table.
482
 *
483
 * @param ncid Ignored.
484
 * @param varid Ignored.
485
 * @param shuffle Ignored.
486
 * @param deflate Ignored.
487
 * @param deflate_level Ignored.
488
 *
489
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
490
 * @author Ed Hartnett, Dennis Heimbigner
491
 */
492
int
493
NC_NOTNC4_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
494
                          int deflate_level)
495
0
{
496
0
    return NC_ENOTNC4;
497
0
}
498
499
/**
500
 * @internal Not implemented for a dispatch table.
501
 *
502
 * @param ncid Ignored.
503
 * @param varid Ignored.
504
 * @param fletcher32 Ignored.
505
 *
506
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
507
 * @author Ed Hartnett, Dennis Heimbigner
508
 */
509
int
510
NC_NOTNC4_def_var_fletcher32(int ncid, int varid, int fletcher32)
511
0
{
512
0
    return NC_ENOTNC4;
513
0
}
514
515
/**
516
 * @internal Not implemented for a dispatch table.
517
 *
518
 * @param ncid Ignored.
519
 * @param varid Ignored.
520
 * @param contiguous Ignored.
521
 * @param chunksizesp Ignored.
522
 *
523
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
524
 * @author Ed Hartnett, Dennis Heimbigner
525
 */
526
int
527
NC_NOTNC4_def_var_chunking(int ncid, int varid, int contiguous, const size_t *chunksizesp)
528
0
{
529
0
    return NC_EPERM;
530
0
}
531
532
533
/**
534
 * @internal Not implemented for a dispatch table.
535
 *
536
 * @param ncid Ignored.
537
 * @param varid Ignored.
538
 * @param endianness Ignored.
539
 *
540
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
541
 * @author Ed Hartnett
542
 */
543
int
544
NC_NOTNC4_def_var_endian(int ncid, int varid, int endianness)
545
0
{
546
0
    return NC_ENOTNC4;
547
0
}
548
549
/**
550
 * @internal Not implemented for a dispatch table.
551
 *
552
 * @param ncid Ignored.
553
 * @param varid Ignored.
554
 * @param par_access Ignored.
555
 *
556
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
557
 * @author Ed Hartnett, Dennis Heimbigner
558
 */
559
int
560
NC_NOTNC4_var_par_access(int ncid, int varid, int par_access)
561
0
{
562
0
    return NC_ENOTNC4;
563
0
}
564
565
/**
566
 * @internal Not implemented for a dispatch table.
567
 *
568
 * @param ncid Ignored.
569
 * @param name Ignored.
570
 * @param grp_ncid Ignored.
571
 *
572
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
573
 * @author Ed Hartnett
574
 */
575
int
576
NC_NOTNC4_inq_ncid(int ncid, const char *name, int *grp_ncid)
577
0
{
578
0
    return NC_ENOTNC4;
579
0
}
580
581
/**
582
 * @internal Not implemented for a dispatch table.
583
 *
584
 * @param ncid Ignored.
585
 * @param numgrps Ignored.
586
 * @param ncids Ignored.
587
 *
588
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
589
 * @author Ed Hartnett
590
 */
591
int
592
NC_NOTNC4_inq_grps(int ncid, int *numgrps, int *ncids)
593
0
{
594
0
    return NC_ENOTNC4;
595
0
}
596
597
/**
598
 * @internal Not implemented for a dispatch table.
599
 *
600
 * @param ncid Ignored.
601
 * @param name Ignored.
602
603
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
604
 * @author Ed Hartnett
605
 */
606
int
607
NC_NOTNC4_inq_grpname(int ncid, char *name)
608
0
{
609
0
    return NC_ENOTNC4;
610
0
}
611
612
/**
613
 * @internal Not implemented for a dispatch table.
614
 *
615
 * @param ncid Ignored.
616
 * @param lenp Ignored.
617
 * @param full_name Ignored.
618
 *
619
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
620
 * @author Ed Hartnett
621
 */
622
int
623
NC_NOTNC4_inq_grpname_full(int ncid, size_t *lenp, char *full_name)
624
0
{
625
0
    return NC_ENOTNC4;
626
0
}
627
628
/**
629
 * @internal Not implemented for a dispatch table.
630
 *
631
 * @param ncid Ignored.
632
 * @param parent_ncid Ignored.
633
 *
634
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
635
 * @author Ed Hartnett
636
 */
637
int
638
NC_NOTNC4_inq_grp_parent(int ncid, int *parent_ncid)
639
0
{
640
0
    return NC_ENOTNC4;
641
0
}
642
643
/**
644
 * @internal Not implemented for a dispatch table.
645
 *
646
 * @param ncid Ignored.
647
 * @param full_name Ignored.
648
 * @param grp_ncid Ignored.
649
 *
650
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
651
 * @author Ed Hartnett
652
 */
653
int
654
NC_NOTNC4_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid)
655
0
{
656
0
    return NC_ENOTNC4;
657
0
}
658
659
/**
660
 * @internal Not implemented for a dispatch table.
661
 *
662
 * @param ncid Ignored.
663
 * @param nvars Ignored.
664
 * @param varids Ignored.
665
 *
666
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
667
 * @author Ed Hartnett
668
 */
669
int
670
NC_NOTNC4_inq_varids(int ncid, int *nvars, int *varids)
671
0
{
672
0
    return NC_ENOTNC4;
673
0
}
674
675
/**
676
 * @internal Not implemented for a dispatch table.
677
 *
678
 * @param ncid Ignored.
679
 * @param ndims Ignored.
680
 * @param dimids Ignored.
681
 * @param include_parents Ignored.
682
 *
683
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
684
 * @author Ed Hartnett
685
 */
686
int
687
NC_NOTNC4_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents)
688
0
{
689
0
    return NC_ENOTNC4;
690
0
}
691
692
/**
693
 * @internal Not implemented for a dispatch table.
694
 *
695
 * @param ncid Ignored.
696
 * @param ntypes Ignored.
697
 * @param typeids Ignored.
698
 *
699
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
700
 * @author Ed Hartnett
701
 */
702
int
703
NC_NOTNC4_inq_typeids(int ncid, int *ntypes, int *typeids)
704
0
{
705
0
    return NC_ENOTNC4;
706
0
}
707
708
/**
709
 * @internal Not implemented for a dispatch table.
710
 *
711
 * @param ncid Ignored.
712
 * @param typeid1 Ignored.
713
 * @param name Ignored.
714
 * @param size Ignored.
715
 * @param base_nc_typep Ignored.
716
 * @param nfieldsp Ignored.
717
 * @param classp Ignored.
718
 *
719
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
720
 * @author Ed Hartnett
721
 */
722
int
723
NC_NOTNC4_inq_user_type(int ncid, nc_type typeid1, char *name, size_t *size,
724
                        nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
725
0
{
726
0
    return NC_ENOTNC4;
727
0
}
728
729
/**
730
 * @internal Get the id of a type from the name.
731
 *
732
 * @param ncid Ignored.
733
 * @param name Ignored.
734
 * @param typeidp Ignored.
735
 *
736
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
737
 * @author Ed Hartnett
738
 */
739
int
740
NC_NOTNC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
741
0
{
742
    /* Note that this should actually work for atomic types */
743
0
    return NC_ENOTNC4;
744
0
}