Coverage Report

Created: 2025-10-28 07:06

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 parms 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* parms)
71
0
{
72
0
    return NC_ENOTNC4;
73
0
}
74
75
int
76
NC_NOTNC4_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
77
0
{
78
0
    return NC_ENOTNC4;
79
0
}
80
81
int
82
NC_NOTNC4_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
83
0
{
84
0
    return NC_ENOTNC4;
85
0
}
86
87
int
88
NC_NOOP_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
89
0
{
90
0
    if(nfilters) *nfilters = 0;
91
0
    return NC_NOERR;
92
0
}
93
94
int
95
NC_NOOP_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
96
0
{
97
0
    NC_UNUSED(ncid);
98
0
    return NC_ENOFILTER;
99
0
}
100
101
int
102
NC_NOOP_inq_filter_avail(int ncid, unsigned id)
103
0
{
104
0
    NC_UNUSED(ncid);
105
0
    NC_UNUSED(id);
106
0
    return NC_ENOFILTER;
107
0
}
108
109
/**
110
 * @internal Not allowed for classic model.
111
 *
112
 * @param parent_ncid Ignored.
113
 * @param name Ignored.
114
 * @param new_ncid Ignored.
115
 *
116
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
117
 * @author Ed Hartnett
118
 */
119
int
120
NC_NOTNC4_def_grp(int parent_ncid, const char *name, int *new_ncid)
121
0
{
122
0
    return NC_ENOTNC4;
123
0
}
124
125
/**
126
 * @internal Not implemented for a dispatch table.
127
 *
128
 * @param grpid Ignored.
129
 * @param name Ignored.
130
 *
131
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
132
 * @author Ed Hartnett
133
 */
134
int
135
NC_NOTNC4_rename_grp(int grpid, const char *name)
136
0
{
137
0
    return NC_ENOTNC4;
138
0
}
139
140
/**
141
 * @internal Not implemented for a dispatch table.
142
 *
143
 * @param ncid Ignored.
144
 * @param size Ignored.
145
 * @param name Ignored.
146
 * @param typeidp Ignored.
147
 *
148
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
149
 * @author Ed Hartnett
150
 */
151
int
152
NC_NOTNC4_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp)
153
0
{
154
0
    return NC_ENOTNC4;
155
0
}
156
157
/**
158
 * @internal Not implemented for a dispatch table.
159
 *
160
 * @param ncid Ignored.
161
 * @param typeid1 Ignored.
162
 * @param name Ignored.
163
 * @param offset Ignored.
164
 * @param field Ignored.
165
 *
166
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
167
 * @author Ed Hartnett
168
 */
169
int
170
NC_NOTNC4_insert_compound(int ncid, nc_type typeid1, const char *name, size_t offset,
171
                          nc_type field_typeid)
172
0
{
173
0
    return NC_ENOTNC4;
174
0
}
175
176
/**
177
 * @internal Not implemented for a dispatch table.
178
 *
179
 * @param ncid Ignored.
180
 * @param typeid1 Ignored.
181
 * @param name Ignored.
182
 * @param offset Ignored.
183
 * @param field Ignored.
184
 * @param ndims Ignored.
185
 * @param dim Ignored.
186
 *
187
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
188
 * @author Ed Hartnett
189
 */
190
extern int
191
NC_NOTNC4_insert_array_compound(int ncid, int typeid1, const char *name,
192
                                size_t offset, nc_type field_typeid,
193
                                int ndims, const int *dim_sizesp)
194
0
{
195
0
    return NC_ENOTNC4;
196
0
}
197
198
/**
199
 * @internal Not implemented for a dispatch table.
200
 *
201
 * @param ncid Ignored.
202
 * @param typeid1 Ignored.
203
 * @param fieldid Ignored.
204
 * @param name Ignored.
205
 * @param offsetp Ignored.
206
 * @param field Ignored.
207
 * @param ndimsp Ignored.
208
 * @param dim Ignored.
209
 *
210
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
211
 * @author Ed Hartnett
212
 */
213
int
214
NC_NOTNC4_inq_compound_field(int ncid, nc_type typeid1, int fieldid, char *name,
215
                             size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
216
                             int *dim_sizesp)
