// addWindowsSyso adds the proper windows .syso if needed
546503
func (b *Bundler) addWindowsSyso(arch string) (err error) {
	if len(b.pathIconWindows) > 0 || len(b.pathManifest) > 0 {
		var p = filepath.Join(b.pathInput, "windows.syso")
		astilog.Debugf("Running rsrc for icon %s into %s", b.pathIconWindows, p)
		if err = rsrc.Embed(p, arch, b.pathManifest, b.pathIconWindows); err != nil {
			err = errors.Wrapf(err, "running rsrc for icon %s into %s failed", b.pathIconWindows, p)
			return
		}
	}
	return
}
669524
func (sb *storageBackend) addFilesystemOps(params FilesystemParams, hostId string) ([]txn.Op, names.FilesystemTag, names.VolumeTag, error) {
	var err error
	params, err = sb.filesystemParamsWithDefaults(params)
	if err != nil {
		return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Trace(err)
	}
	detachable, err := isDetachableFilesystemPool(sb, params.Pool)
	if err != nil {
		return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Trace(err)
	}
	origHostId := hostId
	hostId, err = sb.validateFilesystemParams(params, hostId)
	if err != nil {
		return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Annotate(err, "validating filesystem params")
	}

	filesystemId, err := newFilesystemId(sb.mb, hostId)
	if err != nil {
		return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Annotate(err, "cannot generate filesystem name")
	}
	filesystemTag := names.NewFilesystemTag(filesystemId)

	// Check if the filesystem needs a volume.
	var volumeId string
	var volumeTag names.VolumeTag
	var ops []txn.Op
	_, provider, _, err := poolStorageProvider(sb, params.Pool)
	if err != nil {
		return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Trace(err)
	}
	if !provider.Supports(storage.StorageKindFilesystem) {
		var volumeOps []txn.Op
		if params.volumeInfo != nil {
			// The filesystem ID for volume-backed filesystems
			// is the string representation of the filesystem tag.
			params.filesystemId = filesystemTag.String()
		}
		volumeParams := VolumeParams{
			params.storage,
			params.volumeInfo,
			params.Pool,
			params.Size,
		}
		volumeOps, volumeTag, err = sb.addVolumeOps(volumeParams, hostId)
		if err != nil {
			return nil, names.FilesystemTag{}, names.VolumeTag{}, errors.Annotate(err, "creating backing volume")
		}
		volumeId = volumeTag.Id()
		ops = append(ops, volumeOps...)
	}

	statusDoc := statusDoc{
		Status:  status.Pending,
		Updated: sb.mb.clock().Now().UnixNano(),
	}
	doc := filesystemDoc{
		FilesystemId: filesystemId,
		VolumeId:     volumeId,
		StorageId:    params.storage.Id(),
	}
	if params.filesystemId != "" {
		// We're importing an already provisioned filesystem into the
		// model. Set provisioned info rather than params, and set the
		// status to "detached".
		statusDoc.Status = status.Detached
		doc.Info = &FilesystemInfo{
			Size:         params.Size,
			Pool:         params.Pool,
			FilesystemId: params.filesystemId,
		}
	} else {
		// Every new filesystem is created with one attachment.
		doc.Params = &params
		doc.AttachmentCount = 1
	}
	if !detachable {
		doc.HostId = origHostId
	}
	ops = append(ops, sb.newFilesystemOps(doc, statusDoc)...)
	return ops, filesystemTag, volumeTag, nil
}
808998
func (s *Storage) AddIosSuccess(count int64) {
	total := s.GetIosSuccess() + count
	redisClient.Set(storage.IosSuccessKey, strconv.Itoa(int(total)), 0)
}
491298
func CreateWindow(title string, x, y, w, h int32, flags uint32) (*Window, error) {
	var _window = C.SDL_CreateWindow(C.CString(title), C.int(x), C.int(y), C.int(w), C.int(h), C.Uint32(flags))
	if _window == nil {
		return nil, GetError()
	}
	return (*Window)(unsafe.Pointer(_window)), nil
}
177601
func (c *Context) addNameSystems(namers namer.NameSystems) *Context {
	if namers == nil {
		return c
	}
	c2 := *c
	// Copy the existing name systems so we don't corrupt a parent context
	c2.Namers = namer.NameSystems{}
	for k, v := range c.Namers {
		c2.Namers[k] = v
	}

	for name, namer := range namers {
		c2.Namers[name] = namer
	}
	return &c2
}
362329
func WithWindowNetworksAllowUnqualifiedDNSQuery() SpecOpts {
	return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
		if s.Windows == nil {
			s.Windows = &specs.Windows{}
		}
		if s.Windows.Network == nil {
			s.Windows.Network = &specs.WindowsNetwork{}
		}

		s.Windows.Network.AllowUnqualifiedDNSQuery = true
		return nil
	}
}
1200694
func (s *CreateFileSystemFromBackupInput) SetWindowsConfiguration(v *CreateFileSystemWindowsConfiguration) *CreateFileSystemFromBackupInput {
	s.WindowsConfiguration = v
	return s
}
241419
func (s *StanServer) addSubscription(ss *subStore, sub *subState) error {
	// Store in client
	if !s.clients.addSub(sub.ClientID, sub) {
		return fmt.Errorf("can't find clientID: %v", sub.ClientID)
	}
	// Store this subscription in subStore
	if err := ss.Store(sub); err != nil {
		s.clients.removeSub(sub.ClientID, sub)
		return err
	}
	return nil
}
1340156
func (t *Template) GetAllAWSSSMMaintenanceWindowResources() map[string]*resources.AWSSSMMaintenanceWindow {
	results := map[string]*resources.AWSSSMMaintenanceWindow{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSSSMMaintenanceWindow:
			results[name] = resource
		}
	}
	return results
}
802763
func ServerPublicArchiveWindows(client APIClient, os ostype.ArchiveOSTypes, name string) PublicArchiveWindowsServerBuilder {
	b := newServerBuilder(client, name)
	b.hasCommonProperty = true
	b.hasNetworkInterfaceProperty = true
	b.hasDiskProperty = true
	b.hasDiskSourceProperty = true
	b.hasServerEventProperty = true
	b.hasDiskEventProperty = true
	b.hasAdditionalDiskProperty = true

	b.serverPublicArchiveWindows(os)
	return b
}
1227205
func goWindowPosCB(window unsafe.Pointer, xpos, ypos C.int) {
	w := windows.get((*C.GLFWwindow)(window))
	w.fPosHolder(w, int(xpos), int(ypos))
}
1181180
func (t *partitionTracker) AddSeriesCreated(n uint64, d time.Duration) {
	if !t.enabled {
		return
	}

	labels := t.Labels()
	t.metrics.SeriesCreated.With(labels).Add(float64(n))

	if n == 0 {
		return // Nothing to record
	}

	perseries := d.Seconds() / float64(n)
	t.metrics.SeriesCreatedDuration.With(labels).Observe(perseries)
}
789450
func (em *EventManager) AddEvents(ems ...EventSubs) {
	for _, eo := range ems {
		em.AddEvent(eo)
	}
}
1234418
func (m *subMenu) PopupInWindow(w *Window, o *MenuPopupOptions) (err error) {
	if err = m.isActionable(); err != nil {
		return
	}
	var e = Event{Name: EventNameSubMenuCmdPopup, TargetID: m.id, MenuPopupOptions: o}
	if w != nil {
		e.WindowID = w.id
	}
	_, err = synchronousEvent(m.c, m, m.w, e, EventNameSubMenuEventPoppedUp)
	return
}
805392
func PutWS(ws *websocket.Conn) {
	msg := wsmessage{
		Command: PUT,
		WS:      ws}
	wschannel <- msg

}
505483
func (c *MenuOption) AddToSubMenu(sub *MenuOption) {
	c.subMenu = append(c.subMenu, *sub)
}
55400
func (w *Watchdog) AddService(name, binary string) (*Service, error) {
	if _, ok := w.services[name]; ok {
		return nil, fmt.Errorf("Service %q already exists", name)
	}

	svc := newService(name, binary)
	w.services[name] = svc

	return svc, nil
}