Changeset 1067


Ignore:
Timestamp:
31/05/06 09:43:01 (13 years ago)
Author:
spascoe
Message:

Moved the python bbftpd extension module source code to it's own file.

Location:
TI05-delivery/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/setup.py

    r1064 r1067  
    3838    ] 
    3939 
     40sources = ['%s/bbftpd/%s' % (bbftpd_home, x) for x in bbftpd_src] + ['./src/python_ext/bbftpd.c'] 
     41 
    4042bbftpd = Extension('bbftpd', 
    4143                   define_macros = [('NDG_AUTH', 1), ('LOCAL_SYSLOG_FACILITY', 1), 
     
    4446                   include_dirs = [bbftpd_home+'/includes', bbftpd_home+'/bbftpd'], 
    4547                   libraries = ['crypt', 'crypto'], 
    46                    sources = ['%s/bbftpd/%s' % (bbftpd_home, x) for x in bbftpd_src]) 
     48                   sources = sources) 
    4749 
    4850setup(name = 'bbftp-python', 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd.c

    r1065 r1067  
    117117#endif 
    118118 
    119 #ifdef NDG_PYTHON_EMBED 
    120 #include <Python.h> 
    121 extern char **environ; 
    122  
    123 #endif // NDG_PYTHON_EMBED 
    124  
    125119/* 
    126120** Common variables for BBFTP protocole version 1 and 2 
     
    391385 
    392386#ifdef NDG_PYTHON_EMBED 
    393 bbftpd_main (argc, argv, envp) 
     387int bbftpd_main (argc, argv, envp) 
    394388#else 
    395389main (argc,argv,envp) 
     
    14101404#endif 
    14111405 
    1412 #ifdef NDG_PYTHON_EMBED 
    1413 /* 
    1414   When embedding in python main is replaced by a simple python function call. 
    1415 */ 
    1416 static PyObject *bbftpd_run(PyObject *self, PyObject *args) { 
    1417   int argc, i; 
    1418   char **argv, **arg_p; 
    1419   int pid; 
    1420  
    1421   /* 
    1422    * Convert arguments into a standard argv sequence. 
    1423    */ 
    1424   argc = PyTuple_GET_SIZE(args); 
    1425   if ((argv = (char*)malloc(argc*sizeof(char*))) == NULL) { 
    1426     PyErr_SetString(PyExc_MemoryError, "malloc failed"); 
    1427     return NULL; 
    1428   } 
    1429  
    1430   arg_p = argv; 
    1431   for (i==0; i<argc; i++) { 
    1432     if ((*arg_p = PyString_AsString(PyTuple_GET_ITEM(args, i))) == NULL) { 
    1433       free(argv); 
    1434       return NULL; 
    1435     } 
    1436     arg_p++; 
    1437   } 
    1438  
    1439   pid = bbftpd_main(argc, argv, environ); 
    1440  
    1441   free(argv); 
    1442   return Py_BuildValue("i", pid); 
    1443 } 
    1444  
    1445 static PyMethodDef BbftpdMethods[] = { 
    1446   {"run", bbftpd_run, METH_VARARGS, "Execute the bbftpd server.  Returns the PID of the server process"}, 
    1447   {NULL, NULL, 0, NULL} 
    1448 }; 
    1449  
    1450 PyMODINIT_FUNC initbbftpd(void) { 
    1451   (void) Py_InitModule("bbftpd", BbftpdMethods); 
    1452 } 
    1453  
    1454 #endif // NDG_PYTHON_EMBED 
Note: See TracChangeset for help on using the changeset viewer.