217
0
{
218
0
    return NC_ENOTNC4;
219
0
}
220
221
/**
222
 * @internal Not implemented for a dispatch table.
223
 *
224
 * @param ncid Ignored.
225
 * @param typeid1 Ignored.
226
 * @param name Ignored.
227
 * @param fieldidp Ignored.
228
 *
229
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
230
 * @author Ed Hartnett
231
 */
232
int
233
NC_NOTNC4_inq_compound_fieldindex(int ncid, nc_type typeid1, const char *name, int *fieldidp)
234
0
{
235
0
    return NC_ENOTNC4;
236
0
}
237
238
/* Opaque type. */
239
240
/**
241
 * @internal Not implemented for a dispatch table.
242
 *
243
 * @param ncid Ignored.
244
 * @param datum Ignored.
245
 * @param name Ignored.
246
 * @param typeidp Ignored.
247
 *
248
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
249
 * @author Ed Hartnett
250
 */
251
int
252
NC_NOTNC4_def_opaque(int ncid, size_t datum_size, const char *name,
253
                     nc_type *typeidp)
254
0
{
255
0
    return NC_ENOTNC4;
256
0
}
257
258
/**
259
 * @internal Not implemented for a dispatch table.
260
 *
261
 * @param ncid Ignored.
262
 * @param name Ignored.
263
 * @param base_typeid Ignored.
264
 * @param typeidp Ignored.
265
 *
266
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
267
 * @author Ed Hartnett
268
 */
269
int
270
NC_NOTNC4_def_vlen(int ncid, const char *name, nc_type base_typeid,
271
                   nc_type *typeidp)
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 base_typeid Ignored.
281
 * @param name Ignored.
282
 * @param typeidp Ignored.
283
 *
284
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
285
 * @author Ed Hartnett
286
 */
287
int
288
NC_NOTNC4_def_enum(int ncid, nc_type base_typeid, const char *name,
289
                   nc_type *typeidp)
290
0
{
291
0
    return NC_ENOTNC4;
292
0
}
293
294
295
/**
296
 * @internal Not implemented for a dispatch table.
297
 *
298
 * @param ncid Ignored.
299
 * @param xtype Ignored.
300
 * @param value Ignored.
301
 * @param identifier Ignored.
302
 *
303
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
304
 * @author Ed Hartnett
305
 */
306
int
307
NC_NOTNC4_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier)
308
0
{
309
0
    return NC_ENOTNC4;
310
0
}
311
312
/**
313
 * @internal Not implemented for a dispatch table.
314
 *
315
 * @param ncid Ignored.
316
 * @param typeid1 Ignored.
317
 * @param idx Ignored.
318
 * @param identifier Ignored.
319
 * @param value Ignored.
320
 *
321
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
322
 * @author Ed Hartnett
323
 */
324
int
325
NC_NOTNC4_inq_enum_member(int ncid, nc_type typeid1, int idx, char *identifier,
326
                          void *value)
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 typeid1 Ignored.
336
 * @param identifier Ignored.
337
 * @param value Ignored.
338
 *
339
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
340
 * @author Ed Hartnett
341
 */
342
int
343
NC_NOTNC4_insert_enum(int ncid, nc_type typeid1, const char *identifier,
344
                      const void *value)
345
0
{
346
0
    return NC_ENOTNC4;
347
0
}
348
349
/**
350
 * @internal Not implemented for a dispatch table.
351
 *
352
 * @param ncid Ignored.
353
 * @param typeid1 Ignored.
354
 * @param vlen_element Ignored.
355
 * @param len Ignored.
356
 * @param data Ignored.
357
 *
358
 * @return ::NC_NOERR No error.
359
 * @author Ed Hartnett
360
 */
361
int
362
NC_NOTNC4_put_vlen_element(int ncid, int typeid1, void *vlen_element,
363
                           size_t len, const void *data)
364
0
{
365
0
    return NC_ENOTNC4;
366
0
}
367
368
/**
369
 * @internal Not implemented for a dispatch table.
370
 *
371
 * @param ncid Ignored.
372
 * @param typeid1 Ignored.
373
 * @param vlen_element Ignored.
374
 * @param len Ignored.
375
 * @param data Ignored.
376
 *
377
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
378
 * @author Ed Hartnett
379
 */
380
int
381
NC_NOTNC4_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
382
                           size_t *len, void *data)
