void fillit(int x, int y, int bcolor, int color) { graph[x][y]=color; //drawpixel(x,y); if(graph[x+1][y]==bcolor && x+1<maxx) fillit(x+1,y,bcolor,color); if(graph[x-1][y]==bcolor && x-1>=0) fillit(x-1,y,bcolor,color); if(graph[x][y+1]==bcolor && y+1<maxy) fillit(x,y+1,bcolor,color); if(graph[x][y-1]==bcolor && y-1>=0) fillit(x,y-1,bcolor,color); }
/* Display the contents of cache. */ static int show_ccache(krb5_ccache cache) { krb5_cc_cursor cur; krb5_creds creds; krb5_principal princ; krb5_error_code ret; ret = krb5_cc_get_principal(context, cache, &princ); if (ret) { com_err(progname, ret, ""); return 1; } ret = krb5_unparse_name(context, princ, &defname); if (ret) { com_err(progname, ret, _("while unparsing principal name")); return 1; } printf(_("Ticket cache: %s:%s\nDefault principal: %s\n\n"), krb5_cc_get_type(context, cache), krb5_cc_get_name(context, cache), defname); /* XXX Translating would disturb table alignment; skip for now. */ fputs("Valid starting", stdout); fillit(stdout, timestamp_width - sizeof("Valid starting") + 3, (int) ' '); fputs("Expires", stdout); fillit(stdout, timestamp_width - sizeof("Expires") + 3, (int) ' '); fputs("Service principal\n", stdout); ret = krb5_cc_start_seq_get(context, cache, &cur); if (ret) { com_err(progname, ret, _("while starting to retrieve tickets")); return 1; } while ((ret = krb5_cc_next_cred(context, cache, &cur, &creds)) == 0) { if (show_config || !krb5_is_config_principal(context, creds.server)) show_credential(&creds); krb5_free_cred_contents(context, &creds); } krb5_free_principal(context, princ); krb5_free_unparsed_name(context, defname); defname = NULL; if (ret == KRB5_CC_END) { ret = krb5_cc_end_seq_get(context, cache, &cur); if (ret) { com_err(progname, ret, _("while finishing ticket retrieval")); return 1; } return 0; } else { com_err(progname, ret, _("while retrieving a ticket")); return 1; } }
void fillit(int x,int y) { if(x>1 && x<640 && y>1 && y<480) { putpixel(x,y,1); if(getpixel(x-1,y)==thiscolor) fillit(x-1,y); if(getpixel(x+1,y)==thiscolor) fillit(x+1,y); if(getpixel(x,y-1)==thiscolor) fillit(x,y-1); if(getpixel(x,y+1)==thiscolor) fillit(x,y+1); } else return; }
int main(int ac, char **av) { int fd; char **tab; int size; t_tetri *tet; fd = 0; tet = tetri_new('A'); if (ac != 2) print_error(); fd = open(av[1], O_RDONLY); (fd == -1) ? print_error() : 0; init_shape(tet, fd); if (!file_valide(tet)) print_error(); size = ft_sqrt(tetri_count(tet) * 4); tab = create_double_tab(size, '.'); while (fillit(tab, size, tet) == 0) { free_double_tab(&tab, size); size++; tab = create_double_tab(size, '.'); } end_fillit(&tab, size, fd, tet); return (0); }
int fillit(t_figures *lst, char **map, int max_map) { int i; int j; i = 0; if (!lst) return (1); while (i < max_map) { j = 0; while (j < max_map) { if (check(lst, map, i, j)) { if (fillit(lst->next, map, max_map)) return (1); map = put_dots(lst, map, max_map); } j++; } i++; } return (0); }
//============================================================================== void CombSplit::paint (Graphics& g) { //[UserPrePaint] Add your own custom painting code here.. //[/UserPrePaint] //[UserPaint] Add your own custom painting code here.. fillit(); //[/UserPaint] }
void main() { setup(); setcolor(1); rectangle(180,190,220,210); getch(); thiscolor=getpixel(200,200); fillit(200,200); getch(); }
int main(int ac, char **av) { t_meta *meta; if (ac == 2) { meta = init_meta(); file_to_tab(open_file(av[1]), meta); verif_tetri(meta); fillit(meta); free_meta(meta); } else ft_putendl("usage: ./fillit source_file"); return (0); }
//============================================================================== void MultiplyPhase::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }
//============================================================================== void Mirror::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }
//============================================================================== void KeepPeaks::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }
//============================================================================== void AmplitudeToPhase::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }
//============================================================================== void SpectrumShift::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }
static void do_keytab(const char *name) { krb5_error_code ret; krb5_keytab kt; krb5_keytab_entry entry; krb5_kt_cursor cursor; unsigned int i; char buf[BUFSIZ]; /* Hopefully large enough for any type */ char *pname; if (name == NULL && use_client_keytab) { ret = krb5_kt_client_default(context, &kt); if (ret) { com_err(progname, ret, _("while getting default client keytab")); exit(1); } } else if (name == NULL) { ret = krb5_kt_default(context, &kt); if (ret) { com_err(progname, ret, _("while getting default keytab")); exit(1); } } else { ret = krb5_kt_resolve(context, name, &kt); if (ret) { com_err(progname, ret, _("while resolving keytab %s"), name); exit(1); } } ret = krb5_kt_get_name(context, kt, buf, BUFSIZ); if (ret) { com_err(progname, ret, _("while getting keytab name")); exit(1); } printf("Keytab name: %s\n", buf); ret = krb5_kt_start_seq_get(context, kt, &cursor); if (ret) { com_err(progname, ret, _("while starting keytab scan")); exit(1); } /* XXX Translating would disturb table alignment; skip for now. */ if (show_time) { printf("KVNO Timestamp"); fillit(stdout, timestamp_width - sizeof("Timestamp") + 2, (int) ' '); printf("Principal\n"); printf("---- "); fillit(stdout, timestamp_width, (int) '-'); printf(" "); fillit(stdout, 78 - timestamp_width - sizeof("KVNO"), (int) '-'); printf("\n"); } else { printf("KVNO Principal\n"); printf("---- ------------------------------------------------" "--------------------------\n"); } while ((ret = krb5_kt_next_entry(context, kt, &entry, &cursor)) == 0) { ret = krb5_unparse_name(context, entry.principal, &pname); if (ret) { com_err(progname, ret, _("while unparsing principal name")); exit(1); } printf("%4d ", entry.vno); if (show_time) { printtime(entry.timestamp); printf(" "); } printf("%s", pname); if (show_etype) printf(" (%s) " , etype_string(entry.key.enctype)); if (show_keys) { printf(" (0x"); for (i = 0; i < entry.key.length; i++) printf("%02x", entry.key.contents[i]); printf(")"); } printf("\n"); krb5_free_unparsed_name(context, pname); krb5_free_keytab_entry_contents(context, &entry); } if (ret && ret != KRB5_KT_END) { com_err(progname, ret, _("while scanning keytab")); exit(1); } ret = krb5_kt_end_seq_get(context, kt, &cursor); if (ret) { com_err(progname, ret, _("while ending keytab scan")); exit(1); } exit(0); }
void checkgrid() { if(selectedwindow()==3) { int x1,x2,y1,y2; if(mousestat()==1) { if(selected(1,0)==0) { for(int loopx=0;loopx<maxx;loopx++) { for(int loopy=0;loopy<maxy;loopy++) { x1=windows[3].x1+4+(loopx*size); x2=x1+size-1; y1=windows[3].y1+17+(loopy*size); y2=y1+size-1; if(x>=x1 && x<x2 && y>=y1 && y<y2) { graph[loopx][loopy]=selected(0,0); drawpixel(loopx,loopy); } } } thumb(); } } if(mousestat()==3) { if(selected(1,0)==2 || selected(1,0)==3) { for(int loopx=0;loopx<maxx;loopx++) { for(int loopy=0;loopy<maxy;loopy++) { x1=windows[3].x1+4+(loopx*size); x2=x1+size-1; y1=windows[3].y1+17+(loopy*size); y2=y1+size-1; if(x>=x1 && x<x2 && y>=y1 && y<y2) { sx=loopx; sy=loopy; } } } } if(selected(1,0)==1) { for(int loopx=0;loopx<maxx;loopx++) { for(int loopy=0;loopy<maxy;loopy++) { x1=windows[3].x1+4+(loopx*size); x2=x1+size-1; y1=windows[3].y1+17+(loopy*size); y2=y1+size-1; if(x>=x1 && x<x2 && y>=y1 && y<y2) { fillit(loopx,loopy,graph[loopx][loopy],selected(0,0)); drawgrid(); } } } } } if(mousestat()==4 && select==1) { if(selected(1,0)==2) { for(int loopx=0;loopx<maxx;loopx++) { for(int loopy=0;loopy<maxy;loopy++) { x1=windows[3].x1+4+(loopx*size); x2=x1+size-1; y1=windows[3].y1+17+(loopy*size); y2=y1+size-1; if(x>=x1 && x<x2 && y>=y1 && y<y2) { ex=loopx; ey=loopy; makeline(sx,sy,ex,ey); drawgrid(); } } } } if(selected(1,0)==3) { for(int loopx=0;loopx<maxx;loopx++) { for(int loopy=0;loopy<maxy;loopy++) { x1=windows[3].x1+4+(loopx*size); x2=x1+size-1; y1=windows[3].y1+17+(loopy*size); y2=y1+size-1; if(x>=x1 && x<x2 && y>=y1 && y<y2) { ex=loopx; ey=loopy; rect(sx,sy,ex,ey); drawgrid(); } } } } } } }
//============================================================================== void DerivativeAmp::paint (Graphics& g) { //[UserPaint] Add your own custom paint stuff here.. fillit(); //[/UserPaint] }