The output engine will use lowercase for footnote markers.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
char *name;
suffix[0] = '_';
- if (!str_format_26adic (i + 1, &suffix[1], sizeof suffix - 1))
+ if (!str_format_26adic (i + 1, true, &suffix[1], sizeof suffix - 1))
NOT_REACHED ();
name = utf8_encoding_concat (root, suffix, dict->encoding, 64);
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
else
{
suffix[0] = '_';
- str_format_26adic (trial, &suffix[1], sizeof suffix - 1);
+ str_format_26adic (trial, true, &suffix[1], sizeof suffix - 1);
}
/* Set name. */
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
/* Converts NUMBER into a string in 26-adic notation in BUFFER,
- which has room for SIZE bytes. Returns true if successful,
- false if NUMBER, plus a trailing null, is too large to fit in
- the available space.
+ which has room for SIZE bytes. Uses uppercase if UPPERCASE is
+ true, otherwise lowercase, Returns true if successful, false
+ if NUMBER, plus a trailing null, is too large to fit in the
+ available space.
26-adic notation is "spreadsheet column numbering": 1 = A, 2 =
B, 3 = C, ... 26 = Z, 27 = AA, 28 = AB, 29 = AC, ...
For more information, see
http://en.wikipedia.org/wiki/Bijective_numeration. */
bool
-str_format_26adic (unsigned long int number, char buffer[], size_t size)
+str_format_26adic (unsigned long int number, bool uppercase,
+ char buffer[], size_t size)
{
+ const char *alphabet
+ = uppercase ? "ABCDEFGHIJKLMNOPQRSTUVWXYZ" : "abcdefghijklmnopqrstuvwxyz";
size_t length = 0;
while (number-- > 0)
{
if (length >= size)
goto overflow;
- buffer[length++] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[number % 26];
+ buffer[length++] = alphabet[number % 26];
number /= 26;
}
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void str_uppercase (char *);
void str_lowercase (char *);
-bool str_format_26adic (unsigned long int number, char buffer[], size_t);
+bool str_format_26adic (unsigned long int number, bool uppercase,
+ char buffer[], size_t);
void *mempset (void *, int, size_t);
\f
/* PSPP - a program for statistical analysis.
- Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
check_26adic (unsigned long int number, const char *expected_string)
{
char string[8];
- str_format_26adic (number, string, sizeof string);
+ str_format_26adic (number, true, string, sizeof string);
if (strcmp (string, expected_string))
{
printf ("base-26 of %lu: expected \"%s\", got \"%s\"\n",
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2012, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (*s == NULL)
{
*s = xmalloc (16);
- str_format_26adic (idx + 1, *s, 16);
+ str_format_26adic (idx + 1, true, *s, 16);
}
return *s;
}
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2012, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (*s == NULL)
{
*s = xmalloc (16);
- str_format_26adic (value + 1, *s, 16);
+ str_format_26adic (value + 1, true, *s, 16);
}
return *s;
}