60 |
60 |
61 /* returns FWMgrTrue if processed successfully */ |
61 /* returns FWMgrTrue if processed successfully */ |
62 static FWMgrBool tokenizeTag(FWMgrTagType tagType, const char* buffer, |
62 static FWMgrBool tokenizeTag(FWMgrTagType tagType, const char* buffer, |
63 FrameworkMap **node); |
63 FrameworkMap **node); |
64 |
64 |
65 /* Crates a default rules config file */ |
|
66 static int createDefaultRules(const char * filename); |
|
67 |
|
68 /* Global functions from header file */ |
65 /* Global functions from header file */ |
69 |
66 |
70 /* FrameworkMap* XAFrameworkMgr_CreateFrameworkMap |
67 /* FrameworkMap* XAFrameworkMgr_CreateFrameworkMap |
71 * Description: Creates a list of framework and use-case map. |
68 * Description: Creates a list of framework and use-case map. |
72 */ |
69 */ |
80 FWMgrFwType currentFrameworkType = FWMgrFWUknown; |
77 FWMgrFwType currentFrameworkType = FWMgrFWUknown; |
81 FWMgrTagType currentTagType = FWMgrTagNone; |
78 FWMgrTagType currentTagType = FWMgrTagNone; |
82 FrameworkMap *curNode = NULL; |
79 FrameworkMap *curNode = NULL; |
83 FWMgrBool newNode; |
80 FWMgrBool newNode; |
84 FrameworkMap *frameworkMap = NULL; |
81 FrameworkMap *frameworkMap = NULL; |
85 FILE* fp = fopen(configFileLocationZ, "r"); |
82 |
86 |
83 FILE* fp = fopen(configFileLocationC, "r"); |
87 if (fp == NULL) |
84 if (fp == NULL) |
88 { |
85 { |
89 createDefaultRules(configFileLocationC); |
86 fp = fopen(configFileLocationZ, "r"); |
90 |
|
91 fp = fopen(configFileLocationC, "r"); |
|
92 } |
87 } |
93 |
88 |
94 if (fp != NULL) |
89 if (fp != NULL) |
95 { |
90 { |
96 while ((fgets(buffer, LINEWIDTH, fp) != NULL) && processedEntry) |
91 while ((fgets(buffer, LINEWIDTH, fp) != NULL) && processedEntry) |
551 } |
546 } |
552 tempStartPtr = tempEndPtr; |
547 tempStartPtr = tempEndPtr; |
553 } |
548 } |
554 return FWMgrTrue; |
549 return FWMgrTrue; |
555 } |
550 } |
556 |
551 |
557 int createDefaultRules(const char * filename) |
|
558 { |
|
559 FILE* fp = fopen(filename, "w"); |
|
560 if (fp == NULL) |
|
561 return /*KErrAccessDenied*/-21; |
|
562 fputs("#/*\r\n", fp); |
|
563 fputs( |
|
564 "#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).\r\n", |
|
565 fp); |
|
566 fputs("#* All rights reserved.\r\n", fp); |
|
567 fputs( |
|
568 "#* This component and the accompanying materials are made available\r\n", |
|
569 fp); |
|
570 fputs("#* under the terms of \"Eclipse Public License v1.0\"\r\n", fp); |
|
571 fputs("#* which accompanies this distribution, and is available\r\n", fp); |
|
572 fputs("#* at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\r\n", |
|
573 fp); |
|
574 fputs("#*\r\n", fp); |
|
575 fputs("#* Initial Contributors:\r\n", fp); |
|
576 fputs("#* Nokia Corporation - initial contribution.\r\n", fp); |
|
577 fputs("#*\r\n", fp); |
|
578 fputs("#* Contributors:\r\n", fp); |
|
579 fputs("#*\r\n", fp); |
|
580 fputs("#* Description:\r\n", fp); |
|
581 fputs("#*\r\n", fp); |
|
582 fputs("#*/\r\n", fp); |
|
583 fputs( |
|
584 "#============================================================================>|\r\n", |
|
585 fp); |
|
586 fputs( |
|
587 "# Must not exceed 80 chars each line=========================================>|\r\n", |
|
588 fp); |
|
589 fputs( |
|
590 "#============================================================================>|\r\n", |
|
591 fp); |
|
592 fputs("<mediaplayer>\r\n", fp); |
|
593 fputs("<mmf>\r\n", fp); |
|
594 fputs("<urischeme>\r\n", fp); |
|
595 fputs( |
|
596 "# Num of entries followed by actual entries all ending with a comma\r\n", |
|
597 fp); |
|
598 fputs("6,file,http,rtsp,rtspu,rtspt,mms,\r\n", fp); |
|
599 fputs("</urischeme>\r\n", fp); |
|
600 fputs("<fileext>\r\n", fp); |
|
601 fputs( |
|
602 "15,3gp,wma,wmv,wav,amr,mp3,mp4,rm,ra,avi,mkv,aac,mid,awb,3g2,\r\n", |
|
603 fp); |
|
604 fputs("</fileext>\r\n", fp); |
|
605 fputs("</mmf>\r\n", fp); |
|
606 fputs("</mediaplayer>\r\n", fp); |
|
607 fputs("<mediarecorder>\r\n", fp); |
|
608 fputs("<gst>\r\n", fp); |
|
609 fputs("<urischeme>\r\n", fp); |
|
610 fputs( |
|
611 "# Num of entries followed by actual entries all ending with a comma\r\n", |
|
612 fp); |
|
613 fputs("1,file,\r\n", fp); |
|
614 fputs("</urischeme>\r\n", fp); |
|
615 fputs("<fileext>\r\n", fp); |
|
616 fputs("3,wav,amr,mp4,\r\n", fp); |
|
617 fputs("</fileext>\r\n", fp); |
|
618 fputs("</gst>\r\n", fp); |
|
619 fputs("</mediarecorder>\r\n", fp); |
|
620 fclose(fp); |
|
621 return 0; |
|
622 } |
|