-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creat PR to support refactor of code.
re: PR #3068 Affects files: * libdispatch/ncutil.[ch] * libdispatch/drc.c * include/ncutil.h * include/ncrc.h * include/netcdf_vutils.h plus any files that use the above modified .h files. Part of splitting PR 3068 1. move libdispatch/ncutil.h to include/netcdf_vutils.h and rename uses. 2. Refactor code to move and unify various functions from libdispatch/drc.c into ncutil.h and ncutil.c. 3. Modify file includes to use ncutil.h.
- Loading branch information
1 parent
d19fca6
commit 01fe8d8
Showing
27 changed files
with
265 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata | ||
See COPYRIGHT for license information. | ||
*/ | ||
|
||
/** | ||
API for libdispatch/dutil.c | ||
*/ | ||
|
||
#ifndef NCUTIL_H | ||
#define NCUTIL_H | ||
|
||
/**************************************************/ | ||
|
||
/* signature: void swapinline16(void* ip) */ | ||
#define swapinline16(ip) \ | ||
{ \ | ||
char b[2]; \ | ||
char* src = (char*)(ip); \ | ||
b[0] = src[1]; \ | ||
b[1] = src[0]; \ | ||
memcpy(ip, b, 2); \ | ||
} | ||
|
||
/* signature: void swapinline32(void* ip) */ | ||
#define swapinline32(ip) \ | ||
{ \ | ||
char b[4]; \ | ||
char* src = (char*)(ip); \ | ||
b[0] = src[3]; \ | ||
b[1] = src[2]; \ | ||
b[2] = src[1]; \ | ||
b[3] = src[0]; \ | ||
memcpy(ip, b, 4); \ | ||
} | ||
|
||
/* signature: void swapinline64(void* ip) */ | ||
#define swapinline64(ip) \ | ||
{ \ | ||
char b[8]; \ | ||
char* src = (char*)(ip); \ | ||
b[0] = src[7]; \ | ||
b[1] = src[6]; \ | ||
b[2] = src[5]; \ | ||
b[3] = src[4]; \ | ||
b[4] = src[3]; \ | ||
b[5] = src[2]; \ | ||
b[6] = src[1]; \ | ||
b[7] = src[0]; \ | ||
memcpy(ip, b, 8); \ | ||
} | ||
|
||
/**************************************************/ | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
/* Opaque */ | ||
struct NClist; | ||
struct NCbytes; | ||
struct NCURI; | ||
|
||
EXTERNL int NC__testurl(const char* path, char** basenamep); | ||
EXTERNL int NC_isLittleEndian(void); | ||
EXTERNL char* NC_backslashEscape(const char* s); | ||
EXTERNL char* NC_backslashUnescape(const char* esc); | ||
EXTERNL char* NC_entityescape(const char* s); | ||
EXTERNL char* NC_shellUnescape(const char* esc); | ||
EXTERNL int NC_mktmp(const char* base, char** tmpfile); | ||
EXTERNL int NC_readfile(const char* filename, struct NCbytes* content); | ||
EXTERNL int NC_readfilen(const char* filename, struct NCbytes* content, long long amount); | ||
EXTERNL int NC_readfileF(FILE* stream, struct NCbytes* content, long long amount); | ||
EXTERNL int NC_writefile(const char* filename, size_t size, void* content); | ||
EXTERNL int NC_getmodelist(const char* modestr, struct NClist** modelistp); | ||
EXTERNL int NC_testpathmode(const char* path, const char* tag); | ||
EXTERNL int NC_testmode(struct NCURI* uri, const char* tag); | ||
EXTERNL int NC_addmodetag(struct NCURI* uri, const char* tag); | ||
EXTERNL int NC_isinf(double x); | ||
EXTERNL int NC_isnan(double x); | ||
EXTERNL int NC_split_delim(const char* arg, char delim, struct NClist* segments); | ||
EXTERNL int NC_join(struct NClist* segments, char** pathp); | ||
EXTERNL int NC_joinwith(struct NClist* segments, const char* sep, const char* prefix, const char* suffix, char** pathp); | ||
EXTERNL void NC_sortenvv(size_t n, char** envv); | ||
EXTERNL void NC_sortlist(struct NClist* l); | ||
EXTERNL void NC_freeenvv(size_t nkeys, char** keys); | ||
EXTERNL int NC_swapatomicdata(size_t datalen, void* data, int typesize); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif /*NCUTIL_H*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.