383
0
{
384
0
    return NC_ENOTNC4;
385
0
}
386
387
/**
388
 * @internal Not implemented for a dispatch table.
389
 *
390
 * @param ncid Ignored.
391
 * @param varid Ignored.
392
 * @param size Ignored.
393
 * @param nelems Ignored.
394
 * @param preemption Ignored.
395
 *
396
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
397
 * @author Ed Hartnett
398
 */
399
int
400
NC_NOTNC4_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
401
                              float preemption)
402
0
{
403
0
    return NC_ENOTNC4;
404
0
}
405
406
/**
407
 * @internal Not implemented for a dispatch table.
408
 *
409
 * @param ncid Ignored.
410
 * @param varid Ignored.
411
 * @param sizep Ignored.
412
 * @param nelemsp Ignored.
413
 * @param preemptionp Ignored.
414
 *
415
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
416
 * @author Ed Hartnett
417
 */
418
int
419
NC_NOTNC4_get_var_chunk_cache(int ncid, int varid, size_t *sizep,
420
                              size_t *nelemsp, float *preemptionp)
421
0
{
422
0
    return NC_ENOTNC4;
423
0
}
424
425
/**
426
 * @internal Not implemented for a dispatch table.
427
 *
428
 * @param ncid Ignored.
429
 * @param varid Ignored.
430
 * @param shuffle Ignored.
431
 * @param deflate Ignored.
432
 * @param deflate_level Ignored.
433
 *
434
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
435
 * @author Ed Hartnett, Dennis Heimbigner
436
 */
437
int
438
NC_NOTNC4_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
439
                          int deflate_level)
440
0
{
441
0
    return NC_ENOTNC4;
442
0
}
443
444
/**
445
 * @internal Not implemented for a dispatch table.
446
 *
447
 * @param ncid Ignored.
448
 * @param varid Ignored.
449
 * @param fletcher32 Ignored.
450
 *
451
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
452
 * @author Ed Hartnett, Dennis Heimbigner
453
 */
454
int
455
NC_NOTNC4_def_var_fletcher32(int ncid, int varid, int fletcher32)
456
0
{
457
0
    return NC_ENOTNC4;
458
0
}
459
460
/**
461
 * @internal Not implemented for a dispatch table.
462
 *
463
 * @param ncid Ignored.
464
 * @param varid Ignored.
465
 * @param contiguous Ignored.
466
 * @param chunksizesp Ignored.
467
 *
468
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
469
 * @author Ed Hartnett, Dennis Heimbigner
470
 */
471
int
472
NC_NOTNC4_def_var_chunking(int ncid, int varid, int contiguous, const size_t *chunksizesp)
473
0
{
474
0
    return NC_EPERM;
475
0
}
476
477
478
/**
479
 * @internal Not implemented for a dispatch table.
480
 *
481
 * @param ncid Ignored.
482
 * @param varid Ignored.
483
 * @param endianness Ignored.
484
 *
485
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
486
 * @author Ed Hartnett
487
 */
488
int
489
NC_NOTNC4_def_var_endian(int ncid, int varid, int endianness)
490
0
{
491
0
    return NC_ENOTNC4;
492
0
}
493
494
/**
495
 * @internal Not implemented for a dispatch table.
496
 *
497
 * @param ncid Ignored.
498
 * @param varid Ignored.
499
 * @param par_access Ignored.
500
 *
501
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
502
 * @author Ed Hartnett, Dennis Heimbigner
503
 */
504
int
505
NC_NOTNC4_var_par_access(int ncid, int varid, int par_access)
506
0
{
507
0
    return NC_ENOTNC4;
508
0
}
509
510
/**
511
 * @internal Not implemented for a dispatch table.
512
 *
513
 * @param ncid Ignored.
514
 * @param name Ignored.
515
 * @param grp_ncid Ignored.
516
 *
517
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
518
 * @author Ed Hartnett
519
 */
520
int
521
NC_NOTNC4_inq_ncid(int ncid, const char *name, int *grp_ncid)
522
0
{
523
0
    return NC_ENOTNC4;
524
0
}
525
526
/**
527
 * @internal Not implemented for a dispatch table.
528
 *
529
 * @param ncid Ignored.
530
 * @param numgrps Ignored.
531
 * @param ncids Ignored.
532
 *
533
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
534
 * @author Ed Hartnett
535
 */
