anchor.diff:  
           if options.get("singleton"):
               print >>f, "    r = export(\"%s\", 0);" % \
  -                    comp_name.replace("_", "-")
  +                    to_hal(comp_name)
           else:
               print >>f, "    for(i=0; i<count; i++) {"
               print >>f, "        char buf[HAL_NAME_LEN + 2];"
               print >>f, "        rtapi_snprintf(buf, HAL_NAME_LEN, " \
                                           "\"%s.%%d\", i);" % \
  -                                    comp_name.replace("_", "-")
  +                                    to_hal(comp_name)
               print >>f, "        r = export(buf, i);"
               print >>f, "        if(r != 0) break;"
               print >>f, "    }"
  
positive.code:     for name, type, dir in pins:
          print >>f, "    r = hal_pin_%s_newf(%s, &(inst->%s), comp_id," % (
              type, dirmap[dir], name)
          print >>f, "        \"%%s.%s\", prefix);" % (name.replace("_", "-"))
          print >>f, "    if(r != 0) return r;"
  
      for name, type, dir in params:
          print >>f, "    r = hal_param_%s_newf(%s, &(inst->%s), comp_id," % (
              type, dirmap[dir], name)
          print >>f, "        \"%%s.%s\", prefix);" % (name.replace("_", "-"))
          print >>f, "    if(r != 0) return r;"
  
      for name, fp in functions:
  
negative.code:         raise runtime.SyntaxError, "Duplicate option name %s" % name
      options[name] = value
  
  def to_hal(name):
      return name.replace("_", "-").rstrip("-")
  
  def prologue(f):
      print >> f, "/* Autogenerated by %s on %s -- do not edit */" % (
          sys.argv[0], time.asctime())
  