File: mgdiff.cat

package info (click to toggle)
mgdiff 1.0-29.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 416 kB
  • ctags: 923
  • sloc: ansic: 3,764; makefile: 1,142; awk: 477; sh: 306
file content (660 lines) | stat: -rw-r--r-- 23,803 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660



MGDIFF(1)                                               MGDIFF(1)


NNAAMMEE
       mgdiff - Motif-based graphical file difference browser

SSYYNNOOPPSSIISS
       mgdiff [-toolkitoption ...] [-quit] [-file _n_a_m_e] [-args
       _d_i_f_f_a_r_g_s] [file1 file2]

DDEESSCCRRIIPPTTIIOONN
       _M_g_d_i_f_f is a graphical front end to the _d_i_f_f command.  It
       permits the user to view the differences between two ASCII
       files in context and, optionally, to write out a third
       file which is the user-defined merging of those two files.
       It is inspired by a similar program, called _g_d_i_f_f_, which
       runs only on Silicon Graphics workstations and for which
       source code is not provided.

       The program takes as arguments various flags (described in
       the next section) and the names of two files to compare.
       Either filename (but not both) may be given as '-' to use
       standard input instead.

       The resulting display consists mostly of two panes of
       text; the one on the left is the first file specified and
       the one on the right is the second file specified.
       Between and below the text panes are scrollbars that per-
       mit changing the visible portions of the two files being
       compared.  In addition, the program implements the
       Scrolled Region recommendations of Section 2.3.4 of the
       OSF/Motif Style Guide (release 1.1), meaning that the
       arrow and paging keys will work to scroll as well.  Above
       each text pane is the name of the file in that text pane
       and the line number in the file which is being displayed.

       The text in each of the text panes is divided into blocks
       of lines which are color-coded with one of five different
       colors.  This indicates that the block:

              differs between the two files

              is identical between the two files

              has been inserted in one file or the other

              is for display purposes (to match an inserted block
              in the other file)

              has been selected by the user (for writing to a
              merged file)

       These colors can be modified by the user via X resources;
       see the RESOURCES section of this manual page.  A legend
       display of the colors and their meanings is available
       using the Help menu.




                                                                1





MGDIFF(1)                                               MGDIFF(1)


       On the right-hand side of the display is an overview area;
       this shows the files in their entirety.  The sliders in
       the overview area track the lines being displayed in the
       text panes.

       At the top of the display is a Motif menu bar; those func-
       tions are discussed in the MENUS section of this manual
       page.


CCOOMMMMAANNDD LLIINNEE OOPPTTIIOONNSS
       --ttoooollkkiittooppttiioonn
               These are the standard options accepted by all
               applications that use the X Toolkit Intrinsics.
               See the OPTIONS section in the XX(1) manual page.

       --qquuiitt   This option sets the resource _M_g_d_i_f_f_._q_u_i_t_I_f_S_a_m_e to
               "true".  This will cause the program to exit imme-
               diately without bringing up a window if the two
               files have no differences (as determined by the
               _d_i_f_f command).

       --aarrggss _d_i_f_f_a_r_g_s
               This option sets the resource _M_g_d_i_f_f_._d_i_f_f_A_r_g_s to
               the value of the _d_i_f_f_a_r_g_s argument.  These flags
               are passed to the _d_i_f_f command that actually com-
               putes the differences between the two files.
               Since any argument can be passed, it is possible
               to specify flags that cause the _d_i_f_f command to
               fail or to generate output in a different format
               that will cause _m_g_d_i_f_f to fail.  For most versions
               of _d_i_f_f_, only three flags make any sense.  The
               first is '-b'; this causes _d_i_f_f to ignore trailing
               blanks (spaces and tabs) and to treat all other
               strings of blanks as equivalent.  The second flag
               is '-w'; this ignores blanks and treats strings of
               blanks as equivalent.  The last flag is '-i'; this
               ignores case when comparing letters.

       --ffiillee _n_a_m_e
               This command sets the resource _M_g_d_i_f_f_._f_i_l_e_n_a_m_e to
               the value of the _n_a_m_e argument.  _m_g_d_i_f_f uses this
               string to display over a file read from standard
               input.

MMEENNUUSS
       The menubar contains the following menu topics as Cascade-
       Buttons: FFiillee, VViieeww, SSeelleecctt, OOppttiioonnss and HHeellpp.  The rest
       of this section discusses each menu entry, showing it's
       name and accelerator, if any.


       FFiillee




                                                                2





