-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9e206c
commit 82e1727
Showing
9 changed files
with
125 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#pragma once | ||
|
||
static void dir_fdw_end(ForeignScanState* f){ | ||
DirFdwExecState* e = f->fdw_state; | ||
switch(FreeDir(e->d)){ | ||
case 0: return; | ||
default: break; | ||
for(DirFdwExecState* e = f->fdw_state; NULL != e;){ | ||
for(DIR* d = e->d; NULL != d;){ | ||
switch(FreeDir(e->d)){ | ||
case 0: return; | ||
default: break; | ||
} | ||
elog(WARNING, "Unable to free dir."); | ||
break; | ||
} | ||
break; | ||
} | ||
elog(WARNING, "Unable to free dir."); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,6 @@ typedef struct DirFdwExecState { | |
const char* dirname; | ||
int fd; | ||
DIR* d; | ||
|
||
u8n d_type; | ||
} DirFdwExecState; |
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,34 @@ | ||
#pragma once | ||
|
||
typedef struct u8n { | ||
uint8_t value; | ||
bool is_null; | ||
} u8n; | ||
|
||
void u8n_foreach(const u8n* u, void* param, void cb(uint8_t,void*)){ | ||
switch(u->is_null){ | ||
case true: return; | ||
default: break; | ||
} | ||
cb(u->value, param); | ||
} | ||
|
||
u8n u8n_create(){ | ||
u8n u = {.value=0, .is_null=true}; | ||
return u; | ||
} | ||
|
||
void u8n_set(u8n* u, const uint8_t v){ | ||
u->value = v; | ||
u->is_null = false; | ||
} | ||
|
||
void u8n_datum(const u8n* u, Datum* v, bool* null){ | ||
switch(u->is_null){ | ||
case true: *null = true; break; | ||
default: | ||
*null = false; | ||
*v = UInt8GetDatum(u->value); | ||
break; | ||
} | ||
} |
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