ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src util.c,1.34,1.35 util.h,1.19,1.20


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src util.c,1.34,1.35 util.h,1.19,1.20
Date: Wed, 29 Jan 2003 10:36:01 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv30831/src

Modified Files:
        util.c util.h 
Log Message:
dd group_mgmt_check_moved() so the modules can know
whether they shouldn't locally re-add a deleted group



Index: util.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- util.c      29 Jan 2003 14:55:41 -0000      1.34
+++ util.c      29 Jan 2003 15:35:59 -0000      1.35
@@ -879,7 +879,9 @@
 void add_group( char * name )
 {
        LList *node = NULL;
-       grouplist *eg = calloc(1, sizeof(grouplist));
+       grouplist *eg;
+       
+       eg = calloc(1, sizeof(grouplist));
        strncpy(eg->name, name, sizeof(eg->name));
 
        groups = l_list_append( groups, eg );
@@ -1520,6 +1522,33 @@
        return 0;
 }
 
+int group_mgmt_check_moved(char *groupname) {
+       FILE *queue, *temp;
+       char buff[NAME_MAX], queue_name[NAME_MAX], temp_name[NAME_MAX];
+       g_snprintf(queue_name, NAME_MAX, "%s%cgroup_actions_queue", 
+                               config_dir, 
+                               G_DIR_SEPARATOR);
+       
+       queue = fopen(queue_name, "r");
+       if (!queue)
+               return 0;
+
+       while( fgets(buff, sizeof(buff), queue)  != NULL )
+       {               
+               char *str      = strtok( buff, "\t" );
+               int action     = atoi(strtok(NULL,"\t"));
+               char *oldgroup = strtok(NULL,"\t");
+               char *newgroup = strtok(NULL,"\n");
+                       
+               if (!strcmp(oldgroup, groupname)) {
+                       fclose(queue);
+                       return 1;
+               }
+       }
+       
+       fclose (queue);
+       return 0;
+}
 
 int group_mgmt_flush(eb_local_account *ela)
 {

Index: util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- util.h      29 Jan 2003 14:55:41 -0000      1.19
+++ util.h      29 Jan 2003 15:35:59 -0000      1.20
@@ -135,6 +135,7 @@
 int contact_mgmt_flush(eb_local_account *ela);
 void group_mgmt_queue_add(eb_local_account *ela, char *old_group, int action, 
char *new_group);
 int group_mgmt_flush(eb_local_account *ela);
+int group_mgmt_check_moved(char *groupname);
 void rename_nick_log(char *oldgroup, char *oldnick, char *newgroup, char 
*newnick);
 
 GList * llist_to_glist(LList * l, int free_old);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]