MGDIFF(1)                                               MGDIFF(1)


       This pulldown menu controls file access:

              OOppeenn......                       CCttrrll++OO

              Brings up the "Open Files" FileSelectionDialog to
              allow the user to open two files for comparison.

              OOppeenn LLeefftt......                  CCttrrll++LL

              Brings up the "Open File" FileSelectionDialog to
              allow the user to specify a file to open and com-
              pare with the already opened right-hand file.

              OOppeenn RRiigghhtt......                 CCttrrll++RR

              Brings up the "Open File" FileSelectionDialog to
              allow the user to specify a file to open and com-
              pare with the already opened left-hand file.

              SSaavvee AAss......                    CCttrrll++SS

              Brings up the "Save File" FileSelectionDialog to
              allow the user to specify an output file for writ-
              ing the merged file; this is an application modal
              dialog.  The program will allow the user to over-
              write an existing file but pops up a QuestionDialog
              to allow the user to cancel the operation if
              desired.  If there are any unselected areas of dif-
              ference between the two files the user is notified
              via an ErrorDialog and the save operation is can-
              celed.

              EExxiitt                          CCttrrll++CC

              Exits the program immediately.


       VViieeww

       This pulldown menu contains commands for moving through
       the files.

              PPrreevviioouuss                      CCttrrll++PP

              Scrolls both file views so that the previous area
              of difference is _M_g_d_i_f_f_._l_i_n_e_s_O_f_C_o_n_t_e_x_t lines from
              the top of the application window.

              NNeexxtt                          CCttrrll++NN

              Scrolls both file views so that the next area of
              difference is _M_g_d_i_f_f_._l_i_n_e_s_O_f_C_o_n_t_e_x_t lines from the
              top of the application window.




                                                                3





MGDIFF(1)                                               MGDIFF(1)


              NNeexxtt UUnnsseelleecctteedd               CCttrrll++UU

              Scrolls both file views so that the next unselected
              area of difference is _M_g_d_i_f_f_._l_i_n_e_s_O_f_C_o_n_t_e_x_t lines
              from the top of the application window.


       SSeelleecctt

       The two files being compared can be optionally merged into
       one file.  To do this, the user must select for each area
       of difference between the two files which version should
       be written to the merged file.  The menu entries in this
       pulldown menu allow the user to select or unselect differ-
       ences in groups rather than individually.

              LLeefftt AAllll

              For all areas of difference between the two files
              select the left-hand file version.

              RRiigghhtt AAllll

              For all areas of difference between the two files
              select the right-hand file version.

              UUnnsseelleecctt AAllll

              Unselects all areas of difference in both files.


       OOppttiioonnss

       This pulldown menu controls miscellaneous appearance
       and/or behavior options.

              OOvveerrvviieeww                      CCttrrll++WW

              This menu entry toggles the presence of the
              overview area on the right-hand side of the appli-
              cation window.  The default value for this toggle
              is controlled by a resource, _M_g_d_i_f_f_._o_v_e_r_v_i_e_w, which
              is described in the RESOURCES section.

              HHoorriizzoonnttaall SSccrroollllbbaarr          CCttrrll++HH

              This menu entry toggles the presence of the hori-
              zontal scrollbar at the bottom of the application
              window.  The default value for this toggle is con-
              trolled by a resource, _M_g_d_i_f_f_._h_o_r_z_S_c_r_o_l_l_b_a_r, which
              is described in the RESOURCES section.

              DDrraagg SSccrroollll                   CCttrrll++DD




                                                                4





MGDIFF(1)                                               MGDIFF(1)


              This menu entry toggles the behaviour of the
              scrollbars in the application window.  When set,
              dragging the slider of a scrollbar results in a
              immediate change in the view of the text being com-
              pared.  When unset, the view is only changed at the
              end of a slider drag (when the mouse button is
              released.)  This setting might be preferred on a
              slower X server.  The default value for this toggle
              is controlled by a resource, _M_g_d_i_f_f_._d_r_a_g_S_c_r_o_l_l,
              which is described in the RESOURCES section.


       HHeellpp

       This pulldown menu displays commands for obtaining help on
       or information about _m_g_d_i_f_f.

              VVeerrssiioonn......                    CCttrrll++VV

              Brings up an InformationDialog with author and ver-
              sion information.

              MMaannuuaall PPaaggee......                CCttrrll++MM

              Brings up a DialogShell with a ScrolledText widget
              containing this manual page.  The command for gen-
              erating this is customizable via a resource,
              _M_g_d_i_f_f_._m_a_n_C_o_m_m_a_n_d, which is described in the
              RESOURCES section.

              CCoolloorr LLeeggeenndd......               CCttrrll++GG

              Brings up a DialogShell which summarizes the use of
              color in encoding the types of differences between
              the two files being compared.


