Refactor name of public functions defined for file_fdw to have
authorShigeru Hanada <[email protected]>
Fri, 19 Nov 2010 14:13:34 +0000 (23:13 +0900)
committerShigeru Hanada <[email protected]>
Fri, 19 Nov 2010 14:13:34 +0000 (23:13 +0900)
common prefix "FileState".

src/backend/foreign/file_fdw.c
src/backend/foreign/file_parser.c
src/backend/foreign/file_parser.h

index e66e89dfec1ea28da65eb5eaa85c1d460fd8e64e..43e3206a9cfb7ac621eee03768de266ce541ae27 100644 (file)
@@ -303,7 +303,7 @@ fileBeginScan(ForeignScanState *scanstate)
    }
 
    /* create FileState and set default settings */
-   fstate = MakeFileState(scanstate->ss.ss_currentRelation, options);
+   fstate = FileStateCreate(scanstate->ss.ss_currentRelation, options);
 
    /* pack file information into reply and pass it to subsequent functions */
    scanstate->reply = (FdwReply *) fstate;
@@ -325,7 +325,7 @@ fileIterate(ForeignScanState *scanstate)
         FileStateGetFilename(fstate));
 
    /* get next tuple from the file */
-   tuple = GetNextTuple(fstate, CurrentMemoryContext);
+   tuple = FileStateGetNext(fstate, CurrentMemoryContext);
 
    /*
     * If next tuple has been found, store it into the slot.  Otherwise,
@@ -349,7 +349,7 @@ fileClose(ForeignScanState *scanstate)
 
    elog(DEBUG3, "%s called", __FUNCTION__);
 
-   FreeFileState(fstate);
+   FileStateFree(fstate);
 }
 
 /*
@@ -364,7 +364,7 @@ fileReOpen(ForeignScanState *scanstate)
         __FUNCTION__,
         FileStateGetFilename(fstate));
 
-   ResetFileState(fstate);
+   FileStateReset(fstate);
 }
 
 /*
index 4cabc08c8dd7f619448b98d2b29e2b6181a7fe4b..f90c29b26a774280b8e61b035571b619c0f73657 100644 (file)
@@ -106,7 +106,7 @@ typedef struct FileStateData
 
    /*
     * These variables are used to reduce overhead of memory allocation in the
-    * loop over GetNextTuple().
+    * loop over FileStateGetNext().
     */
    Datum      *values;
    bool       *nulls;
@@ -285,10 +285,10 @@ FileLoadRawBuf(FileState fstate)
 
 
 /*
- * MakeFileState() makes a FileState for a foreign scan on the relation rel.
+ * FileStateCreate() makes a FileState for a foreign scan on the relation rel.
  */
 FileState
-MakeFileState(Relation rel, List *options)
+FileStateCreate(Relation rel, List *options)
 {
    FileState   fstate;
    bool        format_specified = false;
@@ -642,7 +642,7 @@ MakeFileState(Relation rel, List *options)
 
 
 void
-FreeFileState(FileState fstate)
+FileStateFree(FileState fstate)
 {
    if (fstate == NULL)
        return;
@@ -771,7 +771,7 @@ limit_printout_length(const char *str)
  * Read a record from the file and generate HeapTuple.
  */
 HeapTuple
-GetNextTuple(FileState fstate, MemoryContext tupleContext)
+FileStateGetNext(FileState fstate, MemoryContext tupleContext)
 {
    HeapTuple   tuple = NULL;
    TupleDesc   tupDesc = RelationGetDescr(fstate->rel);
@@ -1875,7 +1875,7 @@ FileGetAttnums(TupleDesc tupDesc, Relation rel, List *attnamelist)
 }
 
 void
-ResetFileState(FileState fstate)
+FileStateReset(FileState fstate)
 {
    /* If the file has not been opened, it is virtually reseted already. */
    if (fstate->file == NULL)
index a12f24a930db2f703dd7c24ffe242e5267074b41..665f74765b0dcbce468640f42918c5250a91c448 100644 (file)
@@ -18,10 +18,10 @@ typedef struct FileStateData *FileState;
 /*
  *
  */
-FileState MakeFileState(Relation rel, List *options);
-HeapTuple GetNextTuple(FileState cstate, MemoryContext tupleContext);
-void ResetFileState(FileState cstate);
-void FreeFileState(FileState cstate);
+FileState FileStateCreate(Relation rel, List *options);
+HeapTuple FileStateGetNext(FileState cstate, MemoryContext tupleContext);
+void FileStateReset(FileState cstate);
+void FileStateFree(FileState cstate);
 
 /*
  * FileState access methods