/* interface to Printer GURU */ #include #include #include #include #include "printer_fi.h" #include "printer_gi.h" #include "printer_smbncp-specific.h" #include "printer.m" #include "printer_printcap.h" /* returns all the filters available (filters' descriptions) */ /* does not empty drop_here, just adds new SSTRING there */ /* return code: number os filters returned */ int gi_return_filtersnames(SSTRINGS &drop_here) { char *list_filter; int total_items=0; char *current_item; if((list_filter=return_filters_list())){ current_item=list_filter; while(current_item){ drop_here.add(new SSTRING(current_item)); current_item=gimme_next_string(current_item); } free(list_filter); } return(total_items); } /* returns all the printers (queues) present in the system ex.: lp, lp2|blah, lp3|laserjet */ /* returns the total os printers present in the system */ /* the which_printer_v entries (present in other functions here) reflects THIS list */ int gi_return_printers_list(SSTRINGS &drop_here) { int total_items_added=0; int i=0; while(i once a printer was added you CAN'T count on the previous printers' list, you must reload it */ /* this function may open a window by its own if the my_fullspoolpath can't be created (already exists or there's some other problem) */ /* will save the configuration file automatically with the default values */ int gi_create_a_printer(char type_printr, char *printer_name, char *my_fullspoolpath) { return(return_virtual_printer_number(create_a_printer(type_printr, printer_name, my_fullspoolpath))); } /* remove (it's up to you to ask user for confirmation) */ /* will save configuration file automatically */ void gi_remove_printer(int which_printer_v) { int which_printer; which_printer=translate_printer_number(which_printer_v); remove_printer(which_printer); save_all_printers_data(); // save printcap } void gi_init(void) { kind_of_lpr_system_installed=return_lpr_system_installed_in_this_system(); load_printcap(); } void gi_close(void) { /* nothing currently */ }