source: titan/titan/titan.c @ 41783

Last change on this file since 41783 was 41783, checked in by obi, 5 years ago

add dm920 / wetek step 2

File size: 34.9 KB
Line 
1#include "struct.h"
2#ifdef CONFIG_ION
3#include "ion.h"
4#endif
5#include "header.h"
6#include "debug.h"
7#include "crc32.h"
8#include "sock.h"
9
10#define SYSCODE 0UL
11#define HTTPAUTH "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0="
12
13struct clist *config[LISTHASHSIZE] = {NULL};
14struct clist *ownconfig[LISTHASHSIZE] = {NULL};
15struct clist *rcconfig[LISTHASHSIZE] = {NULL};
16struct clist *skinconfig[LISTHASHSIZE] = {NULL};
17struct skin *skin = NULL;
18struct fb *fb = NULL;
19struct fb* skinfb = NULL;
20struct fb* accelfb = NULL;
21struct fb* fb1 = NULL;
22struct fb* lcdskinfb = NULL;
23struct fb* oledskinfb = NULL;
24struct font *font = NULL;
25struct rc *rc = NULL;
26struct dvbdev *dvbdev = NULL;
27struct dvbdev *dvbdevsim = NULL;
28struct channel *channel = NULL;
29struct transponder *transponder = NULL;
30struct provider *provider = NULL;
31struct sat *sat = NULL;
32struct service *service = NULL;
33struct mainbouquet *mainbouquet = NULL;
34struct mainplaylist *mainplaylist = NULL;
35struct pic *pic = NULL;
36struct rcmap *rcmap = NULL;
37struct inetwork *inetwork = NULL;
38struct stimerthread *stimerthread = NULL;
39struct rectimer *rectimer = NULL;
40struct subpage* subpage = NULL, *oldsubpage = NULL;
41struct epgscanlist* epgscanlist = NULL;
42struct screensaver* screensaver = NULL;
43struct channelcache* channelcache[CHANNELCACHEMAX] = {NULL};
44struct transpondercache* transpondercache[TRANSPONDERCACHEMAX] = {NULL};
45struct hdd* hdd = NULL;
46struct queue* queue = NULL;
47struct caservice caservice[MAXCASERVICE];
48struct channelhistory channelhistory[MAXCHANNELHISTORY];
49struct mostzap* mostzap = NULL;
50struct mediadbfilter* mediadbfilter = NULL;
51struct mediadbcategory* mediadbcategory = NULL;
52struct mediadb* mediadb = NULL;
53struct mediadbcache* mediadbcache[MEDIADBCACHEMAX] = {NULL};
54struct unicable* unicable = NULL;
55struct oldentry* oldentry = NULL;
56struct newsletter* newsletter = NULL;
57struct extepgcache* extepgcache = NULL;
58struct extepgchannel* extepgchannel = NULL;
59struct extepgconfig* extepgconfig = NULL;
60struct lastsubtitle* lastsubtitle = NULL;
61struct style* style = NULL;
62struct download* bgdownload[MAXBGDOWNLOAD] = {NULL};
63struct channelslot *channelslot = NULL;
64
65#ifdef SH4
66#include "sh4port.h"
67#endif
68
69#ifdef MIPSEL
70#include "mipselport.h"
71#endif
72
73#ifdef I386
74#include "i386port.h"
75#endif
76
77#include "oldentry.h"
78#include "tpk.h"
79#include "queue.h"
80#include "channelcache.h"
81#include "transpondercache.h"
82#include "strconvert.h"
83#include "numinput.h"
84#include "textinput.h"
85#include "radiotext.h"
86#include "list.h"
87#include "config.h"
88#include "defaults.h"
89#include "ownconfig.h"
90#include "rcconfig.h"
91#include "skinconfig.h"
92#include "thumb.h"
93#include "global.h"
94#include "security.h"
95#include "stream.h"
96#include "dvbdev.h"
97#include "rotorcalc.h"
98#include "frontenddev.h"
99#include "dmxdev.h"
100#include "videodev.h"
101#include "audiodev.h"
102#include "cidev.h"
103#include "cadev.h"
104#include "scdev.h"
105#include "cacc.h"
106#include "ca.h"
107#include "dvrdev.h"
108#include "cam.h"
109#include "dvb.h"
110#include "fb.h"
111#include "font.h"
112#include "rcmap.h"
113#include "rc.h"
114#include "sat.h"
115#include "transponder.h"
116#include "provider.h"
117#include "channel.h"
118#include "bouquets.h"
119#include "mainbouquets.h"
120#include "playlist.h"
121#include "mainplaylist.h"
122#include "pic.h"
123#include "filelist.h"
124#include "skinfunc.h"
125#include "style.h"
126#include "skin.h"
127#include "inputhelp.h"
128#include "rcfunc.h"
129#include "listbox.h"
130#include "choicebox.h"
131#include "vfd.h"
132#include "timerthread.h"
133#include "service.h"
134#include "pip.h"
135#include "player.h"
136#include "dvdplayer.h"
137#include "timeshift.h"
138#include "record.h"
139#include "zap.h"
140#include "showiframe.h"
141#include "epgrecord.h"
142#include "multiepg.h"
143#include "gmultiepg.h"
144#include "epg.h"
145#include "eit.h"
146#include "extepg.h"
147#include "epgscan.h"
148#include "menulist.h"
149#include "videomode.h"
150#include "inetwork.h"
151#include "keyactions.h"
152#include "scart.h"
153#include "standby.h"
154#include "dir.h"
155#include "spinner.h"
156#include "lnbconfig.h"
157#include "diseqcconfig.h"
158#include "tunerconfig.h"
159#include "epgsettings.h"
160#include "listedit.h"
161#include "channellist.h"
162#include "vfdisplay.h"
163#include "videosettings.h"
164#include "textbox.h"
165#include "autores.h"
166#include "language.h"
167#include "about.h"
168#include "serviceinfo.h"
169#include "avsettings.h"
170#include "mute.h"
171#include "volume.h"
172#include "timezone.h"
173#include "adjust.h"
174#include "skinadjust.h"
175#include "blindscanadjust.h"
176#include "moduleconfig.h"
177#include "scconfig.h"
178#include "possetup.h"
179#include "rectimer.h"
180#include "pin.h"
181#include "plugin.h"
182#include "recordpath.h"
183#include "subtitle.h"
184#include "audiotrack.h"
185#include "linkedchannel.h"
186#include "powerofftimer.h"
187#include "skinselector.h"
188#include "play.h"
189#include "satfinder.h"
190#include "multiboot.h"
191#include "menu.h"
192#include "channelbynr.h"
193#include "infobar.h"
194#include "network.h"
195#include "harddisk.h"
196#include "httpdfunc.h"
197#include "httpd.h"
198#include "download.h"
199#include "copyfile.h"
200#include "screensaver.h"
201#include "screensaveradjust.h"
202#include "scan.h"
203#include "restoredefault.h"
204#include "help.h"
205#include "httpdsettings.h"
206#include "epgsearch.h"
207#include "inadyn.h"
208#include "rguid.h"
209#include "channelhistroy.h"
210#include "mostzap.h"
211#include "settings_redbutton.h"
212#include "settings_bluebutton.h"
213#include "extensions.h"
214#include "system_update.h"
215#include "system_backup.h"
216#include "system_backup_restore.h"
217#include "info.h"
218#include "softcam.h"
219#include "id3.h"
220#include "mediadbcache.h"
221#include "mediadb.h"
222#include "mediadbsettings.h"
223#include "colorpicker.h"
224#include "ocrypt.h"
225#include "unlock.h"
226#include "md5.h"
227#include "rc4.h"
228#include "textinputhist.h"
229#include "system_infos.h"
230#include "system_infos_sysinfo.h"
231#include "unicable.h"
232#include "newsletter.h"
233#include "dirsort.h"
234#include "shortepg.h"
235#include "mediadbedit.h"
236#include "tpchoice.h"
237#include "marker.h"
238#include "timeshiftsettings.h"
239#include "log.h"
240#include "bgdownload.h"
241#include "fancontrol.h"
242#include "channelslot.h"
243#include "hwtest.h"
244#include "settings_autostart.h"
245#include "settings_overclocking.h"
246#include "settings_pluginbutton.h"
247#include "bcm.h"
248#include "settings_mediabutton.h"
249#include "oled.h"
250#ifdef MIPSEL
251#include "cec.h"
252#include "encoder.h"
253#endif
254
255#define TIMECODE "1472042241"
256
257// mipsel start
258/* Apparently, surfaces must be 64-byte aligned */
259#define ACCEL_ALIGNMENT_SHIFT   6
260#define ACCEL_ALIGNMENT_MASK    ((1<<ACCEL_ALIGNMENT_SHIFT)-1)
261
262#define ACCEL_DEBUG
263
264//gAccel *gAccel::instance;
265#define BCM_ACCEL
266
267#ifdef BCM_ACCEL
268extern int bcm_accel_init(void);
269extern void bcm_accel_close(void);
270extern void bcm_accel_blit(
271                int src_addr, int src_width, int src_height, int src_stride, int src_format,
272                int dst_addr, int dst_width, int dst_height, int dst_stride,
273                int src_x, int src_y, int width, int height,
274                int dst_x, int dst_y, int dwidth, int dheight,
275                int pal_addr, int flags);
276extern void bcm_accel_fill(
277                int dst_addr, int dst_width, int dst_height, int dst_stride,
278                int x, int y, int width, int height,
279                unsigned long color);
280extern bool bcm_accel_has_alphablending();
281#endif
282// mipsel end
283
284void demomodethread(struct stimerthread* self)
285{
286        textbox(_("Message"), _("!!! This is a DEMO Version !!!"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 600, 0, 1);
287}
288
289int createstartscreen()
290{
291        addscreen("<screen name=framebuffer/>", 0, 0);
292        if(skin == NULL)
293        {
294                err("can't set framebuffer skin");
295                return 1;
296        }
297        addscreen("<screen name=skinerror/>", 0, 0);
298        status.skinerr = getscreen("skinerror");
299        skin->width = skinfb->width;
300        skin->height = skinfb->height;
301        skin->iwidth = skinfb->width;
302        skin->iheight = skinfb->height;
303        skin->rwidth = skinfb->width;
304        skin->rheight = skinfb->height;
305        skin->bgcol = 0;
306        skin->transparent = 255;
307        skin->flag = 1;
308
309        return 0;
310}
311
312//exitcode: 1 power off
313//exitcode: 2 restart
314//exitcode: 3 Gui restart
315//flag: 0 do not check record
316//flag: 1 check record
317//flag: 2 check record / don't write config
318//flag: 3 check record with timeout
319//flag: 4 check record with increase fixpowerofftime
320//flag: 5 check record with increase powerofftime
321void oshutdown(int exitcode, int flag)
322{
323        struct dvbdev* dvbnode = dvbdev;
324        struct service* servicenode = service;
325        void* threadstatus;
326        int i = 0, faststop = 0, ret = 0;
327        char* tmpstr = NULL;
328        struct skin* logo = getscreen("logo");
329        pthread_attr_t writethreadattr = {};
330        pthread_t writethread = '\0';
331
332        //stop permanent timeshift
333        if(status.timeshift == 1)
334                timeshiftstop(3);
335
336        ret = checkshutdown(flag);
337        if(ret == 1) return;
338
339        ret = servicestop(status.aktservice, 1, 1);
340        if(ret == 1) return;
341       
342        if(exitcode == 1)
343                tmpstr = getconfig("userpowerofflogo", NULL);
344        else if(exitcode == 2)
345                tmpstr = getconfig("userrestartlogo", NULL);
346        else if(exitcode == 3)
347                tmpstr = getconfig("userguirestartlogo", NULL);
348       
349        if(tmpstr != NULL) {
350                if(file_exist(tmpstr) == 0)
351                        tmpstr = NULL;
352        }       
353        if(tmpstr == NULL) {   
354                if(exitcode == 1)
355                        tmpstr = getconfig("powerofflogo", NULL);
356                else if(exitcode == 2)
357                        tmpstr = getconfig("restartlogo", NULL);
358                else if(exitcode == 3)
359                        tmpstr = getconfig("guirestartlogo", NULL);
360        }
361                       
362        if(tmpstr != NULL)
363        {
364                changepic(logo, tmpstr);
365                tmpstr = NULL;
366                drawscreen(logo, 0, 0);
367        }
368        else
369                clearfball();
370
371        //stop all records
372        while(servicenode != NULL)
373        {
374                servicenode->recendtime = 1;
375                servicenode = servicenode->next;
376        }
377
378        faststop = getconfigint("faststop", NULL);
379
380        // Free memory, semaphores, etc. and say goodbye
381        if(faststop == 0) cleanupvfd();
382
383        if(status.servicetype != 99) //don't save tmp servicetype
384        {
385                tmpstr = oitoa(status.servicetype);
386                addconfig("servicetype", tmpstr);
387                free(tmpstr); tmpstr = NULL;
388        }
389
390        status.sec = 0;
391
392        if(flag != 2)
393        {
394                //start write thread
395                pthread_attr_init(&writethreadattr);
396                pthread_attr_setstacksize(&writethreadattr, 50000);
397                pthread_attr_setdetachstate(&writethreadattr, PTHREAD_CREATE_JOINABLE);
398
399                int epgsave = getconfigint("epgsave", NULL);
400                if((epgsave == 1 && exitcode == 3) || epgsave == 2)
401                        ret = pthread_create(&writethread, &writethreadattr, writeallconfigthread1, NULL); //do not save epg
402                else
403                        ret = pthread_create(&writethread, &writethreadattr, writeallconfigthread0, NULL); //save epg
404                if(ret)
405                {
406                        err("create write thread");
407                }
408        }
409       
410        //stop fan
411        if(checkchipset("BCM7424") == 1) //inihdp
412                writesys("/proc/stb/fp/fan", "1", 1);
413               
414        //reset ci devices
415        while(dvbnode != NULL)
416        {
417                if(dvbnode->type == CIDEV && dvbnode->fd > -1)
418                {
419                        if(dvbnode->caslot != NULL) dvbnode->caslot->status = 101;
420                        usleep(10000);
421                        careset(dvbnode, dvbnode->devnr);
422                }
423                dvbnode = dvbnode->next;
424        }
425
426        //Damit deinit ausgef\FChrt wird
427        if(getplugin("GEMBIRD Powermanager") != NULL)
428                delplugin("GEMBIRD Powermanager");
429       
430        if(faststop == 0)
431        {
432                //wait for write thread
433                if(writethread != '\0')
434                        pthread_join(writethread, &threadstatus);
435                pthread_attr_destroy(&writethreadattr);
436
437                //stop timer thread
438                i = 0;
439                status.timerthreadaktion = STOP;
440                while(status.timerthreadstatus != DEACTIVE)
441                {
442                        usleep(100000);
443                        i++; if(i > 20) break;
444                }
445
446                if(i > 20)
447                {
448                        err("detect hanging timer thread");
449                }
450                else if(status.timerthread != '\0')
451                        pthread_join(status.timerthread, &threadstatus);
452                pthread_attr_destroy(&status.timerthreadattr);
453               
454                // free timerthread struct and stop all timer sub threads
455                freetimer(0);
456
457                status.skinerr = NULL;
458                free(status.gateway);
459                free(status.dnsserver1);
460                free(status.dnsserver2);
461                free(status.boxtype);
462                free(status.httpauth);
463                free(status.bgpic);
464
465                freeservice();
466                freecaservice();
467
468                freescreen();
469                freepic();
470                freefont();
471                deinitfont();
472
473                freerectimer();
474                freemostzap(0);
475                freechannelhistory();
476                freesat();
477                freeallplaylist();
478                freemainplaylist();
479                freeallbouquet();
480                freemainbouquet(0);
481                freechannel(0);
482                freetransponder();
483                freeprovider();
484                freeownconfig();
485                freeepgscanlist();
486                freercconfig();
487                freeskinconfig();
488                freequeue();
489                freehdd(0);
490
491                free(status.configfile);
492                freeconfig();
493
494                freedvbdev(0);
495
496                closefb(fb);
497                freefb();
498
499                closerc();
500                freerc();
501                freercmap();
502                free_shutdowntimervar();
503                freeinetwork();
504                freeoldentry();
505                freeextepgconfig();
506                freelastsubtitle();
507                freebgdownload();
508                freechannelslot();
509        }
510        else
511                freetimer(1);
512
513        if(exitcode == 1)
514                setcecstandby(1);
515
516        starthttpd(0);
517        startrguid(0);
518        initmutex(0);
519
520        if(faststop != 0)
521        {
522                //wait for write thread
523                if(writethread != '\0')
524                        pthread_join(writethread, &threadstatus);
525                pthread_attr_destroy(&writethreadattr);
526        }
527
528        exit(exitcode);
529}
530
531int main(int argc, char *argv[])
532{
533        int ret = 0, serviceret = 0, skincheck = 0;
534        char* tmpstr = NULL;
535        unsigned char *mmapfb = NULL;
536        struct sigaction sa;
537        struct stimerthread *tmpthread = NULL;
538        //struct sched_param schedparam;
539
540#ifdef SIMULATE
541        // for mem leak debug
542        setenv("MALLOC_TRACE", "/home/nit/titan/m.txt", 1);
543        mtrace();
544        status.security = 1;
545#endif
546
547        printf("[%s] copyright by %s - version %s (%d)\n", PROGNAME, COPYRIGHT, OVERSION, PLUGINVERSION);
548        printf("[%s] crontribut: %s\n", PROGNAME, CRONTRIBUT);
549
550        sa.sa_handler = (void *)sighandler;
551        sigemptyset(&sa.sa_mask);
552        sa.sa_flags = SA_RESTART;
553       
554        initsignal(&sa);
555
556        status.rguidfd = -1;
557        status.sec = time(NULL);
558        status.mainthread = pthread_self();
559
560        if(argc > 1)
561                status.configfile = ostrcat(argv[1], NULL, 0, 0);
562        else
563                status.configfile = ostrcat(CONFIGFILE, NULL, 0, 0);
564
565        printf("[%s] using config: %s\n", PROGNAME, status.configfile);
566        ret = readconfig(status.configfile, config);
567        if(ret != 0)
568        {
569                printf("error: status.configfile ret=%d\n", ret);
570                return 100;
571        }
572        //Workaround da ansonsten DVR4 nicht funktioniert (Treiberproblem)
573        status.setdvr0 = 0;
574       
575        //start timer thread
576        status.timerthreadaktion = START;
577        pthread_attr_init(&status.timerthreadattr);
578        pthread_attr_setstacksize(&status.timerthreadattr, 50000);
579        pthread_attr_setdetachstate(&status.timerthreadattr, PTHREAD_CREATE_JOINABLE);
580        ret = pthread_create(&status.timerthread, &status.timerthreadattr, timerthreadfunc, NULL);
581        if(ret)
582        {
583                err("create timer thread");
584                printf("error: create timer thread\n");
585                return 100;
586        }
587
588        //change working dir to /tmp
589        //chdir("/tmp");
590
591        //set main scheduler priority
592        //schedparam.sched_priority = 10;
593        //pthread_setschedparam(pthread_self(), SCHED_RR, &schedparam);
594
595        readconfig(getconfig("ownconfig", NULL), ownconfig);
596        readconfig(getconfig("rcconfig", NULL), rcconfig);
597
598        skincheck = checkskin();
599        readconfig(getconfig("skinconfig", NULL), skinconfig);
600
601        setprogress(100);
602        setdefaults();
603        setdebuglevel();
604        initmutex(1);
605        m_lock(&status.waitrcmutex, 24);
606        initvfd();
607
608        if(checkbox("UFS922") == 1)
609                setfanspeed(-1, 0);
610        if(checkchipset("BCM7424") == 1) //inihdp
611        {
612                if(getconfigint("fanmode", NULL) == 0)
613                        addconfig("fanmode", "3");
614                writesys("/proc/stb/fp/fan", getconfig("fanmode", NULL), 1);
615        }
616        if(getconfigint("wol", NULL) == 1)
617                system("echo enable > /proc/stb/fp/wol");
618        else
619                system("echo disable > /proc/stb/fp/wol");
620
621#ifdef MIPSEL
622        addtimer(&cecinit, START, 10000, 1, NULL, NULL, NULL);
623        //cecinit();
624#endif 
625        system(getconfig("skriptbeforetv", NULL));
626//      ret = setcecstandby(0); --- > jetzt in checkboxstart
627        ret = setvideomode(getconfig("av_videomode", NULL), 0);
628#ifndef MIPSEL
629        ret = setaspect(getconfig("av_aspect", NULL));
630#endif
631        ret = setpolicy(getconfig("av_policy", NULL));
632        ret = setcolorformat(getconfig("av_colorformat", NULL), 0);
633        ret = setcolorformat(getconfig("av_colorformatscart", NULL), 1);
634        ret = setaudiosource(getconfig("av_audiosource", NULL));
635        ret = setac3(getconfig("av_ac3mode", NULL));
636
637        if(checkbox("DM900") == 1 || checkbox("DM920") == 1 || checkbox("DM520") == 1 || checkbox("DM525") == 1)
638        {
639                if(getconfig("av_ac3plusmode", NULL) == NULL)
640                        addconfig("av_ac3plusmode", "force_ac3");
641                if(getconfig("av_dtshdmode", NULL) == NULL)
642                        addconfig("av_dtshdmode", "force_dts");
643                if(getconfig("av_wmapromode", NULL) == NULL)
644                        addconfig("av_wmapromode", "downmix");
645                ret = setac3plus(getconfig("av_ac3plusmode", NULL));
646                ret = setdtshd(getconfig("av_dtshdmode", NULL));
647                ret = setwmapro(getconfig("av_wmapromode", NULL));
648       
649                addconfig("mode3ddev", "/proc/stb/fb/primary/3d");     //24.02.17
650        }
651               
652#ifdef MIPSEL
653        ret = setaac(getconfig("av_aacmode", NULL));
654        ret = setwss(getconfig("av_wssmode", NULL));
655#endif
656        ret = setpolicy(getconfig("av_policy", NULL));
657        ret = setmode3d(getconfig("av_mode3d", NULL));
658        ret = setvfdbrightness(getconfigint("vfdbrightness", NULL));
659        ret = setaudiodelaybitstream(getconfig("audiodelaybitstream", NULL));
660        ret = addinetworkall(NULL);
661       
662        ret = 1;
663        if(file_exist("/var/etc/.usbimage"))
664                ret = system("mount | grep titan");
665 
666#ifndef SIMULATE
667        if(checkrealbox("HD51") == 1 || checkrealbox("DM900") == 1 || checkbox("DM920") == 1 || checkbox("DM520") == 1 || checkbox("DM525") == 1 || checkbox("VUSOLO2") == 1)
668                ret = 0;
669
670        // set pvr 1 = allowed , 0 = disabled
671        status.pvr = 1;
672        if(file_exist("/etc/.stable") && (checkbox("ATEMIO6000") == 1 || checkbox("ATEMIO6100") == 1 || checkbox("ATEMIO6200") == 1))
673                status.pvr = 0;
674
675        if(getconfigint("sos", NULL) == 0)
676        {
677                if(ostrcmp(string_newline(gettimeinfo()), TIMECODE) == 1)
678                {
679                        printf("error: 1\n");
680                        destroy();
681                        exit(100);
682                }
683                if(ostrcmp(string_newline(gettimeinfovar()), TIMECODE) == 1)
684                {
685                        printf("error: 2\n");           
686                        destroy();
687                        exit(100);
688                }
689                if(checkreseller() != 0)
690                {
691                        printf("error: 3\n");           
692                        destroy();
693                        exit(100);
694                }
695                if(ret > 0)
696                {
697                        if(getsysinfo() != SYSCODE)
698                        {
699                                printf("error: 4\n");           
700                                destroy();
701                                exit(100);
702                        }
703                }
704                if(file_exist("/mnt/swapextensions/etc/.vnumber") == 1)
705                {
706                        printf("error: 5\n");           
707                        destroy();
708                        exit(100);
709                }
710                if(ret > 0)
711                {
712                        if(checkflash() != 0)
713                        {
714                                printf("error: 6\n");           
715                                destroy();
716                                exit(100);
717                        }
718                }
719                if(ret > 0)
720                {
721                        if((checkchipset("BCM7424") == 1 || checkchipset("BCM7358") == 1 || checkchipset("BCM7362") == 1 || checkbox("UFS913") == 1 || checkbox("SPARK") == 1 || checkbox("SPARK7162") == 1 || checkbox("IPBOX91") == 1 || checkbox("IPBOX900") == 1 || checkbox("IPBOX910") == 1 || checkbox("IPBOX9000") == 1) && checkhighflash() != 0)
722                        {
723                                printf("error: 7\n");           
724                                destroy();
725                                exit(100);
726                        }
727                }
728                if(checkbox("UFS910") == 1 && checklowflash() != 0)
729                {
730                        printf("error: 8\n");           
731                        destroy();
732                        exit(100);
733                }
734       
735                char* cpuid = getcpuid();
736                checkserial(cpuid);
737                free(cpuid); cpuid = NULL;
738        }
739        else
740        {
741                status.security = 5;
742                startnet();
743                setskinnodeslocked(0);
744        }
745#endif
746
747        if(file_exist("/mnt/config/dualboot.enigma2"))
748        {
749                printf("error: found /mnt/config/dualboot.enigma2\n");
750                return 0;
751        }
752
753        ret = initfont();
754        if(ret != 0)
755        {
756                printf("error: initfont\n");
757                return 100;
758        }
759        ret = openfont(getconfig("fontfile1", NULL));
760        if(ret != 0)
761        {
762                err("open fontfile1 font");
763                printf("error: open fontfile1 font\n");
764                return 100;
765        }
766        openfont(getconfig("fontfile2", NULL));
767        openfont(getconfig("fontfile3", NULL));
768        openfont(getconfig("fontfile4", NULL));
769        openfont(getconfig("fontfile5", NULL));
770
771        //skin defined fonts
772        openfont(getskinconfig("fontfile1", NULL));
773        openfont(getskinconfig("fontfile2", NULL));
774        openfont(getskinconfig("fontfile3", NULL));
775        openfont(getskinconfig("fontfile4", NULL));
776        openfont(getskinconfig("fontfile5", NULL));
777
778
779        status.volume = -1;
780        setvol(getconfigint("vol", NULL));
781
782       
783        setlang(getconfig("lang", NULL));
784        initlocale(getconfig("localepath", NULL));
785
786#ifdef MIPSEL
787        bcm_accel_init();
788#endif
789
790        fb = openfb(getconfig("fbdev", NULL), 0);
791        if(fb == NULL)
792        {
793                printf("error: openfb %s\n", getconfig("fbdev", NULL));
794                return 100;
795        }
796        clearfball();
797        enablemanualblit();
798       
799        tmpstr = getconfig("fb1dev", NULL);
800        if(tmpstr != NULL)
801                fb1 = openfb(tmpstr, 1);
802        tmpstr = NULL;
803
804#ifdef MIPSEL
805        waitvsync();
806        if(checkbox("DM7020HD") == 0 && checkbox("DM7020HDV2") == 0 && checkbox("VUSOLO2") == 0 && checkbox("DM900") == 0 && checkbox("DM920") == 0 && checkbox("DM520") == 0 && checkbox("DM525") == 0)
807                setfbosd();
808        if(checkrealbox("HD51") ==1)
809                setfbosdnull();
810        status.usedirectfb = 1;
811#endif
812#ifndef CONFIG_ION
813        if(status.usedirectfb != 1)
814        {
815                skinfb = addfb(SKINFB, 0, getconfigint("skinfbwidth", NULL), getconfigint("skinfbheight", NULL), 4, fb->fd, fb->fb + fb->varfbsize, fb->fixfbsize, 0);
816                if(skinfb != NULL)
817                {
818                        ret = getfbsize(0);
819                        if(ret > 0)
820                                accelfb = addfb(ACCELFB, 0, ret / 4, 1, 4, fb->fd, skinfb->fb + skinfb->varfbsize, fb->fixfbsize, 0);
821                }
822                else
823                {
824                        debug(100, "use directfb");
825                        status.usedirectfb = 1;
826                }
827        }
828        if(status.usedirectfb == 1)
829        {
830                skinfb = fb;
831#ifndef MIPSEL
832                ret = getfbsize(0);
833                if(ret > 0)
834                        accelfb = addfb(ACCELFB, 0, ret / 4, 1, 4, fb->fd, skinfb->fb + skinfb->varfbsize, fb->fixfbsize, fb->data_phys + fb->varfbsize);
835        }
836#else
837                ret = getfbsize(0);
838                if(ret > 0 && status.bcm == 1)
839                {
840                        skinfb = addfb(SKINFB, 0, getconfigint("skinfbwidth", NULL), getconfigint("skinfbheight", NULL), 4, fb->fd, fb->fb + fb->varfbsize, fb->fixfbsize, fb->data_phys + fb->varfbsize);
841                        if(skinfb != NULL)
842                        {
843                                status.usedirectfb = 0;
844                                ret = getfbsize(0);
845                                if(ret > 0)
846                                        accelfb = addfb(ACCELFB, 0, ret / 4, 1, 4, fb->fd, skinfb->fb + skinfb->varfbsize, fb->fixfbsize, skinfb->data_phys + skinfb->varfbsize);
847                        }
848                }
849        }
850#endif 
851#else
852        status.usedirectfb = 0;
853        //SetMode();
854#endif
855       
856
857        //if(lcdskinfb == NULL) {
858                //mmapfb = malloc(4 * 320 * 240);
859                //mmapfb = malloc(4 * 1024 * 768);
860                //mmapfb = NULL;
861                /* dev=999 ist LCD Buffer */
862                //lcdskinfb = addfb("lcdskinfb", 999, 320, 240, 4, -1, mmapfb, 4 * 320 * 240);
863                //lcdskinfb = addfb("lcdskinfb", 999, 1024, 768, 4, -1, mmapfb, 4 * 1024 * 768);
864                // mmapfb = NULL;
865        //}
866
867        ret = createstartscreen();
868        if(ret != 0)
869        {
870                printf("error: createstartscreen\n");
871                return 100;
872        }
873        //from here we can use starterror screen
874        ret = openrc();
875        if(ret != 0)
876        {
877                tmpstr = ostrcat(tmpstr, _("Error: open rc device !!"), 1, 0);
878                goto starterror;
879        }
880
881        if(fegetdev() < 1)
882        {
883                tmpstr = ostrcat(tmpstr, _("Error: no frontend device found !!"), 1, 0);
884                err("no frontend device found");
885                goto starterror;
886        }
887        if(dmxgetdev() < 1)
888        {
889                tmpstr = ostrcat(tmpstr, _("Error: no demux device found !!"), 1, 0);
890                err("no demux device found");
891                goto starterror;
892        }
893        status.videodevs = videogetdev();
894        if(status.videodevs < 1)
895        {
896                tmpstr = ostrcat(tmpstr, _("Error: no video device found !!"), 1, 0);
897                err("no video device found");
898                goto starterror;
899        }
900        if(audiogetdev() < 1)
901        {
902                tmpstr = ostrcat(tmpstr, _("Error: no audio device found !!"), 1, 0);
903                err("no audio device found");
904                goto starterror;
905        }
906        ret = fecreatedummy();
907        ret = cagetdev();
908        ret = cigetdev();
909        ret = dvrgetdev();
910        ret = scgetdev();
911#ifdef MIPSEL
912        if(checkchipset("BCM7424") == 1) //inihdp
913                ret = encodergetdev();
914#endif
915
916        settunerstatus();
917
918        //start ca slot watching threads
919        castart();
920
921        //check skin
922        if(skincheck > 0)
923        {
924
925                tmpstr = ostrcat(tmpstr, _("Error: skin not found !!"), 1, 0);
926                err("skin not found");
927                goto starterror;
928        }
929
930        ret = readsat(getconfig("satfile", NULL));
931        ret = readtransponder(getconfig("transponderfile", NULL));
932        ret = readprovider(getconfig("providerfile", NULL));
933        ret = readchannel(getconfig("channelfile", NULL));
934        ret = readtransponderencoding(getconfig("transponderencodingfile", NULL));
935        ret = readmostzap(getconfig("mostzapfile", NULL));
936        ret = readlastsubtitle(getconfig("lastsubtitle", NULL));
937        ret = readchannelslot(getconfig("channelslotfile", NULL));
938
939        status.aktservice = addservice(NULL);
940        status.lastservice = addservice(NULL);
941        status.pipservice = addservice(NULL);
942
943        //check if startchannel defined
944        char* startchannellist = getconfig("startchannellist", NULL);
945        int startserviceid = getconfigint("startserviceid", NULL);
946        uint64_t starttransponderid = getconfigllu("starttransponderid", NULL);
947        int startservicetype = getconfigint("startservicetype", NULL);
948        if(startchannellist != NULL && startserviceid != 0)
949        {
950                if(startservicetype == 0)
951                {
952                        addconfig("channellist", startchannellist);
953                        addconfigint("serviceid", startserviceid);
954                        addconfigllu("transponderid", starttransponderid);
955                }
956                else
957                {
958                        addconfig("rchannellist", startchannellist);
959                        addconfigint("rserviceid", startserviceid);
960                        addconfigllu("rtransponderid", starttransponderid);
961                }
962                addconfigint("servicetype", startservicetype);
963        }
964        setvol(getconfigint("vol", NULL));
965        //tune to channel
966        if(status.servicetype == 0)
967                serviceret = servicestart(getchannel(getconfigint("serviceid", NULL), getconfigllu("transponderid", NULL)), getconfig("channellist", NULL), NULL, 0);
968        else
969                serviceret = servicestart(getchannel(getconfigint("rserviceid", NULL), getconfigllu("rtransponderid", NULL)), getconfig("rchannellist", NULL),  NULL, 0);
970
971        if(checkbox("IPBOX9000") == 1 && !file_exist("/tmp/.opticum9600.workaround"))
972        {
973                printf("opticum.workaround start\n");
974                system("touch /tmp/.opticum9600.workaround");
975                oshutdown(3, 1);
976                printf("opticum.workaround end\n");
977        }
978
979        ret = readscreen(getconfig("skinfile", NULL), 0, 0);
980        if(getconfig("keyskin_file", NULL) == NULL)
981                ret = readscreen("/var/usr/local/share/titan/skin/default/keyskin.xml", 0, 0);
982        else
983                ret = readscreen(getconfig("keyskin_file", NULL), 0, 0);
984        if(checkchipset("BCM7424") == 1 || checkbox("DM7020HD") == 1 || checkbox("DM7020HDV2") == 1 || checkbox("DM900") == 1 || checkbox("DM920") == 1)  //inihdp
985        {
986                if(getconfig("oledskin_path", NULL) == NULL)
987                        ret = readscreen("/var/usr/local/share/titan/skin/default/oledskin.xml", 0, 0);
988                else
989                {
990                        tmpstr = ostrcat(getconfig("oledskin_path", NULL),"/oledskin.xml", 0, 0);
991                        ret = readscreen(tmpstr, 0, 0);
992                        free(tmpstr);tmpstr=NULL;
993                }
994        }
995        ret = readmainbouquet(getconfig("bouquetfile", NULL));
996        ret = readallbouquet();
997        ret = readmainplaylist(getconfig("playlistfile", NULL));
998        ret = readallplaylist();
999        ret = readrcmap(getconfig("rcmapfile", NULL));
1000        ret = readepgscanlist(getconfig("epgchannelfile", NULL));
1001        ret = settimezone(getconfig("timezone", NULL));
1002        ret = readextepgconfig(getconfig("extepgfile", NULL));
1003
1004        //check to remove preinstalled tpk packages
1005        ret = tpkupdatepre();
1006
1007        addtimer(&checkdate, START, 2000, -1, NULL, NULL, NULL);
1008        if(checkbox("ATEMIO510") == 0)
1009                addtimer(&updatevfd, START, 1000, -1, NULL, NULL, NULL);
1010
1011        if(getconfigint("firststart", NULL) == 1)
1012        {
1013                if(file_exist("/var/etc/.scart"))
1014                {
1015                        setvideomode("pal", 0);
1016                        changefbresolution("pal", 0);
1017                        autoresolution();
1018                }
1019                addconfig("firststart", "0");
1020        }
1021
1022        if(getconfig("remotecontrol", NULL) == NULL)
1023        {
1024                if(checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1)
1025                {
1026                        //autopo work
1027                        char* tmptxt = NULL;
1028                        tmptxt = ostrcat(tmptxt, _("RemoteControl Old Version"), 0, 0);
1029                        tmptxt = ostrcat(tmptxt, _("RemoteControl Long Version"), 0, 0);
1030                        free(tmptxt), tmptxt = NULL;
1031
1032                        struct menulist* mlist = NULL, *mbox = NULL;
1033                        addmenulist(&mlist, "RemoteControl Old Version", "0", NULL, 0, 0);
1034                        addmenulist(&mlist, "RemoteControl Long Version", "1", NULL, 0, 0);
1035                        // remotecontrol try menulist
1036                        mbox = menulistbox(mlist, "menulist", _("Select Your Remote Control"), _("Choose your Remotecontrol Model from the following list"), NULL, NULL, 3, 0);
1037                        if(mbox != NULL)
1038                        {
1039                                debug(10, "mbox->name %s", mbox->name);
1040                                debug(10, "mbox->text %s", mbox->text);
1041                                addconfig("remotecontrol", mbox->text);
1042                                writeallconfig(1);                             
1043                        }
1044                }
1045                if(checkbox("DM7020HD") == 1 || checkbox("DM7020HDV2") == 1 || checkbox("DM900") == 1 || checkbox("DM920") == 1 || checkbox("DM520") == 1 || checkbox("DM525") == 1)
1046                {
1047                        addconfig("remotecontrol", "0");
1048                        writeallconfig(1);     
1049                }                       
1050        }
1051
1052        if(getconfigint("autoscan", NULL) == 1)
1053        {
1054                status.updatevfd = PAUSE;
1055                resettvpic();
1056                screentunerconfig();
1057                resettvpic();
1058                screenscanconfig(1);
1059                resettvpic();
1060                writevfd("");
1061                status.updatevfd = START;
1062                drawscreen(skin, 0, 0);
1063                addconfig("autoscan", "0");
1064        }
1065               
1066        //first wizzard
1067        if(getconfigint("nofirstwizzard", NULL) < 2)
1068        {
1069                if(file_exist("/var/etc/.scart"))
1070                {
1071                        setvideomode("pal", 0);
1072                        changefbresolution("pal", 0);
1073                }
1074
1075                autoresolution();
1076                       
1077                if(getconfigint("nofirstwizzard", NULL) == 0)
1078                {
1079firstwizzardstep1:
1080
1081                        status.updatevfd = PAUSE;
1082//                      screenavsettings(1);
1083//                      resettvpic();
1084                        //this screen can reload the skin (on language change)
1085                        //all skin changes before here than are deleted
1086//                      if(screenlanguage(2) == 2) return 100;
1087//                      resettvpic();
1088
1089                        screentunerconfig();
1090                        resettvpic();
1091                        screenscanconfig(1);
1092                        resettvpic();
1093//                      screennetwork_adapter();
1094//                      resettvpic();
1095                        writevfd("Setting OK ?");
1096                        if(textbox(_("First Wizzard"), _("Settings OK ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 2)
1097                        {
1098                                goto firstwizzardstep1;
1099                        }
1100                }
1101                resettvpic();
1102
1103                char* msg = NULL;
1104                msg = readfiletomem("/etc/imageinfo", 0);
1105                textbox(_("Info"), _(msg), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 680, 30, 0);
1106                free(msg); msg = NULL;
1107               
1108                writevfd("");
1109                status.updatevfd = START;
1110                drawscreen(skin, 0, 0);
1111                addconfig("nofirstwizzard", "2");
1112        }
1113        else
1114        {
1115                // workaround, remove bootlogo on startup
1116                drawscreen(skin, 0, 0);
1117
1118                //check servicestart
1119                if(serviceret != 21) // no message if startchannel empty
1120                        servicecheckret(serviceret, 0);
1121        }
1122
1123// fixt manual start
1124        resettvpic();
1125
1126        //start auto shutdown thread
1127        addtimer(&checkshutdowntimer, START, 10000, -1, NULL, NULL, NULL);
1128        //start demo mode
1129        if(checkbox("WHITEBOX") == 1)
1130                addtimer(&demomodethread, START, 600000, -1, NULL, NULL, NULL);
1131
1132        status.lastrcaction = time(NULL);
1133        ret = loadplugin();
1134        setosdtransparent(getskinconfigint("osdtransparent", NULL));
1135        ret = setsaturation(getconfigint("vs_saturation", NULL));
1136        ret = setbrightness(getconfigint("vs_brightness", NULL));
1137        ret = setcontrast(getconfigint("vs_contrast", NULL));
1138        ret = settint(getconfigint("vs_tint", NULL));
1139        videoApplySettings();
1140       
1141#ifndef SIMULATE
1142        //set skinentrys locked
1143        if(status.security == 0)
1144                setskinnodeslocked(1);
1145        else
1146                setskinnodeslocked(0);
1147#endif
1148
1149        //start epg thread
1150        status.epgthread = addtimer(&epgthreadfunc, START, 1000, -1, NULL, NULL, NULL);
1151        //start record timer thread (on delay change you must change rectimer.h also)
1152        status.rectimerthread = addtimer(&checkrectimer, START, 1000, -1, NULL, NULL, NULL);
1153        //check if cam socket connected
1154        addtimer(&checkcam, START, 3000, -1, NULL, NULL, NULL);
1155        //start stream server
1156        tmpthread = addtimer(&streamthreadfunc, START, 10000, -1, NULL, NULL, NULL);
1157        if(tmpthread != NULL)
1158        {
1159                tmpthread->flag = setbit(tmpthread->flag, 0);
1160                tmpthread = NULL;
1161        }
1162        //start epg scanlist
1163        status.epgscanlistthread = addtimer(&epgscanlistthread, START, 1000, 1, NULL, NULL, NULL);
1164        //get pmt
1165        if(getconfigint("checkpmtalways", NULL) == 1)
1166                addtimer(&dvbgetpmtthread, START, 2000, -1, NULL, NULL, NULL);
1167        //check hdd
1168        status.addhddall = addtimer(&addhddall, START, 6000, -1, NULL, NULL, NULL);
1169        //check net
1170        addtimer(&addinetworkall, START, 15000, -1, NULL, NULL, NULL);
1171        //check kill net (security)
1172        addtimer(&ckeckkillnetthread, START, 1000, 1, NULL, NULL, NULL);
1173        //check old entrys and remove from mem
1174        addtimer(&oldentrythreadfunc, START, 60000 * 60, -1, NULL, NULL, NULL);
1175
1176        //start newsletter
1177        startnewsletter(1);
1178
1179        //thumb create thread
1180        startthumb(1);
1181
1182        //start webserver
1183        starthttpd(1);
1184       
1185        //start rguid
1186        startrguid(1);
1187
1188        //init the player
1189        playerinit(argc, argv);
1190       
1191        //start spinner thread
1192        addtimer(&checkspinner, START, 2000, -1, NULL, NULL, NULL);
1193
1194        system(getconfig("skriptaftertv", NULL));
1195
1196        // work
1197        resettvpic();
1198       
1199        char* cmd = NULL;
1200#ifdef SH4
1201        cmd = ostrcat("/media/hdd/movie/titankey.sh4", NULL, 0, 0);
1202#endif
1203
1204#ifdef MIPSEL
1205        cmd = ostrcat("/media/hdd/movie/titankey.mipsel", NULL, 0, 0);
1206#endif
1207
1208        //for atemio to unlock box with stick
1209        if(file_exist(cmd))
1210        {
1211                char* cpuid = getcpuid();
1212                cmd = ostrcat(cmd, " ", 1, 0);
1213                cmd = ostrcat(cmd, cpuid, 1, 0);
1214
1215                system(cmd);
1216                checkserial(cpuid);
1217                free(cmd); cmd = NULL;
1218
1219                if(status.security >= 1)
1220                {
1221                        char* mac = getmacfromcmdline();
1222                        if(mac != NULL)
1223                        {
1224                                cmd = ostrcat(cmd, cpuid, 1, 0);
1225                                cmd = ostrcat(cmd, ",", 1, 0);
1226                                cmd = ostrcat(cmd, mac, 1, 0);
1227                               
1228                                free(mac); mac = NULL;
1229                        }
1230                        else
1231                                cmd = ostrcat(cmd, cpuid, 1, 0);
1232
1233                        writesys("/media/hdd/movie/codelist.txt", cmd, 3);
1234                        textbox(_("Message"), _("Receiver successful unlocked"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
1235                }
1236
1237                free(cpuid); cpuid = NULL;
1238        }
1239        free(cmd); cmd = NULL;
1240
1241        //must called direct befor screeninfobar
1242        if(getconfigint("saverun", NULL) == 1)
1243        {
1244                ret = sigsetjmp(status.longjumpbuf, 1);
1245                if(ret != 0 && ret != 999)
1246                {
1247                        err("set sigsegjump");
1248                }
1249        }
1250
1251        if(checkbox("UFS910") == 0 && checkbox("UFS922") == 0)
1252        {
1253                //check free space in /var
1254                if(getfreespace("/var") / 1024 < 50) //200kb
1255                        textbox(_("Message"), _("Free space in /var to little!\nThis can make problems!"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 7, 0);
1256                else
1257                {
1258                        //check writeable in /var
1259                        if(mkdir("/var/writetest", 0777) != 0 && errno != EEXIST)
1260                        {
1261                                if(textbox(_("Message"), _("/var not writeable!\nRepair it?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 15, 0) == 1)
1262                                {
1263                                        system("repairjffs2.sh var &"); //this script kills titan an reboot
1264                                        sleep(10);
1265                                }
1266                        }
1267                        rmdir("/var/writetest");
1268                }
1269       
1270                //check free space in /mnt
1271                if(getfreespace("/mnt") / 1024 < 50) //200kb
1272                        textbox(_("Message"), _("Free space in /mnt to little!\nThis can make problems!"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 7, 0);
1273                else
1274                {
1275                        //check writeable in /mnt
1276                        if(mkdir("/mnt/writetest", 0777) != 0 && errno != EEXIST)
1277                        {
1278                                if(textbox(_("Message"), _("/mnt not writeable!\nRepair it?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 15, 0) == 1)
1279                                {
1280                                        if(file_exist("/mnt/swapextensions/epg.dat"))
1281                                        {
1282                                                unlink("/mnt/swapextensions/epg.dat");
1283                                                system("sync");
1284                                                oshutdown(3, 0);
1285                                        }
1286                                        else
1287                                        {
1288                                                system("repairjffs2.sh mnt &"); //this script kills titan an reboot
1289                                                sleep(10);
1290                                        }
1291                                }
1292                        }
1293                        rmdir("/mnt/writetest");
1294                }
1295        }
1296
1297        addtimer(&guestthread, START, 1000, 1, NULL, NULL, NULL);
1298        startinternreader(1);
1299       
1300        screeninfobar();
1301
1302        //for testign screens
1303        //screenmanualscan();
1304        //screeninputhelp();
1305        //screendownload("test", "www.orf.at", NULL, 80, "test.html", 0);
1306        //screenrectimer();
1307        //screenepgsettings();
1308        //screenlnb("1");
1309        //screendiseqc("1");
1310        //screenlanguage();
1311        //screenvideosettings();
1312        //screenskinselect();
1313        //screenrectimer();
1314        //screennetwork_adapter(2);
1315        //screenpin();
1316        //screenchannellist();
1317        //recordstart(channel, RECDIRECT);
1318        //mc_main();
1319        //screenmc_videoplayer();
1320        //screenserviceinfo();
1321        //screentunerconfig();
1322        //screenvfdisplay();
1323        //screenavsettings(1);
1324        //screenadjust();
1325        //subtitlestart();
1326
1327        if(mmapfb != NULL) {
1328                free(mmapfb); mmapfb=NULL;
1329        }
1330        oshutdown(1, 1);
1331        return 0;
1332
1333starterror:
1334        addscreen("<screen hspace=5 vspace=5 type=textbox name=starterror posx=center posy=center bordersize=2 bordercol=#ffffff fontsize=30 fontcol=#ffffff width=600 height=150/>", 0, 0);
1335        struct skin *starterror = getscreen("starterror");
1336        if(tmpstr == NULL)
1337                tmpstr = ostrcat(tmpstr, _("Unknown Error."), 1, 0);
1338        tmpstr = ostrcat(tmpstr, "\n", 1, 0);
1339        tmpstr = ostrcat(tmpstr, _("Automatic stop in 10 seconds."), 1, 0);
1340        changetext(starterror, _(tmpstr));
1341        drawscreen(starterror, 0, 0);
1342        sleep(10);
1343        printf("error: starterror=%s\n", tmpstr);
1344        free(tmpstr);
1345        return 100;
1346}
Note: See TracBrowser for help on using the repository browser.