CCL commands stop/continue implemented. New functions gw_res_{int,bool}
[egate.git] / kernel / persist.c
index 6e4e174..176b17f 100644 (file)
@@ -2,7 +2,11 @@
  * Europagate, 1995
  *
  * $Log: persist.c,v $
- * Revision 1.5  1995/05/02 15:26:00  adam
+ * Revision 1.6  1995/05/03 07:37:44  adam
+ * CCL commands stop/continue implemented. New functions gw_res_{int,bool}
+ * are used when possible.
+ *
+ * Revision 1.5  1995/05/02  15:26:00  adam
  * Monitor observes death of child (email kernel). The number
  * of simultanous processes is controlled now. Email requests are
  * queued if necessary. This scheme should only be forced if no kernels
@@ -238,6 +242,10 @@ int load_p_state (int userid)
         return -1;
     if (sscanf (fline, "%d", &info.setno) != 1)
         return -1;
+    if (!fgetsx (fline, 1024, inf))
+        return -1;
+    if (sscanf (fline, "%d", &info.next_position) != 1)
+        return -1;
     gw_log (GW_LOG_DEBUG, KERNEL_LOG, 
            "Reading persistence file %s (2)", fname);
 #if 0
@@ -328,9 +336,18 @@ int save_p_state (int userid)
         return -1;
     }
     gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Writing persistence file %s", fname);
-    fprintf (of, "%s\n%s\n%s\n%d\n", info.target, info.account,
-             info.database, info.setno);
+    fprintf (of, "%s\n%s\n%s\n%d\n%d\n", info.target, info.account,
+             info.database, info.setno, info.next_position);
     save_sets (of, info.sets);
     fclose (of);
     return 0;
 }
+
+void del_p_state (int userid)
+{
+    char fname[128];
+
+    sprintf (fname, "persist.%d", userid);
+    unlink (fname);
+}
+