OOTTHHEERR DDIISSPPLLAAYYSS//CCOONNTTRROOLLSS
       You can move directly to a particular spot in the two
       files by using BBDDrraagg in the overview area.

       The program uses what the OSF/Motif Style Guide calls
       "multiple selection" to select individual blocks for writ-
       ing to a merged file.  Clicking BBSSeelleecctt on an unselected
       block adds it to the list of selected blocks.  Clicking
       BBSSeelleecctt on a selected block removes it from the list of
       selected blocks.  In addition, Clicking BBSSeelleecctt on an uns-
       elected block which is opposite a selected block (in the
       other text panes) removes the selected block from the list
       of selected blocks.

       The numbers in the small boxes next to the file names are
       the line numbers of the lines at the top of the text
       panes.



                                                                5





MGDIFF(1)                                               MGDIFF(1)


WWIIDDGGEETTSS
       What follows is the hierarchy of Motif widgets, as gener-
       ated by eeddiittrreess(1).  The hierarchical structure of the
       widget tree is reflected in the indentation.  Each line
       consists of the widget class name followed by the widget
       instance name.  This information might be useful if you
       wish to customize the appearance of the program via
       resource settings.

       Mgdiff  mgdiff
            XmMainWindow  mainw
                 XmSeparatorGadget  MainWinSep1
                 XmSeparatorGadget  MainWinSep2
                 XmSeparatorGadget  MainWinSep3
                 XmRowColumn  menubar
                      XmCascadeButtonGadget  button_0
                      XmCascadeButtonGadget  button_1
                      XmCascadeButtonGadget  button_2
                      XmCascadeButtonGadget  button_3
                      XmCascadeButtonGadget  button_4
                      XmMenuShell  popup_file_menu
                           XmRowColumn  select_menu
                                XmPushButtonGadget  button_0
                                XmPushButtonGadget  button_1
                                XmSeparatorGadget  separator_0
                                XmPushButtonGadget  button_2
                           XmRowColumn  file_menu
                                XmPushButtonGadget  button_0
                                XmPushButtonGadget  button_1
                                XmPushButtonGadget  button_2
                                XmPushButtonGadget  button_3
                                XmSeparatorGadget  separator_0
                                XmPushButtonGadget  button_4
                           XmRowColumn  options_menu
                                XmToggleButtonGadget  button_0
                                XmToggleButtonGadget  button_1
                                XmToggleButtonGadget  button_2
                           XmRowColumn  help_menu
                                XmPushButtonGadget  button_0
                                XmPushButtonGadget  button_1
                                XmPushButtonGadget  button_2
                           XmRowColumn  view_menu
                                XmPushButtonGadget  button_0
                                XmPushButtonGadget  button_1
                                XmPushButtonGadget  button_2
                 XmForm  form1
                      XmFrame  frame1
                           XmForm  form3
                                XmScrollBar  sbl
                                XmDrawingArea  dam
                                XmScrollBar  sbr
                      XmFrame  frame2
                           XmForm  form4
                                XmForm  form2



                                                                6





MGDIFF(1)                                               MGDIFF(1)


                                     XmScrollBar  sb
                                     XmForm  form21
                                          XmFrame  frame3
                                               XmLabel  fnamel
                                          XmFrame  frame31
                                               XmTextField  linenuml
                                     XmForm  form22
                                          XmFrame  frame4
                                               XmLabel  fnamer
                                          XmFrame  frame41
                                               XmTextField  linenumr
                                     XmDrawingArea  textl
                                     XmDrawingArea  textr
                                XmScrollBar  sbh
            XmDialogShell  version_popup
                 XmMessageBox  version
                      XmLabelGadget  symbol
                      XmLabelGadget
                      XmSeparatorGadget  separator
                      XmPushButtonGadget  OK
                      XmPushButtonGadget  Cancel
                      XmPushButtonGadget  Help
            XmDialogShell  manualpage_popup
                 XmForm  manualpage
                      XmPanedWindow  pane
                           XmScrolledWindow  help_textSW
                                XmScrollBar  vbar
                                XmText  help_text
                           XmForm  form2a
                                XmPushButton  OK
                           XmSash  sash
                           XmSeparatorGadget  separator
                           XmSash  sash
                           XmSeparatorGadget  separator
            XmDialogShell  legend_popup
                 XmForm  legend
                      XmPanedWindow  pane
                           XmRowColumn  rc
                                XmLabel  label1
                                XmLabel  label2
                                XmLabel  label3
                                XmLabel  label4
                                XmLabel  label5
                           XmForm  form2a
                                XmPushButton  OK
                           XmSash  sash
                           XmSeparatorGadget  separator
                           XmSash  sash
                           XmSeparatorGadget  separator
            XmDialogShell  werror_popup
                 XmMessageBox  werror
                      XmLabelGadget  symbol
                      XmLabelGadget
                      XmSeparatorGadget  separator



                                                                7





