Changeset 972dc40 in rtems
- Timestamp:
- Jan 21, 1998, 3:15:12 PM (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 419fdf1
- Parents:
- 6ab91d9
- Location:
- doc/tools/pdl2texi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/tools/pdl2texi/Makefile
r6ab91d9 r972dc40 61 61 ./$(PROG) -v t1.d 62 62 63 wtest: 64 rm -f $(BASE).txt 65 ./$(PROG) -w -v -p "Turret Subsystem" -u "Turret Subsystem" $(BASE).d 66 63 67 clean: 64 68 rm -f *.o $(PROG) *.txt core *.html $(PROJECT) Drive.texi -
doc/tools/pdl2texi/base.h
r6ab91d9 r972dc40 90 90 void FormatToTexinfo( void ); 91 91 92 void FormatToWord( void ); 93 92 94 void PrintFile( 93 95 char *out … … 102 104 EXTERN boolean Verbose; /* status/debug msgs */ 103 105 EXTERN boolean Statistics; /* statistics msgs */ 106 EXTERN boolean OutputWord; /* Output MS-Word */ 104 107 EXTERN boolean IncompletesAreErrors; 105 108 EXTERN boolean InsertTBDs; -
doc/tools/pdl2texi/main.c
r6ab91d9 r972dc40 988 988 Verbose = FALSE; 989 989 Statistics = FALSE; 990 OutputWord = FALSE; 990 991 IncompletesAreErrors = TRUE; 991 992 InsertTBDs = FALSE; 992 993 993 while ((c = getopt(argc, argv, "istv ?n:p:u:")) != EOF) {994 while ((c = getopt(argc, argv, "istvw?n:p:u:")) != EOF) { 994 995 switch (c) { 995 996 case 'i': … … 1014 1015 Statistics = TRUE; 1015 1016 break; 1017 case 'w': 1018 OutputWord = TRUE; 1019 break; 1016 1020 case '?': 1017 1021 usage(); … … 1025 1029 fprintf( stderr, "Previous Node = (%s)\n", DocsPreviousNode ); 1026 1030 fprintf( stderr, "Up Node = (%s)\n", DocsUpNode ); 1031 fprintf( stderr, "Output Format = (%s)\n", (OutputWord) ? "Word" : "Texi" ); 1027 1032 } 1028 1033 … … 1065 1070 } 1066 1071 1067 out[ out_index++ ] = '.'; 1068 out[ out_index++ ] = 't'; 1069 out[ out_index++ ] = 'e'; 1070 out[ out_index++ ] = 'x'; 1071 out[ out_index++ ] = 'i'; 1072 if ( OutputWord ) { 1073 out[ out_index++ ] = '.'; 1074 out[ out_index++ ] = 't'; 1075 out[ out_index++ ] = 'x'; 1076 out[ out_index++ ] = 't'; 1077 } else { 1078 out[ out_index++ ] = '.'; 1079 out[ out_index++ ] = 't'; 1080 out[ out_index++ ] = 'e'; 1081 out[ out_index++ ] = 'x'; 1082 out[ out_index++ ] = 'i'; 1083 } 1072 1084 out[ out_index ] = '\0'; 1073 1085 … … 1191 1203 */ 1192 1204 1193 FormatToTexinfo(); 1194 1195 if ( Verbose ) 1196 fprintf( stderr, "-------->FILE FORMATTED TO TEXINFO\n" ); 1205 if ( OutputWord ) { 1206 FormatToWord(); 1207 if ( Verbose ) 1208 fprintf( stderr, "-------->FILE FORMATTED TO WORD\n" ); 1209 } else { 1210 FormatToTexinfo(); 1211 if ( Verbose ) 1212 fprintf( stderr, "-------->FILE FORMATTED TO TEXINFO\n" ); 1213 } 1197 1214 1198 1215 /* … … 2753 2770 2754 2771 /* 2772 * FormatToWord 2773 */ 2774 2775 void FormatToWord( void ) 2776 { 2777 Line_Control *line; 2778 Line_Control *new_line; 2779 char Buffer[ PARAGRAPH_SIZE ]; 2780 int i; 2781 char ChapterTitle[ PARAGRAPH_SIZE ]; 2782 char InfoFile[ PARAGRAPH_SIZE ]; 2783 char *p; 2784 boolean new_section; 2785 boolean in_bullets; 2786 2787 for ( line = (Line_Control *) Lines.first ; 2788 !_Chain_Is_last( &line->Node ) ; 2789 ) { 2790 2791 switch ( line->keyword ) { 2792 case UNUSED: 2793 line = (Line_Control *) line->Node.next; 2794 break; 2795 2796 case OBJECT: 2797 LineCopyFromRight( line, ChapterTitle ); 2798 strcpy( InfoFile, ChapterTitle ); 2799 2800 for ( p=InfoFile ; *p ; *p++ ) /* turn this into a file name */ 2801 if ( isspace( *p ) ) 2802 *p = '_'; 2803 2804 sprintf( Buffer, "@Chapter = %s", line->Contents ); 2805 strcpy( line->Contents, Buffer ); 2806 line = (Line_Control *) line->Node.next; 2807 break; 2808 2809 case ATTRIBUTE_DESCRIPTIONS: 2810 case ASSOCIATION_DESCRIPTIONS: 2811 case ABSTRACT_TYPE_DESCRIPTIONS: 2812 case DATA_ITEM_DESCRIPTIONS: 2813 case METHOD_DESCRIPTIONS: 2814 case TASK_DESCRIPTIONS: 2815 sprintf( Buffer, "@Section = %s", line->Contents ); 2816 strcpy( line->Contents, Buffer ); 2817 2818 new_line = AllocateLine(); 2819 strcpy( new_line->Contents, "@Page" ); 2820 _Chain_Insert( line->Node.previous, &new_line->Node ); 2821 2822 line = (Line_Control *) line->Node.next; 2823 new_section = TRUE; 2824 break; 2825 2826 case END_OBJECT: 2827 line->Contents[ 0 ] = '\0'; 2828 goto bottom; 2829 2830 case ATTRIBUTE: 2831 case ASSOCIATION: 2832 case ABSTRACT_TYPE: 2833 case DATA_ITEM: 2834 if ( !new_section ) { 2835 /* 2836 * Do something with the style to keep subsection 2837 * contents together 2838 */ 2839 ; 2840 } 2841 new_section = FALSE; 2842 sprintf( Buffer, "@Subsection = %s", line->Contents ); 2843 strcpy( line->Contents, Buffer ); 2844 line = (Line_Control *) line->Node.next; 2845 break; 2846 2847 case METHOD: 2848 case TASK: 2849 if ( !new_section ) { 2850 new_line = AllocateLine(); 2851 strcpy( new_line->Contents, "@Page" ); 2852 _Chain_Insert( line->Node.previous, &new_line->Node ); 2853 } 2854 new_section = FALSE; 2855 sprintf( Buffer, "@Subsection = %s", line->Contents ); 2856 strcpy( line->Contents, Buffer ); 2857 line = (Line_Control *) line->Node.next; 2858 break; 2859 2860 case DESCRIPTION: 2861 case COPYRIGHT: 2862 case PORTING: 2863 case THEORY_OF_OPERATION: 2864 case DEPENDENCIES: 2865 case NOTES: 2866 sprintf( Buffer, "@Subheading = %s\n", line->Contents ); 2867 strcpy( line->Contents, Buffer ); 2868 line = (Line_Control *) line->Node.next; 2869 2870 /* now take care of the paragraphs which are here */ 2871 2872 in_bullets = FALSE; 2873 do { 2874 line = (Line_Control *) line->Node.next; 2875 if ( line->format == BULLET_OUTPUT ) { 2876 if ( !in_bullets ) { 2877 in_bullets = TRUE; 2878 2879 new_line = AllocateLine(); 2880 _Chain_Insert( line->Node.previous, &new_line->Node ); 2881 } 2882 sprintf( Buffer, "@Bullet = %s\n", line->Contents ); 2883 strcpy( line->Contents, Buffer ); 2884 } else if ( in_bullets ) { 2885 in_bullets = FALSE; 2886 2887 new_line = AllocateLine(); 2888 _Chain_Insert( line->Node.previous, &new_line->Node ); 2889 } else { 2890 new_line = AllocateLine(); 2891 _Chain_Insert( line->Node.previous, &new_line->Node ); 2892 } 2893 } while ( !line->keyword ); 2894 2895 break; 2896 2897 case DERIVATION: 2898 case TYPE: 2899 case RANGE: 2900 case UNITS: 2901 case SCALE_FACTOR: 2902 case TOLERANCE: 2903 case VISIBILITY: 2904 case ASSOCIATED_WITH: 2905 case MULTIPLICITY: 2906 case TIMING: 2907 sprintf( Buffer, "@Subheading = %s\n", line->Contents ); 2908 strcpy( line->Contents, Buffer ); 2909 line = (Line_Control *) line->Node.next; 2910 break; 2911 2912 case MEMBERS: 2913 case DEFAULT: 2914 case REQUIREMENTS: 2915 case REFERENCES: 2916 case INPUTS: 2917 case OUTPUTS: 2918 case PDL: 2919 case SYNCHRONIZATION: 2920 sprintf( Buffer, "@Subheading = %s\n", line->Contents ); 2921 strcpy( line->Contents, Buffer ); 2922 2923 /* now take care of the raw text which is here */ 2924 2925 line = (Line_Control *) line->Node.next; 2926 while ( !line->keyword ) { 2927 sprintf( Buffer, "@Example = %s\n", line->Contents ); 2928 strcpy( line->Contents, Buffer ); 2929 line = (Line_Control *) line->Node.next; 2930 } 2931 2932 /* at this point line points to the next keyword */ 2933 break; 2934 } 2935 } 2936 2937 bottom: 2938 } 2939 2940 /* 2755 2941 * PrintFile 2756 2942 */
Note: See TracChangeset
for help on using the changeset viewer.