#!/usr/local/bin/perl -i
# /******************************************************************-*-c-*-
#  * Myricom GM networking software and documentation                      *
#  * Copyright (c) 1999 by Myricom, Inc.                                   *
#  * All rights reserved.  See the file `COPYING' for copyright notice.    *
#  *************************************************************************/
# 
# /* author: glenn@myri.com */

$id = 1;
while (<>) {
  $result = s/LOG_DISPATCH\s+\(\d+/LOG_DISPATCH (0/g;
  if ($result) {
  }
  else {
    $result = s/DISPATCH\s+\(\d+/DISPATCH (${id}/g;
    if ($result) {
      $id = $id + 1;
    }
  }
  print;
}
