summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-16 06:18:39 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-16 06:18:39 +0000
commit837887ffd6a82616a5388cb3536c9c1283464ee0 (patch)
tree55448ec18bc294c42ab1dd323ad68c032d2bc0c7
parent4a12fb79c0498c3094c4e744483925fd802cf171 (diff)
downloadsamba-837887ffd6a82616a5388cb3536c9c1283464ee0.tar.gz
samba-837887ffd6a82616a5388cb3536c9c1283464ee0.tar.bz2
samba-837887ffd6a82616a5388cb3536c9c1283464ee0.zip
the fsp needs a jobid in it now
------------ The following series of commits are for the new tdb based printing backend. This completely replaces our old printing backend. Major changes include: - all print ops are now done in printing/*.c rather than scattered all over the place - system job ids are decoupled from SMB job ids - the lpq parsers don't need to be nearly so smart, they only need to parse the filename, the status and system job id - we can store lots more info about a job, including the full job name - the queue cache control is much better I also added a new utility routine file_lines_load() that loads a text file and parses it into lines. This is used in out lpq parsing and I also want to use it to replace all of our fgets() based code in other places. (This used to be commit 4973b7e276ca75dcb63ccb54687d17f87aede7c1)
-rw-r--r--source3/include/proto.h43
-rw-r--r--source3/include/smb.h5
2 files changed, 34 insertions, 14 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e30d24b81b..94afe21749 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -316,6 +316,7 @@ BOOL zero_ip(struct in_addr ip);
void standard_sub_basic(char *str);
void standard_sub_advanced(int snum, char *user, char *connectpath, gid_t gid, char *str);
void standard_sub(connection_struct *conn, char *str);
+void standard_sub_snum(int snum, char *str);
BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
struct hostent *Get_Hostbyname(const char *name);
BOOL process_exists(pid_t pid);
@@ -377,6 +378,8 @@ SMB_BIG_UINT getfilepwpos(void *vp);
BOOL setfilepwpos(void *vp, SMB_BIG_UINT tok);
int getfileline(void *vp, char *linebuf, int linebuf_size);
char *fgets_slash(char *s2,int maxlen,FILE *f);
+char **file_lines_load(char *fname, int *numlines);
+void file_lines_free(char **lines);
/*The following definitions come from lib/util_sec.c */
@@ -1517,6 +1520,10 @@ BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_t
BOOL set_trust_account_password( unsigned char *md4_new_pwd);
BOOL trust_get_passwd( unsigned char trust_passwd[16], char *domain, char *myname);
+/*The following definitions come from printing/load.c */
+
+void load_printers(void);
+
/*The following definitions come from printing/lpq_parse.c */
BOOL parse_lpq_entry(int snum,char *line,
@@ -1564,18 +1571,28 @@ int sysv_printername_ok(char *name);
/*The following definitions come from printing/printing.c */
-void lpq_reset(int snum);
-void print_file(connection_struct *conn, files_struct *file);
-int get_printqueue(int snum,
- connection_struct *conn,print_queue_struct **queue,
- print_status_struct *status);
-void del_printqueue(connection_struct *conn,int snum,int jobid);
-void status_printjob(connection_struct *conn,int snum,int jobid,int status);
-int printjob_encode(int snum, int job);
-void printjob_decode(int jobid, int *snum, int *job);
-void status_printqueue(connection_struct *conn,int snum,int status);
-void load_printers(void);
-void print_open_file(files_struct *fsp,connection_struct *conn,char *fname);
+BOOL print_backend_init(void);
+BOOL print_job_exists(int jobid);
+int print_job_snum(int jobid);
+int print_job_fd(int jobid);
+char *print_job_fname(int jobid);
+BOOL print_job_set_place(int jobid, int place);
+BOOL print_job_set_name(int jobid, char *name);
+BOOL print_job_delete(int jobid);
+BOOL print_job_pause(int jobid);
+BOOL print_job_resume(int jobid);
+int print_job_write(int jobid, const char *buf, int size);
+int print_job_start(int snum, char *jobname);
+BOOL print_job_end(int jobid);
+int print_queue_status(int snum,
+ print_queue_struct **queue,
+ print_status_struct *status);
+int print_queue_snum(char *qname);
+BOOL print_queue_pause(int snum);
+BOOL print_queue_resume(int snum);
+BOOL print_queue_purge(int snum);
+void print_fsp_open(files_struct *fsp,connection_struct *conn,char *jobname);
+void print_fsp_end(files_struct *fsp);
/*The following definitions come from profile/profile.c */
@@ -3383,6 +3400,8 @@ int tdb_writelock(TDB_CONTEXT *tdb);
int tdb_writeunlock(TDB_CONTEXT *tdb);
int tdb_lockchain(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_unlockchain(TDB_CONTEXT *tdb, TDB_DATA key);
+int tdb_get_int(TDB_CONTEXT *tdb, char *keystr);
+int tdb_store_int(TDB_CONTEXT *tdb, char *keystr, int v);
/*The following definitions come from utils/nbio.c */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index d8653538df..b8cd415ef9 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -474,6 +474,7 @@ typedef struct files_struct
int fnum;
struct connection_struct *conn;
int fd;
+ int print_jobid;
SMB_DEV_T dev;
SMB_INO_T inode;
BOOL delete_on_close;
@@ -633,8 +634,8 @@ typedef struct _print_queue_struct
int status;
int priority;
time_t time;
- char user[30];
- char file[100];
+ fstring user;
+ fstring file;
} print_queue_struct;
enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};