MGDIFF(1)                                               MGDIFF(1)


                      XmPushButtonGadget  OK
                      XmPushButtonGadget  Cancel
                      XmPushButtonGadget  Help


XX RREESSOOUURRCCEESS
       MMggddiiffff..ddiiffffFFoorreeggrroouunndd::   bbllaacckk

       MMggddiiffff..ddiiffffBBaacckkggrroouunndd::   yyeellllooww

       These colors are for blocks which differ between files.


       MMggddiiffff..ssaammeeFFoorreeggrroouunndd::   bbllaacckk

       MMggddiiffff..ssaammeeBBaacckkggrroouunndd::   ggrreeyy

       These colors are for blocks which are identical between
       files.


       MMggddiiffff..iinnsseerrttFFoorreeggrroouunndd:: bbllaacckk

       MMggddiiffff..iinnsseerrttBBaacckkggrroouunndd:: oorraannggee

       These colors are for blocks which have been inserted in
       one file.


       MMggddiiffff..bbllaannkkFFoorreeggrroouunndd::  bbllaacckk

       MMggddiiffff..bbllaannkkBBaacckkggrroouunndd::  ggrreeyy6666

       These colors are for blocks which are for display pur-
       poses.


       MMggddiiffff..sseelleeccttFFoorreeggrroouunndd:: bbllaacckk

       MMggddiiffff..sseelleeccttBBaacckkggrroouunndd:: lliigghhtt ssllaattee bblluuee

       These colors are for blocks which have been selected by
       the user.


       MMggddiiffff..ffoonntt::             77xx1133bboolldd

       Font for displaying text blocks.


       MMggddiiffff..ddrraaggSSccrroollll::       ttrruuee

       Set to true if scrollbar dragging should cause immediate
       changes in the viewed text, and false if the view should



                                                                8





MGDIFF(1)                                               MGDIFF(1)


       only change after the scrollbar has been moved.


       MMggddiiffff..oovveerrvviieeww::         ttrruuee

       Set to true if the file overview section should appear.


       MMggddiiffff..hhoorrzzSSccrroollllbbaarr::    ttrruuee

       Set to true if the horizontal scrollbar should appear.


       MMggddiiffff..lliinneessOOffCCoonntteexxtt::   33

       Number of lines that should appear above a difference
       block gotten to using the Previous or Next commands.
       Should be greater or equal to zero.


       MMggddiiffff..mmaannCCoommmmaanndd::       ((mmaann mmggddiiffff || ccooll --bb)) 22>>&&11

       The command (or pipeline) used to produce a formatted man-
       ual page without escape codes.


       MMggddiiffff..ddiiffffCCoommmmaanndd::      ddiiffff

       The ddiiffff(1) compatible command to use for calculating dif-
       ferences between text files.


       MMggddiiffff..ddiiffffAArrggss::

       The arguments to be provided to the _d_i_f_f command.  This
       resource can also be set via the _-_a_r_g_s command line
       option.


       MMggddiiffff..qquuiittIIffSSaammee::       ffaallssee

       If the two files have no differences (as determined by the
       _d_i_f_f command) then exit immediately without bringing up a
       window.  This resource can also be set to "true" via the
       _-_q_u_i_t command line option.


       MMggddiiffff..ffiilleennaammee::         ((ssttddiinn))

       _m_g_d_i_f_f uses this string to display over a file read from
       standard input.  This resource can also be set via the
       _-_f_i_l_e command line option.





                                                                9





MGDIFF(1)                                               MGDIFF(1)


DDIIAAGGNNOOSSTTIICCSS
       Returns the exit status generated by the _d_i_f_f command.
       This is usually 0 for no differences, 1 for some differ-
       ences and 2 for errors.

SSEEEE AALLSSOO
       ddiiffff(1), XX(1)

RREESSTTRRIICCTTIIOONNSS
       Using BBDDrraagg in the overview area doesn't work well when
       drag scrolling is turned off.

       Doesn't support monochrome displays.

       Input lines longer than BUFSIZ (see /usr/include/stdio.h)
       are silently truncated.

       The code for parsing and passing arguments to the _d_i_f_f
       command assumes arguments are delimited by white space and
       does not do any quote processing.

CCOOPPYYRRIIGGHHTT
       Copyright (c) 1994, Daniel Williams
       See XX ((11)) for a full statement of rights and permissions.

AAUUTTHHOORR
       Daniel Williams (dan@sass.com)

AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS
       To Andrew C. Myers for writing _g_d_i_f_f_.



























                                                               10