536
int
537
NC_NOTNC4_inq_grps(int ncid, int *numgrps, int *ncids)
538
0
{
539
0
    return NC_ENOTNC4;
540
0
}
541
542
/**
543
 * @internal Not implemented for a dispatch table.
544
 *
545
 * @param ncid Ignored.
546
 * @param name Ignored.
547
548
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
549
 * @author Ed Hartnett
550
 */
551
int
552
NC_NOTNC4_inq_grpname(int ncid, char *name)
553
0
{
554
0
    return NC_ENOTNC4;
555
0
}
556
557
/**
558
 * @internal Not implemented for a dispatch table.
559
 *
560
 * @param ncid Ignored.
561
 * @param lenp Ignored.
562
 * @param full_name Ignored.
563
 *
564
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
565
 * @author Ed Hartnett
566
 */
567
int
568
NC_NOTNC4_inq_grpname_full(int ncid, size_t *lenp, char *full_name)
569
0
{
570
0
    return NC_ENOTNC4;
571
0
}
572
573
/**
574
 * @internal Not implemented for a dispatch table.
575
 *
576
 * @param ncid Ignored.
577
 * @param parent_ncid Ignored.
578
 *
579
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
580
 * @author Ed Hartnett
581
 */
582
int
583
NC_NOTNC4_inq_grp_parent(int ncid, int *parent_ncid)
584
0
{
585
0
    return NC_ENOTNC4;
586
0
}
587
588
/**
589
 * @internal Not implemented for a dispatch table.
590
 *
591
 * @param ncid Ignored.
592
 * @param full_name Ignored.
593
 * @param grp_ncid Ignored.
594
 *
595
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
596
 * @author Ed Hartnett
597
 */
598
int
599
NC_NOTNC4_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid)
600
0
{
601
0
    return NC_ENOTNC4;
602
0
}
603
604
/**
605
 * @internal Not implemented for a dispatch table.
606
 *
607
 * @param ncid Ignored.
608
 * @param nvars Ignored.
609
 * @param varids Ignored.
610
 *
611
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
612
 * @author Ed Hartnett
613
 */
614
int
615
NC_NOTNC4_inq_varids(int ncid, int *nvars, int *varids)
616
0
{
617
0
    return NC_ENOTNC4;
618
0
}
619
620
/**
621
 * @internal Not implemented for a dispatch table.
622
 *
623
 * @param ncid Ignored.
624
 * @param ndims Ignored.
625
 * @param dimids Ignored.
626
 * @param include_parents Ignored.
627
 *
628
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
629
 * @author Ed Hartnett
630
 */
631
int
632
NC_NOTNC4_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents)
633
0
{
634
0
    return NC_ENOTNC4;
635
0
}
636
637
/**
638
 * @internal Not implemented for a dispatch table.
639
 *
640
 * @param ncid Ignored.
641
 * @param ntypes Ignored.
642
 * @param typeids Ignored.
643
 *
644
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
645
 * @author Ed Hartnett
646
 */
647
int
648
NC_NOTNC4_inq_typeids(int ncid, int *ntypes, int *typeids)
649
0
{
650
0
    return NC_ENOTNC4;
651
0
}
652
653
/**
654
 * @internal Not implemented for a dispatch table.
655
 *
656
 * @param ncid Ignored.
657
 * @param typeid1 Ignored.
658
 * @param name Ignored.
659
 * @param size Ignored.
660
 * @param base_nc_typep Ignored.
661
 * @param nfieldsp Ignored.
662
 * @param classp Ignored.
663
 *
664
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
665
 * @author Ed Hartnett
666
 */
667
int
668
NC_NOTNC4_inq_user_type(int ncid, nc_type typeid1, char *name, size_t *size,
669
                        nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
670
0
{
671
0
    return NC_ENOTNC4;
672
0
}
673
674
/**
675
 * @internal Get the id of a type from the name.
676
 *
677
 * @param ncid Ignored.
678
 * @param name Ignored.
679
 * @param typeidp Ignored.
680
 *
681
 * @return ::NC_ENOTNC4 Not implemented for a dispatch table.
682
 * @author Ed Hartnett
683
 */
684
int
685
NC_NOTNC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
686
0
{
687
    /* Note that this should actually work for atomic types */
688
0
    return NC_ENOTNC4;
689
0
}