[Redbutton-devel] SF.net SVN: redbutton: [109] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-06-14 09:37:36
|
Revision: 109 Author: skilvington Date: 2006-06-14 02:37:29 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=109&view=rev Log Message: ----------- recognise long and short ResidentProgram names Modified Paths: -------------- redbutton-browser/trunk/ResidentProgramClass.c redbutton-browser/trunk/TODO redbutton-browser/trunk/der_decode.c redbutton-browser/trunk/der_decode.h Modified: redbutton-browser/trunk/ResidentProgramClass.c =================================================================== --- redbutton-browser/trunk/ResidentProgramClass.c 2006-06-14 08:32:17 UTC (rev 108) +++ redbutton-browser/trunk/ResidentProgramClass.c 2006-06-14 09:37:29 UTC (rev 109) @@ -234,7 +234,7 @@ } /* - * run the given program (identified by the 3 character name field in the ResidentProgramClass) + * run the given program (identified by the name field in the ResidentProgramClass) * returns true if the program succeeds * sets the parameters to the values described by the UK MHEG Profile * caller_gid is used to resolve Generic variables in the parameters @@ -243,35 +243,36 @@ struct { - char name[3]; + char *short_name; + char *long_name; bool (*func)(LIST_OF(Parameter) *, OctetString *); } resident_progs[] = { - { "GCD", prog_GetCurrentDate }, - { "FDa", prog_FormatDate }, - { "GDW", prog_GetDayOfWeek }, - { "Rnd", prog_Random }, - { "CTC", prog_CastToContentRef }, - { "CTO", prog_CastToObjectRef }, - { "GSL", prog_GetStringLength }, - { "GSS", prog_GetSubString }, - { "SSS", prog_SearchSubString }, - { "SES", prog_SearchAndExtractSubString }, - { "GSI", prog_SI_GetServiceIndex }, - { "TIn", prog_SI_TuneIndex }, - { "TII", prog_SI_TuneIndexInfo }, - { "BSI", prog_SI_GetBasicSI }, - { "GBI", prog_GetBootInfo }, - { "CCR", prog_CheckContentRef }, - { "CGR", prog_CheckGroupIDRef }, - { "VTG", prog_VideoToGraphics }, - { "SWA", prog_SetWidescreenAlignment }, - { "GDA", prog_GetDisplayAspectRatio }, - { "CIS", prog_CI_SendMessage }, - { "SSM", prog_SetSubtitleMode }, - { "WAI", prog_WhoAmI }, - { "DBG", prog_Debug }, - { "", NULL } + { "GCD", "GetCurrentDate", prog_GetCurrentDate }, + { "FDa", "FormatDate", prog_FormatDate }, + { "GDW", "GetDayOfWeek", prog_GetDayOfWeek }, + { "Rnd", "Random", prog_Random }, + { "CTC", "CastToContentRef", prog_CastToContentRef }, + { "CTO", "CastToObjectRef", prog_CastToObjectRef }, + { "GSL", "GetStringLength", prog_GetStringLength }, + { "GSS", "GetSubString", prog_GetSubString }, + { "SSS", "SearchSubString", prog_SearchSubString }, + { "SES", "SearchAndExtractSubString", prog_SearchAndExtractSubString }, + { "GSI", "SI_GetServiceIndex", prog_SI_GetServiceIndex }, + { "TIn", "SI_TuneIndex", prog_SI_TuneIndex }, + { "TII", "SI_TuneIndexInfo", prog_SI_TuneIndexInfo }, + { "BSI", "SI_GetBasicSI", prog_SI_GetBasicSI }, + { "GBI", "GetBootInfo", prog_GetBootInfo }, + { "CCR", "CheckContentRef", prog_CheckContentRef }, + { "CGR", "CheckGroupIDRef", prog_CheckGroupIDRef }, + { "VTG", "VideoToGraphics", prog_VideoToGraphics }, + { "SWA", "SetWidescreenAlignment", prog_SetWidescreenAlignment }, + { "GDA", "GetDisplayAspectRatio", prog_GetDisplayAspectRatio }, + { "CIS", "CI_SendMessage", prog_CI_SendMessage }, + { "SSM", "SetSubtitleMode", prog_SetSubtitleMode }, + { "WAI", "WhoAmI", prog_WhoAmI }, + { "DBG", "Debug", prog_Debug }, + { "", "", NULL } }; bool @@ -283,18 +284,14 @@ /* remember if we were forked or not */ p->inst.forked = forked; - /* check the name is in the form we expect */ - if(p->name.size != 3) + /* find it */ + for(i=0; resident_progs[i].func!=NULL; i++) { - error("Unknown ResidentProgram: '%.*s'", p->name.size, p->name.data); - return false; + if(OctetString_strcmp(&p->name, resident_progs[i].short_name) == 0 + || OctetString_strcmp(&p->name, resident_progs[i].long_name) == 0) + break; } - /* find it */ - i = 0; - while(resident_progs[i].func && strncmp(resident_progs[i].name, p->name.data, 3) != 0) - i ++; - /* run it */ if(resident_progs[i].func) { Modified: redbutton-browser/trunk/TODO =================================================================== --- redbutton-browser/trunk/TODO 2006-06-14 08:32:17 UTC (rev 108) +++ redbutton-browser/trunk/TODO 2006-06-14 09:37:29 UTC (rev 109) @@ -1,3 +1,8 @@ +if openStream fails - need to make sure either: +contents picture gets filled with black, or +VideoClass_render does not make a transparent rectangle in the overlay picture + + in all VisibleClass objects only redraw them in SetPosition/SetBoxSize/etc if they actually move/change size/etc Modified: redbutton-browser/trunk/der_decode.c =================================================================== --- redbutton-browser/trunk/der_decode.c 2006-06-14 08:32:17 UTC (rev 108) +++ redbutton-browser/trunk/der_decode.c 2006-06-14 09:37:29 UTC (rev 109) @@ -219,6 +219,21 @@ } /* + * compare the OctetString with the given \0 terminated C string + */ + +int +OctetString_strcmp(OctetString *oct, char *str) +{ + size_t len = strlen(str); + + if(oct->size != len) + return oct->size - len; + else + return memcmp(oct->data, str, len); +} + +/* * assumes its okay to call der_realloc(dst->data, x) * if dst is not initialised, you should use OctetString_dup instead * src can be NULL, but dst must be valid Modified: redbutton-browser/trunk/der_decode.h =================================================================== --- redbutton-browser/trunk/der_decode.h 2006-06-14 08:32:17 UTC (rev 108) +++ redbutton-browser/trunk/der_decode.h 2006-06-14 09:37:29 UTC (rev 109) @@ -50,6 +50,8 @@ void free_OctetString(OctetString *); int OctetString_cmp(OctetString *, OctetString *); +int OctetString_strcmp(OctetString *, char *); + bool OctetString_copy(OctetString *, OctetString *); void OctetString_dup(OctetString *, OctetString *); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |