rev 279 - trunk/modules/File

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-04-04 15:47:46 -0400 (Sun, 04 Apr 2004)
New Revision: 279

Modified:
   trunk/modules/File/File.c
Log:
fixed File.__init__() to match new __init__() rules

Modified: trunk/modules/File/File.c
===================================================================
--- trunk/modules/File/File.c	2004-04-04 18:59:36 UTC (rev 278)
+++ trunk/modules/File/File.c	2004-04-04 19:47:46 UTC (rev 279)
@@ -81,19 +81,16 @@
 MODULE_DECLARE(Dir);
 
 
-static obj_p new_file_object(obj_p filename, obj_p mode,
+static void set_file_obj(obj_p file_obj, obj_p filename, obj_p mode,
 			     apr_file_t *fp, int bufsize,
 			     apr_int32_t flags)
 {
-	obj_p file_obj = new_object(File_OBJ);
 	apr_pool_t *subpool = apr_file_pool_get(fp);
 	pr_file_p filep;
 
-	file_obj = new_object(File_OBJ);
 	set_attr(ist, file_obj, sym(ist, "name"), filename);
 	set_attr(ist, file_obj, sym(ist, "mode"), mode);
 
-	file_obj->data_type = OBJ_TYPE_DATAPTR;
 	filep = pr_malloc(sizeof(*filep));
 
 	if (bufsize < MIN_BUFSIZE)
@@ -105,7 +102,17 @@
 	filep->flags = flags;
 	file_obj->data_type = OBJ_TYPE_DATAPTR;
 	file_obj->data.ptr  = filep;
+}
 
+
+static obj_p new_file_object(obj_p filename, obj_p mode,
+			     apr_file_t *fp, int bufsize,
+			     apr_int32_t flags)
+{
+	obj_p file_obj;
+
+	file_obj = new_object(File_OBJ);
+	set_file_obj(file_obj, filename, mode, fp, bufsize, flags);
 	return file_obj;
 }
 
@@ -178,8 +185,8 @@
 		apr_pool_destroy(subpool);
 		return NULL;
 	}
-
-	return new_file_object(parms[1], parms[3], f, (int)(parms[5]->data.i64), flags);
+	set_file_obj(self, parms[1], parms[3], f, (int)(parms[5]->data.i64), flags);
+	return NULL;
 }
 
 DEF(File, __objlist__, FORM_RPARAM) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.