mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
There are a number of cases in the oc code
where a procedure is defined to return int and really returns OCerror. This causes problems in AIX. Fixed those I could find.
This commit is contained in:
parent
fd523f4df3
commit
774428f2fd
@ -122,7 +122,7 @@ done:
|
||||
return cstat;
|
||||
}
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocset_proxy(OCstate* state)
|
||||
{
|
||||
CURLcode cstat;
|
||||
@ -154,7 +154,7 @@ ocset_proxy(OCstate* state)
|
||||
return OC_NOERR;
|
||||
}
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocset_ssl(OCstate* state)
|
||||
{
|
||||
CURLcode cstat = CURLE_OK;
|
||||
@ -213,7 +213,7 @@ fail:
|
||||
* used with global values read from the.dodsrc file. The reason is that
|
||||
* we may have multiple password sources.
|
||||
*/
|
||||
int
|
||||
OCerror
|
||||
ocset_user_password(OCstate* state)
|
||||
{
|
||||
CURLcode cstat;
|
||||
|
@ -9,10 +9,10 @@
|
||||
#define _CURLFUNCTION_H_
|
||||
|
||||
extern void oc_curl_protocols(struct OCGLOBALSTATE*);
|
||||
extern int ocset_curl_flags(OCstate*);
|
||||
extern int ocset_user_password(OCstate*);
|
||||
extern int ocset_proxy(OCstate*);
|
||||
extern int ocset_ssl(OCstate*);
|
||||
extern CURLcode ocset_curl_flags(OCstate*);
|
||||
extern OCerror ocset_user_password(OCstate*);
|
||||
extern OCerror ocset_proxy(OCstate*);
|
||||
extern OCerror ocset_ssl(OCstate*);
|
||||
extern void oc_curl_setup(OCstate* state);
|
||||
extern void oc_curl_debug(OCstate* state);
|
||||
extern void oc_curl_printerror(OCstate* state);
|
||||
|
@ -231,7 +231,7 @@ Note that start and count are linearized from the oc_data_read
|
||||
arguments.
|
||||
*/
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocdata_read(OCstate* state, OCdata* data, size_t start, size_t count,
|
||||
void* memory, size_t memsize)
|
||||
|
||||
|
@ -43,6 +43,6 @@ extern OCerror ocdata_recordcount(OCstate*, OCdata*, size_t*);
|
||||
extern OCerror ocdata_getroot(OCstate*, OCnode*, OCdata**);
|
||||
|
||||
/* Atomic leaf reading */
|
||||
extern int ocdata_read(OCstate*,OCdata*,size_t,size_t,void*,size_t);
|
||||
extern OCerror ocdata_read(OCstate*,OCdata*,size_t,size_t,void*,size_t);
|
||||
|
||||
#endif /*OCDATA_H*/
|
||||
|
@ -12,11 +12,11 @@ int ocdebug;
|
||||
|
||||
#ifdef OCCATCHERROR
|
||||
/* Place breakpoint here to catch errors close to where they occur*/
|
||||
int
|
||||
ocbreakpoint(int err) {return err;}
|
||||
OCerror
|
||||
ocbreakpoint(OCerror err) {return err;}
|
||||
|
||||
int
|
||||
octhrow(int err)
|
||||
OCerror
|
||||
octhrow(OCerror err)
|
||||
{
|
||||
if(err == 0) return err;
|
||||
return ocbreakpoint(err);
|
||||
|
@ -4,10 +4,14 @@
|
||||
#ifndef OCOCDBG_H
|
||||
#define OCOCDBG_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#include "oc.h"
|
||||
|
||||
#ifndef OCDEBUG
|
||||
#undef OCDEBUG
|
||||
#endif
|
||||
@ -75,8 +79,8 @@ extern void ocfree(void*);
|
||||
#define MEMGOTO(var,label) {if((var)==NULL) goto label;}
|
||||
|
||||
#ifdef OCCATCHERROR
|
||||
extern int ocbreakpoint(int err);
|
||||
extern int octhrow(int err);
|
||||
extern OCerror ocbreakpoint(OCerror err);
|
||||
extern OCerror octhrow(OCerror err);
|
||||
/* Place breakpoint on ocbreakpoint to catch errors close to where they occur*/
|
||||
#define OCTHROW(e) octhrow(e)
|
||||
#define OCTHROWCHK(e) (void)octhrow(e)
|
||||
|
@ -35,7 +35,7 @@ ocfetchhttpcode(CURL* curl)
|
||||
return httpcode;
|
||||
}
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocfetchurl_file(CURL* curl, const char* url, FILE* stream,
|
||||
off_t* sizep, long* filetime)
|
||||
{
|
||||
@ -259,7 +259,7 @@ encodeurltext(char* text, OCbytes* buf)
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
OCerror
|
||||
occurlopen(CURL** curlp)
|
||||
{
|
||||
int stat = OC_NOERR;
|
||||
@ -286,7 +286,7 @@ occurlclose(CURL* curl)
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocfetchlastmodified(CURL* curl, char* url, long* filetime)
|
||||
{
|
||||
int stat = OC_NOERR;
|
||||
@ -318,7 +318,7 @@ fail:
|
||||
return OCTHROW(OC_ECURL);
|
||||
}
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocping(const char* url)
|
||||
{
|
||||
int stat = OC_NOERR;
|
||||
|
13
oc2/ochttp.h
13
oc2/ochttp.h
@ -4,19 +4,16 @@
|
||||
#ifndef HTTP_H
|
||||
#define HTTP_H 1
|
||||
|
||||
extern int curlopen(CURL** curlp);
|
||||
extern void curlclose(CURL*);
|
||||
|
||||
extern int ocfetchurl(CURL*, const char*, OCbytes*, long*, struct OCcredentials*);
|
||||
extern int ocfetchurl_file(CURL*, const char*, FILE*, off_t*, long*);
|
||||
extern OCerror ocfetchurl(CURL*, const char*, OCbytes*, long*, struct OCcredentials*);
|
||||
extern OCerror ocfetchurl_file(CURL*, const char*, FILE*, off_t*, long*);
|
||||
|
||||
extern long ocfetchhttpcode(CURL* curl);
|
||||
|
||||
extern int ocfetchlastmodified(CURL* curl, char* url, long* filetime);
|
||||
extern OCerror ocfetchlastmodified(CURL* curl, char* url, long* filetime);
|
||||
|
||||
extern int occurlopen(CURL** curlp);
|
||||
extern OCerror occurlopen(CURL** curlp);
|
||||
extern void occurlclose(CURL* curlp);
|
||||
|
||||
extern int ocping(const char* url);
|
||||
extern OCerror ocping(const char* url);
|
||||
|
||||
#endif /*HTTP_H*/
|
||||
|
@ -46,7 +46,7 @@ static char* constraintescape(const char* url);
|
||||
static OCerror createtempfile(OCstate*,OCtree*);
|
||||
static int dataError(XXDR* xdrs, OCstate*);
|
||||
|
||||
static int ocsetcurlproperties(OCstate*);
|
||||
static OCerror ocsetcurlproperties(OCstate*);
|
||||
|
||||
extern OCnode* makeunlimiteddimension(void);
|
||||
|
||||
@ -65,7 +65,7 @@ extern OCnode* makeunlimiteddimension(void);
|
||||
/* Collect global state info in one place */
|
||||
struct OCGLOBALSTATE ocglobalstate;
|
||||
|
||||
int
|
||||
OCerror
|
||||
ocinternalinitialize(void)
|
||||
{
|
||||
int stat = OC_NOERR;
|
||||
@ -561,7 +561,7 @@ ocupdatelastmodifieddata(OCstate* state)
|
||||
/*
|
||||
Set curl properties for link based on rc files etc.
|
||||
*/
|
||||
static int
|
||||
static OCerror
|
||||
ocsetcurlproperties(OCstate* state)
|
||||
{
|
||||
CURLcode cstat = CURLE_OK;
|
||||
|
@ -206,12 +206,11 @@ extern void occlose(OCstate* state);
|
||||
extern OCerror ocfetch(OCstate*, const char*, OCdxd, OCflags, OCnode**);
|
||||
extern int oc_network_order;
|
||||
extern int oc_invert_xdr_double;
|
||||
extern int ocinternalinitialize(void);
|
||||
|
||||
extern OCerror ocinternalinitialize(void);
|
||||
|
||||
extern OCerror ocupdatelastmodifieddata(OCstate* state);
|
||||
|
||||
extern int ocinternalinitialize(void);
|
||||
|
||||
extern OCerror ocsetuseragent(OCstate* state, const char* agent);
|
||||
|
||||
#endif /*COMMON_H*/
|
||||
|
@ -82,6 +82,6 @@ extern void ocroot_free(OCnode* root);
|
||||
extern void ocnodes_free(OClist*);
|
||||
|
||||
/* Merge DAS with DDS or DATADDS*/
|
||||
extern int ocddsdasmerge(struct OCstate*, OCnode* das, OCnode* dds);
|
||||
extern OCerror ocddsdasmerge(struct OCstate*, OCnode* das, OCnode* dds);
|
||||
|
||||
#endif /*OCNODE_H*/
|
||||
|
@ -47,7 +47,7 @@ occredentials_in_url(const char *url)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static OCerror
|
||||
ocextract_credentials(const char *url, char **name, char **pw, char **result_url)
|
||||
{
|
||||
char *pos;
|
||||
@ -295,7 +295,7 @@ ocdodsrc_read(char* basename, char* path)
|
||||
in_file = fopen(path, "r"); /* Open the file to read it */
|
||||
if (in_file == NULL) {
|
||||
oclog(OCLOGERR, "Could not open configuration file: %s",basename);
|
||||
return OC_EPERM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user