OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_list.c versions 1.1 and 1.2
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc_list.c 1.1 -> 1.2

--- rc_list.c    2003/06/18 14:35:29     1.1
+++ rc_list.c    2003/06/27 14:26:13     1.2
@@ -138,6 +138,26 @@
 }
 
 /************************************************
+* listGetrcfile(rc_list_t *, const char *)      *
+* Searches the rcfile list and returns the file *
+* matching the given name                       *
+************************************************/
+rc_file_t *listGetrcfile(rc_list_t *pInst, const char *kszName)
+{
+    int nIter = 0;
+
+    assert(pInst && kszName); /* Dummy check */
+
+    /* Iterate through list, searching for a rcfile matching the given name */
+    for (nIter = 0; nIter < pInst->m_nFiles && \
+        strcmp(pInst->m_ppFilevec[nIter]->m_szName, kszName); nIter++);
+    if (nIter < pInst->m_nFiles)
+        return(pInst->m_ppFilevec[nIter]);  /* Name of rcfile in list matched */
+    else
+        return(NULL);                       /* Name did not match any rcfile  */
+}
+
+/************************************************
 * listDelete(rc_list_t *)                       *
 * Destruct a rcfile list                        *
 ************************************************/

CVSTrac 2.0.1