// newPstring create a new pstring
345762
func newPstring(s string) *pstring {
	length := len(s)
	p := pstring{int8(length), s}
	return &p
}
992152
func ToString(p Plan) string {
	strs, _ := toString(p, []string{}, []int{})
	return strings.Join(strs, "->")
}
691398
func NewStringPtr(val string) *string {
	ptrValue := new(string)
	*ptrValue = val
	return ptrValue
}
619398
func NewReferenceFromStrings(name, target string) *Reference {
	n := ReferenceName(name)

	if strings.HasPrefix(target, symrefPrefix) {
		target := ReferenceName(target[len(symrefPrefix):])
		return NewSymbolicReference(n, target)
	}

	return NewHashReference(n, NewHash(target))
}
137411
func NewMfType(s string) (mfType, error) {
	var e mfType
	err := e.FromString(s)
	if err != nil {
		return 0, err
	}
	return e, nil
}
565374
func NewPropArg(genResult *GenResult, shrinks int, value, origValue interface{}) *PropArg {
	return &PropArg{
		Label:   strings.Join(genResult.Labels, ", "),
		Arg:     value,
		OrigArg: origValue,
		Shrinks: shrinks,
	}
}
1265411
func NewString(val string, p *string) *String {
	*p = val
	return (*String)(p)
}
374148
func NewPubring(sec *Secring) *Pubring {
	return &Pubring{
		data: &xcpb.Pubring{
			PublicKeys: make([]*xcpb.PublicKey, 0, 10),
		},
		secring: sec,
	}
}
1140852
func NewCIMDString(typ Type, version uint32, data string) string {
	return fmt.Sprintf("%s:%s:v=%d:%s", Scheme, typ, version, data)
}
215109
func (p *RecordDefn) SexpString(ps *PrintState) string {
	Q("RecordDefn::SexpString() called!")
	if len(p.Fields) == 0 {
		return fmt.Sprintf("(struct %s)", p.Name)
	}
	s := fmt.Sprintf("(struct %s [\n", p.Name)

	w := make([][]int, len(p.Fields))
	maxnfield := 0
	for i, f := range p.Fields {
		w[i] = f.FieldWidths()
		Q("w[i=%v] = %v", i, w[i])
		maxnfield = maxi(maxnfield, len(w[i]))
	}

	biggestCol := make([]int, maxnfield)
	Q("\n")
	for j := 0; j < maxnfield; j++ {
		for i := range p.Fields {
			Q("i= %v, j=%v, len(w[i])=%v  check=%v", i, j, len(w[i]), len(w[i]) < j)
			if j < len(w[i]) {
				biggestCol[j] = maxi(biggestCol[j], w[i][j]+1)
			}
		}
	}
	Q("RecordDefn::SexpString(): maxnfield = %v, out of %v", maxnfield, len(p.Fields))
	Q("RecordDefn::SexpString(): biggestCol =  %#v", biggestCol)

	// computing padding
	// x
	// xx xx
	// xxxxxxx x
	// xxx x x x
	//
	// becomes
	//
	// x
	// xx      xx
	// xxxxxxx
	// xxx     x  x x
	Q("pad = %#v", biggestCol)
	for _, f := range p.Fields {
		s += " " + f.AlignString(biggestCol) + "\n"
	}
	s += " ])\n"
	return s
}
664015
func NewDateString(dateRe, layout string) DateString {
	return DateString{regexp.MustCompile(dateRe), layout}
}
1206197
func NewFromString(encoded string) (*Value, error) {
	out, err := base64.RawURLEncoding.DecodeString(encoded)
	if err != nil {
		return nil, err
	}

	return New(out), nil
}
917059
func New() *Pget {
	return &Pget{
		Trace:   false,
		Utils:   &Data{},
		Procs:   runtime.NumCPU(), // default
		timeout: 10,
	}
}
410521
func (i *identifier) new() string {
	i.m.Lock()
	defer i.m.Unlock()
	i.i++
	return strconv.Itoa(i.i)
}
822571
func NewPing(TIME_USEC uint64, SEQ uint32, TARGET_SYSTEM uint8, TARGET_COMPONENT uint8) *Ping {
	m := Ping{}
	m.TIME_USEC = TIME_USEC
	m.SEQ = SEQ
	m.TARGET_SYSTEM = TARGET_SYSTEM
	m.TARGET_COMPONENT = TARGET_COMPONENT
	return &m
}
896342
func (m *Module) New(state string) (string, error) {
	b, err := json.Marshal(&csrfPayload{
		State:       state,
		Token:       token.New32(),
		ExpireAfter: time.Now().Add(m.csrfValidityDuration),
	})
	if err != nil {
		return "", err
	}

	obj, err := m.encrypter.Encrypt(b)
	if err != nil {
		return "", err
	}

	msg, err := obj.CompactSerialize()
	if err != nil {
		return "", err
	}

	return msg, nil
}
693829
func (f *Fpdf) LinkString(x, y, w, h float64, linkStr string) {
	f.newLink(x, y, w, h, 0, linkStr)
}