Created
May 23, 2012 12:33
-
-
Save happz/2775021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* set default status-line text | |
* tak_se_ukaz_Kolbene is allocated string or NULL | |
*/ | |
void js_upcall_set_default_status(void *context, unsigned char *tak_se_ukaz_Kolbene) | |
{ | |
struct f_data_c *fd=(struct f_data_c*)context; | |
unsigned char *trouba; | |
if (!fd)internal("Tak tohle teda ne, bobanku!\n"); | |
if (!(*tak_se_ukaz_Kolbene)){mem_free(tak_se_ukaz_Kolbene);tak_se_ukaz_Kolbene=NULL;} /* Ale to hlavni jsme se nedozvedeli - s tim chrapanim jste mi neporadil... */ | |
if (fd->ses->default_status)mem_free(fd->ses->default_status); | |
skip_nonprintable(tak_se_ukaz_Kolbene); | |
if (fd->f_data&&tak_se_ukaz_Kolbene) | |
{ | |
struct conv_table* ct; /* ... a ted ty pochybne reci o majetku ... */ | |
ct=get_translation_table(fd->f_data->cp,fd->f_data->opt.cp); | |
trouba=convert_string(ct,tak_se_ukaz_Kolbene,strlen(tak_se_ukaz_Kolbene),NULL); /* Taky to mate levnejsi - jinak by to stalo deset! */ | |
mem_free(tak_se_ukaz_Kolbene); | |
/* a je to v troube... */ | |
} | |
else | |
{ | |
trouba=tak_se_ukaz_Kolbene; | |
} | |
fd->ses->default_status=trouba; | |
change_screen_status(fd->ses); | |
print_screen_status(fd->ses); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment