Implement two printing related functions and start the remaining two.
authorRichard Sharpe <sharpe@samba.org>
Mon, 5 Feb 2001 13:02:20 +0000 (13:02 +0000)
committerRichard Sharpe <sharpe@samba.org>
Mon, 5 Feb 2001 13:02:20 +0000 (13:02 +0000)
(This used to be commit c19559a286c3ec6dedefbd2423aa5738edd9ba41)

source3/include/libsmbclient.h
source3/libsmb/libsmbclient.c

index a02c0e53179ad50890e4b17e5b3e09f8704ab28e..5469966cf8f1c15356f2cbc5e2d2c2da76025437 100644 (file)
@@ -195,7 +195,7 @@ int smbc_lseekdir(int fd, off_t offset, int whence);
  * Print a file given the name in fname. It would be a URL ...
  */
 
-int smbc_print_file(const char *fname);
+int smbc_print_file(const char *fname, const char *printq);
 
 /* 
  * Open a print file that can be written to by other calls. This simply
@@ -215,6 +215,6 @@ int smbc_list_print_jobs(const char *fname, void (*fn)(struct print_job_info *))
  * Delete a print job 
  */
 
-int smbc_unlink_print_job(int id);
+int smbc_unlink_print_job(const char *fname, int id);
 
 #endif
index feb0baaee39c784d0105db53bec8b3fa12cef0c0..68dbe666f7ba7225dc8a27fef3d86d3315a4daf0 100644 (file)
@@ -2138,6 +2138,20 @@ int smbc_fstatdir(int fd, struct stat *st)
 
   return 0;
 
+}
+
+/*
+ * Routine to print a file on a remote server ...
+ *
+ * We open the file, which we assume to be on a remote server, and then
+ * copy it to a print file on the share specified by printq.
+ */
+
+int smbc_print_file(const char *fname, const char *printq)
+{
+
+
+
 }
 
 /*
@@ -2189,3 +2203,52 @@ int smbc_list_print_jobs(const char *fname, void (*fn)(struct print_job_info *))
 
 }
 
+/*
+ * Delete a print job from a remote printer share
+ */
+
+int smbc_unlink_print_job(const char *fname, int id)
+{
+  struct smbc_server *srv;
+  fstring server, share, user, password;
+  pstring path;
+
+  if (!smbc_initialized) {
+
+    errno = EUCLEAN;
+    return -1;
+
+  }
+
+  if (!fname) {
+
+    errno = EINVAL;
+    return -1;
+
+  }
+  
+  DEBUG(4, ("smbc_unlink_print_job(%s)\n", fname));
+
+  smbc_parse_path(fname, server, share, path, user, password); /*FIXME, errors*/
+
+  if (user[0] == (char)0) pstrcpy(user, smbc_user);
+
+  srv = smbc_server(server, share, lp_workgroup(), user, password);
+
+  if (!srv) {
+
+    return -1;  /* errno set by smbc_server */
+
+  }
+
+  if (cli_printjob_del(&srv->cli, id) < 0) {
+
+    errno = smbc_errno(&srv->cli);
+    return -1;
+
+  }
+
+  return 0;
+
+}
+