From 54de56a1be8ede7476c741cd1631ad1ac8107fcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Apr 2000 06:22:31 +0000 Subject: the changes to the main smb code ------------ 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 d870542c2884510bd45fd5b54ff2157434d53f4c) --- source3/smbd/reply.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index b280b07f7c..e998e1741c 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -393,6 +393,7 @@ int reply_ioctl(connection_struct *conn, uint32 ioctl_code = (device << 16) + function; int replysize, outsize; char *p; + files_struct *fsp = file_fsp(inbuf,smb_vwv0); DEBUG(4, ("Received IOCTL (code 0x%x)\n", ioctl_code)); @@ -413,8 +414,8 @@ int reply_ioctl(connection_struct *conn, switch (ioctl_code) { - case IOCTL_QUERY_JOB_INFO: - SSVAL(p,0,1); /* Job number */ + case IOCTL_QUERY_JOB_INFO: + SSVAL(p,0,fsp->print_jobid); /* Job number */ StrnCpy(p+2, global_myname, 15); /* Our NetBIOS name */ StrnCpy(p+18, lp_servicename(SNUM(conn)), 13); /* Service name */ break; @@ -3029,7 +3030,7 @@ int reply_printopen(connection_struct *conn, return(ERROR(ERRSRV,ERRnofids)); /* Open for exclusive use, write only. */ - print_open_file(fsp,conn,"dos.prn"); + print_fsp_open(fsp,conn,"dos.prn"); if (!fsp->open) { file_free(fsp); @@ -3104,7 +3105,7 @@ int reply_printqueue(connection_struct *conn, { print_queue_struct *queue = NULL; char *p = smb_buf(outbuf) + 3; - int count = get_printqueue(SNUM(conn), conn,&queue,NULL); + int count = print_queue_status(SNUM(conn), &queue,NULL); int num_to_get = ABS(max_count); int first = (max_count>0?start_index:start_index+max_count+1); int i; @@ -3118,8 +3119,7 @@ int reply_printqueue(connection_struct *conn, for (i=first;i